Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to send voice vlan id in the cdp/lldp message #51

Open
gereoffy opened this issue Jul 27, 2023 · 1 comment
Open

option to send voice vlan id in the cdp/lldp message #51

gereoffy opened this issue Jul 27, 2023 · 1 comment

Comments

@gereoffy
Copy link

Organization specific TLV (127), length 8: OUI ANSI/TIA (0x0012bb)
  Network policy Subtype (2)
    Application type [voice] (0x01), Flags [Tagged]
    Vlan id 100, L2 priority 6, DSCP value 46

it would be useful for testing/configuring ip phones from linux...

@gereoffy
Copy link
Author

gereoffy commented Jul 27, 2023

here is a quick&dirty hack to implement this:


--- a/src/proto/lldp.c
+++ b/src/proto/lldp.c
@@ -306,12 +306,30 @@ size_t lldp_packet(uint8_t proto, void *packet, struct netif *netif,
 	START_LLDP_TLV(LLDP_TYPE_PRIVATE) &&
 	PUSH_BYTES(OUI_TIA, OUI_LEN) &&
 	PUSH_UINT8(LLDP_PRIVATE_TIA_SUBTYPE_CAPABILITIES) &&
-	PUSH_UINT16(sysinfo->cap_lldpmed) &&
-	PUSH_UINT8(sysinfo->lldpmed_devtype)
+	PUSH_UINT16(sysinfo->cap_lldpmed | LLDP_TIA_CAPABILITY_NETWORK_POLICY) &&
+	PUSH_UINT8(LLDP_TIA_DEVICE_TYPE_NETWORK_CONNECTIVITY)
     ))
 	return 0;
     END_LLDP_TLV;

+
+//FE 08       127/len=8
+// 00 12 BB   02  oui=TIA (0x0012bb)  subtype=2
+// 01         Application type [voice] (0x01)
+// 40 C9 AE   vlan=100,l2prio=6,dscp=46
+
+    // TIA voice vlan  FIXME A'rpi
+    if (!(
+	START_LLDP_TLV(LLDP_TYPE_PRIVATE) &&
+	PUSH_BYTES(OUI_TIA, OUI_LEN) &&
+	PUSH_UINT8(LLDP_PRIVATE_TIA_SUBTYPE_NETWORK_POLICY) &&
+	PUSH_UINT8(0x01) &&    /* Application type [voice] (0x01) */
+	PUSH_UINT8(0x40) && PUSH_UINT8(0xC9) && PUSH_UINT8(0xAE)   /* FIXME  vlan100 hardcoded */
+    ))
+	return 0;
+    END_LLDP_TLV;
+
+
     // TIA Location Identification TLv


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant