summaryrefslogtreecommitdiffstats
path: root/lib/interface.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/interface.py')
-rw-r--r--lib/interface.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/interface.py b/lib/interface.py
new file mode 100644
index 0000000..8f18559
--- /dev/null
+++ b/lib/interface.py
@@ -0,0 +1,12 @@
+import string
+
+class Interface(object):
+ def __init__(self, interface):
+ """ Store the NIC in the form "<if name> <MAC address> """
+ self.nic_info = string.split(interface, " ")
+
+ def get_interface(self):
+ return self.nic_info[0]
+
+ def get_mac_addr(self):
+ return self.nic_info[1]