Manual page style work.

Submitted by:	Alexey Zelkin <phantom@FreeBSD.org>
thanks!
This commit is contained in:
Julian Elischer 1999-12-21 01:25:21 +00:00
parent bedf424beb
commit 5129159789
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54927
59 changed files with 1059 additions and 490 deletions

View File

@ -47,7 +47,7 @@
.Nm NgRecvData , .Nm NgRecvData ,
.Nm NgSetDebug , .Nm NgSetDebug ,
.Nm NgSetErrLog .Nm NgSetErrLog
.Nd Netgraph user library .Nd netgraph user library
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph.h> .Fd #include <netgraph.h>
.Ft int .Ft int
@ -78,7 +78,7 @@ These functions facilitate user-mode program participation in the kernel
graph-based networking system, by utilizing the netgraph graph-based networking system, by utilizing the netgraph
.Em socket .Em socket
node type (see node type (see
.Xr ng_socket 8 ")." .Xr ng_socket 8 ) .
.Pp .Pp
.Fn NgMkSockNode .Fn NgMkSockNode
should be called first, to create a new should be called first, to create a new
@ -130,16 +130,22 @@ The original message header should be pointed to by
.Fn NgSendAsciiMsg .Fn NgSendAsciiMsg
performs the same function as performs the same function as
.Fn NgSendMsg , .Fn NgSendMsg ,
but adds support for ASCII encoding of control messages. but adds support for
.Tn ASCII
encoding of control messages.
.Fn NgSendAsciiMsg .Fn NgSendAsciiMsg
formats its input a la formats its input a la
.Xr printf 3 .Xr printf 3
and then sends the resulting ASCII string to the node in a and then sends the resulting
.Tn ASCII
string to the node in a
.Dv NGM_ASCII2BINARY .Dv NGM_ASCII2BINARY
control message. The node returns a binary version of the control message. The node returns a binary version of the
message, which is then sent back to the node just as with message, which is then sent back to the node just as with
.Fn NgSendMsg . .Fn NgSendMsg .
Note that ASCII conversion may not be supported by all node types. Note that
.Tn ASCII
conversion may not be supported by all node types.
.Pp .Pp
.Fn NgRecvMsg .Fn NgRecvMsg
reads the next control message received by the node associated with reads the next control message received by the node associated with
@ -159,12 +165,16 @@ the node from which the message was received.
works exactly like works exactly like
.Fn NgRecvMsg , .Fn NgRecvMsg ,
except that after the message is received, any binary arguments except that after the message is received, any binary arguments
are converted to ASCII by sending a are converted to
.Tn ASCII
by sending a
.Dv NGM_BINARY2ASCII .Dv NGM_BINARY2ASCII
request back to the originating node. The result is the same as request back to the originating node. The result is the same as
.Fn NgRecvAsciiMsg , .Fn NgRecvAsciiMsg ,
with the exception that the reply arguments field will contain with the exception that the reply arguments field will contain
a NUL-terminated ASCII version of the arguments (and the reply a NUL-terminated
.Tn ASCII
version of the arguments (and the reply
header argument length field will be adjusted). header argument length field will be adjusted).
.Pp .Pp
.Fn NgSendData .Fn NgSendData
@ -203,7 +213,9 @@ and
.Xr vwarnx 3 . .Xr vwarnx 3 .
.Pp .Pp
At debug level 3, the library attempts to display control message arguments At debug level 3, the library attempts to display control message arguments
in ASCII format; however, this results in additional messages being in
.Tn ASCII
format; however, this results in additional messages being
sent which may interfere with debugging. At even higher levels, sent which may interfere with debugging. At even higher levels,
even these additional messagages will be displayed, etc. even these additional messagages will be displayed, etc.
.Pp .Pp
@ -219,7 +231,9 @@ User mode programs must be linked with the
flag to link in this library. flag to link in this library.
.Sh INITIALIZATION .Sh INITIALIZATION
To enable Netgraph in your kernel, either your kernel must be To enable Netgraph in your kernel, either your kernel must be
compiled with ``options NETGRAPH'' in the kernel configuration compiled with
.Dq options NETGRAPH
in the kernel configuration
file, or else the file, or else the
.Xr netgraph 4 .Xr netgraph 4
and and
@ -244,11 +258,16 @@ The node type does not know how to encode or decode the control message.
.It Bq Er ERANGE .It Bq Er ERANGE
The encoded or decoded arguments were too long for the supplied buffer. The encoded or decoded arguments were too long for the supplied buffer.
.It Bq Er ENOENT .It Bq Er ENOENT
An unknown structure field was seen in an ASCII control message. An unknown structure field was seen in an
.Tn ASCII
control message.
.It Bq Er EALREADY .It Bq Er EALREADY
The same structure field was specified twice in an ASCII control message. The same structure field was specified twice in an
.Tn ASCII
control message.
.It Bq Er EINVAL .It Bq Er EINVAL
ASCII control message parse error or illegal value. .Tn ASCII
control message parse error or illegal value.
.It Bq Er E2BIG .It Bq Er E2BIG
ASCII control message array or fixed width string buffer overflow. ASCII control message array or fixed width string buffer overflow.
.El .El
@ -260,8 +279,10 @@ ASCII control message array or fixed width string buffer overflow.
.Xr ng_socket 8 . .Xr ng_socket 8 .
.Sh HISTORY .Sh HISTORY
The The
.Em netgraph .Nm netgraph
system was designed and first implemented at Whistle Communications, Inc. in system was designed and first implemented at Whistle Communications, Inc. in
a version FreeBSD 2.2 customized for the Whistle InterJet. a version of
.Sh AUTHOR .Fx 2.2
.An Archie Cobbs <archie@whistle.com> customized for the Whistle InterJet.
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -80,25 +80,37 @@ to interact with other nodes in a well defined manner.
Each node has a Each node has a
.Em type , .Em type ,
which is a static property of the node determined at node creation time. which is a static property of the node determined at node creation time.
A node's type is described by a unique ASCII type name. A node's type is described by a unique
.Tn ASCII
type name.
The type implies what the node does and how it may be connected The type implies what the node does and how it may be connected
to other nodes. to other nodes.
.Pp .Pp
In object-oriented language, types are classes and nodes are instances In object-oriented language, types are classes and nodes are instances
of their respective class. All node types are subclasses of the generic node of their respective class. All node types are subclasses of the generic node
type, and hence inherit certain common functionality and capabilities type, and hence inherit certain common functionality and capabilities
(e.g., the ability to have an ASCII name). (e.g., the ability to have an
.Tn ASCII
name).
.Pp .Pp
Nodes may be assigned a globally unique ASCII name which can be Nodes may be assigned a globally unique
.Tn ASCII
name which can be
used to refer to the node. used to refer to the node.
The name must not contain the characters ``.'' or ``:'' and is limited to The name must not contain the characters
.Dq \&.
or
.Dq \&:
and is limited to
.Dv "NG_NODELEN + 1" .Dv "NG_NODELEN + 1"
characters (including NUL byte). characters (including NUL byte).
.Pp .Pp
Each node instance has a unique Each node instance has a unique
.Em ID number .Em ID number
which is expressed as a 32-bit hex value. This value may be used to which is expressed as a 32-bit hex value. This value may be used to
refer to a node when there is no ASCII name assigned to it. refer to a node when there is no
.Tn ASCII
name assigned to it.
.Sh Hooks .Sh Hooks
Nodes are connected to other nodes by connecting a pair of Nodes are connected to other nodes by connecting a pair of
.Em hooks , .Em hooks ,
@ -110,9 +122,15 @@ Hooks have these properties:
.Pp .Pp
.Bl -bullet -compact -offset 2n .Bl -bullet -compact -offset 2n
.It .It
A hook has an ASCII name which is unique among all hooks A hook has an
.Tn ASCII
name which is unique among all hooks
on that node (other hooks on other nodes may have the same name). on that node (other hooks on other nodes may have the same name).
The name must not contain a ``.'' or a ``:'' and is The name must not contain a
.Dq \&.
or a
.Dq \&:
and is
limited to limited to
.Dv "NG_HOOKLEN + 1" .Dv "NG_HOOKLEN + 1"
characters (including NUL byte). characters (including NUL byte).
@ -123,7 +141,9 @@ removing either hook destroys both hooks.
.El .El
.Pp .Pp
A node may decide to assign special meaning to some hooks. A node may decide to assign special meaning to some hooks.
For example, connecting to the hook named ``debug'' might trigger For example, connecting to the hook named
.Dq debug
might trigger
the node to start sending debugging information to that hook. the node to start sending debugging information to that hook.
.Sh Data Flow .Sh Data Flow
Two types of information flow between nodes: data messages and Two types of information flow between nodes: data messages and
@ -137,7 +157,8 @@ directly to some arbitrary other node. Control messages have a common
header format, followed by type-specific data, and are binary structures header format, followed by type-specific data, and are binary structures
for efficiency. However, node types also may support conversion of the for efficiency. However, node types also may support conversion of the
type specific data between binary and type specific data between binary and
ASCII for debugging and human interface purposes (see the .Tn ASCII
for debugging and human interface purposes (see the
.Dv NGM_ASCII2BINARY .Dv NGM_ASCII2BINARY
and and
.Dv NGM_BINARY2ASCII .Dv NGM_BINARY2ASCII
@ -146,9 +167,13 @@ these conversions.
.Pp .Pp
There are two ways to address a control message. If There are two ways to address a control message. If
there is a sequence of edges connecting the two nodes, the message there is a sequence of edges connecting the two nodes, the message
may be ``source routed'' by specifying the corresponding sequence may be
.Dq source routed
by specifying the corresponding sequence
of hooks as the destination address for the message (relative of hooks as the destination address for the message (relative
addressing). Otherwise, the recipient node global ASCII name addressing). Otherwise, the recipient node global
.Tn ASCII
name
(or equivalent ID based name) is used as the destination address (or equivalent ID based name) is used as the destination address
for the message (absolute addressing). The two types of addressing for the message (absolute addressing). The two types of addressing
may be combined, by specifying an absolute start node and a sequence may be combined, by specifying an absolute start node and a sequence
@ -156,7 +181,9 @@ of hooks.
.Pp .Pp
Messages often represent commands that are followed by a reply message Messages often represent commands that are followed by a reply message
in the reverse direction. To facilitate this, the recipient of a in the reverse direction. To facilitate this, the recipient of a
control message is supplied with a ``return address'' that is suitable control message is supplied with a
.Dq return address
that is suitable
for addressing a reply. for addressing a reply.
.Pp .Pp
Each control message contains a 32 bit value called a Each control message contains a 32 bit value called a
@ -167,7 +194,7 @@ that it understands. However, a node may choose to recognize and
implement more than one type of message. implement more than one type of message.
.Sh Netgraph is Functional .Sh Netgraph is Functional
In order to minimize latency, most In order to minimize latency, most
.Nm netgraph .Nm
operations are functional. operations are functional.
That is, data and control messages are delivered by making function That is, data and control messages are delivered by making function
calls rather than by using queues and mailboxes. For example, if node calls rather than by using queues and mailboxes. For example, if node
@ -175,7 +202,9 @@ A wishes to send a data mbuf to neighboring node B, it calls the
generic generic
.Nm .Nm
data delivery function. This function in turn locates data delivery function. This function in turn locates
node B and calls B's ``receive data'' method. While this mode of operation node B and calls B's
.Dq receive data
method. While this mode of operation
results in good performance, it has a few implications for node results in good performance, it has a few implications for node
developers: developers:
.Pp .Pp
@ -186,13 +215,13 @@ may need to allow for the possibility of receiving a returning message
before the original delivery function call returns. before the original delivery function call returns.
.It .It
Netgraph nodes and support routines generally run at Netgraph nodes and support routines generally run at
.Dv "splnet()" . .Fn splnet .
However, some nodes may want to send data and control messages However, some nodes may want to send data and control messages
from a different priority level. Netgraph supplies queueing routines which from a different priority level. Netgraph supplies queueing routines which
utilize the NETISR system to move message delivery to utilize the NETISR system to move message delivery to
.Dv "splnet()" . .Fn splnet .
Note that messages are always received at Note that messages are always received at
.Dv "splnet()" . .Fn splnet .
.It .It
It's possible for an infinite loop to occur if the graph contains cycles. It's possible for an infinite loop to occur if the graph contains cycles.
.El .El
@ -215,7 +244,7 @@ which is both a netgraph node and a
BSD socket in the protocol family BSD socket in the protocol family
.Dv PF_NETGRAPH . .Dv PF_NETGRAPH .
Socket nodes allow user processes to participate in Socket nodes allow user processes to participate in
.Nm netgraph . .Nm Ns .
Other nodes communicate with socket nodes using the usual methods, and the Other nodes communicate with socket nodes using the usual methods, and the
node hides the fact that it is also passing information to and from a node hides the fact that it is also passing information to and from a
cooperating user process. cooperating user process.
@ -225,7 +254,7 @@ a node interface to the hardware.
.Sh Node Methods .Sh Node Methods
Nodes are notified of the following actions via function calls Nodes are notified of the following actions via function calls
to the following node methods (all at to the following node methods (all at
.Dv "splnet()" ) .Fn splnet )
and may accept or reject that action (by returning the appropriate and may accept or reject that action (by returning the appropriate
error code): error code):
.Bl -tag -width xxx .Bl -tag -width xxx
@ -235,7 +264,9 @@ allowed, the constructor must call the generic node creation
function (in object-oriented terms, the superclass constructor) function (in object-oriented terms, the superclass constructor)
and then allocate any special resources it needs. For nodes that and then allocate any special resources it needs. For nodes that
correspond to hardware, this is typically done during the device correspond to hardware, this is typically done during the device
attach routine. Often a global ASCII name corresponding to the attach routine. Often a global
.Tn ASCII
name corresponding to the
device name is assigned here as well. device name is assigned here as well.
.It Creation of a new hook .It Creation of a new hook
The hook is created and tentatively The hook is created and tentatively
@ -270,7 +301,7 @@ An mbuf chain is passed to the node.
The node is notified on which hook the data arrived, The node is notified on which hook the data arrived,
and can use this information in its processing decision. and can use this information in its processing decision.
The node must must always The node must must always
.Dv m_freem() .Fn m_freem
the mbuf chain on completion or error, or pass it on to another node the mbuf chain on completion or error, or pass it on to another node
(or kernel module) which will then be responsible for freeing it. (or kernel module) which will then be responsible for freeing it.
.Pp .Pp
@ -280,13 +311,13 @@ structure describing meta-data about the message
.Dv NULL .Dv NULL
if there is no additional information. The format for this information is if there is no additional information. The format for this information is
described in described in
.Dv netgraph.h . .Pa netgraph.h .
The memory for meta-data must allocated via The memory for meta-data must allocated via
.Dv malloc() .Fn malloc
with type with type
.Dv M_NETGRAPH . .Dv M_NETGRAPH .
As with the data itself, it is the receiver's responsibility to As with the data itself, it is the receiver's responsibility to
.Dv free() .Fn free
the meta-data. If the mbuf chain is freed the meta-data must the meta-data. If the mbuf chain is freed the meta-data must
be freed at the same time. If the meta-data is freed but the be freed at the same time. If the meta-data is freed but the
real data on is passed on, then a real data on is passed on, then a
@ -324,14 +355,14 @@ to point to the reply.
Then when the control message delivery function returns, Then when the control message delivery function returns,
the caller can check if this pointer has been made non-NULL, the caller can check if this pointer has been made non-NULL,
and if so then it points to the reply message allocated via and if so then it points to the reply message allocated via
.Dv malloc() .Fn malloc
and containing the synchronous response. In both directions, and containing the synchronous response. In both directions,
(request and response) it is up to the (request and response) it is up to the
receiver of that message to receiver of that message to
.Dv free() .Fn free
the control message buffer. All control messages and replies are the control message buffer. All control messages and replies are
allocated with allocated with
.Dv malloc() .Fn malloc
type type
.Dv M_NETGRAPH . .Dv M_NETGRAPH .
.El .El
@ -339,7 +370,9 @@ type
Much use has been made of reference counts, so that nodes being Much use has been made of reference counts, so that nodes being
free'd of all references are automatically freed, and this behaviour free'd of all references are automatically freed, and this behaviour
has been tested and debugged to present a consistent and trustworthy has been tested and debugged to present a consistent and trustworthy
framework for the ``type module'' writer to use. framework for the
.Dq type module
writer to use.
.Sh Addressing .Sh Addressing
The The
.Nm .Nm
@ -358,7 +391,11 @@ A relative address includes only the sequence of hook names, implicitly
starting hook traversal at the local node. starting hook traversal at the local node.
.Pp .Pp
There are a couple of special possibilities for the node name. There are a couple of special possibilities for the node name.
The name ``.'' (referred to as ``.:'') always refers to the local node. The name
.Dq \&.
(referred to as
.Dq \&.: )
always refers to the local node.
Also, nodes that have no global name may be addressed by their ID numbers, Also, nodes that have no global name may be addressed by their ID numbers,
by enclosing the hex representation of the ID number within square brackets. by enclosing the hex representation of the ID number within square brackets.
Here are some examples of valid netgraph addresses: Here are some examples of valid netgraph addresses:
@ -560,19 +597,22 @@ be changed.
The de facto method for generating unique type cookies is to take the The de facto method for generating unique type cookies is to take the
seconds from the epoch at the time the header file is written seconds from the epoch at the time the header file is written
(i.e., the output of (i.e., the output of
.Dv "date -u +'%s'" ")." .Dv "date -u +'%s'" ) .
.Pp .Pp
There is a predefined typecookie There is a predefined typecookie
.Dv NGM_GENERIC_COOKIE .Dv NGM_GENERIC_COOKIE
for the ``generic'' node type, and for the
.Dq generic
node type, and
a corresponding set of generic messages which all nodes understand. a corresponding set of generic messages which all nodes understand.
The handling of these messages is automatic. The handling of these messages is automatic.
.It Dv command .It Dv command
The identifier for the message command. This is type specific, The identifier for the message command. This is type specific,
and is defined in the same header file as the typecookie. and is defined in the same header file as the typecookie.
.It Dv cmdstr .It Dv cmdstr
Room for a short human readable version of ``command'' (for debugging Room for a short human readable version of
purposes only). .Dq command
(for debugging purposes only).
.El .El
.Pp .Pp
Some modules may choose to implement messages from more than one Some modules may choose to implement messages from more than one
@ -580,25 +620,34 @@ of the header files and thus recognize more than one type cookie.
.Sh Control Message ASCII Form .Sh Control Message ASCII Form
Control messages are in binary format for efficiency. However, for Control messages are in binary format for efficiency. However, for
debugging and human interface purposes, and if the node type supports debugging and human interface purposes, and if the node type supports
it, control messages may be converted to and from an equivalent ASCII it, control messages may be converted to and from an equivalent
form. The ASCII form is similar to the binary form, with two exceptions: .Tn ASCII
form. The
.Tn ASCII
form is similar to the binary form, with two exceptions:
.Pp .Pp
.Bl -tag -compact -width xxx .Bl -tag -compact -width xxx
.It o .It o
The The
.Dv cmdstr .Dv cmdstr
header field must contain the ASCII name of the command, corresponding to the header field must contain the
.Tn ASCII
name of the command, corresponding to the
.Dv cmd .Dv cmd
header field. header field.
.It o .It o
The The
.Dv args .Dv args
field contains a NUL-terminated ASCII string version of the message arguments. field contains a NUL-terminated
.Tn ASCII
string version of the message arguments.
.El .El
.Pp .Pp
In general, the arguments field of a control messgage can be any In general, the arguments field of a control messgage can be any
arbitrary C data type. Netgraph includes parsing routines to support arbitrary C data type. Netgraph includes parsing routines to support
some pre-defined datatypes in ASCII with this simple syntax: some pre-defined datatypes in
.Tn ASCII
with this simple syntax:
.Pp .Pp
.Bl -tag -compact -width xxx .Bl -tag -compact -width xxx
.It o .It o
@ -616,24 +665,28 @@ does not have an explicit index, the index is implicitly the previous
element's index plus one. element's index plus one.
.It o .It o
Structures are enclosed in curly braces, and each field is specified Structures are enclosed in curly braces, and each field is specified
in the form ``fieldname=value''. in the form
.Dq fieldname=value .
.It o .It o
Any array element or structure field whose value is equal to its Any array element or structure field whose value is equal to its
``default value'' may be omitted. For integer types, the default value .Dq default value
may be omitted. For integer types, the default value
is usually zero; for string types, the empty string. is usually zero; for string types, the empty string.
.It o .It o
Array elements and structure fields may be specified in any order. Array elements and structure fields may be specified in any order.
.El .El
.Pp .Pp
Each node type may define its own arbitrary types by providing Each node type may define its own arbitrary types by providing
the necessary routines to parse and unparse. ASCII forms defined the necessary routines to parse and unparse.
.Tn ASCII
forms defined
for a specific node type are documented in the documentation for for a specific node type are documented in the documentation for
that node type. that node type.
.Sh Generic Control Messages .Sh Generic Control Messages
There are a number of standard predefined messages that will work There are a number of standard predefined messages that will work
for any node, as they are supported directly by the framework itself. for any node, as they are supported directly by the framework itself.
These are defined in These are defined in
.Dv ng_message.h .Pa ng_message.h
along with the basic layout of messages and other similar information. along with the basic layout of messages and other similar information.
.Bl -tag -width xxx .Bl -tag -width xxx
.It Dv NGM_CONNECT .It Dv NGM_CONNECT
@ -655,7 +708,9 @@ is the default for nodes created using the
method. Such nodes can only be addressed relatively or by their ID number. method. Such nodes can only be addressed relatively or by their ID number.
.It Dv NGM_RMHOOK .It Dv NGM_RMHOOK
Ask the node to break a hook connection to one of its neighbours. Ask the node to break a hook connection to one of its neighbours.
Both nodes will have their ``disconnect'' method invoked. Both nodes will have their
.Dq disconnect
method invoked.
Either node may elect to totally shut down as a result. Either node may elect to totally shut down as a result.
.It Dv NGM_NODEINFO .It Dv NGM_NODEINFO
Asks the target node to describe itself. The four returned fields Asks the target node to describe itself. The four returned fields
@ -688,12 +743,16 @@ elect to not support this message. The text response must be less than
bytes in length (presently 1024). This can be used to return general bytes in length (presently 1024). This can be used to return general
status information in human readable form. status information in human readable form.
.It Dv NGM_BINARY2ASCII .It Dv NGM_BINARY2ASCII
This message converts a binary control message to its ASCII form. This message converts a binary control message to its
.Tn ASCII
form.
The entire control message to be converted is contained within the The entire control message to be converted is contained within the
arguments field of the arguments field of the
.Dv Dv NGM_BINARY2ASCII .Dv Dv NGM_BINARY2ASCII
message itself. If successful, the reply will contain the same control message itself. If successful, the reply will contain the same control
message in ASCII form. message in
.Tn ASCII
form.
A node will typically only know how to translate messages that it A node will typically only know how to translate messages that it
itself understands, so the target node of the itself understands, so the target node of the
.Dv NGM_BINARY2ASCII .Dv NGM_BINARY2ASCII
@ -701,7 +760,9 @@ is often the same node that would actually receive that message.
.It Dv NGM_ASCII2BINARY .It Dv NGM_ASCII2BINARY
The opposite of The opposite of
.Dv NGM_BINARY2ASCII . .Dv NGM_BINARY2ASCII .
The entire control message to be converted, in ASCII form, is contained The entire control message to be converted, in
.Tn ASCII
form, is contained
in the arguments section of the in the arguments section of the
.Dv NGM_ASCII2BINARY .Dv NGM_ASCII2BINARY
and need only have the and need only have the
@ -765,20 +826,20 @@ node of unknown type
is made, is made,
.Nm .Nm
will attempt to load the KLD module will attempt to load the KLD module
.Dv ng_type.ko . .Pa ng_type.ko .
.Pp .Pp
Types can also be installed at boot time, as certain device drivers Types can also be installed at boot time, as certain device drivers
may want to export each instance of the device as a netgraph node. may want to export each instance of the device as a netgraph node.
.Pp .Pp
In general, new types can be installed at any time from within the In general, new types can be installed at any time from within the
kernel by calling kernel by calling
.Dv ng_newtype() , .Fn ng_newtype ,
supplying a pointer to the type's supplying a pointer to the type's
.Dv struct ng_type .Dv struct ng_type
structure. structure.
.Pp .Pp
The The
.Dv "NETGRAPH_INIT()" .Fn NETGRAPH_INIT
macro automates this process by using a linker set. macro automates this process by using a linker set.
.Sh EXISTING NODE TYPES .Sh EXISTING NODE TYPES
Several node types currently exist. Each is fully documented Several node types currently exist. Each is fully documented
@ -808,8 +869,9 @@ calls, using a
socket address. socket address.
.Pp .Pp
.It HOLE .It HOLE
Responds only to generic messages and is a ``black hole'' for data, Responds only to generic messages and is a
Useful for testing. Always accepts new hooks. .Dq black hole
for data, Useful for testing. Always accepts new hooks.
.Pp .Pp
.It ECHO .It ECHO
Responds only to generic messages and always echoes data back through the Responds only to generic messages and always echoes data back through the
@ -817,7 +879,9 @@ hook from which it arrived. Returns any non generic messages as their
own response. Useful for testing. Always accepts new hooks. own response. Useful for testing. Always accepts new hooks.
.Pp .Pp
.It TEE .It TEE
This node is useful for ``snooping.'' It has 4 hooks: This node is useful for
.Dq snooping .
It has 4 hooks:
.Dv left , .Dv left ,
.Dv right , .Dv right ,
.Dv left2right , .Dv left2right ,
@ -836,24 +900,31 @@ to left.
.Pp .Pp
.It RFC1490 MUX .It RFC1490 MUX
Encapsulates/de-encapsulates frames encoded according to RFC 1490. Encapsulates/de-encapsulates frames encoded according to RFC 1490.
Has a hook for the encapsulated packets (``downstream'') and one hook Has a hook for the encapsulated packets
.Pq Dq downstream
and one hook
for each protocol (i.e., IP, PPP, etc.). for each protocol (i.e., IP, PPP, etc.).
.Pp .Pp
.It FRAME RELAY MUX .It FRAME RELAY MUX
Encapsulates/de-encapsulates Frame Relay frames. Encapsulates/de-encapsulates Frame Relay frames.
Has a hook for the encapsulated packets (``downstream'') and one hook Has a hook for the encapsulated packets
.Pq Dq downstream
and one hook
for each DLCI. for each DLCI.
.Pp .Pp
.It FRAME RELAY LMI .It FRAME RELAY LMI
Automatically handles frame relay Automatically handles frame relay
``LMI'' (link management interface) operations and packets. .Dq LMI
(link management interface) operations and packets.
Automatically probes and detects which of several LMI standards Automatically probes and detects which of several LMI standards
is in use at the exchange. is in use at the exchange.
.Pp .Pp
.It TTY .It TTY
This node is also a line discipline. It simply converts between mbuf This node is also a line discipline. It simply converts between mbuf
frames and sequential serial data, allowing a tty to appear as a netgraph frames and sequential serial data, allowing a tty to appear as a netgraph
node. It has a programmable ``hotkey'' character. node. It has a programmable
.Dq hotkey
character.
.Pp .Pp
.It ASYNC .It ASYNC
This node encapsulates and de-encapsulates asynchronous frames This node encapsulates and de-encapsulates asynchronous frames
@ -891,14 +962,14 @@ It might be freed by any node the data passes through, and a
.Dv NULL .Dv NULL
passed onwards, but the caller will never free it. passed onwards, but the caller will never free it.
Two macros Two macros
.Dv "NG_FREE_META(meta)" .Fn NG_FREE_META "meta"
and and
.Dv "NG_FREE_DATA(m, meta)" .Fn NG_FREE_DATA "m" "meta"
should be used if possible to free data and meta data (see should be used if possible to free data and meta data (see
.Dv netgraph.h ")." .Pa netgraph.h ) .
.It 3 .It 3
Messages sent using Messages sent using
.Dv ng_send_message() .Fn ng_send_message
are freed by the callee. As in the case above, the addresses are freed by the callee. As in the case above, the addresses
associated with the message are freed by whatever allocated them so the associated with the message are freed by whatever allocated them so the
recipient should copy them if it wants to keep that information. recipient should copy them if it wants to keep that information.
@ -974,7 +1045,10 @@ and
The The
.Nm .Nm
system was designed and first implemented at Whistle Communications, Inc. system was designed and first implemented at Whistle Communications, Inc.
in a version FreeBSD 2.2 customized for the Whistle InterJet. in a version
.Fx 2.2
customized for the Whistle InterJet.
.Sh AUTHORS .Sh AUTHORS
Julian Elischer <julian@whistle.com>, with contributions by .An Julian Elischer Aq julian@whistle.com ,
Archie Cobbs <archie@whistle.com>. with contributions by
.An Archie Cobbs Aq archie@whistle.com .

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_UI 8 .Dt NG_UI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_UI .Nm ng_UI
.Nd UI netgraph node type .Nd UI netgraph node type
@ -82,5 +82,10 @@ control message, or when both hooks have been disconnected.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ASYNC 8 .Dt NG_ASYNC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_async .Nm ng_async
.Nd asynchronous framing netgraph node type .Nd asynchronous framing netgraph node type
@ -75,7 +75,9 @@ is enabled for that frame (in PPP, LCP packets are always sent with
no address and control field compression and all control characters no address and control field compression and all control characters
escaped). escaped).
.Pp .Pp
This node supports ``flag sharing'' for packets transmitted on This node supports
.Dq flag sharing
for packets transmitted on
.Dv async . .Dv async .
This is an optimization where the trailing flag byte This is an optimization where the trailing flag byte
of one frame is shared with the opening flag byte of the next. of one frame is shared with the opening flag byte of the next.
@ -122,7 +124,9 @@ struct ng_async_cfg {
The The
.Dv enabled .Dv enabled
field enables or disables all encoding/decoding functions (default disabled). field enables or disables all encoding/decoding functions (default disabled).
When disabled, the node operates in simple ``pass through'' mode. When disabled, the node operates in simple
.Dq pass through
mode.
The The
.Dv amru .Dv amru
and and
@ -156,5 +160,10 @@ control message, or when all hooks have been disconnected.
.%T "The Point-to-Point Protocol (PPP)" .%T "The Point-to-Point Protocol (PPP)"
.%O RFC 1661 .%O RFC 1661
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd December 2, 1999 .Dd December 2, 1999
.Dt NG_BPF 8 .Dt NG_BPF 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_bpf .Nm ng_bpf
.Nd Berkeley packet filter netgraph node type .Nd Berkeley packet filter netgraph node type
@ -48,17 +48,17 @@
The The
.Nm bpf .Nm bpf
node type allows Berkeley Packet Filter (see node type allows Berkeley Packet Filter (see
.Xr bpf 8 ) .Xr bpf 4 )
filters to be applied to data travelling through a Netgraph network. filters to be applied to data travelling through a Netgraph network.
Each node allows an arbitrary number of connections to arbitrarily Each node allows an arbitrary number of connections to arbitrarily
named hooks. With each hook is associated a named hooks. With each hook is associated a
.Xf bpf 8 .Xf bpf 4
filter program which is applied to incoming data only, a destination hook filter program which is applied to incoming data only, a destination hook
for matching packets, a destination hook for non-matching packets, for matching packets, a destination hook for non-matching packets,
and various statistics counters. and various statistics counters.
.Pp .Pp
A A
.Xr bpf 8 .Xr bpf 4
program returns an unsigned integer, which is normally interpreted as 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 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 node type, returning zero is considered a non-match, in which case the
@ -102,21 +102,27 @@ Matching and non-matching incoming packets are delivered out the hooks named
and and
.Dv ifNotMatch , .Dv ifNotMatch ,
respectively. The program must be a valid respectively. The program must be a valid
.Xr bpf 8 .Xr bpf 4
program or else program or else
.Er EINVAL .Er EINVAL
is returned. is returned.
.It Dv NGM_BPF_GET_FILTER .It Dv NGM_BPF_GET_FILTER
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
corresponding corresponding
.Dv "struct ngm_bpf_hookprog" .Dv "struct ngm_bpf_hookprog"
as shown above. as shown above.
.It Dv NGM_BPF_GET_STATS .It Dv NGM_BPF_GET_STATS
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
statistics associated with the hook as a statistics associated with the hook as a
.Dv "struct ng_bpf_hookstat" . .Dv "struct ng_bpf_hookstat" .
.It Dv NGM_BPF_CLR_STATS .It Dv NGM_BPF_CLR_STATS
This command takes an ASCII string argument, the hook name, and clears the This command takes an
.Tn ASCII
string argument, the hook name, and clears the
statistics associated with the hook. statistics associated with the hook.
.It Dv NGM_BPF_GETCLR_STATS .It Dv NGM_BPF_GETCLR_STATS
This command is identical to This command is identical to
@ -129,15 +135,20 @@ This node shuts down upon receipt of a
control message, or when all hooks have been disconnected. control message, or when all hooks have been disconnected.
.Sh BUGS .Sh BUGS
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/bpf_filter.c" . .Pa net/bpf_filter.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/bpf_filter.c" .Pa net/bpf_filter.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh AUTHORS
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_CISCO 8 .Dt NG_CISCO 8
.Os FreeBSD 3 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_cisco .Nm ng_cisco
.Nd Cisco HDLC protocol netgraph node type .Nd Cisco HDLC protocol netgraph node type
@ -52,7 +52,10 @@ using the Cisco HDLC protocol. This is a fairly simple
protocol for the transmission of packets across protocol for the transmission of packets across
high speed synchronous lines. Each packet is prepended with high speed synchronous lines. Each packet is prepended with
an Ethertype, indicating the protocol. There is also a an Ethertype, indicating the protocol. There is also a
``keep alive'' and an ``inquire'' capability. .Dq keep alive
and an
.Dq inquire
capability.
.Pp .Pp
The The
.Dv downstream .Dv downstream
@ -70,7 +73,9 @@ type node.
.Sh IP Configuration .Sh IP Configuration
In order to function properly for IP traffic, the node must be informed In order to function properly for IP traffic, the node must be informed
of the local IP address and netmask setting. This is because the protocol of the local IP address and netmask setting. This is because the protocol
includes an ``inquire'' packet which we must be prepared to answer. includes an
.Dq inquire
packet which we must be prepared to answer.
There are two ways to accomplish this, manually and automatically. There are two ways to accomplish this, manually and automatically.
.Pp .Pp
Whenever such an inquire packet is received, the node sends a Whenever such an inquire packet is received, the node sends a
@ -154,7 +159,13 @@ and netmask.
.%O RFC 1547 .%O RFC 1547
.Re .Re
.Sh LEGAL .Sh LEGAL
Cisco is a trademark of Cisco Systems, Inc. .Tn Cisco
is a trademark of Cisco Systems, Inc.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS .Sh AUTHORS
Julian Elischer <julian@whistle.com>, .An Julian Elischer Aq julian@whistle.com ,
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ECHO 8 .Dt NG_ECHO 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_echo .Nm ng_echo
.Nd netgraph echo node type .Nd netgraph echo node type
@ -49,8 +49,9 @@ The
node type reflects all data and control messages back to the sender. node type reflects all data and control messages back to the sender.
This node type is used for testing and debugging. This node type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Echo A
nodes accept any request to connect, regardless of the hook name, .Nm echo
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_hole 8 , .Xr ng_hole 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_FRAME_RELAY 8 .Dt NG_FRAME_RELAY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_frame_relay .Nm ng_frame_relay
.Nd Frame relay netgraph node type .Nd frame relay netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_frame_relay.h> .Fd #include <netgraph/ng_frame_relay.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -80,7 +80,7 @@ control message, or when all hooks have been disconnected.
Technically, frames on DLCI X should not be transmitted to the switch Technically, frames on DLCI X should not be transmitted to the switch
until the LMI protocol entity on both ends has configured DLCI X as active. until the LMI protocol entity on both ends has configured DLCI X as active.
The The
.Nm frame_relay .Nm
node type ignores this restriction, and will always pass data received node type ignores this restriction, and will always pass data received
on a DLCI hook to on a DLCI hook to
.Dv downstream . .Dv downstream .
@ -89,5 +89,10 @@ Instead, it should query the LMI node first.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_lmi 8 , .Xr ng_lmi 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_HOLE 8 .Dt NG_HOLE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_hole .Nm ng_hole
.Nd netgraph discard node type .Nd netgraph discard node type
@ -49,8 +49,9 @@ The
node type silently discards all data and control messages it receives. node type silently discards all data and control messages it receives.
This type is used for testing and debugging. This type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Hole A
nodes accept any request to connect, regardless of the hook name, .Nm
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_echo 8 , .Xr ng_echo 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_IFACE 8 .Dt NG_IFACE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_iface .Nm ng_iface
.Nd interface netgraph node type .Nd interface netgraph node type
@ -47,7 +47,7 @@
An An
.Nm iface .Nm iface
node is both a netgraph node and a system networking interface. When an node is both a netgraph node and a system networking interface. When an
.Nm iface .Nm
node is created, a new point-to-point interface appears which is accessible via node is created, a new point-to-point interface appears which is accessible via
.Xr ifconfig 8 . .Xr ifconfig 8 .
The new interfaces are named The new interfaces are named
@ -56,8 +56,9 @@ The new interfaces are named
etc. The node is assigned the same name as its interface, unless the name etc. The node is assigned the same name as its interface, unless the name
already exists, in which case the node remains unnamed. already exists, in which case the node remains unnamed.
.Pp .Pp
.Nm Iface An
nodes have a single hook corresponding to each supported protocol. .Nm
node has a single hook corresponding to each supported protocol.
Packets transmitted via the interface flow out the corresponding Packets transmitted via the interface flow out the corresponding
protocol-specific hook. protocol-specific hook.
Similarly, packets received on a hook appear on the interface as Similarly, packets received on a hook appear on the interface as
@ -66,8 +67,9 @@ packets received in the corresponding protocol.
The currently supported protocols are IP, IPX, AppleTalk, and NS. The currently supported protocols are IP, IPX, AppleTalk, and NS.
In the KLD module, only support for IP is compiled in by default. In the KLD module, only support for IP is compiled in by default.
.Pp .Pp
.Nm Iface An
nodes support the Berkeley Packet Filter (BPF). .Nm
node supports the Berkeley Packet Filter (BPF).
.Sh HOOKS .Sh HOOKS
This node type supports the following hooks: This node type supports the following hooks:
.Pp .Pp
@ -96,7 +98,7 @@ struct ng_iface_ifname {
Returns the list of addresses associated with this interface. Returns the list of addresses associated with this interface.
The list is returned in the same format as the The list is returned in the same format as the
.Dv SIOCGIFCONF .Dv SIOCGIFCONF
ioctl(). .Fn ioctl .
.It Dv NGM_CISCO_GET_IPADDR .It Dv NGM_CISCO_GET_IPADDR
This message is defined by the This message is defined by the
.Xr ng_cisco 8 .Xr ng_cisco 8
@ -106,8 +108,9 @@ for a description.
.El .El
.Sh SHUTDOWN .Sh SHUTDOWN
Because it is currently not possible to remove a system networking Because it is currently not possible to remove a system networking
interface in FreeBSD, interface in
.Nm iface .Fx ,
.Nm
nodes are nodes are
.Em persistent. .Em persistent.
That is, once created they are never destroyed. That is, once created they are never destroyed.
@ -115,12 +118,17 @@ The receipt of a
.Dv NGM_SHUTDOWN .Dv NGM_SHUTDOWN
control message disconnects all hooks but does not remove the node. control message disconnects all hooks but does not remove the node.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr netgraph 4 ,
.Xr ifconfig 8 ,
.Xr ng_cisco 8 , .Xr ng_cisco 8 ,
.Xr ng_ppp 8 , .Xr ng_ppp 8 ,
.Xr ng_rfc1490 8 , .Xr ng_rfc1490 8 ,
.Xr ngctl 8 , .Xr ngctl 8 .
.Xr ifconfig 8 . .Sh HISTORY
.Sh AUTHOR The
Archie Cobbs <archie@whistle.com> .Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -46,21 +46,21 @@
A A
.Nm ksocket .Nm ksocket
node is both a netgraph node and a BSD socket. The node is both a netgraph node and a BSD socket. The
.Nm ksocket .Nm
node type allows one to open a socket inside the kernel and have node type allows one to open a socket inside the kernel and have
it appear as a Netgraph node. The it appear as a Netgraph node. The
.Nm ksocket .Nm
node type is the reverse of the socket node type (see node type is the reverse of the socket node type (see
.Xr ng_socket 8 "):" .Xr ng_socket 8 ) :
whereas the socket node type enables the user-level manipulation (via whereas the socket node type enables the user-level manipulation (via
a socket) of what is normally a kernel-level entity (the associated a socket) of what is normally a kernel-level entity (the associated
Netgraph node), the Netgraph node), the
.Nm ksocket .Nm
node type enables the kernel-level manipulation (via a Netgraph node) of node type enables the kernel-level manipulation (via a Netgraph node) of
what is normally a user-level entity (the associated socket). what is normally a user-level entity (the associated socket).
.Pp .Pp
A A
.Nm ksocket .Nm
node allows at most one hook connection. Connecting to the node is node allows at most one hook connection. Connecting to the node is
equivalent to opening the associated socket. The name given to the hook equivalent to opening the associated socket. The name given to the hook
determines what kind of socket the node will open (see below). determines what kind of socket the node will open (see below).
@ -136,7 +136,9 @@ retrieved value.
.Sh ASCII FORM CONTROL MESSAGES .Sh ASCII FORM CONTROL MESSAGES
For control messages that pass a For control messages that pass a
.Dv "struct sockaddr" .Dv "struct sockaddr"
in the argument field, the normal ASCII equivalent of the C structure in the argument field, the normal
.Tn ASCII
equivalent of the C structure
is an acceptable form. For the is an acceptable form. For the
.Dv PF_INET .Dv PF_INET
and and
@ -162,7 +164,9 @@ local/"/tmp/foo.socket"
.Pp .Pp
For control messages that pass a For control messages that pass a
.Dv "struct ng_ksocket_sockopt" , .Dv "struct ng_ksocket_sockopt" ,
the normal ASCII form for that structure is used. In the future, more the normal
.Tn ASCII
form for that structure is used. In the future, more
convenient encoding of the more common socket options may be supported. convenient encoding of the more common socket options may be supported.
.Sh SHUTDOWN .Sh SHUTDOWN
This node shuts down upon receipt of a This node shuts down upon receipt of a
@ -174,5 +178,10 @@ Shutdown of the node closes the associated socket.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_socket 8 , .Xr ng_socket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_LMI 8 .Dt NG_LMI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_lmi .Nm ng_lmi
.Nd Frame relay LMI protocol netgraph node type .Nd frame relay LMI protocol netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_lmi.h> .Fd #include <netgraph/ng_lmi.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -126,5 +126,10 @@ control message, or when all hooks have been disconnected.
.Rs .Rs
.%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A" .%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A"
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -66,7 +66,7 @@ hook which is used to handle any protocol not directly supported
by the node. This includes all of the control protocols: LCP, IPCP, by the node. This includes all of the control protocols: LCP, IPCP,
CCP, etc. Typically this node is connected to a user-land daemon CCP, etc. Typically this node is connected to a user-land daemon
via a via a
.Xr ng_socket(8) .Xr ng_socket 8
type node. type node.
.Sh ENABLING FUNCTIONALITY .Sh ENABLING FUNCTIONALITY
In general, the PPP node enables a specific link or functionality when In general, the PPP node enables a specific link or functionality when
@ -153,7 +153,9 @@ hooks are connected, and the corresponding configuration flag is
enabled, Van Jacobsen compression and/or decompression will become active. enabled, Van Jacobsen compression and/or decompression will become active.
Normally these hooks connect to the corresponding hooks of a single Normally these hooks connect to the corresponding hooks of a single
.Xr ng_vjc 8 .Xr ng_vjc 8
node. The PPP node is compatible with the ``pass through'' modes of the node. The PPP node is compatible with the
.Dq pass through
modes of the
.Xr ng_vjc 8 .Xr ng_vjc 8
node type. node type.
.Sh BYPASS HOOK .Sh BYPASS HOOK
@ -375,5 +377,10 @@ control message, or when all hooks have been disconnected.
.%T "The PPP Multilink Protocol (MP)" .%T "The PPP Multilink Protocol (MP)"
.%O RFC 1990 .%O RFC 1990
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd October 28, 1999 .Dd October 28, 1999
.Dt NG_PPPOE 8 .Dt NG_PPPOE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_pppoe .Nm ng_pppoe
.Nd RFC 2516 PPPOE protocol netgraph node type .Nd RFC 2516 PPPOE protocol netgraph node type
@ -46,7 +46,7 @@
.Fd #include <netgraph/ng_pppoe.h> .Fd #include <netgraph/ng_pppoe.h>
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm pppoe
node type performs the PPPoE protocol. It is used in conjunction with the node type performs the PPPoE protocol. It is used in conjunction with the
.Xr netgraph 4 .Xr netgraph 4
extensions to the Ethernet framework to divert and inject Ethernet packets extensions to the Ethernet framework to divert and inject Ethernet packets
@ -164,7 +164,7 @@ This node shuts down upon receipt of a
control message, when all session have been disconnected or when the control message, when all session have been disconnected or when the
.Dv ethernet .Dv ethernet
hook is disconnected. hook is disconnected.
.Sh EXAMPLE USAGE .Sh EXAMPLES
The following code uses The following code uses
.Dv libnetgraph .Dv libnetgraph
to set up a to set up a
@ -395,5 +395,10 @@ setup(char *ethername, char *service, char *sessname,
.%T "A Method for transmitting PPP over Ethernet (PPPoE)" .%T "A Method for transmitting PPP over Ethernet (PPPoE)"
.%O RFC 2516 .%O RFC 2516
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -132,5 +132,10 @@ control message, or when both hooks have been disconnected.
.%T "Generic Routing Encapsulation over IPv4 networks" .%T "Generic Routing Encapsulation over IPv4 networks"
.%O RFC 1702 .%O RFC 1702
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_RFC1490 8 .Dt NG_RFC1490 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_rfc1490 .Nm ng_rfc1490
.Nd RFC 1490 netgraph node type .Nd RFC 1490 netgraph node type
@ -105,5 +105,10 @@ Not all of RFC 1490 is implemented.
.%T "PPP in Frame Relay" .%T "PPP in Frame Relay"
.%O RFC 1973 .%O RFC 1973
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_SOCKET 8 .Dt NG_SOCKET 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_socket .Nm ng_socket
.Nd netgraph socket node type .Nd netgraph socket node type
@ -48,7 +48,7 @@
A A
.Nm socket .Nm socket
node is both a BSD socket and a netgraph node. The node is both a BSD socket and a netgraph node. The
.Nm socket .Nm
node type allows user-mode processes to participate in the kernel node type allows user-mode processes to participate in the kernel
.Xr netgraph 4 .Xr netgraph 4
networking subsystem using the BSD socket interface. The process must have networking subsystem using the BSD socket interface. The process must have
@ -56,7 +56,7 @@ root privileges to be able to create netgraph sockets however once created,
any process that has one may use it. any process that has one may use it.
.Pp .Pp
A new A new
.Nm socket .Nm
node is created by creating a new socket of type node is created by creating a new socket of type
.Dv NG_CONTROL .Dv NG_CONTROL
in the protocol family in the protocol family
@ -85,13 +85,13 @@ To transmit and receive netgraph data packets, a
socket must also be created using socket must also be created using
.Xr socket 2 .Xr socket 2
and associated with a and associated with a
.Nm socket .Nm
node. node.
.Dv NG_DATA sockets do not automatically .Dv NG_DATA sockets do not automatically
have nodes associated with them; they are bound to a specific node via the have nodes associated with them; they are bound to a specific node via the
.Xr connect 2 .Xr connect 2
system call. The address argument is the netgraph address of the system call. The address argument is the netgraph address of the
.Nm socket .Nm
node already created. Once a data socket is associated with a node, node already created. Once a data socket is associated with a node,
any data packets received by the node are read using any data packets received by the node are read using
.Xr recvfrom 2 .Xr recvfrom 2
@ -169,5 +169,10 @@ socket).
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_ksocket 8 , .Xr ng_ksocket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TEE 8 .Dt NG_TEE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tee .Nm ng_tee
.Nd netgraph ``tee'' node type .Nd netgraph ``tee'' node type
@ -50,7 +50,9 @@ node type has a purpose similar to the
.Xr tee 1 .Xr tee 1
command. command.
.Nm Tee .Nm Tee
nodes are useful for debugging or ``snooping'' on a connection nodes are useful for debugging or
.Dq snooping
on a connection
between two netgraph nodes. between two netgraph nodes.
.Nm Tee .Nm Tee
nodes have four hooks, nodes have four hooks,
@ -113,5 +115,10 @@ control message, or when all hooks have been disconnected.
.Xr tee 1 , .Xr tee 1 ,
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TTY 8 .Dt NG_TTY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tty .Nm ng_tty
.Nd netgraph node type that is also a line discipline .Nd netgraph node type that is also a line discipline
@ -52,7 +52,7 @@ node type is both a netgraph node type and a line discipline.
A new node is created when the corresponding line discipline, A new node is created when the corresponding line discipline,
.Dv NETGRAPHDISC , .Dv NETGRAPHDISC ,
is registered on a tty device (see is registered on a tty device (see
.Xr tty 4 ")." .Xr tty 4 ) .
.Pp .Pp
The node has a single hook called The node has a single hook called
.Dv hook . .Dv hook .
@ -65,7 +65,9 @@ While the line discipline is installed on a tty, the normal
read and write operations are unavailable, returning read and write operations are unavailable, returning
.Er EIO . .Er EIO .
.Pp .Pp
The node supports an optional ``hot character.'' If set to non-zero, incoming The node supports an optional
.Dq hot character .
If set to non-zero, incoming
data from the tty device is queued until this character is seen. data from the tty device is queued until this character is seen.
This avoids sending lots of mbufs containing a small number of bytes, This avoids sending lots of mbufs containing a small number of bytes,
but introduces potentially infinite latency. but introduces potentially infinite latency.
@ -114,11 +116,12 @@ The
control message is not valid, and always returns the error control message is not valid, and always returns the error
.Er EOPNOTSUPP . .Er EOPNOTSUPP .
.Sh BUGS .Sh BUGS
The serial driver code also has a notion of a ``hot character.'' The serial driver code also has a notion of a
.Dq hot character .
Unfortunately, this value is statically defined in terms of the Unfortunately, this value is statically defined in terms of the
line discipline and cannot be changed. line discipline and cannot be changed.
Therefore, if a hot character other than 0x7e (the default) is set for the Therefore, if a hot character other than 0x7e (the default) is set for the
.Nm tty .Nm
node, the node has no way to convey this information to the node, the node has no way to convey this information to the
serial driver, and sub-optimal performance may result. serial driver, and sub-optimal performance may result.
.Sh SEE ALSO .Sh SEE ALSO
@ -127,5 +130,10 @@ serial driver, and sub-optimal performance may result.
.Xr tty 4 , .Xr tty 4 ,
.Xr ng_async 8 , .Xr ng_async 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_VJC 8 .Dt NG_VJC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_vjc .Nm ng_vjc
.Nd Van Jacobsen compression netgraph node type .Nd Van Jacobsen compression netgraph node type
@ -60,10 +60,14 @@ nodes represent the compressed side of the node. Packets received on the
.Dv ip .Dv ip
will be compressed or passed through as appropriate. Packets received will be compressed or passed through as appropriate. Packets received
on the other three hooks will be uncompressed as appropriate. on the other three hooks will be uncompressed as appropriate.
This node also supports ``always pass through'' mode in either direction. This node also supports
.Dq always pass through
mode in either direction.
.Pp .Pp
Van Jacobsen compression only applies to TCP packets. Van Jacobsen compression only applies to TCP packets.
Only ``normal'' (i.e., common case) TCP packets are actually compressed. Only
.Dq normal
(i.e., common case) TCP packets are actually compressed.
These are output on the These are output on the
.Dv vjcomp .Dv vjcomp
hook. Other TCP packets are run through the state machine but not hook. Other TCP packets are run through the state machine but not
@ -138,7 +142,9 @@ and
hooks. hooks.
When a node is first created, When a node is first created,
both compression and decompression are disabled and the node is both compression and decompression are disabled and the node is
therefore operating in bi-directional ``pass through'' mode. therefore operating in bi-directional
.Dq pass through
mode.
.Pp .Pp
When enabling compression, When enabling compression,
.Dv maxChannel .Dv maxChannel
@ -155,7 +161,7 @@ message is immediately sent whenever this occurs.
This command returns the node's current state described by the This command returns the node's current state described by the
.Dv "struct slcompress" .Dv "struct slcompress"
structure, which is defined in structure, which is defined in
.Dv "net/slcompress.h" . .Pa net/slcompress.h .
.It Dv NGM_VJC_CLR_STATS .It Dv NGM_VJC_CLR_STATS
Clears the node statistics counters. Statistics are also cleared whenever the Clears the node statistics counters. Statistics are also cleared whenever the
.Dv enableComp .Dv enableComp
@ -185,9 +191,9 @@ both enabled. This of course resets the node state. This restriction
may be lifted in a later version. may be lifted in a later version.
.Pp .Pp
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/slcompress.c" . .Pa net/slcompress.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/slcompress.c" .Pa net/slcompress.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
@ -206,5 +212,10 @@ However, this may change in the future.
.%T "The PPP Internet Control Protocol (IPCP)" .%T "The PPP Internet Control Protocol (IPCP)"
.%O RFC 1332 .%O RFC 1332
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_UI 8 .Dt NG_UI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_UI .Nm ng_UI
.Nd UI netgraph node type .Nd UI netgraph node type
@ -82,5 +82,10 @@ control message, or when both hooks have been disconnected.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_UI 8 .Dt NG_UI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_UI .Nm ng_UI
.Nd UI netgraph node type .Nd UI netgraph node type
@ -82,5 +82,10 @@ control message, or when both hooks have been disconnected.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ASYNC 8 .Dt NG_ASYNC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_async .Nm ng_async
.Nd asynchronous framing netgraph node type .Nd asynchronous framing netgraph node type
@ -75,7 +75,9 @@ is enabled for that frame (in PPP, LCP packets are always sent with
no address and control field compression and all control characters no address and control field compression and all control characters
escaped). escaped).
.Pp .Pp
This node supports ``flag sharing'' for packets transmitted on This node supports
.Dq flag sharing
for packets transmitted on
.Dv async . .Dv async .
This is an optimization where the trailing flag byte This is an optimization where the trailing flag byte
of one frame is shared with the opening flag byte of the next. of one frame is shared with the opening flag byte of the next.
@ -122,7 +124,9 @@ struct ng_async_cfg {
The The
.Dv enabled .Dv enabled
field enables or disables all encoding/decoding functions (default disabled). field enables or disables all encoding/decoding functions (default disabled).
When disabled, the node operates in simple ``pass through'' mode. When disabled, the node operates in simple
.Dq pass through
mode.
The The
.Dv amru .Dv amru
and and
@ -156,5 +160,10 @@ control message, or when all hooks have been disconnected.
.%T "The Point-to-Point Protocol (PPP)" .%T "The Point-to-Point Protocol (PPP)"
.%O RFC 1661 .%O RFC 1661
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ASYNC 8 .Dt NG_ASYNC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_async .Nm ng_async
.Nd asynchronous framing netgraph node type .Nd asynchronous framing netgraph node type
@ -75,7 +75,9 @@ is enabled for that frame (in PPP, LCP packets are always sent with
no address and control field compression and all control characters no address and control field compression and all control characters
escaped). escaped).
.Pp .Pp
This node supports ``flag sharing'' for packets transmitted on This node supports
.Dq flag sharing
for packets transmitted on
.Dv async . .Dv async .
This is an optimization where the trailing flag byte This is an optimization where the trailing flag byte
of one frame is shared with the opening flag byte of the next. of one frame is shared with the opening flag byte of the next.
@ -122,7 +124,9 @@ struct ng_async_cfg {
The The
.Dv enabled .Dv enabled
field enables or disables all encoding/decoding functions (default disabled). field enables or disables all encoding/decoding functions (default disabled).
When disabled, the node operates in simple ``pass through'' mode. When disabled, the node operates in simple
.Dq pass through
mode.
The The
.Dv amru .Dv amru
and and
@ -156,5 +160,10 @@ control message, or when all hooks have been disconnected.
.%T "The Point-to-Point Protocol (PPP)" .%T "The Point-to-Point Protocol (PPP)"
.%O RFC 1661 .%O RFC 1661
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd December 2, 1999 .Dd December 2, 1999
.Dt NG_BPF 8 .Dt NG_BPF 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_bpf .Nm ng_bpf
.Nd Berkeley packet filter netgraph node type .Nd Berkeley packet filter netgraph node type
@ -48,17 +48,17 @@
The The
.Nm bpf .Nm bpf
node type allows Berkeley Packet Filter (see node type allows Berkeley Packet Filter (see
.Xr bpf 8 ) .Xr bpf 4 )
filters to be applied to data travelling through a Netgraph network. filters to be applied to data travelling through a Netgraph network.
Each node allows an arbitrary number of connections to arbitrarily Each node allows an arbitrary number of connections to arbitrarily
named hooks. With each hook is associated a named hooks. With each hook is associated a
.Xf bpf 8 .Xf bpf 4
filter program which is applied to incoming data only, a destination hook filter program which is applied to incoming data only, a destination hook
for matching packets, a destination hook for non-matching packets, for matching packets, a destination hook for non-matching packets,
and various statistics counters. and various statistics counters.
.Pp .Pp
A A
.Xr bpf 8 .Xr bpf 4
program returns an unsigned integer, which is normally interpreted as 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 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 node type, returning zero is considered a non-match, in which case the
@ -102,21 +102,27 @@ Matching and non-matching incoming packets are delivered out the hooks named
and and
.Dv ifNotMatch , .Dv ifNotMatch ,
respectively. The program must be a valid respectively. The program must be a valid
.Xr bpf 8 .Xr bpf 4
program or else program or else
.Er EINVAL .Er EINVAL
is returned. is returned.
.It Dv NGM_BPF_GET_FILTER .It Dv NGM_BPF_GET_FILTER
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
corresponding corresponding
.Dv "struct ngm_bpf_hookprog" .Dv "struct ngm_bpf_hookprog"
as shown above. as shown above.
.It Dv NGM_BPF_GET_STATS .It Dv NGM_BPF_GET_STATS
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
statistics associated with the hook as a statistics associated with the hook as a
.Dv "struct ng_bpf_hookstat" . .Dv "struct ng_bpf_hookstat" .
.It Dv NGM_BPF_CLR_STATS .It Dv NGM_BPF_CLR_STATS
This command takes an ASCII string argument, the hook name, and clears the This command takes an
.Tn ASCII
string argument, the hook name, and clears the
statistics associated with the hook. statistics associated with the hook.
.It Dv NGM_BPF_GETCLR_STATS .It Dv NGM_BPF_GETCLR_STATS
This command is identical to This command is identical to
@ -129,15 +135,20 @@ This node shuts down upon receipt of a
control message, or when all hooks have been disconnected. control message, or when all hooks have been disconnected.
.Sh BUGS .Sh BUGS
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/bpf_filter.c" . .Pa net/bpf_filter.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/bpf_filter.c" .Pa net/bpf_filter.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh AUTHORS
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd December 2, 1999 .Dd December 2, 1999
.Dt NG_BPF 8 .Dt NG_BPF 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_bpf .Nm ng_bpf
.Nd Berkeley packet filter netgraph node type .Nd Berkeley packet filter netgraph node type
@ -48,17 +48,17 @@
The The
.Nm bpf .Nm bpf
node type allows Berkeley Packet Filter (see node type allows Berkeley Packet Filter (see
.Xr bpf 8 ) .Xr bpf 4 )
filters to be applied to data travelling through a Netgraph network. filters to be applied to data travelling through a Netgraph network.
Each node allows an arbitrary number of connections to arbitrarily Each node allows an arbitrary number of connections to arbitrarily
named hooks. With each hook is associated a named hooks. With each hook is associated a
.Xf bpf 8 .Xf bpf 4
filter program which is applied to incoming data only, a destination hook filter program which is applied to incoming data only, a destination hook
for matching packets, a destination hook for non-matching packets, for matching packets, a destination hook for non-matching packets,
and various statistics counters. and various statistics counters.
.Pp .Pp
A A
.Xr bpf 8 .Xr bpf 4
program returns an unsigned integer, which is normally interpreted as 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 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 node type, returning zero is considered a non-match, in which case the
@ -102,21 +102,27 @@ Matching and non-matching incoming packets are delivered out the hooks named
and and
.Dv ifNotMatch , .Dv ifNotMatch ,
respectively. The program must be a valid respectively. The program must be a valid
.Xr bpf 8 .Xr bpf 4
program or else program or else
.Er EINVAL .Er EINVAL
is returned. is returned.
.It Dv NGM_BPF_GET_FILTER .It Dv NGM_BPF_GET_FILTER
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
corresponding corresponding
.Dv "struct ngm_bpf_hookprog" .Dv "struct ngm_bpf_hookprog"
as shown above. as shown above.
.It Dv NGM_BPF_GET_STATS .It Dv NGM_BPF_GET_STATS
This command takes an ASCII string argument, the hook name, and returns the This command takes an
.Tn ASCII
string argument, the hook name, and returns the
statistics associated with the hook as a statistics associated with the hook as a
.Dv "struct ng_bpf_hookstat" . .Dv "struct ng_bpf_hookstat" .
.It Dv NGM_BPF_CLR_STATS .It Dv NGM_BPF_CLR_STATS
This command takes an ASCII string argument, the hook name, and clears the This command takes an
.Tn ASCII
string argument, the hook name, and clears the
statistics associated with the hook. statistics associated with the hook.
.It Dv NGM_BPF_GETCLR_STATS .It Dv NGM_BPF_GETCLR_STATS
This command is identical to This command is identical to
@ -129,15 +135,20 @@ This node shuts down upon receipt of a
control message, or when all hooks have been disconnected. control message, or when all hooks have been disconnected.
.Sh BUGS .Sh BUGS
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/bpf_filter.c" . .Pa net/bpf_filter.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/bpf_filter.c" .Pa net/bpf_filter.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh AUTHORS
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_CISCO 8 .Dt NG_CISCO 8
.Os FreeBSD 3 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_cisco .Nm ng_cisco
.Nd Cisco HDLC protocol netgraph node type .Nd Cisco HDLC protocol netgraph node type
@ -52,7 +52,10 @@ using the Cisco HDLC protocol. This is a fairly simple
protocol for the transmission of packets across protocol for the transmission of packets across
high speed synchronous lines. Each packet is prepended with high speed synchronous lines. Each packet is prepended with
an Ethertype, indicating the protocol. There is also a an Ethertype, indicating the protocol. There is also a
``keep alive'' and an ``inquire'' capability. .Dq keep alive
and an
.Dq inquire
capability.
.Pp .Pp
The The
.Dv downstream .Dv downstream
@ -70,7 +73,9 @@ type node.
.Sh IP Configuration .Sh IP Configuration
In order to function properly for IP traffic, the node must be informed In order to function properly for IP traffic, the node must be informed
of the local IP address and netmask setting. This is because the protocol of the local IP address and netmask setting. This is because the protocol
includes an ``inquire'' packet which we must be prepared to answer. includes an
.Dq inquire
packet which we must be prepared to answer.
There are two ways to accomplish this, manually and automatically. There are two ways to accomplish this, manually and automatically.
.Pp .Pp
Whenever such an inquire packet is received, the node sends a Whenever such an inquire packet is received, the node sends a
@ -154,7 +159,13 @@ and netmask.
.%O RFC 1547 .%O RFC 1547
.Re .Re
.Sh LEGAL .Sh LEGAL
Cisco is a trademark of Cisco Systems, Inc. .Tn Cisco
is a trademark of Cisco Systems, Inc.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS .Sh AUTHORS
Julian Elischer <julian@whistle.com>, .An Julian Elischer Aq julian@whistle.com ,
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_CISCO 8 .Dt NG_CISCO 8
.Os FreeBSD 3 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_cisco .Nm ng_cisco
.Nd Cisco HDLC protocol netgraph node type .Nd Cisco HDLC protocol netgraph node type
@ -52,7 +52,10 @@ using the Cisco HDLC protocol. This is a fairly simple
protocol for the transmission of packets across protocol for the transmission of packets across
high speed synchronous lines. Each packet is prepended with high speed synchronous lines. Each packet is prepended with
an Ethertype, indicating the protocol. There is also a an Ethertype, indicating the protocol. There is also a
``keep alive'' and an ``inquire'' capability. .Dq keep alive
and an
.Dq inquire
capability.
.Pp .Pp
The The
.Dv downstream .Dv downstream
@ -70,7 +73,9 @@ type node.
.Sh IP Configuration .Sh IP Configuration
In order to function properly for IP traffic, the node must be informed In order to function properly for IP traffic, the node must be informed
of the local IP address and netmask setting. This is because the protocol of the local IP address and netmask setting. This is because the protocol
includes an ``inquire'' packet which we must be prepared to answer. includes an
.Dq inquire
packet which we must be prepared to answer.
There are two ways to accomplish this, manually and automatically. There are two ways to accomplish this, manually and automatically.
.Pp .Pp
Whenever such an inquire packet is received, the node sends a Whenever such an inquire packet is received, the node sends a
@ -154,7 +159,13 @@ and netmask.
.%O RFC 1547 .%O RFC 1547
.Re .Re
.Sh LEGAL .Sh LEGAL
Cisco is a trademark of Cisco Systems, Inc. .Tn Cisco
is a trademark of Cisco Systems, Inc.
.Sh HISTORY
The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS .Sh AUTHORS
Julian Elischer <julian@whistle.com>, .An Julian Elischer Aq julian@whistle.com ,
Archie Cobbs <archie@whistle.com> .An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ECHO 8 .Dt NG_ECHO 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_echo .Nm ng_echo
.Nd netgraph echo node type .Nd netgraph echo node type
@ -49,8 +49,9 @@ The
node type reflects all data and control messages back to the sender. node type reflects all data and control messages back to the sender.
This node type is used for testing and debugging. This node type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Echo A
nodes accept any request to connect, regardless of the hook name, .Nm echo
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_hole 8 , .Xr ng_hole 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_ECHO 8 .Dt NG_ECHO 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_echo .Nm ng_echo
.Nd netgraph echo node type .Nd netgraph echo node type
@ -49,8 +49,9 @@ The
node type reflects all data and control messages back to the sender. node type reflects all data and control messages back to the sender.
This node type is used for testing and debugging. This node type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Echo A
nodes accept any request to connect, regardless of the hook name, .Nm echo
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_hole 8 , .Xr ng_hole 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_FRAME_RELAY 8 .Dt NG_FRAME_RELAY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_frame_relay .Nm ng_frame_relay
.Nd Frame relay netgraph node type .Nd frame relay netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_frame_relay.h> .Fd #include <netgraph/ng_frame_relay.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -80,7 +80,7 @@ control message, or when all hooks have been disconnected.
Technically, frames on DLCI X should not be transmitted to the switch Technically, frames on DLCI X should not be transmitted to the switch
until the LMI protocol entity on both ends has configured DLCI X as active. until the LMI protocol entity on both ends has configured DLCI X as active.
The The
.Nm frame_relay .Nm
node type ignores this restriction, and will always pass data received node type ignores this restriction, and will always pass data received
on a DLCI hook to on a DLCI hook to
.Dv downstream . .Dv downstream .
@ -89,5 +89,10 @@ Instead, it should query the LMI node first.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_lmi 8 , .Xr ng_lmi 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_FRAME_RELAY 8 .Dt NG_FRAME_RELAY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_frame_relay .Nm ng_frame_relay
.Nd Frame relay netgraph node type .Nd frame relay netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_frame_relay.h> .Fd #include <netgraph/ng_frame_relay.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -80,7 +80,7 @@ control message, or when all hooks have been disconnected.
Technically, frames on DLCI X should not be transmitted to the switch Technically, frames on DLCI X should not be transmitted to the switch
until the LMI protocol entity on both ends has configured DLCI X as active. until the LMI protocol entity on both ends has configured DLCI X as active.
The The
.Nm frame_relay .Nm
node type ignores this restriction, and will always pass data received node type ignores this restriction, and will always pass data received
on a DLCI hook to on a DLCI hook to
.Dv downstream . .Dv downstream .
@ -89,5 +89,10 @@ Instead, it should query the LMI node first.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_lmi 8 , .Xr ng_lmi 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_HOLE 8 .Dt NG_HOLE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_hole .Nm ng_hole
.Nd netgraph discard node type .Nd netgraph discard node type
@ -49,8 +49,9 @@ The
node type silently discards all data and control messages it receives. node type silently discards all data and control messages it receives.
This type is used for testing and debugging. This type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Hole A
nodes accept any request to connect, regardless of the hook name, .Nm
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_echo 8 , .Xr ng_echo 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_HOLE 8 .Dt NG_HOLE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_hole .Nm ng_hole
.Nd netgraph discard node type .Nd netgraph discard node type
@ -49,8 +49,9 @@ The
node type silently discards all data and control messages it receives. node type silently discards all data and control messages it receives.
This type is used for testing and debugging. This type is used for testing and debugging.
.Sh HOOKS .Sh HOOKS
.Nm Hole A
nodes accept any request to connect, regardless of the hook name, .Nm
node accepts any request to connect, regardless of the hook name,
as long as the name is unique. as long as the name is unique.
.Sh CONTROL MESSAGES .Sh CONTROL MESSAGES
This node type supports only the generic control messages. This node type supports only the generic control messages.
@ -63,5 +64,10 @@ control message, or when all hooks have been disconnected.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_echo 8 , .Xr ng_echo 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_IFACE 8 .Dt NG_IFACE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_iface .Nm ng_iface
.Nd interface netgraph node type .Nd interface netgraph node type
@ -47,7 +47,7 @@
An An
.Nm iface .Nm iface
node is both a netgraph node and a system networking interface. When an node is both a netgraph node and a system networking interface. When an
.Nm iface .Nm
node is created, a new point-to-point interface appears which is accessible via node is created, a new point-to-point interface appears which is accessible via
.Xr ifconfig 8 . .Xr ifconfig 8 .
The new interfaces are named The new interfaces are named
@ -56,8 +56,9 @@ The new interfaces are named
etc. The node is assigned the same name as its interface, unless the name etc. The node is assigned the same name as its interface, unless the name
already exists, in which case the node remains unnamed. already exists, in which case the node remains unnamed.
.Pp .Pp
.Nm Iface An
nodes have a single hook corresponding to each supported protocol. .Nm
node has a single hook corresponding to each supported protocol.
Packets transmitted via the interface flow out the corresponding Packets transmitted via the interface flow out the corresponding
protocol-specific hook. protocol-specific hook.
Similarly, packets received on a hook appear on the interface as Similarly, packets received on a hook appear on the interface as
@ -66,8 +67,9 @@ packets received in the corresponding protocol.
The currently supported protocols are IP, IPX, AppleTalk, and NS. The currently supported protocols are IP, IPX, AppleTalk, and NS.
In the KLD module, only support for IP is compiled in by default. In the KLD module, only support for IP is compiled in by default.
.Pp .Pp
.Nm Iface An
nodes support the Berkeley Packet Filter (BPF). .Nm
node supports the Berkeley Packet Filter (BPF).
.Sh HOOKS .Sh HOOKS
This node type supports the following hooks: This node type supports the following hooks:
.Pp .Pp
@ -96,7 +98,7 @@ struct ng_iface_ifname {
Returns the list of addresses associated with this interface. Returns the list of addresses associated with this interface.
The list is returned in the same format as the The list is returned in the same format as the
.Dv SIOCGIFCONF .Dv SIOCGIFCONF
ioctl(). .Fn ioctl .
.It Dv NGM_CISCO_GET_IPADDR .It Dv NGM_CISCO_GET_IPADDR
This message is defined by the This message is defined by the
.Xr ng_cisco 8 .Xr ng_cisco 8
@ -106,8 +108,9 @@ for a description.
.El .El
.Sh SHUTDOWN .Sh SHUTDOWN
Because it is currently not possible to remove a system networking Because it is currently not possible to remove a system networking
interface in FreeBSD, interface in
.Nm iface .Fx ,
.Nm
nodes are nodes are
.Em persistent. .Em persistent.
That is, once created they are never destroyed. That is, once created they are never destroyed.
@ -115,12 +118,17 @@ The receipt of a
.Dv NGM_SHUTDOWN .Dv NGM_SHUTDOWN
control message disconnects all hooks but does not remove the node. control message disconnects all hooks but does not remove the node.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr netgraph 4 ,
.Xr ifconfig 8 ,
.Xr ng_cisco 8 , .Xr ng_cisco 8 ,
.Xr ng_ppp 8 , .Xr ng_ppp 8 ,
.Xr ng_rfc1490 8 , .Xr ng_rfc1490 8 ,
.Xr ngctl 8 , .Xr ngctl 8 .
.Xr ifconfig 8 . .Sh HISTORY
.Sh AUTHOR The
Archie Cobbs <archie@whistle.com> .Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_IFACE 8 .Dt NG_IFACE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_iface .Nm ng_iface
.Nd interface netgraph node type .Nd interface netgraph node type
@ -47,7 +47,7 @@
An An
.Nm iface .Nm iface
node is both a netgraph node and a system networking interface. When an node is both a netgraph node and a system networking interface. When an
.Nm iface .Nm
node is created, a new point-to-point interface appears which is accessible via node is created, a new point-to-point interface appears which is accessible via
.Xr ifconfig 8 . .Xr ifconfig 8 .
The new interfaces are named The new interfaces are named
@ -56,8 +56,9 @@ The new interfaces are named
etc. The node is assigned the same name as its interface, unless the name etc. The node is assigned the same name as its interface, unless the name
already exists, in which case the node remains unnamed. already exists, in which case the node remains unnamed.
.Pp .Pp
.Nm Iface An
nodes have a single hook corresponding to each supported protocol. .Nm
node has a single hook corresponding to each supported protocol.
Packets transmitted via the interface flow out the corresponding Packets transmitted via the interface flow out the corresponding
protocol-specific hook. protocol-specific hook.
Similarly, packets received on a hook appear on the interface as Similarly, packets received on a hook appear on the interface as
@ -66,8 +67,9 @@ packets received in the corresponding protocol.
The currently supported protocols are IP, IPX, AppleTalk, and NS. The currently supported protocols are IP, IPX, AppleTalk, and NS.
In the KLD module, only support for IP is compiled in by default. In the KLD module, only support for IP is compiled in by default.
.Pp .Pp
.Nm Iface An
nodes support the Berkeley Packet Filter (BPF). .Nm
node supports the Berkeley Packet Filter (BPF).
.Sh HOOKS .Sh HOOKS
This node type supports the following hooks: This node type supports the following hooks:
.Pp .Pp
@ -96,7 +98,7 @@ struct ng_iface_ifname {
Returns the list of addresses associated with this interface. Returns the list of addresses associated with this interface.
The list is returned in the same format as the The list is returned in the same format as the
.Dv SIOCGIFCONF .Dv SIOCGIFCONF
ioctl(). .Fn ioctl .
.It Dv NGM_CISCO_GET_IPADDR .It Dv NGM_CISCO_GET_IPADDR
This message is defined by the This message is defined by the
.Xr ng_cisco 8 .Xr ng_cisco 8
@ -106,8 +108,9 @@ for a description.
.El .El
.Sh SHUTDOWN .Sh SHUTDOWN
Because it is currently not possible to remove a system networking Because it is currently not possible to remove a system networking
interface in FreeBSD, interface in
.Nm iface .Fx ,
.Nm
nodes are nodes are
.Em persistent. .Em persistent.
That is, once created they are never destroyed. That is, once created they are never destroyed.
@ -115,12 +118,17 @@ The receipt of a
.Dv NGM_SHUTDOWN .Dv NGM_SHUTDOWN
control message disconnects all hooks but does not remove the node. control message disconnects all hooks but does not remove the node.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 4 ,
.Xr bpf 4 , .Xr bpf 4 ,
.Xr netgraph 4 ,
.Xr ifconfig 8 ,
.Xr ng_cisco 8 , .Xr ng_cisco 8 ,
.Xr ng_ppp 8 , .Xr ng_ppp 8 ,
.Xr ng_rfc1490 8 , .Xr ng_rfc1490 8 ,
.Xr ngctl 8 , .Xr ngctl 8 .
.Xr ifconfig 8 . .Sh HISTORY
.Sh AUTHOR The
Archie Cobbs <archie@whistle.com> .Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -46,21 +46,21 @@
A A
.Nm ksocket .Nm ksocket
node is both a netgraph node and a BSD socket. The node is both a netgraph node and a BSD socket. The
.Nm ksocket .Nm
node type allows one to open a socket inside the kernel and have node type allows one to open a socket inside the kernel and have
it appear as a Netgraph node. The it appear as a Netgraph node. The
.Nm ksocket .Nm
node type is the reverse of the socket node type (see node type is the reverse of the socket node type (see
.Xr ng_socket 8 "):" .Xr ng_socket 8 ) :
whereas the socket node type enables the user-level manipulation (via whereas the socket node type enables the user-level manipulation (via
a socket) of what is normally a kernel-level entity (the associated a socket) of what is normally a kernel-level entity (the associated
Netgraph node), the Netgraph node), the
.Nm ksocket .Nm
node type enables the kernel-level manipulation (via a Netgraph node) of node type enables the kernel-level manipulation (via a Netgraph node) of
what is normally a user-level entity (the associated socket). what is normally a user-level entity (the associated socket).
.Pp .Pp
A A
.Nm ksocket .Nm
node allows at most one hook connection. Connecting to the node is node allows at most one hook connection. Connecting to the node is
equivalent to opening the associated socket. The name given to the hook equivalent to opening the associated socket. The name given to the hook
determines what kind of socket the node will open (see below). determines what kind of socket the node will open (see below).
@ -136,7 +136,9 @@ retrieved value.
.Sh ASCII FORM CONTROL MESSAGES .Sh ASCII FORM CONTROL MESSAGES
For control messages that pass a For control messages that pass a
.Dv "struct sockaddr" .Dv "struct sockaddr"
in the argument field, the normal ASCII equivalent of the C structure in the argument field, the normal
.Tn ASCII
equivalent of the C structure
is an acceptable form. For the is an acceptable form. For the
.Dv PF_INET .Dv PF_INET
and and
@ -162,7 +164,9 @@ local/"/tmp/foo.socket"
.Pp .Pp
For control messages that pass a For control messages that pass a
.Dv "struct ng_ksocket_sockopt" , .Dv "struct ng_ksocket_sockopt" ,
the normal ASCII form for that structure is used. In the future, more the normal
.Tn ASCII
form for that structure is used. In the future, more
convenient encoding of the more common socket options may be supported. convenient encoding of the more common socket options may be supported.
.Sh SHUTDOWN .Sh SHUTDOWN
This node shuts down upon receipt of a This node shuts down upon receipt of a
@ -174,5 +178,10 @@ Shutdown of the node closes the associated socket.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_socket 8 , .Xr ng_socket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -46,21 +46,21 @@
A A
.Nm ksocket .Nm ksocket
node is both a netgraph node and a BSD socket. The node is both a netgraph node and a BSD socket. The
.Nm ksocket .Nm
node type allows one to open a socket inside the kernel and have node type allows one to open a socket inside the kernel and have
it appear as a Netgraph node. The it appear as a Netgraph node. The
.Nm ksocket .Nm
node type is the reverse of the socket node type (see node type is the reverse of the socket node type (see
.Xr ng_socket 8 "):" .Xr ng_socket 8 ) :
whereas the socket node type enables the user-level manipulation (via whereas the socket node type enables the user-level manipulation (via
a socket) of what is normally a kernel-level entity (the associated a socket) of what is normally a kernel-level entity (the associated
Netgraph node), the Netgraph node), the
.Nm ksocket .Nm
node type enables the kernel-level manipulation (via a Netgraph node) of node type enables the kernel-level manipulation (via a Netgraph node) of
what is normally a user-level entity (the associated socket). what is normally a user-level entity (the associated socket).
.Pp .Pp
A A
.Nm ksocket .Nm
node allows at most one hook connection. Connecting to the node is node allows at most one hook connection. Connecting to the node is
equivalent to opening the associated socket. The name given to the hook equivalent to opening the associated socket. The name given to the hook
determines what kind of socket the node will open (see below). determines what kind of socket the node will open (see below).
@ -136,7 +136,9 @@ retrieved value.
.Sh ASCII FORM CONTROL MESSAGES .Sh ASCII FORM CONTROL MESSAGES
For control messages that pass a For control messages that pass a
.Dv "struct sockaddr" .Dv "struct sockaddr"
in the argument field, the normal ASCII equivalent of the C structure in the argument field, the normal
.Tn ASCII
equivalent of the C structure
is an acceptable form. For the is an acceptable form. For the
.Dv PF_INET .Dv PF_INET
and and
@ -162,7 +164,9 @@ local/"/tmp/foo.socket"
.Pp .Pp
For control messages that pass a For control messages that pass a
.Dv "struct ng_ksocket_sockopt" , .Dv "struct ng_ksocket_sockopt" ,
the normal ASCII form for that structure is used. In the future, more the normal
.Tn ASCII
form for that structure is used. In the future, more
convenient encoding of the more common socket options may be supported. convenient encoding of the more common socket options may be supported.
.Sh SHUTDOWN .Sh SHUTDOWN
This node shuts down upon receipt of a This node shuts down upon receipt of a
@ -174,5 +178,10 @@ Shutdown of the node closes the associated socket.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_socket 8 , .Xr ng_socket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_LMI 8 .Dt NG_LMI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_lmi .Nm ng_lmi
.Nd Frame relay LMI protocol netgraph node type .Nd frame relay LMI protocol netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_lmi.h> .Fd #include <netgraph/ng_lmi.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -126,5 +126,10 @@ control message, or when all hooks have been disconnected.
.Rs .Rs
.%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A" .%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A"
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,10 +37,10 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_LMI 8 .Dt NG_LMI 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_lmi .Nm ng_lmi
.Nd Frame relay LMI protocol netgraph node type .Nd frame relay LMI protocol netgraph node type
.Sh SYNOPSIS .Sh SYNOPSIS
.Fd #include <netgraph/ng_lmi.h> .Fd #include <netgraph/ng_lmi.h>
.Sh DESCRIPTION .Sh DESCRIPTION
@ -126,5 +126,10 @@ control message, or when all hooks have been disconnected.
.Rs .Rs
.%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A" .%T "ITU-T Q.933 Digital Subscriber Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A"
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -80,25 +80,37 @@ to interact with other nodes in a well defined manner.
Each node has a Each node has a
.Em type , .Em type ,
which is a static property of the node determined at node creation time. which is a static property of the node determined at node creation time.
A node's type is described by a unique ASCII type name. A node's type is described by a unique
.Tn ASCII
type name.
The type implies what the node does and how it may be connected The type implies what the node does and how it may be connected
to other nodes. to other nodes.
.Pp .Pp
In object-oriented language, types are classes and nodes are instances In object-oriented language, types are classes and nodes are instances
of their respective class. All node types are subclasses of the generic node of their respective class. All node types are subclasses of the generic node
type, and hence inherit certain common functionality and capabilities type, and hence inherit certain common functionality and capabilities
(e.g., the ability to have an ASCII name). (e.g., the ability to have an
.Tn ASCII
name).
.Pp .Pp
Nodes may be assigned a globally unique ASCII name which can be Nodes may be assigned a globally unique
.Tn ASCII
name which can be
used to refer to the node. used to refer to the node.
The name must not contain the characters ``.'' or ``:'' and is limited to The name must not contain the characters
.Dq \&.
or
.Dq \&:
and is limited to
.Dv "NG_NODELEN + 1" .Dv "NG_NODELEN + 1"
characters (including NUL byte). characters (including NUL byte).
.Pp .Pp
Each node instance has a unique Each node instance has a unique
.Em ID number .Em ID number
which is expressed as a 32-bit hex value. This value may be used to which is expressed as a 32-bit hex value. This value may be used to
refer to a node when there is no ASCII name assigned to it. refer to a node when there is no
.Tn ASCII
name assigned to it.
.Sh Hooks .Sh Hooks
Nodes are connected to other nodes by connecting a pair of Nodes are connected to other nodes by connecting a pair of
.Em hooks , .Em hooks ,
@ -110,9 +122,15 @@ Hooks have these properties:
.Pp .Pp
.Bl -bullet -compact -offset 2n .Bl -bullet -compact -offset 2n
.It .It
A hook has an ASCII name which is unique among all hooks A hook has an
.Tn ASCII
name which is unique among all hooks
on that node (other hooks on other nodes may have the same name). on that node (other hooks on other nodes may have the same name).
The name must not contain a ``.'' or a ``:'' and is The name must not contain a
.Dq \&.
or a
.Dq \&:
and is
limited to limited to
.Dv "NG_HOOKLEN + 1" .Dv "NG_HOOKLEN + 1"
characters (including NUL byte). characters (including NUL byte).
@ -123,7 +141,9 @@ removing either hook destroys both hooks.
.El .El
.Pp .Pp
A node may decide to assign special meaning to some hooks. A node may decide to assign special meaning to some hooks.
For example, connecting to the hook named ``debug'' might trigger For example, connecting to the hook named
.Dq debug
might trigger
the node to start sending debugging information to that hook. the node to start sending debugging information to that hook.
.Sh Data Flow .Sh Data Flow
Two types of information flow between nodes: data messages and Two types of information flow between nodes: data messages and
@ -137,7 +157,8 @@ directly to some arbitrary other node. Control messages have a common
header format, followed by type-specific data, and are binary structures header format, followed by type-specific data, and are binary structures
for efficiency. However, node types also may support conversion of the for efficiency. However, node types also may support conversion of the
type specific data between binary and type specific data between binary and
ASCII for debugging and human interface purposes (see the .Tn ASCII
for debugging and human interface purposes (see the
.Dv NGM_ASCII2BINARY .Dv NGM_ASCII2BINARY
and and
.Dv NGM_BINARY2ASCII .Dv NGM_BINARY2ASCII
@ -146,9 +167,13 @@ these conversions.
.Pp .Pp
There are two ways to address a control message. If There are two ways to address a control message. If
there is a sequence of edges connecting the two nodes, the message there is a sequence of edges connecting the two nodes, the message
may be ``source routed'' by specifying the corresponding sequence may be
.Dq source routed
by specifying the corresponding sequence
of hooks as the destination address for the message (relative of hooks as the destination address for the message (relative
addressing). Otherwise, the recipient node global ASCII name addressing). Otherwise, the recipient node global
.Tn ASCII
name
(or equivalent ID based name) is used as the destination address (or equivalent ID based name) is used as the destination address
for the message (absolute addressing). The two types of addressing for the message (absolute addressing). The two types of addressing
may be combined, by specifying an absolute start node and a sequence may be combined, by specifying an absolute start node and a sequence
@ -156,7 +181,9 @@ of hooks.
.Pp .Pp
Messages often represent commands that are followed by a reply message Messages often represent commands that are followed by a reply message
in the reverse direction. To facilitate this, the recipient of a in the reverse direction. To facilitate this, the recipient of a
control message is supplied with a ``return address'' that is suitable control message is supplied with a
.Dq return address
that is suitable
for addressing a reply. for addressing a reply.
.Pp .Pp
Each control message contains a 32 bit value called a Each control message contains a 32 bit value called a
@ -167,7 +194,7 @@ that it understands. However, a node may choose to recognize and
implement more than one type of message. implement more than one type of message.
.Sh Netgraph is Functional .Sh Netgraph is Functional
In order to minimize latency, most In order to minimize latency, most
.Nm netgraph .Nm
operations are functional. operations are functional.
That is, data and control messages are delivered by making function That is, data and control messages are delivered by making function
calls rather than by using queues and mailboxes. For example, if node calls rather than by using queues and mailboxes. For example, if node
@ -175,7 +202,9 @@ A wishes to send a data mbuf to neighboring node B, it calls the
generic generic
.Nm .Nm
data delivery function. This function in turn locates data delivery function. This function in turn locates
node B and calls B's ``receive data'' method. While this mode of operation node B and calls B's
.Dq receive data
method. While this mode of operation
results in good performance, it has a few implications for node results in good performance, it has a few implications for node
developers: developers:
.Pp .Pp
@ -186,13 +215,13 @@ may need to allow for the possibility of receiving a returning message
before the original delivery function call returns. before the original delivery function call returns.
.It .It
Netgraph nodes and support routines generally run at Netgraph nodes and support routines generally run at
.Dv "splnet()" . .Fn splnet .
However, some nodes may want to send data and control messages However, some nodes may want to send data and control messages
from a different priority level. Netgraph supplies queueing routines which from a different priority level. Netgraph supplies queueing routines which
utilize the NETISR system to move message delivery to utilize the NETISR system to move message delivery to
.Dv "splnet()" . .Fn splnet .
Note that messages are always received at Note that messages are always received at
.Dv "splnet()" . .Fn splnet .
.It .It
It's possible for an infinite loop to occur if the graph contains cycles. It's possible for an infinite loop to occur if the graph contains cycles.
.El .El
@ -215,7 +244,7 @@ which is both a netgraph node and a
BSD socket in the protocol family BSD socket in the protocol family
.Dv PF_NETGRAPH . .Dv PF_NETGRAPH .
Socket nodes allow user processes to participate in Socket nodes allow user processes to participate in
.Nm netgraph . .Nm Ns .
Other nodes communicate with socket nodes using the usual methods, and the Other nodes communicate with socket nodes using the usual methods, and the
node hides the fact that it is also passing information to and from a node hides the fact that it is also passing information to and from a
cooperating user process. cooperating user process.
@ -225,7 +254,7 @@ a node interface to the hardware.
.Sh Node Methods .Sh Node Methods
Nodes are notified of the following actions via function calls Nodes are notified of the following actions via function calls
to the following node methods (all at to the following node methods (all at
.Dv "splnet()" ) .Fn splnet )
and may accept or reject that action (by returning the appropriate and may accept or reject that action (by returning the appropriate
error code): error code):
.Bl -tag -width xxx .Bl -tag -width xxx
@ -235,7 +264,9 @@ allowed, the constructor must call the generic node creation
function (in object-oriented terms, the superclass constructor) function (in object-oriented terms, the superclass constructor)
and then allocate any special resources it needs. For nodes that and then allocate any special resources it needs. For nodes that
correspond to hardware, this is typically done during the device correspond to hardware, this is typically done during the device
attach routine. Often a global ASCII name corresponding to the attach routine. Often a global
.Tn ASCII
name corresponding to the
device name is assigned here as well. device name is assigned here as well.
.It Creation of a new hook .It Creation of a new hook
The hook is created and tentatively The hook is created and tentatively
@ -270,7 +301,7 @@ An mbuf chain is passed to the node.
The node is notified on which hook the data arrived, The node is notified on which hook the data arrived,
and can use this information in its processing decision. and can use this information in its processing decision.
The node must must always The node must must always
.Dv m_freem() .Fn m_freem
the mbuf chain on completion or error, or pass it on to another node the mbuf chain on completion or error, or pass it on to another node
(or kernel module) which will then be responsible for freeing it. (or kernel module) which will then be responsible for freeing it.
.Pp .Pp
@ -280,13 +311,13 @@ structure describing meta-data about the message
.Dv NULL .Dv NULL
if there is no additional information. The format for this information is if there is no additional information. The format for this information is
described in described in
.Dv netgraph.h . .Pa netgraph.h .
The memory for meta-data must allocated via The memory for meta-data must allocated via
.Dv malloc() .Fn malloc
with type with type
.Dv M_NETGRAPH . .Dv M_NETGRAPH .
As with the data itself, it is the receiver's responsibility to As with the data itself, it is the receiver's responsibility to
.Dv free() .Fn free
the meta-data. If the mbuf chain is freed the meta-data must the meta-data. If the mbuf chain is freed the meta-data must
be freed at the same time. If the meta-data is freed but the be freed at the same time. If the meta-data is freed but the
real data on is passed on, then a real data on is passed on, then a
@ -324,14 +355,14 @@ to point to the reply.
Then when the control message delivery function returns, Then when the control message delivery function returns,
the caller can check if this pointer has been made non-NULL, the caller can check if this pointer has been made non-NULL,
and if so then it points to the reply message allocated via and if so then it points to the reply message allocated via
.Dv malloc() .Fn malloc
and containing the synchronous response. In both directions, and containing the synchronous response. In both directions,
(request and response) it is up to the (request and response) it is up to the
receiver of that message to receiver of that message to
.Dv free() .Fn free
the control message buffer. All control messages and replies are the control message buffer. All control messages and replies are
allocated with allocated with
.Dv malloc() .Fn malloc
type type
.Dv M_NETGRAPH . .Dv M_NETGRAPH .
.El .El
@ -339,7 +370,9 @@ type
Much use has been made of reference counts, so that nodes being Much use has been made of reference counts, so that nodes being
free'd of all references are automatically freed, and this behaviour free'd of all references are automatically freed, and this behaviour
has been tested and debugged to present a consistent and trustworthy has been tested and debugged to present a consistent and trustworthy
framework for the ``type module'' writer to use. framework for the
.Dq type module
writer to use.
.Sh Addressing .Sh Addressing
The The
.Nm .Nm
@ -358,7 +391,11 @@ A relative address includes only the sequence of hook names, implicitly
starting hook traversal at the local node. starting hook traversal at the local node.
.Pp .Pp
There are a couple of special possibilities for the node name. There are a couple of special possibilities for the node name.
The name ``.'' (referred to as ``.:'') always refers to the local node. The name
.Dq \&.
(referred to as
.Dq \&.: )
always refers to the local node.
Also, nodes that have no global name may be addressed by their ID numbers, Also, nodes that have no global name may be addressed by their ID numbers,
by enclosing the hex representation of the ID number within square brackets. by enclosing the hex representation of the ID number within square brackets.
Here are some examples of valid netgraph addresses: Here are some examples of valid netgraph addresses:
@ -560,19 +597,22 @@ be changed.
The de facto method for generating unique type cookies is to take the The de facto method for generating unique type cookies is to take the
seconds from the epoch at the time the header file is written seconds from the epoch at the time the header file is written
(i.e., the output of (i.e., the output of
.Dv "date -u +'%s'" ")." .Dv "date -u +'%s'" ) .
.Pp .Pp
There is a predefined typecookie There is a predefined typecookie
.Dv NGM_GENERIC_COOKIE .Dv NGM_GENERIC_COOKIE
for the ``generic'' node type, and for the
.Dq generic
node type, and
a corresponding set of generic messages which all nodes understand. a corresponding set of generic messages which all nodes understand.
The handling of these messages is automatic. The handling of these messages is automatic.
.It Dv command .It Dv command
The identifier for the message command. This is type specific, The identifier for the message command. This is type specific,
and is defined in the same header file as the typecookie. and is defined in the same header file as the typecookie.
.It Dv cmdstr .It Dv cmdstr
Room for a short human readable version of ``command'' (for debugging Room for a short human readable version of
purposes only). .Dq command
(for debugging purposes only).
.El .El
.Pp .Pp
Some modules may choose to implement messages from more than one Some modules may choose to implement messages from more than one
@ -580,25 +620,34 @@ of the header files and thus recognize more than one type cookie.
.Sh Control Message ASCII Form .Sh Control Message ASCII Form
Control messages are in binary format for efficiency. However, for Control messages are in binary format for efficiency. However, for
debugging and human interface purposes, and if the node type supports debugging and human interface purposes, and if the node type supports
it, control messages may be converted to and from an equivalent ASCII it, control messages may be converted to and from an equivalent
form. The ASCII form is similar to the binary form, with two exceptions: .Tn ASCII
form. The
.Tn ASCII
form is similar to the binary form, with two exceptions:
.Pp .Pp
.Bl -tag -compact -width xxx .Bl -tag -compact -width xxx
.It o .It o
The The
.Dv cmdstr .Dv cmdstr
header field must contain the ASCII name of the command, corresponding to the header field must contain the
.Tn ASCII
name of the command, corresponding to the
.Dv cmd .Dv cmd
header field. header field.
.It o .It o
The The
.Dv args .Dv args
field contains a NUL-terminated ASCII string version of the message arguments. field contains a NUL-terminated
.Tn ASCII
string version of the message arguments.
.El .El
.Pp .Pp
In general, the arguments field of a control messgage can be any In general, the arguments field of a control messgage can be any
arbitrary C data type. Netgraph includes parsing routines to support arbitrary C data type. Netgraph includes parsing routines to support
some pre-defined datatypes in ASCII with this simple syntax: some pre-defined datatypes in
.Tn ASCII
with this simple syntax:
.Pp .Pp
.Bl -tag -compact -width xxx .Bl -tag -compact -width xxx
.It o .It o
@ -616,24 +665,28 @@ does not have an explicit index, the index is implicitly the previous
element's index plus one. element's index plus one.
.It o .It o
Structures are enclosed in curly braces, and each field is specified Structures are enclosed in curly braces, and each field is specified
in the form ``fieldname=value''. in the form
.Dq fieldname=value .
.It o .It o
Any array element or structure field whose value is equal to its Any array element or structure field whose value is equal to its
``default value'' may be omitted. For integer types, the default value .Dq default value
may be omitted. For integer types, the default value
is usually zero; for string types, the empty string. is usually zero; for string types, the empty string.
.It o .It o
Array elements and structure fields may be specified in any order. Array elements and structure fields may be specified in any order.
.El .El
.Pp .Pp
Each node type may define its own arbitrary types by providing Each node type may define its own arbitrary types by providing
the necessary routines to parse and unparse. ASCII forms defined the necessary routines to parse and unparse.
.Tn ASCII
forms defined
for a specific node type are documented in the documentation for for a specific node type are documented in the documentation for
that node type. that node type.
.Sh Generic Control Messages .Sh Generic Control Messages
There are a number of standard predefined messages that will work There are a number of standard predefined messages that will work
for any node, as they are supported directly by the framework itself. for any node, as they are supported directly by the framework itself.
These are defined in These are defined in
.Dv ng_message.h .Pa ng_message.h
along with the basic layout of messages and other similar information. along with the basic layout of messages and other similar information.
.Bl -tag -width xxx .Bl -tag -width xxx
.It Dv NGM_CONNECT .It Dv NGM_CONNECT
@ -655,7 +708,9 @@ is the default for nodes created using the
method. Such nodes can only be addressed relatively or by their ID number. method. Such nodes can only be addressed relatively or by their ID number.
.It Dv NGM_RMHOOK .It Dv NGM_RMHOOK
Ask the node to break a hook connection to one of its neighbours. Ask the node to break a hook connection to one of its neighbours.
Both nodes will have their ``disconnect'' method invoked. Both nodes will have their
.Dq disconnect
method invoked.
Either node may elect to totally shut down as a result. Either node may elect to totally shut down as a result.
.It Dv NGM_NODEINFO .It Dv NGM_NODEINFO
Asks the target node to describe itself. The four returned fields Asks the target node to describe itself. The four returned fields
@ -688,12 +743,16 @@ elect to not support this message. The text response must be less than
bytes in length (presently 1024). This can be used to return general bytes in length (presently 1024). This can be used to return general
status information in human readable form. status information in human readable form.
.It Dv NGM_BINARY2ASCII .It Dv NGM_BINARY2ASCII
This message converts a binary control message to its ASCII form. This message converts a binary control message to its
.Tn ASCII
form.
The entire control message to be converted is contained within the The entire control message to be converted is contained within the
arguments field of the arguments field of the
.Dv Dv NGM_BINARY2ASCII .Dv Dv NGM_BINARY2ASCII
message itself. If successful, the reply will contain the same control message itself. If successful, the reply will contain the same control
message in ASCII form. message in
.Tn ASCII
form.
A node will typically only know how to translate messages that it A node will typically only know how to translate messages that it
itself understands, so the target node of the itself understands, so the target node of the
.Dv NGM_BINARY2ASCII .Dv NGM_BINARY2ASCII
@ -701,7 +760,9 @@ is often the same node that would actually receive that message.
.It Dv NGM_ASCII2BINARY .It Dv NGM_ASCII2BINARY
The opposite of The opposite of
.Dv NGM_BINARY2ASCII . .Dv NGM_BINARY2ASCII .
The entire control message to be converted, in ASCII form, is contained The entire control message to be converted, in
.Tn ASCII
form, is contained
in the arguments section of the in the arguments section of the
.Dv NGM_ASCII2BINARY .Dv NGM_ASCII2BINARY
and need only have the and need only have the
@ -765,20 +826,20 @@ node of unknown type
is made, is made,
.Nm .Nm
will attempt to load the KLD module will attempt to load the KLD module
.Dv ng_type.ko . .Pa ng_type.ko .
.Pp .Pp
Types can also be installed at boot time, as certain device drivers Types can also be installed at boot time, as certain device drivers
may want to export each instance of the device as a netgraph node. may want to export each instance of the device as a netgraph node.
.Pp .Pp
In general, new types can be installed at any time from within the In general, new types can be installed at any time from within the
kernel by calling kernel by calling
.Dv ng_newtype() , .Fn ng_newtype ,
supplying a pointer to the type's supplying a pointer to the type's
.Dv struct ng_type .Dv struct ng_type
structure. structure.
.Pp .Pp
The The
.Dv "NETGRAPH_INIT()" .Fn NETGRAPH_INIT
macro automates this process by using a linker set. macro automates this process by using a linker set.
.Sh EXISTING NODE TYPES .Sh EXISTING NODE TYPES
Several node types currently exist. Each is fully documented Several node types currently exist. Each is fully documented
@ -808,8 +869,9 @@ calls, using a
socket address. socket address.
.Pp .Pp
.It HOLE .It HOLE
Responds only to generic messages and is a ``black hole'' for data, Responds only to generic messages and is a
Useful for testing. Always accepts new hooks. .Dq black hole
for data, Useful for testing. Always accepts new hooks.
.Pp .Pp
.It ECHO .It ECHO
Responds only to generic messages and always echoes data back through the Responds only to generic messages and always echoes data back through the
@ -817,7 +879,9 @@ hook from which it arrived. Returns any non generic messages as their
own response. Useful for testing. Always accepts new hooks. own response. Useful for testing. Always accepts new hooks.
.Pp .Pp
.It TEE .It TEE
This node is useful for ``snooping.'' It has 4 hooks: This node is useful for
.Dq snooping .
It has 4 hooks:
.Dv left , .Dv left ,
.Dv right , .Dv right ,
.Dv left2right , .Dv left2right ,
@ -836,24 +900,31 @@ to left.
.Pp .Pp
.It RFC1490 MUX .It RFC1490 MUX
Encapsulates/de-encapsulates frames encoded according to RFC 1490. Encapsulates/de-encapsulates frames encoded according to RFC 1490.
Has a hook for the encapsulated packets (``downstream'') and one hook Has a hook for the encapsulated packets
.Pq Dq downstream
and one hook
for each protocol (i.e., IP, PPP, etc.). for each protocol (i.e., IP, PPP, etc.).
.Pp .Pp
.It FRAME RELAY MUX .It FRAME RELAY MUX
Encapsulates/de-encapsulates Frame Relay frames. Encapsulates/de-encapsulates Frame Relay frames.
Has a hook for the encapsulated packets (``downstream'') and one hook Has a hook for the encapsulated packets
.Pq Dq downstream
and one hook
for each DLCI. for each DLCI.
.Pp .Pp
.It FRAME RELAY LMI .It FRAME RELAY LMI
Automatically handles frame relay Automatically handles frame relay
``LMI'' (link management interface) operations and packets. .Dq LMI
(link management interface) operations and packets.
Automatically probes and detects which of several LMI standards Automatically probes and detects which of several LMI standards
is in use at the exchange. is in use at the exchange.
.Pp .Pp
.It TTY .It TTY
This node is also a line discipline. It simply converts between mbuf This node is also a line discipline. It simply converts between mbuf
frames and sequential serial data, allowing a tty to appear as a netgraph frames and sequential serial data, allowing a tty to appear as a netgraph
node. It has a programmable ``hotkey'' character. node. It has a programmable
.Dq hotkey
character.
.Pp .Pp
.It ASYNC .It ASYNC
This node encapsulates and de-encapsulates asynchronous frames This node encapsulates and de-encapsulates asynchronous frames
@ -891,14 +962,14 @@ It might be freed by any node the data passes through, and a
.Dv NULL .Dv NULL
passed onwards, but the caller will never free it. passed onwards, but the caller will never free it.
Two macros Two macros
.Dv "NG_FREE_META(meta)" .Fn NG_FREE_META "meta"
and and
.Dv "NG_FREE_DATA(m, meta)" .Fn NG_FREE_DATA "m" "meta"
should be used if possible to free data and meta data (see should be used if possible to free data and meta data (see
.Dv netgraph.h ")." .Pa netgraph.h ) .
.It 3 .It 3
Messages sent using Messages sent using
.Dv ng_send_message() .Fn ng_send_message
are freed by the callee. As in the case above, the addresses are freed by the callee. As in the case above, the addresses
associated with the message are freed by whatever allocated them so the associated with the message are freed by whatever allocated them so the
recipient should copy them if it wants to keep that information. recipient should copy them if it wants to keep that information.
@ -974,7 +1045,10 @@ and
The The
.Nm .Nm
system was designed and first implemented at Whistle Communications, Inc. system was designed and first implemented at Whistle Communications, Inc.
in a version FreeBSD 2.2 customized for the Whistle InterJet. in a version
.Fx 2.2
customized for the Whistle InterJet.
.Sh AUTHORS .Sh AUTHORS
Julian Elischer <julian@whistle.com>, with contributions by .An Julian Elischer Aq julian@whistle.com ,
Archie Cobbs <archie@whistle.com>. with contributions by
.An Archie Cobbs Aq archie@whistle.com .

View File

@ -66,7 +66,7 @@ hook which is used to handle any protocol not directly supported
by the node. This includes all of the control protocols: LCP, IPCP, by the node. This includes all of the control protocols: LCP, IPCP,
CCP, etc. Typically this node is connected to a user-land daemon CCP, etc. Typically this node is connected to a user-land daemon
via a via a
.Xr ng_socket(8) .Xr ng_socket 8
type node. type node.
.Sh ENABLING FUNCTIONALITY .Sh ENABLING FUNCTIONALITY
In general, the PPP node enables a specific link or functionality when In general, the PPP node enables a specific link or functionality when
@ -153,7 +153,9 @@ hooks are connected, and the corresponding configuration flag is
enabled, Van Jacobsen compression and/or decompression will become active. enabled, Van Jacobsen compression and/or decompression will become active.
Normally these hooks connect to the corresponding hooks of a single Normally these hooks connect to the corresponding hooks of a single
.Xr ng_vjc 8 .Xr ng_vjc 8
node. The PPP node is compatible with the ``pass through'' modes of the node. The PPP node is compatible with the
.Dq pass through
modes of the
.Xr ng_vjc 8 .Xr ng_vjc 8
node type. node type.
.Sh BYPASS HOOK .Sh BYPASS HOOK
@ -375,5 +377,10 @@ control message, or when all hooks have been disconnected.
.%T "The PPP Multilink Protocol (MP)" .%T "The PPP Multilink Protocol (MP)"
.%O RFC 1990 .%O RFC 1990
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -66,7 +66,7 @@ hook which is used to handle any protocol not directly supported
by the node. This includes all of the control protocols: LCP, IPCP, by the node. This includes all of the control protocols: LCP, IPCP,
CCP, etc. Typically this node is connected to a user-land daemon CCP, etc. Typically this node is connected to a user-land daemon
via a via a
.Xr ng_socket(8) .Xr ng_socket 8
type node. type node.
.Sh ENABLING FUNCTIONALITY .Sh ENABLING FUNCTIONALITY
In general, the PPP node enables a specific link or functionality when In general, the PPP node enables a specific link or functionality when
@ -153,7 +153,9 @@ hooks are connected, and the corresponding configuration flag is
enabled, Van Jacobsen compression and/or decompression will become active. enabled, Van Jacobsen compression and/or decompression will become active.
Normally these hooks connect to the corresponding hooks of a single Normally these hooks connect to the corresponding hooks of a single
.Xr ng_vjc 8 .Xr ng_vjc 8
node. The PPP node is compatible with the ``pass through'' modes of the node. The PPP node is compatible with the
.Dq pass through
modes of the
.Xr ng_vjc 8 .Xr ng_vjc 8
node type. node type.
.Sh BYPASS HOOK .Sh BYPASS HOOK
@ -375,5 +377,10 @@ control message, or when all hooks have been disconnected.
.%T "The PPP Multilink Protocol (MP)" .%T "The PPP Multilink Protocol (MP)"
.%O RFC 1990 .%O RFC 1990
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd October 28, 1999 .Dd October 28, 1999
.Dt NG_PPPOE 8 .Dt NG_PPPOE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_pppoe .Nm ng_pppoe
.Nd RFC 2516 PPPOE protocol netgraph node type .Nd RFC 2516 PPPOE protocol netgraph node type
@ -46,7 +46,7 @@
.Fd #include <netgraph/ng_pppoe.h> .Fd #include <netgraph/ng_pppoe.h>
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm pppoe
node type performs the PPPoE protocol. It is used in conjunction with the node type performs the PPPoE protocol. It is used in conjunction with the
.Xr netgraph 4 .Xr netgraph 4
extensions to the Ethernet framework to divert and inject Ethernet packets extensions to the Ethernet framework to divert and inject Ethernet packets
@ -164,7 +164,7 @@ This node shuts down upon receipt of a
control message, when all session have been disconnected or when the control message, when all session have been disconnected or when the
.Dv ethernet .Dv ethernet
hook is disconnected. hook is disconnected.
.Sh EXAMPLE USAGE .Sh EXAMPLES
The following code uses The following code uses
.Dv libnetgraph .Dv libnetgraph
to set up a to set up a
@ -395,5 +395,10 @@ setup(char *ethername, char *service, char *sessname,
.%T "A Method for transmitting PPP over Ethernet (PPPoE)" .%T "A Method for transmitting PPP over Ethernet (PPPoE)"
.%O RFC 2516 .%O RFC 2516
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd October 28, 1999 .Dd October 28, 1999
.Dt NG_PPPOE 8 .Dt NG_PPPOE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_pppoe .Nm ng_pppoe
.Nd RFC 2516 PPPOE protocol netgraph node type .Nd RFC 2516 PPPOE protocol netgraph node type
@ -46,7 +46,7 @@
.Fd #include <netgraph/ng_pppoe.h> .Fd #include <netgraph/ng_pppoe.h>
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Nm .Nm pppoe
node type performs the PPPoE protocol. It is used in conjunction with the node type performs the PPPoE protocol. It is used in conjunction with the
.Xr netgraph 4 .Xr netgraph 4
extensions to the Ethernet framework to divert and inject Ethernet packets extensions to the Ethernet framework to divert and inject Ethernet packets
@ -164,7 +164,7 @@ This node shuts down upon receipt of a
control message, when all session have been disconnected or when the control message, when all session have been disconnected or when the
.Dv ethernet .Dv ethernet
hook is disconnected. hook is disconnected.
.Sh EXAMPLE USAGE .Sh EXAMPLES
The following code uses The following code uses
.Dv libnetgraph .Dv libnetgraph
to set up a to set up a
@ -395,5 +395,10 @@ setup(char *ethername, char *service, char *sessname,
.%T "A Method for transmitting PPP over Ethernet (PPPoE)" .%T "A Method for transmitting PPP over Ethernet (PPPoE)"
.%O RFC 2516 .%O RFC 2516
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -132,5 +132,10 @@ control message, or when both hooks have been disconnected.
.%T "Generic Routing Encapsulation over IPv4 networks" .%T "Generic Routing Encapsulation over IPv4 networks"
.%O RFC 1702 .%O RFC 1702
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -132,5 +132,10 @@ control message, or when both hooks have been disconnected.
.%T "Generic Routing Encapsulation over IPv4 networks" .%T "Generic Routing Encapsulation over IPv4 networks"
.%O RFC 1702 .%O RFC 1702
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_RFC1490 8 .Dt NG_RFC1490 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_rfc1490 .Nm ng_rfc1490
.Nd RFC 1490 netgraph node type .Nd RFC 1490 netgraph node type
@ -105,5 +105,10 @@ Not all of RFC 1490 is implemented.
.%T "PPP in Frame Relay" .%T "PPP in Frame Relay"
.%O RFC 1973 .%O RFC 1973
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_RFC1490 8 .Dt NG_RFC1490 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_rfc1490 .Nm ng_rfc1490
.Nd RFC 1490 netgraph node type .Nd RFC 1490 netgraph node type
@ -105,5 +105,10 @@ Not all of RFC 1490 is implemented.
.%T "PPP in Frame Relay" .%T "PPP in Frame Relay"
.%O RFC 1973 .%O RFC 1973
.Re .Re
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_SOCKET 8 .Dt NG_SOCKET 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_socket .Nm ng_socket
.Nd netgraph socket node type .Nd netgraph socket node type
@ -48,7 +48,7 @@
A A
.Nm socket .Nm socket
node is both a BSD socket and a netgraph node. The node is both a BSD socket and a netgraph node. The
.Nm socket .Nm
node type allows user-mode processes to participate in the kernel node type allows user-mode processes to participate in the kernel
.Xr netgraph 4 .Xr netgraph 4
networking subsystem using the BSD socket interface. The process must have networking subsystem using the BSD socket interface. The process must have
@ -56,7 +56,7 @@ root privileges to be able to create netgraph sockets however once created,
any process that has one may use it. any process that has one may use it.
.Pp .Pp
A new A new
.Nm socket .Nm
node is created by creating a new socket of type node is created by creating a new socket of type
.Dv NG_CONTROL .Dv NG_CONTROL
in the protocol family in the protocol family
@ -85,13 +85,13 @@ To transmit and receive netgraph data packets, a
socket must also be created using socket must also be created using
.Xr socket 2 .Xr socket 2
and associated with a and associated with a
.Nm socket .Nm
node. node.
.Dv NG_DATA sockets do not automatically .Dv NG_DATA sockets do not automatically
have nodes associated with them; they are bound to a specific node via the have nodes associated with them; they are bound to a specific node via the
.Xr connect 2 .Xr connect 2
system call. The address argument is the netgraph address of the system call. The address argument is the netgraph address of the
.Nm socket .Nm
node already created. Once a data socket is associated with a node, node already created. Once a data socket is associated with a node,
any data packets received by the node are read using any data packets received by the node are read using
.Xr recvfrom 2 .Xr recvfrom 2
@ -169,5 +169,10 @@ socket).
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_ksocket 8 , .Xr ng_ksocket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_SOCKET 8 .Dt NG_SOCKET 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_socket .Nm ng_socket
.Nd netgraph socket node type .Nd netgraph socket node type
@ -48,7 +48,7 @@
A A
.Nm socket .Nm socket
node is both a BSD socket and a netgraph node. The node is both a BSD socket and a netgraph node. The
.Nm socket .Nm
node type allows user-mode processes to participate in the kernel node type allows user-mode processes to participate in the kernel
.Xr netgraph 4 .Xr netgraph 4
networking subsystem using the BSD socket interface. The process must have networking subsystem using the BSD socket interface. The process must have
@ -56,7 +56,7 @@ root privileges to be able to create netgraph sockets however once created,
any process that has one may use it. any process that has one may use it.
.Pp .Pp
A new A new
.Nm socket .Nm
node is created by creating a new socket of type node is created by creating a new socket of type
.Dv NG_CONTROL .Dv NG_CONTROL
in the protocol family in the protocol family
@ -85,13 +85,13 @@ To transmit and receive netgraph data packets, a
socket must also be created using socket must also be created using
.Xr socket 2 .Xr socket 2
and associated with a and associated with a
.Nm socket .Nm
node. node.
.Dv NG_DATA sockets do not automatically .Dv NG_DATA sockets do not automatically
have nodes associated with them; they are bound to a specific node via the have nodes associated with them; they are bound to a specific node via the
.Xr connect 2 .Xr connect 2
system call. The address argument is the netgraph address of the system call. The address argument is the netgraph address of the
.Nm socket .Nm
node already created. Once a data socket is associated with a node, node already created. Once a data socket is associated with a node,
any data packets received by the node are read using any data packets received by the node are read using
.Xr recvfrom 2 .Xr recvfrom 2
@ -169,5 +169,10 @@ socket).
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ng_ksocket 8 , .Xr ng_ksocket 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TEE 8 .Dt NG_TEE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tee .Nm ng_tee
.Nd netgraph ``tee'' node type .Nd netgraph ``tee'' node type
@ -50,7 +50,9 @@ node type has a purpose similar to the
.Xr tee 1 .Xr tee 1
command. command.
.Nm Tee .Nm Tee
nodes are useful for debugging or ``snooping'' on a connection nodes are useful for debugging or
.Dq snooping
on a connection
between two netgraph nodes. between two netgraph nodes.
.Nm Tee .Nm Tee
nodes have four hooks, nodes have four hooks,
@ -113,5 +115,10 @@ control message, or when all hooks have been disconnected.
.Xr tee 1 , .Xr tee 1 ,
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TEE 8 .Dt NG_TEE 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tee .Nm ng_tee
.Nd netgraph ``tee'' node type .Nd netgraph ``tee'' node type
@ -50,7 +50,9 @@ node type has a purpose similar to the
.Xr tee 1 .Xr tee 1
command. command.
.Nm Tee .Nm Tee
nodes are useful for debugging or ``snooping'' on a connection nodes are useful for debugging or
.Dq snooping
on a connection
between two netgraph nodes. between two netgraph nodes.
.Nm Tee .Nm Tee
nodes have four hooks, nodes have four hooks,
@ -113,5 +115,10 @@ control message, or when all hooks have been disconnected.
.Xr tee 1 , .Xr tee 1 ,
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Julian Elischer <julian@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Julian Elischer Aq julian@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TTY 8 .Dt NG_TTY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tty .Nm ng_tty
.Nd netgraph node type that is also a line discipline .Nd netgraph node type that is also a line discipline
@ -52,7 +52,7 @@ node type is both a netgraph node type and a line discipline.
A new node is created when the corresponding line discipline, A new node is created when the corresponding line discipline,
.Dv NETGRAPHDISC , .Dv NETGRAPHDISC ,
is registered on a tty device (see is registered on a tty device (see
.Xr tty 4 ")." .Xr tty 4 ) .
.Pp .Pp
The node has a single hook called The node has a single hook called
.Dv hook . .Dv hook .
@ -65,7 +65,9 @@ While the line discipline is installed on a tty, the normal
read and write operations are unavailable, returning read and write operations are unavailable, returning
.Er EIO . .Er EIO .
.Pp .Pp
The node supports an optional ``hot character.'' If set to non-zero, incoming The node supports an optional
.Dq hot character .
If set to non-zero, incoming
data from the tty device is queued until this character is seen. data from the tty device is queued until this character is seen.
This avoids sending lots of mbufs containing a small number of bytes, This avoids sending lots of mbufs containing a small number of bytes,
but introduces potentially infinite latency. but introduces potentially infinite latency.
@ -114,11 +116,12 @@ The
control message is not valid, and always returns the error control message is not valid, and always returns the error
.Er EOPNOTSUPP . .Er EOPNOTSUPP .
.Sh BUGS .Sh BUGS
The serial driver code also has a notion of a ``hot character.'' The serial driver code also has a notion of a
.Dq hot character .
Unfortunately, this value is statically defined in terms of the Unfortunately, this value is statically defined in terms of the
line discipline and cannot be changed. line discipline and cannot be changed.
Therefore, if a hot character other than 0x7e (the default) is set for the Therefore, if a hot character other than 0x7e (the default) is set for the
.Nm tty .Nm
node, the node has no way to convey this information to the node, the node has no way to convey this information to the
serial driver, and sub-optimal performance may result. serial driver, and sub-optimal performance may result.
.Sh SEE ALSO .Sh SEE ALSO
@ -127,5 +130,10 @@ serial driver, and sub-optimal performance may result.
.Xr tty 4 , .Xr tty 4 ,
.Xr ng_async 8 , .Xr ng_async 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_TTY 8 .Dt NG_TTY 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_tty .Nm ng_tty
.Nd netgraph node type that is also a line discipline .Nd netgraph node type that is also a line discipline
@ -52,7 +52,7 @@ node type is both a netgraph node type and a line discipline.
A new node is created when the corresponding line discipline, A new node is created when the corresponding line discipline,
.Dv NETGRAPHDISC , .Dv NETGRAPHDISC ,
is registered on a tty device (see is registered on a tty device (see
.Xr tty 4 ")." .Xr tty 4 ) .
.Pp .Pp
The node has a single hook called The node has a single hook called
.Dv hook . .Dv hook .
@ -65,7 +65,9 @@ While the line discipline is installed on a tty, the normal
read and write operations are unavailable, returning read and write operations are unavailable, returning
.Er EIO . .Er EIO .
.Pp .Pp
The node supports an optional ``hot character.'' If set to non-zero, incoming The node supports an optional
.Dq hot character .
If set to non-zero, incoming
data from the tty device is queued until this character is seen. data from the tty device is queued until this character is seen.
This avoids sending lots of mbufs containing a small number of bytes, This avoids sending lots of mbufs containing a small number of bytes,
but introduces potentially infinite latency. but introduces potentially infinite latency.
@ -114,11 +116,12 @@ The
control message is not valid, and always returns the error control message is not valid, and always returns the error
.Er EOPNOTSUPP . .Er EOPNOTSUPP .
.Sh BUGS .Sh BUGS
The serial driver code also has a notion of a ``hot character.'' The serial driver code also has a notion of a
.Dq hot character .
Unfortunately, this value is statically defined in terms of the Unfortunately, this value is statically defined in terms of the
line discipline and cannot be changed. line discipline and cannot be changed.
Therefore, if a hot character other than 0x7e (the default) is set for the Therefore, if a hot character other than 0x7e (the default) is set for the
.Nm tty .Nm
node, the node has no way to convey this information to the node, the node has no way to convey this information to the
serial driver, and sub-optimal performance may result. serial driver, and sub-optimal performance may result.
.Sh SEE ALSO .Sh SEE ALSO
@ -127,5 +130,10 @@ serial driver, and sub-optimal performance may result.
.Xr tty 4 , .Xr tty 4 ,
.Xr ng_async 8 , .Xr ng_async 8 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_VJC 8 .Dt NG_VJC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_vjc .Nm ng_vjc
.Nd Van Jacobsen compression netgraph node type .Nd Van Jacobsen compression netgraph node type
@ -60,10 +60,14 @@ nodes represent the compressed side of the node. Packets received on the
.Dv ip .Dv ip
will be compressed or passed through as appropriate. Packets received will be compressed or passed through as appropriate. Packets received
on the other three hooks will be uncompressed as appropriate. on the other three hooks will be uncompressed as appropriate.
This node also supports ``always pass through'' mode in either direction. This node also supports
.Dq always pass through
mode in either direction.
.Pp .Pp
Van Jacobsen compression only applies to TCP packets. Van Jacobsen compression only applies to TCP packets.
Only ``normal'' (i.e., common case) TCP packets are actually compressed. Only
.Dq normal
(i.e., common case) TCP packets are actually compressed.
These are output on the These are output on the
.Dv vjcomp .Dv vjcomp
hook. Other TCP packets are run through the state machine but not hook. Other TCP packets are run through the state machine but not
@ -138,7 +142,9 @@ and
hooks. hooks.
When a node is first created, When a node is first created,
both compression and decompression are disabled and the node is both compression and decompression are disabled and the node is
therefore operating in bi-directional ``pass through'' mode. therefore operating in bi-directional
.Dq pass through
mode.
.Pp .Pp
When enabling compression, When enabling compression,
.Dv maxChannel .Dv maxChannel
@ -155,7 +161,7 @@ message is immediately sent whenever this occurs.
This command returns the node's current state described by the This command returns the node's current state described by the
.Dv "struct slcompress" .Dv "struct slcompress"
structure, which is defined in structure, which is defined in
.Dv "net/slcompress.h" . .Pa net/slcompress.h .
.It Dv NGM_VJC_CLR_STATS .It Dv NGM_VJC_CLR_STATS
Clears the node statistics counters. Statistics are also cleared whenever the Clears the node statistics counters. Statistics are also cleared whenever the
.Dv enableComp .Dv enableComp
@ -185,9 +191,9 @@ both enabled. This of course resets the node state. This restriction
may be lifted in a later version. may be lifted in a later version.
.Pp .Pp
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/slcompress.c" . .Pa net/slcompress.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/slcompress.c" .Pa net/slcompress.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
@ -206,5 +212,10 @@ However, this may change in the future.
.%T "The PPP Internet Control Protocol (IPCP)" .%T "The PPP Internet Control Protocol (IPCP)"
.%O RFC 1332 .%O RFC 1332
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -37,7 +37,7 @@
.\" .\"
.Dd January 19, 1999 .Dd January 19, 1999
.Dt NG_VJC 8 .Dt NG_VJC 8
.Os FreeBSD 4.0 .Os FreeBSD
.Sh NAME .Sh NAME
.Nm ng_vjc .Nm ng_vjc
.Nd Van Jacobsen compression netgraph node type .Nd Van Jacobsen compression netgraph node type
@ -60,10 +60,14 @@ nodes represent the compressed side of the node. Packets received on the
.Dv ip .Dv ip
will be compressed or passed through as appropriate. Packets received will be compressed or passed through as appropriate. Packets received
on the other three hooks will be uncompressed as appropriate. on the other three hooks will be uncompressed as appropriate.
This node also supports ``always pass through'' mode in either direction. This node also supports
.Dq always pass through
mode in either direction.
.Pp .Pp
Van Jacobsen compression only applies to TCP packets. Van Jacobsen compression only applies to TCP packets.
Only ``normal'' (i.e., common case) TCP packets are actually compressed. Only
.Dq normal
(i.e., common case) TCP packets are actually compressed.
These are output on the These are output on the
.Dv vjcomp .Dv vjcomp
hook. Other TCP packets are run through the state machine but not hook. Other TCP packets are run through the state machine but not
@ -138,7 +142,9 @@ and
hooks. hooks.
When a node is first created, When a node is first created,
both compression and decompression are disabled and the node is both compression and decompression are disabled and the node is
therefore operating in bi-directional ``pass through'' mode. therefore operating in bi-directional
.Dq pass through
mode.
.Pp .Pp
When enabling compression, When enabling compression,
.Dv maxChannel .Dv maxChannel
@ -155,7 +161,7 @@ message is immediately sent whenever this occurs.
This command returns the node's current state described by the This command returns the node's current state described by the
.Dv "struct slcompress" .Dv "struct slcompress"
structure, which is defined in structure, which is defined in
.Dv "net/slcompress.h" . .Pa net/slcompress.h .
.It Dv NGM_VJC_CLR_STATS .It Dv NGM_VJC_CLR_STATS
Clears the node statistics counters. Statistics are also cleared whenever the Clears the node statistics counters. Statistics are also cleared whenever the
.Dv enableComp .Dv enableComp
@ -185,9 +191,9 @@ both enabled. This of course resets the node state. This restriction
may be lifted in a later version. may be lifted in a later version.
.Pp .Pp
When built as a loadable kernel module, this module includes the file When built as a loadable kernel module, this module includes the file
.Dv "net/slcompress.c" . .Pa net/slcompress.c .
Although loading the module should fail if Although loading the module should fail if
.Dv "net/slcompress.c" .Pa net/slcompress.c
already exists in the kernel, currently it does not, and the duplicate already exists in the kernel, currently it does not, and the duplicate
copies of the file do not interfere. copies of the file do not interfere.
However, this may change in the future. However, this may change in the future.
@ -206,5 +212,10 @@ However, this may change in the future.
.%T "The PPP Internet Control Protocol (IPCP)" .%T "The PPP Internet Control Protocol (IPCP)"
.%O RFC 1332 .%O RFC 1332
.Re .Re
.Sh AUTHOR .Sh HISTORY
Archie Cobbs <archie@whistle.com> The
.Nm
node type was implemented in
.Fx 4.0 .
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -40,7 +40,7 @@
.Nm ngctl .Nm ngctl
.Nd netgraph control utility .Nd netgraph control utility
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ngctl .Nm
.Op Fl d .Op Fl d
.Op Fl f Ar filename .Op Fl f Ar filename
.Op Fl n Ar nodename .Op Fl n Ar nodename
@ -55,19 +55,21 @@ If no
.Fl f .Fl f
flag is given, no flag is given, no
command is supplied on the command line, and standard input is a tty, command is supplied on the command line, and standard input is a tty,
.Nm ngctl .Nm
will enter interactive mode. Otherwise will enter interactive mode. Otherwise
.Nm ngctl .Nm
will execute the supplied command(s) and exit immediately. will execute the supplied command(s) and exit immediately.
.Pp .Pp
Nodes can be created, removed, joined together, etc. Nodes can be created, removed, joined together, etc.
ASCII formatted control messages can be sent to any node if that node .Tn ASCII
formatted control messages can be sent to any node if that node
supports binary/ASCII control message conversion. supports binary/ASCII control message conversion.
.Pp .Pp
In interactive mode, In interactive mode,
.Nm .Nm
will display any control messages and data packets received by the socket node. will display any control messages and data packets received by the socket node.
In the case of control messages, the message arguments are displayed in ASCII In the case of control messages, the message arguments are displayed in
.Tn ASCII
form if the originating node supports conversion. form if the originating node supports conversion.
.Pp .Pp
The options are as follows: The options are as follows:
@ -75,7 +77,9 @@ The options are as follows:
.It Fl f Ar nodeinfo .It Fl f Ar nodeinfo
Read commands from the named file. Read commands from the named file.
A single dash represents the standard input. A single dash represents the standard input.
Blank lines and lines starting with a ``#'' are ignored. Blank lines and lines starting with a
.Dq #
are ignored.
.It Fl n Ar nodename .It Fl n Ar nodename
Assign Assign
.Em nodename .Em nodename
@ -87,7 +91,7 @@ Increase the debugging verbosity level.
.El .El
.Sh COMMANDS .Sh COMMANDS
The currently supported commands in The currently supported commands in
.Nm ngctl .Nm
are: are:
.Pp .Pp
.Bd -literal -offset indent -compact .Bd -literal -offset indent -compact
@ -107,8 +111,13 @@ types Show all installed node types
quit Exit program quit Exit program
.Ed .Ed
.Pp .Pp
Some commands have aliases, e.g., ``ls'' is the same as ``list''. Some commands have aliases, e.g.,
The ``help'' command displays the available .Dq ls
is the same as
.Dq list .
The
.Dq help
command displays the available
commands, their usage and aliases, and a brief description. commands, their usage and aliases, and a brief description.
.Sh EXIT VALUE .Sh EXIT VALUE
The The
@ -116,12 +125,14 @@ The
utility exits 0 on success, and >0 if an error occurs. utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO .Sh SEE ALSO
.Xr netgraph 3 , .Xr netgraph 3 ,
.Xr netgraph 4 . .Xr netgraph 4 ,
.Xr nghook 8 . .Xr nghook 8 .
.Sh AUTHOR
Archie Cobbs <archie@whistle.com>
.Sh HISTORY .Sh HISTORY
The The
.Em netgraph .Nm netgraph
system was designed and first implemented at Whistle Communications, Inc. in system was designed and first implemented at Whistle Communications, Inc. in
a version FreeBSD 2.2 customized for the Whistle InterJet. a version
.Fx 2.2
customized for the Whistle InterJet.
.Sh AUTHORS
.An Archie Cobbs Aq archie@whistle.com

View File

@ -39,7 +39,7 @@
.Sh NAME .Sh NAME
.Nm nghook .Nm nghook
.Nd connect to a .Nd connect to a
.Xr netgraph 8 .Xr ng_socket 8
node node
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
@ -50,14 +50,16 @@ node
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm .Nm
creates a creates a
.Xr netgraph 8 .Xr ng_socket 8
socket type node and connects it to hook socket type node and connects it to hook
.Ar hookname .Ar hookname
of the node found at of the node found at
.Ar path . .Ar path .
If If
.Ar hookname .Ar hookname
is omitted, ``debug'' is assumed. is omitted,
.Dq debug
is assumed.
.Pp .Pp
At this point all data written to standard input is sent At this point all data written to standard input is sent
to the node and all data received from the node is relayed to the node and all data received from the node is relayed
@ -67,7 +69,8 @@ The options are as follows:
.Pp .Pp
.Bl -tag -width indent .Bl -tag -width indent
.It Fl a .It Fl a
Output each read packet in ASCII. Output each read packet in
.Tn ASCII .
.It Fl d .It Fl d
Increase the debugging verbosity level. Increase the debugging verbosity level.
.El .El
@ -78,10 +81,12 @@ there's no way to control the packetization of the input.
.Xr netgraph 4 , .Xr netgraph 4 ,
.Xr netgraph 3 , .Xr netgraph 3 ,
.Xr ngctl 8 . .Xr ngctl 8 .
.Sh AUTHOR
Archie Cobbs <archie@whistle.com>
.Sh HISTORY .Sh HISTORY
The The
.Em netgraph .Em netgraph
system was designed and first implemented at Whistle Communications, Inc. system was designed and first implemented at Whistle Communications, Inc.
in a version FreeBSD 2.2 customized for the Whistle InterJet. in a version of
.Fx 2.2
customized for the Whistle InterJet.
.Sh AUTHOR
.An Archie Cobbs Aq archie@whistle.com