summaryrefslogtreecommitdiff
path: root/src/ra.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ra.h')
-rw-r--r--src/ra.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ra.h b/src/ra.h
new file mode 100644
index 0000000..37d9573
--- /dev/null
+++ b/src/ra.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#define ALL_IPV6_NODES {{{0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}}}
+
+#define ALL_IPV6_ROUTERS {{{0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02}}}
+
+struct icmpv6_opt {
+ uint8_t type;
+ uint8_t len;
+ uint8_t data[6];
+};
+
+#define ND_OPT_ROUTE_INFORMATION 24
+
+
+#define icmpv6_for_each_option(opt, start, end)\
+ for (opt = (struct icmpv6_opt*)(start);\
+ (void*)(opt + 1) <= (void*)(end) && opt->len > 0 &&\
+ (void*)(opt + opt->len) <= (void*)(end); opt += opt->len)
+
+
+int ra_init(const char *ifname);
+bool ra_process(void);
+bool ra_rtnl_process(void);