openwrt/package/network/services
Paul Donald 677edb0bbc 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/18344
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-03-25 09:54:08 +01:00
..
bridger bridger: update to the latest version 2023-05-12 21:18:31 +02:00
dnsmasq dnsmasq: Backport 2 upstream patches 2024-03-20 01:22:10 +01:00
dropbear package/network/services/dropbear: fix PKG_CPE_ID 2024-07-06 18:31:14 +02:00
ead ead: fix resource leak in tinysrp 2020-01-05 19:36:46 +01:00
hostapd hostapd: fix anqp_3gpp_cell_net list delimiter 2024-08-28 12:00:23 +02:00
ipset-dns build: prefer HTTPS if available (for packages) 2022-10-05 17:37:07 +02:00
lldpd lldpd: add custom-tlv handling 2025-03-25 09:54:08 +01:00
odhcpd odhcpd: Bump to latest commits 2023-11-03 08:27:52 +01:00
omcproxy omcproxy: bump to git HEAD 2021-11-04 15:04:45 +02:00
ppp treewide: add support for "lto" in PKG_BUILD_FLAGS 2023-03-21 18:28:22 +01:00
relayd relayd: bump to version 2023-01-28 2023-01-28 20:24:22 +01:00
uhttpd uhttpd: handle reload after uhttpd-mod-ubus installation using postinst 2024-01-27 10:36:43 +01:00
umdns umdns: update to Git 7c675979 (2024-03-04) 2024-03-08 07:56:44 +00:00
unetd unetd: update to Git HEAD (2024-03-31) 2024-03-31 19:57:22 +02:00
ustp treewide: add support for "lto" in PKG_BUILD_FLAGS 2023-03-21 18:28:22 +01:00