summaryrefslogtreecommitdiff
path: root/src/systemd/sd-ipv4ll.h
Commit message (Collapse)AuthorAgeFilesLines
* Use https for gnu.orgMichael Biebl2022-06-281-1/+1
|
* meson: Build header tests with -pedanticJan Janssen2022-05-301-1/+1
| | | | | | | | | | | | By using __extension__, we can silence pedantic errors we cannot or do not want to fix. This in particular silences: - enum values being outside of int range - variadic macros - long long being C99 - type of bit-field ‘type’ is a GCC extension - use of C99 bool in public header functions
* libsystemd-network: make sd_dhcp_client_get_ifname() or friends return ↵Yu Watanabe2021-09-291-1/+1
| | | | negative errno on error
* sd-ipv4ll: introduce sd_ipv4ll_set_check_mac_callback()Yu Watanabe2021-07-011-0/+2
|
* libsystemd-network: introduce sd_xxx_{set,get}_ifname()Yu Watanabe2021-03-041-0/+1
|
* sd-ipv4acd,sd-ipv4ll: introduce _get_ifindex() and _get_ifname()Yu Watanabe2020-12-021-0/+2
| | | | | | They will be used in later commits. This also makes sd_ipv4acd_set_ifindex() check the existence of the interface.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* tree-wide: use proper unicode © instead of (C) where we canLennart Poettering2018-06-141-1/+1
| | | | | | Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | 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.
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* libsystemd-network: sd-ipv4ll: Wrapper to restart address aquisition after ↵Jason Reeder2017-03-311-0/+1
| | | | | | | | | | | | | | | conflict After an ipv4ll claimed address conflict occurs a new address needs to be chosen and then the acquisition state machine needs to be restarted. This commit adds a function (sd_ipv4ll_restart) that clears the previously acquired address (ll->address) and then calls the existing sd_ipv4ll_start function to choose the new address and start the acquisition. Signed-off-by: Jason Reeder <jasonreeder@gmail.com>
* ipv4ll: change "seed" parameter to be uint64_tLennart Poettering2016-05-261-1/+1
| | | | | Let's make clear this always has the same size, since otherwise it's not useful for reproducible runs, which this is really about however.
* ipv4l-{acd,ll}: make sure ipv4 addresses are unsignedLennart Poettering2016-05-261-1/+1
| | | | And some other minor fixes.
* sd-network: rename "index" field of the various clients to "ifindex"Lennart Poettering2016-05-261-1/+1
| | | | | | | 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.
* libsystemd-network: sd-event uses 64bit priorities, expose them in the APIs ↵Lennart Poettering2016-02-201-1/+1
| | | | as such
* libsystemd-network: don't abbreviate "callback" as "cb" needlesslyLennart Poettering2016-02-201-2/+2
| | | | | This isn't an excercise in creating APIs that are hard to understand, hence let's call a callback a callback.
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2015-11-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* tree-wide: sort includes in *.hThomas Hindoe Paaboel Andersen2015-11-181-1/+2
| | | | | This is a continuation of the previous include sort patch, which only sorted for .c files.
* sd-*.h: clean up exported (or to-be-exported) header filesLennart Poettering2015-10-241-2/+6
| | | | | | | | | | | | | | | | | 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.
* sd-ipv4ll: allow initial address to be set explicitlyTom Gundersen2015-10-111-0/+1
| | | | | This is useful in case the daemon is restarted and the state of the IPv4LL client should be serialized/deserialized.
* sd-ipv4ll: fix namespacingDavid Herrmann2015-09-221-3/+3
| | | | | Prefix all exported constants with SD_IPV4LL_* to avoid namespacing conflicts.
* sd-ipv4acd: introduce new library split out from sd-ipv4llTom Gundersen2015-09-181-1/+1
| | | | | | | | This splits the Address Conflict Detection out of the Link Local library so that we can reuse it for DHCP and static addresses in the future. Implements RFC5227.
* sd-ipv4ll: Add reference counting for IPv4LLPatrik Flykt2014-04-111-2/+3
| | | | | | | | | | Similar to DHCP, the IPv4LL library user can decide to free the LL client any time the callback is called. Guard against freeing the LL client in the callback by introducing proper reference counting. Also update code using the IPv4LL library to properly handle a returned NULL from the notify and stop functions if the IPv4LL client was freed.
* networkd: smooth transition from ipv4ll to dhcp addressUmut Tezduyar Lindskog2014-04-031-5/+7
| | | | | | | | | | | | | | | | | | Currently when both ipv4ll and dhcp are enabled, ipv4ll address (if one has been claimed) is removed when dhcp address is aquired. This is not the best thing to do since there might be clients unaware of the removal trying to communicate. This patch provides a smooth transition between ipv4ll and dhcp. If ipv4ll address was claimed [1] before dhcp, address is marked as deprecated. Deprecated address is still a valid address and packets can be received on it but address cannot be selected as a source address. If dhcp lease cannot be extended, then ipv4ll address is marked as valid again. [1] If there is no collision, claiming IPv4LL takes between 4 to 7 seconds.
* sd-ipv4ll/networkd: generate predictable addressesUmut Tezduyar Lindskog2014-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | Increase the chance of using the same link local address between reboots. The pseudo random sequence of addresses we attempt is now seeded with data that is very likely to stay the same between reboots, but at the same time be unique to the specific machine/nic. First we try to use the ID_NET_NAME_* data from the udev db combined with the machin-id, which is guaranteed to be unique and persistent, if available. If that is not possible (e.g., in containers where we don't have access to the udev db) we fallback to using the MAC address of the interface, which is guaranteed to be unique, and likely to be persistent. [tomegun: three minor changes: - don't expose HASH_KEY in the siphash24 header - get rid of some compile-warnings (and some casts at the same time), by using uint8_t[8] rather than uint64_t in the api - added commit message]
* sd-network: IPv4 link-local support [v2]Umut Tezduyar Lindskog2014-03-031-0/+50
Implements IPv4LL with respect to RFC 3927 (http://tools.ietf.org/rfc/rfc3927.txt) and integrates it with networkd. Majority of the IPv4LL state machine is taken from avahi (http://avahi.org/) project's autoip. IPv4LL can be enabled by IPv4LL=yes under [Network] section of .network file. IPv4LL works independent of DHCP but if DHCP lease is aquired, then LL address will be dropped. [tomegun: removed a trailing newline and a compiler warning]