mdoc(7) police: cleanup.

This commit is contained in:
Ruslan Ermilov 2001-11-21 17:29:00 +00:00
parent 8a29064ab7
commit 75595bf1eb

View File

@ -26,45 +26,46 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.\"
.Dd February 28, 2001 .Dd February 28, 2001
.Dt NG_ETF 4 .Dt NG_ETF 4
.Os FreeBSD .Os
.Sh NAME .Sh NAME
.Nm ng_etf .Nm ng_etf
.Nd Ethertype filtering netgraph node type .Nd Ethertype filtering netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_etf.h> .In netgraph/ng_etf.h
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm etf .Nm etf
node type multiplexes and filters data between hooks on the basis node type multiplexes and filters data between hooks on the basis
of the ethertype found in an ethernet header, presumed to be in 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 first 14 bytes of the data.
the Incoming Ethernet frames are accepted on the
.Em downstream .Em downstream
hook and if the ethertype matches a value which the node has been configured 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 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 at the time that value was configured.
If it does not match a configured
value, it is passed to the value, it is passed to the
.Em nomatch .Em nomatch
hook. If the hook.
If the
.Em nomatch .Em nomatch
hook is not connected, the packet is dropped. hook is not connected, the packet is dropped.
.Pp .Pp
Packets travelling in the other direction (towards the Packets travelling in the other direction (towards the
.Em downstream .Em downstream
hook) are also examined and filtered. 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 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 was configured, otherwise it will be discarded.
Ethertypes of values other
than those configured by the control messages must have arrived via the than those configured by the control messages must have arrived via the
.Em nomatch .Em nomatch
hook. hook.
.Sh HOOKS .Sh HOOKS
This node type supports the following hooks: This node type supports the following hooks:
.Pp .Bl -tag -width ".Em downstream"
.Bl -tag -width foobar
.It Em downstream .It Em downstream
Typically this hook would be connected to a Typically this hook would be connected to a
.Xr ng_ether 4 .Xr ng_ether 4
@ -77,24 +78,26 @@ Typically this hook would also be connected to an
type node using the type node using the
.Em upper .Em upper
hook. hook.
.It Em <any legal name> .It Aq Em "any legal name"
Any other hook name will be accepted and can be used as the match target 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 a protocol handling node that requires and generates packets
with a particular set of ethertypes. with a particular set of ethertypes.
.El .El
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports the generic control messages, plus the following: This node type supports the generic control messages, plus the following:
.Bl -tag -width foo .Bl -tag -width 4n
.It Em NGM_ETF_GET_STATUS .It Dv NGM_ETF_GET_STATUS
This command returns a This command returns a
.Em "struct ng_etfstat" .Vt "struct ng_etfstat"
containing node statistics for packet counts. 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 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 from which packets of that type should use.
are specified in a struct of type The hook and ethertype
.Em "struct ng_etffilter" : are specified in a structure of type
.Vt "struct ng_etffilter" :
.Bd -literal -offset 4n .Bd -literal -offset 4n
struct ng_etffilter { struct ng_etffilter {
char matchhook[NG_HOOKLEN + 1]; /* hook name */ char matchhook[NG_HOOKLEN + 1]; /* hook name */
@ -103,7 +106,9 @@ struct ng_etffilter {
.Ed .Ed
.El .El
.Sh EXAMPLES .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: as follows:
.Bd -literal -offset 4n .Bd -literal -offset 4n
#!/bin/sh #!/bin/sh
@ -130,16 +135,15 @@ nghook -a etf: newproto &
ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH1} } ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH1} }
ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH2} } ngctl 'msg etf: setfilter { matchhook="newproto" ethertype=${MATCH2} }
DONE DONE
.Ed .Ed
.Sh SHUTDOWN .Sh SHUTDOWN
This node shuts down upon receipt of a This node shuts down upon receipt of a
.Em NGM_SHUTDOWN .Dv NGM_SHUTDOWN
control message, or when all hooks have been disconnected. control message, or when all hooks have been disconnected.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_ether 4 , .Xr ng_ether 4 ,
.Xr ngctl 8 .Xr ngctl 8 ,
.Xr nghook 8 .Xr nghook 8
.Sh HISTORY .Sh HISTORY
The The