@classmethod
def _register_attributes(cls):
- ip4 = Attribute("ip4", "IPv4 Address",
+ endpoint_ip = Attribute("endpoint_ip", "IPv4 Address",
flags = Flags.Design)
mac = Attribute("mac", "MAC Address",
flags = Flags.Design)
- prefix4 = Attribute("prefix4", "IPv4 network prefix",
+ endpoint_prefix = Attribute("endpoint_prefix", "IPv4 network prefix",
type = Types.Integer,
flags = Flags.Design)
"Bash script to be executed before releasing the resource",
flags = Flags.Design)
- cls._register_attribute(ip4)
+ cls._register_attribute(endpoint_ip)
cls._register_attribute(mac)
- cls._register_attribute(prefix4)
+ cls._register_attribute(endpoint_prefix)
cls._register_attribute(mtu)
cls._register_attribute(devname)
cls._register_attribute(up)
cipher, cipher_key, bwlimit, txqueuelen):
# Set the remote endpoint
- self.set("pointopoint", remote_endpoint.get("ip4"))
+ self.set("pointopoint", remote_endpoint.get("endpoint_ip"))
# Planetlab TAPs always use PI headers
from nepi.resources.planetlab.tap import PlanetlabTap
def _gre_connect_command(self, remote_endpoint, connection_run_home):
# Set the remote endpoint
- self.set("pointopoint", remote_endpoint.get("ip4"))
+ self.set("pointopoint", remote_endpoint.get("endpoint_ip"))
self.set("greRemote", remote_endpoint.node.get("ip"))
# Generate GRE connect command
"pi" if self.get("pi") else ""))
start_command.append("sudo -S ip link set %s up" % self.get("deviceName"))
start_command.append("sudo -S ip addr add %s/%d dev %s" % (
- self.get("ip4"),
- self.get("prefix4"),
+ self.get("endpoint_ip"),
+ self.get("endpoint_prefix"),
self.get("deviceName"),
))
self.get("greKey")
))
command.append("sudo -S ip addr add %s/%d peer %s/%d dev %s" % (
- self.get("ip4"),
- self.get("prefix4"),
+ self.get("endpoint_ip"),
+ self.get("endpoint_prefix"),
self.get("pointopoint"),
- self.get("prefix4"),
+ self.get("endpoint_prefix"),
self.get("deviceName"),
))
command.append("sudo -S ip link set %s up " % self.get("deviceName"))