def __init__(self, name): self.Name = name try: _ifconfig.getifmedia(self.Name) self.media = Media(self.Name) except OException: self.media = None # We de-reference this once, so we get the Iftype self.getAddresses()
def getAllOptions(self, subtype): """ Retrieve all possible options for a given subtype. """ options = [] for i in _ifconfig.getifmedia(self._interface)["options"]: if i[1] == subtype: options.extend(i[2]) return options
def getAllSubtypes(self): """ Retrieve all possible subtypes for this interface. """ return unique([i[1] for i in _ifconfig.getifmedia(self._interface)["options"]])
def _getActiveOptions(self): return _ifconfig.getifmedia(self._interface)["active"][2]
def _getActiveSubType(self): return _ifconfig.getifmedia(self._interface)["active"][1]
def _getOptions(self): return _ifconfig.getifmedia(self._interface)["current"][2]
def _getSubType(self): return _ifconfig.getifmedia(self._interface)["current"][1]