summaryrefslogtreecommitdiffstats
path: root/main/arpwatch/19_all_arpwatch-2.1a15-nonewstation.patch
blob: 521d31ae1bf2dccf569c96187a3add1ed577ba65 (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
diff -Naur arpwatch-2.1a15.orig/arpwatch.8 arpwatch-2.1a15/arpwatch.8
--- arpwatch-2.1a15.orig/arpwatch.8	2006-12-11 12:56:18.000000000 +0300
+++ arpwatch-2.1a15/arpwatch.8	2006-12-11 12:56:53.000000000 +0300
@@ -60,6 +60,11 @@
 .br
 .ti +9
 [
+.B -S
+]
+.br
+.ti +9
+[
 .B -r
 .I file
 ]
@@ -155,6 +160,10 @@
 flag disables reporting any bogons.
 .LP
 The
+.B -S
+flag disables reporting of new stations.
+.LP
+The
 .B -r
 flag is used to specify a savefile
 (perhaps created by
diff -Naur arpwatch-2.1a15.orig/arpwatch.c arpwatch-2.1a15/arpwatch.c
--- arpwatch-2.1a15.orig/arpwatch.c	2006-12-11 12:56:18.000000000 +0300
+++ arpwatch-2.1a15/arpwatch.c	2006-12-11 12:56:53.000000000 +0300
@@ -189,6 +189,7 @@
 		"i:"
 		"n:"
 		"N"
+		"S"
 		"r:"
 		"m:"
 		"s:"
@@ -252,6 +253,10 @@
 			++nobogons;
 			break;
 
+		case 'S':
+			++nonewstations;
+			break;
+
 		case 'r':
 			rfilename = optarg;
 			break;
@@ -883,7 +888,7 @@
 {
 	extern char version[];
 	char usage[] =
-		"[-dN] "
+		"[-dNS] "
 		"[-f datafile] "
 		"[-i interface] "
 		"[-n net[/width]] "
@@ -894,7 +899,7 @@
 		"[-a] "
 		"[-u username] "
 		"[-R seconds ] "
-		"[-Q ] "
+		"[-Q] "
 		"[-z ignorenet/ignoremask] "
 		"\n"
 	;
diff -Naur arpwatch-2.1a15.orig/arpwatch.h arpwatch-2.1a15/arpwatch.h
--- arpwatch-2.1a15.orig/arpwatch.h	2006-12-11 12:56:18.000000000 +0300
+++ arpwatch-2.1a15/arpwatch.h	2006-12-11 12:57:13.000000000 +0300
@@ -16,6 +16,8 @@
 
 extern char *prog;
 
+extern int nonewstations; /* Turns off new-station reporting. */
+
 #ifdef ETHER_HEADER_HAS_EA
 #define ESRC(ep) ((ep)->ether_shost.ether_addr_octet)
 #define EDST(ep) ((ep)->ether_dhost.ether_addr_octet)
diff -Naur arpwatch-2.1a15.orig/db.c arpwatch-2.1a15/db.c
--- arpwatch-2.1a15.orig/db.c	2006-12-11 12:56:18.000000000 +0300
+++ arpwatch-2.1a15/db.c	2006-12-11 12:57:34.000000000 +0300
@@ -86,6 +86,8 @@
 static void check_hname(struct ainfo *);
 struct ainfo *newainfo(void);
 
+int nonewstations = 0;
+
 int
 ent_add(register u_int32_t a, register u_char *e, time_t t, register char *h,
 	char *interface)
@@ -118,7 +120,8 @@
 	if (ap->ecount == 0) {
 		ap->ecount = 1;
 		ap->elist[0] = elist_alloc(a, e, t, h, interface);
-		report("new station", a, e, NULL, &t, NULL, interface);
+		if (!nonewstations)
+			report("new station", a, e, NULL, &t, NULL, interface);
 		return (1);
 	}