From f12ed3bf0b315fc88d5fbdf5bdca14b218c86e0c Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Thu, 19 Jun 2014 15:39:20 +0300 Subject: sd-dhcp6-client: Add basic DHCPv6 option handling Add option appending and parsing. DHCPv6 options are not aligned, thus the option handling code must be able to handle options starting at any byte boundary. Add a test case for the basic option handling. --- src/libsystemd-network/dhcp6-internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/libsystemd-network/dhcp6-internal.h') diff --git a/src/libsystemd-network/dhcp6-internal.h b/src/libsystemd-network/dhcp6-internal.h index 1cdb912548..30b624d54c 100644 --- a/src/libsystemd-network/dhcp6-internal.h +++ b/src/libsystemd-network/dhcp6-internal.h @@ -59,3 +59,9 @@ typedef struct DHCP6IA DHCP6IA; int dhcp_network_icmp6_bind_router_solicitation(int index); int dhcp_network_icmp6_send_router_solicitation(int s, const struct ether_addr *ether_addr); + +int dhcp6_option_append(uint8_t **buf, size_t *buflen, uint16_t code, + size_t optlen, const void *optval); +int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, DHCP6IA *ia); +int dhcp6_option_parse(uint8_t **buf, size_t *buflen, uint16_t *optcode, + size_t *optlen, uint8_t **optvalue); -- cgit v1.2.3-54-g00ecf