chiark / gitweb /
networkd: route/address - use trivial hash functions
[elogind.git] / src / network / networkd.h
index f1c7f204ea862af7b4404abdbdf3b258c99f60ba..766297cffa6985f802b37cbf05f943d597290c13 100644 (file)
@@ -81,10 +81,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 +93,7 @@ struct Network {
         bool dhcp_critical;
         bool dhcp_routes;
         bool ipv4ll;
+        bool ipv4ll_route;
 
         bool dhcp_server;
 
@@ -105,15 +103,14 @@ struct Network {
         Hashmap *addresses_by_section;
         Hashmap *routes_by_section;
 
-        LIST_HEAD(Address, dns);
-        LIST_HEAD(Address, ntp);
+        char **dns, **ntp;
 
         LIST_FIELDS(Network, networks);
 };
 
 struct Address {
         Network *network;
-        uint64_t section;
+        unsigned section;
 
         int family;
         unsigned char prefixlen;
@@ -131,12 +128,13 @@ struct Address {
 
 struct Route {
         Network *network;
-        uint64_t section;
+        unsigned section;
 
         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,7 +170,7 @@ struct Link {
 
         int n_ref;
 
-        uint64_t ifindex;
+        int ifindex;
         char *ifname;
         char *state_file;
         struct ether_addr mac;
@@ -305,7 +303,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 +335,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);