The Assimilation Project  based on Assimilation version 1.1.7.1474836767
cma.AssimCclasses.pySwitchDiscovery Class Reference
Inheritance diagram for cma.AssimCclasses.pySwitchDiscovery:
Collaboration diagram for cma.AssimCclasses.pySwitchDiscovery:

Public Member Functions

def __init__ (self)
 

Static Public Member Functions

def decode_discovery (host, interface, instance, wallclock, pktstart, pktend)
 
def dot3MauTypes (mautype)
 
def getNint (tlvptr, tlvlen, pktend)
 
def construct_cdp_caps (capval)
 
def getcdpaddresses (tlvlen, tlvstart, pktend)
 

Static Public Attributes

dictionary lldpnames
 
dictionary lldp802_1names
 
dictionary lldp802_3names
 
dictionary cdpnames
 

Detailed Description

Class for interpreting switch discovery data via LLDP or CDP
Currently only LLDP is fully implemented.

Definition at line 150 of file AssimCclasses.py.

Constructor & Destructor Documentation

def cma.AssimCclasses.pySwitchDiscovery.__init__ (   self)

Definition at line 205 of file AssimCclasses.py.

References netaddr_ipv4_new(), netaddr_ipv6_new(), netaddr_mac48_new(), netaddr_mac64_new(), and cma.drawwithdot.type.

Here is the call graph for this function:

Member Function Documentation

def cma.AssimCclasses.pySwitchDiscovery.construct_cdp_caps (   capval)
static

Definition at line 751 of file AssimCclasses.py.

def cma.AssimCclasses.pySwitchDiscovery.decode_discovery (   host,
  interface,
  instance,
  wallclock,
  pktstart,
  pktend 
)
static
def cma.AssimCclasses.pySwitchDiscovery.dot3MauTypes (   mautype)
static
MAU types and characteristics from RFC 3636 - starting at page 9
The LLDP spec says that MAU types returned by G2.3 MAU type are to be
the same as dot3MauType information in RFC 3636.
This is my take on that information.

Definition at line 477 of file AssimCclasses.py.

References get_cdptlv_body(), get_cdptlv_first(), get_cdptlv_len(), get_cdptlv_next(), get_cdptlv_type(), netaddr_mac48_new(), and tlv_get_guint16().

Here is the call graph for this function:

def cma.AssimCclasses.pySwitchDiscovery.getcdpaddresses (   tlvlen,
  tlvstart,
  pktend 
)
static
Decode utterly bizarre CDP-specific address list format
4 bytes address count
'count' addresses in this form:
    one bytes protocol length
    'protocol length' bytes of protocol type
    two bytes address length
    'address length' bytes of address
    IPv4:
protocol length = 1, protocol type = 0xCC
    IPv6:
protocol length = 8 and address length = 16
protocol type == 0xAAAA0300000086DD ??
    +-------+--------------------+----------+-----------------+
    |Proto  |Protocol Type       | address  | Actual address  |
    |Length |(protolength bytes) | length   | (addresslength  |
    |1 byte |(1-255 bytes)       | (2 bytes)|  bytes)         |
    +-------+--------------------+----------+-----------------+

    Min length for an IPV4 address is 8 bytes

Definition at line 772 of file AssimCclasses.py.

References netaddr_ipv4_new(), and netaddr_ipv6_new().

Here is the call graph for this function:

def cma.AssimCclasses.pySwitchDiscovery.getNint (   tlvptr,
  tlvlen,
  pktend 
)
static

Definition at line 735 of file AssimCclasses.py.

References tlv_get_guint16(), tlv_get_guint24(), tlv_get_guint32(), tlv_get_guint64(), and tlv_get_guint8().

Here is the call graph for this function:

Field Documentation

dictionary cma.AssimCclasses.pySwitchDiscovery.cdpnames
static
Initial value:
1 = {
2  # System-wide capabilities
3  CDP_TLV_DEVID: ('ChassisId', True),
4  CDP_TLV_CAPS: ('SystemCapabilities', True),
5  CDP_TLV_VERS: ('SystemVersion', True),
6  CDP_TLV_PLATFORM: ('SystemPlatform', True),
7  CDP_TLV_VTPDOMAIN: ('VLANManagementDomain', True),
8  CDP_TLV_ADDRESS: ('SystemAddress', True),
9  CDP_TLV_MANAGEMENT_ADDR: ('ManagementAddress', True),
10  CDP_TLV_SYSTEM_NAME: ('SystemName', True),
11  CDP_TLV_LOCATION: ('SystemDescription', True),
12  CDP_TLV_HELLO: ('CiscoHello', True),
13  # Per-port capabilities follow
14  CDP_TLV_TRUST_BITMAP: ('CiscoTrustBitMap', False),
15  CDP_TLV_UNTRUSTED_COS: ('CiscoUnTrustedPortCOS', False),
16  CDP_TLV_NATIVEVLAN: ('VlanId', False),
17  CDP_TLV_VLQUERY: ('VlanQuery', False),
18  CDP_TLV_VLREPLY: ('VlanReply', False),
19  CDP_TLV_PORTID: ('PortId', False),
20  CDP_TLV_EXT_PORTID: ('PortDescription', False),
21  CDP_TLV_DUPLEX: ('duplex', False),
22  CDP_TLV_MTU: ('mtu', False),
23  CDP_TLV_POWER: ('PortPower', False),
24  }

Definition at line 180 of file AssimCclasses.py.

dictionary cma.AssimCclasses.pySwitchDiscovery.lldp802_1names
static
Initial value:
1 = {
2  LLDP_ORG802_1_VLAN_PVID: ('VlanPvId', False),
3  LLDP_ORG802_1_VLAN_PORTPROTO: ('VlanPortProtocol', False),
4  LLDP_ORG802_1_VLAN_NAME: ('VlanName', False),
5  LLDP_ORG802_1_VLAN_PROTOID: ('VlanProtocolId', False),
6  }

Definition at line 167 of file AssimCclasses.py.

dictionary cma.AssimCclasses.pySwitchDiscovery.lldp802_3names
static
Initial value:
1 = {
2  LLDP_ORG802_3_PHY_CONFIG: ('PhysicalConfiguration', False),
3  LLDP_ORG802_3_POWERVIAMDI: ('PowerViaMDI', False),
4  LLDP_ORG802_3_LINKAGG: ('LinkAggregation', False),
5 
6  }

Definition at line 173 of file AssimCclasses.py.

dictionary cma.AssimCclasses.pySwitchDiscovery.lldpnames
static
Initial value:
1 = {
2  LLDP_TLV_END: ('END', True),
3  LLDP_TLV_CHID: ('ChassisId', True),
4  LLDP_TLV_PID: ('PortId', True),
5  LLDP_TLV_TTL: ('TTL', True),
6  LLDP_TLV_PORT_DESCR: ('PortDescription', False),
7  LLDP_TLV_SYS_NAME: ('SystemName', True),
8  LLDP_TLV_SYS_DESCR: ('SystemDescription', True),
9  LLDP_TLV_SYS_CAPS: ('SystemCapabilities', True),
10  LLDP_TLV_MGMT_ADDR: ('ManagementAddress', True),
11  LLDP_TLV_ORG_SPECIFIC: ('(OrgSpecific)', True),
12  }

Definition at line 155 of file AssimCclasses.py.


The documentation for this class was generated from the following file: