Description: prepare for the simple addition of options through patches
Author: KELEMEN Péter <fuji@debian.org>
Author: Axel Beckert <abe@debian.org>
Last-Update: 2015-06-13

Index: arpwatch/arpsnmp.8
===================================================================
--- arpwatch.orig/arpsnmp.8	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/arpsnmp.8	2015-06-13 21:17:57.266340222 +0200
@@ -27,10 +27,19 @@
 .B arpsnmp
 [
 .B \-d
-] [
+]
+.\" **
+.\" **
+.br
+.ti +8
+[
 .B \-f
 .I datafile
 ]
+.\" **
+.\" **
+.br
+.ti +8
 .I file
 [
 .I ...
@@ -42,18 +51,24 @@
 .B Arpsnmp
 reads information from a file (usually generated by
 .BR snmpwalk (8)).
+.\" **
+.\" **
 .LP
 The
 .B \-d
 flag is used enable debugging. This also inhibits mailing the reports.
 Instead, they are sent to
 .IR stderr .
+.\" **
+.\" **
 .LP
 The
 .B \-f
 flag is used to set the ethernet/ip address database filename.
 The default is
 .IR arp.dat .
+.\" **
+.\" **
 .LP
 Note that an empty
 .I arp.dat
Index: arpwatch/arpsnmp.c
===================================================================
--- arpwatch.orig/arpsnmp.c	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/arpsnmp.c	2015-06-13 21:17:57.266340222 +0200
@@ -78,6 +78,10 @@
 	register char *cp;
 	register int op, i;
 	char errbuf[256];
+	char options[] =
+		"d"
+		"f:"
+	;
 
 	if ((cp = strrchr(argv[0], '/')) != NULL)
 		prog = cp + 1;
@@ -90,7 +94,7 @@
 	}
 
 	opterr = 0;
-	while ((op = getopt(argc, argv, "df:")) != EOF)
+	while ((op = getopt(argc, argv, options)) != EOF)
 		switch (op) {
 
 		case 'd':
@@ -182,9 +186,14 @@
 usage(void)
 {
 	extern char version[];
+	char usage[] =
+		"[-d] "
+		"[-f datafile] "
+		"file [...]\n"
+	;
 
 	(void)fprintf(stderr, "Version %s\n", version);
 	(void)fprintf(stderr,
-	    "usage: %s [-d] [-f datafile] file [...]\n", prog);
+	    "usage: %s %s", prog, usage);
 	exit(1);
 }
Index: arpwatch/arpwatch.8
===================================================================
--- arpwatch.orig/arpwatch.8	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/arpwatch.8	2015-06-13 21:17:57.266340222 +0200
@@ -26,12 +26,24 @@
 .SH SYNOPSIS
 .na
 .B arpwatch
+.\" **
+.\" **
 [
 .B \-dN
-] [
+]
+.\" **
+.\" **
+.br
+.ti +8
+[
 .B \-f
 .I datafile
-] [
+]
+.\" **
+.\" **
+.br
+.ti +8
+[
 .B \-i
 .I interface
 ]
@@ -40,10 +52,17 @@
 [
 .B -n
 .IR net [/ width
-]] [
+]]
+.\" **
+.\" **
+.br
+.ti +8
+[
 .B \-r
 .I file
 ]
+.\" **
+.\" **
 .ad
 .SH DESCRIPTION
 .B Arpwatch
@@ -53,22 +72,30 @@
 uses
 .BR pcap (3)
 to listen for arp packets on a local ethernet interface.
+.\" **
+.\" **
 .LP
 The
 .B \-d
 flag is used enable debugging. This also inhibits forking into the
 background and emailing the reports. Instead, they are sent to
 .IR stderr .
+.\" **
+.\" **
 .LP
 The
 .B \-f
 flag is used to set the ethernet/ip address database filename.
 The default is
 .IR arp.dat .
+.\" **
+.\" **
 .LP
 The
 .B \-i
 flag is used to override the default interface.
+.\" **
+.\" **
 .LP
 The
 .B \-n
@@ -77,10 +104,14 @@
 on the same wire. If the optional
 .I width
 is not specified, the default netmask for the network's class is used.
+.\" **
+.\" **
 .LP
 The
 .B \-N
 flag disables reporting any bogons.
+.\" **
+.\" **
 .LP
 The
 .B \-r
@@ -93,11 +124,15 @@
 of reading from the network. In this case,
 .B arpwatch
 does not fork.
+.\" **
+.\" **
 .LP
 Note that an empty
 .I arp.dat
 file must be created before the first time you run
 .BR arpwatch .
+.\" **
+.\" **
 .LP
 .SH "REPORT MESSAGES"
 Here's a quick list of the report messages generated by
Index: arpwatch/arpwatch.c
===================================================================
--- arpwatch.orig/arpwatch.c	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/arpwatch.c	2015-06-13 21:17:57.266340222 +0200
@@ -153,6 +153,26 @@
 	register char *interface, *rfilename;
 	struct bpf_program code;
 	char errbuf[PCAP_ERRBUF_SIZE];
+	char options[] =
+		"d"
+		/**/
+		/**/
+		"f:"
+		/**/
+		/**/
+		"i:"
+		/**/
+		/**/
+		"n:"
+		/**/
+		/**/
+		"N"
+		/**/
+		/**/
+		"r:"
+		/**/
+		/**/
+	;
 
 	if (argv[0] == NULL)
 		prog = "arpwatch";
@@ -170,7 +190,7 @@
 	interface = NULL;
 	rfilename = NULL;
 	pd = NULL;
-	while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
+	while ((op = getopt(argc, argv, options)) != EOF)
 		switch (op) {
 
 		case 'd':
@@ -201,7 +221,8 @@
 		case 'r':
 			rfilename = optarg;
 			break;
-
+		/**/
+		/**/
 		default:
 			usage();
 		}
@@ -748,9 +769,26 @@
 usage(void)
 {
 	extern char version[];
+	char usage[] =
+		"[-dN] "
+		/**/
+		/**/
+		"[-f datafile] "
+		/**/
+		/**/
+		"[-i interface] "
+		/**/
+		/**/
+		"[-n net[/width]] "
+		/**/
+		/**/
+		"[-r file] "
+		/**/
+		/**/
+		"\n"
+	;
 
 	(void)fprintf(stderr, "Version %s\n", version);
-	(void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"
-	    " [-n net[/width]] [-r file]\n", prog);
+	(void)fprintf(stderr, "usage: %s %s", prog, usage);
 	exit(1);
 }
Index: arpwatch/util.c
===================================================================
--- arpwatch.orig/util.c	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/util.c	2015-06-13 21:17:57.266340222 +0200
@@ -61,6 +61,8 @@
 
 int debug = 0;
 int initializing = 1;			/* true if initializing */
+/**/
+/**/
 
 /* syslog() helper routine */
 void
Index: arpwatch/util.h
===================================================================
--- arpwatch.orig/util.h	2015-06-13 21:17:57.266340222 +0200
+++ arpwatch/util.h	2015-06-13 21:17:57.266340222 +0200
@@ -17,3 +17,5 @@
 
 extern int debug;
 extern int initializing;
+/**/
+/**/
