Change the name of ip4 and prefix4 into endpoint_ip and endpoint_prefix
[nepi.git] / src / nepi / resources / planetlab / tap.py
index 49ec41f..5a47663 100644 (file)
@@ -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")