summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/options_test.go
AgeCommit message (Collapse)Author
2021-05-28Break circular dependency on u-rootChris Koch
u-root -> dhcp -> u-root is the circular dependency. Which is fine, except we messed up modules in u-root big time. We need to break the circular dep for now. Signed-off-by: Chris Koch <chrisko@google.com>
2020-09-05- restore OptionGeneric.String()Hu Jun
- add raiValue in option_relay_agent_information.go to implement fmt.Stringer - change test cases accordingly Signed-off-by: Hu Jun <hujun.work@gmail.com>
2020-08-31- fixed some test cases broken by this PRHu Jun
- add a space in OptionGeneric.String() - move the indenting "\n" from OptionHumanizer.Stringify to RelayOptions.String() Signed-off-by: Hu Jun <hujun.work@gmail.com>
2020-06-20dhcpv4: Also write out 0-length optionsAnatole Denis
When there was a 0-length generic option, it would be omitted. Rapid commit (option 80) is a 0-length option with a length tag. There could also be 0-length options in the vendor extensions, and the RFC states that they should be written out: > Any options defined subsequent to this document should contain a > length octet even if the length is fixed or zero. Signed-off-by: Anatole Denis <natolumin@unverle.fr>
2019-01-24dhcpv4: nicer API for option parsing.Christopher Koch
From: r := d.GetOneOption(OptionRouter).(*OptRouter).Routers d.UpdateOption(&OptRouter{Routers: []net.IP{net.IP{192, 168, 0, 1}}}) To: r := GetRouter(d.Options) d.UpdateOption(OptRouter(net.IP{192, 168, 0, 1}, ...))
2019-01-14dhcpv4: change OptionCode to an interface for humanization.Christopher Koch
Interface'd OptionCodes can print the correct human string. It sucks because option codes are just a byte, but depending on where you use them, they are interpreted differently. BSDP option codes != DHCP option codes.
2019-01-11dhcpv4: remove unused Option.Length function.Christopher Koch
2019-01-11dhcpv4: simplify marshaling options to binary.Christopher Koch
- Consolidate writing the option code and length to Options.Marshal rather than doing it in each individual option. - Use uio in marshaling code.
2019-01-10dhcpv4: simplify option parsing.Christopher Koch
option's codes and lengths were being parsed twice: once in ParseOption and once in each option type's Parse implementation. Consolidate such that it only happens once. Additionally, only pass data to options that they should parse -- we know the length before the Parse function is called, so the option only gets to see the data it needs to see. Also, use uio.Lexer to simplify parsing code in general. Easier to read and reason about.
2019-01-09dhcpv4: nicer (un-)marshaling of DHCP messages.Christopher Koch
2018-11-11OptRelayAgentInformation: increase coveragePablo Mazzini
2018-11-11OptRelayAgentInformation: increase coveragePablo Mazzini
2018-11-11OptRelayAgentInformation: increase coveragePablo Mazzini
2018-11-11OptRelayAgentInformation: increase coveragePablo Mazzini
2018-10-03dhcpv4: Add OptRootPath (#163)Sean Karlage
* dhcpv4: Add OptRootPath Adds a root path option that supports DHCPv4 option 17 * Add root path parsing to giant option parsing switch
2018-08-15stop parsing after end (#132)Pablo Mazzini
2018-08-02OptClientArchType: increase coveragePablo Mazzini
2018-08-02OptClientArchType: increase coveragePablo Mazzini
2018-08-02OptClientArchType: increase coveragePablo Mazzini
2018-08-02OptClientArchType: increase coveragePablo Mazzini
2018-08-02OptClientArchType: increase coveragePablo Mazzini
2018-08-02OptClientArchTypePablo Mazzini
2018-08-02add OptClientArchTypePablo Mazzini
2018-07-29add OptRouterPablo Mazzini
2018-07-29OptSubnetMask: add options testPablo Mazzini
2018-07-25Added additional ParseOption tests (#93)Owen Mooney
2018-03-16Add more specific dhcpv4 options (#17)Sean Karlage
Added several DHCPv4 options
2018-03-13Add OptionGeneric, comment out other code so tests compile/passSean Karlage
2018-03-06Refactor tests to use stretchr/testify/requireSean Karlage
2017-12-05Initial commitAndrea Barberio