--- /dev/null
+--- 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;