- Add the ability to run in the background as daemon.

- Fix man page.

PR:		ports/62798
Submitted by:	Aaron D. Gifford <agifford@infowest.com>
This commit is contained in:
Kirill Ponomarev 2004-02-13 19:38:09 +00:00
parent d957897fa7
commit d2ff71757c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=100868
4 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,52 @@
--- choparp.8.orig Fri Feb 13 20:28:33 2004
+++ choparp.8 Fri Feb 13 20:30:23 2004
@@ -34,7 +34,7 @@
.Nm choparp
.Nd cheap and omitted proxy ARP
.Sh SYNOPSIS
-.Nm chpoarp
+.Nm choparp
.Ar if_name mac_addr
.Oo Fl Oc Ns Ar net_addr Ns
.Op / Ns Ar net_mask
@@ -42,7 +42,7 @@
.Sh DESCRIPTION
.Pp
.Nm choparp
-is a easy-to-use proxy ARP daemon.
+is an easy-to-use proxy ARP daemon.
It watches ARP request packets visible on the interface specified by argument
.Ar if_name ,
and sends proxy ARP reply to the sender if the ARP request queries the
@@ -52,7 +52,7 @@
.Ar net_addr Ns / Ar net_mask .
.Pp
.Ar mac_addr
-is th MAC address to be published for the specified hosts.
+is the MAC address to be published for the specified hosts.
It is normally the address of
.Ar if_name .
The format of
@@ -72,7 +72,7 @@
.Dq 0x
.Pq for example Ad 0x858a0186 .
.Ar net_mask
-can likewise be speficied as a dotted quad or hexadecimal value,
+can likewise be specified as a dotted quad or hexadecimal value,
or alternatively as a mask length. The following address specifications
are therefore equivalent:
.Bl -item -offset indent
@@ -89,6 +89,13 @@
.Em excluded
by preceding them with
.Fl
+.Pp
+.Nm choparp
+uses the Berkeley Packet Filter
+.Nm bpf(4)
+and so the kernel must be compiled with support for the
+.Nm bpf
+device.
.Sh EXAMPLES
If you have network interface
.Dq ne0

View File

@ -0,0 +1,12 @@
--- choparp.c.orig Fri Feb 13 20:27:14 2004
+++ choparp.c Fri Feb 13 20:27:51 2004
@@ -437,6 +437,9 @@
#endif
if ((fd = openbpf(ifname, &buf, &buflen)) < 0)
return(-1);
+ #ifndef DEBUG
+ daemon(0, 0);
+ #endif
loop(fd, buf, buflen);
return(-1);
}

View File

@ -0,0 +1,52 @@
--- choparp.8.orig Fri Feb 13 20:28:33 2004
+++ choparp.8 Fri Feb 13 20:30:23 2004
@@ -34,7 +34,7 @@
.Nm choparp
.Nd cheap and omitted proxy ARP
.Sh SYNOPSIS
-.Nm chpoarp
+.Nm choparp
.Ar if_name mac_addr
.Oo Fl Oc Ns Ar net_addr Ns
.Op / Ns Ar net_mask
@@ -42,7 +42,7 @@
.Sh DESCRIPTION
.Pp
.Nm choparp
-is a easy-to-use proxy ARP daemon.
+is an easy-to-use proxy ARP daemon.
It watches ARP request packets visible on the interface specified by argument
.Ar if_name ,
and sends proxy ARP reply to the sender if the ARP request queries the
@@ -52,7 +52,7 @@
.Ar net_addr Ns / Ar net_mask .
.Pp
.Ar mac_addr
-is th MAC address to be published for the specified hosts.
+is the MAC address to be published for the specified hosts.
It is normally the address of
.Ar if_name .
The format of
@@ -72,7 +72,7 @@
.Dq 0x
.Pq for example Ad 0x858a0186 .
.Ar net_mask
-can likewise be speficied as a dotted quad or hexadecimal value,
+can likewise be specified as a dotted quad or hexadecimal value,
or alternatively as a mask length. The following address specifications
are therefore equivalent:
.Bl -item -offset indent
@@ -89,6 +89,13 @@
.Em excluded
by preceding them with
.Fl
+.Pp
+.Nm choparp
+uses the Berkeley Packet Filter
+.Nm bpf(4)
+and so the kernel must be compiled with support for the
+.Nm bpf
+device.
.Sh EXAMPLES
If you have network interface
.Dq ne0

View File

@ -0,0 +1,12 @@
--- choparp.c.orig Fri Feb 13 20:27:14 2004
+++ choparp.c Fri Feb 13 20:27:51 2004
@@ -437,6 +437,9 @@
#endif
if ((fd = openbpf(ifname, &buf, &buflen)) < 0)
return(-1);
+ #ifndef DEBUG
+ daemon(0, 0);
+ #endif
loop(fd, buf, buflen);
return(-1);
}