+ def deactivateNetworkConfig(self):
+ for iface in self.ifaces.keys():
+ os.system("ip addr flush " + iface)
+ os.system("/etc/init.d/networking stop")
+ os.system("killall -9 udhcpc")
+ os.system("rm /var/run/udhcpc*")
+
+ def activateNetworkConfig(self):
+ os.system("/etc/init.d/networking start")
+
+ def getNumberOfAdapters(self):
+ return len(self.ifaces)
+
+ def getAdapterName(self, iface):
+ return iface
+
+ def getAdapterList(self):
+ return self.ifaces.keys()
+
+ def getAdapterAttribute(self, iface, attribute):
+ if self.ifaces.has_key(iface):
+ if self.ifaces[iface].has_key(attribute):
+ return self.ifaces[iface][attribute]
+ return None
+
+ def setAdapterAttribute(self, iface, attribute, value):
+ print "setting for adapter", iface, "attribute", attribute, " to value", value
+ if self.ifaces.has_key(iface):
+ self.ifaces[iface][attribute] = value