Vincent Bernat [Mon, 23 Jan 2012 18:55:49 +0000 (19:55 +0100)]
marshal: fix list marshalling and various other changes
Since last element and previous element are a pointer to a pointer, we
should handle this case differently. Unit tests are not failing
because the original memory space is still available on the stack. We
just ignore last and previous. This still allows to use the list for
the most useful operations: TAILQ_EMPTY, TAILQ_FOREACH and
TAILQ_REMOVE. We can't use TAILQ_INSERT_TAIL!
Another important change is that by default, macros will declare an
external structure. MARSHAL_EXPORT variable should be defined only for
one module. Otherwise, marshal structures will be defined several
times.
We also rename `_marshal_*` to `marshal_*_`. This enables more
graceful logging messages.
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.