summaryrefslogtreecommitdiff
path: root/src/network/networkd-address-label.h
Commit message (Collapse)AuthorAgeFilesLines
* network: re-design request queueYu Watanabe2022-03-111-2/+0
| | | | | | | | This makes Request object takes hash, compare, free, and process functions. With this change, the logic in networkd-queue.c can be mostly independent of the type of the request or the object (e.g. Address) assigned to the request, and it becomes simpler.
* network: make request_process_address() and friends take Link and ↵Yu Watanabe2022-03-111-1/+1
| | | | | | | | | | | | | | | | | corresponding object This also renames e.g. request_process_address() -> address_process_request(). Also, this drops type checks such as `assert(req->type == REQUEST_TYPE_ADDRESS)`, as in the later commits, the function of processing request, e.g. `address_process_request()`, will be assigned to the Request object when it is created. And the request type will be used to distinguish and to avoid deduplicating requests which do not have any assigned objects, like REQUEST_TYPE_DHCP4_CLIENT. Hence, the type checks in process functions are mostly not necessary and redundant. This is mostly cleanups and preparation for later commits, and should not change any behavior.
* network: rename NetworkConfigSection -> ConfigSectionYu Watanabe2022-01-191-1/+1
| | | | And move it and relevant functions to conf-parser.[ch].
* network: verify [IPv6AddressLabel] sectionYu Watanabe2021-10-281-2/+3
|
* network: address label: use request queue to configure address labelsYu Watanabe2021-06-081-2/+4
|
* network: address label: use struct in6_addr insteadYu Watanabe2021-06-081-1/+1
| | | | Address label is for IPv6.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* network: rename network_verify_xxx() -> network_drop_invalid_xxx()Yu Watanabe2020-10-071-1/+1
| | | | As 'verify' implies a boolean result.
* network: cleanup networkd-address-label.hYu Watanabe2020-10-071-12/+2
|
* network: introduce link_set_address_labels()Yu Watanabe2020-10-071-1/+1
|
* network: introduce network_verify_address_labels()Yu Watanabe2020-10-071-0/+2
|
* network: make address_label_free() return NULLYu Watanabe2020-10-071-1/+1
|
* network: drop list of static address labelsYu Watanabe2020-10-071-2/+0
| | | | | [IPv6AddressLabel] sections are managed by both LIST and Hashmap. Let's drop list, as they store the completely same information.
* network: drop sections contain invalid settings in network_verify()Yu Watanabe2019-03-131-1/+2
| | | | | | | | | | | If e.g., an [Address] section has an invalid setting, then previously assigned settings in the section is freed, and only later settings are stored. That may cause partially broken section stored in Network object. This makes if an invalid setting is found, then set 'invalid' flag instead of freeing it. And invalid sections are dropped later by network_verify().
* network: use typesafe netlink_call_async() macro where applicableYu Watanabe2018-12-021-1/+1
|
* network: fixes related to NetworkConfigSectionYu Watanabe2018-11-121-1/+0
| | | | | | - Do not allocate NetworkConfigSection when filename == NULL - set .network element before calling hashmap_put() - Always free NetworkConfigSection in each object.
* networkd: drop unused element from AddressLabel structYu Watanabe2018-10-101-1/+0
|
* tree-wide: drop double newlineYu Watanabe2018-06-291-1/+0
|
* tree-wide: drop copyright headers from frequent contributorsZbigniew Jędrzejewski-Szmek2018-06-201-3/+0
| | | | | | | | 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
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-141-1/+1
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* 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.
* tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-05-221-2/+3
| | | | | | | | | | | This makes most header files easier to look at. Also Emacs gets really slow when browsing through large sections of overly long prototypes, which is much improved by this macro. We should probably not do something similar with too many other cases, as macros like this might help readability for some, but make it worse for others. But I think given the complexity of this specific prototype and how often we use it, it's worth doing.
* tree-wide: drop redundant _cleanup_ macros (#8810)Lennart Poettering2018-04-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | 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.
* 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.
* socket-util: add parse_ip_prefix (#5867)Susant Sahani2017-05-051-1/+0
| | | | networkd: replace parse prefix with generic in_addr_prefix_from_string
* networkd: add support for address labelSusant Sahani2017-04-261-0/+59
IPv6 address labels are used for address selection; they are described in RFC 3484. Precedence is managed by userspace, and only the label itself is stored in the kernel. enp0s25.network [Match] Name=enp0s25 [Network] DHCP=yes Address = 2001:db8:f00:baa::b [AddressLabel] Label=199 Prefix=2001:db8:41::/64 [AddressLabel] Label=11 Prefix=2001:db8:31::/64 [AddressLabel] Label=123 Prefix=2001:db8:21::/64 [AddressLabel] Label=124 Prefix=2001:db8:11::/64 [sus@maximus label]$ ip addrlabel list prefix ::1/128 label 0 prefix ::/96 label 3 prefix ::ffff:0.0.0.0/96 label 4 prefix 2001:db8:41::/64 dev enp0s25 label 199 prefix 2001:db8:31::/64 dev enp0s25 label 11 prefix 2001:db8:21::/64 dev enp0s25 label 123 prefix 2001:db8:11::/64 dev enp0s25 label 124 prefix 2001::/32 label 6 prefix 2001:10::/28 label 7 prefix 3ffe::/16 label 12 prefix 2002::/16 label 2 prefix fec0::/10 label 11 prefix fc00::/7 label 5 prefix ::/0 label 1