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.
Vincent Bernat [Mon, 3 May 2010 13:27:15 +0000 (15:27 +0200)]
Revert "Blacklist VMWare interfaces (as per ticket #40)."
It seems that vnetX interfaces are also used by other virtualization
solutions. From now on, we rely only on the queue len of the interface
and not on the name.
Vincent Bernat [Sun, 11 Apr 2010 12:53:32 +0000 (14:53 +0200)]
Ignore interfaces with no queue.
This filters out vnet* interfaces and some others. It seems that
physical (real or virtual) interfaces always have a queue. We might
also check qdisc. If "noop", this means that the interface is a
blackhole and should be ignored. However, we wait for an actual
interface to exhibit a behaviour where such a detection is needed.
Vincent Bernat [Sun, 4 Apr 2010 07:53:58 +0000 (09:53 +0200)]
Add SNMP support of lldpXMedPoE stuff.
Since LLDP-MED MIB does not allow to store per-port information for PD
devices and does not allow a device to be both PSE and PD (even on
different ports), we try to work around this.
802.3af/at does not have this limitation. All those information are
per-port.
Vincent Bernat [Tue, 23 Mar 2010 14:32:29 +0000 (15:32 +0100)]
Fix hang issue in select() loop with SNMP.
The last argument of snmp_select_info() should be set to 0 and should
be checked to be 0 after call. Otherwise, the timeval argument should
be ignored.
Vincent Bernat [Fri, 12 Mar 2010 13:47:05 +0000 (14:47 +0100)]
Allow to force a protocol.
This fixes ticket #34. By using the option to enable a protocol twice,
we are able to speak a protocol even when no peer is detected. In this
case, packets are sent even when another protocol is detected. A new
parameter has been added to get this behaviour for LLDP as well.
Vincent Bernat [Fri, 12 Mar 2010 16:12:52 +0000 (17:12 +0100)]
Remove unused chassis in lldpd_cleanup() instead of lldpd_port_cleanup().
In some cases, lldpd_port_cleanup() is called when a reference to the
chassis that will be removed is hold for updating. This happens when
we need to update the information on a chassis known by only one port:
1. we find that the chassis is still the same
2. we remove the port and hence remove the chassis which becomes
unused and freed
3. with the previous reference to the chassis, we try to update it
with new information while it has been freed.
Freeing in lldpd_cleanup() is more natural and less risky.
Vincent Bernat [Fri, 12 Mar 2010 11:03:24 +0000 (12:03 +0100)]
Retrieve FD_SETSIZE in a sane environment.
Since we import linux/if.h, in some environment, we may end up
importing kernel FD_SETSIZE that may be inappropriate (too large). For
example, on Sarge systems, FD_SETSIZE becomes 8192 instead of 1024 but
FD_ISSET is unable to handle this size.
Vincent Bernat [Wed, 10 Mar 2010 07:22:40 +0000 (08:22 +0100)]
Increase refcount of the local chassis when a new port is created.
Also add an explanation of refcount handling in a part of the code
that was a bit difficult to follow. Now, each time that p_chassis is
affected to a new value, c_refcount should be updated accordingly.
Vincent [Sat, 6 Mar 2010 08:53:40 +0000 (09:53 +0100)]
Avoid dereferencing a type-punned pointer.
When passing a file descriptor, we were dereferencing a unsigned char
pointer. This breaks strict-aliasing rules in C99. Moreover, we should
care about the alignment (even if in this case, this is aligned
because the previous member of the struct is an int). Therefore, we
use memcpy instead.
Vincent [Sat, 6 Mar 2010 08:41:53 +0000 (09:41 +0100)]
Free unused chassis.
When reference count for a chassis drops to 0, we free the chassis.
This cannot happen to the local chassis because a reference should be
held to it even without any local port.
Make lldpctl refuse attempts to change anything when running setuid.
When running setuid, lldpctl now refuses to set location data. This should
make it save to run the program setuid root by normal users including a
web-server f.e.
Vincent [Sat, 27 Feb 2010 09:18:03 +0000 (10:18 +0100)]
Allow to specify the AgentX socket to use (instead of the default one).
This means that AgentX can be configured to use tcp:127.0.0.1:705 (for
example). Since we are running in a chroot, we cannot use hostnames.
Any network socket should work. Unix sockets should work as before
(using privilege separation).