From owner-man-jp-reviewer@jp.freebsd.org  Wed Dec 15 14:47:05 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id OAA91942;
	Wed, 15 Dec 1999 14:47:05 +0900 (JST)
	(envelope-from owner-man-jp-reviewer@jp.FreeBSD.org)
Received: from vinita.tri.asanuma.co.jp (vinita.tri.asanuma.co.jp [210.160.188.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id OAA91931
	for <man-jp-reviewer@jp.freebsd.org>; Wed, 15 Dec 1999 14:47:02 +0900 (JST)
	(envelope-from mori@tri.asanuma.co.jp)
Received: from parvati.tri.asanuma.co.jp by vinita.tri.asanuma.co.jp (8.9.3/3.7W) with ESMTP id OAA44662 for <man-jp-reviewer@jp.freebsd.org>; Wed, 15 Dec 1999 14:47:00 +0900 (JST)
Received: from kurishna.tri.asanuma.co.jp by parvati.tri.asanuma.co.jp (8.8.8/3.7W) with ESMTP id OAA04799 for <man-jp-reviewer@jp.freebsd.org>; Wed, 15 Dec 1999 14:47:33 +0900 (JST)
To: man-jp-reviewer@jp.freebsd.org
MIME-Version: 1.0 (generated by SEMI 1.13.7 - "Awazu")
Content-Type: text/plain; charset=ISO-2022-JP
From: Mori Kouji <mori@tri.asanuma.co.jp>
Date: 15 Dec 1999 14:46:58 +0900
Message-ID: <80g0x4rc19.fsf@kurishna.tri.asanuma.co.jp>
Lines: 249
User-Agent: Nana-gnus/6.13.11 SEMI/1.13.7 (Awazu) CLIME/1.13.5
 (=?ISO-2022-JP?B?GyRCMkMybEohMiwbKEI=?=) Emacs/20.5
 (i386-unknown-freebsdelf3.3) MULE/4.0 (=?ISO-2022-JP?B?GyRCMlYxYxsoQg==?=)
Reply-To: man-jp-reviewer@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: man-jp-reviewer 1802
Subject: [man-jp-reviewer 1802] ng_bpf.8
Errors-To: owner-man-jp-reviewer@jp.freebsd.org
Sender: owner-man-jp-reviewer@jp.freebsd.org
X-Originator: mori@kurishna.tri.asanuma.co.jp

$B?9$G$9!#(B

ng_bpf.8 $B$N=iLu$rAw$j$^$9!#(B
$B$A$s$W$s$+$s$W$s$@$C$?$N$G!"JQ$J$H$3$m$O$8$c$s$8$c$sD>$7$F2<$5$$!#(B

$B=Q8l$O0J2<$N$h$&$K$7$F$$$^$9!#(B

 Berkeley packet filter     $B%P!<%/%l%$%Q%1%C%H%U%#%k%?(B (bpf.4)
 control message            $B@)8f%a%C%;!<%8(B (ng_*.8)
 generic controll messages  $BHFMQ@)8f%a%C%;!<%8(B (ng_*.8)

 destination hook           $B%G%9%F%#%M!<%7%g%s%U%C%/(B
 loadable kernel module     $B%m!<%@%V%k%+!<%M%k%b%8%e!<%k(B


$B$3$NItJ,$O$[$H$s$IA[A|$GLu$7$F$^$9!#(B(^^;)

 With each hook is associated a
 .Xf bpf 8
 filter program which is applied to incoming data only, a destination hook
 for matching packets, a destination hook for non-matching packets,
 and various statistics counters.

 $B%^%C%A$7$?%Q%1%C%H$KBP$9$k%G%9%F%#%M!<%7%g%s%U%C%/!"(B
 $B%^%C%A$7$J$+$C$?%Q%1%C%H$KBP$9$k%G%9%F%#%M!<%7%g%s%U%C%/!"(B
 $B$5$^$6$^$JE}7W%+%&%s%?$KBP$9$k$=$l$>$l$N(B
 $B%U%C%/$O!"E~Ce$9$k%G!<%?$N$_$KE,MQ$5$l$k(B
 .Xr bpf 8
 $B%U%#%k%?%W%m%0%i%`$K4XO"$E$1$i$l$^$9!#(B


atomically clear $B$C$F$I$&$9$k$3$H$r;X$7$F$k$s$G$7$g$&(B?

 This command is identical to
 .Dv NGM_BPF_GET_STATS ,
 except that the statistics are also atomically cleared.

 $B$3$N%3%^%s%I$O!"(B
 $BE}7WCM$r6K>.$K%/%j%"$9$k$3$H$r=|$$$F!"(B
 .Dv NGM_BPF_GET_STATS
 $B$HF1$8$G$9!#(B

Index: ng_bpf.8
===================================================================
RCS file: /home/mori/cvs/man-jp/man8/ng_bpf.8,v
retrieving revision 1.1
retrieving revision 1.4
diff -u -r1.1 -r1.4
--- ng_bpf.8	1999/12/15 02:28:40	1.1
+++ ng_bpf.8	1999/12/15 05:42:35	1.4
@@ -39,51 +39,59 @@
 .\" jpman %Id: ng_bpf.8,v 0.0 1999/12/07 15:56:21 horikawa Stab %
 .Dt NG_BPF 8
 .Os FreeBSD 4.0
-.Sh NAME
+.Sh $BL>>N(B
 .Nm ng_bpf
-.Nd Berkeley packet filter netgraph node type
-.Sh SYNOPSIS
+.Nd $B%P!<%/%l%$%Q%1%C%H%U%#%k%?(B netgraph $B%N!<%I%?%$%W(B
+.Sh $B=q<0(B
 .Fd #include <net/bpf.h>
 .Fd #include <netgraph/ng_bpf.h>
-.Sh DESCRIPTION
-The
+.Sh $B2r@b(B
 .Nm bpf
-node type allows Berkeley Packet Filter (see
-.Xr bpf 8 )
-filters to be applied to data travelling through a Netgraph network.
-Each node allows an arbitrary number of connections to arbitrarily
-named hooks.  With each hook is associated a
-.Xf bpf 8
-filter program which is applied to incoming data only, a destination hook
-for matching packets, a destination hook for non-matching packets,
-and various statistics counters.
+$B%N!<%I%?%$%W$O%P!<%/%l%$%Q%1%C%H%U%#%k%?(B (
+.Xr bpf 8 $B;2>H(B )
+$B$r(B Netgraph $B%M%C%H%o!<%/$rEA$o$k%G!<%?$K(B
+$BE,MQ$9$k$3$H$r2DG=$K$7$^$9!#(B
+$B3F%N!<%I$OG$0U$KL>A0$E$1$i$l$?%U%C%/$KBP$9$kG$0U$N?t$N@\B3$r5v$7$^$9!#(B
+$B%^%C%A$7$?%Q%1%C%H$KBP$9$k%G%9%F%#%M!<%7%g%s%U%C%/!"(B
+$B%^%C%A$7$J$+$C$?%Q%1%C%H$KBP$9$k%G%9%F%#%M!<%7%g%s%U%C%/!"(B
+$B$5$^$6$^$JE}7W%+%&%s%?$KBP$9$k$=$l$>$l$N(B
+$B%U%C%/$O!"E~Ce$9$k%G!<%?$N$_$KE,MQ$5$l$k(B
+.Xr bpf 8
+$B%U%#%k%?%W%m%0%i%`$K4XO"$E$1$i$l$^$9!#(B
 .Pp
-A
 .Xr bpf 8
-program returns an unsigned integer, which is normally interpreted as
-the length of the prefix of the packet to return.  In the context of this
-node type, returning zero is considered a non-match, in which case the
-entire packet is delivered out the non-match destination hook.
-Returning a value greater than zero causes the packet to be truncated
-to that length and delivered out the match destination hook.
-Either or both destination hooks may be the empty string, or may
-not exist, in which case the packet is dropped.
+$B%W%m%0%i%`$OId9f$J$7@0?t$rJV$7$^$9!#(B
+$B$=$l$ODL>o$O!"JV$9$Y$-%Q%1%C%H$N%W%l%U%#%C%/%9$ND9$5$H$7$F2r<a$5$l$^$9!#(B
+$B$3$N%N!<%I%?%$%W$N%3%s%F%-%9%H$G$O(B
+0 $B$,JV$k$3$H$O%^%C%A$7$J$+$C$?$3$H$r0UL#$7$^$9!#(B
+$B$=$N>l9g$O!"(B
+$B%Q%1%C%HA4BN$,!"%^%C%A$7$J$$>l9g$N%G%9%F%#%M!<%7%g%s%U%C%/$K(B
+$BAw$i$l$^$9!#(B
+0 $B$h$jBg$-$JCM$,JV$C$?$H$-$O!"%Q%1%C%H$O$=$ND9$5$K@Z$j5M$a$i$l!"(B
+$B%^%C%A$7$?>l9g$N%G%9%F%#%M!<%7%g%s%U%C%/$KAw$i$l$k$3$H$K$J$j$^$9!#(B
+$B%G%9%F%#%M!<%7%g%s%U%C%/$N$I$A$i$+!"$b$7$/$ON>J}$,(B
+$B6u$NJ8;zNs$G$"$C$?$j!"B8:_$7$J$+$C$?$j$9$k$3$H$,$"$j$^$9!#(B
+$B$=$N>l9g$O%Q%1%C%H$O<N$F$i$l$^$9!#(B
 .Pp
-New hooks are initially configured to drop all packets.
-A new filter may be installed using the
+$B?7$7$$%U%C%/$O!":G=i$K!"A4$F$N%Q%1%C%H$r<N$F$k$h$&$K@_Dj$5$l$^$9!#(B
+$B?7$7$$%U%#%k%?$O!"$*$=$i$/(B
 .Dv NGM_BPF_SET_FILTER
-control message.
-.Sh HOOKS
-This node type supports any number of hooks having arbitrary names.
-.Sh CONTROL MESSAGES
-This node type supports the generic control messages, plus the following:
+$B@)8f%a%C%;!<%8$r;H$C$F%$%s%9%H!<%k$5$l$^$9!#(B
+.Sh $B%U%C%/(B
+$B$3$N%N!<%I%?%$%W$OG$0U$NL>A0$r;}$C$?!"$$$+$J$k?t$N%U%C%/$r$b(B
+$B%5%]!<%H$7$^$9!#(B
+.Sh $B@)8f%a%C%;!<%8(B
+$B$3$N%N!<%I%?%$%W$OHFMQ@)8f%a%C%;!<%8$r%5%]!<%H$7!"(B
+$B$5$i$K0J2<$N$b$N$r%5%]!<%H$7$^$9!#(B
 .Bl -tag -width foo
 .It Dv NGM_BPF_SET_FILTER
-This command sets the filter program that will be applied to incoming
-data on a hook.  The following structure must be supplied as an argument:
+$B$3$N%3%^%s%I$O!"(B
+$BE~Ce$7$?%G!<%?$KE,MQ$9$k%U%#%k%?%W%m%0%i%`$r!"(B
+$B%U%C%/$K%;%C%H$7$^$9!#(B
+$B0J2<$N9=B$BN$,0z?t$H$7$FM?$($i$l$J$1$l$P$J$j$^$;$s!#(B
 .Bd -literal -offset 4n
 struct ngm_bpf_hookprog {
-  char            thisHook[NG_HOOKLEN+1];   /* name of hook */
+  char            thisHook[NG_HOOKLEN+1];   /* $B%U%C%/$NL>>N(B */
   char            ifMatch[NG_HOOKLEN+1];    /* match dest hook */
   char            ifNotMatch[NG_HOOKLEN+1]; /* !match dest hook */
   int32_t         bpf_prog_len;             /* #isns in program */
@@ -91,54 +99,66 @@
 };
 .Ed
 .Pp
-The hook to be updated is specified in
-.Dv thisHook .
-The BPF program is the sequence of instructions in the
+$B99?7$5$l$k%U%C%/$O(B
+.Dv thisHook
+$B$G;XDj$5$l$^$9!#(B
+BPF $B%W%m%0%i%`$O(B
+$BG[Ns(B
 .Dv bpf_prog
-array; there must be
+$BCf$NL?Na$NJB$S$G$9!#(B
+$B$=$l$O(B
 .Dv bpf_prog_len
-of them.
-Matching and non-matching incoming packets are delivered out the hooks named
+$B$ND9$5$G$J$1$l$P$J$j$^$;$s!#(B
+$B%^%C%A$7$?E~Ce%Q%1%C%H$H%^%C%A$7$J$+$C$?E~Ce%Q%1%C%H$O!"(B
+$B$=$l$>$l!"(B
 .Dv ifMatch
-and
-.Dv ifNotMatch ,
-respectively.  The program must be a valid
+$B$H(B
+.Dv ifNotMatch
+$B$NL>A0$N%U%C%/$KAw$i$l$^$9!#(B
+$B$3$N%W%m%0%i%`$O!"M-8z$J(B
 .Xr bpf 8
-program or else
+$B%W%m%0%i%`$G$"$k$+!"$5$b$J$/$P(B
 .Er EINVAL
-is returned.
+$B$rJV$5$J$1$l$P$J$j$^$;$s!#(B
 .It Dv NGM_BPF_GET_FILTER
-This command takes an ASCII string argument, the hook name, and returns the
-corresponding
+$B$3$N%3%^%s%I$O%U%C%/$NL>>N$N(B ASCII $BJ8;zNs$r0z?t$K$H$j$^$9!#(B
+$B>e$K<($7$?!"BP1~$9$k(B
 .Dv "struct ngm_bpf_hookprog"
-as shown above.
+$B$rJV$7$^$9!#(B
 .It Dv NGM_BPF_GET_STATS
-This command takes an ASCII string argument, the hook name, and returns the
-statistics associated with the hook as a
-.Dv "struct ng_bpf_hookstat" .
+$B$3$N%3%^%s%I$O%U%C%/$NL>>N$N(B ASCII $BJ8;zNs$r0z?t$K$H$j!"(B
+$B%U%C%/$K4XO"$7$?E}7WCM$r(B
+.Dv "struct ng_bpf_hookstat"
+$B$H$7$FJV$7$^$9!#(B
 .It Dv NGM_BPF_CLR_STATS
-This command takes an ASCII string argument, the hook name, and clears the
-statistics associated with the hook.
+$B$3$N%3%^%s%I$O%U%C%/$NL>>N$N(B ASCII $BJ8;zNs$r0z?t$K$H$j!"(B
+$B%U%C%/$K4XO"$7$?E}7WCM$r%/%j%"$7$^$9!#(B
 .It Dv NGM_BPF_GETCLR_STATS
-This command is identical to
-.Dv NGM_BPF_GET_STATS ,
-except that the statistics are also atomically cleared.
+$B$3$N%3%^%s%I$O!"(B
+$BE}7WCM$r6K>.$K%/%j%"$9$k$3$H$r=|$$$F!"(B
+.Dv NGM_BPF_GET_STATS
+$B$HF1$8$G$9!#(B
 .El
-.Sh SHUTDOWN
-This node shuts down upon receipt of a
+.Sh $B%7%c%C%H%@%&%s(B
+$B$3$N%N!<%I$O(B
 .Dv NGM_SHUTDOWN
-control message, or when all hooks have been disconnected.
-.Sh BUGS
-When built as a loadable kernel module, this module includes the file
-.Dv "net/bpf_filter.c" .
-Although loading the module should fail if
+$B@)8f%a%C%;!<%8$r<u$1<h$k$+!"(B
+$BA4$F$N%U%C%/$N@\B3$,@Z$l$?$H$-!"(B
+$B%7%c%C%H%@%&%s$7$^$9!#(B
+.Sh $B%P%0(B
+$B%m!<%@%V%k%+!<%M%k%b%8%e!<%k$H$7$F:n@.$9$k$H$-!"(B
+$B$3$N%b%8%e!<%k$O%U%!%$%k(B
+.Dv "net/bpf_filter.c"
+$B$r%$%s%/%k!<%I$7$^$9!#(B
+$B$7$+$7!"%b%8%e!<%k$r%m!<%I$9$k$H$-!"(B
 .Dv "net/bpf_filter.c"
-already exists in the kernel, currently it does not, and the duplicate
-copies of the file do not interfere.
-However, this may change in the future.
-.Sh SEE ALSO
+$B$,4{$K%+!<%M%kFb$KB8:_$9$k$H!"<:GT$7$^$9!#(B
+$B$3$l$O8=:_$OB8:_$7$^$;$s!#(B
+$B$^$?!"%U%!%$%k$NJ#@=$5$l$?%3%T!<$O43>D$7$^$;$s!#(B
+$B$7$+$7!"$3$l$O>-MhJQ99$5$l$k$+$b$7$l$^$;$s!#(B
+.Sh $B;2>H(B
 .Xr netgraph 4 ,
 .Xr bpf 4 ,
 .Xr ngctl 8 .
-.Sh AUTHOR
+.Sh $B:n<T(B
 Archie Cobbs <archie@whistle.com>

-- 
$B?9(B $B9@Fs(B	(MORI Kouji)
($B3t(B)$B^I>BAH(B $B5;=Q8&5f=j(B
E-mail: mori@tri.asanuma.co.jp
