Commit graph

22 commits

Author SHA1 Message Date
Lennart Poettering 40eb1b0ae8 tree-wide: prefer AF_xyz over PF_xyz
This really doesn't matter given that AF_xyz and PF_xyz are equivalent
in all ways, but we almost always use AF_xyz, hence stick to it
universally and convert the remaining PF_ to AF_
2020-09-09 23:42:55 +02:00
Yu Watanabe f5947a5e92 tree-wide: drop missing.h 2019-10-31 17:57:03 +09:00
Yu Watanabe 36dd5ffd5d util: drop missing.h from util.h 2018-12-04 10:00:34 +01:00
Zbigniew Jędrzejewski-Szmek d9b02e1697 tree-wide: drop copyright headers from frequent contributors
Fixes #9320.

for p in Shapovalov Chevalier Rozhkov Sievers Mack Herrmann Schmidt Rudenberg Sahani Landden Andersen Watanabe; do
  git grep -e 'Copyright.*'$p -l|xargs perl -i -0pe 's|/([*][*])?[*]\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\s*[*]([*][*])?/\n*|\n|gms; s|\s+([*#]\s+)?Copyright[^\n]*'$p'[^\n]*\n*|\n|gms'
done
2018-06-20 11:58:53 +02:00
Lennart Poettering 810adae9e9 tree-wide: use proper unicode © instead of (C) where we can
Let's use a proper unicode copyright symbol where we can, it's prettier.

This important patch is very important.
2018-06-14 10:20:20 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Lennart Poettering c10d6bdb89 macro: introduce new TAKE_FD() macro
This is similar to TAKE_PTR() but operates on file descriptors, and thus
assigns -1 to the fd parameter after returning it.

Removes 60 lines from our codebase. Pretty good too I think.
2018-03-22 20:30:40 +01:00
Zbigniew Jędrzejewski-Szmek 53e1b68390 Add SPDX license identifiers to source files under the LGPL
This follows what the kernel is doing, c.f.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
2017-11-19 19:08:15 +01:00
27o 6f844e3a3f networkd: add multicast membership to lldp socket (#5282) 2017-02-09 10:36:13 +01:00
Lennart Poettering 8e38570ebe tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
Super-important change, yeah!
2016-06-15 01:26:01 +02:00
Lennart Poettering 7cde237777 sd-lldp: fix how we create the LLDP listening socket
Specifiy the ethernet family, and make sure we se the O_CLOEXEC and O_NONBLOCK
bits how we should for all fds.
2016-02-20 22:42:29 +01:00
Lennart Poettering 0ef6f45425 tree-wide: place #pragma once at the same place everywhere
Usually, we place the #pragma once before the copyright blurb in header files,
but in a few cases we didn't. Move those around, so that we do the same thing
everywhere.
2016-02-20 22:42:29 +01:00
Lennart Poettering 358977458b sd-lldp: simplify lldp_network_bind_raw_socket() a bit
Let's constify the filter program, drop a few includes and structure
definitions.
2016-02-20 22:42:29 +01:00
Nathan McSween e306723ec4 Remove/add (un)needed includes 2016-02-18 23:34:30 +00:00
Daniel Mack b26fa1a2fb 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.
2016-02-10 13:41:57 +01:00
Lennart Poettering 3ffd4af220 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.
2015-10-25 13:19:18 +01:00
Beniamino Galvani 0037c2dc54 lldp: move lldp_receive_packet() to lldp-internal.c
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-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
Thomas Hindoe Paaboel Andersen 2eec67acbb 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.
2015-02-23 23:53:42 +01:00
Tom Gundersen 7a6f145746 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'
2014-12-19 22:42:03 +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