Commit Graph

19 Commits

Author SHA1 Message Date
Frantisek Sumsal 86b52a3958 tree-wide: fix spelling errors
Based on a report from Fossies.org using Codespell.

Followup to #15436
2020-04-21 23:21:08 +02:00
Yu Watanabe a2dcda328a ndisc: improve debug log message 2018-11-06 20:15:09 +09: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 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
Lennart Poettering 1e7a0e21c9 network: beef up ipv6 RA support considerably
This reworks sd-ndisc and networkd substantially to support IPv6 RA much more
comprehensively. Since the API is extended quite a bit networkd has been ported
over too, and the patch is not as straight-forward as one could wish. The
rework includes:

- Support for DNSSL, RDNSS and RA routing options in sd-ndisc and networkd. Two
  new configuration options have been added to networkd to make this
  configurable.

- sd-ndisc now exposes an sd_ndisc_router object that encapsulates a full RA
  message, and has direct, friendly acessor functions for the singleton RA
  properties, as well as an iterative interface to iterate through known and
  unsupported options. The router object may either be retrieved from the wire,
  or generated from raw data. In many ways the sd-ndisc API now matches the
  sd-lldp API, except that no implicit database of seen data is kept. (Note
  that sd-ndisc actually had a half-written, but unused implementaiton of such
  a store, which is removed now.)

- sd-ndisc will now collect the reception timestamps of RA, which is useful to
  make sd_ndisc_router fully descriptive of what it covers.

Fixes: #1079
2016-06-06 20:11:38 +02:00
Lennart Poettering 2f8e763376 sd-network: rename "index" field of the various clients to "ifindex"
A field "index" is not particularly precise and also might conflict with libc's
index() function definition. Also, pretty much everywhere else we call this
concept "ifindex", including in networkd, the primary user of these libraries.
Hence, let's fix this up and call this "ifindex" everywhere here too.
2016-05-26 15:34:42 +02:00
Lennart Poettering 32d2064523 libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs as such 2016-02-20 22:42:29 +01: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 4afd3348c7 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.
2015-11-27 19:19:36 +01:00
Thomas Hindoe Paaboel Andersen 71d35b6b55 tree-wide: sort includes in *.h
This is a continuation of the previous include sort patch, which
only sorted for .c files.
2015-11-18 23:09:02 +01:00
Tom Gundersen 9d96e6c3ef sd-ndisc: introduce separate callbacks
As the data passed is very different, we introduce four different callbacks:
 - Generic - router discovery timed out or state machine stopped
 - Router - router and link configuration received
 - Prefix onlink - configuration for an onlink prefix received
 - Prefix autonomous - configuration for to configure a SLAAC address for a prefix received
2015-11-11 15:42:38 +01:00
Tom Gundersen cb53894d3b sd-ndisc: notify user on STOP
Also, stop the state machine when we get into a broken state, rather than just notify the user.
2015-11-11 15:42:38 +01:00
Lennart Poettering 04c0136989 sd-*.h: clean up exported (or to-be-exported) header files
Exported header files should not include internal headers. Fix that.

Exported header files should not use the bool type. So far we opted to
stick to C89 for exported headers, and hence use "int" for bools in
them. Continue to do so.

Exported header files should have #include lines for everything they use
including inttypes.h and sys/types.h, so that they may be included in
any order.

Exported header files should have C++ guards, hence add them.

Exported header files should not use gcc extensions like #pragma once,
get rid of it.
2015-10-24 23:42:56 +02:00
Tom Gundersen 4e5ca364f4 sd-ndisc: drop sd_ndisc_get_prefixlen()
This is unused, and in the future we will pass prefixes and prefixlengths directly
to the callbacks when needed rather than having to search for them.
2015-10-22 17:19:54 +02:00
Tom Gundersen f46fc04fac sd-ndisc: drop sd_ndisc_prefix_match()
This is no longer used.
2015-10-22 17:19:54 +02:00
Tom Gundersen 77b05fa9a7 sd-ndisc: don't inform the caller of expired prefixes
The caller should push any lifetime information into the kernel and let the kernel handle
prefix expiration.
2015-10-22 17:19:54 +02:00
Tom Gundersen 4d7b83da7b sd-ndisc: rename API from sd-icmp6-nd 2015-10-22 17:19:54 +02:00
Tom Gundersen 3ad0c5d8a4 sd-icmp6-nd: rename files to sd-ndisc
The actual code rename will follow. The reason for the change of name is to make it
simpler and more uniform with how we name other libraries (we don't include the
underlying protocol). The new name also matches the naming in the kernel (which
is particularly relevent here as we expect to let the kernel do some parts of
the protocol and we do others).
2015-10-22 17:19:54 +02:00
Renamed from src/systemd/sd-icmp6-nd.h (Browse further)