X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fplanetlab%2Ftap.py;h=5a47663cf2b7c13b109dce252af82ffa339ec71f;hb=38575a0f27f26511965771dde8320060b10252dd;hp=49ec41f3b0aea497632778769c483fec93c1d45a;hpb=98f05568cf4474005a22f09f5377556c3974c71e;p=nepi.git diff --git a/src/nepi/resources/planetlab/tap.py b/src/nepi/resources/planetlab/tap.py index 49ec41f3..5a47663c 100644 --- a/src/nepi/resources/planetlab/tap.py +++ b/src/nepi/resources/planetlab/tap.py @@ -37,13 +37,15 @@ class PlanetlabTap(LinuxApplication): @classmethod def _register_attributes(cls): - ip4 = Attribute("ip4", "IPv4 Address", + endpoint_ip = Attribute("endpoint_ip", "IP of the endpoint. This is the attribute " + "you should use to establish a tunnel or a remote " + "connection between endpoint", 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 of the endpoint", type = Types.Integer, flags = Flags.Design) @@ -83,9 +85,9 @@ class PlanetlabTap(LinuxApplication): "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) @@ -383,7 +385,7 @@ class PlanetlabTap(LinuxApplication): cipher, cipher_key, bwlimit, txqueuelen): # Set the remote endpoint - self.set("pointopoint", remote_endpoint.get("ip4")) + self.set("pointopoint", remote_endpoint.get("endpoint_ip")) remote_ip = remote_endpoint.node.get("ip") @@ -432,7 +434,7 @@ class PlanetlabTap(LinuxApplication): 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 @@ -462,8 +464,8 @@ class PlanetlabTap(LinuxApplication): command = ["sudo -S python ${SRC}/pl-vif-create.py"] command.append("-t %s" % self.vif_type) - command.append("-a %s" % self.get("ip4")) - command.append("-n %d" % self.get("prefix4")) + command.append("-a %s" % self.get("endpoint_ip")) + command.append("-n %d" % self.get("endpoint_prefix")) command.append("-f %s " % self.vif_name_file) command.append("-S %s " % self.sock_name) @@ -505,8 +507,8 @@ class PlanetlabTap(LinuxApplication): command.append("-u %s" % self.node.get("username")) command.append("-N %s" % device_name) command.append("-t %s" % self.vif_type) - command.append("-a %s" % self.get("ip4")) - command.append("-n %d" % self.get("prefix4")) + command.append("-a %s" % self.get("endpoint_ip")) + command.append("-n %d" % self.get("endpoint_prefix")) if self.get("snat") == True: command.append("-s")