summaryrefslogtreecommitdiff
path: root/src/network/networkd.h
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-28 16:00:49 +0200
committerTom Gundersen <teg@jklm.no>2014-06-29 15:18:21 +0200
commited942a9eb22d50f667909ad6184b45015d28d054 (patch)
tree760aa4ceb830afc515d98dfc6539cbefd48bfd6c /src/network/networkd.h
parent68ceb9df6a39a7f86ffc3cf8266ca677a5d5271b (diff)
networkd: merge DHCPv4 and DHCPv6 config
If there are v4 or v6 specific options we can keep those in separate sections, but for the common options, we will use only one. Moreovere only use DHCP=[yes/both|no/none|v4|v6] to enable or disable the clients.
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r--src/network/networkd.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h
index b7b1d903b2..67f70d9e60 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -131,6 +131,15 @@ struct NetDev {
LIST_HEAD(netdev_enslave_callback, callbacks);
};
+typedef enum DHCPSupport {
+ DHCP_SUPPORT_NONE,
+ DHCP_SUPPORT_BOTH,
+ DHCP_SUPPORT_V4,
+ DHCP_SUPPORT_V6,
+ _DHCP_SUPPORT_MAX,
+ _DHCP_SUPPORT_INVALID = -1,
+} DHCPSupport;
+
struct Network {
Manager *manager;
@@ -153,7 +162,7 @@ struct Network {
Hashmap *vlans;
Hashmap *macvlans;
Hashmap *vxlans;
- bool dhcp;
+ DHCPSupport dhcp;
bool dhcp_dns;
bool dhcp_ntp;
bool dhcp_mtu;
@@ -161,7 +170,6 @@ struct Network {
bool dhcp_domainname;
bool dhcp_critical;
bool ipv4ll;
- bool dhcp6;
bool dhcp_server;
@@ -472,6 +480,15 @@ LinkOperationalState link_operstate_from_string(const char *s) _pure_;
DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref);
#define _cleanup_link_unref_ _cleanup_(link_unrefp)
+/* DHCP support */
+
+const char* dhcp_support_to_string(DHCPSupport i) _const_;
+DHCPSupport dhcp_support_from_string(const char *s) _pure_;
+
+int config_parse_dhcp(const char *unit, const char *filename, unsigned line,
+ const char *section, unsigned section_line, const char *lvalue,
+ int ltype, const char *rvalue, void *data, void *userdata);
+
/* Address Pool */
int address_pool_new(Manager *m, AddressPool **ret, unsigned family, const union in_addr_union *u, unsigned prefixlen);