Implement support for route / route6 table attribute
[project/netifd.git] / system.h
index 701e44a..b093371 100644 (file)
--- a/system.h
+++ b/system.h
@@ -16,6 +16,7 @@
 
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <arpa/inet.h>
 #include "device.h"
 #include "interface-ip.h"
 
@@ -49,6 +50,22 @@ struct bridge_config {
        int max_age;
 };
 
+static inline int system_get_addr_family(unsigned int flags)
+{
+       if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6)
+               return AF_INET6;
+       else
+               return AF_INET;
+}
+
+static inline int system_get_addr_len(unsigned int flags)
+{
+       if ((flags & DEVADDR_FAMILY) == DEVADDR_INET6)
+               return sizeof(struct in_addr);
+       else
+               return sizeof(struct in6_addr);
+}
+
 int system_init(void);
 
 int system_bridge_addbr(struct device *bridge, struct bridge_config *cfg);
@@ -77,9 +94,15 @@ int system_add_route(struct device *dev, struct device_route *route);
 int system_del_route(struct device *dev, struct device_route *route);
 int system_flush_routes(void);
 
+bool system_resolve_rt_table(const char *name, unsigned int *id);
+
 int system_del_ip_tunnel(const char *name);
 int system_add_ip_tunnel(const char *name, struct blob_attr *attr);
 
 time_t system_get_rtime(void);
 
+void system_fd_set_cloexec(int fd);
+
+int system_update_ipv6_mtu(struct device *device, int mtu);
+
 #endif