Vincent Bernat [Wed, 28 Oct 2009 10:38:03 +0000 (11:38 +0100)]
Make netsnmp headers compatible with C99.
Disable inlining by adding -DNETSNMP_NO_INLINE to CFLAGS. Since we
only use header files, this should not be a problem. A more valid fix
would be to turn NETSNMP_INLINE into "extern inline" instead of just
"inline".
Without this fix, we get a lot of warnings with gcc 4.3.
Vincent Bernat [Thu, 15 Oct 2009 10:18:45 +0000 (12:18 +0200)]
Get timezone info before being in the chroot.
Depending on the libc, first implicit call to tzset() can be done when
invoking syslog() the first time. In most situation, this is done when
we are in a chroot and therefore, we cannot read /etc/localtime and
get an accurate timezone information. Therefore, we invoke tzset()
before being in chroot.
Vincent Bernat [Tue, 29 Sep 2009 14:44:59 +0000 (16:44 +0200)]
Rework autoconf stuff.
Update to autoconf 2.64.
Use custom macro for ethtool, netsnmp and argument handling to shorten
main configure.ac file.
Use less verbose build process by default.
For headers, missing header is fatal for now because we don't know how
to replace them. Better handling will be done later. We only target
Linux for now with GNU LibC: portability issues are narrow.
Some useful documentation about autoconf:
http://sources.redhat.com/autobook/ (a bit outdated)
http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_automake_libtool
http://www.flameeyes.eu/autotools-mythbuster/
Vincent Bernat [Thu, 24 Sep 2009 09:28:24 +0000 (11:28 +0200)]
Include manual pages into distribution.
By default, manual pages are not included in "make dist". We add them
by adding them in EXTRA_DIST. See:
http://gnu.huihoo.org/automake-1.4/html_node/automake_50.html
Vincent Bernat [Thu, 24 Sep 2009 08:27:15 +0000 (10:27 +0200)]
Use "void" instead of empty parameter list for function prototypes.
Using empty parameter list means that we don't know what are the
parameters of a function, while using "void" means that there is no
parameter for this function. Some compilers are ticky about this. See
C99 6.11.6 and 6.7.5.3 ยง14.
This also allows to fix a little bug: priv_ctl_create was called with
a parameter.
Vincent Bernat [Thu, 24 Sep 2009 08:13:27 +0000 (10:13 +0200)]
Use libtool convenience libraries for common files for lldpd and lldpctl.
Instead of directly linking common files, we use another libtool
convenience library (libcommon.la). We also separate server part of
ctl.c into a separate file to avoid -DCLIENT_ONLY flag which was
causing recompilation of most files.
We also move compatibility objects (like strcpy() function) into
libcommon.la.
Vincent Bernat [Thu, 9 Jul 2009 18:10:43 +0000 (20:10 +0200)]
Compilation fix for ancient gcc.
gcc 2.96 does not like "char frame[]" declaration and complains with
"array size missing in frame'". We circumvent this limitation by using
a one byte array instead of an undefined one.
Vincent Bernat [Wed, 23 Sep 2009 07:14:50 +0000 (09:14 +0200)]
Add '-k' flag to disable kernel version advertising.
From a suggestion and a patch proposed in ticket #19. With this flag,
system description is just the kernel name and software version as
advertised if LLDP-MED is enabled is set to "Unknown".
Vincent Bernat [Sun, 5 Jul 2009 17:30:56 +0000 (19:30 +0200)]
Unit tests for packing/unpacking.
We build a static library liblldpd.la to ease linking to tests.
liblldpd.la is equal to lldpd except:
- no main (but lldpd_main instead)
- no link to netsnmp (because libtool try to link many many more
things)
Vincent Bernat [Wed, 10 Jun 2009 13:22:29 +0000 (15:22 +0200)]
Use ifAlias from newer Linux kernels if available.
From 2.6.28, Linux allows to attach a description to an interface. We
grab this description from /sys/class/net/$IFACE/ifalias if it exists
and is not empty and use it as port description. In this case,
interface name is used as port ID.
Vincent Bernat [Tue, 9 Jun 2009 05:42:32 +0000 (07:42 +0200)]
Set h_ifindex correctly.
We also use this index as a way to define an interface. The following
comment has been added to lldpd.h:
An interface is uniquely identified by h_ifindex, h_ifname and h_ops.
This means if an interface becomes enslaved, it will be considered as
a new interface. The same applies for renaming and we include the
index in case of renaming to an existing interface.
Vincent Bernat [Sun, 24 May 2009 17:33:28 +0000 (19:33 +0200)]
Fix support for EDP with respect to multisystem support.
EDP VLAN are transmitted in another VLAN and therefore need to be
attached to the right existing system.
Vincent Bernat [Sat, 23 May 2009 13:04:22 +0000 (15:04 +0200)]
Simplify multiprotocols handling.
Remove probing. This is not very usable for now but this will be
enhanced when we will support multiple systems on the same port.
Vincent Bernat [Thu, 21 May 2009 08:50:40 +0000 (10:50 +0200)]
Fix the case where last change < start time.
This case can happen if the master agent is restarted: lldpd last
change will be before the start of the master agent.
Vincent Bernat [Tue, 17 Mar 2009 14:01:40 +0000 (15:01 +0100)]
Some virtual ethernet interfaces do not have IFF_MULTICAST flag. We
use them if they have at least the IFF_BROADCAST flag. This is useful
for Xen Dom0 to get LLDP information from DomU.
Vincent Bernat [Sun, 8 Mar 2009 15:47:17 +0000 (16:47 +0100)]
When cleaning up a port in the context of refreshing gathered
information, don't clean LLDP-MED location information. However, when
cleaning up a port for removal, clean them.
Vincent Bernat [Sun, 8 Mar 2009 15:01:22 +0000 (16:01 +0100)]
Major rewrite for packet builder and parser.
Packet builder now uses POKE_* macro that push bytes one by one using
memcpy to avoid any alignment issue that may appear on architectures
like ARM. The use of those macros instead of IOV renders the code
usually smaller except for very simple protocols.
Packet parser does not use structure casting any more. This is not
safe on architectures that do not handle unaligned read. We now read
packets sequentially using memcpy when reading more than one byte.
This makes the parser harder to read and somewhat longer.