summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp6-protocol.h
AgeCommit message (Collapse)AuthorFilesLines
2018-06-14tree-wide: use proper unicode © instead of (C) where we canLennart Poettering1-1/+1
Let's use a proper unicode copyright symbol where we can, it's prettier. This important patch is very important.
2018-06-14tree-wide: drop 'This file is part of systemd' blurbLennart Poettering1-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.
2018-04-06tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek1-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.
2018-01-04dhcp6: Sanitize DHCPv6 IA option parsingPatrik Flykt1-0/+1
Sanitize code for parsing DHCPv6 IA NA and TA options and their nested Status options so that the options can be fully and properly ignored should they not be conformant to the specification. Do this by defining a proper DHCP6Option structure and sending that structure to the parsing function. The parsing function will then not manipulate either any option data pointers or their lengths in order to iterate over the current option. Needless to say, this affects a few files including the test program.
2017-11-19Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek1-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.
2017-11-16sd-dhcp6-client: Implement FQDN Option (#7309)Stefan Agner1-0/+6
Implement DHCPv6 option to exchange information about the Fully Qualified Domain Name (FQDN) according to RFC 4704. The RFC 4704 describes two models of operations in section 3, currently only the second model is supported (DHCPv6 server updates both the AAAA and the PTR RRs). The existing DHCP Section Options SendHostname and Hostname are sent as FQDN to the server. According to section 4.2 sending only parts of its FQDN is allowed. Fixes #4682.
2016-03-30DHCP DUID, IAID configuration optionsVinay Kulkarni1-7/+0
2016-03-21Revert "DHCP DUID and IAID configurability"Zbigniew Jędrzejewski-Szmek1-0/+7
2016-03-09DHCP DUID and IAID configurabilityVinay Kulkarni1-7/+0
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack1-2/+0
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-01-20dhcp: make DHCP6_OPTION_* enum publicBeniamino Galvani1-35/+0
libsystemd-network provides the public function sd_dhcp6_client_set_request_option() to enable the request of a given DHCP option. However the enum defining such options is defined in the internal header dhcp6-protocol.h. Move the enum definition to the public header sd-dhcp6-client.h and properly namespace values.
2015-08-21sd-dhcp6: Support deprecated SNTP Configuration OptionPatrik Flykt1-1/+1
Although the SNTP option specified in RFC 4075 has been deprecated, some servers are still sending NTP information with this option. Use the SNTP information provided only if the NTP option is not present. Update the test case as SNTP information is also requested.
2015-08-21sd-dhcp6: Add support for DHCPv6 NTP Server OptionPatrik Flykt1-0/+6
Support NTP server and multicast addresses and NTP server domain names as specified in RFC 5908.
2014-12-10sd-dhcp6-client: Implement Information Request messagePatrik Flykt1-0/+3
Implement Information Request message according to RFC 3315, section 18.1.5. with the excepion that the first message is not delayed by a random amount. Instead systemd-networkd is supposed to take care of desynchronizing between other clients. Initialize the DHCPv6 client structure in sd_dhcp6_client_start() as this allows toggling between information request and normal DHCPv6 address aquisition modes.
2014-07-23dhcp-network: remove unused DHCP6_STATE_RSDan Williams1-1/+0
Probably a left-over from when router solicitations were requested in the DHCP6 code. But since they are now separate, this state is no longer needed.
2014-06-26sd-dhcp6-client: Implement Renew and RebindPatrik Flykt1-0/+6
Start sending Renew and Rebind DHCPv6 messages when respective timers T1 and T2 expire. Rebind messages do not include a Server ID option and the Rebind procedure ends when the last IPv6 address valid lifetime expires, whereafter the client restarts the address acquisition procedure by Soliciting for available servers. See RFC 3315, sections 18.1.3. and 18.1.4. for details.
2014-06-26sd-dhcp6-client: Add Option Request Option supportPatrik Flykt1-0/+12
Provide a function to request more options from the DHCPv6 server. Provide a sensible default set at startup and add test basic test cases for the intended usage. Define DNS and NTP related option codes and add comments for the unassigned codes.
2014-06-19sd-dhcp6-client: Receive and parse a reply and set T1 and T2 timersPatrik Flykt1-0/+1
Receive and parse a Reply from the server. Set up T1 and T2 timers and notify the library user of an acquired DHCPv6 lease.
2014-06-19sd-dhcp6-client: Add Request message sendingPatrik Flykt1-0/+4
As described in RFC 3315, Section 17.1.2, a client has to wait until the first timeout has elapsed before it is allowed to request IPv6 addresses from the DHCPv6 server. This is indicated by a non-NULL lease and a non-zero resend count. Should the Advertisement contain a preference value of 255 or be received after the first timeout, IPv6 address requesting is started immediately. In response to these events, create a Request message and set up proper resend timers to send the message to the server.
2014-06-19sd-dhcp6-client: Receive and parse Advertise messagesPatrik Flykt1-0/+6
When receiving DHCPv6 messages, discard the ones that are not meant for DHCPv6 clients and verify the transaction id. Once that is done, process the Advertise message and select the Advertise with the highest preference. Create a separate function for lease information parsing so that it can be reused in other parts of the protocol. Verify both DUID and IAID in the received message and store other necessary information with the lease structure.
2014-06-19sd-dhcp6-client: Add functions to bind to DHCPv6 UDP socketPatrik Flykt1-0/+4
Add a function that creates a UDP socket bound to the given interface and optionally to an IPv6 address. Add another function that will send the DHCPv6 UDP packet to its destination. Using IPV6_PKTINFO in setsockopt to bind the IPv6 socket to an interface is documented in section 4. of RFC 3542, "Advanced Sockets Application Program Interface (API) for IPv6" Add a define for DHCPv6 Relay Agents and Servers multicast address as its not available elsewhere.
2014-06-19sd-dhcp6-client: Add DHCPv6 client Solicitation timeout handlingPatrik Flykt1-0/+5
Add the core of DHCPv6 client message retransmission and upper bound timer and message count handling according to RFC 3315 Secions 7.1.2 and 14. Omit the DHCPv6 initial delay; for now it is assumed that systemd-networkd will provide decent startup randomization that will desynchronize the clients. When reinitializing the client, clear all timers.
2014-06-19sd-dhcp6-client: Add initial DHCPv6 client filesPatrik Flykt1-0/+104
Add initial structure definition and functions for setting index, MAC address, callback and event loop. Define protocol values and states.