CVSROOT: /cvs Module name: src Changes by: d...@cvs.openbsd.org 2025/05/02 00:12:53
Added files: usr.sbin/lldpd : Makefile lldpctl.h lldpd.8 lldpd.c log.c log.h pdu.c pdu.h Log message: lldpd(8): a daemon that acts as an LLDP agent on Ethernet interfaces. lldpd uses the recently added AF_FRAME Ethernet sockets to listen for LLDP packets on all Ethernet interfaces in the system, and stores them so a lldp(8) client connecting to the control socket can fetch and display the packets. AF_FRAME means we can avoid BPF for receiving LLDP packets, which has a couple of benefits. firstly, BPF needs to look at all packets entering an interface so it can filter for the ones you're interested in, which is annoying for low packet/data rate protocols like LLDP. AF_FRAME is handled late in ether_input, and only after other protocols (like ip) are handled, so it's lower overhad compared to BPF listeners. secondly, attaching a BPF filter to new interfaces relies on having access to and the privileges to open /dev/bpf, while AF_FRAME provides a wildcard listener that is able to receive LLDP from all interfaces on a single socket, like how binding to on 0.0.0.0 with an AF_INET socket let's you receive packets for all the IPs on your system from a single socket. lldp can create and configure this socket when it starts up just use it from then on. this means lldpd is simpler and needs fewer privileges to operate than if it went the BPF route. at the moment lldpd only handles LLDP packet reception on all interfaces, you can't disable reception on interfaces yet. it also doesn't transmit LLDP packets (yet). there is no intention of implementing any protocol other than LLDP in this daemon either. ok djm@ deraadt@ general enthusiasm from many