コード例 #1
0
ファイル: extreme.py プロジェクト: benroeder/HEN
 def __init__(self, switchNode, minimumVLANInternalID, maximumVLANInternalID, minimumInterfaceInternalID, maximumInterfaceInternalID):
     """\brief Initializes the class
     \param switchNode (\c SwitchNode) The SwitchNode object to obtain information from to initialize the class with
     \param minimumVLANInternalID (\c int) The minimum number for a vlan's internal id
     \param maximumVLANInternalID (\c int) The maximum number for a vlan's internal id
     \param minimumInterfaceInternalID (\c int) The minimum number for an interface's internal id
     \param maximumInterfaceInternalID (\c int) The maximum number for an interface's internal id
     """
     Switch.__init__(self, switchNode, minimumVLANInternalID, maximumVLANInternalID, minimumInterfaceInternalID, maximumInterfaceInternalID)
コード例 #2
0
ファイル: extreme.py プロジェクト: sohonet/HEN
 def __init__(self, switchNode, minimumVLANInternalID,
              maximumVLANInternalID, minimumInterfaceInternalID,
              maximumInterfaceInternalID):
     """\brief Initializes the class
     \param switchNode (\c SwitchNode) The SwitchNode object to obtain information from to initialize the class with
     \param minimumVLANInternalID (\c int) The minimum number for a vlan's internal id
     \param maximumVLANInternalID (\c int) The maximum number for a vlan's internal id
     \param minimumInterfaceInternalID (\c int) The minimum number for an interface's internal id
     \param maximumInterfaceInternalID (\c int) The maximum number for an interface's internal id
     """
     Switch.__init__(self, switchNode, minimumVLANInternalID,
                     maximumVLANInternalID, minimumInterfaceInternalID,
                     maximumInterfaceInternalID)
コード例 #3
0
ファイル: threecom.py プロジェクト: sohonet/HEN
 def __init__(self, switchNode, minimumVLANInternalID,
              maximumVLANInternalID, minimumInterfaceInternalID,
              maximumInterfaceInternalID):
     """\brief Initializes the class
     \param switchNode (\c SwitchNode) The SwitchNode object to obtain information from to initialize the class with
     \param minimumVLANInternalID (\c int) The minimum number for a vlan's internal id
     \param maximumVLANInternalID (\c int) The maximum number for a vlan's internal id        
     \param minimumInterfaceInternalID (\c int) The minimum number for an interface's internal id
     \param maximumInterfaceInternalID (\c int) The maximum number for an interface's internal id        
     """
     Switch.__init__(self, switchNode, minimumVLANInternalID,
                     maximumVLANInternalID, minimumInterfaceInternalID,
                     maximumInterfaceInternalID)
     self.snmp = SNMP(self.getCommunity(), self.getIPAddress(), SNMP.SNMPv1)
コード例 #4
0
ファイル: threecom.py プロジェクト: benroeder/HEN
 def __init__(
     self,
     switchNode,
     minimumVLANInternalID,
     maximumVLANInternalID,
     minimumInterfaceInternalID,
     maximumInterfaceInternalID,
 ):
     """\brief Initializes the class
     \param switchNode (\c SwitchNode) The SwitchNode object to obtain information from to initialize the class with
     \param minimumVLANInternalID (\c int) The minimum number for a vlan's internal id
     \param maximumVLANInternalID (\c int) The maximum number for a vlan's internal id        
     \param minimumInterfaceInternalID (\c int) The minimum number for an interface's internal id
     \param maximumInterfaceInternalID (\c int) The maximum number for an interface's internal id        
     """
     Switch.__init__(
         self,
         switchNode,
         minimumVLANInternalID,
         maximumVLANInternalID,
         minimumInterfaceInternalID,
         maximumInterfaceInternalID,
     )
     self.snmp = SNMP(self.getCommunity(), self.getIPAddress(), SNMP.SNMPv1)
コード例 #5
0
ファイル: threecom.py プロジェクト: sohonet/HEN
    def getFullMACTable(self):
        """\brief Returns a list of MACTableEntry objects representing the full mac table of the
                  switch (the switch's database).
        \return (\c list of MACTableEntry objects) A list of MACTableEntry objects
        """
        originalCommunity = self.snmp.getCommunity()
        table = []
        macs = []

        vlans = self.getFullVLANInfo()

        for vlan in vlans:
            community = str(originalCommunity) + "@" + str(vlan.getID())
            self.snmp.setCommunity(community)
            macs = Switch.getFullMACTable(self)
            for mac in macs:
                table.append(mac)
        self.snmp.setCommunity(originalCommunity)
        return table
コード例 #6
0
ファイル: threecom.py プロジェクト: benroeder/HEN
    def getFullMACTable(self):
        """\brief Returns a list of MACTableEntry objects representing the full mac table of the
                  switch (the switch's database).
        \return (\c list of MACTableEntry objects) A list of MACTableEntry objects
        """
        originalCommunity = self.snmp.getCommunity()
        table = []
        macs = []

        vlans = self.getFullVLANInfo()

        for vlan in vlans:
            community = str(originalCommunity) + "@" + str(vlan.getID())
            self.snmp.setCommunity(community)
            macs = Switch.getFullMACTable(self)
            for mac in macs:
                table.append(mac)
        self.snmp.setCommunity(originalCommunity)
        return table