X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Flinux%2Ftap.py;h=91640dff1d0421a86bed7f560ccedc0029d74ca0;hb=38575a0f27f26511965771dde8320060b10252dd;hp=6b3dce6afcbc5f5ff32f5a84d0be9394dfa324f3;hpb=98f05568cf4474005a22f09f5377556c3974c71e;p=nepi.git diff --git a/src/nepi/resources/linux/tap.py b/src/nepi/resources/linux/tap.py index 6b3dce6a..91640dff 100644 --- a/src/nepi/resources/linux/tap.py +++ b/src/nepi/resources/linux/tap.py @@ -37,13 +37,13 @@ class LinuxTap(LinuxApplication): @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) @@ -83,9 +83,9 @@ class LinuxTap(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) @@ -326,7 +326,7 @@ class LinuxTap(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")) # Planetlab TAPs always use PI headers from nepi.resources.planetlab.tap import PlanetlabTap @@ -382,7 +382,7 @@ class LinuxTap(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 @@ -411,8 +411,8 @@ class LinuxTap(LinuxApplication): "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"), )) @@ -445,10 +445,10 @@ class LinuxTap(LinuxApplication): 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"))