_help = "Creates a TAP device on a Linux host"
_backend = "linux"
+ IFF_TUN = 0x0001
+ IFF_TAP = 0x0002
+
@classmethod
def _register_attributes(cls):
endpoint_ip = Attribute("endpoint_ip", "IPv4 Address",
def node(self):
node = self.get_connected(LinuxNode.get_rtype())
if node: return node[0]
- raise RuntimeError, "TAP/TUN devices must be connected to Node"
+ raise RuntimeError, "linux::TAP/TUN devices must be connected to a linux::Node"
@property
def gre_enabled(self):
tdiffsec(tnow(), self._last_state_check) > state_check_delay:
if self.get("deviceName"):
- (out, err), proc = self.node.execute("ifconfig")
+ (out, err), proc = self.node.execute("ip a")
if out.strip().find(self.get("deviceName")) == -1:
# tap is not running is not running (socket not found)
def vif_type(self):
return "IFF_TAP"
+ @property
+ def vif_type_flag(self):
+ return LinuxTap.IFF_TAP
+
@property
def vif_prefix(self):
return "tap"