Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lldp_syncd/conventions.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ class LldpSystemCapabilitiesMap(int, Enum):
other = 0
repeater = 1
bridge = 2
wlanAccessPoint = 3
wlan = 3
router = 4
telephone = 5
docsisCableDevice = 6
stationOnly = 7
docsis = 6
station = 7
4 changes: 2 additions & 2 deletions src/lldp_syncd/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ def parse_sys_capabilities(self, capability_list, enabled=False):
for capability in capability_list:
try:
if (not enabled) or capability["enabled"]:
sys_cap |= 128 >> LldpSystemCapabilitiesMap[capability["type"].lower()]
sys_cap |= 1 << LldpSystemCapabilitiesMap[capability["type"].lower()]
except KeyError:
logger.debug("Unknown capability {}".format(capability["type"]))
return "%0.2X 00" % sys_cap
return "00 %0.2X" % sys_cap

def __init__(self, update_interval=None):
super(LldpSyncDaemon, self).__init__()
Expand Down
134 changes: 67 additions & 67 deletions tests/mock_tables/LLDP_ENTRY_TABLE.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"LLDP_ENTRY_TABLE:Ethernet100": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -15,8 +15,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet4": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -29,8 +29,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet104": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -43,8 +43,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet0": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -57,8 +57,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet108": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -71,8 +71,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet8": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -99,8 +99,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet92": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -113,8 +113,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet124": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -127,8 +127,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet120": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -141,8 +141,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet40": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -155,8 +155,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet44": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -169,8 +169,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet48": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -183,8 +183,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet24": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -197,8 +197,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet68": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -211,8 +211,8 @@
},
"LLDP_ENTRY_TABLE:eth0": {
"lldp_rem_index": 2,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm going to need you to come in on saturday",
Expand All @@ -225,8 +225,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet20": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -239,8 +239,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet60": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -253,8 +253,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet64": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -267,8 +267,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet112": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -281,8 +281,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet116": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -295,8 +295,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet84": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -309,8 +309,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet80": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -323,8 +323,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet88": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -337,8 +337,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet52": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -351,8 +351,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet76": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -365,8 +365,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet56": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -379,8 +379,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet72": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -393,8 +393,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet32": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -407,8 +407,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet28": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -421,8 +421,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet36": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -435,8 +435,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet16": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -449,8 +449,8 @@
},
"LLDP_ENTRY_TABLE:Ethernet12": {
"lldp_rem_index": 1,
"lldp_rem_sys_cap_enabled": "28 00",
"lldp_rem_sys_cap_supported": "28 00",
"lldp_rem_sys_cap_enabled": "00 14",
"lldp_rem_sys_cap_supported": "00 14",
"lldp_rem_port_id_subtype": 5,
"lldp_rem_chassis_id": "00:11:22:33:44:55",
"lldp_rem_sys_desc": "I'm a little teapot.",
Expand All @@ -467,7 +467,7 @@
"lldp_loc_sys_name": "arc-switch1025",
"lldp_loc_sys_desc": "Debian GNU/Linux 8 (jessie) Linux 3.16.0-5-amd64 #1 SMP Debian 3.16.51-3+deb8u1 (2018-01-08) x86_64",
"lldp_loc_man_addr": "10.1.0.32,fc00:1::32",
"lldp_loc_sys_cap_supported": "28 00",
"lldp_loc_sys_cap_enabled": "28 00"
"lldp_loc_sys_cap_supported": "00 14",
"lldp_loc_sys_cap_enabled": "00 14"
}
}
}
Loading