Пример #1
0
 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()
Пример #2
0
 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
Пример #3
0
 def getAllSubtypes(self):
     """
         Retrieve all possible subtypes for this interface.
     """
     return unique([i[1] for i in _ifconfig.getifmedia(self._interface)["options"]])
Пример #4
0
 def _getActiveOptions(self):
     return _ifconfig.getifmedia(self._interface)["active"][2]
Пример #5
0
 def _getActiveSubType(self):
     return _ifconfig.getifmedia(self._interface)["active"][1]
Пример #6
0
 def _getOptions(self):
     return _ifconfig.getifmedia(self._interface)["current"][2]
Пример #7
0
 def _getSubType(self):
     return _ifconfig.getifmedia(self._interface)["current"][1]