2
* Header file for the rd6 tool
6
#define LUI long unsigned int
8
#define ETH_ALEN 6 /* Octets in one ethernet addr */
9
#define ETH_HLEN 14 /* Total octets in header. */
10
#define ETH_DATA_LEN 1500 /* Max. octets in payload */
11
#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */
12
#define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */
13
#define ETHER_HDR_LEN ETH_HLEN /* total octets in header */
15
#define ETHER_ADDR_PLEN 18 /* Includes termination byte */
17
#define ETHER_ALLNODES_LINK_ADDR "33:33:00:00:00:01"
18
#define ETHER_ALLROUTERS_LINK_ADDR "33:33:00:00:00:02"
20
#define MIN_IPV6_HLEN 40
21
#define MIN_TCP_HLEN 20
22
#define MIN_UDP_HLEN 20
23
#define MIN_ICMP6_HLEN 8
24
#define SLLA_OPT_LEN 1
25
#define TLLA_OPT_LEN 1
26
#define MAX_TLLA_OPTION 256
27
#define IFACE_LENGTH 255
28
#define ALL_NODES_MULTICAST_ADDR "FF02::1"
29
#define ALL_ROUTERS_MULTICAST_ADDR "FF02::2"
30
#define SOLICITED_NODE_MULTICAST_PREFIX "FF02:0:0:0:0:1:FF00::"
33
/* Support for IPv6 extension headers */
34
#define FRAG_HDR_SIZE 8
35
#define MAX_IPV6_PAYLOAD 65535
36
#define MAX_DST_OPT_HDR 256
37
#define MAX_DST_OPT_U_HDR MAX_DST_OPT_HDR
38
#define MAX_HBH_OPT_HDR MAX_DST_OPT_HDR
41
/* Filter Constants */
42
#define MAX_BLOCK_SRC 50
43
#define MAX_BLOCK_DST 50
44
#define MAX_BLOCK_TARGET 50
45
#define MAX_BLOCK_LINK_SRC 50
46
#define MAX_BLOCK_LINK_DST 50
48
#define MAX_ACCEPT_SRC 50
49
#define MAX_ACCEPT_DST 50
50
#define MAX_ACCEPT_TARGET 50
51
#define MAX_ACCEPT_LINK_SRC 50
52
#define MAX_ACCEPT_LINK_DST 50
57
/* Constants used with the libpcap functions */
58
#define PCAP_ICMPV6_NA_FILTER "icmp6 and ip6[7]==255 and ip6[40]==136 and ip6[41]==0"
59
#define PCAP_ICMPV6_RA_FILTER "icmp6 and ip6[7]==255 and ip6[40]==134 and ip6[41]==0"
60
#define PCAP_IPV6_FILTER "ip6"
63
u_int8_t a[ETHER_ADDR_LEN];
64
} __attribute__ ((__packed__));
70
} __attribute__ ((__packed__));
76
} __attribute__ ((__packed__));
79
struct in6_addr srcaddr;
80
struct in6_addr dstaddr;
84
} __attribute__ ((__packed__));
86
/* 10Mb/s ethernet header */
89
struct ether_addr dst; /* destination eth addr */
90
struct ether_addr src; /* source ether addr */
91
u_int16_t ether_type; /* packet type ID field */
92
} __attribute__ ((__packed__));
95
#if defined (__FreeBSD__) || defined(__NetBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
97
#define s6_addr16 __u6_addr.__u6_addr16
101
#define s6_addr8 __u6_addr.__u6_addr8
105
#define s6_addr32 __u6_addr.__u6_addr32
110
/* This causes Linux to use the BSD definition of the TCP and UDP header fields */