summaryrefslogtreecommitdiff
path: root/src/network/networkd-address.h
Commit message (Collapse)AuthorAgeFilesLines
* network: Introduce method to generate EUI-64 addressesSusant Sahani2020-03-011-0/+2
|
* network: assume Scope=host when Address= is loopback addressYu Watanabe2020-02-281-0/+1
| | | | Fixes #14903.
* network: Make address_hash_ops available outside of networkd-address.cKevin P. Fleming2020-02-101-0/+2
| | | | | | In order to allow other parts of systemd-networkd to use sets/hashmaps of Address objects, the address_hash_ops structure needs to be made available to them.
* network: introduce DAD for static addressSusant Sahani2019-12-061-5/+11
| | | | Closes #2527.
* network: drop sections contain invalid settings in network_verify()Yu Watanabe2019-03-131-1/+3
| | | | | | | | | | | 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: make all xxx_new_static() staticYu Watanabe2019-03-131-1/+0
| | | | | These functions are called from only config parsers, and the parsers are in the same files. So, let's make them static.
* network: use typesafe netlink_call_async() macro where applicableYu Watanabe2018-12-021-2/+2
|
* 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-6/+7
| | | | | | | | | | | 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.
* networkd: Move Router Advertisement functionality to a single filePatrik Flykt2018-01-041-22/+0
| | | | | Centralize Router Advertisement functionality in networkd-radv instead of keeping it in networkd-address.
* 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.
* networkd: add scope to address section (#6449)Susant Sahani2017-08-011-0/+1
| | | | | | | This work allows to configure address Scope to host | link | global or a number. Closes #6446
* networkd: Add Router Advertisement variablesPatrik Flykt2017-05-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Add variables for enabling Router Advertisements, router lifetime as well as managed and other information flags indicating use of DHCPv6. Add configuration of default router preferences as defined in RFC 4191. IPv6PrefixDelegation in the [Network] section has to be set in order to enable prefix delegation. The rest of the prefix delegation values are stored in the [IPv6PrefixDelegation] section. The host will act as a default router if it is given a non-zero lifetime with RouterLifetimeSec. Managed and OtherInformation booleans set the level of DHCPv6 support, and the RouterPreference configures the router's preference between low, medium and high. Words 'normal' and 'default' are added as synonyms for 'medium' just to make configuration simpler. This adds a section like the following to .network configuration files: [Network] IPv6PrefixDelegation=true [IPv6PrefixDelegation] RouterLifetimeSec=2000 Managed=false OtherInformation=true RouterPreference=medium
* networkd: Add IPv6Prefix sections to the network configuration filesPatrik Flykt2017-05-151-0/+5
| | | | | | | | | | | | | | | | | Support zero or more [IPv6Prefix] sections in the network configuration files. Each section can have one Prefix=<subnet>[/<prefixlength>] option, with the preferred and valid lifetimes specified by ValidLifetimeSec and PreferredLifetimeSec measured in seconds, and with onlink and address autoconfiguration booleans specified by OnLink and AddressAutoconfiguration variables. This adds a section like the following to .network configuration files: [IPv6Prefix] Prefix=2001:db8:dead:beef::/64 OnLink=true AddressAutoconfiguration=true ValidLifetimeSec=1500 PreferredLifetimeSec=1000
* networkd: Add initial prefix handling for network configurationPatrik Flykt2017-05-151-0/+16
| | | | | Add initial code for handling prefixes in network configuration files. Add hash map and list storing the information in systemd-networkd.
* networkd: fix drop-in conf directory configs overwriting each otherSusant Sahani2017-02-161-2/+3
| | | | | | | | | | | | Now we track the sections for example [Address] via line number. Which was fine till we din't had dropins dir. If we have multiple sections which have the ideantical line number in diffrent files we are overwriting these since line number is the key. This patch fixes this by taking filename and line number as key. This fixes [Address] and [Route] section overwriting. fixes: #5141
* networkd: address add support to configure flags (#4201)Susant Sahani2016-10-081-0/+6
| | | | | | | | | This patch enables to configure IFA_F_HOMEADDRESS IFA_F_NODAD IFA_F_MANAGETEMPADDR IFA_F_NOPREFIXROUTE IFA_F_MCAUTOJOIN
* networkd: constify more thingsLennart Poettering2016-06-031-1/+1
|
* Merge pull request #3156 from keszybz/duid-settingsLennart Poettering2016-05-041-1/+3
|\ | | | | Rework DUID setting
| * networkd: rework headers to avoid circular includesZbigniew Jędrzejewski-Szmek2016-04-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Header files were organized in a way where the includer would add various typedefs used by the includee before including it, resulting in a tangled web of dependencies between files. Replace this with the following logic: networkd.h / \ networkd-link.h \ networkd-ipv4ll.h--\__\ networkd-fdb.h \ networkd-network.h netword-netdev-*.h networkd-route.h \ networkd-netdev.h If a pointer to a structure defined in a different header file is needed, use a typedef line instead of including the whole header.
* | networkd: Add support to configure IPv6 preferred lifetime (#3102)Susant Sahani2016-05-031-0/+1
|/ | | | | | Closes #2166. We only allow 0, infinity and forever. infinity and forever is same.
* 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: sort includes in *.hThomas Hindoe Paaboel Andersen2015-11-181-2/+2
| | | | | This is a continuation of the previous include sort patch, which only sorted for .c files.
* networkd: address - drop the 'added' flagTom Gundersen2015-11-111-1/+0
| | | | | Instead instantiate the kernel flags to TENTATIVE until the kernel updates us with the real value.
* networkd: link - deserializeTom Gundersen2015-10-301-0/+1
| | | | | | | For now only deserialize some basic state and the applied addresses. When a link is added, try to deserialize it's state from /run. This is relevant only when networkd is restarted at runtime.
* networkd: address - distinguish between addresses added by us and by othersTom Gundersen2015-10-211-2/+3
| | | | | | | | | We only keep the addresses that we added ourselves in link->addresses, and introduce a new set link->addresses_foreign to keep addresses of unknown origin. Only functional change is that "foreign" addresses no longer prevent a link from entering "configured" state.
* networkd: address - merge _change() into _configure()Tom Gundersen2015-10-211-2/+1
| | | | These functions are almost entirely the same, so avoid duplication.
* networkd: address - factor out address_update()Tom Gundersen2015-10-211-1/+2
| | | | | Call back into link_check_ready() whenever an address state change may have made a link ready.
* networkd: address - introduce address_is_ready()Tom Gundersen2015-10-111-0/+1
| | | | Checks that a given address is not tentative nor deprecated.
* networkd: make address_{establish,release}() staticTom Gundersen2015-10-111-3/+2
| | | | No need to expose these functions, but rather call them from address_{add,drop}.
* networkd: manager - avoid unnecessary memory allocationTom Gundersen2015-10-111-1/+1
| | | | | Don't allocate Address objects only to free them again when processing rtnl events.
* networkd: address - store active addresses in a Set rather than a ListTom Gundersen2015-10-111-0/+4
| | | | | We need to be able to look these things up quickly as we will be updating them continuously and there can in principle be many of them.
* networkd: route/address - simplify and unify creatorsTom Gundersen2015-10-111-1/+1
| | | | Rename new_dynamic() to simply _new() and reuse that from new_static().
* networkd: split up networkd.h into per-object header filesLennart Poettering2015-08-271-0/+73
No functional changes, just moving definitions into separate header files.