+ if self.gre_enabled:
+ command = []
+ else:
+ 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("-f %s " % self.vif_name_file)
+ command.append("-S %s " % self.sock_name)
+
+ if self.get("snat") == True:
+ command.append("-s")
+
+ if self.get("pointopoint"):
+ command.append("-p %s" % self.get("pointopoint"))
+
+ if self.get("txqueuelen"):
+ command.append("-q %s" % self.get("txqueuelen"))
+
+ return " ".join(command)
+
+ @property
+ def _stop_command(self):
+ if self.gre_enabled:
+ command = self._vif_down_command()
+ else:
+ command = ["sudo -S "]
+ command.append("PYTHONPATH=$PYTHONPATH:${SRC}")
+ command.append("python ${SRC}/pl-vif-down.py")
+ command.append("-S %s " % self.sock_name)
+ command = " ".join(command)
+
+ return command
+
+ @property
+ def _vif_up_command(self):
+ if self.gre_enabled:
+ device_name = "%s" % self.guid
+ else:
+ device_name = self.get("deviceName")
+
+ # Use pl-vif-up.py script to configure TAP
+ command = ["sudo -S "]
+ command.append("PYTHONPATH=$PYTHONPATH:${SRC}")
+ command.append("python ${SRC}/pl-vif-up.py")
+ command.append("-N %s" % self.get("deviceName"))