1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
|
--- a/tools/flow6.c
+++ b/tools/flow6.c
@@ -85,8 +85,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/frag6.c
+++ b/tools/frag6.c
@@ -94,8 +94,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/icmp6.c
+++ b/tools/icmp6.c
@@ -114,8 +114,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/ipv6toolkit.h
+++ b/tools/ipv6toolkit.h
@@ -2,3 +2,10 @@
#define MAX_CMDLINE_OPT_LEN 40
#define DATE_STR_LEN 40
+#include <pcap.h>
+#include <setjmp.h>
+
+extern char errbuf[PCAP_ERRBUF_SIZE];
+extern struct bpf_program pcap_filter;
+extern sigjmp_buf env;
+extern unsigned int canjump;
--- a/tools/jumbo6.c
+++ b/tools/jumbo6.c
@@ -80,8 +80,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/na6.c
+++ b/tools/na6.c
@@ -61,8 +61,7 @@
struct in6_addr *pkt_ipv6addr;
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
char all_nodes_addr[]= ALL_NODES_MULTICAST_ADDR;
unsigned char buffer[65556];
unsigned char *v6buffer, *ptr, *startofprefixes;
--- a/tools/ni6.c
+++ b/tools/ni6.c
@@ -90,8 +90,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
char domain[MAX_DOMAIN_LEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
--- a/tools/ns6.c
+++ b/tools/ns6.c
@@ -59,8 +59,7 @@
const u_char *pktdata;
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556];
unsigned char *v6buffer, *ptr, *startofprefixes;
--- a/tools/path6.c
+++ b/tools/path6.c
@@ -88,8 +88,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/ra6.c
+++ b/tools/ra6.c
@@ -64,8 +64,7 @@
struct in6_addr *pkt_ipv6addr;
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
char all_nodes_addr[]= ALL_NODES_MULTICAST_ADDR;
unsigned char buffer[ETHER_HDR_LEN+MIN_IPV6_HLEN+MAX_IPV6_PAYLOAD];
--- a/tools/rd6.c
+++ b/tools/rd6.c
@@ -106,8 +106,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/rs6.c
+++ b/tools/rs6.c
@@ -60,8 +60,7 @@
struct in6_addr *pkt_ipv6addr;
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
char all_nodes_addr[]= ALL_NODES_MULTICAST_ADDR;
unsigned char buffer[65556];
--- a/tools/scan6.c
+++ b/tools/scan6.c
@@ -153,8 +153,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[BUFFER_SIZE], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
char line[LINE_BUFFER_SIZE];
unsigned char *v6buffer, *ptr, *startofprefixes;
@@ -269,10 +268,6 @@
443, 547, 993, 995, 1194, 3306, 5060, 5061, 5432, 6446, 8080};
-/* IPv6 Address Resolution */
-sigjmp_buf env;
-unsigned int canjump;
-
int main(int argc, char **argv){
extern char *optarg;
int r;
--- a/tools/tcp6.c
+++ b/tools/tcp6.c
@@ -116,8 +116,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_TCP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
--- a/tools/udp6.c
+++ b/tools/udp6.c
@@ -99,8 +99,7 @@
bpf_u_int32 my_netmask;
bpf_u_int32 my_ip;
-struct bpf_program pcap_filter;
-char dev[64], errbuf[PCAP_ERRBUF_SIZE];
+char dev[64];
unsigned char buffer[65556], buffrh[MIN_IPV6_HLEN + MIN_UDP_HLEN];
unsigned char *v6buffer, *ptr, *startofprefixes;
char *pref;
|