chiark / gitweb /
networkd: add and expose per-link LLMNR config option
[elogind.git] / src / network / networkd.h
index 9abc0d46ec0c511a8fbea86fdf3f8d15216bae60..d5c229cf4620b361f384643739d9bbde64a1a7a5 100644 (file)
@@ -61,6 +61,14 @@ typedef enum DHCPSupport {
         _DHCP_SUPPORT_INVALID = -1,
 } DHCPSupport;
 
+typedef enum LLMNRSupport {
+        LLMNR_SUPPORT_NO,
+        LLMNR_SUPPORT_YES,
+        LLMNR_SUPPORT_RESOLVE,
+        _LLMNR_SUPPORT_MAX,
+        _LLMNR_SUPPORT_INVALID = -1,
+} LLMNRSupport;
+
 struct Network {
         Manager *manager;
 
@@ -81,10 +89,7 @@ struct Network {
         char *description;
         NetDev *bridge;
         NetDev *bond;
-        NetDev *tunnel;
-        Hashmap *vlans;
-        Hashmap *macvlans;
-        Hashmap *vxlans;
+        Hashmap *stacked_netdevs;
         DHCPSupport dhcp;
         bool dhcp_dns;
         bool dhcp_ntp;
@@ -96,6 +101,7 @@ struct Network {
         bool dhcp_critical;
         bool dhcp_routes;
         bool ipv4ll;
+        bool ipv4ll_route;
 
         bool dhcp_server;
 
@@ -105,17 +111,18 @@ struct Network {
         Hashmap *addresses_by_section;
         Hashmap *routes_by_section;
 
-        LIST_HEAD(Address, dns);
-        LIST_HEAD(Address, ntp);
+        char **dns, **ntp;
+
+        LLMNRSupport llmnr;
 
         LIST_FIELDS(Network, networks);
 };
 
 struct Address {
         Network *network;
-        uint64_t section;
+        unsigned section;
 
-        unsigned char family;
+        int family;
         unsigned char prefixlen;
         unsigned char scope;
         char *label;
@@ -131,12 +138,13 @@ struct Address {
 
 struct Route {
         Network *network;
-        uint64_t section;
+        unsigned section;
 
-        unsigned char family;
+        int family;
         unsigned char dst_prefixlen;
         unsigned char scope;
         uint32_t metrics;
+        unsigned char protocol;  /* RTPROT_* */
 
         union in_addr_union in_addr;
         union in_addr_union dst_addr;
@@ -172,10 +180,11 @@ struct Link {
 
         int n_ref;
 
-        uint64_t ifindex;
+        int ifindex;
         char *ifname;
         char *state_file;
         struct ether_addr mac;
+        uint32_t mtu;
         struct udev_device *udev_device;
 
         unsigned flags;
@@ -209,7 +218,7 @@ struct Link {
 struct AddressPool {
         Manager *manager;
 
-        unsigned family;
+        int family;
         unsigned prefixlen;
 
         union in_addr_union in_addr;
@@ -255,7 +264,7 @@ int manager_bus_listen(Manager *m);
 
 int manager_save(Manager *m);
 
-int manager_address_pool_acquire(Manager *m, unsigned family, unsigned prefixlen, union in_addr_union *found);
+int manager_address_pool_acquire(Manager *m, int family, unsigned prefixlen, union in_addr_union *found);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free);
 #define _cleanup_manager_free_ _cleanup_(manager_freep)
@@ -305,7 +314,7 @@ const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsig
 
 /* Route */
 int route_new_static(Network *network, unsigned section, Route **ret);
-int route_new_dynamic(Route **ret);
+int route_new_dynamic(Route **ret, unsigned char rtm_protocol);
 void route_free(Route *route);
 int route_configure(Route *route, Link *link, sd_rtnl_message_handler_t callback);
 int route_drop(Route *route, Link *link, sd_rtnl_message_handler_t callback);
@@ -337,10 +346,6 @@ bool address_equal(Address *a1, Address *a2);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
 #define _cleanup_address_free_ _cleanup_(address_freep)
 
-int config_parse_dns(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);
-
 int config_parse_address(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);
@@ -388,10 +393,19 @@ 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);
 
+/* LLMNR support */
+
+const char* llmnr_support_to_string(LLMNRSupport i) _const_;
+LLMNRSupport llmnr_support_from_string(const char *s) _pure_;
+
+int config_parse_llmnr(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);
-int address_pool_new_from_string(Manager *m, AddressPool **ret, unsigned family, const char *p, unsigned prefixlen);
+int address_pool_new(Manager *m, AddressPool **ret, int family, const union in_addr_union *u, unsigned prefixlen);
+int address_pool_new_from_string(Manager *m, AddressPool **ret, int family, const char *p, unsigned prefixlen);
 void address_pool_free(AddressPool *p);
 
 int address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);