chiark / gitweb /
networkd: introduce an AddressFamilyBoolean enum type
[elogind.git] / src / network / networkd.h
index a5c5b085bad58b0891f22438e790b7170e6ec40b..b36590e2d6ca70779a92cd096c4d639799028a60 100644 (file)
@@ -32,6 +32,7 @@
 #include "sd-icmp6-nd.h"
 #include "sd-dhcp6-client.h"
 #include "udev.h"
+#include "sd-lldp.h"
 
 #include "rtnl-util.h"
 #include "hashmap.h"
@@ -53,14 +54,14 @@ typedef struct Manager Manager;
 typedef struct AddressPool AddressPool;
 typedef struct FdbEntry FdbEntry;
 
-typedef enum DHCPSupport {
-        DHCP_SUPPORT_NONE,
-        DHCP_SUPPORT_BOTH,
-        DHCP_SUPPORT_V4,
-        DHCP_SUPPORT_V6,
-        _DHCP_SUPPORT_MAX,
-        _DHCP_SUPPORT_INVALID = -1,
-} DHCPSupport;
+typedef enum AddressFamilyBoolean {
+        ADDRESS_FAMILY_NO,
+        ADDRESS_FAMILY_YES,
+        ADDRESS_FAMILY_IPV4,
+        ADDRESS_FAMILY_IPV6,
+        _ADDRESS_FAMILY_BOOLEAN_MAX,
+        _ADDRESS_FAMILY_BOOLEAN_INVALID = -1,
+} AddressFamilyBoolean;
 
 typedef enum LLMNRSupport {
         LLMNR_SUPPORT_NO,
@@ -101,7 +102,7 @@ struct Network {
         NetDev *bridge;
         NetDev *bond;
         Hashmap *stacked_netdevs;
-        DHCPSupport dhcp;
+        AddressFamilyBoolean dhcp;
         bool dhcp_dns;
         bool dhcp_ntp;
         bool dhcp_mtu;
@@ -119,9 +120,14 @@ struct Network {
 
         unsigned cost;
 
+        bool ip_masquerade;
+        bool ip_forward;
+
         struct ether_addr *mac;
         unsigned mtu;
 
+        bool lldp;
+
         LIST_HEAD(Address, static_addresses);
         LIST_HEAD(Route, static_routes);
         LIST_HEAD(FdbEntry, static_fdb_entries);
@@ -154,6 +160,8 @@ struct Address {
         union in_addr_union in_addr;
         union in_addr_union in_addr_peer;
 
+        bool ip_forward_done;
+
         LIST_FIELDS(Address, addresses);
 };
 
@@ -323,6 +331,8 @@ void address_free(Address *address);
 int address_configure(Address *address, Link *link, sd_rtnl_message_handler_t callback);
 int address_update(Address *address, Link *link, sd_rtnl_message_handler_t callback);
 int address_drop(Address *address, Link *link, sd_rtnl_message_handler_t callback);
+int address_establish(Address *address, Link *link);
+int address_release(Address *address, Link *link);
 bool address_equal(Address *a1, Address *a2);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC(Address*, address_free);
@@ -358,9 +368,6 @@ int config_parse_fdb_vlan_id(const char *unit, const char *filename, unsigned li
 
 /* 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);
@@ -381,3 +388,6 @@ int address_pool_new_from_string(Manager *m, AddressPool **ret, int family, cons
 void address_pool_free(AddressPool *p);
 
 int address_pool_acquire(AddressPool *p, unsigned prefixlen, union in_addr_union *found);
+
+const char *address_family_boolean_to_string(AddressFamilyBoolean b) _const_;
+AddressFamilyBoolean address_family_boolean_from_string(const char *s) _const_;