From 7e753d9d28ca93fe0e48fd3605ed7c3371736422 Mon Sep 17 00:00:00 2001 From: Alex Crawford Date: Fri, 31 Jul 2015 20:02:22 -0700 Subject: networkd: add private options to lease struct This stores private-zone DHCP options inside of their respective DHCP lease. These options aren't used by networkd (what would it do with them?), but saving them will allow other programs to query the values. To improve performance, the options are stored in ascending order by tag. --- src/libsystemd-network/dhcp-lease-internal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/libsystemd-network/dhcp-lease-internal.h') diff --git a/src/libsystemd-network/dhcp-lease-internal.h b/src/libsystemd-network/dhcp-lease-internal.h index 6e00b1ad30..5a3fcddb1b 100644 --- a/src/libsystemd-network/dhcp-lease-internal.h +++ b/src/libsystemd-network/dhcp-lease-internal.h @@ -27,6 +27,7 @@ #include "refcnt.h" #include "util.h" +#include "list.h" #include "dhcp-protocol.h" @@ -38,6 +39,14 @@ struct sd_dhcp_route { unsigned char dst_prefixlen; }; +struct sd_dhcp_raw_option { + LIST_FIELDS(struct sd_dhcp_raw_option, options); + + uint8_t tag; + uint8_t length; + void *data; +}; + struct sd_dhcp_lease { RefCount n_ref; @@ -74,11 +83,14 @@ struct sd_dhcp_lease { size_t client_id_len; uint8_t *vendor_specific; size_t vendor_specific_len; + LIST_HEAD(struct sd_dhcp_raw_option, private_options); }; int dhcp_lease_new(sd_dhcp_lease **ret); int dhcp_lease_parse_options(uint8_t code, uint8_t len, const uint8_t *option, void *user_data); +int dhcp_lease_insert_private_option(sd_dhcp_lease *lease, uint8_t tag, + const uint8_t *data, uint8_t len); int dhcp_lease_set_default_subnet_mask(sd_dhcp_lease *lease); -- cgit v1.2.3-54-g00ecf