router: add syslog debug tracing for trouble shooting
[project/odhcpd.git] / src / router.h
1 /**
2  * Copyright (C) 2012-2013 Steven Barth <steven@midlink.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License v2 as published by
6  * the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  * GNU General Public License for more details.
12  *
13  */
14
15 #pragma once
16 #include <stdint.h>
17 #include <netinet/in.h>
18 #include <netinet/icmp6.h>
19
20 struct icmpv6_opt {
21         uint8_t type;
22         uint8_t len;
23         uint8_t data[6];
24 };
25
26
27 #define icmpv6_for_each_option(opt, start, end)\
28         for (opt = (struct icmpv6_opt*)(start);\
29         (void*)(opt + 1) <= (void*)(end) && opt->len > 0 &&\
30         (void*)(opt + opt->len) <= (void*)(end); opt += opt->len)
31
32
33 #define MaxValidTime 65535
34 #define MaxRtrAdvInterval 1800
35
36 #define ND_RA_FLAG_PROXY        0x4
37 #define ND_RA_PREF_HIGH (1 << 3)
38 #define ND_RA_PREF_LOW          (3 << 3)