View | Details | Raw Unified | Return to bug 247952 | Differences between
and this patch

Collapse All | Expand All

(-)b/contrib/ipfilter/man/ipfstat.8 (-2 / +7 lines)
Lines 5-11 ipfstat \- reports on packet filter statistics and filter list Link Here
5
.SH SYNOPSIS
5
.SH SYNOPSIS
6
.B ipfstat
6
.B ipfstat
7
[
7
[
8
.B \-6aAdfghIilnoRsv
8
.B \-46aAdfghIilnoRsv
9
]
9
]
10
.br
10
.br
11
.B ipfstat -t
11
.B ipfstat -t
Lines 35-40 is to retrieve and display the accumulated statistics which have been Link Here
35
accumulated over time as the kernel has put packets through the filter.
35
accumulated over time as the kernel has put packets through the filter.
36
.SH OPTIONS
36
.SH OPTIONS
37
.TP
37
.TP
38
.B \-4
39
Display filter lists and states for IPv4, if available. This is the default
40
when displaying states.  \fB-4\fP and \fB-6\fP is the default when
41
displaying lists.
42
.TP
38
.B \-6
43
.B \-6
39
Display filter lists and states for IPv6, if available.
44
Display filter lists and states for IPv6, if available.
40
.TP
45
.TP
Lines 190-193 more entries is to resize the screen. Link Here
190
.SH SEE ALSO
195
.SH SEE ALSO
191
ipf(8)
196
ipf(8)
192
.SH BUGS
197
.SH BUGS
193
none known.
198
\fB-4\fP and \fB-6\fP should also be the default when displaying states.
(-)b/contrib/ipfilter/tools/ipfstat.c (-9 / +38 lines)
Lines 57-63 static wordtab_t *state_fields = NULL; Link Here
57
57
58
int	nohdrfields = 0;
58
int	nohdrfields = 0;
59
int	opts = 0;
59
int	opts = 0;
60
#ifdef	USE_INET6
61
int	use_inet4 = 0;
60
int	use_inet6 = 0;
62
int	use_inet6 = 0;
63
#endif
61
int	live_kernel = 1;
64
int	live_kernel = 1;
62
int	state_fd = -1;
65
int	state_fd = -1;
63
int	ipf_fd = -1;
66
int	ipf_fd = -1;
Lines 206-214 int main(argc,argv) Link Here
206
	u_32_t frf;
209
	u_32_t frf;
207
210
208
#ifdef	USE_INET6
211
#ifdef	USE_INET6
209
	options = "6aACdfghIilnostvD:m:M:N:O:P:RS:T:";
212
	options = "46aACdfghIilnostvD:m:M:N:O:P:RS:T:";
210
#else
213
#else
211
	options = "aACdfghIilnostvD:m:M:N:O:P:RS:T:";
214
	options = "4aACdfghIilnostvD:m:M:N:O:P:RS:T:";
212
#endif
215
#endif
213
216
214
	saddr.in4.s_addr = INADDR_ANY; 	/* default any v4 source addr */
217
	saddr.in4.s_addr = INADDR_ANY; 	/* default any v4 source addr */
Lines 283-288 int main(argc,argv) Link Here
283
		switch (c)
286
		switch (c)
284
		{
287
		{
285
#ifdef	USE_INET6
288
#ifdef	USE_INET6
289
		case '4' :
290
			use_inet4 = 1;
291
			break;
286
		case '6' :
292
		case '6' :
287
			use_inet6 = 1;
293
			use_inet6 = 1;
288
			break;
294
			break;
Lines 385-390 int main(argc,argv) Link Here
385
			break;
391
			break;
386
		}
392
		}
387
	}
393
	}
394
#ifdef	USE_INET6
395
	if (use_inet4 == 0 && use_inet6 == 0)
396
		use_inet4 = use_inet6 = 1;
397
#endif
388
398
389
	if (live_kernel == 1) {
399
	if (live_kernel == 1) {
390
		bzero((char *)&fio, sizeof(fio));
400
		bzero((char *)&fio, sizeof(fio));
Lines 410-417 int main(argc,argv) Link Here
410
#ifdef STATETOP
420
#ifdef STATETOP
411
	else if (opts & OPT_STATETOP)
421
	else if (opts & OPT_STATETOP)
412
		topipstates(saddr, daddr, sport, dport, protocol,
422
		topipstates(saddr, daddr, sport, dport, protocol,
413
			    use_inet6 ? 6 : 4, refreshtime, topclosed, filter);
423
#ifdef	USE_INET6
424
			    use_inet6 ? 6 : 4,
425
#else
426
			    4,
427
#endif
414
#endif
428
#endif
429
			    refreshtime, topclosed, filter);
415
	else if (opts & OPT_AUTHSTATS)
430
	else if (opts & OPT_AUTHSTATS)
416
		showauthstates(frauthstp);
431
		showauthstates(frauthstp);
417
	else if (opts & OPT_GROUPS)
432
	else if (opts & OPT_GROUPS)
Lines 805-819 printlivelist(fiop, out, set, fp, group, comment) Link Here
805
		if (rule.iri_rule == NULL)
820
		if (rule.iri_rule == NULL)
806
			break;
821
			break;
807
#ifdef USE_INET6
822
#ifdef USE_INET6
808
		if (use_inet6 != 0) {
823
		if (use_inet6 != 0 && use_inet4 == 0) {
809
			if (fp->fr_family != 0 && fp->fr_family != AF_INET6)
824
			if (fp->fr_family != 0 && fp->fr_family != AF_INET6)
810
				continue;
825
				continue;
811
		} else
826
		} else if (use_inet4 != 0 && use_inet6 == 0) {
812
#endif
827
#endif
813
		{
814
			if (fp->fr_family != 0 && fp->fr_family != AF_INET)
828
			if (fp->fr_family != 0 && fp->fr_family != AF_INET)
815
				continue;
829
				continue;
830
#ifdef USE_INET6
831
		} else {
832
			if (fp->fr_family != 0 &&
833
			   fp->fr_family != AF_INET && fp->fr_family != AF_INET6)
834
				continue;
816
		}
835
		}
836
#endif
837
817
		if (fp->fr_data != NULL)
838
		if (fp->fr_data != NULL)
818
			fp->fr_data = (char *)fp + fp->fr_size;
839
			fp->fr_data = (char *)fp + fp->fr_size;
819
840
Lines 904-916 static void printdeadlist(fiop, out, set, fp, group, comment) Link Here
904
			return;
925
			return;
905
		}
926
		}
906
		fp = &fb;
927
		fp = &fb;
907
		if (use_inet6 != 0) {
928
#ifdef	USE_INET6
908
			if (fp->fr_family != 0 && fp->fr_family != 6)
929
		if (use_inet6 != 0 && use_inet4 == 0) {
930
			if (fp->fr_family != 0 && fp->fr_family != AF_INET6)
909
				continue;
931
				continue;
932
		} else if (use_inet4 != 0 && use_inet6 == 0) {
933
#endif
934
			if (fp->fr_family != 0 && fp->fr_family != AF_INET)
935
				continue;
936
#ifdef	USE_INET6
910
		} else {
937
		} else {
911
			if (fp->fr_family != 0 && fp->fr_family != 4)
938
			if (fp->fr_family != 0 &&
939
			   fp->fr_family != AF_INET && fp->fr_family != AF_INET6)
912
				continue;
940
				continue;
913
		}
941
		}
942
#endif
914
943
915
		data = NULL;
944
		data = NULL;
916
		type = fb.fr_type & ~FR_T_BUILTIN;
945
		type = fb.fr_type & ~FR_T_BUILTIN;

Return to bug 247952