# Path: wiremaps/collector/datastore.py
# class Port:
#     implements(IPort)
# 
#     def __init__(self, name, state,
#                  alias=None, mac=None, speed=None, duplex=None, autoneg=None):
#         self.name = ascii(name)
#         self.state = state
#         self.alias = ascii(alias)
#         self.mac = mac
#         self.speed = speed
#         self.duplex = duplex
#         self.autoneg = autoneg
#         self.fdb = []
#         self.sonmp = None
#         self.edp = None
#         self.cdp = None
#         self.lldp = None
#         self.vlan = []
#         self.trunk = None
# 
# class Trunk:
#     implements(ITrunk)
# 
#     def __init__(self, parent):
#         self.parent = parent


from twisted.internet import defer
from wiremaps.collector.datastore import Port, Trunk
            s = results[oid]
            if s == 2**32 - 1:
                # Overflow, let's say that it is 10G
                s = 10000
            else:
                s /= 1000000
            if s:
                self.speed[port] = s

    def gotHighSpeed(self, results):
        """Callback handling retrieving of interface high speed.

        @param result: result of walking C{IF-MIB::ifHighSpeed}
        """
        for oid in results:
            port = int(oid.split(".")[-1])
            if self.normPort is not None:
                port = self.normPort(port)
            if port not in self.ports:
                continue
            s = results[oid]
            if s:
                self.speed[port] = s

    def completeEquipment(self):
        """Complete C{self.equipment} with data collected"""
        tmp = self.portAliases.copy()
        tmp.update(self.portNames)
        self.portNames = tmp
        for port in self.portNames:

# Path: wiremaps/collector/datastore.py
# class Port:
#     implements(IPort)
# 
#     def __init__(self, name, state,
#                  alias=None, mac=None, speed=None, duplex=None, autoneg=None):
#         self.name = ascii(name)
#         self.state = state
#         self.alias = ascii(alias)
#         self.mac = mac
#         self.speed = speed
#         self.duplex = duplex
#         self.autoneg = autoneg
#         self.fdb = []
#         self.sonmp = None
#         self.edp = None
#         self.cdp = None
#         self.lldp = None
#         self.vlan = []
#         self.trunk = None
# 
# class Trunk:
#     implements(ITrunk)
# 
#     def __init__(self, parent):
#         self.parent = parent


# Path: wiremaps/collector/helpers/port.py
from twisted.internet import defer
from wiremaps.collector.datastore import Port, Trunk

            s = results[oid]
            if s == 2**32 - 1:
                # Overflow, let's say that it is 10G
                s = 10000
            else:
                s /= 1000000
            if s:
                self.speed[port] = s

    def gotHighSpeed(self, results):
        """Callback handling retrieving of interface high speed.

        @param result: result of walking C{IF-MIB::ifHighSpeed}
        """
        for oid in results:
            port = int(oid.split(".")[-1])
            if self.normPort is not None:
                port = self.normPort(port)
            if port not in self.ports:
                continue
            s = results[oid]
            if s:
                self.speed[port] = s

    def completeEquipment(self):
        """Complete C{self.equipment} with data collected"""
        tmp = self.portAliases.copy()
        tmp.update(self.portNames)
        self.portNames = tmp
        for port in self.portNames:

            self.equipment.ports[port] = Port(self.portNames[port],