summaryrefslogtreecommitdiff
path: root/src/libsystemd-network/dhcp-lease-internal.h
diff options
context:
space:
mode:
authorAlex Crawford <alex.crawford@coreos.com>2015-07-31 20:02:22 -0700
committerAlex Crawford <alex.crawford@coreos.com>2015-08-05 09:00:57 -0700
commit7e753d9d28ca93fe0e48fd3605ed7c3371736422 (patch)
tree304f1ef1b5efabbee16a0c6f1900d2b794cd0e0f /src/libsystemd-network/dhcp-lease-internal.h
parent85e22bfc3f9192d18f262c6978e926d74c6a6992 (diff)
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.
Diffstat (limited to 'src/libsystemd-network/dhcp-lease-internal.h')
-rw-r--r--src/libsystemd-network/dhcp-lease-internal.h12
1 files changed, 12 insertions, 0 deletions
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);