summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/lldp-internal.c
AgeCommit message (Collapse)Author
2015-11-27tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering
GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
2015-10-27util-lib: split out allocation calls into alloc-util.[ch]Lennart Poettering
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-10-02lldp: move lldp_receive_packet() to lldp-internal.cBeniamino Galvani
In order to implement tests for the LLDP state machine, we need to mock lldp_network_bind_raw_socket(). Move the other function lldp_receive_packet() to another file so that we can replace the first function with a custom one and keep the second one.
2015-10-02lldp: move TLV related functions to lldp-tlv.cBeniamino Galvani
Move some public functions from lldp-internal.c to lldp-tlv.c, as now they are not internal functions anymore.
2015-10-02lldp: export opaque TLV type and accessor functionsBeniamino Galvani
Export struct tlv_packet as a public opaque sd_lldp_packet type and make its accessor functions public.
2015-10-02lldp: change order of arguments of lldp_read_*() functionsBeniamino Galvani
These functions are going to be exported, swap the 'data' and 'length' arguments so that their signature is consistent with the rest of the code.
2015-10-02lldp: add reference counter to struct tlv_packetBeniamino Galvani
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-08-27network: get rid of more RefCnt usageLennart Poettering
A follow-up to 3733eec3e292e4ddb4cba5eb8d3bd8cbee7102d8
2015-03-13Use space after a silencing (void)Zbigniew Jędrzejewski-Szmek
We were using a space more often than not, and this way is codified in CODING_STYLE.
2015-03-13tree-wide: there is no ENOTSUP on linuxDavid Herrmann
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-01-15LLDP: Support locally assigned port subtypeSusant Sahani
The Zyxel switch sends port subtype as Locally assigned (7). Add LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED as supported type reported by Mantas Mikulėnas <grawity@gmail.com>
2014-12-31lldp: fix uninitialized cleanup var #2David Herrmann
Another uninitialized variable marked as _cleanup_. Set it to NULL to avoid accessing uninitialized memory.
2014-12-31lldp: fix uninitialized cleanup varDavid Herrmann
Make sure to set _cleanup_ variables to NULL. Otherwise, we free uninitialized objects.
2014-12-19LLDP: Add support for networkctlSusant Sahani
2014-12-19networkd: Introduce Link Layer Discovery Protocol (LLDP)Susant Sahani
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.