summaryrefslogtreecommitdiff
blob: 88e668e1a4a558c4436639ac110b00f0b307f2b3 (plain)
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
--- a/configure.in
+++ b/configure.in
@@ -84,15 +84,26 @@
 dnl #######################
 dnl Checks for header files
 dnl #######################
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(sys/time.h sys/stat.h unistd.h strings.h fcntl.h netinet/ip6.h)
+AC_CHECK_HEADERS(sys/time.h sys/stat.h unistd.h strings.h fcntl.h)
 
 dnl BSD/OS Seems to not have a good ethernet header, so we gotta wing it
 AC_CHECK_HEADERS(net/if.h net/ethernet.h netinet/if_ether.h net/ppp_defs.h)
 
+AC_ARG_ENABLE( ipv6, [ AC_HELP_STRING([--enable-ipv6], [s use IPv6?]) ], ip6=$enableval )
+if test "$ip6" = "yes"
+then
+	AC_CHECK_HEADER(netinet/ip6.h, , [AC_MSG_ERROR([I couldn't find netinet/ip6.h though you asked for ipv6 support.])] )
+elif test "$ip6" != "no"
+then
+	AC_CHECK_HEADER(netinet/ip6.h)
+
+fi
+
+
 dnl #############################################################
 dnl Checks for typedefs, structures, and compiler characteristics
 dnl #############################################################
 AC_C_CONST
 AC_TYPE_SIZE_T
@@ -147,34 +158,11 @@
   If you already have... then please rerun configure with the option
     --with-pcap-lib=DIR
   with "DIR" being where libpcap is found.])
 ])
 
-dnl look for dbopen for tcpprof
-TCPPROF=""
-LD_TCPPROF=""
-AC_CHECK_LIB(c, dbopen, [ TCPPROF=tcpprof ], [
- AC_CHECK_LIB(db1, dbopen, [
-  TCPPROF=tcpprof
-  LD_TCPPROF="-ldb1"
-  AC_DEFINE(USE_DB1_LIBRARY, 1, [ Use the sleepycat DB library. ])
-  ], [
-  AC_MSG_WARN([
-
-  *** WARNING ***
-  I couldn't locate the Berkeley DB library.  The extra utility
-  "tcpprof" will not be built.  THIS IS OK!!!  "tcpstat" will
-  continue to be built as if this never happened.
-
-  If you wish to use the extra "tcpprof" program, please install
-  the Berkeley DB library from:
-      ftp://ftp.cs.berkeley.edu/ucb/4bsd/db.tar.gz
-    ])
-  ])
-])
 AC_SUBST(TCPPROF)
-AC_SUBST(LD_TCPPROF)
 AC_SUBST(MATHLIB)
 
 AC_CONFIG_FILES([
 Makefile
 doc/Makefile
--- a/lib/process.c
+++ b/lib/process.c
@@ -230,12 +230,12 @@
  *   calls a user function pointing to the data
  *
  * XXX: filter is not used.  capture_seconds also isn't, but snoop is
  *	always read from a file.
  */
-int get_snoop_data(char *fname, char *filter, int flags,
-	Double capture_seconds, void (*hook)(packet_data *, void **),
+int get_snoop_data(char *fname,  char *filter __attribute__((unused)), int flags,
+	Double capture_seconds __attribute__((unused)), void (*hook)(packet_data *, void **),
 	void **args) {
 
 	u_char *packet;
 	int fd, len, blen, ret = 0;
 	struct snoop_file_header	fh;
--- a/lib/tcpseq.c
+++ b/lib/tcpseq.c
@@ -54,11 +54,10 @@
 	u_char	flags;
 	struct tcpseq_ha test_ha;
 	struct tcphdr *tp = NULL;
 	struct ip *ip;
 #ifdef INET6
-	int is_ip6 = 0;
 	struct ip6_hdr *ip6;
 
 	ip6 = (struct ip6_hdr *) &pd->data.ip6.hdr;
 	if (is_ip6_packet(pd))
 		tp= &(pd->data.ip6.body.tcphdr);
--- a/src/catpcap.c
+++ b/src/catpcap.c
@@ -50,11 +50,11 @@
 	if (c == ' ') return c;
 	if ((u_char)c > 0xa1 && SHOW_HIGH_BIT) return c;
 	return '.';
 }
 
-void proc_pcap(u_char *user, const struct pcap_pkthdr *h, const u_char *p) {
+void proc_pcap(u_char *user __attribute__((unused)), const struct pcap_pkthdr *h, const u_char *p) {
 	u_int length = h->caplen, i, j, k, step;
 	u_char *r, *s;
 	char c;
 
 	r = (u_char *)p;
@@ -90,11 +90,11 @@
 }
 /*
  * process_file() takes the output of tcpdump, saves packets, and displays
  * statistics
  */
-void process_file(char *fname, u_int unused) {
+void process_file(char *fname, u_int unused __attribute__((unused))) {
 	int run = 1, i;
 	pcap_t	*pd;
 	char	ebuf[PCAP_ERRBUF_SIZE];
 	struct bpf_program	bpf_prog;
 
--- a/src/dump.c
+++ b/src/dump.c
@@ -37,21 +37,21 @@
 char filterexpr[BUF_SIZ]	= "";
 int	get_tcp_flags		= 0;
 int	what_to_show		= 0;
 int	packet_number		= 0;
 
-void my_hook(packet_data *pd, void **args) {
+void my_hook(packet_data *pd) {
 	printf("PACKET NUMBER: %d\n", ++packet_number);
 	print_packet(pd, what_to_show);
 	printf("-------------------\n");
 }
 
 /*
  * process_file() takes the output of tcpdump, saves packets, and displays
  * statistics
  */
-void process_file(char *fname, u_int unused) {
+void process_file(char *fname, u_int unused __attribute__((unused))) {
         get_dump_data(fname, filterexpr, get_tcp_flags,
 		-1.0, my_hook, NULL);
 }
 
 int parse_show_types(char *in) {
--- a/src/tcpstat.c
+++ b/src/tcpstat.c
@@ -421,11 +421,11 @@
 }
 
 /*
  * process_file() gets the data, and then displays the statistics
  */
-void process_file(char *fname, u_int unused) {
+void process_file(char *fname, u_int unused __attribute__((unused))) {
 	void		*argv[2];
 	statistics	stats;
 	Double		x;
 
 	signal(SIGUSR1, catch_signal);