summaryrefslogtreecommitdiffhomepage
path: root/dhcpv6/modifiers.go
AgeCommit message (Collapse)Author
2021-10-25dhcpv6: fix and improve IA_TA (#449)Mikma
Fix typo in MessageOptions.IATA(). Add iaid argument to WithIATA() to allow it to be set easily in line with WithIAPD(). Add a test for WithIATA(), Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net> Co-authored-by: Mikael Magnusson <mikma@users.sourceforge.net> Co-authored-by: Pablo Mazzini <pmazzini@gmail.com>
2020-08-13Added structure, parsing and convenience fuctions for ↵Tom McPhail
OptInformationRefreshTime (32) https://tools.ietf.org/html/rfc8415#section-21.23 Signed-off-by: Tom McPhail <tom.mcphail@icloud.com>
2020-08-06dhcpv6: Handle IA_TA optionsAnatole Denis
This creates support for IA_TA options, based on and reusing the blocks from IA_NA, to which it is extremely similar Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2020-06-01Add Client Link-Layer Address option for RFC 6939 support.Tom McPhail
Signed-off-by: Tom McPhail <tom.mcphail@icloud.com>
2020-03-11v6: introduce Prefix optionsChris Koch
IAPD has PDOptions which allows IAPrefix and StatusCode. IAPrefix has PrefixOptions which allow StatusCode. Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-10dhcpv6 fqdn: fix domain encodingPablo Mazzini
Signed-off-by: Pablo Mazzini <pmazzini@gmail.com>
2020-03-10dhcpv6: add IA_PD to request from advertiseMikael Magnusson
Add the IA_PD option to the request from the advertise if present. Add WithIAPD() as modifier and test. Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2020-03-09Merge branch 'master' into feature/dhcp4-o-dhcp6Pablo Mazzini
2020-03-09v6: add IdentityOptionsChris Koch
IANA and IATA options may contain Status Code and IAAddr options. Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-06dhcpv6: add DHCPv4-over-DHCPv6 supportMikael Magnusson
Add message types, options, and modifier for handling DHCPv4-over-DHCPv6. Refer to RFC 7341 Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
2020-03-05v6: DomainSearchList getterChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05v6: add DNS getter (and rename DNSRecursiveNameServer to DNS)Chris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05v6: RequestedOptions getterChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05v6: add IANA GetterChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05v6: add ServerID getterChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05v6: add ClientID getterChris Koch
Signed-off-by: Chris Koch <chrisko@google.com>
2020-03-05dhcpv6: intro Getters for OptionsChris Koch
Allow the Options type to have getters for each specific options, in order to avoid users having to cast options to their specific type. This commit introduces a getter for exactly one option: the ClientArchType. i.e. users can replace archTypes := msg.GetOneOption(OptionClientArchType).(*OptClientArchType) with archTypes := msg.Options.ArchTypes() Because a few message types and options embed options (normal message, relay message, IANA/IATA option) and each have a restricted set of options that can be used inside them, we'll introduce at least 3 or more Options subtypes: - MessageOptions - RelayOptions - IdentityOptions Perhaps others will join at a later time, such as VendorOptions or AddressOptions for the IAAddress options field. Signed-off-by: Chris Koch <chrisko@google.com>
2020-02-06hcpv6 fqdn: implements OptionFQDN optionXuehao (David) Hu
per https://tools.ietf.org/rfc/rfc4704.txt Signed-off-by: Xuehao (David) Hu <xuehaohu@google.com>
2019-05-08Addressed various linter warningsAndrea Barberio
Mostly for dead code and potentially wrong comparisons. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-24[dhcpv6] Solicit messages derive default IAID from MAC addressAndrea Barberio
IAID must be set by the client. This patch generates the IAID from the MAC address of the interface. To do so, a new WithIAID modifier is added, the interface of NewSolicitWithCID now requires a hwaddr parameter, and NewAdvertiseFromSolicit copies the IA_NA option from the solicit if present. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-23Revert "[dhcpv6] Solicit messages derive default IAID from MAC address"Andrea Barberio
This reverts commit b071bdc86a58037f6c745647c97fca202f3caef9. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-23[dhcpv6] Solicit messages derive default IAID from MAC addressAndrea Barberio
IAID must be set by the client. This patch generates the IAID from the MAC address of the interface. To do so, a new WithIAID modifier is added, the interface of NewSolicitWithCID now requires a hwaddr parameter, and NewAdvertiseFromSolicit copies the IA_NA option from the solicit if present. Signed-off-by: Andrea Barberio <insomniac@slackware.it>
2019-04-04client6: new async DHCPv6 client like #250.Christopher Koch
- Race-condition-averse. - Supports multiple concurrent requests. - Tested. - Requires a fully compatible net.PacketConn. Signed-off-by: Christopher Koch <chrisko@google.com>
2019-03-11dhcpv6: remove setters and getters.Christopher Koch
- Make members directly accessible.
2019-03-11dhcpv6: rename stuttering types.Christopher Koch
dhcpv6.DHCPv6Message -> dhcpv6.Message dhcpv6.DHCPv6Relay -> dhcpv6.RelayMessage
2019-01-14Rename iana.ArchType to iana.Arch.Christopher Koch
2018-12-09Addressed pmazzini's feedbackAndrea Barberio
2018-12-08Also simplified corresponding v6 modifiersAndrea Barberio
2018-12-08Added netconf basic testing and required modifiersAndrea Barberio
2018-08-20ORO Modifier (#144)Mikołaj Walczak
2018-08-13fix OptClientArchTypePablo Mazzini
2018-07-30DHCPv6: Rename Option constants to CamelCaseSean Karlage
To appease linters
2018-05-02Added WithClientId, WithServerId and tests (#56)insomniac
2018-04-20dhcpv6: option userclass: supporting multiple user classes (#44)insomniac
dhcpv6: option userclass: supporting multiple user classes
2018-04-20WithUserClass using the passed user class nowAndrea Barberio
2018-04-20dhcpv6: added modifiers (#41)insomniac
dhcpv6: added modifiers Added support for packet modifiers, i.e. functions that can arbitrarily manipulate a DHCPv6 packet. These modifiers are used by NewMessage, NewSolicitForInterface, NewRequestForAdvertise, and can be used by other packet creation functions. A bunch of sample modifiers have been added under modifiers.go , too. With the introduction of modifiers I also removed some options that should not necessarily be in a standard DHCPv6 message.