- def udp_connect_command(self, remote_ip, local_port_file,
- remote_port_file, ret_file, cipher, cipher_key,
- bwlimit, txqueuelen):
- command = ["sudo -S "]
+ def udp_connect_command(self, remote_endpoint, connection_run_home,
+ cipher, cipher_key, bwlimit, txqueuelen):
+
+ # Generate UDP connect command
+ remote_ip = socket.gethostbyname(
+ remote_endpoint.node.get("hostname"))
+
+ local_port_file = os.path.join(connection_run_home,
+ "local_port")
+
+ remote_port_file = os.path.join(connection_run_home,
+ "remote_port")
+
+ ret_file = os.path.join(connection_run_home,
+ "ret_file")
+
+ # Use pl-vif-up.py script to configure TAP with peer info
+ command = ["( sudo -S "]
+ command.append("PYTHONPATH=$PYTHONPATH:${SRC}")
+ command.append("python ${SRC}/pl-vif-up.py")
+ command.append("-N %s" % self.get("deviceName"))
+ command.append("-t %s" % self.vif_type)
+ command.append("-a %s" % self.get("ip4"))
+ command.append("-n %d" % self.get("prefix4"))
+ if self.get("snat") == True:
+ command.append("-s")
+ command.append("-p %s" % remote_endpoint.get("ip4"))
+
+ # Use pl-vid-udp-connect.py to stablish the tunnel between endpoints
+ command.append(") & (")
+ command.append("sudo -S")