summaryrefslogtreecommitdiff
path: root/system.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-09-06 12:57:20 +0200
committerFelix Fietkau <nbd@openwrt.org>2012-09-06 16:54:38 +0200
commitc58e7f45ec4e32db109ffb12d22745133a3b1068 (patch)
tree155990c7b8804e8996b9b18abff46fd49f019bc5 /system.h
parent9411d498c46fe3f1c4d79eb8fa0b7c97dd32a990 (diff)
downloadnetifd-c58e7f45ec4e32db109ffb12d22745133a3b1068.tar.gz
clean up and fix system-dummy addr/route messages
Diffstat (limited to 'system.h')
-rw-r--r--system.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/system.h b/system.h
index 701e44a..7716fbd 100644
--- 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);