]> git.ipfire.org Git - thirdparty/lldpd.git/commit
interfaces: abstraction of interfaces/devices
authorVincent Bernat <bernat@luffy.cx>
Mon, 24 Dec 2012 16:56:01 +0000 (17:56 +0100)
committerVincent Bernat <bernat@luffy.cx>
Mon, 24 Dec 2012 16:56:01 +0000 (17:56 +0100)
commitadbb6e54c36cf77e033a5eb4fe28c7aa5abfcd76
treed78433e462d9d3b3bfe65ecb71da6762128af9a2
parent2fafbd309cac8e7d66892d92b26900fe0f34d32e
interfaces: abstraction of interfaces/devices

To prepare support of additional OS, interfaces have been abstracted
into a proper structure. It is still expected that each OS should have
its own `update_interfaces()` that will discover interfaces and set
the appropriate `lldpd_hardware` structures. However, helper functions
have been setup with the assumption that interfaces are put in an
abstract `interfaces_device_list`. It is expected that
`update_interfaces()` build such a list with all sensible
information (VLAN, bond, bridge, drivers, ...). Once this is done,
`interfaces_helper_*` function can be called to do most of the work.

Another change is that VLAN stuff, bridge stuff and bonding stuff is
discovered only once instead of using functions each time we need to
know something. This should lower the number of ioctl call (which can
be costly on some special hardware, for example with Marvell
DSA). This also enable to discover some of those stuff through
Netlink.

Supporting FreeBSD is the next step.
src/daemon/Makefile.am
src/daemon/interfaces-linux.c
src/daemon/interfaces.c [new file with mode: 0644]
src/daemon/lldpd.h
src/daemon/netlink.c