]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/ra.h
Add RA-handling support
[odhcp6c.git] / src / ra.h
diff --git a/src/ra.h b/src/ra.h
new file mode 100644 (file)
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);