diff --git a/share/man/man4/ng_etf.4 b/share/man/man4/ng_etf.4 index 39a7de65d1cc..ab1af0641869 100644 --- a/share/man/man4/ng_etf.4 +++ b/share/man/man4/ng_etf.4 @@ -24,77 +24,80 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" +.\" $FreeBSD$ .\" .Dd February 28, 2001 .Dt NG_ETF 4 -.Os FreeBSD +.Os .Sh NAME .Nm ng_etf .Nd Ethertype filtering netgraph node type .Sh SYNOPSIS -.Fd #include +.In netgraph/ng_etf.h .Sh DESCRIPTION The .Nm etf node type multiplexes and filters data between hooks on the basis -of the ethertype found in an ethernet header, presumed to be in the -first 14 bytes of the data. Incoming Ethernet frames are accepted on -the +of the ethertype found in an ethernet header, presumed to be in the +first 14 bytes of the data. +Incoming Ethernet frames are accepted on the .Em downstream hook and if the ethertype matches a value which the node has been configured to filter, the packet is forwarded out the hook which was identified -at the time that value was configured. If it does not match a configured -value, it is passed to the +at the time that value was configured. +If it does not match a configured +value, it is passed to the .Em nomatch -hook. If the +hook. +If the .Em nomatch hook is not connected, the packet is dropped. .Pp -Packets travelling in the other direction (towards the +Packets travelling in the other direction (towards the .Em downstream hook) are also examined and filtered. -If a packet has an ethertype that matches one of he values configured +If a packet has an ethertype that matches one of the values configured into the node, it must have arrived in on the hook for which that value -was configured otherwise it wil be discarded. Ethertypes of values other -than those configured by the control messages must have arrived via the +was configured, otherwise it will be discarded. +Ethertypes of values other +than those configured by the control messages must have arrived via the .Em nomatch hook. .Sh HOOKS This node type supports the following hooks: -.Pp -.Bl -tag -width foobar +.Bl -tag -width ".Em downstream" .It Em downstream Typically this hook would be connected to a .Xr ng_ether 4 -node, using the +node, using the .Em lower hook. .It Em nomatch Typically this hook would also be connected to an .Xr ng_ether 4 -type node using the +type node using the .Em upper hook. -.It Em +.It Aq Em "any legal name" Any other hook name will be accepted and can be used as the match target -of an ethertype. Typically this hook would be attached to +of an ethertype. +Typically this hook would be attached to a protocol handling node that requires and generates packets with a particular set of ethertypes. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: -.Bl -tag -width foo -.It Em NGM_ETF_GET_STATUS +.Bl -tag -width 4n +.It Dv NGM_ETF_GET_STATUS This command returns a -.Em "struct ng_etfstat" +.Vt "struct ng_etfstat" containing node statistics for packet counts. -.It Em NGM_ETF_SET_FILTER +.It Dv NGM_ETF_SET_FILTER Sets the a new ethertype filter into the node and specifies the hook to and -from which packets of that type should use. The hook and ethertype -are specified in a struct of type -.Em "struct ng_etffilter" : +from which packets of that type should use. +The hook and ethertype +are specified in a structure of type +.Vt "struct ng_etffilter" : .Bd -literal -offset 4n struct ng_etffilter { char matchhook[NG_HOOKLEN + 1]; /* hook name */ @@ -103,7 +106,9 @@ struct ng_etffilter { .Ed .El .Sh EXAMPLES -Using ngcontrol it is possible to set a filter in place from the command line +Using +.Xr ngctl 8 +it is possible to set a filter in place from the command line as follows: .Bd -literal -offset 4n #!/bin/sh @@ -113,7 +118,7 @@ MATCH2=0x835 cat </tmp/xwert # Make a new ethertype filter and attach to the ethernet lower hook. # first remove left over bits from last time. -shutdown ${ETHER_IF}:lower +shutdown ${ETHER_IF}:lower mkpeer ${ETHER_IF}: etf lower downstream # Give it a name to easily refer to it. name ${ETHER_IF}:lower etf @@ -130,16 +135,15 @@ nghook -a etf: newproto & ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH1} } ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH2} } DONE - .Ed .Sh SHUTDOWN This node shuts down upon receipt of a -.Em NGM_SHUTDOWN +.Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_ether 4 , -.Xr ngctl 8 +.Xr ngctl 8 , .Xr nghook 8 .Sh HISTORY The