Vincent Bernat [Sat, 21 Jan 2012 13:42:42 +0000 (14:42 +0100)]
Add a new serialization engine.
The chosen approach is totally different compared to the existing
packing mechanism. Instead of describing the struct with some string
and trying to decode the structure like the compiler would do (with
alignments problem), the structure is now described by its size and
the list of pointers in it. Macros are provided to make this
easy. Here is an example:
This enables the use of pointers, with detection of circular
references and therefore support of lists.
While only pointers need to be described, it is also possible to add
sub structure to avoid specifying (again) its list of pointers if it
has already been specified.
The use of this mechanism should simplify the client/server code.
Vincent Bernat [Mon, 2 Jan 2012 07:27:43 +0000 (08:27 +0100)]
core: optimize BPF filter
When monitoring high trafic interfaces, the BPF filter can become
quite important. We optimize it a bit by first checking if the
ethernet address is a multicast one. If it is not, we only have to
check for EDP.
Vincent Bernat [Sat, 31 Dec 2011 09:52:03 +0000 (10:52 +0100)]
configure: check more SNMP stuff.
First, we check that netsnmp_enable_subagent() exists. Otherwise, this
means that Net-SNMP has been compiled without this feature.
Second, we check if <net-snmp/agent/util_funcs.h> header is
usable. There was incomplete installation of files required by this
header with NetSNMP 5.4 and situation got worse with NetSNMP 5.7. If
the header is not usable, we fallback to define the two functions that
we need.
Vincent Bernat [Fri, 2 Dec 2011 06:35:02 +0000 (07:35 +0100)]
Export TZ=/etc/localtime to fix timestamps.
While chrooted, syslog timestamps does not respect the configured
timezone despite the copy of /etc/localtime inside the chroot. Setting
TZ variable seems to fix this problem.
Vincent Bernat [Thu, 3 Nov 2011 21:44:54 +0000 (22:44 +0100)]
Extend whitelist with possibility to blacklist.
It is possible to specify patterns like "*,!eth1" to blacklist "eth1"
or something like "eth*,wlan*,!wlan*master" to listen to all eth
interfaces and wlan interfaces with the exception of interfaces like
"wlan0master".
Vincent Bernat [Wed, 26 Oct 2011 13:56:07 +0000 (15:56 +0200)]
Don't pack struct hmsg since we are not able to do unaligned access on some archs.
Packing was used because data was cast as a pointer and therefore,
header was padded excessively. Since we don't use it as a pointer, we
cast it as an incomplete array of chars. We don't need its size.
Michael Tremer [Sat, 28 May 2011 12:29:33 +0000 (14:29 +0200)]
Add support to read /etc/os-release for system information.
/etc/os-release is introduced with systemd which will be in all the
major distributions, soon. For backwards-compatibility, the lsb_release
method is still there and will be used if no /etc/os-release is available.
Vincent Bernat [Sat, 5 Jun 2010 17:51:55 +0000 (19:51 +0200)]
Add support for 802.3at.
This includes send and receive support as well as SNMP support.
802.3at seems to not define OID that should be used as well as the
mapping for bit values. Therefore, the implementation is a wild guess
of what is consistent with 802.1ab.
Vincent Bernat [Sat, 8 May 2010 15:25:35 +0000 (17:25 +0200)]
Add initial Dot3/802.3at support
This includes ability to receive and store Dot3 MDI power TLV, to
display them with lldpctl and to export them through SNMP agent. There
is no support for 802.3af yet.
Vincent Bernat [Wed, 9 Jun 2010 16:13:43 +0000 (18:13 +0200)]
Add smart mode support.
This features was removed in previous versions to allow to have
several neighbors on one port. It now uses a different approach. Each
port can still have several neighbors but some of them will be hidden.
Vincent Bernat [Tue, 8 Jun 2010 16:45:52 +0000 (18:45 +0200)]
Don't check CDP checksums.
Some VLAN encapsulated CDP frames seem to have a checksum difficult to
verify. We give up on checking correctly CDP checksums. It is turned
into a dead code for future reference.
Vincent Bernat [Tue, 8 Jun 2010 16:39:18 +0000 (18:39 +0200)]
Listen on VLAN using an appropriate BPF filter and VLAN decapsulation.
Three cases may happen:
- You have a non VLAN accelerated network card.
The BPF filter will catch the frames in the VLAN and the frame will
be decapsulated.
- You have a VLAN accelerated network card and a kernel < 2.6.27.
lldpd won't see any frame encapsulated into a VLAN.
- You have a VLAN accelerated network card and a kernel >= 2.6.27.
lldpd will see the frames encapsulated into a VLAN as untagged
frames and won't need to decapsulate them.
Vincent Bernat [Tue, 8 Jun 2010 15:49:33 +0000 (17:49 +0200)]
Remove "listen on VLAN" feature.
This feature was intrusive and not very well tested. We will replace
it with less code using the fact that a recent kernel is able to
listen on all VLAN is asked to.
Vincent Bernat [Wed, 12 May 2010 18:06:02 +0000 (20:06 +0200)]
Fix additional alignment issues for ARM platform.
This solves the following GCC warnings:
interfaces.c: In function ‘iface_minimal_checks’:
interfaces.c:421: warning: cast increases required alignment of target type [-Wcast-align]
interfaces.c: In function ‘lldpd_ifh_eth’:
interfaces.c:732: warning: cast increases required alignment of target type [-Wcast-align]
interfaces.c: In function ‘lldpd_ifh_mgmt’:
interfaces.c:1127: warning: cast increases required alignment of target type [-Wcast-align]
Vincent Bernat [Wed, 12 May 2010 09:42:20 +0000 (11:42 +0200)]
Fix AC_CHECK_DECLS macro in configure.ac
This macro does not behave like AC_CHECK_FUNCS whose content is copied
in a shell for loop. Therefore, extra spaces may be turned into
underscores. We keep multiple lines but we remove backslashes and
extra spaces.