]> git.pld-linux.org Git - packages/arpwatch.git/blob - arpwatch-debian_17opt_ignorenet.patch
- fixed Group
[packages/arpwatch.git] / arpwatch-debian_17opt_ignorenet.patch
1 Index: arpwatch/arpwatch.8
2 diff -u arpwatch/arpwatch.8:1.1.1.1.2.2 arpwatch/arpwatch.8:1.1.1.1.24.2
3 --- arpwatch/arpwatch.8:1.1.1.1.2.2     Thu Aug 12 22:31:09 2004
4 +++ arpwatch/arpwatch.8 Thu Aug 12 23:44:44 2004
5 @@ -63,6 +63,14 @@
6  ]
7  .\" **
8  .\" **
9 +.br
10 +.ti +8
11 +[
12 +.B -z
13 +.I ignorenet/ignoremask
14 +]
15 +.\" **
16 +.\" **
17  .ad
18  .SH DESCRIPTION
19  .B Arpwatch
20 @@ -127,6 +135,13 @@
21  .\" **
22  .\" **
23  .LP
24 +(Debian) The
25 +.B -z
26 +flag is used to set a range of ip addresses to ignore (such as a DHCP
27 +range). Netmask is specified as 255.255.128.0.
28 +.\" **
29 +.\" **
30 +.LP
31  Note that an empty
32  .I arp.dat
33  file must be created before the first time you run
34 Index: arpwatch/arpwatch.c
35 diff -u arpwatch/arpwatch.c:1.1.1.1.2.5 arpwatch/arpwatch.c:1.1.1.1.2.1.14.6
36 --- arpwatch/arpwatch.c:1.1.1.1.2.5     Sat Aug 14 02:33:07 2004
37 +++ arpwatch/arpwatch.c Fri Aug 13 02:40:20 2004
38 @@ -123,6 +123,9 @@
39  static int nets_ind;
40  static int nets_size;
41  
42 +static struct in_addr ignore_net;
43 +static struct in_addr ignore_netmask;
44 +
45  extern int optind;
46  extern int opterr;
47  extern char *optarg;
48 @@ -172,7 +175,11 @@
49                 "r:"
50                 /**/
51                 /**/
52 +               "z:"
53 +               /**/
54 +               /**/
55         ;
56 +       char *tmpptr;
57  
58         if (argv[0] == NULL)
59                 prog = "arpwatch";
60 @@ -190,6 +197,9 @@
61         interface = NULL;
62         rfilename = NULL;
63         pd = NULL;
64 +
65 +       inet_aton("0.0.0.0", &ignore_netmask);
66 +       inet_aton("255.255.255.255", &ignore_netmask);
67         while ((op = getopt(argc, argv, options)) != EOF)
68                 switch (op) {
69  
70 @@ -223,6 +233,14 @@
71                         break;
72                 /**/
73                 /**/
74 +               case 'z':
75 +                       tmpptr = strtok(optarg, "/");
76 +                       inet_aton(tmpptr, &ignore_net);
77 +                       tmpptr = strtok(NULL, "/");
78 +                       inet_aton(tmpptr, &ignore_netmask);
79 +                       break;
80 +               /**/
81 +               /**/
82                 default:
83                         usage();
84                 }
85 @@ -418,7 +436,15 @@
86                 return;
87         }
88  
89 +       /* Ignores the specified netmask/metwork */
90 +       if ((sia & ignore_netmask.s_addr) == ignore_net.s_addr) {
91 +               if (debug) {
92 +                       dosyslog(LOG_INFO, "ignored", sia, sea, sha, interface);
93 +               }
94 +               return;
95 +       }
96         /* Got a live one */
97 +
98         t = h->ts.tv_sec;
99         can_checkpoint = 0;
100         if (!ent_add(sia, sea, t, NULL))
101 @@ -785,6 +811,9 @@
102                 "[-r file] "
103                 /**/
104                 /**/
105 +               "[-z ignorenet/ignoremask] "
106 +               /**/
107 +               /**/
108                 "\n"
109         ;
110  
This page took 0.123006 seconds and 3 git commands to generate.