diff options
author | Julian Elischer <julian@FreeBSD.org> | 1999-10-21 09:06:11 +0000 |
---|---|---|
committer | Julian Elischer <julian@FreeBSD.org> | 1999-10-21 09:06:11 +0000 |
commit | 4cf49a43559ed9fdad601bdcccd2c55963008675 (patch) | |
tree | 722c03ee4d750dd89ed43b028c35302fbfd03bfd /sys/modules | |
parent | 67494b1a71eccedcce178eba53e7d31f35d44016 (diff) |
Whistle's Netgraph link-layer (sometimes more) networking infrastructure.
Been in production for 3 years now. Gives Instant Frame relay to if_sr
and if_ar drivers, and PPPOE support soon. See:
ftp://ftp.whistle.com/pub/archie/netgraph/index.html
for on-line manual pages.
Reviewed by: Doug Rabson (dfr@freebsd.org)
Obtained from: Whistle CVS tree
Notes
Notes:
svn path=/head/; revision=52419
Diffstat (limited to 'sys/modules')
50 files changed, 4799 insertions, 3 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile index c2cfed5ac7d1..7aa52210d819 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -3,8 +3,8 @@ # XXX present but broken: atapi ip_mroute_mod joy pcic SUBDIR= aha al ax ccd cd9660 coda dm fdesc fxp if_disc if_ppp if_sl if_tun \ - ipfw kernfs md mfs mii msdos mx nfs ntfs nullfs pn portal procfs rl \ - sf sis sk ste ti tl umapfs union vn vr wb xl + ipfw kernfs md mfs mii msdos mx netgraph nfs ntfs nullfs pn portal \ + procfs rl sf sis sk ste ti tl umapfs union vn vr wb xl # XXX some of these can move to the general case when de-i386'ed .if ${MACHINE_ARCH} == "i386" diff --git a/sys/modules/netgraph/Makefile b/sys/modules/netgraph/Makefile index a522813cab0c..1068590a9529 100644 --- a/sys/modules/netgraph/Makefile +++ b/sys/modules/netgraph/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ +# $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ # $FreeBSD$ SUBDIR= async cisco echo frame_relay hole iface lmi netgraph ppp rfc1490 \ diff --git a/sys/modules/netgraph/Makefile.inc b/sys/modules/netgraph/Makefile.inc new file mode 100644 index 000000000000..16ca171c2de7 --- /dev/null +++ b/sys/modules/netgraph/Makefile.inc @@ -0,0 +1,7 @@ +# $FreeBSD$ +# $Whistle: Makefile.inc,v 1.4 1999/01/19 23:46:16 archie Exp $ + +.PATH: ${.CURDIR}/../../../netgraph +CFLAGS+= -Wall + +.include "../Makefile.inc" diff --git a/sys/modules/netgraph/UI/Makefile b/sys/modules/netgraph/UI/Makefile new file mode 100644 index 000000000000..cf7542ff1c29 --- /dev/null +++ b/sys/modules/netgraph/UI/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $ + +KMOD= ng_UI +SRCS= ng_UI.c +MAN8= ng_UI.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/UI/ng_UI.4 b/sys/modules/netgraph/UI/ng_UI.4 new file mode 100644 index 000000000000..f432fc4cdb85 --- /dev/null +++ b/sys/modules/netgraph/UI/ng_UI.4 @@ -0,0 +1,86 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_UI.8,v 1.4 1999/01/25 02:37:56 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_UI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_UI +.Nd UI netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_UI.h> +.Sh DESCRIPTION +The +.Nm UI +node type has two hooks, +.Dv upstream +and +.Dv downstream . +Packets received on +.Dv downstream +must have 0x03 (indicating unnumbered information) as their first byte; +if not the packet is dropped. This byte is then stripped and the +remainder of the packet sent out on +.Dv upstream . +.Pp +Conversely, packets received on +.Dv upstream +will have a 0x03 byte prepended to them before being forwarded out on the +.Dv downstream +hook. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv downstream +Downstream connection. Packets on this side of the node have a 0x03 as +their first byte. +.It Dv upstream +Upstream connection. Packets on this side of the node have the +initial 0x03 byte stripped off. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when both hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/UI/ng_UI.8 b/sys/modules/netgraph/UI/ng_UI.8 new file mode 100644 index 000000000000..f432fc4cdb85 --- /dev/null +++ b/sys/modules/netgraph/UI/ng_UI.8 @@ -0,0 +1,86 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_UI.8,v 1.4 1999/01/25 02:37:56 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_UI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_UI +.Nd UI netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_UI.h> +.Sh DESCRIPTION +The +.Nm UI +node type has two hooks, +.Dv upstream +and +.Dv downstream . +Packets received on +.Dv downstream +must have 0x03 (indicating unnumbered information) as their first byte; +if not the packet is dropped. This byte is then stripped and the +remainder of the packet sent out on +.Dv upstream . +.Pp +Conversely, packets received on +.Dv upstream +will have a 0x03 byte prepended to them before being forwarded out on the +.Dv downstream +hook. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv downstream +Downstream connection. Packets on this side of the node have a 0x03 as +their first byte. +.It Dv upstream +Upstream connection. Packets on this side of the node have the +initial 0x03 byte stripped off. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when both hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/async/Makefile b/sys/modules/netgraph/async/Makefile new file mode 100644 index 000000000000..507d0e4068be --- /dev/null +++ b/sys/modules/netgraph/async/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $ + +KMOD= ng_async +SRCS= ng_async.c +MAN8= ng_async.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/async/ng_async.4 b/sys/modules/netgraph/async/ng_async.4 new file mode 100644 index 000000000000..cddaa1b68bf8 --- /dev/null +++ b/sys/modules/netgraph/async/ng_async.4 @@ -0,0 +1,160 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_async.8,v 1.6 1999/01/25 23:46:25 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_ASYNC 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_async +.Nd asynchronous framing netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_async.h> +.Sh DESCRIPTION +The +.Nm async +node type performs conversion between synchronous frames and +asynchronous frames, as defined for the PPP protocol in RFC 1662. +Asynchronous framing uses flag bytes and octet-stuffing +to simulate a frame oriented connection over an octet-oriented +asynchronous line. +.Pp +The node trasmits and receives asynchronous data on the +.Dv async +hook. Incoming data mbuf boundaries are ignored, while +outgoing data is sent as a complete frame at a time. +.Pp +There are two synchronous hooks, +.Dv sync +and +.Dv sync2 . +For both hooks, received packets are encoded as asynchronous frames +and sent out on +.Dv async . +Hook +.Dv sync2 +differs from +.Dv sync +only in that any configured address and control field compression +and/or control character escaping is disabled when the frame is encoded. +This is useful for transmitting PPP LCP packets, which are always sent +this way. +.Pp +This node supports ``flag sharing'' for packets transmitted on +.Dv async . +This is an optimization where the trailing flag byte +of one frame is shared with the opening flag byte of the next. +Flag sharing between frames is disabled after one second of transmit +idle time. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv async +Asynchronous connection. +Typically this hook would be connected to a +.Xr ng_tty 8 +node, which handles transmission of serial data over a tty device. +.It Dv sync +Synchronous connection. This hook sends and receives synchronous frames. +For PPP, these frames contain no address, control, or checksum fields; +each frame begins with the PPP protocol number. Typically this hook would +be connected to the +.Dv downstream +hook of a +.Xr ng_ppp 8 +type node. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_ASYNC_CMD_GET_STATS +This command returns a +.Dv "struct ng_async_stat" +containing node statistics for packet, octet, and error counts. +.It Dv NGM_ASYNC_CMD_CLR_STATS +Clears the node statistics. +.It Dv NGM_ASYNC_CMD_SET_CONFIG +Sets the node configuration, which is described by a +.Dv "struct ng_async_cfg" : +.Bd -literal -offset 4n +struct ng_async_cfg { + u_char enabled; /* Turn encoding on/off */ + u_char acfcomp; /* Address/control field comp. */ + u_int16_t amru; /* Max receive async frame len */ + u_int16_t smru; /* Max receive sync frame len */ + u_int32_t accm; /* ACCM encoding */ +}; +.Ed +.Pp +The +.Dv enabled +field enables or disables all encoding/decoding functions (default disabled). +When disabled, the node operates in simple ``pass through'' mode. Setting +.Dv acfcomp +enables address and control field compression on transmission (for packets +received on the +.Dv sync +hook only; default off). +.Dv amru +and +.Dv smru +are the asynchronous and synchronous MRU (maximum receive unit) values, +respectively. These both default to 1600; note that the async MRU +applies to the incoming frame length after asynchronous decoding. +Finally, +.Dv accm +is the asynchronous character control map, which controls the escaping +of characters 0x00 thorough 0x1f (default 0xffffffff). +.It Dv NGM_ASYNC_CMD_GET_CONFIG +This command returns the current configuration structure. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ppp 8 , +.Xr ng_tty 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "PPP in HDLC-link Framing" +.%O RFC 1662 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/async/ng_async.8 b/sys/modules/netgraph/async/ng_async.8 new file mode 100644 index 000000000000..cddaa1b68bf8 --- /dev/null +++ b/sys/modules/netgraph/async/ng_async.8 @@ -0,0 +1,160 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_async.8,v 1.6 1999/01/25 23:46:25 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_ASYNC 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_async +.Nd asynchronous framing netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_async.h> +.Sh DESCRIPTION +The +.Nm async +node type performs conversion between synchronous frames and +asynchronous frames, as defined for the PPP protocol in RFC 1662. +Asynchronous framing uses flag bytes and octet-stuffing +to simulate a frame oriented connection over an octet-oriented +asynchronous line. +.Pp +The node trasmits and receives asynchronous data on the +.Dv async +hook. Incoming data mbuf boundaries are ignored, while +outgoing data is sent as a complete frame at a time. +.Pp +There are two synchronous hooks, +.Dv sync +and +.Dv sync2 . +For both hooks, received packets are encoded as asynchronous frames +and sent out on +.Dv async . +Hook +.Dv sync2 +differs from +.Dv sync +only in that any configured address and control field compression +and/or control character escaping is disabled when the frame is encoded. +This is useful for transmitting PPP LCP packets, which are always sent +this way. +.Pp +This node supports ``flag sharing'' for packets transmitted on +.Dv async . +This is an optimization where the trailing flag byte +of one frame is shared with the opening flag byte of the next. +Flag sharing between frames is disabled after one second of transmit +idle time. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv async +Asynchronous connection. +Typically this hook would be connected to a +.Xr ng_tty 8 +node, which handles transmission of serial data over a tty device. +.It Dv sync +Synchronous connection. This hook sends and receives synchronous frames. +For PPP, these frames contain no address, control, or checksum fields; +each frame begins with the PPP protocol number. Typically this hook would +be connected to the +.Dv downstream +hook of a +.Xr ng_ppp 8 +type node. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_ASYNC_CMD_GET_STATS +This command returns a +.Dv "struct ng_async_stat" +containing node statistics for packet, octet, and error counts. +.It Dv NGM_ASYNC_CMD_CLR_STATS +Clears the node statistics. +.It Dv NGM_ASYNC_CMD_SET_CONFIG +Sets the node configuration, which is described by a +.Dv "struct ng_async_cfg" : +.Bd -literal -offset 4n +struct ng_async_cfg { + u_char enabled; /* Turn encoding on/off */ + u_char acfcomp; /* Address/control field comp. */ + u_int16_t amru; /* Max receive async frame len */ + u_int16_t smru; /* Max receive sync frame len */ + u_int32_t accm; /* ACCM encoding */ +}; +.Ed +.Pp +The +.Dv enabled +field enables or disables all encoding/decoding functions (default disabled). +When disabled, the node operates in simple ``pass through'' mode. Setting +.Dv acfcomp +enables address and control field compression on transmission (for packets +received on the +.Dv sync +hook only; default off). +.Dv amru +and +.Dv smru +are the asynchronous and synchronous MRU (maximum receive unit) values, +respectively. These both default to 1600; note that the async MRU +applies to the incoming frame length after asynchronous decoding. +Finally, +.Dv accm +is the asynchronous character control map, which controls the escaping +of characters 0x00 thorough 0x1f (default 0xffffffff). +.It Dv NGM_ASYNC_CMD_GET_CONFIG +This command returns the current configuration structure. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ppp 8 , +.Xr ng_tty 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "PPP in HDLC-link Framing" +.%O RFC 1662 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/cisco/Makefile b/sys/modules/netgraph/cisco/Makefile new file mode 100644 index 000000000000..2a8d5be1a2c1 --- /dev/null +++ b/sys/modules/netgraph/cisco/Makefile @@ -0,0 +1,35 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $ + +KMOD= ng_cisco +SRCS= ng_cisco.c opt_inet.h opt_atalk.h opt_ipx.h +MAN8= ng_cisco.8 +KMODDEPS= netgraph + +IFACE_INET?= 1 # 0/1 - requires INET configured in kernel +IFACE_NETATALK?= 0 # 0/1 - requires NETATALK configured in kernel +IFACE_IPX?= 0 # 0/1 - requires IPX configured in kernel + +CFLAGS+= ${PROTOS} + +CLEANFILES+= opt_inet.h opt_atalk.h opt_ipx.h + +opt_inet.h: + touch opt_inet.h +.if ${IFACE_INET} > 0 + echo "#define INET 1" > opt_inet.h +.endif + +opt_atalk.h: + touch opt_atalk.h +.if ${IFACE_NETATALK} > 0 + echo "#define NETATALK ${IFACE_NETATALK}" > opt_atalk.h +.endif + +opt_ipx.h: + touch opt_ipx.h +.if ${IFACE_IPX} > 0 + echo "#define IPX ${IFACE_IPX}" > opt_ipx.h +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/cisco/ng_cisco.4 b/sys/modules/netgraph/cisco/ng_cisco.4 new file mode 100644 index 000000000000..30523f8d2bd0 --- /dev/null +++ b/sys/modules/netgraph/cisco/ng_cisco.4 @@ -0,0 +1,159 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_cisco.8,v 1.5 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_CISCO 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_cisco +.Nd Cisco HDLC protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_cisco.h> +.Sh DESCRIPTION +The +.Nm cisco +node type performs encapsulation and de-encapsulation of packets +using the Cisco HDLC protocol. This is a fairly simple +protocol for the transmission of packets across +high speed synchronous lines. Each packet is prepended with +an Ethertype, indicating the protocol. There is also a +``keep alive'' and an ``inquire'' capability. +.Pp +The +.Dv downstream +hook should connect to the synchronous line. On the other side +of the node are the +.Dv inet , +.Dv atalk , +and +.Dv ipx +hooks, which transmit and receive raw IP, AppleTalk, and IPX packets, +respectively. Typically these hooks would connect to the corresponding +hooks on an +.Xr ng_iface 8 +type node. +.Sh IP Configuration +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 +includes an ``inquire'' packet which we must be prepared to answer. +There are two ways to acomplish this, manually and automatically. +.Pp +Whenever such an inquire packet is received, the node sends a +.Dv NGM_CISCO_GET_IPADDR +control message to the peer node connected to the +.Dv inet +hook (if any). +If the peer responds, then that response is used. This is the automatic method. +.Pp +If the peer does not respond, the node falls back on its cached value +for the IP address and netmask. This cached value can be set at any time +with a +.Dv NGM_CISCO_SET_IPADDR +message, and this is the manual method. +.Pp +If the +.Dv inet +hook is connected to the +.Dv inet +hook of an +.Xr ng_iface 8 +node, as is usually the case, then configuration is automatic as the +.Xr ng_iface 8 +understands the +.Dv NGM_CISCO_GET_IPADDR +message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazio +.It Dv downstream +The connection to the synchronous line. +.It Dv inet +IP hook. +.It Dv atalk +AppleTalk hook. +.It Dv ipx +IPX hook +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_CISCO_SET_IPADDR +This command takes an array of two +.Dv "struct in_addr" +arguments. The first is the IP address of the corresponding interface +and the second is the netmask. +.It Dv NGM_CISCO_GET_IPADDR +This command returns the IP configuration in the same format used by +.Dv NGM_CISCO_SET_IPADDR . +This command is also +.Em sent +by this node type to the +.Dv inet +peer whenever an IP address inquiry packet is received. +.It Dv NGM_CISCO_GET_STATUS +Returns a +.Dv "struct ngciscostat" : +.Bd -literal -offset 4n +struct ngciscostat { + u_int32_t seq_retries; /* # unack'd retries */ + u_int32_t keepalive_period; /* in seconds */ +}; +.Ed +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +Not all of the functionality has been implemented. For example, +the node does not support querying the remote end for its IP address +and netmask. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A D. Perkins +.%T "Requirements for an Internet Standard Point-to-Point Protocol" +.%O RFC 1547 +.Re +.Sh LEGAL +Cisco is a trademark of Cisco Systems, Inc. +.Sh AUTHORS +Julian Elisher <julian@whistle.com>, +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/cisco/ng_cisco.8 b/sys/modules/netgraph/cisco/ng_cisco.8 new file mode 100644 index 000000000000..30523f8d2bd0 --- /dev/null +++ b/sys/modules/netgraph/cisco/ng_cisco.8 @@ -0,0 +1,159 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_cisco.8,v 1.5 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_CISCO 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_cisco +.Nd Cisco HDLC protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_cisco.h> +.Sh DESCRIPTION +The +.Nm cisco +node type performs encapsulation and de-encapsulation of packets +using the Cisco HDLC protocol. This is a fairly simple +protocol for the transmission of packets across +high speed synchronous lines. Each packet is prepended with +an Ethertype, indicating the protocol. There is also a +``keep alive'' and an ``inquire'' capability. +.Pp +The +.Dv downstream +hook should connect to the synchronous line. On the other side +of the node are the +.Dv inet , +.Dv atalk , +and +.Dv ipx +hooks, which transmit and receive raw IP, AppleTalk, and IPX packets, +respectively. Typically these hooks would connect to the corresponding +hooks on an +.Xr ng_iface 8 +type node. +.Sh IP Configuration +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 +includes an ``inquire'' packet which we must be prepared to answer. +There are two ways to acomplish this, manually and automatically. +.Pp +Whenever such an inquire packet is received, the node sends a +.Dv NGM_CISCO_GET_IPADDR +control message to the peer node connected to the +.Dv inet +hook (if any). +If the peer responds, then that response is used. This is the automatic method. +.Pp +If the peer does not respond, the node falls back on its cached value +for the IP address and netmask. This cached value can be set at any time +with a +.Dv NGM_CISCO_SET_IPADDR +message, and this is the manual method. +.Pp +If the +.Dv inet +hook is connected to the +.Dv inet +hook of an +.Xr ng_iface 8 +node, as is usually the case, then configuration is automatic as the +.Xr ng_iface 8 +understands the +.Dv NGM_CISCO_GET_IPADDR +message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazio +.It Dv downstream +The connection to the synchronous line. +.It Dv inet +IP hook. +.It Dv atalk +AppleTalk hook. +.It Dv ipx +IPX hook +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_CISCO_SET_IPADDR +This command takes an array of two +.Dv "struct in_addr" +arguments. The first is the IP address of the corresponding interface +and the second is the netmask. +.It Dv NGM_CISCO_GET_IPADDR +This command returns the IP configuration in the same format used by +.Dv NGM_CISCO_SET_IPADDR . +This command is also +.Em sent +by this node type to the +.Dv inet +peer whenever an IP address inquiry packet is received. +.It Dv NGM_CISCO_GET_STATUS +Returns a +.Dv "struct ngciscostat" : +.Bd -literal -offset 4n +struct ngciscostat { + u_int32_t seq_retries; /* # unack'd retries */ + u_int32_t keepalive_period; /* in seconds */ +}; +.Ed +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +Not all of the functionality has been implemented. For example, +the node does not support querying the remote end for its IP address +and netmask. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A D. Perkins +.%T "Requirements for an Internet Standard Point-to-Point Protocol" +.%O RFC 1547 +.Re +.Sh LEGAL +Cisco is a trademark of Cisco Systems, Inc. +.Sh AUTHORS +Julian Elisher <julian@whistle.com>, +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/echo/Makefile b/sys/modules/netgraph/echo/Makefile new file mode 100644 index 000000000000..0c33d2fd3d0b --- /dev/null +++ b/sys/modules/netgraph/echo/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:20 archie Exp $ + +KMOD= ng_echo +SRCS= ng_echo.c +MAN8= ng_echo.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/echo/ng_echo.4 b/sys/modules/netgraph/echo/ng_echo.4 new file mode 100644 index 000000000000..33ca72990808 --- /dev/null +++ b/sys/modules/netgraph/echo/ng_echo.4 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_echo.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_ECHO 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_echo +.Nd netgraph echo node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_echo.h> +.Sh DESCRIPTION +The +.Nm echo +node type reflects all data and control messages back to the sender. +This node type is used for testing and debugging. +.Sh HOOKS +.Nm Echo +nodes accept any request to connect, regardless of the hook name, +as long as the name is unique. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +Any other control messages are reflected back to the sender. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_hole 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/echo/ng_echo.8 b/sys/modules/netgraph/echo/ng_echo.8 new file mode 100644 index 000000000000..33ca72990808 --- /dev/null +++ b/sys/modules/netgraph/echo/ng_echo.8 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_echo.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_ECHO 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_echo +.Nd netgraph echo node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_echo.h> +.Sh DESCRIPTION +The +.Nm echo +node type reflects all data and control messages back to the sender. +This node type is used for testing and debugging. +.Sh HOOKS +.Nm Echo +nodes accept any request to connect, regardless of the hook name, +as long as the name is unique. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +Any other control messages are reflected back to the sender. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_hole 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/frame_relay/Makefile b/sys/modules/netgraph/frame_relay/Makefile new file mode 100644 index 000000000000..3c0117a1e830 --- /dev/null +++ b/sys/modules/netgraph/frame_relay/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_frame_relay +SRCS= ng_frame_relay.c +MAN8= ng_frame_relay.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/frame_relay/ng_frame_relay.4 b/sys/modules/netgraph/frame_relay/ng_frame_relay.4 new file mode 100644 index 000000000000..790676dd5566 --- /dev/null +++ b/sys/modules/netgraph/frame_relay/ng_frame_relay.4 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_frame_relay.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_FRAME_RELAY 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_frame_relay +.Nd Frame relay netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_frame_relay.h> +.Sh DESCRIPTION +The +.Nm frame_relay +node type performs encapsulation, de-encapsulation, and multiplexing +of packets using the frame relay protocol. It supports up to 1024 DLCI's. +The LMI protocol is handled by a separate node type (see +.Xr ng_lmi 8 ). +.Pp +The +.Dv downstream +hook should be connected to the synchronous line, i.e., the switch. +Then hooks +.Dv dlci0 , +.Dv dlci1 , +through +.Dv dlci1023 +are available to connect to each of the DLCI channels. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv downstream +The connection to the synchronous line. +.It Dv dlciX +Here X is a decimal number from 0 to 1023. This hook corresponds +to the DLCI X frame relay virtual channel. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +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. +The +.Nm frame_relay +node type ignores this restriction, and will always pass data received +on a DLCI hook to +.Dv downstream . +Instead, it should query the LMI node first. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_lmi 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/frame_relay/ng_frame_relay.8 b/sys/modules/netgraph/frame_relay/ng_frame_relay.8 new file mode 100644 index 000000000000..790676dd5566 --- /dev/null +++ b/sys/modules/netgraph/frame_relay/ng_frame_relay.8 @@ -0,0 +1,93 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_frame_relay.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_FRAME_RELAY 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_frame_relay +.Nd Frame relay netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_frame_relay.h> +.Sh DESCRIPTION +The +.Nm frame_relay +node type performs encapsulation, de-encapsulation, and multiplexing +of packets using the frame relay protocol. It supports up to 1024 DLCI's. +The LMI protocol is handled by a separate node type (see +.Xr ng_lmi 8 ). +.Pp +The +.Dv downstream +hook should be connected to the synchronous line, i.e., the switch. +Then hooks +.Dv dlci0 , +.Dv dlci1 , +through +.Dv dlci1023 +are available to connect to each of the DLCI channels. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv downstream +The connection to the synchronous line. +.It Dv dlciX +Here X is a decimal number from 0 to 1023. This hook corresponds +to the DLCI X frame relay virtual channel. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +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. +The +.Nm frame_relay +node type ignores this restriction, and will always pass data received +on a DLCI hook to +.Dv downstream . +Instead, it should query the LMI node first. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_lmi 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/hole/Makefile b/sys/modules/netgraph/hole/Makefile new file mode 100644 index 000000000000..f7408c12ff77 --- /dev/null +++ b/sys/modules/netgraph/hole/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_hole +SRCS= ng_hole.c +MAN8= ng_hole.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/hole/ng_hole.4 b/sys/modules/netgraph/hole/ng_hole.4 new file mode 100644 index 000000000000..4d34eb5dbebf --- /dev/null +++ b/sys/modules/netgraph/hole/ng_hole.4 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_hole.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_HOLE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_hole +.Nd netgraph discard node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_hole.h> +.Sh DESCRIPTION +The +.Nm hole +node type silently discards all data and control messages it receives. +This type is used for testing and debugging. +.Sh HOOKS +.Nm Hole +nodes accept any request to connect, regardless of the hook name, +as long as the name is unique. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +Other control messages are silently discarded. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_echo 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/hole/ng_hole.8 b/sys/modules/netgraph/hole/ng_hole.8 new file mode 100644 index 000000000000..4d34eb5dbebf --- /dev/null +++ b/sys/modules/netgraph/hole/ng_hole.8 @@ -0,0 +1,67 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_hole.8,v 1.4 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_HOLE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_hole +.Nd netgraph discard node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_hole.h> +.Sh DESCRIPTION +The +.Nm hole +node type silently discards all data and control messages it receives. +This type is used for testing and debugging. +.Sh HOOKS +.Nm Hole +nodes accept any request to connect, regardless of the hook name, +as long as the name is unique. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +Other control messages are silently discarded. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_echo 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/iface/Makefile b/sys/modules/netgraph/iface/Makefile new file mode 100644 index 000000000000..a76106996ef0 --- /dev/null +++ b/sys/modules/netgraph/iface/Makefile @@ -0,0 +1,39 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_iface +SRCS= ng_iface.c bpfilter.h opt_inet.h opt_atalk.h opt_ipx.h +MAN8= ng_iface.8 +KMODDEPS= netgraph + +IFACE_FILTER?= 0 # 0/1 - requires bpf configured in kernel +IFACE_INET?= 1 # 0/1 - requires INET configured in kernel +IFACE_NETATALK?= 0 # 0/1 - requires NETATALK configured in kernel +IFACE_IPX?= 0 # 0/1 - requires IPX configured in kernel + +CFLAGS+= ${PROTOS} + +CLEANFILES+= bpfilter.h opt_inet.h opt_atalk.h opt_ipx.h + +bpfilter.h: + echo "#define NBPFILTER ${IFACE_FILTER}" > bpfilter.h + +opt_inet.h: + touch opt_inet.h +.if ${IFACE_INET} > 0 + echo "#define INET 1" > opt_inet.h +.endif + +opt_atalk.h: + touch opt_atalk.h +.if ${IFACE_NETATALK} > 0 + echo "#define NETATALK ${IFACE_NETATALK}" > opt_atalk.h +.endif + +opt_ipx.h: + touch opt_ipx.h +.if ${IFACE_IPX} > 0 + echo "#define IPX ${IFACE_IPX}" > opt_ipx.h +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/iface/ng_iface.4 b/sys/modules/netgraph/iface/ng_iface.4 new file mode 100644 index 000000000000..77167e60d6f7 --- /dev/null +++ b/sys/modules/netgraph/iface/ng_iface.4 @@ -0,0 +1,126 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_IFACE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_iface +.Nd interface netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_iface.h> +.Sh DESCRIPTION +An +.Nm iface +node is both a netgraph node and a system networking interface. When an +.Nm iface +node is created, a new point-to-point interface appears which is accessible via +.Xr ifconfig 8 . +The new interfaces are named +.Dv ng0 , +.Dv ng1 , +etc. The node is assigned the same name as its interface, unless the name +already exists, in which case the node remains unnamed. +.Pp +.Nm Iface +nodes have a single hook corresponding to each supported protocol. +Packets transmitted via the interface flow out the corresponding +protocol-specific hook. +Similarly, packets received on a hook appear on the interface as +packets received in the corresponding protocol. +.Pp +The currently supported protocols are IP, IPX, AppleTalk, and NS. +In the KLD module, only support for IP is compiled in by default. +.Pp +.Nm Iface +nodes support the Berkeley Packet Filter (BPF). +In the KLD module, this support is disabled by default. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv inet +Transmission and reception of IP packets. +.It Dv ipx +Transmission and reception of IPX packets. +.It Dv atalk +Transmission and reception of AppleTalk packets. +.It Dv ns +Transmission and reception of NS packets. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_IFACE_GET_IFNAME +Returns the name of the interface corresponding to this node in a +.Dv "struct ng_iface_ifname" : +.Bd -literal -offset 4n +struct ng_iface_ifname { + char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; +}; +.Ed +.It Dv NGM_IFACE_GET_IFADDRS +Returns the list of addresses associated with this interface. +The list is returned in the same format as the +.Dv SIOCGIFCONF +ioctl(). +.It Dv NGM_CISCO_GET_IPADDR +This message is defined by the +.Xr ng_cisco 8 +node type; see +.Xr ng_cisco 8 +for a description. +.El +.Sh SHUTDOWN +Because it is currenly not possible to remove a system networking +interface in FreeBSD, +.Nm iface +nodes are +.Em persistent. +That is, once created they are never destroyed. +The receipt of a +.Dv NGM_SHUTDOWN +control message disconnects all hooks but does not remove the node. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr bpf 4 , +.Xr ng_cisco 8 , +.Xr ng_rfc1490 8 , +.Xr ngctl 8 , +.Xr ifconfig 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/iface/ng_iface.8 b/sys/modules/netgraph/iface/ng_iface.8 new file mode 100644 index 000000000000..77167e60d6f7 --- /dev/null +++ b/sys/modules/netgraph/iface/ng_iface.8 @@ -0,0 +1,126 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_IFACE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_iface +.Nd interface netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_iface.h> +.Sh DESCRIPTION +An +.Nm iface +node is both a netgraph node and a system networking interface. When an +.Nm iface +node is created, a new point-to-point interface appears which is accessible via +.Xr ifconfig 8 . +The new interfaces are named +.Dv ng0 , +.Dv ng1 , +etc. The node is assigned the same name as its interface, unless the name +already exists, in which case the node remains unnamed. +.Pp +.Nm Iface +nodes have a single hook corresponding to each supported protocol. +Packets transmitted via the interface flow out the corresponding +protocol-specific hook. +Similarly, packets received on a hook appear on the interface as +packets received in the corresponding protocol. +.Pp +The currently supported protocols are IP, IPX, AppleTalk, and NS. +In the KLD module, only support for IP is compiled in by default. +.Pp +.Nm Iface +nodes support the Berkeley Packet Filter (BPF). +In the KLD module, this support is disabled by default. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv inet +Transmission and reception of IP packets. +.It Dv ipx +Transmission and reception of IPX packets. +.It Dv atalk +Transmission and reception of AppleTalk packets. +.It Dv ns +Transmission and reception of NS packets. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_IFACE_GET_IFNAME +Returns the name of the interface corresponding to this node in a +.Dv "struct ng_iface_ifname" : +.Bd -literal -offset 4n +struct ng_iface_ifname { + char ngif_name[NG_IFACE_IFACE_NAME_MAX + 1]; +}; +.Ed +.It Dv NGM_IFACE_GET_IFADDRS +Returns the list of addresses associated with this interface. +The list is returned in the same format as the +.Dv SIOCGIFCONF +ioctl(). +.It Dv NGM_CISCO_GET_IPADDR +This message is defined by the +.Xr ng_cisco 8 +node type; see +.Xr ng_cisco 8 +for a description. +.El +.Sh SHUTDOWN +Because it is currenly not possible to remove a system networking +interface in FreeBSD, +.Nm iface +nodes are +.Em persistent. +That is, once created they are never destroyed. +The receipt of a +.Dv NGM_SHUTDOWN +control message disconnects all hooks but does not remove the node. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr bpf 4 , +.Xr ng_cisco 8 , +.Xr ng_rfc1490 8 , +.Xr ngctl 8 , +.Xr ifconfig 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/lmi/Makefile b/sys/modules/netgraph/lmi/Makefile new file mode 100644 index 000000000000..9b4c07edeb99 --- /dev/null +++ b/sys/modules/netgraph/lmi/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_lmi +SRCS= ng_lmi.c +MAN8= ng_lmi.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/lmi/ng_lmi.4 b/sys/modules/netgraph/lmi/ng_lmi.4 new file mode 100644 index 000000000000..fc0ba24f854e --- /dev/null +++ b/sys/modules/netgraph/lmi/ng_lmi.4 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_lmi.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_LMI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_lmi +.Nd Frame relay LMI protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_lmi.h> +.Sh DESCRIPTION +The +.Nm lmi +node type performs the frame relay LMI protocol. It supports +the ITU Annex A, ANSI Annex D, and Group-of-four LMI types. +It also supports auto-detection of the LMI type. +.Pp +To enable a specific LMI type, connect the corresponding hook ( +.Dv annexA , +.Dv annexD , +or +.Dv group4 ")" +to DLCI 0 or 1023 of a +.Xr ng_frame_relay 8 +node. +Typically, Annex A and Annex D live on DLCI 0 while Group-of-four +lives on DLCI 1023. +.Pp +To enable LMI type auto-detection, connect the +.Dv auto0 +hook to DLCI 0 and the +.Dv auto1023 +hook to DLCI 1023. The node will attempt to automatically determine +which LMI type is running at the switch, and go into that mode. +.Pp +Only one fixed LMI type, or auto-detection, can be active at any given time. +.Pp +The +.Dv NGM_LMI_GET_STATUS +control message can be used at any time to query the current status +of the LMI protocol and each DLCI channel. This node also supports the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv annexA +ITU Annex A LMI hook. +.It Dv annexD +ANSI Annex D LMI hook. +.It Dv group4 +Group-of-four LMI hook. +.It Dv auto0 +Auto-detection hook for DLCI 0. +.It Dv auto1023 +Auto-detection hook for DLCI 1023. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_LMI_GET_STATUS +This command returns status information in a +.Dv "struct nglmistat" : +.Bd -literal -offset 4n +#define NGM_LMI_STAT_ARYSIZE (1024/8) + +struct nglmistat { + u_char proto[12]; /* Active proto (same as hook name) */ + u_char hook[12]; /* Active hook */ + u_char fixed; /* If set to fixed LMI mode */ + u_char autod; /* If currently auto-detecting */ + u_char seen[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs seen */ + u_char up[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs up */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ngctl 8 . +.Rs +.%T "ANSI T1.617-1991 Annex D" +.Re +.Rs +.%T "ITU-T Q.933 Digital Subscriber Signalling System No. 1 - Signalling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/lmi/ng_lmi.8 b/sys/modules/netgraph/lmi/ng_lmi.8 new file mode 100644 index 000000000000..fc0ba24f854e --- /dev/null +++ b/sys/modules/netgraph/lmi/ng_lmi.8 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_lmi.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_LMI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_lmi +.Nd Frame relay LMI protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_lmi.h> +.Sh DESCRIPTION +The +.Nm lmi +node type performs the frame relay LMI protocol. It supports +the ITU Annex A, ANSI Annex D, and Group-of-four LMI types. +It also supports auto-detection of the LMI type. +.Pp +To enable a specific LMI type, connect the corresponding hook ( +.Dv annexA , +.Dv annexD , +or +.Dv group4 ")" +to DLCI 0 or 1023 of a +.Xr ng_frame_relay 8 +node. +Typically, Annex A and Annex D live on DLCI 0 while Group-of-four +lives on DLCI 1023. +.Pp +To enable LMI type auto-detection, connect the +.Dv auto0 +hook to DLCI 0 and the +.Dv auto1023 +hook to DLCI 1023. The node will attempt to automatically determine +which LMI type is running at the switch, and go into that mode. +.Pp +Only one fixed LMI type, or auto-detection, can be active at any given time. +.Pp +The +.Dv NGM_LMI_GET_STATUS +control message can be used at any time to query the current status +of the LMI protocol and each DLCI channel. This node also supports the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv annexA +ITU Annex A LMI hook. +.It Dv annexD +ANSI Annex D LMI hook. +.It Dv group4 +Group-of-four LMI hook. +.It Dv auto0 +Auto-detection hook for DLCI 0. +.It Dv auto1023 +Auto-detection hook for DLCI 1023. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_LMI_GET_STATUS +This command returns status information in a +.Dv "struct nglmistat" : +.Bd -literal -offset 4n +#define NGM_LMI_STAT_ARYSIZE (1024/8) + +struct nglmistat { + u_char proto[12]; /* Active proto (same as hook name) */ + u_char hook[12]; /* Active hook */ + u_char fixed; /* If set to fixed LMI mode */ + u_char autod; /* If currently auto-detecting */ + u_char seen[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs seen */ + u_char up[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs up */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ngctl 8 . +.Rs +.%T "ANSI T1.617-1991 Annex D" +.Re +.Rs +.%T "ITU-T Q.933 Digital Subscriber Signalling System No. 1 - Signalling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/netgraph/Makefile b/sys/modules/netgraph/netgraph/Makefile new file mode 100644 index 000000000000..eb37f197a781 --- /dev/null +++ b/sys/modules/netgraph/netgraph/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $ + +KMOD= netgraph +SRCS= ng_base.c +MAN4= netgraph.4 + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/netgraph/netgraph.4 b/sys/modules/netgraph/netgraph/netgraph.4 new file mode 100644 index 000000000000..c90650e0d62c --- /dev/null +++ b/sys/modules/netgraph/netgraph/netgraph.4 @@ -0,0 +1,876 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Authors: Julian Elischer <julian@whistle.com> +.\" Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: netgraph.4,v 1.7 1999/01/28 23:54:52 julian Exp $ +.\" +.Dd January 19, 1999 +.Dt NETGRAPH 4 +.Os FreeBSD +.Sh NAME +.Nm netgraph +.Nd graph based kernel networking subsystem +.Sh DESCRIPTION +The +.Nm +system provides a uniform and modular system for the implementation +of kernel objects which perform various networking functions. The objects, +known as +.Em nodes , +can be arranged into arbitrarily complicated graphs. Nodes have +.Em hooks +which are used to connect two nodes together, forming the edges in the graph. +Nodes communicate along the edges to process data, implement protocols, etc. +.Pp +The aim of +.Nm +is to supplement rather than replace the existing kernel networking +infrastructure. It provides: +.Pp +.Bl -bullet -compact -offset 2n +.It +A flexible way of combining protocol and link level drivers +.It +A modular way to implement new protocols +.It +A common framework for kernel entities to inter-communicate +.It +A reasonably fast, kernel-based implementation +.El +.Sh Nodes and Types +The most fundamental concept in +.Nm +is that of a +.Em node . +All nodes implement a number of predefined methods which allow them +to interact with other nodes in a well defined manner. +.Pp +Each node has a +.Em type , +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. +The type implies what the node does and how it may be connected +to other nodes. +.Pp +In object-oriented language, types are classes and nodes are instances +of their respective class. All node types are subclasses of the generic node +type, and hence inherit certain common functionality and capabilities +(e.g., the ability to have an ASCII name). +.Pp +Nodes may be assigned a globally unique ASCII name which can be +used to refer to the node. +The name must not contain the characters ``.'' or ``:'' and is limited to +.Dv "NG_NODELEN + 1" +characters (including NUL byte). +.Pp +Each node instance has a unique +.Em ID number +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. +.Sh Hooks +Nodes are connected to other nodes by connecting a pair of +.Em hooks , +one from each node. Data flows bidirectionally between nodes along +connected pairs of hooks. A node may have as many hooks as it +needs, and may assign whatever meaning it wants to a hook. +.Pp +Hooks have these properties: +.Pp +.Bl -bullet -compact -offset 2n +.It +A hook has an ASCII name which is unique among all hooks +on that node (other hooks on other nodes may have the same name). +The name must not contain a ``.'' or a ``:'' and is +limited to +.Dv "NG_HOOKLEN + 1" +characters (including NUL byte). +.It +A hook is always connected to another hook. That is, hooks are +created at the time they are connected, and breaking an edge by +removing either hook destroys both hooks. +.El +.Pp +A node may decide to assign special meaning to some hooks. +For example, connecting to the hook named ``debug'' might trigger +the node to start sending debugging information to that hook. +.Sh Data Flow +Two types of information flow between nodes: data messages and +control messages. Data messages are passed in mbuf chains along the edges +in the graph, one edge at a time. The first mbuf in a chain must have the +.Dv M_PKTHDR +flag set. Each node decides how to handle data coming in on its hooks. +.Pp +Control messages are type-specific structures sent from one node directly +to an arbitrary other node. There are two ways to address such a message. If +there is a sequence of edges connecting the two nodes, the message +may be ``source routed'' by specifying the corresponding sequence +of hooks as the destination address for the message (relative +addressing). Otherwise, the recipient node global ASCII name +(or equivalent ID based name) is used as the destination address +for the message (absolute addressing). The two types of addressing +may be combined, by specifying an absolute start node and a sequence +of hooks. +.Pp +Messages often represent commands that are followed by a reply message +in the reverse direction. To facilitate this, the recipient of a +control message is supplied with a ``return address'' that is suitable +for addressing a reply. +.Pp +Each control message contains a 32 bit value called a +.Em typecookie +indicating the type of the message, i.e., how to interpret it. +Typically each type defines a unique typecookie for the messages +that it understands. However, a node may choose to recognize and +implement more than one type of message. +.Sh Netgraph is Functional +In order to minimize latency, most +.Nm netgraph +operations are functional. +That is, data and control messages are delivered by making function +calls rather than by using queues and mailboxes. For example, if node +A wishes to send a data mbuf to neighboring node B, it calls the +generic +.Nm +data delivery function. This function in turn locates +node B and calls B's ``receive data'' method. While this mode of operation +results in good performance, it has a few implications for node +developers: +.Pp +.Bl -bullet -compact -offset 2n +.It +Whenever a node delivers a data or control message, the node +may need to allow for the possibility of receiving a returning message +before the original delivery function call returns. +.It +Netgraph nodes and support routines generally run at +.Dv "splnet()" . +However, some nodes may want to send data and control messages +from a different priority level. Netgraph supplies queueing routines which +utilize the NETISR system to move message delivery to +.Dv "splnet()" . +Note that messages are always received at +.Dv "splnet()" . +.It +It's possible for an infinite loop to occur if the graph contains cycles. +.El +.Pp +So far, these issues have not proven problematical in practice. +.Sh Interaction With Other Parts of the Kernel +A node may have a hidden interaction with other components of the +kernel outside of the +.Nm +subsystem, such as device hardware, +kernel protocol stacks, etc. In fact, one of the benefits of +.Nm +is the ability to join disparate kernel networking entities together in a +consistent communication framework. +.Pp +An example is the node type +.Em socket +which is both a netgraph node and a +.Xr socket 2 +BSD socket in the protocol family +.Dv PF_NETGRAPH . +Socket nodes allow user processes to participate in +.Nm netgraph . +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 +cooperating user process. +.Pp +Another example is a device driver that presents +a node interface to the hardware. +.Sh Node Methods +Nodes are notified of the following actions via function calls +to the following node methods (all at +.Dv "splnet()" ) +and may accept or reject that action (by returning the appropriate +error code): +.Bl -tag -width xxx +.It Creation of a new node +The constructor for the type is called. If creation of a new node is +allowed, the constructor must call the generic node creation +function (in object-oriented terms, the superclass constructor) +and then allocate any special resources it needs. For nodes that +correspond to hardware, this is typically done during the device +attach routine. Often a global ASCII name corresponding to the +device name is assigned here as well. +.It Creation of a new hook +The hook is created and tentatively +linked to the node, and the node is told about the name that will be +used to describe this hook. The node sets up any special data structures +it needs, or may reject the connection, based on the name of the hook. +.It Successful connection of two hooks +After both ends have accepted their +hooks, and the links have been made, the nodes get a chance to +find out who their peer is across the link and can then decide to reject +the connection. Tear-down is automatic. +.It Destruction of a hook +The node is notified of a broken connection. The node may consider some hooks +to be critical to operation and others to be expendable: the disconnection +of one hook may be an acceptable event while for another it +may effect a total shutdown for the node. +.It Shutdown of a node +This method allows a node to clean up +and to ensure that any actions that need to be performed +at this time are taken. The method must call the generic (i.e., superclass) +node destructor to get rid of the generic components of the node. +Some nodes (usually associated with a piece of hardware) may be +.Em persistent +in that a shutdown breaks all edges and resets the node, +but doesn't remove it, in which case the generic destructor is not called. +.El +.Sh Sending and Receiving Data +Three other methods are also supported by all nodes: +.Bl -tag -width xxx +.It Receive data message +An mbuf chain is passed to the node. +The node is notified on which hook the data arrived, +and can use this information in its processing decision. +The node must must always +.Dv m_freem() +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. +.Pp +In addition to the mbuf chain itself there is also a pointer to a +structure describing meta-data about the message +(e.g. priority information). This pointer may be +.Dv NULL +if there is no additional information. The format for this information is +described in +.Dv netgraph.h . +The memory for meta-data must allocated via +.Dv malloc() +with type +.Dv M_NETGRAPH . +As with the data itself, it is the receiver's responsibility to +.Dv free() +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 +real data on is passed on, then a +.Dv NULL +pointer must be substituted. +.Pp +The receiving node may decide to defer the data by queueing it in the +.Nm +NETISR system (see below). +.Pp +The structure and use of meta-data is still experimental, but is presently used in +frame-relay to indicate that management packets should be queued for transmission +at a higher priority than data packets. This is required for +conformance with Frame Relay standards. +.Pp +.It Receive queued data message +Usually this will be the same function as +.Em Receive data message. +This is the entry point called when a data message is being handed to +the node after having been queued in the NETISR system. +This allows a node to decide in the +.Em Receive data message +method that a message should be defered and queued, +and be sure that when it is processed from the queue, +it will not be queued again. +.It Receive control message +This method is called when a control message is addressed to the node. +A return address is always supplied, giving the address of the node +that originated the message so a reply message can be sent anytime later. +.Pp +It is possible for a synchronous reply to be made, and in fact this +is more common in practice. +This is done by setting a pointer (supplied as an extra function parameter) +to point to the reply. +Then when the control message delivery function returns, +the caller can check if this pointer has been made non-NULL, +and if so then it points to the reply message allocated via +.Dv malloc() +and containing the synchronous response. In both directions, +(request and response) it is up to the +receiver of that message to +.Dv free() +the control message buffer. All control messages and replies are +allocated with +.Dv malloc() +type +.Dv M_NETGRAPH . +.El +.Pp +Much use has been made of reference counts, so that nodes being +free'd of all references are automatically freed, and this behaviour +has been tested and debugged to present a consistent and trustworthy +framework for the ``type module'' writer to use. +.Sh Addressing +The +.Nm +framework provides an unambiguous and simple to use method of specifically +addressing any single node in the graph. The naming of a node is +independent of its type, in that another node, or external component +need not know anything about the node's type in order to address it so as +to send it a generic message type. Node and hook names should be +chosen so as to make addresses meaningful. +.Pp +Addresses are either absolute or relative. An absolute address begins +with a node name, (or ID), followed by a colon, followed by a sequence of hook +names separated by periods. This addresses the node reached by starting +at the named node and following the specified sequence of hooks. +A relative address includes only the sequence of hook names, implicitly +starting hook traversal at the local node. +.Pp +There are a couple of special possibilities for the node name. +The name ``.'' (refered to as ``.:'') always refers to the local node. +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. +Here are some examples of valid netgraph addresses: +.Bd -literal -offset 4n -compact + + .: + foo: + .:hook1 + foo:hook1.hook2 + [f057cd80]:hook1 +.Ed +.Pp +Consider the following set of nodes might be created for a site with +a single physical frame relay line having two active logical DLCI channels, +with RFC-1490 frames on DLCI 16 and PPP frames over DLCI 20: +.Pp +.Bd -literal +[type SYNC ] [type FRAME] [type RFC1490] +[ "Frame1" ](uplink)<-->(data)[<un-named>](dlci16)<-->(mux)[<un-named> ] +[ A ] [ B ](dlci20)<---+ [ C ] + | + | [ type PPP ] + +>(mux)[<un-named>] + [ D ] +.Ed +.Pp +One could always send a control message to node C from anywhere +by using the name +.Em "Frame1:uplink.dlci16" . +Similarly, +.Em "Frame1:uplink.dlci20" +could reliably be used to reach node D, and node A could refer +to node B as +.Em ".:uplink" , +or simply +.Em "uplink" . +Conversely, B can refer to A as +.Em "data" . +The address +.Em "mux.data" +could be used by both nodes C and D to address a message to node A. +.Pp +Note that this is only for +.Em control messages . +Data messages are routed one hop at a time, by specifying the departing +hook, with each node making the next routing decision. So when B +receives a frame on hook +.Em data +it decodes the frame relay header to determine the DLCI, +and then forwards the unwrapped frame to either C or D. +.Pp +A similar graph might be used to represent multi-link PPP running +over an ISDN line: +.Pp +.Bd -literal +[ type BRI ](B1)<--->(link1)[ type MPP ] +[ "ISDN1" ](B2)<--->(link2)[ (no name) ] +[ ](D) <-+ + | + +----------------+ + | + +->(switch)[ type Q.921 ](term1)<---->(datalink)[ type Q.931 ] + [ (no name) ] [ (no name) ] +.Ed +.Sh Netgraph Structures +Interesting members of the node and hook structures are shown below: +.Bd -literal +struct ng_node { + char *name; /* Optional globally unique name */ + void *private; /* Node implementation private info */ + struct ng_type *type; /* The type of this node */ + int refs; /* Number of references to this struct */ + int numhooks; /* Number of connected hooks */ + hook_p hooks; /* Linked list of (connected) hooks */ +}; +typedef struct ng_node *node_p; + +struct ng_hook { + char *name; /* This node's name for this hook */ + void *private; /* Node implementation private info */ + int refs; /* Number of references to this struct */ + struct ng_node *node; /* The node this hook is attached to */ + struct ng_hook *peer; /* The other hook in this connected pair */ + struct ng_hook *next; /* Next in list of hooks for this node */ +}; +typedef struct ng_hook *hook_p; +.Ed +.Pp +The maintenance of the name pointers, reference counts, and linked list +of hooks for each node is handled automatically by the +.Nm +subsystem. +Typically a node's private info contains a back-pointer to the node or hook +structure, which counts as a new reference that must be registered by +incrementing +.Dv "node->refs" . +.Pp +From a hook you can obtain the corresponding node, and from +a node the list of all active hooks. +.Pp +Node types are described by this structure: +.Bd -literal +struct ng_type { + u_int32_t version; /* Must equal NG_VERSION */ + const char *name; /* Unique type name */ + + /* Module event handler */ + modeventhand_t mod_event; /* Handle load/unload (optional) */ + + /* Constructor */ + int (*constructor)(node_p *node); /* Create a new node */ + + /** Methods using the node **/ + int (*rcvmsg)(node_p node, /* Receive control message */ + struct ng_mesg *msg, /* The message */ + const char *retaddr, /* Return address */ + struct ng_mesg **resp); /* Synchronous response */ + int (*shutdown)(node_p node); /* Shutdown this node */ + int (*newhook)(node_p node, /* create a new hook */ + hook_p hook, /* Pre-allocated struct */ + const char *name); /* Name for new hook */ + + /** Methods using the hook **/ + int (*connect)(hook_p hook); /* Confirm new hook attachment */ + int (*rcvdata)(hook_p hook, /* Receive data on a hook */ + struct mbuf *m, /* The data in an mbuf */ + meta_p meta); /* Meta-data, if any */ + int (*disconnect)(hook_p hook); /* Notify disconnection of hook */ +}; +.Ed +.Pp +Control messages have the following structure: +.Bd -literal +#define NG_CMDSTRLEN 15 /* Max command string (16 with null) */ + +struct ng_mesg { + struct ng_msghdr { + u_char version; /* Must equal NG_VERSION */ + u_char spare; /* Pad to 2 bytes */ + u_short arglen; /* Length of cmd/resp data */ + u_long flags; /* Message status flags */ + u_long token; /* Reply should have the same token */ + u_long typecookie; /* Node type understanding this message */ + u_long cmd; /* Command identifier */ + u_char cmdstr[NG_CMDSTRLEN+1]; /* Cmd string (for debug) */ + } header; + char data[0]; /* Start of cmd/resp data */ +}; + +#define NG_VERSION 1 /* Netgraph version */ +#define NGF_ORIG 0x0000 /* Command */ +#define NGF_RESP 0x0001 /* Response */ +.Ed +.Pp +Control messages have the fixed header shown above, followed by a +variable length data section which depends on the type cookie +and the command. Each field is explained below: +.Bl -tag -width xxx +.It Dv version +Indicates the version of netgraph itself. The current version is +.Dv NG_VERSION . +.It Dv arglen +This is the length of any extra arguments, which begin at +.Dv data . +.It Dv flags +Indicates whether this is a command or a response control message. +.It Dv token +The +.Dv token +is a means by which a sender can match a reply message to the +corresponding command message; the reply always has the same token. +.Pp +.It Dv typecookie +The corresponding node type's unique 32-bit value. +If a node doesn't recognize the type cookie it must reject the message +by returning +.Er EINVAL . +.Pp +Each type should have an include file that defines the commands, +argument format, and cookie for its own messages. +The typecookie +insures that the same header file was included by both sender and +receiver; when an incompatible change in the header file is made, +the typecookie +.Em must +be changed. +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 +(i.e., the output of +.Dv "date -u +'%s'" ")." +.Pp +There is a predefined typecookie +.Dv NGM_GENERIC_COOKIE +for the ``generic'' node type, and +a corresponding set of generic messages which all nodes understand. +The handling of these messages is automatic. +.It Dv command +The identifier for the message command. This is type specific, +and is defined in the same header file as the typecookie. +.It Dv cmdstr +Room for a short human readable version of ``command'' (for debugging +purposes only). +.El +.Pp +Some modules may choose to implement messages from more than one +of the header files and thus recognize more than one type cookie. +.Sh Generic Control Messages +There are a number of standard predefined messages that will work +for any node, as they are supported directly by the framework itself. +These are defined in +.Dv ng_message.h +along with the basic layout of messages and other similar information. +.Bl -tag -width xxx +.It Dv NGM_CONNECT +Connect to another node, using the supplied hook names on either end. +.It Dv NGM_MKPEER +Construct a node of the given type and then connect to it using the +supplied hook names. +.It Dv NGM_SHUTDOWN +The target node should disconnect from all its neighbours and shut down. +Persistent nodes such as those representing physical hardware +might not dissappear from the node namespace, but only reset themselves. +The node must disconnect all of its hooks. +This may result in neighbors shutting themselves down, and possibly a +cascading shutdown of the entire connected graph. +.It Dv NGM_NAME +Assign a name to a node. Nodes can exist without having a name, and this +is the default for nodes created using the +.Dv NGM_MKPEER +method. Such nodes can only be addressed relatively or by their ID number. +.It Dv NGM_RMHOOK +Ask the node to break a hook connection to one of its neighbours. +Both nodes will have their ``disconnect'' method invoked. +Either node may elect to totally shut down as a result. +.It Dv NGM_NODEINFO +Asks the target node to describe itself. The four returned fields +are the node name (if named), the node type, the node ID and the +number of hooks attached. The ID is an internal number unique to that node. +.It Dv NGM_LISTHOOKS +This returns the information given by +.Dv NGM_NODEINFO , +but in addition +includes an array of fields describing each link, and the desription for +the node at the far end of that link. +.It Dv NGM_LISTNAMES +This returns an array of node descriptions (as for +.Dv NGM_NODEINFO ")" +where each entry of the array describes a named node. +All named nodes will be described. +.It Dv NGM_LISTNODES +This is the same as +.Dv NGM_LISTNAMES +except that all nodes are listed regardless of whether they have a name or not. +.It Dv NGM_LISTTYPES +This returns a list of all currently installed netgraph types. +.It Dv NGM_TEXT_STATUS +The node may return a text formatted status message. +The status information is determined entirely by the node type. +It is the only "generic" message +that requires any support within the node itself and as such the node may +elect to not support this message. The text response must be less than +.Dv NG_TEXTRESPONSE +bytes in length (presently 1024). This can be used to return general +status information in human readable form. +.El +.Sh Metadata +Data moving through the +.Nm +system can be accompanied by meta-data that describes some +aspect of that data. The form of the meta-data is a fixed header, +which contains enough information for most uses, and can optionally +be suplemented by trailing +.Em option +structures, which contain a +.Em cookie +(see the section on control messages), an identifier, a length and optional +data. If a node does not recognize the cookie associated with an option, +it should ignore that option. +.Pp +Meta data might include such things as priority, discard eligibility, +or special processing requirements. It might also mark a packet for +debug status, etc. The use of meta-data is still experimental. +.Sh INITIALIZATION +The base +.Nm +code may either be statically compiled +into the kernel or else loaded dynamically as a KLD via +.Xr kldload 8 . +In the former case, include +.Bd -literal -offset 4n -compact + + options NETGRAPH + +.Ed +in your kernel configuration file. You may also include selected +node types in the kernel compilation, for example: +.Bd -literal -offset 4n -compact + + options NETGRAPH + options NETGRAPH_SOCKET + options NETGRAPH_ECHO + +.Ed +.Pp +Once the +.Nm +subsystem is loaded, individual node types may be loaded at any time +as KLD modules via +.Xr kldload 8 . +Moreover, +.Nm +knows how to automatically do this; when a request to create a new +node of unknown type +.Em type +is made, +.Nm +will attempt to load the KLD module +.Dv ng_type.ko . +.Pp +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. +.Pp +In general, new types can be installed at any time from within the +kernel by calling +.Dv ng_newtype() , +supplying a pointer to the type's +.Dv struct ng_type +structure. +.Pp +The +.Dv "NETGRAPH_INIT()" +macro automates this process by using a linker set. +.Sh EXISTING NODE TYPES +Several node types currently exist. Each is fully documented +in its own man page: +.Bl -tag -width xxx +.It SOCKET +The socket type implements two new sockets in the new protocol domain +.Dv PF_NETGRAPH . +The new sockets protocols are +.Dv NG_DATA +and +.Dv NG_CONTROL , +both of type +.Dv SOCK_DGRAM . +Typically one of each is associated with a socket node. +When both sockets have closed, the node will shut down. The +.Dv NG_DATA +socket is used for sending and receiving data, while the +.Dv NG_CONTROL +socket is used for sending and receiving control messages. +Data and control messages are passed using the +.Xr sendto 2 +and +.Xr recvfrom 2 +calls, using a +.Dv struct sockaddr_ng +socket address. +.Pp +.It HOLE +Responds only to generic messages and is a ``black hole'' for data, +Useful for testing. Always accepts new hooks. +.Pp +.It ECHO +Responds only to generic messages and always echoes data back through the +hook from which it arrived. Returns any non generic messages as their +own response. Useful for testing. Always accepts new hooks. +.Pp +.It TEE +This node is useful for ``snooping.'' It has 4 hooks: +.Dv left , +.Dv right , +.Dv left2right , +and +.Dv right2left . +Data entering from the right is passed to the left and duplicated on +.Dv right2left, +and data entering from the left is passed to the right and +duplicated on +.Dv left2right . +Data entering from +.Dv left2right +is sent to the right and data from +.Dv right2left +to left. +.Pp +.It RFC1490 MUX +Encapsulates/de-encapsulates frames encoded according to RFC 1490. +Has a hook for the encapsulated packets (``downstream'') and one hook +for each protocol (i.e., IP, PPP, etc.). +.Pp +.It FRAME RELAY MUX +Encapsulates/de-encapsulates Frame Relay frames. +Has a hook for the encapsulated packets (``downstream'') and one hook +for each DLCI. +.Pp +.It FRAME RELAY LMI +Automatically handles frame relay +``LMI'' (link management interface) operations and packets. +Automatically probes and detects whch of several LMI standards +is in use at the exchange. +.Pp +.It TTY +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 +node. It has a programmable ``hotkey'' character. +.Pp +.It ASYNC +This node encapsulates and de-encapsulates asynchronous frames +according to RFC 1662. This is used in conjunction with the TTY node +type for supporting PPP links over asynchronous serial lines. +.Pp +.It INTERFACE +This node is also a system networking interface. It has hooks representing +each protocol family (IP, AppleTalk, IPX, etc.) and appears in the output of +.Xr ifconfig 8 . +The interfaces are named +.Em ng0 , +.Em ng1 , +etc. +.El +.Sh NOTES +Whether a named node exists can be checked by trying to send a control mesage +to it (e.g., +.Dv NGM_NODEINFO +). +If it does not exist, +.Er ENOENT +will be returned. +.Pp +All data messages are mbuf chains with the M_PKTHDR flag set. +.Pp +Nodes are responsible for freeing what they allocate. +There are three exceptions: +.Bl -tag -width xxxx +.It 1 +Mbufs sent across a data link are never to be freed by the sender. +.It 2 +Any meta-data information travelling with the data has the same restriction. +It might be freed by any node the data passes through, and a +.Dv NULL +passed onwards, but the caller will never free it. +Two macros +.Dv "NG_FREE_META(meta)" +and +.Dv "NG_FREE_DATA(m, meta)" +should be used if possible to free data and meta data (see +.Dv netgraph.h ")." +.It 3 +Messages sent using +.Dv ng_send_message() +are freed by the callee. As in the case above, the addresses +associated with the message are freed by whatever allocated them so the +recipient should copy them if it wants to keep that information. +.El +.Sh FILES +.Bl -tag -width xxxxx -compact +.It Pa /sys/netgraph/netgraph.h +Definitions for use soley within the kernel by +.Nm +nodes. +.It Pa /sys/netgraph/ng_message.h +Definitions needed by any file that needs to deal with +.Nm +messages. +.It Pa /sys/netgraph/ng_socket.h +Definitions needed to use +.Nm +socket type nodes. +.It Pa /sys/netgraph/ng_{type}.h +Definitions needed to use +.Nm +{type} +nodes, including the type cookie definition. +.It Pa /modules/netgraph.ko +Netgraph subsystem loadable KLD module. +.It Pa /modules/ng_{type}.ko +Loadable KLD module for node type {type}. +.El +.Sh USER MODE SUPPORT +There is a library for supporting user-mode programs that wish +to interact with the netgraph system. See +.Xr netgraph 3 +for details. +.Pp +Two user-mode support programs, +.Xr ngctl 8 +and +.Xr nghook 8 , +are available to assist manual configuration and debugging. +.Pp +There are a few useful techniques for debugging new node types. +First, implementing new node types in user-mode first +makes debugging easier. +The +.Em tee +node type is also useful for debugging, especially in conjunction with +.Xr ngctl 8 +and +.Xr nghook 8 . +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 3 , +.Xr ngctl 8 , +.Xr nghook 8 , +.Xr ng_async 8 . +.Xr ng_cisco 8 . +.Xr ng_echo 8 . +.Xr ng_frame_relay 8 . +.Xr ng_hole 8 . +.Xr ng_iface 8 . +.Xr ng_lmi 8 . +.Xr ng_rfc1490 8 . +.Xr ng_socket 8 . +.Xr ng_tee 8 . +.Xr ng_tty 8 . +.Xr ng_UI 8 . +.Xr ng_{type} 8 . +.Sh HISTORY +The +.Nm +system was designed and first implemented at Whistle Communications, Inc. +in a version FreeBSD 2.2 customized for the Whistle InterJet. +.Sh AUTHORS +Julian Elischer <julian@whistle.com>, with contributions by +Archie Cobbs <archie@whistle.com>. diff --git a/sys/modules/netgraph/ppp/Makefile b/sys/modules/netgraph/ppp/Makefile new file mode 100644 index 000000000000..590e10ac1c4f --- /dev/null +++ b/sys/modules/netgraph/ppp/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/24 02:52:12 archie Exp $ + +KMOD= ng_ppp +SRCS= ng_ppp.c +MAN8= ng_ppp.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/ppp/ng_ppp.4 b/sys/modules/netgraph/ppp/ng_ppp.4 new file mode 100644 index 000000000000..cffa78ee186e --- /dev/null +++ b/sys/modules/netgraph/ppp/ng_ppp.4 @@ -0,0 +1,164 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_ppp.8,v 1.3 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_PPP 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_ppp +.Nd PPP protocol multiplexor negraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ppp.h> +.Sh DESCRIPTION +The +.Nm ppp +node type performs multiplexing for the PPP protocol. On the +.Dv downstream +hook it transmits and receives full PPP frames, which include the +protocol field, but no address, control or checksum fields. +On outgoing frames, when protocol compression has been enabled and +the protocol number is suitable for compression, the protocol field will +be compressed (i.e., sent as one byte instead of two). +Either compressed or uncompressed protocol fields are accepted +on incoming frames. +.Pp +For each 16-bit PPP procotol number there is a corresponding ``upstream'' hook. +Packets on these hooks contain no PPP protocol header. +The node simply multiplexes between the +.Dv downstream +hook and all of the upstream hooks by adding or subtracting the +PPP protocol field, depending on the direction of flow. +.Pp +When a frame is received on +.Dv downstream , +if the corresponding protocol hook is +not connected, the packet is forwarded to a special upstream hook called +.Dv bypass . +This hook is a catch-all for any incoming frames not destined +for another already connected hook. Packets sent out on the +.Dv bypass +hook always have the PPP protcol header prepended as the first +two bytes (even if the +original incoming frame was protocol compressed to one byte). +.Pp +Any frames received on the +.Dv bypass +hook are forwarded to +.Dv downstream +without modification. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazi +.It Dv downstream +Connection to the PPP link layer. +.It Dv bypass +Frames that do not correspond to a connected protocol hook; +the PPP protocol header is included. +.It Dv 0xNNNN +Conection to the PPP protocol with 16-bit hex value +.Dv NNNN . +No PPP protocol header is included. +.El +.Pp +For convenience, the +.Nm +node type defines several hook name aliases for common PPP protocols: +.Pp +.Bl -tag -width abcdefgh -compact -offset 4n +.It Dv lcp +LCP protocol data (0xc021) +.It Dv ipcp +IPCP protocol data (0x8021) +.It Dv atcp +ATCP protocol data (0x8029) +.It Dv ccp +CCP protocol data (0x80fd) +.It Dv ecp +ECP protocol data (0x8053) +.It Dv ip +IP protocol data (0x0021) +.It Dv vjcomp +Van Jacobsen compressed TCP data (0x002d) +.It Dv vjuncomp +Van Jacobsen uncompressed TCP data (0x002f) +.It Dv mp +Multi-link protocol data (0x003d) +.It Dv compd +Compressed protocol data (0x00fd) +.It Dv cryptd +Encrypted protocol data (0x0053) +.It Dv pap +PAP authentication protocol data (0xc023) +.It Dv chap +CHAP authentication protocol data (0xc223) +.It Dv lqr +LQR protocol data (0xc025) +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPP_SET_PROTOCOMP +This command takes a single integer as argument and enables or disables +protocol field compression as the value is zero or non-zero. +Note that only protocols with high order byte equal to +.Dv 0x00 +are compressible. +.It Dv NGM_PPP_GET_STATS +This command returns a +.Dv "struct ng_ppp_stat" +containing various node statistics. +.It Dv NGM_PPP_CLR_STATS +Clears the node statistics. Statistics are also cleared whenever the +.Dv downstream +hook is reconnected. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_async 8 , +.Xr ng_vjc 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "The Point-to-Point Protocol (PPP)" +.%O RFC 1661 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/ppp/ng_ppp.8 b/sys/modules/netgraph/ppp/ng_ppp.8 new file mode 100644 index 000000000000..cffa78ee186e --- /dev/null +++ b/sys/modules/netgraph/ppp/ng_ppp.8 @@ -0,0 +1,164 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_ppp.8,v 1.3 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_PPP 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_ppp +.Nd PPP protocol multiplexor negraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ppp.h> +.Sh DESCRIPTION +The +.Nm ppp +node type performs multiplexing for the PPP protocol. On the +.Dv downstream +hook it transmits and receives full PPP frames, which include the +protocol field, but no address, control or checksum fields. +On outgoing frames, when protocol compression has been enabled and +the protocol number is suitable for compression, the protocol field will +be compressed (i.e., sent as one byte instead of two). +Either compressed or uncompressed protocol fields are accepted +on incoming frames. +.Pp +For each 16-bit PPP procotol number there is a corresponding ``upstream'' hook. +Packets on these hooks contain no PPP protocol header. +The node simply multiplexes between the +.Dv downstream +hook and all of the upstream hooks by adding or subtracting the +PPP protocol field, depending on the direction of flow. +.Pp +When a frame is received on +.Dv downstream , +if the corresponding protocol hook is +not connected, the packet is forwarded to a special upstream hook called +.Dv bypass . +This hook is a catch-all for any incoming frames not destined +for another already connected hook. Packets sent out on the +.Dv bypass +hook always have the PPP protcol header prepended as the first +two bytes (even if the +original incoming frame was protocol compressed to one byte). +.Pp +Any frames received on the +.Dv bypass +hook are forwarded to +.Dv downstream +without modification. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazi +.It Dv downstream +Connection to the PPP link layer. +.It Dv bypass +Frames that do not correspond to a connected protocol hook; +the PPP protocol header is included. +.It Dv 0xNNNN +Conection to the PPP protocol with 16-bit hex value +.Dv NNNN . +No PPP protocol header is included. +.El +.Pp +For convenience, the +.Nm +node type defines several hook name aliases for common PPP protocols: +.Pp +.Bl -tag -width abcdefgh -compact -offset 4n +.It Dv lcp +LCP protocol data (0xc021) +.It Dv ipcp +IPCP protocol data (0x8021) +.It Dv atcp +ATCP protocol data (0x8029) +.It Dv ccp +CCP protocol data (0x80fd) +.It Dv ecp +ECP protocol data (0x8053) +.It Dv ip +IP protocol data (0x0021) +.It Dv vjcomp +Van Jacobsen compressed TCP data (0x002d) +.It Dv vjuncomp +Van Jacobsen uncompressed TCP data (0x002f) +.It Dv mp +Multi-link protocol data (0x003d) +.It Dv compd +Compressed protocol data (0x00fd) +.It Dv cryptd +Encrypted protocol data (0x0053) +.It Dv pap +PAP authentication protocol data (0xc023) +.It Dv chap +CHAP authentication protocol data (0xc223) +.It Dv lqr +LQR protocol data (0xc025) +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPP_SET_PROTOCOMP +This command takes a single integer as argument and enables or disables +protocol field compression as the value is zero or non-zero. +Note that only protocols with high order byte equal to +.Dv 0x00 +are compressible. +.It Dv NGM_PPP_GET_STATS +This command returns a +.Dv "struct ng_ppp_stat" +containing various node statistics. +.It Dv NGM_PPP_CLR_STATS +Clears the node statistics. Statistics are also cleared whenever the +.Dv downstream +hook is reconnected. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_async 8 , +.Xr ng_vjc 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "The Point-to-Point Protocol (PPP)" +.%O RFC 1661 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/pppoe/Makefile b/sys/modules/netgraph/pppoe/Makefile new file mode 100644 index 000000000000..ed3756f1a492 --- /dev/null +++ b/sys/modules/netgraph/pppoe/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_pppoe +SRCS= ng_pppoe.c +MAN8= ng_pppoe.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/pppoe/ng_pppoe.4 b/sys/modules/netgraph/pppoe/ng_pppoe.4 new file mode 100644 index 000000000000..fc0ba24f854e --- /dev/null +++ b/sys/modules/netgraph/pppoe/ng_pppoe.4 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_lmi.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_LMI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_lmi +.Nd Frame relay LMI protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_lmi.h> +.Sh DESCRIPTION +The +.Nm lmi +node type performs the frame relay LMI protocol. It supports +the ITU Annex A, ANSI Annex D, and Group-of-four LMI types. +It also supports auto-detection of the LMI type. +.Pp +To enable a specific LMI type, connect the corresponding hook ( +.Dv annexA , +.Dv annexD , +or +.Dv group4 ")" +to DLCI 0 or 1023 of a +.Xr ng_frame_relay 8 +node. +Typically, Annex A and Annex D live on DLCI 0 while Group-of-four +lives on DLCI 1023. +.Pp +To enable LMI type auto-detection, connect the +.Dv auto0 +hook to DLCI 0 and the +.Dv auto1023 +hook to DLCI 1023. The node will attempt to automatically determine +which LMI type is running at the switch, and go into that mode. +.Pp +Only one fixed LMI type, or auto-detection, can be active at any given time. +.Pp +The +.Dv NGM_LMI_GET_STATUS +control message can be used at any time to query the current status +of the LMI protocol and each DLCI channel. This node also supports the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv annexA +ITU Annex A LMI hook. +.It Dv annexD +ANSI Annex D LMI hook. +.It Dv group4 +Group-of-four LMI hook. +.It Dv auto0 +Auto-detection hook for DLCI 0. +.It Dv auto1023 +Auto-detection hook for DLCI 1023. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_LMI_GET_STATUS +This command returns status information in a +.Dv "struct nglmistat" : +.Bd -literal -offset 4n +#define NGM_LMI_STAT_ARYSIZE (1024/8) + +struct nglmistat { + u_char proto[12]; /* Active proto (same as hook name) */ + u_char hook[12]; /* Active hook */ + u_char fixed; /* If set to fixed LMI mode */ + u_char autod; /* If currently auto-detecting */ + u_char seen[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs seen */ + u_char up[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs up */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ngctl 8 . +.Rs +.%T "ANSI T1.617-1991 Annex D" +.Re +.Rs +.%T "ITU-T Q.933 Digital Subscriber Signalling System No. 1 - Signalling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/pppoe/ng_pppoe.8 b/sys/modules/netgraph/pppoe/ng_pppoe.8 new file mode 100644 index 000000000000..fc0ba24f854e --- /dev/null +++ b/sys/modules/netgraph/pppoe/ng_pppoe.8 @@ -0,0 +1,130 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_lmi.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_LMI 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_lmi +.Nd Frame relay LMI protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_lmi.h> +.Sh DESCRIPTION +The +.Nm lmi +node type performs the frame relay LMI protocol. It supports +the ITU Annex A, ANSI Annex D, and Group-of-four LMI types. +It also supports auto-detection of the LMI type. +.Pp +To enable a specific LMI type, connect the corresponding hook ( +.Dv annexA , +.Dv annexD , +or +.Dv group4 ")" +to DLCI 0 or 1023 of a +.Xr ng_frame_relay 8 +node. +Typically, Annex A and Annex D live on DLCI 0 while Group-of-four +lives on DLCI 1023. +.Pp +To enable LMI type auto-detection, connect the +.Dv auto0 +hook to DLCI 0 and the +.Dv auto1023 +hook to DLCI 1023. The node will attempt to automatically determine +which LMI type is running at the switch, and go into that mode. +.Pp +Only one fixed LMI type, or auto-detection, can be active at any given time. +.Pp +The +.Dv NGM_LMI_GET_STATUS +control message can be used at any time to query the current status +of the LMI protocol and each DLCI channel. This node also supports the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv annexA +ITU Annex A LMI hook. +.It Dv annexD +ANSI Annex D LMI hook. +.It Dv group4 +Group-of-four LMI hook. +.It Dv auto0 +Auto-detection hook for DLCI 0. +.It Dv auto1023 +Auto-detection hook for DLCI 1023. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_LMI_GET_STATUS +This command returns status information in a +.Dv "struct nglmistat" : +.Bd -literal -offset 4n +#define NGM_LMI_STAT_ARYSIZE (1024/8) + +struct nglmistat { + u_char proto[12]; /* Active proto (same as hook name) */ + u_char hook[12]; /* Active hook */ + u_char fixed; /* If set to fixed LMI mode */ + u_char autod; /* If currently auto-detecting */ + u_char seen[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs seen */ + u_char up[NGM_LMI_STAT_ARYSIZE]; /* bitmap DLCIs up */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ngctl 8 . +.Rs +.%T "ANSI T1.617-1991 Annex D" +.Re +.Rs +.%T "ITU-T Q.933 Digital Subscriber Signalling System No. 1 - Signalling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/rfc1490/Makefile b/sys/modules/netgraph/rfc1490/Makefile new file mode 100644 index 000000000000..ac7562dafaf2 --- /dev/null +++ b/sys/modules/netgraph/rfc1490/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $ + +KMOD= ng_rfc1490 +SRCS= ng_rfc1490.c +MAN8= ng_rfc1490.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/rfc1490/ng_rfc1490.4 b/sys/modules/netgraph/rfc1490/ng_rfc1490.4 new file mode 100644 index 000000000000..c7fa85998146 --- /dev/null +++ b/sys/modules/netgraph/rfc1490/ng_rfc1490.4 @@ -0,0 +1,109 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_rfc1490.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_RFC1490 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_rfc1490 +.Nd RFC 1490 netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_rfc1490.h> +.Sh DESCRIPTION +The +.Nm rfc1490 +node type performs protocol encapsulation, de-encapsulation, and +multiplexing according to RFC 1490 (which has since been updated by RFC 2427). +This particular type of encapsulation is often used on top of frame relay +DLCI channels. +.Pp +The +.Dv downstream +hook is used to transmit and receive encapsulated frames. On the other +side of the node, the +.Dv inet +and +.Dv ppp +hooks are used to transmit and receive raw IP frames and PPP frames, +respectively. PPP frames are transmitted and received according to +RFC 1973; in particular, frames appearing on the +.Dv ppp +hook begin with the PPP protocol number. +.Pp +Typically the +.Dv inet +hook is connected to the +.Dv inet +hook of an +.Xr ng_iface 8 +node. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazum +.It Dv downstream +Connects to the RFC 1490 peer entity. +.It Dv inet +Transmits and receives raw IP frames. +.It Dv ppp +Transmits and receives PPP frames. +.El +.Sh CONTROL MESSAGES +This node type only supports the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +Not all of RFC 1490 is implemented. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A C. Brown, A. Malis +.%T "Multiprotocol Interconnect over Frame Relay" +.%O RFC 2427 +.Re +.Rs +.%A W. Simpson +.%T "PPP in Frame Relay" +.%O RFC 1973 +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/rfc1490/ng_rfc1490.8 b/sys/modules/netgraph/rfc1490/ng_rfc1490.8 new file mode 100644 index 000000000000..c7fa85998146 --- /dev/null +++ b/sys/modules/netgraph/rfc1490/ng_rfc1490.8 @@ -0,0 +1,109 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_rfc1490.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_RFC1490 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_rfc1490 +.Nd RFC 1490 netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_rfc1490.h> +.Sh DESCRIPTION +The +.Nm rfc1490 +node type performs protocol encapsulation, de-encapsulation, and +multiplexing according to RFC 1490 (which has since been updated by RFC 2427). +This particular type of encapsulation is often used on top of frame relay +DLCI channels. +.Pp +The +.Dv downstream +hook is used to transmit and receive encapsulated frames. On the other +side of the node, the +.Dv inet +and +.Dv ppp +hooks are used to transmit and receive raw IP frames and PPP frames, +respectively. PPP frames are transmitted and received according to +RFC 1973; in particular, frames appearing on the +.Dv ppp +hook begin with the PPP protocol number. +.Pp +Typically the +.Dv inet +hook is connected to the +.Dv inet +hook of an +.Xr ng_iface 8 +node. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazum +.It Dv downstream +Connects to the RFC 1490 peer entity. +.It Dv inet +Transmits and receives raw IP frames. +.It Dv ppp +Transmits and receives PPP frames. +.El +.Sh CONTROL MESSAGES +This node type only supports the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +Not all of RFC 1490 is implemented. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_frame_relay 8 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A C. Brown, A. Malis +.%T "Multiprotocol Interconnect over Frame Relay" +.%O RFC 2427 +.Re +.Rs +.%A W. Simpson +.%T "PPP in Frame Relay" +.%O RFC 1973 +.Re +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/socket/Makefile b/sys/modules/netgraph/socket/Makefile new file mode 100644 index 000000000000..d2779b3cb16a --- /dev/null +++ b/sys/modules/netgraph/socket/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $ + +KMOD= ng_socket +SRCS= ng_socket.c +MAN8= ng_socket.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/socket/ng_socket.4 b/sys/modules/netgraph/socket/ng_socket.4 new file mode 100644 index 000000000000..31302a5a8995 --- /dev/null +++ b/sys/modules/netgraph/socket/ng_socket.4 @@ -0,0 +1,127 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_socket.8,v 1.5 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_SOCKET 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_socket +.Nd netgraph socket node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_message.h> +.Fd #include <netgraph/ng_socket.h> +.Sh DESCRIPTION +A +.Nm socket +node is both a BSD socket and a netgraph node. The +.Nm socket +node type allows user-mode processes to participate in the kernel +.Xr netgraph 4 +networking subsystem using the BSD socket interface. +.Pp +A new +.Nm socket +node is created by creating a new socket of type +.Dv NG_CONTROL +in the protocol family +.Dv PF_NETGRAPH , +using the +.Xr socket 2 +system call. +Any control messages received by the node are received using +.Xr recvfrom 2 ; +the socket address argument is a +.Dv "struct sockaddr_ng" +containing the sender's netgraph address. Conversely, control messages +can be sent to any node by calling +.Xr sendto 2 , +supplying the recipient's address in a +.Dv "struct sockaddr_ng" . +The +.Xr bind 2 +system call may be used to assign a global netgraph name to the node. +.Pp +To transmit and receive netgraph data packets, a +.Dv NG_DATA +socket must also be created using +.Xr socket 2 +and associated with a +.Nm socket +node. +.Dv NG_DATA sockets do not automatically +have nodes associated with them; they are bound to a specific node via the +.Xr connect 2 +system call. The address argument is the netgraph address of the +.Nm socket +node already created. Once a data socket is associated with a node, +any data packets received by the node are read using +.Xr recvfrom 2 +and any packets to be sent out from the node are written using +.Xr sendto 2 . +In the case of data sockets, the +.Dv "struct sockaddr_ng" +contains the name of the +.Em hook +on which the data was received or should be sent. +.Pp +There is a user library that simplifies using netgraph sockets; see +.Xr netgraph 3 . +.Sh HOOKS +This node type supports hooks with arbitrary names (as long as +they are unique) and always accepts hook connection requests. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node type shuts down and disappears when both the associated +.Dv NG_CONTROL +and +.Dv NG_DATA +sockets have been closed, or a +.Dv NGM_SHUTDOWN +control message is received. In the latter case, attempts to write +to the still-open sockets will return +.Er ENOTCONN . +.Sh BUGS +It is not possible to reject the connection of a hook, though any +data received on that hook can certainly be ignored. +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/socket/ng_socket.8 b/sys/modules/netgraph/socket/ng_socket.8 new file mode 100644 index 000000000000..31302a5a8995 --- /dev/null +++ b/sys/modules/netgraph/socket/ng_socket.8 @@ -0,0 +1,127 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_socket.8,v 1.5 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_SOCKET 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_socket +.Nd netgraph socket node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_message.h> +.Fd #include <netgraph/ng_socket.h> +.Sh DESCRIPTION +A +.Nm socket +node is both a BSD socket and a netgraph node. The +.Nm socket +node type allows user-mode processes to participate in the kernel +.Xr netgraph 4 +networking subsystem using the BSD socket interface. +.Pp +A new +.Nm socket +node is created by creating a new socket of type +.Dv NG_CONTROL +in the protocol family +.Dv PF_NETGRAPH , +using the +.Xr socket 2 +system call. +Any control messages received by the node are received using +.Xr recvfrom 2 ; +the socket address argument is a +.Dv "struct sockaddr_ng" +containing the sender's netgraph address. Conversely, control messages +can be sent to any node by calling +.Xr sendto 2 , +supplying the recipient's address in a +.Dv "struct sockaddr_ng" . +The +.Xr bind 2 +system call may be used to assign a global netgraph name to the node. +.Pp +To transmit and receive netgraph data packets, a +.Dv NG_DATA +socket must also be created using +.Xr socket 2 +and associated with a +.Nm socket +node. +.Dv NG_DATA sockets do not automatically +have nodes associated with them; they are bound to a specific node via the +.Xr connect 2 +system call. The address argument is the netgraph address of the +.Nm socket +node already created. Once a data socket is associated with a node, +any data packets received by the node are read using +.Xr recvfrom 2 +and any packets to be sent out from the node are written using +.Xr sendto 2 . +In the case of data sockets, the +.Dv "struct sockaddr_ng" +contains the name of the +.Em hook +on which the data was received or should be sent. +.Pp +There is a user library that simplifies using netgraph sockets; see +.Xr netgraph 3 . +.Sh HOOKS +This node type supports hooks with arbitrary names (as long as +they are unique) and always accepts hook connection requests. +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node type shuts down and disappears when both the associated +.Dv NG_CONTROL +and +.Dv NG_DATA +sockets have been closed, or a +.Dv NGM_SHUTDOWN +control message is received. In the latter case, attempts to write +to the still-open sockets will return +.Er ENOTCONN . +.Sh BUGS +It is not possible to reject the connection of a hook, though any +data received on that hook can certainly be ignored. +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/tee/Makefile b/sys/modules/netgraph/tee/Makefile new file mode 100644 index 000000000000..118668f05634 --- /dev/null +++ b/sys/modules/netgraph/tee/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $ + +KMOD= ng_tee +SRCS= ng_tee.c +MAN8= ng_tee.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/tee/ng_tee.4 b/sys/modules/netgraph/tee/ng_tee.4 new file mode 100644 index 000000000000..cfcb02f031b1 --- /dev/null +++ b/sys/modules/netgraph/tee/ng_tee.4 @@ -0,0 +1,110 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_tee.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_TEE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_tee +.Nd netgraph ``tee'' node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_tee.h> +.Sh DESCRIPTION +The +.Nm tee +node type has a purpose similar to the +.Xr tee 1 +command. +.Nm Tee +nodes are useful for debugging or ``snooping'' on a connection +between two netgraph nodes. +.Nm Tee +nodes have four hooks, +.Dv right , +.Dv left , +.Dv right2left , +and +.Dv left2right . +All data received on +.Dv right +is sent unmodified to +.Em both +hooks +.Dv left +and +.Dv right2left . +Similarly, all data received on +.Dv left +is sent unmodified to both +.Dv right +and +.Dv left2right . +.Pp +Packets may also be received on +.Dv right2left +and +.Dv left2right ; +if so, they are forwarded unchanged out hooks +.Dv left +and +.Dv right , +respectively. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbarfoo +.It Dv right +The connection to the node on the right. +.It Dv left +The connection to the node on the left. +.It Dv right2left +Tap for right to left traffic. +.It Dv left2right +Tap for left to right traffic. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr tee 1 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/tee/ng_tee.8 b/sys/modules/netgraph/tee/ng_tee.8 new file mode 100644 index 000000000000..cfcb02f031b1 --- /dev/null +++ b/sys/modules/netgraph/tee/ng_tee.8 @@ -0,0 +1,110 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_tee.8,v 1.4 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_TEE 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_tee +.Nd netgraph ``tee'' node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_tee.h> +.Sh DESCRIPTION +The +.Nm tee +node type has a purpose similar to the +.Xr tee 1 +command. +.Nm Tee +nodes are useful for debugging or ``snooping'' on a connection +between two netgraph nodes. +.Nm Tee +nodes have four hooks, +.Dv right , +.Dv left , +.Dv right2left , +and +.Dv left2right . +All data received on +.Dv right +is sent unmodified to +.Em both +hooks +.Dv left +and +.Dv right2left . +Similarly, all data received on +.Dv left +is sent unmodified to both +.Dv right +and +.Dv left2right . +.Pp +Packets may also be received on +.Dv right2left +and +.Dv left2right ; +if so, they are forwarded unchanged out hooks +.Dv left +and +.Dv right , +respectively. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbarfoo +.It Dv right +The connection to the node on the right. +.It Dv left +The connection to the node on the left. +.It Dv right2left +Tap for right to left traffic. +.It Dv left2right +Tap for left to right traffic. +.El +.Sh CONTROL MESSAGES +This node type supports only the generic control messages. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh SEE ALSO +.Xr tee 1 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elisher <julian@whistle.com> diff --git a/sys/modules/netgraph/tty/Makefile b/sys/modules/netgraph/tty/Makefile new file mode 100644 index 000000000000..5b9bd20c4200 --- /dev/null +++ b/sys/modules/netgraph/tty/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:22 archie Exp $ + +KMOD= ng_tty +SRCS= ng_tty.c +MAN8= ng_tty.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/tty/ng_tty.4 b/sys/modules/netgraph/tty/ng_tty.4 new file mode 100644 index 000000000000..660b46c2c5af --- /dev/null +++ b/sys/modules/netgraph/tty/ng_tty.4 @@ -0,0 +1,141 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_tty.8,v 1.5 1999/01/25 23:46:28 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_TTY 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_tty +.Nd netgraph node type that is also a line discipline +.Sh SYNOPSIS +.Fd #include <netgraph/ng_message.h> +.Fd #include <netgraph/ng_tty.h> +.Sh DESCRIPTION +The +.Nm tty +node type is both a netgraph node type and a line discipline. +A new node is created when the corresponding line discipline is +registered on a tty device (see +.Xr tty 4 ")." +.Pp +The node has a single hook called +.Dv hook . +Incoming bytes received on the tty device are sent out on this hook, +and frames received on +.Dv hook +are transmitted out on the tty device. +No modification to the data is performed in either direction. +While the line discipline is installed on a tty, the normal +read and write operations are unavailable, returning +.Er EIO . +.Pp +The node supports an optional ``hot character.'' If set to non-zero, incoming +data from the tty device is queued until this character is seen. +This avoids sending lots of mbufs containing a small number of bytes, +but introduces potentially infinite latency. +The default hot character is 0x7e, consistent with +.Dv hook +being connected to a +.Xr ng_async 8 +type node. The hot character has no effect on the transmission of data. +.Pp +The node will attempt to give itself the same netgraph name as the name +of the tty device. +In any case, information about the node is available via the netgraph +.Xr ioctl 2 +command +.Dv NGIOCGINFO . +This command returns a +.Dv "struct nodeinfo" +similar to the +.Dv NGM_NODEINFO +netgraph control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv hook +.Xr tty 4 +serial data contained in +.Dv mbuf +structures, with arbitrary inter-frame boundaries. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_TTY_SET_HOTCHAR +This command takes an integer argument and sets the hot character +from the lower 8 bits. A hot character of zero disables queueing, +so that all received data is forwarded immediately. +.It Dv NGM_TTY_GET_HOTCHAR +Returns an integer containing the current hot character in the lower +eight bits. +.Sh SHUTDOWN +This node shuts down when the corresponding device is closed +(or the line discipline is uninstalled on the device). +The +.Dv NGM_SHUTDOWN +control message is not valid, and always returns the error +.Er EOPNOTSUPP . +.Sh BUGS +The +.Nm tty +type registers its line discipline when the type is installed, +where it is dynamically assigned an integer index. +Unfortunately, there's no way to know what this integer is +except by reading the output of +.Xr dmesg 8 . +The fix for this is to have line disciplines identified by +unique ASCII strings instead of fixed integer constants, +or else to assign one of those constants to +.Nm ng_tty . +.Pp +The serial driver code also has a notion of a ``hot character.'' +Unfortunately, this value is statically defined in terms of the +line discipline and cannot be changed. +Therefore, if a hot character other than 0x7e (the default) is set for the +.Nm tty +node, the node has no way to convey this information to the +serial driver, and sub-optimal performance may result. +.Sh SEE ALSO +.Xr ioctl 2 , +.Xr netgraph 4 , +.Xr tty 4 , +.Xr ng_async 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/tty/ng_tty.8 b/sys/modules/netgraph/tty/ng_tty.8 new file mode 100644 index 000000000000..660b46c2c5af --- /dev/null +++ b/sys/modules/netgraph/tty/ng_tty.8 @@ -0,0 +1,141 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_tty.8,v 1.5 1999/01/25 23:46:28 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_TTY 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_tty +.Nd netgraph node type that is also a line discipline +.Sh SYNOPSIS +.Fd #include <netgraph/ng_message.h> +.Fd #include <netgraph/ng_tty.h> +.Sh DESCRIPTION +The +.Nm tty +node type is both a netgraph node type and a line discipline. +A new node is created when the corresponding line discipline is +registered on a tty device (see +.Xr tty 4 ")." +.Pp +The node has a single hook called +.Dv hook . +Incoming bytes received on the tty device are sent out on this hook, +and frames received on +.Dv hook +are transmitted out on the tty device. +No modification to the data is performed in either direction. +While the line discipline is installed on a tty, the normal +read and write operations are unavailable, returning +.Er EIO . +.Pp +The node supports an optional ``hot character.'' If set to non-zero, incoming +data from the tty device is queued until this character is seen. +This avoids sending lots of mbufs containing a small number of bytes, +but introduces potentially infinite latency. +The default hot character is 0x7e, consistent with +.Dv hook +being connected to a +.Xr ng_async 8 +type node. The hot character has no effect on the transmission of data. +.Pp +The node will attempt to give itself the same netgraph name as the name +of the tty device. +In any case, information about the node is available via the netgraph +.Xr ioctl 2 +command +.Dv NGIOCGINFO . +This command returns a +.Dv "struct nodeinfo" +similar to the +.Dv NGM_NODEINFO +netgraph control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobar +.It Dv hook +.Xr tty 4 +serial data contained in +.Dv mbuf +structures, with arbitrary inter-frame boundaries. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_TTY_SET_HOTCHAR +This command takes an integer argument and sets the hot character +from the lower 8 bits. A hot character of zero disables queueing, +so that all received data is forwarded immediately. +.It Dv NGM_TTY_GET_HOTCHAR +Returns an integer containing the current hot character in the lower +eight bits. +.Sh SHUTDOWN +This node shuts down when the corresponding device is closed +(or the line discipline is uninstalled on the device). +The +.Dv NGM_SHUTDOWN +control message is not valid, and always returns the error +.Er EOPNOTSUPP . +.Sh BUGS +The +.Nm tty +type registers its line discipline when the type is installed, +where it is dynamically assigned an integer index. +Unfortunately, there's no way to know what this integer is +except by reading the output of +.Xr dmesg 8 . +The fix for this is to have line disciplines identified by +unique ASCII strings instead of fixed integer constants, +or else to assign one of those constants to +.Nm ng_tty . +.Pp +The serial driver code also has a notion of a ``hot character.'' +Unfortunately, this value is statically defined in terms of the +line discipline and cannot be changed. +Therefore, if a hot character other than 0x7e (the default) is set for the +.Nm tty +node, the node has no way to convey this information to the +serial driver, and sub-optimal performance may result. +.Sh SEE ALSO +.Xr ioctl 2 , +.Xr netgraph 4 , +.Xr tty 4 , +.Xr ng_async 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/vjc/Makefile b/sys/modules/netgraph/vjc/Makefile new file mode 100644 index 000000000000..510337fc2a91 --- /dev/null +++ b/sys/modules/netgraph/vjc/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/24 06:48:07 archie Exp $ + +KMOD= ng_vjc +SRCS= ng_vjc.c +MAN8= ng_vjc.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/vjc/ng_vjc.4 b/sys/modules/netgraph/vjc/ng_vjc.4 new file mode 100644 index 000000000000..bc0a8b1efcd7 --- /dev/null +++ b/sys/modules/netgraph/vjc/ng_vjc.4 @@ -0,0 +1,188 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_vjc.8,v 1.4 1999/01/25 23:46:28 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_VJC 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_vjc +.Nd Van Jacobsen compression netgraph node type +.Sh SYNOPSIS +.Fd #include <net/slcompress.h> +.Fd #include <netgraph/ng_vjc.h> +.Sh DESCRIPTION +The +.Nm vjc +node type performs Van Jacobsen compresion, which is used +over PPP, SLIP, and other point-to-point IP connections to +compress TCP packet headers. The +.Dv ip +hook represents the uncompressed side of the node, while the +.Dv vjcomp , +.Dv vjuncomp , +and +.Dv vjip +nodes represent the compressed side of the node. Packets received on the +.Dv ip +will be compressed or passed through as appropriate. Packets received +on the other three hooks will be uncompressed as appropriate. +.Pp +Van Jacobsen compression only applies to TCP packets. +Only ``normal'' (i.e., common case) TCP packets are actually compressed. +These are output on the +.Dv vjcomp +hook. Other TCP packets are run through the state machine but not +compressed; these appear on the +.Dv vjuncomp +hook. +Other non-TCP IP packets are forwarded unchanged to +.Dv vjip . +.Pp +When connecting to a +.Xr ng_ppp 8 +node, the +.Dv vjuncomp , +.Dv vjcomp , +and +.Dv vjip +nodes should be connected to the +.Xr ng_ppp 8 +node's +.Dv vjcomp , +.Dv vjuncomp , +and +.Dv ip +nodes, respectively. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazi +.It Dv ip +Upstream (uncompressed) IP packets. +.It Dv vjcomp +Downstream compressed TCP packets. +.It Dv vjuncomp +Downstream uncompressed TCP packets. +.It Dv vjip +Downstream uncompressed IP packets. +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VJC_CONFIG +This command resets the compression state and configures it according +to the supplied +.Dv "struct ngm_vjc_config" +argument. This structure contains the following fields: +.Bd -literal -offset 4n +struct ngm_vjc_config { + u_char enabled; /* Enable compression/decompression */ + u_char numChannels; /* Number of outgoing channels */ + u_char compressCID; /* OK to compress outgoing CID's */ +}; +.Ed +.Pp +When +.Dv enabled +is set to zero, the node operates in ``pass through'' mode, only +accepting packets on the +.Dv ip +and +.Dv vjip +hooks. +.Dv numChannels +should be set to the number of compression channels, and is a value +between 3 and 16, inclusive. +.Pp +The +.Dv compressCID +field indicates whether it is OK to compress the CID field for +outgoing compressed TCP packets. This value should be zero unless +either (a) it not possible for an incoming frame to be lost, or +(b) lost frames can be reliably detected and a +.Dv NGM_VJC_RECV_ERROR +mesages is immediately sent whenever this occurs. +.It Dv NGM_VJC_GET_STATE +This command returns the node's current state described by the +.Dv "struct slcompress" +structure, which is defined in +.Dv "net/slcompress.h" . +.It Dv NGM_VJC_CLR_STATS +Clears the node statistics counters. Statistics are also cleared whenever the +.Dv enabled +field is changed from zero to one by a +.Dv NGM_VJC_CONFIG +control message. +.It Dv NGM_VJC_RECV_ERROR +When the +.Dv compressCID +is set to one, this message must be sent to the node immediately +after detecting that a recieved frame has been lost, due to a bad +checksum or for any other reason. Failing to do this can result +in corrupted TCP stream data. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +This node type requires that the file +.Dv "net/slcompress.c" +was compiled into the kernel. Currently the only way to insure this +is to include the +.Dv slip , +.Dv ppp , +or +.Dv i4bipr +pseudo-devices in your kernel compilation. In the future there should +be a kernel option that causes inclusion of this file without requiring +one of these drivers. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ppp 8 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A V. Jacobsen +.%T "Compressing TCP/IP Headers" +.%O RFC 1144 +.Re +.Rs +.%A G. McGregor +.%T "The PPP Internet Control Protocol (IPCP)" +.%O RFC 1332 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/vjc/ng_vjc.8 b/sys/modules/netgraph/vjc/ng_vjc.8 new file mode 100644 index 000000000000..bc0a8b1efcd7 --- /dev/null +++ b/sys/modules/netgraph/vjc/ng_vjc.8 @@ -0,0 +1,188 @@ +.\" Copyright (c) 1996-1999 Whistle Communications, Inc. +.\" All rights reserved. +.\" +.\" Subject to the following obligations and disclaimer of warranty, use and +.\" redistribution of this software, in source or object code forms, with or +.\" without modifications are expressly permitted by Whistle Communications; +.\" provided, however, that: +.\" 1. Any and all reproductions of the source or object code must include the +.\" copyright notice above and the following disclaimer of warranties; and +.\" 2. No rights are granted, in any manner or form, to use Whistle +.\" Communications, Inc. trademarks, including the mark "WHISTLE +.\" COMMUNICATIONS" on advertising, endorsements, or otherwise except as +.\" such appears in the above copyright notice or in the software. +.\" +.\" THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND +.\" TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO +.\" REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE, +.\" INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. +.\" WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY +.\" REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS +.\" SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE. +.\" IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES +.\" RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING +.\" WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +.\" PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR +.\" SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY +.\" OF SUCH DAMAGE. +.\" +.\" Author: Archie Cobbs <archie@whistle.com> +.\" +.\" $FreeBSD$ +.\" $Whistle: ng_vjc.8,v 1.4 1999/01/25 23:46:28 archie Exp $ +.\" +.Dd January 19, 1999 +.Dt NG_VJC 8 +.Os FreeBSD 3 +.Sh NAME +.Nm ng_vjc +.Nd Van Jacobsen compression netgraph node type +.Sh SYNOPSIS +.Fd #include <net/slcompress.h> +.Fd #include <netgraph/ng_vjc.h> +.Sh DESCRIPTION +The +.Nm vjc +node type performs Van Jacobsen compresion, which is used +over PPP, SLIP, and other point-to-point IP connections to +compress TCP packet headers. The +.Dv ip +hook represents the uncompressed side of the node, while the +.Dv vjcomp , +.Dv vjuncomp , +and +.Dv vjip +nodes represent the compressed side of the node. Packets received on the +.Dv ip +will be compressed or passed through as appropriate. Packets received +on the other three hooks will be uncompressed as appropriate. +.Pp +Van Jacobsen compression only applies to TCP packets. +Only ``normal'' (i.e., common case) TCP packets are actually compressed. +These are output on the +.Dv vjcomp +hook. Other TCP packets are run through the state machine but not +compressed; these appear on the +.Dv vjuncomp +hook. +Other non-TCP IP packets are forwarded unchanged to +.Dv vjip . +.Pp +When connecting to a +.Xr ng_ppp 8 +node, the +.Dv vjuncomp , +.Dv vjcomp , +and +.Dv vjip +nodes should be connected to the +.Xr ng_ppp 8 +node's +.Dv vjcomp , +.Dv vjuncomp , +and +.Dv ip +nodes, respectively. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbazi +.It Dv ip +Upstream (uncompressed) IP packets. +.It Dv vjcomp +Downstream compressed TCP packets. +.It Dv vjuncomp +Downstream uncompressed TCP packets. +.It Dv vjip +Downstream uncompressed IP packets. +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_VJC_CONFIG +This command resets the compression state and configures it according +to the supplied +.Dv "struct ngm_vjc_config" +argument. This structure contains the following fields: +.Bd -literal -offset 4n +struct ngm_vjc_config { + u_char enabled; /* Enable compression/decompression */ + u_char numChannels; /* Number of outgoing channels */ + u_char compressCID; /* OK to compress outgoing CID's */ +}; +.Ed +.Pp +When +.Dv enabled +is set to zero, the node operates in ``pass through'' mode, only +accepting packets on the +.Dv ip +and +.Dv vjip +hooks. +.Dv numChannels +should be set to the number of compression channels, and is a value +between 3 and 16, inclusive. +.Pp +The +.Dv compressCID +field indicates whether it is OK to compress the CID field for +outgoing compressed TCP packets. This value should be zero unless +either (a) it not possible for an incoming frame to be lost, or +(b) lost frames can be reliably detected and a +.Dv NGM_VJC_RECV_ERROR +mesages is immediately sent whenever this occurs. +.It Dv NGM_VJC_GET_STATE +This command returns the node's current state described by the +.Dv "struct slcompress" +structure, which is defined in +.Dv "net/slcompress.h" . +.It Dv NGM_VJC_CLR_STATS +Clears the node statistics counters. Statistics are also cleared whenever the +.Dv enabled +field is changed from zero to one by a +.Dv NGM_VJC_CONFIG +control message. +.It Dv NGM_VJC_RECV_ERROR +When the +.Dv compressCID +is set to one, this message must be sent to the node immediately +after detecting that a recieved frame has been lost, due to a bad +checksum or for any other reason. Failing to do this can result +in corrupted TCP stream data. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh BUGS +This node type requires that the file +.Dv "net/slcompress.c" +was compiled into the kernel. Currently the only way to insure this +is to include the +.Dv slip , +.Dv ppp , +or +.Dv i4bipr +pseudo-devices in your kernel compilation. In the future there should +be a kernel option that causes inclusion of this file without requiring +one of these drivers. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_ppp 8 , +.Xr ng_iface 8 , +.Xr ngctl 8 . +.Rs +.%A V. Jacobsen +.%T "Compressing TCP/IP Headers" +.%O RFC 1144 +.Re +.Rs +.%A G. McGregor +.%T "The PPP Internet Control Protocol (IPCP)" +.%O RFC 1332 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> |