Commit graph

15 commits

Author SHA1 Message Date
Tom Gundersen 76fba3ca60 Merge pull request #1735 from thom311/master
lldp: avoid compiler warnings in lldp_tfl_package_read* functions
2015-11-10 14:41:35 +01:00
Jan Engelhardt a8eaaee72a doc: correct orthography, word forms and missing/extraneous words 2015-11-06 13:45:21 +01:00
Thomas Haller 9ac8e91324 lldp: avoid compiler warnings in lldp_tfl_package_read* functions
gcc 5.1.1 wrongly warns about uninitialized variable @r2 when compiling
with "-Og". Refactor the code to avoid the warnings.

Fixes: 564cabd46c
2015-10-31 22:30:14 +01:00
Lennart Poettering b5efdb8af4 util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
Beniamino Galvani 29eca2ff89 lldp: fix parsing of TLV length
tlv_packet_read_bytes() and tlv_packet_read_string() returned the
wrong length when called after other functions which modify the offset
in the container.

In other words, if the TLV data length is X and we do a
tlv_packet_read_u8(), a subsequent tlv_packet_read_bytes() should
return a length of (X - 1).
2015-10-02 17:39:22 +02:00
Beniamino Galvani 564cabd46c lldp: check return value of lldp_tlv_packet_exit_container() 2015-10-02 17:39:22 +02:00
Beniamino Galvani d8c89d6198 lldp: add support for organizationally specific TLVs
LLDP TLVs of type 127 are used to carry organizationally specific
information and include additional fields to specify the OUI and
subtype.

Add support for parsing such fields and functions to access the most
common IEEE 802.1 specific TLVs.
2015-10-02 17:39:22 +02:00
Beniamino Galvani 11e8357164 lldp: factor out common code in lldp-tlv.c 2015-10-02 17:39:22 +02:00
Beniamino Galvani 4fc6de5df3 lldp: add sd_lldp_tlv_packet_get_destination_type()
It can be useful to know the destination address of a LLDP frame
because it determines the scope of propagation of the frame and thus
this information be used to know whether the neighbor is connected to
the same physical link.

See clause 7.1 of IEEE Std 802.1AB-2009.
2015-10-02 17:39:22 +02:00
Beniamino Galvani b57003ecc3 lldp: move TLV related functions to lldp-tlv.c
Move some public functions from lldp-internal.c to lldp-tlv.c, as now
they are not internal functions anymore.
2015-10-02 17:39:22 +02:00
Beniamino Galvani 176c355b43 lldp: export opaque TLV type and accessor functions
Export struct tlv_packet as a public opaque sd_lldp_packet type and
make its accessor functions public.
2015-10-02 17:39:12 +02:00
Beniamino Galvani 2212d76d08 lldp: add reference counter to struct tlv_packet
Add a reference counter to the tlv_packet structure so that it can be
shared between multiple users and properly free'd when no longer in
use.
2015-10-02 17:11:40 +02:00
Thomas Hindoe Paaboel Andersen 920b52e490 tree-wide: remove spurious space 2015-06-08 23:11:26 +02:00
Harald Hoyer a7f7d1bde4 fix gcc warnings about uninitialized variables
like:

src/shared/install.c: In function ‘unit_file_lookup_state’:
src/shared/install.c:1861:16: warning: ‘r’ may be used uninitialized in
this function [-Wmaybe-uninitialized]
         return r < 0 ? r : state;
                ^
src/shared/install.c:1796:13: note: ‘r’ was declared here
         int r;
             ^
2015-03-27 14:57:38 +01:00
Susant Sahani ad1ad5c8e3 networkd: Introduce Link Layer Discovery Protocol (LLDP)
This patch introduces LLDP support to networkd. it implements the
receiver side of the protocol.

The Link Layer Discovery Protocol (LLDP) is an industry-standard,
vendor-neutral method to allow networked devices to advertise
capabilities, identity, and other information onto a LAN. The Layer 2
protocol, detailed in IEEE 802.1AB-2005.LLDP allows network devices
that operate at the lower layers of a protocol stack (such as
Layer 2 bridges and switches) to learn some of the capabilities
and characteristics of LAN devices available to higher
layer protocols.
2014-12-19 08:02:45 +05:30