]> git.ipfire.org Git - thirdparty/lldpd.git/log
thirdparty/lldpd.git
12 years agoAdd autoreconf to call autogen.sh while build deb 28/head
Zealot [Tue, 26 Feb 2013 09:16:43 +0000 (17:16 +0800)] 
Add autoreconf to call autogen.sh while build deb

12 years agobuild: also ship ./autogen.sh
Vincent Bernat [Wed, 20 Feb 2013 22:12:32 +0000 (23:12 +0100)] 
build: also ship ./autogen.sh

12 years agobuild: use the same way as libbsd for version and changelog
Vincent Bernat [Wed, 20 Feb 2013 22:11:59 +0000 (23:11 +0100)] 
build: use the same way as libbsd for version and changelog

See:
 http://cgit.freedesktop.org/libbsd/tree/

12 years agobuild: try to save current version in `VERSION`
Vincent Bernat [Wed, 20 Feb 2013 21:35:57 +0000 (22:35 +0100)] 
build: try to save current version in `VERSION`

12 years agoinstall: remove liblldpctl previous symbolic link
Vincent Bernat [Wed, 13 Feb 2013 07:35:18 +0000 (08:35 +0100)] 
install: remove liblldpctl previous symbolic link

Otherwise, we get an error on "make install".

12 years agoconfigure: only match tags starting with a digit for version number
Vincent Bernat [Tue, 12 Feb 2013 19:53:36 +0000 (20:53 +0100)] 
configure: only match tags starting with a digit for version number

12 years agobuild: check if libevent as provided by pkg-config is working
Vincent Bernat [Mon, 4 Feb 2013 07:38:08 +0000 (08:38 +0100)] 
build: check if libevent as provided by pkg-config is working

If a user installs both libevent 2.0.x and libevent 1.4.x, pkg-config
may report libevent 2.0.x where it really is 1.4.x. The system is
broken in this case but we work-around this by using the shipped
libevent.

12 years agodoc: add documentation about reading /etc/lldpd.conf and /etc/lldpd.d/*
Vincent Bernat [Sun, 3 Feb 2013 08:58:01 +0000 (09:58 +0100)] 
doc: add documentation about reading /etc/lldpd.conf and /etc/lldpd.d/*

12 years agointerfaces: whitelist an interface before being checking lower
Vincent Bernat [Sun, 3 Feb 2013 08:38:19 +0000 (09:38 +0100)] 
interfaces: whitelist an interface before being checking lower

Some whitelisted interfaces, like dsa, have a lower interface in
managed mode but we still want to advertise on it. Move the check for
lower interface after whitelisting.

12 years agolibevent: produce smaller binaries when shipping libevent
Vincent Bernat [Tue, 29 Jan 2013 20:42:37 +0000 (21:42 +0100)] 
libevent: produce smaller binaries when shipping libevent

When shipping libevent, we try to build smaller binaries by disabling
unneeded stuff (openssl, threading, malloc replacement, debug stuff)
and enabling `--gc-sections`. On various tests, this remove 80K from
lldpd size (stripping excluded).

12 years agolldpcli: possibility to configure tx-delay
Vincent Bernat [Tue, 22 Jan 2013 22:14:53 +0000 (23:14 +0100)] 
lldpcli: possibility to configure tx-delay

12 years agolldpcli: fix exit command
Vincent Bernat [Tue, 22 Jan 2013 22:02:48 +0000 (23:02 +0100)] 
lldpcli: fix exit command

The exit command did not exit lldpcli anymore.

12 years agolldpcli: split actions.c in several files
Vincent Bernat [Tue, 22 Jan 2013 21:49:33 +0000 (22:49 +0100)] 
lldpcli: split actions.c in several files

We need `configure` to be more modulable.

12 years agolldpcli: put port restriction into a commands.c for use in other files
Vincent Bernat [Tue, 22 Jan 2013 21:33:57 +0000 (22:33 +0100)] 
lldpcli: put port restriction into a commands.c for use in other files

12 years agolldpd: discard output of lldpcli
Vincent Bernat [Tue, 22 Jan 2013 08:51:06 +0000 (09:51 +0100)] 
lldpd: discard output of lldpcli

We keep stderr since we may have logs here.

12 years agolldpd: pause only if lldpcli has not been disabled
Vincent Bernat [Tue, 22 Jan 2013 08:49:52 +0000 (09:49 +0100)] 
lldpd: pause only if lldpcli has not been disabled

12 years agolldpd: pause at start, unpause through lldpcli
Vincent Bernat [Tue, 22 Jan 2013 08:46:01 +0000 (09:46 +0100)] 
lldpd: pause at start, unpause through lldpcli

lldpd will be paused at start. Nothing will run. lldpcli job is to
unpause it once the configuration has been read.

12 years agolldpd: invoke lldpcli at start
Vincent Bernat [Sat, 19 Jan 2013 15:13:50 +0000 (16:13 +0100)] 
lldpd: invoke lldpcli at start

To configure itself, lldpd now invokes lldpcli when
starting. Currently, it does not really check if everything works as
expected but in the future, lldpcli will ask lldpd to "start".

The configuration files are:
 - ${sysconfdir}/lldpd.conf
 - ${sysconfdir}/lldpd.d/*.conf

12 years agoctl: close control socket on error when connecting
Vincent Bernat [Sun, 20 Jan 2013 12:18:30 +0000 (13:18 +0100)] 
ctl: close control socket on error when connecting

12 years agobuild: lib and client don't need shipped OS specific headers
Vincent Bernat [Sun, 20 Jan 2013 10:47:47 +0000 (11:47 +0100)] 
build: lib and client don't need shipped OS specific headers

12 years agolldpcli: add an option to read commands from files
Vincent Bernat [Fri, 18 Jan 2013 22:33:34 +0000 (23:33 +0100)] 
lldpcli: add an option to read commands from files

12 years agoFix some spelling mistakes.
Vincent Bernat [Fri, 18 Jan 2013 01:00:51 +0000 (02:00 +0100)] 
Fix some spelling mistakes.

12 years agodebian: don't remove inexistent CHANGELOG file
Vincent Bernat [Fri, 18 Jan 2013 00:57:08 +0000 (01:57 +0100)] 
debian: don't remove inexistent CHANGELOG file

12 years agodebian: provide a development package for liblldpctl
Vincent Bernat [Fri, 18 Jan 2013 00:56:53 +0000 (01:56 +0100)] 
debian: provide a development package for liblldpctl

12 years agopriv: add ability to lock filter on Linux
Vincent Bernat [Thu, 17 Jan 2013 21:01:34 +0000 (22:01 +0100)] 
priv: add ability to lock filter on Linux

This is a new feature which should be available in Linux 3.9. See:
 http://git.kernel.org/?p=linux/kernel/git/davem/net-next.git;a=commit;h=d59577b6ffd313d0ab3be39cb1ab47e29bdc9182

12 years agopriv: make inability to set write filter as fatal
Vincent Bernat [Thu, 17 Jan 2013 21:00:24 +0000 (22:00 +0100)] 
priv: make inability to set write filter as fatal

On BSD, if the userland supports an ioctl, the kernel is in sync and
also supports the ioctl. So, if BIOCSETWF exists, it should succeed.

12 years agopriv: create chroot if it does not exist
Vincent Bernat [Thu, 17 Jan 2013 08:02:48 +0000 (09:02 +0100)] 
priv: create chroot if it does not exist

This is not the ideal situation since the chroot should maybe contain
some additional stuff (like `/etc/localtime` with GNU libc) to make it
work properly, but this is more convenient that leaving the user does
exactly the same things. Packagers are still expected to populate the
chroot correctly before starting lldpd.

12 years agopriv: lock BPF interface on BSD
Vincent Bernat [Mon, 14 Jan 2013 09:21:13 +0000 (10:21 +0100)] 
priv: lock BPF interface on BSD

We move all BPF setup in the monitor process. When the socket is
configured, we lock it. This works for both OpenBSD and FreeBSD. This
feature does not seem to exist on Linux. However, for consistency, we
also move BPF filter setup in priv.c for Linux.

12 years agolldpcli: add "help" command in manual page
Vincent Bernat [Sun, 13 Jan 2013 13:21:11 +0000 (14:21 +0100)] 
lldpcli: add "help" command in manual page

12 years agoosx: don't include "head" bits in homebrew formula
Vincent Bernat [Sun, 13 Jan 2013 12:24:09 +0000 (13:24 +0100)] 
osx: don't include "head" bits in homebrew formula

We will add them back when they work.

12 years agoosx: update Homebrew formula with JSON and SNMP support
Vincent Bernat [Sun, 13 Jan 2013 12:23:32 +0000 (13:23 +0100)] 
osx: update Homebrew formula with JSON and SNMP support

12 years agosnmp: workaround unknown value for RONLY
Vincent Bernat [Sun, 13 Jan 2013 12:15:52 +0000 (13:15 +0100)] 
snmp: workaround unknown value for RONLY

This happens when Net-SNMP has been compiled with
NETSNMP_NO_LEGACY_DEFINITIONS defined. For example, on Mac OS X. This
seems a good way to deprecate an API still widely used just because it
is not used internally... <grin>

12 years agomarshal: serialization may return 0 and target untouched
Vincent Bernat [Sun, 13 Jan 2013 10:25:39 +0000 (11:25 +0100)] 
marshal: serialization may return 0 and target untouched

If serialization finds a structure already serialized, it skips it and
return 0. `target` should not be freed.

12 years agosnmp: frame.h is not needed anymore
Vincent Bernat [Sun, 13 Jan 2013 10:08:35 +0000 (11:08 +0100)] 
snmp: frame.h is not needed anymore

The `frame_checksum()` function is declared in `lldpd.h`.

12 years agoclang: additional fixes detected by clang analyzer
Vincent Bernat [Sun, 13 Jan 2013 10:02:28 +0000 (11:02 +0100)] 
clang: additional fixes detected by clang analyzer

12 years agoSmall fixes detected by clang analyzer.
Vincent Bernat [Sun, 13 Jan 2013 01:53:37 +0000 (02:53 +0100)] 
Small fixes detected by clang analyzer.

 - log: mark `fatal*()` function as noreturn
 - event: insert client in the list after its creation
 - lldpcli: avoid confusion by initializing cargc to 0
 - lldpd: avoid ambiguous use of strlen() in initialization
 - lldp/edp: fix memory leaks
 - tokenizer: fix a memory leak in low memory condition
 - cdp: don't accept too short TLV for port description

12 years agopackaging: update packaging stuff for release 0.7.1
Vincent Bernat [Sat, 12 Jan 2013 23:46:46 +0000 (00:46 +0100)] 
packaging: update packaging stuff for release

12 years agobuild: more changelog drama
Vincent Bernat [Sat, 12 Jan 2013 23:23:53 +0000 (00:23 +0100)] 
build: more changelog drama

We need ChangeLog to be listed in `dist_doc_DATA` or
`doc_DATA`. Therefore, we list it in the former and if we happen to
install from git, we just ship an empty ChangeLog.

12 years agosystemd: don't use SOCK_CLOEXEC
Vincent Bernat [Sat, 12 Jan 2013 23:03:32 +0000 (00:03 +0100)] 
systemd: don't use SOCK_CLOEXEC

It is unknown on RHEL5. Moreover, we promise to not exec anything in
this function.

12 years agoevent: replace obsolete `sigignore()` by `signal()`
Vincent Bernat [Sat, 12 Jan 2013 22:32:54 +0000 (23:32 +0100)] 
event: replace obsolete `sigignore()` by `signal()`

12 years agodoc: new homepage for lldpd
Vincent Bernat [Sat, 12 Jan 2013 22:01:44 +0000 (23:01 +0100)] 
doc: new homepage for lldpd

12 years agocompat: add `strnlen()` which may be absent on some older systems
Vincent Bernat [Fri, 11 Jan 2013 17:53:10 +0000 (18:53 +0100)] 
compat: add `strnlen()` which may be absent on some older systems

12 years agobsd: compatibility with systems that do not have interface descriptions
Vincent Bernat [Fri, 11 Jan 2013 17:42:50 +0000 (18:42 +0100)] 
bsd: compatibility with systems that do not have interface descriptions

12 years agobuild: fix changelog generation
Vincent Bernat [Fri, 11 Jan 2013 00:25:32 +0000 (01:25 +0100)] 
build: fix changelog generation

We really only want to generate changelog when building the dist
tarball. We force its generation using a fake PHONY target. We don't
list it as a dist_* something since it does not exist yet. Therefore,
we don't have to clean it.

12 years agoosx: add an homebrew formula
Vincent Bernat [Fri, 11 Jan 2013 00:07:38 +0000 (01:07 +0100)] 
osx: add an homebrew formula

This formula is currently incorrect because of the bad MD5 sum. We
will correct it at the first release supporting Mac OS X.

12 years agoconfigure: compatibility with automake 1.12
Vincent Bernat [Thu, 10 Jan 2013 23:01:31 +0000 (00:01 +0100)] 
configure: compatibility with automake 1.12

AM_PROG_AR should be used. The reason seems a bit obscure. This should
be done in libtool.

12 years agoautogen: don't use readlink -f
Vincent Bernat [Thu, 10 Jan 2013 22:52:26 +0000 (23:52 +0100)] 
autogen: don't use readlink -f

This is not portable. We are only interested in the basename, let's
just use $PWD instead of `.`.

12 years agoautogen: allow to override commands used
Vincent Bernat [Thu, 10 Jan 2013 22:44:51 +0000 (23:44 +0100)] 
autogen: allow to override commands used

For example:

    LIBTOOLIZE=glibtoolize ./autogen.sh

12 years agodmi: implementation for Mac OS X.
Vincent Bernat [Thu, 10 Jan 2013 22:11:23 +0000 (23:11 +0100)] 
dmi: implementation for Mac OS X.

We use the IOKit framework.

12 years agoMac OS X support.
Vincent Bernat [Thu, 10 Jan 2013 19:23:57 +0000 (20:23 +0100)] 
Mac OS X support.

This includes bond, VLAN and bridge support. Mac OS X is pretty
similar to FreeBSD except for bonding which is different. Bonding code
is stolen from ifconfig.c. Header files from XNU are
shipped because they are missing from Mac OS X developer tools.

Still missing:
 - integration into launchd
 - homebrew formula
 - DMI part (through ioreg)

12 years agobuild: add tag date in changelog
Vincent Bernat [Mon, 7 Jan 2013 21:56:07 +0000 (22:56 +0100)] 
build: add tag date in changelog

12 years agopriv: mirror the exit status of the child
Vincent Bernat [Mon, 7 Jan 2013 20:59:32 +0000 (21:59 +0100)] 
priv: mirror the exit status of the child

When exiting because the child has exited, the privileged processus
will mirror the exit status and the signal that killed the child if
any. This allows monitoring daemon like systemd to detect an
unexpected exit.

12 years agodebian: add systemd support
Vincent Bernat [Sun, 6 Jan 2013 23:53:01 +0000 (00:53 +0100)] 
debian: add systemd support

Provides a lldpd.service file and let `lldpd` notify systemd when it
is ready using the notification socket.

12 years agolldpd: remove uncleaned control socket when noone is listening
Vincent Bernat [Mon, 7 Jan 2013 11:26:25 +0000 (12:26 +0100)] 
lldpd: remove uncleaned control socket when noone is listening

12 years agodebian: provide an upstart job
Vincent Bernat [Sun, 6 Jan 2013 23:24:31 +0000 (00:24 +0100)] 
debian: provide an upstart job

lldpd daemonization seems to confuse upstart (I think this is because
it also forks the monitor process, otherwise the daemonization is
pretty classic). Therefore, when we detect we are run by
upstart (because of UPSTART_JOB variable), we raise the SIGSTOP signal
instead of daemonizing. Upstart notices it and will resume us and
consider we are ready. No more misleading fork.

Also, ignore SIGHUP which is used for reload.

12 years agoREADME: mention multi-OS support
Vincent Bernat [Sun, 6 Jan 2013 15:47:01 +0000 (16:47 +0100)] 
README: mention multi-OS support

And mention `lldpcli` in place of `lldpctl`.

12 years agodebian: update Debian packaging.
Vincent Bernat [Sun, 6 Jan 2013 15:46:36 +0000 (16:46 +0100)] 
debian: update Debian packaging.

The diff from the official package is now a lot smaller.

12 years agoredhat: fix Redhat packaging
Vincent Bernat [Sun, 6 Jan 2013 15:42:12 +0000 (16:42 +0100)] 
redhat: fix Redhat packaging

Call /sbin/ldconfig on postinstall.

12 years agoredhat: update lldpd.spec
Vincent Bernat [Sun, 6 Jan 2013 13:56:25 +0000 (14:56 +0100)] 
redhat: update lldpd.spec

12 years agobuild: fix generation of ChangeLog
Vincent Bernat [Sun, 6 Jan 2013 13:45:53 +0000 (14:45 +0100)] 
build: fix generation of ChangeLog

We must be able to have one when git is not present because we include
it in dist, but we also must generate it on each release. The previous
fix would keep the ChangeLog empty or not updated. We use a PHONY
target instead (and not a real PHONY target since we cannot add it
because automake doesn't like it).

12 years agolldpcli: add a "help" command. 0.7.0
Vincent Bernat [Sun, 6 Jan 2013 13:06:19 +0000 (14:06 +0100)] 
lldpcli: add a "help" command.

This should come handy for people not having readline or completion.

12 years agolldpcli: fix "source unknown" for Dot3/LLDP-MED power.
Vincent Bernat [Sun, 6 Jan 2013 12:34:36 +0000 (13:34 +0100)] 
lldpcli: fix "source unknown" for Dot3/LLDP-MED power.

12 years agolldpcli: don't rely on `rl_delete_text()`
Vincent Bernat [Sun, 6 Jan 2013 12:21:51 +0000 (13:21 +0100)] 
lldpcli: don't rely on `rl_delete_text()`

Even recent versions of libedit do not include `rl_delete_text()`
compatibility function. We don't use it.

12 years agolldpcli: make readline library optional.
Vincent Bernat [Sun, 6 Jan 2013 10:43:33 +0000 (11:43 +0100)] 
lldpcli: make readline library optional.

And improve compatibility. We should be compatible with BSD
libedit. However, we are not compatible with older versions that lack
`rl_insert_text()` and `rl_delete_text()`.

12 years agolldpcli: switch to GNU Readline.
Vincent Bernat [Sun, 6 Jan 2013 09:47:21 +0000 (10:47 +0100)] 
lldpcli: switch to GNU Readline.

libedit is not available on old versions of Linux distro. We try to
use Readline API instead which may be compatible with the libedit
version available in BSD.

This means that we have to write our own tokenizer. This also means
that we can make Readline optional.

12 years agoevent: trigger the main iteration when starting the main loop.
Vincent Bernat [Sat, 5 Jan 2013 19:57:24 +0000 (20:57 +0100)] 
event: trigger the main iteration when starting the main loop.

Otherwise, nothing will happen until there is an interface change...

12 years agolldpcli: ensure `conn` is initialized to NULL to avoid a compiler warning
Vincent Bernat [Sat, 5 Jan 2013 19:44:53 +0000 (20:44 +0100)] 
lldpcli: ensure `conn` is initialized to NULL to avoid a compiler warning

12 years agolldpcli: don't propose configure for options not compiled
Vincent Bernat [Sat, 5 Jan 2013 16:37:37 +0000 (17:37 +0100)] 
lldpcli: don't propose configure for options not compiled

We don't rely on ENABLE_* variables to keep lldpcli independant of the
source code of the library.

12 years agolib: fix a compilation problem when LLDP-MED or Dot3 were disabled
Vincent Bernat [Sat, 5 Jan 2013 16:31:02 +0000 (17:31 +0100)] 
lib: fix a compilation problem when LLDP-MED or Dot3 were disabled

12 years agoredhat: also ship lldpcli
Vincent Bernat [Sat, 5 Jan 2013 16:24:33 +0000 (17:24 +0100)] 
redhat: also ship lldpcli

12 years agoredhat: add libedit-devel for RPM distros as well
Vincent Bernat [Sat, 5 Jan 2013 16:22:46 +0000 (17:22 +0100)] 
redhat: add libedit-devel for RPM distros as well

12 years agodebian: also add libedit-dev as a dependency
Vincent Bernat [Sat, 5 Jan 2013 16:21:21 +0000 (17:21 +0100)] 
debian: also add libedit-dev as a dependency

12 years agotravis: add libedit-dev in the dependencies
Vincent Bernat [Sat, 5 Jan 2013 16:20:56 +0000 (17:20 +0100)] 
travis: add libedit-dev in the dependencies

12 years agolldpcli: let libedit install its own signal handlers (SIGWINCH)
Vincent Bernat [Sat, 5 Jan 2013 16:13:02 +0000 (17:13 +0100)] 
lldpcli: let libedit install its own signal handlers (SIGWINCH)

12 years agoMerge branch 'feature/1/cli'
Vincent Bernat [Sat, 5 Jan 2013 16:00:05 +0000 (17:00 +0100)] 
Merge branch 'feature/1/cli'

12 years agodoc: fix doxygen warnings and don't parse include/linux
Vincent Bernat [Sat, 5 Jan 2013 15:59:53 +0000 (16:59 +0100)] 
doc: fix doxygen warnings and don't parse include/linux

12 years agoconfigure: detect libedit without pkg-config
Vincent Bernat [Sat, 5 Jan 2013 15:59:41 +0000 (16:59 +0100)] 
configure: detect libedit without pkg-config

BSD comes with libedit shipped and without pkg-config being able to
detect it. Fallback to manual detection of the headers and check if we
can compile a program with it.

12 years agobuild: no need to save CFLAGS LDFLAGS when testing libevent
Vincent Bernat [Sat, 5 Jan 2013 15:39:04 +0000 (16:39 +0100)] 
build: no need to save CFLAGS LDFLAGS when testing libevent

12 years agolldpcli: accept a command from the command line arguments
Vincent Bernat [Sat, 5 Jan 2013 15:09:29 +0000 (16:09 +0100)] 
lldpcli: accept a command from the command line arguments

As stated in the manual page, lldpcli should accept a command from
command line arguments.

12 years agolldpcli: fix manual page about specifying ports.
Vincent Bernat [Sat, 5 Jan 2013 15:03:20 +0000 (16:03 +0100)] 
lldpcli: fix manual page about specifying ports.

Ports are comma-separated list.

12 years agolldpcli: rename lldpctl to lldpcli.
Vincent Bernat [Sat, 5 Jan 2013 15:00:33 +0000 (16:00 +0100)] 
lldpcli: rename lldpctl to lldpcli.

We also provide a backward-compatible lldpctl.

12 years agolldpctl: remove "unconfigure" commands (not implemented)
Vincent Bernat [Sat, 5 Jan 2013 13:49:51 +0000 (14:49 +0100)] 
lldpctl: remove "unconfigure" commands (not implemented)

This seems better to remove them instead of documenting them but not
implementing them. The API makes it difficult to implement them for
now.

12 years agolldpctl: add a CLI
Vincent Bernat [Sat, 5 Jan 2013 13:44:46 +0000 (14:44 +0100)] 
lldpctl: add a CLI

CLI provides contextual help and completion. It uses libedit.

12 years agolib: add a function to retrieve a map
Vincent Bernat [Sat, 5 Jan 2013 12:24:10 +0000 (13:24 +0100)] 
lib: add a function to retrieve a map

Some values can only take a discrete number of int values. We have a
map to display them as string. We provide this map through a function
and we also accept values from this map as string input. This is a
slight change in the API but it should be backward compatible.

12 years agolib: fix a memory leak when setting LLDP-MED ELIN number
Vincent Bernat [Fri, 4 Jan 2013 22:07:00 +0000 (23:07 +0100)] 
lib: fix a memory leak when setting LLDP-MED ELIN number

12 years agoevent: make levent_send_now() work again
Vincent Bernat [Tue, 1 Jan 2013 13:08:39 +0000 (14:08 +0100)] 
event: make levent_send_now() work again

12 years agoNEWS: add a word about detecting interface changes
Vincent Bernat [Mon, 31 Dec 2012 17:58:58 +0000 (18:58 +0100)] 
NEWS: add a word about detecting interface changes

And also dump next version to 0.7.0. We have a lot of changes here.

12 years ago*bsd: listen on PF_ROUTE socket to get interface changes
Vincent Bernat [Mon, 31 Dec 2012 17:57:07 +0000 (18:57 +0100)] 
*bsd: listen on PF_ROUTE socket to get interface changes

Only OpenBSD is able to filter messages. We could filter messages for
FreeBSD and NetBSD after receiving them but we don't bother doing
it. Any change will trigger a rescan of the interfaces. Since this
cannot happen more than once per second, this should be OK for most
people.

12 years agoevent: avoid socket leak if we cannot register netlink socket
Vincent Bernat [Mon, 31 Dec 2012 17:56:02 +0000 (18:56 +0100)] 
event: avoid socket leak if we cannot register netlink socket

12 years agoevent: use a separate event timer for each port
Vincent Bernat [Mon, 31 Dec 2012 17:25:42 +0000 (18:25 +0100)] 
event: use a separate event timer for each port

Each port will have its own live with its own timer. If a port just
appeared, it will have its own 30 seconds timer. We also notice
changes independently on each port, so the timer is reset on each
change on a given port.

Also, as a safeguard, update port-related information every 10
minutes. We can catch changes in addresses this way (otherwise,
detecting them via netlink is noisy).

12 years agolldpd: remove unused `g_lastsent`
Vincent Bernat [Mon, 31 Dec 2012 16:52:02 +0000 (17:52 +0100)] 
lldpd: remove unused `g_lastsent`

Since migration to libevent, `g_lastsent` variable in `struct lldpd`
was not used anymore.

12 years agomarshal: ensure that two identic structures are serialized in the same way
Vincent Bernat [Sun, 30 Dec 2012 18:12:52 +0000 (19:12 +0100)] 
marshal: ensure that two identic structures are serialized in the same way

Because we serialized pointers unchanged and use them to track
substructures, two identic structures located at different places in
the memory were serialized as two different buffers. It is easy to use
"dummy" pointers instead of real ones and then be able to compare two
structures by serializing them and compare the resulting buffers.

However, those two structures should be calloced to make this
works. When allocating from the stack, use of designated initializers
don't mean anything about padded memory (no guarantee that it will be
set to 0).

12 years agoNEWS: add a word about NetBSD support
Vincent Bernat [Sun, 30 Dec 2012 11:26:21 +0000 (12:26 +0100)] 
NEWS: add a word about NetBSD support

12 years agointerfaces: correctly detect link down interfaces
Vincent Bernat [Sun, 30 Dec 2012 11:22:21 +0000 (12:22 +0100)] 
interfaces: correctly detect link down interfaces

An interface can be administratively up and operationally down. Handle
this as a down interface.

12 years agonetlink: listen to netlink changes to trigger interface updates
Vincent Bernat [Sun, 23 Dec 2012 10:11:38 +0000 (11:11 +0100)] 
netlink: listen to netlink changes to trigger interface updates

This allows to detect "link down" or new interfaces in a timely
manner. There is still a global event loop for sending LLDPDU to each
port (no per-port sending loop).

12 years agolldpd: cleanup phase is done in `update_local_ports()`
Vincent Bernat [Sun, 30 Dec 2012 10:05:55 +0000 (11:05 +0100)] 
lldpd: cleanup phase is done in `update_local_ports()`

Cleaning up unused ports and chassis is really part of updating local
ports process.

12 years agoglobal: fix some issues detected by cppcheck
Vincent Bernat [Sat, 29 Dec 2012 23:25:31 +0000 (00:25 +0100)] 
global: fix some issues detected by cppcheck

This includes some memory leaks when decoding erroneous LLDP TLV.

12 years agolib: use strlcpy and snprintf instead of strcpy and sprintf
Vincent Bernat [Sat, 29 Dec 2012 18:54:43 +0000 (19:54 +0100)] 
lib: use strlcpy and snprintf instead of strcpy and sprintf

Even if we used strcpy and sprintf safely, use strlcpy and snprintf to
show that we know what we do (and make OpenBSD linker happy).

12 years agoopenbsd: add DMI information
Vincent Bernat [Sat, 29 Dec 2012 18:51:27 +0000 (19:51 +0100)] 
openbsd: add DMI information

12 years agoopenbsd: don't use BIOCSSEESENT with OpenBSD
Vincent Bernat [Sat, 29 Dec 2012 17:59:07 +0000 (18:59 +0100)] 
openbsd: don't use BIOCSSEESENT with OpenBSD

This does not exist. Switch back to BIOCSDIRFILT.