openwrt-mirror/package/network/services
Paul Donald de2718b2f3 lldpd: add custom-tlv handling
Do not verify the format of TLV. Leave that to lldpd.

These lldpd config entries:

config custom-tlv
	list ports 'eth0'
	option tlv 'replace oui 33,44,55 subtype 254 oui-info 55,55,55,55,55'

config custom-tlv
	option tlv 'oui 33,44,44 subtype 232'
	list ports 'br-lan'
	list ports 'eth0'

config custom-tlv # oui-info truncated
	option tlv 'add oui 33,44,33 subtype 66 oui-info 5555555555'

config custom-tlv
	option tlv 'add oui 33,44,31 subtype 44'

config custom-tlv # invalid oui
	option tlv 'add oui 3322 subtype 79'

config custom-tlv # invalid oui
	option tlv 'oui 3312 subtype 74'

Produce the following lldpd.conf content:

configure ports eth0 lldp custom-tlv replace oui 33,44,55 subtype 254 oui-info 55,55,55,55,55
configure ports br-lan,eth0 lldp custom-tlv oui 33,44,44 subtype 232
configure lldp custom-tlv add oui 33,44,33 subtype 66 oui-info 5555555555
configure lldp custom-tlv add oui 33,44,31 subtype 44
configure lldp custom-tlv add oui 3322 subtype 79
configure lldp custom-tlv oui 3312 subtype 74

And lldpd (v1.0.13 on v22) logs the following:

Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op replace oui 33:44:55 subtype fe
Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:44 subtype e8
Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:33 subtype 42
Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:33 subtype 42
Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:31 subtype 2c
Sat Mar 16 19:11:39 2024 daemon.info lldpd[10916]: custom TLV op add oui 33:44:31 subtype 2c
Sat Mar 16 19:11:39 2024 daemon.warn lldpcli[10915]: invalid OUI value '3322'
Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: an error occurred while executing last command
Sat Mar 16 19:11:39 2024 daemon.warn lldpcli[10915]: invalid OUI value '3312'
Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: an error occurred while executing last command
Sat Mar 16 19:11:39 2024 daemon.info lldpcli[10915]: lldpd should resume operations

( The last two TLV are invalid: their oui must be three hex bytes, comma
separated. Only the first hex byte of oui-info 5555555555 is used )

Depends on #14867 and its release version bump

Tested on: 22.03.6

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14872
(cherry picked from commit 8d1fe32c2c)
Link: https://github.com/openwrt/openwrt/pull/18343
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-03-25 09:52:55 +01:00
..
bridger bridger: update to Git HEAD (2024-04-22) 2024-04-22 11:02:52 +02:00
dnsmasq dnsmasq: fix handlers for options filter_rr and cache_rr 2025-03-09 17:28:50 +01:00
dropbear dropbear: bump to 2024.86 2024-11-28 18:49:19 +00:00
ead ead: fix resource leak in tinysrp 2020-01-05 19:36:46 +01:00
hostapd hostapd: add missing #ifdef to fix compile error when 802.11be support is disabled 2025-03-05 09:20:06 +01:00
ipset-dns treewide: update PKG_MIRROR_HASH to zst 2024-04-06 11:24:18 +02:00
lldpd lldpd: add custom-tlv handling 2025-03-25 09:52:55 +01:00
odhcpd odhcpd: update to Git HEAD (2024-05-08) 2024-05-08 00:11:19 +02:00
omcproxy omcproxy: update to latest version 2025-02-27 20:12:15 +01:00
ppp ppp: remove more unnecessary kernel checks 2024-11-28 18:47:25 +00:00
relayd treewide: update PKG_MIRROR_HASH to zst 2024-04-06 11:24:18 +02:00
uhttpd uhttpd: restart daemon if certificate has changed 2024-08-19 18:46:08 +02:00
umdns umdns: update to Git HEAD (2025-02-10) 2025-02-10 21:44:00 +01:00
unetd unetd: update to Git HEAD (2025-03-09) 2025-03-16 18:53:59 +01:00
ustp ustp: update to Git HEAD (2023-05-29) 2024-04-27 11:40:04 +02:00