b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
859c37b15243fe71aa71c17ebe02692a336c94e2 |
|
25-Dec-2015 |
Susant Sahani <ssahani@gmail.com> |
V3 LLDP: Add packet validation (system name and description)
LLDP type system name and system description should
be with in 255 characters and unique.
Let's add the validation to discard corrupt packets. |
e5c42b7ff1a45e1bc4e1f21a6da09610f335f83d |
|
25-Dec-2015 |
Susant Sahani <ssahani@gmail.com> |
lldp: improve logging |
4afd3348c7506dd1d36305b7bcb9feb8952b9d6b |
|
27-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easy
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. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
0d39fa9c69b97a2ceb156053deef69c0866c2b97 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: move more file I/O related calls into fileio.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file 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. |
1e2527a6fede996a429bd44b30a15e76ee293437 |
|
05-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
hashmap: hash_funcs - make inputs unambiguous
Make sure all variable-length inputs are properly terminated or that
their length is encoded in some way. This avoids ambiguity of
adjacent inputs.
E.g., in case of a hash function taking two strings, compressing "ab"
followed by "c" is now distinct from "a" followed by "bc". |
b826ab586c9e0a9c0d438a75c28cf3a8ab485929 |
|
05-Oct-2015 |
Tom Gundersen <teg@jklm.no> |
hashmap: refactor hash_func
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.
This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result. |
d8c89d6198651e34786bc78df26f313eede9918b |
|
02-Oct-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
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. |
7434883c40f3623372044f88cdde3eda49ba9758 |
|
02-Oct-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
lldp: add public function to export LLDP TLV packets
Add a public function to get a list of current LLDP neighbours' TLV
packets. The function populates an array of pointers to the opaque
type sd_lldp_packet and returns the number of elements found. Callers
must take care of freeing the array and decreasing the refcount of
elements when done. |
176c355b43e616b61552566303ad59d5fd910333 |
|
02-Oct-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
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. |
97030a86f0137bca52c3cf9b30e5ed3bdf69b2f2 |
|
02-Oct-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
lldp: change order of arguments of lldp_read_*() functions
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. |
2212d76d08f3bc34c683aed1a6736325b841625c |
|
02-Oct-2015 |
Beniamino Galvani <bgalvani@redhat.com> |
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. |
9ef61f2e4802abdb4a2853a82126420b1e77b419 |
|
22-Sep-2015 |
David Herrmann <dh.herrmann@gmail.com> |
sd-lldp: hide internal details
Currently, sd-lldp.h exports "UPDATE_INFO".. and defines it to a magic
constant '10'. This is completely bogus, so fix it to follow our coding
standards:
- Prefix exported symbols by SD_LLDP_*
- Define a separate event-enum for event types
- Translate internal state to external event-types |
27ec691bfd4088b678aa18d0bad90be47d0357f4 |
|
03-Aug-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: convert bootchart and lldp code to use clock_boottime_or_monotonic()
We should avoid using CLOCK_BOOTTIME directly unless we actually can
sensible distuingish it from CLOCK_MONOTONIC. CLOCK_BOOTTIME is only
fully feature on very recent Linux kernels, hence we should stick to a
fallback logic, which is already available in the
clock_boottime_or_monotonic() call. |
dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 |
|
29-Jul-2015 |
Lennart Poettering <lennart@poettering.net> |
tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error
checking, let's unify all that by using fflush_and_check().
This also unifies the general error paths of fflush()+rename() file
writers. |
9bb1bffe3018aef5e70c411f68863eafdc92fddf |
|
02-Jul-2015 |
Susant Sahani <susant@redhat.com> |
lldp: set correct state for processing
ldp_receive_frame after correct processing of the packet the state
should be LLDP_AGENT_RX_WAIT_FOR_FRAME not LLDP_AGENT_RX_UPDATE_INFO. |
dc75168823540076b354135f6e2de7a9a978fbca |
|
14-Mar-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Use space after a silencing (void)
We were using a space more often than not, and this way is
codified in CODING_STYLE. |
2eec67acbb00593e414549a7e5b35eb7dd776b1b |
|
23-Feb-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
remove unused includes
This patch removes includes that are not used. The removals were found with
include-what-you-use which checks if any of the symbols from a header is
in use. |
6b3fd9a14d378a35d95ec4be65065708d092bee2 |
|
05-Jan-2015 |
Torstein Husebø <torstein@huseboe.net> |
libsystemd-network: fix typo in lldp |
ef7532531942d59f81bfbd8a8f923f17e4827952 |
|
01-Jan-2015 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
network: fix scanf/printf format
usec_t is defined as 64 bit wide, but long is 32 bit on many archs. |
ee14ebf211df1322c3d8b550b931bbfa6cb3b033 |
|
31-Dec-2014 |
David Herrmann <dh.herrmann@gmail.com> |
lldp: fix sd_lldp_save()
Fix a bunch of needless memzero() calls, a bunch of use-after-free
regarding _cleanup_free_ and drop unused variables.
Hint: Do NOT use _cleanup_free_ for temporary strappend() helpers that are
freed multiple times. All you safe is the last free() call, which is
really not worth the trouble resetting it to NULL all the time. |
580e55da1118870b6099d1a863d9806a31f2b1b4 |
|
31-Dec-2014 |
David Herrmann <dh.herrmann@gmail.com> |
lldp: fix double free
'k' is marked as _cleanup_free_ so reset it to NULL if we free it
explicitly. |
7a6f1457462840ed52f2a332e2bd56ca210cff2d |
|
19-Dec-2014 |
Tom Gundersen <teg@jklm.no> |
sd-lldp: minor header cleanup
* (potentially) public headers must reside in src/systemd/ (not in
src/libsystemd*)
* some private (not prefixed with sd_) functions moved from sd-lldp.h to
lldp-internal.h
* introduce lldp-util.h for the cleanup macro, as these should not be public
* rename the cleanup macro, we always name them _cleanup_foo_, never
_cleanup_sd_foo_
* mark some function arguments as 'const' |
49699bac94d24b444274f91f85c82e6fad04d029 |
|
19-Dec-2014 |
Susant Sahani <susant@redhat.com> |
LLDP: Add support for networkctl |
ad1ad5c8e36ea795034fcdac660b15d7c141d55b |
|
19-Dec-2014 |
Susant Sahani <susant@redhat.com> |
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. |