#include "sd-dhcp-client.h"
#include "sd-dhcp-server.h"
#include "sd-ipv4ll.h"
+#include "sd-icmp6-nd.h"
+#include "sd-dhcp6-client.h"
#include "udev.h"
#include "rtnl-util.h"
#define CACHE_INFO_INFINITY_LIFE_TIME 0xFFFFFFFFU
#define VXLAN_VID_MAX (1u << 24) - 1
+#define DHCP_STATIC_ROUTE_METRIC 1024
typedef struct NetDev NetDev;
typedef struct Network Network;
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;
Hashmap *vlans;
Hashmap *macvlans;
Hashmap *vxlans;
- bool dhcp;
+ DHCPSupport dhcp;
bool dhcp_dns;
bool dhcp_ntp;
bool dhcp_mtu;
bool dhcp_hostname;
bool dhcp_domainname;
bool dhcp_critical;
+ bool dhcp_routes;
bool ipv4ll;
bool dhcp_server;
LIST_HEAD(Address, pool_addresses);
sd_dhcp_server *dhcp_server;
+
+ sd_icmp6_nd *icmp6_router_discovery;
+ sd_dhcp6_client *dhcp6_client;
};
struct AddressPool {
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);