diff options
Diffstat (limited to 'sys/modules')
182 files changed, 12462 insertions, 0 deletions
diff --git a/sys/modules/Makefile b/sys/modules/Makefile new file mode 100644 index 0000000..8593fab --- /dev/null +++ b/sys/modules/Makefile @@ -0,0 +1,21 @@ +# $FreeBSD$ + +# XXX present but broken: ip_mroute_mod pcic + +SUBDIR= aha amr ccd cd9660 coda dc fdesc fxp if_disc if_ef if_ppp if_sl \ + if_tun ipfilter ipfw joy kernfs md mfs mii mlx msdos \ + ncp netgraph nfs ntfs nullfs \ + nwfs portal procfs rl sf sis sk ste ti tl \ + ugen uhid ukbd ulpt umapfs umass umodem ums union usb vn vr wb xl + +# XXX some of these can move to the general case when de-i386'ed +.if ${MACHINE_ARCH} == "i386" +SUBDIR+=bktr coff fpu gnufpu ibcs2 linux splash streams \ + svr4 syscons vesa vinum wi +.endif + +.if ${MACHINE_ARCH} == "alpha" +SUBDIR+=osf1 +.endif + +.include <bsd.subdir.mk> diff --git a/sys/modules/Makefile.inc b/sys/modules/Makefile.inc new file mode 100644 index 0000000..2e4c96d --- /dev/null +++ b/sys/modules/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +KLDMOD= true diff --git a/sys/modules/aha/Makefile b/sys/modules/aha/Makefile new file mode 100644 index 0000000..295124f6 --- /dev/null +++ b/sys/modules/aha/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/aha +KMOD = aha +SRCS = aha.c aha_isa.c ahareg.h opt_cam.h device_if.h bus_if.h aha.h \ + opt_scsi.h isa_if.h +CLEANFILES = aha.h +CFLAGS += ${DEBUG_FLAGS} + +aha.h: + echo "#define NAHA 1" > aha.h + +opt_scsi.h: + echo "#define SCSI_DELAY 15000" > opt_scsi.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/amr/Makefile b/sys/modules/amr/Makefile new file mode 100644 index 0000000..e81049d --- /dev/null +++ b/sys/modules/amr/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/amr +KMOD = amr +SRCS = amr.c amr_pci.c amr_disk.c device_if.h bus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/bktr/Makefile b/sys/modules/bktr/Makefile new file mode 100644 index 0000000..a341d6a --- /dev/null +++ b/sys/modules/bktr/Makefile @@ -0,0 +1,29 @@ +# Makefile for the bktr Brooktree Bt848/Bt878 PCI video capture device +# Using the new FreeBSD 4.x device driver API (newbus) the Bt848 driver +# can be loaded dynamically both in the boot loader phase and once +# the system has booted. +# The driver can also be unloaded, recompiled and reloaded. +# +# Use kldload bktr and kldunload bktr to load/unload the driver +# +# Note - as the driver requires contiguous memory, loading the driver once +# memory has filled or become fragmented may fail. + +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/bktr +KMOD= bktr +SRCS= bktr_core.c bktr_os.c bktr_audio.c bktr_tuner.c bktr_card.c \ + bktr.h opt_devfs.h opt_bktr.h smbus.h bus_if.h device_if.h \ + pci_if.h vnode_if.h +CLEANFILES= bktr.h smbus.h + +bktr.h: + echo "#define NBKTR 1" > bktr.h + +# Does not use SMBUS/IICBUS. Uses the old i2c code self contained in +# the bt848 driver. +smbus.h: + echo "#define NSMBUS 0" > smbus.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/cardbus/Makefile b/sys/modules/cardbus/Makefile new file mode 100644 index 0000000..5ac7d33 --- /dev/null +++ b/sys/modules/cardbus/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/cardbus +KMOD= cardbus +SRCS= cardbus.c \ + device_if.h bus_if.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/cbb/Makefile b/sys/modules/cbb/Makefile new file mode 100644 index 0000000..a48b002 --- /dev/null +++ b/sys/modules/cbb/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD= cbb +SRCS= pccbb.c \ + device_if.h bus_if.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/ccd/Makefile b/sys/modules/ccd/Makefile new file mode 100644 index 0000000..3235eae --- /dev/null +++ b/sys/modules/ccd/Makefile @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/ccd +KMOD= ccd +SRCS= ccd.c ccd.h vnode_if.h +NOMAN= + +NCCD?= 4 +CLEANFILES= ccd.h + +ccd.h: + echo "#define NCCD ${NCCD}" > ccd.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/cd9660/Makefile b/sys/modules/cd9660/Makefile new file mode 100644 index 0000000..8443e31 --- /dev/null +++ b/sys/modules/cd9660/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../isofs/cd9660 +KMOD= cd9660 +SRCS= vnode_if.h \ + cd9660_bmap.c cd9660_lookup.c cd9660_node.c cd9660_rrip.c \ + cd9660_util.c cd9660_vfsops.c cd9660_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/coda/Makefile b/sys/modules/coda/Makefile new file mode 100644 index 0000000..cc9614b --- /dev/null +++ b/sys/modules/coda/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../coda +KMOD= coda +SRCS= vnode_if.h \ + coda_fbsd.c coda_namecache.c coda_psdev.c coda_subr.c \ + coda_venus.c coda_vfsops.c coda_vnops.c opt_devfs.h vcoda.h +NOMAN= + +CLEANFILES= vcoda.h + +vcoda.h: + echo "#define NVCODA 4" > vcoda.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/coff/Makefile b/sys/modules/coff/Makefile new file mode 100644 index 0000000..2fa1f54 --- /dev/null +++ b/sys/modules/coff/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../i386/ibcs2 +KMOD= ibcs2_coff +SRCS= imgact_coff.c vnode_if.h +NOMAN= +CFLAGS+= -DCOMPAT_IBCS2 +KMODDEPS= ibcs2 + +.include <bsd.kmod.mk> diff --git a/sys/modules/dc/Makefile b/sys/modules/dc/Makefile new file mode 100644 index 0000000..2f87272 --- /dev/null +++ b/sys/modules/dc/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_dc +SRCS = if_dc.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> diff --git a/sys/modules/fdesc/Makefile b/sys/modules/fdesc/Makefile new file mode 100644 index 0000000..09f3ba5 --- /dev/null +++ b/sys/modules/fdesc/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/fdesc +KMOD= fdesc +SRCS= vnode_if.h \ + fdesc_vfsops.c fdesc_vnops.c +NOMAN= +CFLAGS+= -DFDESC + +.include <bsd.kmod.mk> diff --git a/sys/modules/fdescfs/Makefile b/sys/modules/fdescfs/Makefile new file mode 100644 index 0000000..09f3ba5 --- /dev/null +++ b/sys/modules/fdescfs/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/fdesc +KMOD= fdesc +SRCS= vnode_if.h \ + fdesc_vfsops.c fdesc_vnops.c +NOMAN= +CFLAGS+= -DFDESC + +.include <bsd.kmod.mk> diff --git a/sys/modules/fpu/Makefile b/sys/modules/fpu/Makefile new file mode 100644 index 0000000..66c2ad1 --- /dev/null +++ b/sys/modules/fpu/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../i386/i386 +KMOD= fpu +SRCS= math_emulate.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/fxp/Makefile b/sys/modules/fxp/Makefile new file mode 100644 index 0000000..9285bb2 --- /dev/null +++ b/sys/modules/fxp/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_fxp +SRCS = if_fxp.c opt_bdg.h device_if.h bus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/gnufpu/Makefile b/sys/modules/gnufpu/Makefile new file mode 100644 index 0000000..d7bfb67 --- /dev/null +++ b/sys/modules/gnufpu/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../gnu/i386/fpemul +KMOD= gnufpu +SRCS= div_small.s errors.c fpu_arith.c fpu_aux.c fpu_entry.c fpu_etc.c \ + fpu_trig.c get_address.c load_store.c poly_2xm1.c poly_atan.c \ + poly_div.s poly_l2.c poly_mul64.s poly_sin.c poly_tan.c \ + polynomial.s reg_add_sub.c reg_compare.c reg_constant.c reg_div.s \ + reg_ld_str.c reg_u_mul.s reg_u_sub.s wm_shrx.s wm_sqrt.s +NOMAN= + +.s.o: + ${CC} -x assembler-with-cpp -DLOCORE ${CFLAGS} -c \ + ${.IMPSRC} -o ${.TARGET} + +.include <bsd.kmod.mk> diff --git a/sys/modules/hpfs/Makefile b/sys/modules/hpfs/Makefile new file mode 100644 index 0000000..9e10cd2 --- /dev/null +++ b/sys/modules/hpfs/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../fs/hpfs +KMOD= hpfs +SRCS= vnode_if.h \ + hpfs_vfsops.c hpfs_vnops.c hpfs_hash.c hpfs_subr.c hpfs_lookup.c \ + hpfs_alsubr.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/ibcs2/Makefile b/sys/modules/ibcs2/Makefile new file mode 100644 index 0000000..29f88a9 --- /dev/null +++ b/sys/modules/ibcs2/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../i386/ibcs2 +KMOD= ibcs2 +SRCS= ibcs2_errno.c ibcs2_ipc.c ibcs2_stat.c ibcs2_misc.c \ + ibcs2_fcntl.c ibcs2_signal.c ibcs2_sysent.c ibcs2_ioctl.c \ + ibcs2_socksys.c ibcs2_util.c ibcs2_xenix.c ibcs2_xenix_sysent.c \ + ibcs2_isc.c ibcs2_isc_sysent.c \ + ibcs2_msg.c ibcs2_other.c ibcs2_sysi86.c ibcs2_sysvec.c \ + vnode_if.h opt_spx_hack.h +MAN8= ibcs2.8 + +CFLAGS+= -DCOMPAT_IBCS2 +EXPORT_SYMS= _ibcs2_mod _ibcs2_emul_path _ibcs2_svr3_sysvec + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/ibcs2.sh ${DESTDIR}/usr/sbin/ibcs2 + +.include <bsd.kmod.mk> diff --git a/sys/modules/ibcs2/ibcs2.8 b/sys/modules/ibcs2/ibcs2.8 new file mode 100644 index 0000000..be34bd8 --- /dev/null +++ b/sys/modules/ibcs2/ibcs2.8 @@ -0,0 +1,63 @@ +.\" +.\" Copyright (c) 1995 Lyndon Nerenberg +.\" +.\" All rights reserved. +.\" +.\" This program is free software. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 27, 1995 +.Dt IBCS2 8 +.Os FreeBSD +.Sh NAME +.Nm ibcs2 +.Nd load iBCS2 runtime support for SCO and ISC binaries +.Sh SYNOPSIS +.Nm ibcs2 +.Sh DESCRIPTION +The +.Nm +utility loads kernel runtime support for iBCS2 compliant programs. +This runtime support is limited to emulation of the iBCS2 +system call interface, and is far from complete. COFF binaries +and shared libraries are supported, however no shared libraries +are provided with the FreeBSD distribution. +.Sh FILES +.Bl -tag -width /usr/share/examples/ibcs2/* -compact +.It Pa /modules/ibcs2.ko +.It Pa /modules/ibcs2_coff.ko +iBCS2 loadable kernel modules. +.Pp +.It Pa /usr/share/examples/ibcs2/* +Sample object files with which to test the emulator. +.Sh "SEE ALSO" +.Xr kld 4 , +.Xr kldload 8 +.Sh BUGS +The emulation is very incomplete. +.Pp +Running dynamically linked binaries requires access to an existing +SCO system from which you can grab the shared libraries. +.Pp +You can't really use this without reading the source code. diff --git a/sys/modules/ibcs2/ibcs2.sh b/sys/modules/ibcs2/ibcs2.sh new file mode 100644 index 0000000..c8bf2a8 --- /dev/null +++ b/sys/modules/ibcs2/ibcs2.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Copyright (C) 1994-1997 +# FreeBSD Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY FreeBSD Inc. AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL FreeBSD Inc. OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + + +PATH=/bin:/sbin:/usr/bin:/usr/sbin; export PATH + +if [ $# -le 1 ]; then + LOADERS="coff" # elf +fi + +set -e + +kldload ibcs2 + +for loader in $LOADERS; do + kldload ibcs2_${loader} +done +set +e diff --git a/sys/modules/if_disc/Makefile b/sys/modules/if_disc/Makefile new file mode 100644 index 0000000..e33555d --- /dev/null +++ b/sys/modules/if_disc/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net +KMOD= if_disc +SRCS= if_disc.c opt_inet.h opt_inet6.h +NOMAN= + +NBPF?= 1 + +CFLAGS+= ${PROTOS} + +opt_inet.h: + echo "#define INET 1" > opt_inet.h + +#opt_inet6.h: +# echo "#define INET6 1" > opt_inet6.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/if_ef/Makefile b/sys/modules/if_ef/Makefile new file mode 100644 index 0000000..eb0286c --- /dev/null +++ b/sys/modules/if_ef/Makefile @@ -0,0 +1,52 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net + +KMOD= if_ef +SRCS= if_ef.c opt_ipx.h opt_inet.h +MAN4= ef.4 + +# If you need only limited number of frames comment out unneeded ones +# this will reduce number of visible devices +ETHER_II= +ETHER_8023= +ETHER_8022= +ETHER_SNAP= + +NBPF?= 1 + +CFLAGS+= ${PROTOS} + +.if defined(ETHER_II) +CFLAGS+= -DETHER_II +.endif + +.if defined(ETHER_8023) +CFLAGS+= -DETHER_8023 +.endif + +.if defined(ETHER_8022) +CFLAGS+= -DETHER_8022 +.endif + +.if defined(ETHER_SNAP) +CFLAGS+= -DETHER_SNAP +.endif + +.if defined(EFDEBUG) +CFLAGS+= -DEF_DEBUG +.endif + +opt_inet.h: + echo "#define INET 1" > opt_inet.h + +opt_ipx.h: + echo "#define IPX 1" > opt_ipx.h + +load: all + /sbin/kldload ./${PROG} + +unload: + /sbin/kldunload ${PROG} + +.include <bsd.kmod.mk> diff --git a/sys/modules/if_ef/ef.4 b/sys/modules/if_ef/ef.4 new file mode 100644 index 0000000..6165e06 --- /dev/null +++ b/sys/modules/if_ef/ef.4 @@ -0,0 +1,103 @@ +.\" +.\" Copyright (c) 1999, Boris Popov +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 20, 1999 +.Dt EF 4 +.Os BSD +.Sh NAME +.Nm ef +.Nd +pseudo-device driver provides support for multiple ethernet frame types. +.Sh SYNOPSIS +.Cd "kldload if_ef.ko" +.Sh DESCRIPTION +The +.Nm +pseudo-device driver clones each ethernet type device with four +additional interfaces. Each of them capable to send or receive only +one predefined frame type. +.Pp +Names for the new interfaces created by adding +.Ar fN +suffix to an existing device name. Where +.Ar N +is a device unit which can have one of the following values: +.Bd -literal -offset indent +0 interface with an Ethernet_II frame +1 interface with a Novell Ethernet_802.3 frame +2 interface with an Ethernet_802.2 frame +3 interface with an Ethernet_802.2/SNAP frame support. +.Ed +.Pp +For example, device +.Ar ed0 +will be populated with four devices: +.Ar ed0f0 , +.Ar ed0f1 , +.Ar ed0f2 +and +.Ar ed0f3 . +.Pp +After that, each device can be configured as usually: +.Dl # ifconfig ed0f1 ipx 0x105 +This will configure IPX protocol with network number +.Ar 0x105 +and +.Ar Ethernet_802.3 +frame type. +.Pp +Please note that it is impossible to configure IPX protocol on the 'raw' +.Ar ed0 +device after +.Ar if_ef.ko +driver loaded. +.Sh EXAMPLES +The +.Nm +driver can be loaded via +.Xr loader.conf 5 +file: +.Dl if_ef_load="YES" +.Pp +In this case an ordinary interface configuration commands can be used +in +.Xr rc.conf 5 +file: +.Dl network_interfaces="ed2 lo0 tun0 ed2f0 ed2f1" +.Dl ifconfig_ed2f0_ipx="ipx 0x101" +.Dl ifconfig_ed2f1_ipx="ipx 0x102" +.Sh DIAGNOSTICS +None. +.Sh CAVEATS +Avoid to configuring 'raw' ethernet device for IPX protocol after +.Nm +driver is loaded. +.Sh SEE ALSO +.Xr ipx 3 , +.Xr ifconfig 8 +.Sh AUTHOR +Boris Popov. diff --git a/sys/modules/if_ppp/Makefile b/sys/modules/if_ppp/Makefile new file mode 100644 index 0000000..3e6c9a5 --- /dev/null +++ b/sys/modules/if_ppp/Makefile @@ -0,0 +1,54 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net +KMOD= if_ppp +SRCS= if_ppp.c ppp_tty.c slcompress.c \ + ppp.h opt_inet.h opt_ipx.h opt_ppp.h vnode_if.h +NOMAN= + +NPPP?= 2 +PPP_BSDCOMP?= 1 # 0/1 +PPP_DEFLATE?= 1 # 0/1 +PPP_FILTER?= 1 # 0/1 - requires bpf to be configured in kernel +PPP_INET?= 1 # 0/1 - requires INET to be configured in kernel +PPP_IPX?= 0 # 0/1 - requires IPX to be configured in kernel + +CFLAGS+= ${PROTOS} + +.if ${PPP_BSDCOMP} > 0 +SRCS+= bsd_comp.c +.endif +.if ${PPP_DEFLATE} > 0 +SRCS+= ppp_deflate.c zlib.c +.endif + +CLEANFILES= ppp.h + +ppp.h: + echo "#define NPPP ${NPPP}" > ppp.h + +opt_inet.h: + touch opt_inet.h +.if ${PPP_INET} > 0 + echo "#define INET 1" > opt_inet.h +.endif + +opt_ipx.h: + touch opt_ipx.h +.if ${PPP_IPX} > 0 + echo "#define IPX ${PPP_IPX}" > opt_ipx.h +.endif + +opt_ppp.h: + touch opt_ppp.h +.if ${PPP_BSDCOMP} > 0 + echo "#define PPP_BSDCOMP ${PPP_BSDCOMP}" > opt_ppp.h +.endif +.if ${PPP_DEFLATE} > 0 + echo "#define PPP_DEFLATE ${PPP_DEFLATE}" >> opt_ppp.h +.endif +.if ${PPP_FILTER} > 0 + echo "#define PPP_FILTER ${PPP_FILTER}" >> opt_ppp.h +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/if_sl/Makefile b/sys/modules/if_sl/Makefile new file mode 100644 index 0000000..c188d19 --- /dev/null +++ b/sys/modules/if_sl/Makefile @@ -0,0 +1,20 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net +KMOD= if_sl +SRCS= if_sl.c slcompress.c opt_inet.h sl.h +NOMAN= + +NSL?= 2 +PROTOS?= -DINET + +CFLAGS+= ${PROTOS} +CLEANFILES= sl.h + +opt_inet.h: + echo "#define INET 1" > opt_inet.h + +sl.h: + echo "#define NSL ${NSL}" > sl.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/if_tun/Makefile b/sys/modules/if_tun/Makefile new file mode 100644 index 0000000..019bc91 --- /dev/null +++ b/sys/modules/if_tun/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../net +KMOD= if_tun +SRCS= if_tun.c opt_devfs.h opt_inet.h vnode_if.h +NOMAN= + +NBPF?= 1 +NTUN?= 2 + +CFLAGS+= ${PROTOS} + +opt_inet.h: + echo "#define INET 1" > opt_inet.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/ip_mroute_mod/Makefile b/sys/modules/ip_mroute_mod/Makefile new file mode 100644 index 0000000..39412bc --- /dev/null +++ b/sys/modules/ip_mroute_mod/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../netinet +KMOD= ip_mroute +SRCS= ip_mroute.c +NOMAN= +CFLAGS+= -DMROUTE_LKM -DMROUTING + +.include <bsd.kmod.mk> diff --git a/sys/modules/ipfilter/Makefile b/sys/modules/ipfilter/Makefile new file mode 100644 index 0000000..c2c6de7 --- /dev/null +++ b/sys/modules/ipfilter/Makefile @@ -0,0 +1,13 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../netinet +KMOD= ipl +SRCS= mlfk_ipl.c ip_nat.c ip_frag.c ip_state.c ip_proxy.c ip_auth.c \ + ip_log.c ip_fil.c fil.c +NOMAN= +CFLAGS+= -DIPFILTER_LKM -DIPFILTER_LOG +# +# If you don't want long functionality remove -DIPFILTER_LOG +# + +.include <bsd.kmod.mk> diff --git a/sys/modules/ipfw/Makefile b/sys/modules/ipfw/Makefile new file mode 100644 index 0000000..963349f --- /dev/null +++ b/sys/modules/ipfw/Makefile @@ -0,0 +1,17 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../netinet +KMOD= ipfw +SRCS= ip_fw.c +NOMAN= +CFLAGS+= -DIPFIREWALL +# +#If you want it verbose +#CFLAGS+= -DIPFIREWALL_VERBOSE +#CFLAGS+= -DIPFIREWALL_VERBOSE_LIMIT=100 +# +#If you want it to pass all packets by default +#CFLAGS+= -DIPFIREWALL_DEFAULT_TO_ACCEPT +# + +.include <bsd.kmod.mk> diff --git a/sys/modules/joy/Makefile b/sys/modules/joy/Makefile new file mode 100644 index 0000000..a275add --- /dev/null +++ b/sys/modules/joy/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../isa +KMOD = joy +SRCS = bus_if.h device_if.h isa_if.h joy.c +MAN8 = joy.8 + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/joy.sh ${DESTDIR}/usr/bin/joy + +.include <bsd.kmod.mk> diff --git a/sys/modules/joy/joy.8 b/sys/modules/joy/joy.8 new file mode 100644 index 0000000..e073e47 --- /dev/null +++ b/sys/modules/joy/joy.8 @@ -0,0 +1,46 @@ +.\" +.\" Copyright (c) 1996 Jean-Marc Zucconi <jmz@cabri.obs-besancon.fr> +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 16, 1996 +.Dt JOY 8 +.Os FreeBSD +.Sh NAME +.Nm joy +.Nd load the joystick driver kernel module +.Sh SYNOPSIS +.Nm joy +.Sh DESCRIPTION +The +.Nm +utility loads the joystick driver kernel module. +.Sh FILES +.Bl -tag -width /modules/joy.ko +.It Pa /modules/joy.ko +joystick loadable kernel module. +.Sh "SEE ALSO" +.Xr joy 4 , +.Xr kld 4 , +.Xr kldload 8 diff --git a/sys/modules/joy/joy.sh b/sys/modules/joy/joy.sh new file mode 100644 index 0000000..48c5482 --- /dev/null +++ b/sys/modules/joy/joy.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# $FreeBSD$ + +kldload joy diff --git a/sys/modules/kernfs/Makefile b/sys/modules/kernfs/Makefile new file mode 100644 index 0000000..cf28e6c --- /dev/null +++ b/sys/modules/kernfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/kernfs +KMOD= kernfs +SRCS= vnode_if.h \ + kernfs_vfsops.c kernfs_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/linux/Makefile b/sys/modules/linux/Makefile new file mode 100644 index 0000000..7c5a53e --- /dev/null +++ b/sys/modules/linux/Makefile @@ -0,0 +1,41 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../${MACHINE_ARCH}/linux + +MAINTAINER= marcel@FreeBSD.org + +KMOD= linux +SRCS= linux_file.c linux_ioctl.c linux_misc.c linux_signal.c \ + linux_ipc.c linux_socket.c linux_stats.c linux_mib.c \ + linux_dummy.c linux_sysent.c linux_sysvec.c linux_util.c \ + imgact_linux.c opt_compat.h opt_linux.h opt_vmpage.h vnode_if.h +OBJS= linux_locore.o +MAN8= linux.8 + +# CFLAGS+= -DDEBUG +EXPORT_SYMS=_linux_mod +CLEANFILES= linux_assym.h linux_genassym linux_genassym.o + +build-tools: linux_genassym + +linux_assym.h: linux_genassym + ./linux_genassym > linux_assym.h + +linux_locore.o: linux_locore.s linux_assym.h + ${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + +linux_genassym.o: linux_genassym.c linux.h @ machine + ${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC} + +linux_genassym: linux_genassym.o + ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + +opt_compat.h: + echo "#define COMPAT_43 1" > opt_compat.h + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/linux.sh ${DESTDIR}/usr/sbin/linux + +.include <bsd.kmod.mk> diff --git a/sys/modules/linux/linux.8 b/sys/modules/linux/linux.8 new file mode 100644 index 0000000..13f3f0b --- /dev/null +++ b/sys/modules/linux/linux.8 @@ -0,0 +1,47 @@ +.\" +.\" Copyright (c) 1997 +.\" The FreeBSD Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 9, 1997 +.Dt LINUX 8 +.Os FreeBSD +.Sh NAME +.Nm linux +.Nd load the Linux image activator module +.Sh SYNOPSIS +.Nm linux +.Sh DESCRIPTION +The +.Nm +utility loads the Linux image activator module. +.Sh FILES +.Bl -tag -width /modules/linux.ko +.It Pa /modules/linux.ko +Linux image activator loadable kernel module. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr kldstat 8 , +.Xr kldunload 8 diff --git a/sys/modules/linux/linux.sh b/sys/modules/linux/linux.sh new file mode 100644 index 0000000..a9215cf --- /dev/null +++ b/sys/modules/linux/linux.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# $FreeBSD$ + +FOUND=`kldstat -v | egrep 'linux(aout|elf)'` + +exitcode=0 + +if [ "x$FOUND" != x ] ; then + echo Linux driver already loaded + exitcode=1 +else + kldload linux + exitcode=$? +fi + +if [ -f /compat/linux/sbin/ldconfig ] ; then + /compat/linux/sbin/ldconfig +fi + +exit $exitcode diff --git a/sys/modules/md/Makefile b/sys/modules/md/Makefile new file mode 100644 index 0000000..bbbec99 --- /dev/null +++ b/sys/modules/md/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/md +KMOD= md +SRCS= md.c opt_mfs.h opt_md.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/mfs/Makefile b/sys/modules/mfs/Makefile new file mode 100644 index 0000000..7f2a0d4 --- /dev/null +++ b/sys/modules/mfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../ufs/mfs +KMOD= mfs +SRCS= vnode_if.h \ + mfs_vfsops.c mfs_vnops.c opt_mfs.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/mii/Makefile b/sys/modules/mii/Makefile new file mode 100644 index 0000000..9d277b5 --- /dev/null +++ b/sys/modules/mii/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/mii +KMOD = miibus +SRCS = mii.c mii_physubr.c ukphy.c ukphy_subr.c bus_if.h pci_if.h +SRCS += miibus_if.h device_if.h miibus_if.c exphy.c nsphy.c +SRCS += mlphy.c tlphy.c rlphy.c amphy.c dcphy.c pnphy.c +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/mlx/Makefile b/sys/modules/mlx/Makefile new file mode 100644 index 0000000..274d857 --- /dev/null +++ b/sys/modules/mlx/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/mlx +KMOD = mlx +SRCS = mlx.c mlx_pci.c mlx_disk.c device_if.h bus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/msdos/Makefile b/sys/modules/msdos/Makefile new file mode 100644 index 0000000..1ac0016 --- /dev/null +++ b/sys/modules/msdos/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../msdosfs +KMOD= msdos +SRCS= vnode_if.h \ + msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c \ + msdosfs_vfsops.c msdosfs_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/msdosfs/Makefile b/sys/modules/msdosfs/Makefile new file mode 100644 index 0000000..1ac0016 --- /dev/null +++ b/sys/modules/msdosfs/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../msdosfs +KMOD= msdos +SRCS= vnode_if.h \ + msdosfs_conv.c msdosfs_denode.c msdosfs_fat.c msdosfs_lookup.c \ + msdosfs_vfsops.c msdosfs_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/ncp/Makefile b/sys/modules/ncp/Makefile new file mode 100644 index 0000000..f68602f --- /dev/null +++ b/sys/modules/ncp/Makefile @@ -0,0 +1,44 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../netncp + +KMOD= ncp + +# Build with IPX support (1|0) +NCP_IPX?= 1 + +# Build with INET support (1|0) +NCP_INET?= 1 + +SRCS= ncp_conn.c ncp_sock.c ncp_ncp.c ncp_subr.c ncp_crypt.c ncp_mod.c \ + ncp_rq.c ncp_login.c ncp_nls.c opt_inet.h opt_ipx.h opt_ncp.h + +.if defined(NCPBURST) +SRCS+= ncp_burst.c +CFLAGS+= -DNCPBURST +.endif + +NOMAN= + +opt_inet.h: + touch ${.TARGET} +.if ${NCP_INET} > 0 + echo "#define INET 1" > ${.TARGET} +.endif + +opt_ipx.h: + touch ${.TARGET} +.if ${NCP_IPX} > 0 + echo "#define IPX 1" > ${.TARGET} +.endif + +load: ${KMOD}.ko + kldload ./${KMOD}.ko + +unload: + @(if kldunload ${KMOD}; then true; else true; fi) + +deinstall: + rm -f /modules/ncp.ko + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/Makefile b/sys/modules/netgraph/Makefile new file mode 100644 index 0000000..69a9f2b --- /dev/null +++ b/sys/modules/netgraph/Makefile @@ -0,0 +1,7 @@ +# $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ +# $FreeBSD$ + +SUBDIR= async bpf cisco echo frame_relay hole iface ksocket lmi netgraph \ + ppp pppoe pptpgre rfc1490 socket tee tty UI vjc + +.include <bsd.subdir.mk> diff --git a/sys/modules/netgraph/Makefile.inc b/sys/modules/netgraph/Makefile.inc new file mode 100644 index 0000000..16ca171 --- /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 0000000..cf7542f --- /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 0000000..74b6832 --- /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 4.0 +.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 0000000..74b6832 --- /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 4.0 +.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 0000000..507d0e4 --- /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 0000000..7c061c9 --- /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 4.0 +.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 serial line. +.Pp +The node transmits and receives asynchronous data on the +.Dv async +hook. Mbuf boundaries of incoming data are ignored. +Once a complete packet has been received, it is decoded and +stripped of all framing bytes, and transmitted out the +.Dv sync +hook as a single frame. +.Pp +Synchronous frames are transmitted and received on the +.Dv sync +hook. +Packets received on this hook are encoded as asynchronous frames +and sent out on +.Dv async . +Received packets should start with the address and control fields, +or the PPP protocol field if address and control field compression +is employed, and contain no checksum field. If the first four bytes are +.Dv "0xff 0x03 0xc0 0x21" +(an LCP protocol frame) then complete control character escaping +is enabled for that frame (in PPP, LCP packets are always sent with +no address and control field compression and all control characters +escaped). +.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 should contain address, control, and protocol fields, +but no checksum field. +Typically this hook would be connected to an individual link 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_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. +The +.Dv amru +and +.Dv smru +fields 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. +The +.Dv accm +field 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 +.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/async/ng_async.8 b/sys/modules/netgraph/async/ng_async.8 new file mode 100644 index 0000000..7c061c9 --- /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 4.0 +.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 serial line. +.Pp +The node transmits and receives asynchronous data on the +.Dv async +hook. Mbuf boundaries of incoming data are ignored. +Once a complete packet has been received, it is decoded and +stripped of all framing bytes, and transmitted out the +.Dv sync +hook as a single frame. +.Pp +Synchronous frames are transmitted and received on the +.Dv sync +hook. +Packets received on this hook are encoded as asynchronous frames +and sent out on +.Dv async . +Received packets should start with the address and control fields, +or the PPP protocol field if address and control field compression +is employed, and contain no checksum field. If the first four bytes are +.Dv "0xff 0x03 0xc0 0x21" +(an LCP protocol frame) then complete control character escaping +is enabled for that frame (in PPP, LCP packets are always sent with +no address and control field compression and all control characters +escaped). +.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 should contain address, control, and protocol fields, +but no checksum field. +Typically this hook would be connected to an individual link 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_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. +The +.Dv amru +and +.Dv smru +fields 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. +The +.Dv accm +field 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 +.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/bpf/Makefile b/sys/modules/netgraph/bpf/Makefile new file mode 100644 index 0000000..704b98a --- /dev/null +++ b/sys/modules/netgraph/bpf/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/12/03 01:44:28 archie Exp $ + +KMOD= ng_bpf +SRCS= ng_bpf.c bpf_filter.c +MAN8= ng_bpf.8 +KMODDEPS= netgraph + +.PATH: ${.CURDIR}/../../../net + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/bpf/ng_bpf.4 b/sys/modules/netgraph/bpf/ng_bpf.4 new file mode 100644 index 0000000..e9079ea --- /dev/null +++ b/sys/modules/netgraph/bpf/ng_bpf.4 @@ -0,0 +1,143 @@ +.\" Copyright (c) 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_bpf.8,v 1.2 1999/12/03 01:57:12 archie Exp $ +.\" +.Dd December 2, 1999 +.Dt NG_BPF 8 +.Os FreeBSD 4.0 +.Sh NAME +.Nm ng_bpf +.Nd Berkeley packet filter netgraph node type +.Sh SYNOPSIS +.Fd #include <net/bpf.h> +.Fd #include <netgraph/ng_bpf.h> +.Sh DESCRIPTION +The +.Nm bpf +node type allows Berkeley Packet Filter (see +.Xr bpf 8 ) +filters to be applied to data travelling through a Netgraph network. +Each node allows an arbitrary number of connections to arbitrarily +named hooks. With each hook is associated a +.Xf bpf 8 +filter program which is applied to incoming data only, a destination hook +for matching packets, a destination hook for non-matching packets, +and various statistics counters. +.Pp +A +.Xr bpf 8 +program returns an unsigned integer, which is normally interpreted as +the length of the prefix of the packet to return. In the context of this +node type, returning zero is considered a non-match, in which case the +entire packet is delivered out the non-match destination hook. +Returning a value greater than zero causes the packet to be truncated +to that length and delivered out the match destination hook. +Either or both destination hooks may be the empty string, or may +not exist, in which case the packet is dropped. +.Pp +New hooks are initially configured to drop all packets. +A new filter may be installed using the +.Dv NGM_BPF_SET_FILTER +control message. +.Sh HOOKS +This node type supports any number of hooks having arbitrary names. +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_BPF_SET_FILTER +This command sets the filter program that will be applied to incoming +data on a hook. The following structure must be supplied as an argument: +.Bd -literal -offset 4n +struct ngm_bpf_hookprog { + char thisHook[NG_HOOKLEN+1]; /* name of hook */ + char ifMatch[NG_HOOKLEN+1]; /* match dest hook */ + char ifNotMatch[NG_HOOKLEN+1]; /* !match dest hook */ + int32_t bpf_prog_len; /* #isns in program */ + struct bpf_insn bpf_prog[0]; /* bpf program */ +}; +.Ed +.Pp +The hook to be updated is specified in +.Dv thisHook . +The BPF program is the sequence of instructions in the +.Dv bpf_prog +array; there must be +.Dv bpf_prog_len +of them. +Matching and non-matching incoming packets are delivered out the hooks named +.Dv ifMatch +and +.Dv ifNotMatch , +respectively. The program must be a valid +.Xr bpf 8 +program or else +.Er EINVAL +is returned. +.It Dv NGM_BPF_GET_FILTER +This command takes an ASCII string argument, the hook name, and returns the +corresponding +.Dv "struct ngm_bpf_hookprog" +as shown above. +.It Dv NGM_BPF_GET_STATS +This command takes an ASCII string argument, the hook name, and returns the +statistics associated with the hook as a +.Dv "struct ng_bpf_hookstat" . +.It Dv NGM_BPF_CLR_STATS +This command takes an ASCII string argument, the hook name, and clears the +statistics associated with the hook. +.It Dv NGM_BPF_GETCLR_STATS +This command is identical to +.Dv NGM_BPF_GET_STATS , +except that the statistics are also atomically cleared. +.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 +When built as a loadable kernel module, this module includes the file +.Dv "net/bpf_filter.c" . +Although loading the module should fail if +.Dv "net/bpf_filter.c" +already exists in the kernel, currently it does not, and the duplicate +copies of the file do not interfere. +However, this may change in the future. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr bpf 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/bpf/ng_bpf.8 b/sys/modules/netgraph/bpf/ng_bpf.8 new file mode 100644 index 0000000..e9079ea --- /dev/null +++ b/sys/modules/netgraph/bpf/ng_bpf.8 @@ -0,0 +1,143 @@ +.\" Copyright (c) 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_bpf.8,v 1.2 1999/12/03 01:57:12 archie Exp $ +.\" +.Dd December 2, 1999 +.Dt NG_BPF 8 +.Os FreeBSD 4.0 +.Sh NAME +.Nm ng_bpf +.Nd Berkeley packet filter netgraph node type +.Sh SYNOPSIS +.Fd #include <net/bpf.h> +.Fd #include <netgraph/ng_bpf.h> +.Sh DESCRIPTION +The +.Nm bpf +node type allows Berkeley Packet Filter (see +.Xr bpf 8 ) +filters to be applied to data travelling through a Netgraph network. +Each node allows an arbitrary number of connections to arbitrarily +named hooks. With each hook is associated a +.Xf bpf 8 +filter program which is applied to incoming data only, a destination hook +for matching packets, a destination hook for non-matching packets, +and various statistics counters. +.Pp +A +.Xr bpf 8 +program returns an unsigned integer, which is normally interpreted as +the length of the prefix of the packet to return. In the context of this +node type, returning zero is considered a non-match, in which case the +entire packet is delivered out the non-match destination hook. +Returning a value greater than zero causes the packet to be truncated +to that length and delivered out the match destination hook. +Either or both destination hooks may be the empty string, or may +not exist, in which case the packet is dropped. +.Pp +New hooks are initially configured to drop all packets. +A new filter may be installed using the +.Dv NGM_BPF_SET_FILTER +control message. +.Sh HOOKS +This node type supports any number of hooks having arbitrary names. +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_BPF_SET_FILTER +This command sets the filter program that will be applied to incoming +data on a hook. The following structure must be supplied as an argument: +.Bd -literal -offset 4n +struct ngm_bpf_hookprog { + char thisHook[NG_HOOKLEN+1]; /* name of hook */ + char ifMatch[NG_HOOKLEN+1]; /* match dest hook */ + char ifNotMatch[NG_HOOKLEN+1]; /* !match dest hook */ + int32_t bpf_prog_len; /* #isns in program */ + struct bpf_insn bpf_prog[0]; /* bpf program */ +}; +.Ed +.Pp +The hook to be updated is specified in +.Dv thisHook . +The BPF program is the sequence of instructions in the +.Dv bpf_prog +array; there must be +.Dv bpf_prog_len +of them. +Matching and non-matching incoming packets are delivered out the hooks named +.Dv ifMatch +and +.Dv ifNotMatch , +respectively. The program must be a valid +.Xr bpf 8 +program or else +.Er EINVAL +is returned. +.It Dv NGM_BPF_GET_FILTER +This command takes an ASCII string argument, the hook name, and returns the +corresponding +.Dv "struct ngm_bpf_hookprog" +as shown above. +.It Dv NGM_BPF_GET_STATS +This command takes an ASCII string argument, the hook name, and returns the +statistics associated with the hook as a +.Dv "struct ng_bpf_hookstat" . +.It Dv NGM_BPF_CLR_STATS +This command takes an ASCII string argument, the hook name, and clears the +statistics associated with the hook. +.It Dv NGM_BPF_GETCLR_STATS +This command is identical to +.Dv NGM_BPF_GET_STATS , +except that the statistics are also atomically cleared. +.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 +When built as a loadable kernel module, this module includes the file +.Dv "net/bpf_filter.c" . +Although loading the module should fail if +.Dv "net/bpf_filter.c" +already exists in the kernel, currently it does not, and the duplicate +copies of the file do not interfere. +However, this may change in the future. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr bpf 4 , +.Xr ngctl 8 . +.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 0000000..ba91dab --- /dev/null +++ b/sys/modules/netgraph/cisco/Makefile @@ -0,0 +1,33 @@ +# $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} + +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 0000000..26370cd --- /dev/null +++ b/sys/modules/netgraph/cisco/ng_cisco.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_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 <netinet/in.h> +.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 accomplish 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 Elischer <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 0000000..26370cd --- /dev/null +++ b/sys/modules/netgraph/cisco/ng_cisco.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_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 <netinet/in.h> +.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 accomplish 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 Elischer <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 0000000..0c33d2f --- /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 0000000..7e22a6f --- /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 4.0 +.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 Elischer <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 0000000..7e22a6f --- /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 4.0 +.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 Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/frame_relay/Makefile b/sys/modules/netgraph/frame_relay/Makefile new file mode 100644 index 0000000..3c0117a --- /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 0000000..fc9ef0f --- /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 4.0 +.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 Elischer <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 0000000..fc9ef0f --- /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 4.0 +.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 Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/hole/Makefile b/sys/modules/netgraph/hole/Makefile new file mode 100644 index 0000000..f7408c1 --- /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 0000000..472b22c --- /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 4.0 +.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 Elischer <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 0000000..472b22c --- /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 4.0 +.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 Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/iface/Makefile b/sys/modules/netgraph/iface/Makefile new file mode 100644 index 0000000..ccd6fe8 --- /dev/null +++ b/sys/modules/netgraph/iface/Makefile @@ -0,0 +1,35 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.2 1999/01/19 19:39:21 archie Exp $ + +KMOD= ng_iface +SRCS= ng_iface.c opt_inet.h opt_atalk.h opt_ipx.h +MAN8= ng_iface.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/iface/ng_iface.4 b/sys/modules/netgraph/iface/ng_iface.4 new file mode 100644 index 0000000..376b5c5 --- /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 4.0 +.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). +.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 currently 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_ppp 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 0000000..376b5c5 --- /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 4.0 +.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). +.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 currently 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_ppp 8 , +.Xr ng_rfc1490 8 , +.Xr ngctl 8 , +.Xr ifconfig 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/ksocket/Makefile b/sys/modules/netgraph/ksocket/Makefile new file mode 100644 index 0000000..5baadf7 --- /dev/null +++ b/sys/modules/netgraph/ksocket/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +KMOD= ng_ksocket +SRCS= ng_ksocket.c +MAN8= ng_ksocket.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/ksocket/ng_ksocket.4 b/sys/modules/netgraph/ksocket/ng_ksocket.4 new file mode 100644 index 0000000..d32c2cf --- /dev/null +++ b/sys/modules/netgraph/ksocket/ng_ksocket.4 @@ -0,0 +1,178 @@ +.\" Copyright (c) 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$ +.\" +.Dd November 15, 1999 +.Dt NG_KSOCKET 8 +.Os FreeBSD +.Sh NAME +.Nm ng_ksocket +.Nd kernel socket netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ksocket.h> +.Sh DESCRIPTION +A +.Nm ksocket +node is both a netgraph node and a BSD socket. The +.Nm ksocket +node type allows one to open a socket inside the kernel and have +it appear as a Netgraph node. The +.Nm ksocket +node type is the reverse of the socket node type (see +.Xr ng_socket 8 "):" +whereas the socket node type enables the user-level manipulation (via +a socket) of what is normally a kernel-level entity (the associated +Netgraph node), the +.Nm ksocket +node type enables the kernel-level manipulation (via a Netgraph node) of +what is normally a user-level entity (the associated socket). +.Pp +A +.Nm ksocket +node allows at most one hook connection. Connecting to the node is +equivalent to opening the associated socket. The name given to the hook +determines what kind of socket the node will open (see below). +When the hook is disconnected and/or the node is shutdown, the +associated socket is closed. +.Sh HOOKS +This node type supports a single hook connection at a time. +The name of the hook must be of the form +.Dv Em <family>/<type>/<proto> , +where the +.Dv Em family , +.Dv Em type , +and +.Dv Em proto +are the decimal equivalent of the same arguments to +.Xr socket 2 . +Alternately, aliases for the commonly used values are accepted as +well. For example +.Dv inet/dgram/udp +is a more readable but equivalent version of +.Dv 2/2/17 . +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_KSOCKET_BIND +This functions exactly like the +.Xr bind 2 +system call. The +.Dv "struct sockaddr" +socket address parameter should be supplied as an argument. +.It Dv NGM_KSOCKET_LISTEN +This functions exactly like the +.Xr listen 2 +system call. The backlog paramter (a single 32 bit +.Dv int ) +should be supplied as an argument. +.It Dv NGM_KSOCKET_CONNECT +This functions exactly like the +.Xr connect 2 +system call. The +.Dv "struct sockaddr" +destination address parameter should be supplied as an argument. +.It Dv NGM_KSOCKET_ACCEPT +Currently unimplemented. +.It Dv NGM_KSOCKET_GETNAME +Equivalent to the +.Xr getname 2 +system call. The name is returned as a +.Dv "struct sockaddr" +in the arguments field of the reply. +.It Dv NGM_KSOCKET_GETPEERNAME +Equivalent to the +.Xr getpeername 2 +system call. The name is returned as a +.Dv "struct sockaddr" +in the arguments field of the reply. +.It Dv NGM_KSOCKET_SETOPT +Equivalent to the +.Xr setsockopt 2 +system call, except that the option name, level, and value are passed in a +.Dv "struct ng_ksocket_sockopt" . +.It Dv NGM_KSOCKET_GETOPT +Equivalent to the +.Xr getsockopt 2 +system call, except that the option is passed in a +.Dv "struct ng_ksocket_sockopt" . +When sending this command, the +.Dv value +field should be empty; upon return, it will contain the +retrieved value. +.El +.Pp +.Sh ASCII FORM CONTROL MESSAGES +For control messages that pass a +.Dv "struct sockaddr" +in the argument field, the normal ASCII equivalent of the C structure +is an acceptable form. For the +.Dv PF_INET +and +.Dv PF_LOCAL +address families, a more convenient form is also used, which is +the protocol family name, followed by a slash, followed by the actual +address. For +.Dv PF_INET , +the address is an IP address followed by an optional colon and port number. +For +.Dv PF_LOCAL , +the address is the pathname as a doubly quoted string. +.Pp +Examples: +.Bl -tag -width XXXXXXXXXX +.It Dv PF_LOCAL +inet/192.168.1.1:1234 +.It Dv PF_INET +local/"/tmp/foo.socket" +.It Other +.Dv "{ family=16 len=16 data=[ 0x70 0x00 0x01 0x23 ] }" +.El +.Pp +For control messages that pass a +.Dv "struct ng_ksocket_sockopt" , +the normal ASCII form for that structure is used. In the future, more +convenient encoding of the more common socket options may be supported. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when the hook is disconnected. +Shutdown of the node closes the associated socket. +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 4 , +.Xr ng_socket 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/ksocket/ng_ksocket.8 b/sys/modules/netgraph/ksocket/ng_ksocket.8 new file mode 100644 index 0000000..d32c2cf --- /dev/null +++ b/sys/modules/netgraph/ksocket/ng_ksocket.8 @@ -0,0 +1,178 @@ +.\" Copyright (c) 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$ +.\" +.Dd November 15, 1999 +.Dt NG_KSOCKET 8 +.Os FreeBSD +.Sh NAME +.Nm ng_ksocket +.Nd kernel socket netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ksocket.h> +.Sh DESCRIPTION +A +.Nm ksocket +node is both a netgraph node and a BSD socket. The +.Nm ksocket +node type allows one to open a socket inside the kernel and have +it appear as a Netgraph node. The +.Nm ksocket +node type is the reverse of the socket node type (see +.Xr ng_socket 8 "):" +whereas the socket node type enables the user-level manipulation (via +a socket) of what is normally a kernel-level entity (the associated +Netgraph node), the +.Nm ksocket +node type enables the kernel-level manipulation (via a Netgraph node) of +what is normally a user-level entity (the associated socket). +.Pp +A +.Nm ksocket +node allows at most one hook connection. Connecting to the node is +equivalent to opening the associated socket. The name given to the hook +determines what kind of socket the node will open (see below). +When the hook is disconnected and/or the node is shutdown, the +associated socket is closed. +.Sh HOOKS +This node type supports a single hook connection at a time. +The name of the hook must be of the form +.Dv Em <family>/<type>/<proto> , +where the +.Dv Em family , +.Dv Em type , +and +.Dv Em proto +are the decimal equivalent of the same arguments to +.Xr socket 2 . +Alternately, aliases for the commonly used values are accepted as +well. For example +.Dv inet/dgram/udp +is a more readable but equivalent version of +.Dv 2/2/17 . +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_KSOCKET_BIND +This functions exactly like the +.Xr bind 2 +system call. The +.Dv "struct sockaddr" +socket address parameter should be supplied as an argument. +.It Dv NGM_KSOCKET_LISTEN +This functions exactly like the +.Xr listen 2 +system call. The backlog paramter (a single 32 bit +.Dv int ) +should be supplied as an argument. +.It Dv NGM_KSOCKET_CONNECT +This functions exactly like the +.Xr connect 2 +system call. The +.Dv "struct sockaddr" +destination address parameter should be supplied as an argument. +.It Dv NGM_KSOCKET_ACCEPT +Currently unimplemented. +.It Dv NGM_KSOCKET_GETNAME +Equivalent to the +.Xr getname 2 +system call. The name is returned as a +.Dv "struct sockaddr" +in the arguments field of the reply. +.It Dv NGM_KSOCKET_GETPEERNAME +Equivalent to the +.Xr getpeername 2 +system call. The name is returned as a +.Dv "struct sockaddr" +in the arguments field of the reply. +.It Dv NGM_KSOCKET_SETOPT +Equivalent to the +.Xr setsockopt 2 +system call, except that the option name, level, and value are passed in a +.Dv "struct ng_ksocket_sockopt" . +.It Dv NGM_KSOCKET_GETOPT +Equivalent to the +.Xr getsockopt 2 +system call, except that the option is passed in a +.Dv "struct ng_ksocket_sockopt" . +When sending this command, the +.Dv value +field should be empty; upon return, it will contain the +retrieved value. +.El +.Pp +.Sh ASCII FORM CONTROL MESSAGES +For control messages that pass a +.Dv "struct sockaddr" +in the argument field, the normal ASCII equivalent of the C structure +is an acceptable form. For the +.Dv PF_INET +and +.Dv PF_LOCAL +address families, a more convenient form is also used, which is +the protocol family name, followed by a slash, followed by the actual +address. For +.Dv PF_INET , +the address is an IP address followed by an optional colon and port number. +For +.Dv PF_LOCAL , +the address is the pathname as a doubly quoted string. +.Pp +Examples: +.Bl -tag -width XXXXXXXXXX +.It Dv PF_LOCAL +inet/192.168.1.1:1234 +.It Dv PF_INET +local/"/tmp/foo.socket" +.It Other +.Dv "{ family=16 len=16 data=[ 0x70 0x00 0x01 0x23 ] }" +.El +.Pp +For control messages that pass a +.Dv "struct ng_ksocket_sockopt" , +the normal ASCII form for that structure is used. In the future, more +convenient encoding of the more common socket options may be supported. +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when the hook is disconnected. +Shutdown of the node closes the associated socket. +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 4 , +.Xr ng_socket 8 , +.Xr ngctl 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 0000000..9b4c07e --- /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 0000000..2ce52a7 --- /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 4.0 +.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 Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elischer <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 0000000..2ce52a7 --- /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 4.0 +.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 Signaling System No. 1 - Signaling Specification for Frame Mode Basic Call Control, Annex A" +.Re +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/netgraph/Makefile b/sys/modules/netgraph/netgraph/Makefile new file mode 100644 index 0000000..eaaf4ac --- /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 ng_parse.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 0000000..46cc658 --- /dev/null +++ b/sys/modules/netgraph/netgraph/netgraph.4 @@ -0,0 +1,980 @@ +.\" 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 C structures sent from one node +directly to some arbitrary other node. Control messages have a common +header format, followed by type-specific data, and are binary structures +for efficiency. However, node types also may support conversion of the +type specific data between binary and +ASCII for debugging and human interface purposes (see the +.Dv NGM_ASCII2BINARY +and +.Dv NGM_BINARY2ASCII +generic control messages below). Nodes are not required to support +these conversions. +.Pp +There are two ways to address a control 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 deferred 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 ``.'' (referred 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 these structures: +.Bd -literal +/** How to convert a control message from binary <-> ASCII */ +struct ng_cmdlist { + u_int32_t cookie; /* typecookie */ + int cmd; /* command number */ + const char *name; /* command name */ + const struct ng_parse_type *mesgType; /* args if !NGF_RESP */ + const struct ng_parse_type *respType; /* args if NGF_RESP */ +}; + +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 */ + + /** How to convert control messages binary <-> ASCII */ + const struct ng_cmdlist *cmdlist; /* Optional; may be NULL */ +}; +.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 Control Message ASCII Form +Control messages are in binary format for efficiency. However, for +debugging and human interface purposes, and if the node type supports +it, control messages may be converted to and from an equivalent ASCII +form. The ASCII form is similar to the binary form, with two exceptions: +.Pp +.Bl -tag -compact -width xxx +.It o +The +.Dv cmdstr +header field must contain the ASCII name of the command, corresponding to the +.Dv cmd +header field. +.It o +The +.Dv args +field contains a NUL-terminated ASCII string version of the message arguments. +.El +.Pp +In general, the arguments field of a control messgage can be any +arbitrary C data type. Netgraph includes parsing routines to support +some pre-defined datatypes in ASCII with this simple syntax: +.Pp +.Bl -tag -compact -width xxx +.It o +Integer types are represented by base 8, 10, or 16 numbers. +.It o +Strings are enclosed in double quotes and respect the normal +C language backslash escapes. +.It o +IP addresses have the obvious form. +.It o +Arrays are enclosed in square brackets, with the elements listed +consecutively starting at index zero. An element may have an optional +index and equals sign preceeding it. Whenever an element +does not have an explicit index, the index is implicitly the previous +element's index plus one. +.It o +Structures are enclosed in curly braces, and each field is specified +in the form ``fieldname=value''. +.It o +Any array element or structure field whose value is equal to its +``default value'' may be omitted. For integer types, the default value +is usually zero; for string types, the empty string. +.It o +Array elements and structure fields may be specified in any order. +.El +.Pp +Each node type may define its own arbitrary types by providing +the necessary routines to parse and unparse. ASCII forms defined +for a specific node type are documented in the documentation for +that node type. +.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 disappear 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 description 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. +.It Dv NGM_BINARY2ASCII +This message converts a binary control message to its ASCII form. +The entire control message to be converted is contained within the +arguments field of the +.Dv Dv NGM_BINARY2ASCII +message itself. If successful, the reply will contain the same control +message in ASCII form. +A node will typically only know how to translate messages that it +itself understands, so the target node of the +.Dv NGM_BINARY2ASCII +is often the same node that would actually receive that message. +.It Dv NGM_ASCII2BINARY +The opposite of +.Dv NGM_BINARY2ASCII . +The entire control message to be converted, in ASCII form, is contained +in the arguments section of the +.Dv NGM_ASCII2BINARY +and need only have the +.Dv flags , +.Dv cmdstr , +and +.Dv arglen +header fields filled in, plus the NUL-terminated string version of +the arguments in the arguments field. If successful, the reply +contains the binary version of the control message. +.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 supplemented 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 which 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 message +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 traveling 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 solely 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_ksocket 8 , +.Xr ng_lmi 8 , +.Xr ng_ppp 8 , +.Xr ng_pppoe 8 , +.Xr ng_rfc1490 8 , +.Xr ng_socket 8 , +.Xr ng_tee 8 , +.Xr ng_tty 8 , +.Xr ng_UI 8 , +.Xr ng_vjc 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 0000000..590e10a --- /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 0000000..ac23ee4 --- /dev/null +++ b/sys/modules/netgraph/ppp/ng_ppp.4 @@ -0,0 +1,379 @@ +.\" 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 +.Sh NAME +.Nm ng_ppp +.Nd PPP protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ppp.h> +.Sh DESCRIPTION +The +.Nm ppp +node type performs multiplexing for the PPP protocol. It handles +only packets that contain data, and forwards protocol negotiation +and control packets to a separate controlling entity (e.g., a +user-land daemon). This approach combines the fast dispatch of +kernel implementations with the configuration flexibility of a +user-land implementations. The PPP node type directly supports +multi-link PPP, Van Jacobsen compression, PPP compression, PPP +encryption, and the IP, IPX, and AppleTalk protocols. A single +PPP node corresponds to one PPP multi-link bundle. +.Pp +There is a separate hook for each PPP link in the bundle, plus +several hooks corresponding to the directly supported protocols. +For compression and encryption, separate attached nodes are required +to do the actual work. The node type used will of course depend +on the algorithm negotiated. There is also a +.Dv bypass +hook which is used to handle any protocol not directly supported +by the node. This includes all of the control protocols: LCP, IPCP, +CCP, etc. Typically this node is connected to a user-land daemon +via a +.Xr ng_socket(8) +type node. +.Sh ENABLING FUNCTIONALITY +In general, the PPP node enables a specific link or functionality when +(a) a +.Dv NGM_PPP_SET_CONFIG +message has been received which enables it, and +(b) the corresponding hook(s) are connected. +This allows the controlling entity to use either method (a) or (b) +(or both) to control the node's behavior. +When a link is connected but disabled, traffic can still flow on +the link via the +.Dv bypass +hook (see below). +.Sh LINK HOOKS +During normal operation, the individual PPP links are connected to hooks +.Dv link0 , +.Dv link1 , +etc. Up to +.Dv NG_PPP_MAX_LINKS +links are supported. +These device-independent hooks transmit and receive full PPP +frames, which include the PPP protocol, address, control, and +information fields, but no checksum or other link-specific fields. +.Pp +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. Similarly, if address and control +field compression has been enabled for the link, the address and +control fields will be omitted (except for LCP frames as required +by the standards). Incoming frames have the address and control fields +stripped automatically if present. +.Pp +Since all negotiation is handled outside the PPP node, the links +should not be connected and enabled until the corresponding link +has reached the network phase (i.e., LCP negotiation and authentication +have completed successfully) and the PPP node has been informed of +the link parameters via the +.Dv NGM_PPP_LINK_CONFIG +message. +.Pp +When a link is connected but disabled, all received frames are forwarded +directly out the +.Dv bypass +hook, and conversely, frames may be transmitted via the +.Dv bypass +hook as well. This mode is appropriate for the link authentication phase. +As soon as the link is enabled, the PPP node will +begin processing frames received on the link. +.Sh COMPRESSION AND ENCRYPTION +Compression is supported via two hooks, +.Dv compress +and +.Dv decompress . +When enabled and connected, the PPP node writes outgoing frames on the +.Dv comp +hook and expects to receive back the compressed frame on the same hook. +Similarly, the +.Dv decompress +hook is used to uncompress incoming frames when decompression is +negotiated (compression and decompression are independently negotiable). +The type of node attached to these hooks should correspond +to the type of compression negotiated, e.g., Deflate, Predictor-1, etc. +.Pp +Encryption works exactly analogously via the +.Dv encrypt +and +.Dv decrypt +nodes. Data is always compressed before being encrypted, +and decrypted before being decompressed. +.Pp +Only bundle-level compression and encryption is directly supported; +link-level compression and encryption can be handled transparently +by downstream nodes. +.Sh VAN JACOBSEN COMPRESSION +When all of the +.Dv vjc_ip , +.Dv vjc_vjcomp , +.Dv vjc_vjuncomp , +and +.Dv vjc_vjip +hooks are connected, and the corresponding configuration flag is +enabled, Van Jacobsen compression and/or decompression will become active. +Normally these hooks connect to the corresponding hooks of a single +.Xr ng_vjc 8 +node. The PPP node is compatible with the ``pass through'' modes of the +.Xr ng_vjc 8 +node type. +.Sh BYPASS HOOK +When a frame is received on a link with an unsupported protocol, +or a protocol which is disabled or for which the corresponding hook +is unconnected, the PPP node forwards the frame out the +.Dv bypass +hook, prepended with a four byte prefix. This first two bytes of +the prefix indicate the link number on which the frame was received +(in network order). +For such frames received over the bundle (i.e., encapsulated in the +multi-link protocol), the special link number +.Dv NG_PPP_BUNDLE_LINKNUM +is used. After the two byte link number is the two byte PPP protocol number +(also in network order). +The PPP protocol number is two bytes long even if the original frame +was protocol compressed. +.Pp +Conversely, any data written to the +.Dv bypass +hook is assumed to be in this same format. The four byte header is +stripped off, the PPP protocol number is prepended (possibly compressed), +and the frame is delivered over the desired link. +If the link number is +.Dv NG_PPP_BUNDLE_LINKNUM +the frame will be delivered over the multi-link bundle; or, if multi-link +is disabled, over the (single) PPP link. +.Pp +Typically when the controlling entity receives a packet on the bypass +hook it responds either by dropping the frame (if it's not ready for +the protocol) or with an LCP protocol reject (if it doesn't recognize +or expect the protocol). +.Sh MULTILINK OPERATION +To enable multi-link PPP, the corresponding configuration flag must be set +and at least one link connected. The PPP node will not allow more than +one link to be connected if multi-link is not enabled, nor will it allow +certain multi-link settings to be changed while multi-link operation is +active (e.g., short sequence number header format). +.Pp +Because packets are sent as fragments across multiple individual links, +it is important that when a link goes down the PPP node is notified +immediately, either by disconnecting the corresponding hook or disabling +the link via the +.Dv NGM_PPP_SET_CONFIG +control message. +.Pp +Each link has configuration parameters for latency (specified in +milliseconds) and bandwidth (specified in tens of bytes per second). +The PPP node can be configured for +.Em round-robin +or +.Em optimized +packet delivery. +.Pp +When configured for round-robin delivery, the latency and bandwidth +values are ignored and the PPP node simply sends each frame as a +single fragment, alternating frames across all the links in the +bundle. This scheme has the advantage that even if one link fails +silently, some packets will still get through. It has the disadvantage +of sub-optimal overall bundle latency, which is important for +interactive response time, and sub-optimal overall bundle bandwidth +when links with different bandwidths exist in the same bundle. +.Pp +When configured for optimal delivery, the PPP node distributes the +packet across the links in a way that minimizes the time it takes +for the completed packet to be received by the far end. This +involves taking into account each link's latency, bandwidth, and +current queue length. Therefore these numbers should be +configured as accurately as possible. The algorithm does require +some computation, so may not be appropriate for very slow machines +and/or very fast links. +.Pp +As a special case, if all links have identical latency and bandwidth, +then the above algorithm is disabled (because it is unnecessary) +and the PPP node simply fragments frames into equal sized portions +across all of the links. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -compact -width vjc_vjuncomp +.It Dv link<N> +Individual PPP link number +.Dv <N> +.It Dv compress +Connection to compression engine +.It Dv decompress +Connection to decompression engine +.It Dv encrypt +Connection to encryption engine +.It Dv decrypt +Connection to decryption engine +.It Dv vjc_ip +Connection to +.Xr ng_vjc 8 +.Dv ip +hook +.It Dv vjc_vjcomp +Connection to +.Xr ng_vjc 8 +.Dv vjcomp +hook +.It Dv vjc_vjuncomp +Connection to +.Xr ng_vjc 8 +.Dv vjuncomp +hook +.It Dv vjc_vjip +Connection to +.Xr ng_vjc 8 +.Dv vjip +hook +.It Dv inet +IP packet data +.It Dv atalk +AppleTalk packet data +.It Dv ipx +IPX packet data +.It Dv bypass +Bypass hook; frames have a four byte header consisting of +a link number and a PPP protocol number. +.El +.Pp +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPP_SET_CONFIG +This command configures all aspects of the node. This includes enabling +multi-link PPP, encryption, compression, Van Jacobsen compression, and IP, +AppleTalk, and IPX packet delivery. It includes per-link configuration, +including enabling the link, setting latency and bandwidth parameters, +and enabling protocol field compression. Note that no link or functionality +is active until the corresponding hook is also connected. +This command takes a +.Dv "struct ng_ppp_node_config" +as an argument: +.Bd -literal -offset 0 +/* Per-link config structure */ +struct ng_ppp_link_config { + u_char enableLink; /* enable this link */ + u_char enableProtoComp;/* enable protocol field compression */ + u_char enableACFComp; /* enable addr/ctrl field compression */ + u_int16_t mru; /* peer MRU */ + u_int32_t latency; /* link latency (in milliseconds) */ + u_int32_t bandwidth; /* link bandwidth (in bytes/second) */ +}; + +/* Node config structure */ +struct ng_ppp_node_config { + u_int16_t mrru; /* multilink peer MRRU */ + u_char enableMultilink; /* enable multilink */ + u_char recvShortSeq; /* recv multilink short seq # */ + u_char xmitShortSeq; /* xmit multilink short seq # */ + u_char enableRoundRobin; /* xmit whole packets */ + u_char enableIP; /* enable IP data flow */ + u_char enableAtalk; /* enable AppleTalk data flow */ + u_char enableIPX; /* enable IPX data flow */ + u_char enableCompression; /* enable PPP compression */ + u_char enableDecompression; /* enable PPP decompression */ + u_char enableEncryption; /* enable PPP encryption */ + u_char enableDecryption; /* enable PPP decryption */ + u_char enableVJCompression; /* enable VJ compression */ + u_char enableVJDecompression; /* enable VJ decompression */ + struct ng_ppp_link_config /* per link config params */ + links[NG_PPP_MAX_LINKS]; +}; +.Ed +.Pp +.It Dv NGM_PPP_GET_CONFIG +Returns the current configuration as a +.Dv "struct ng_ppp_node_config" . +.It Dv NGM_PPP_GET_LINK_STATS +This command takes a two byte link number as an argument and returns a +.Dv "struct ng_ppp_link_stat" +containing statistics for the corresponding link. Here +.Dv NG_PPP_BUNDLE_LINKNUM +is a valid link number corresponding to the multi-link bundle. +.It Dv NGM_PPP_CLR_LINK_STATS +This command takes a two byte link number as an argument and +clears the statistics for that link. +.It Dv NGM_PPP_GETCLR_LINK_STATS +Same as +.Dv NGM_PPP_GET_LINK_STATS , +but also atomically clears the statistics as well. +.El +.Pp +This node type also accepts the control messages accepted by the +.Xr ng_vjc 8 +node type. When received, these messages are simply forwarded to +the adjacent +.Xr ng_vjc 8 +node, if any. This is particularly useful when the individual +PPP links are able to generate +.Dv NGM_VJC_RECV_ERROR +messages (see +.Xr ng_vjc 8 +for a description). +.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_iface 8 , +.Xr ng_vjc 8 , +.Xr ng_pppoe 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "The Point-to-Point Protocol (PPP)" +.%O RFC 1661 +.Re +.Rs +.%A K. Sklower +.%A B. Lloyd +.%A G. McGregor +.%A D. Carr +.%A T. Coradetti +.%T "The PPP Multilink Protocol (MP)" +.%O RFC 1990 +.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 0000000..ac23ee4 --- /dev/null +++ b/sys/modules/netgraph/ppp/ng_ppp.8 @@ -0,0 +1,379 @@ +.\" 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 +.Sh NAME +.Nm ng_ppp +.Nd PPP protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_ppp.h> +.Sh DESCRIPTION +The +.Nm ppp +node type performs multiplexing for the PPP protocol. It handles +only packets that contain data, and forwards protocol negotiation +and control packets to a separate controlling entity (e.g., a +user-land daemon). This approach combines the fast dispatch of +kernel implementations with the configuration flexibility of a +user-land implementations. The PPP node type directly supports +multi-link PPP, Van Jacobsen compression, PPP compression, PPP +encryption, and the IP, IPX, and AppleTalk protocols. A single +PPP node corresponds to one PPP multi-link bundle. +.Pp +There is a separate hook for each PPP link in the bundle, plus +several hooks corresponding to the directly supported protocols. +For compression and encryption, separate attached nodes are required +to do the actual work. The node type used will of course depend +on the algorithm negotiated. There is also a +.Dv bypass +hook which is used to handle any protocol not directly supported +by the node. This includes all of the control protocols: LCP, IPCP, +CCP, etc. Typically this node is connected to a user-land daemon +via a +.Xr ng_socket(8) +type node. +.Sh ENABLING FUNCTIONALITY +In general, the PPP node enables a specific link or functionality when +(a) a +.Dv NGM_PPP_SET_CONFIG +message has been received which enables it, and +(b) the corresponding hook(s) are connected. +This allows the controlling entity to use either method (a) or (b) +(or both) to control the node's behavior. +When a link is connected but disabled, traffic can still flow on +the link via the +.Dv bypass +hook (see below). +.Sh LINK HOOKS +During normal operation, the individual PPP links are connected to hooks +.Dv link0 , +.Dv link1 , +etc. Up to +.Dv NG_PPP_MAX_LINKS +links are supported. +These device-independent hooks transmit and receive full PPP +frames, which include the PPP protocol, address, control, and +information fields, but no checksum or other link-specific fields. +.Pp +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. Similarly, if address and control +field compression has been enabled for the link, the address and +control fields will be omitted (except for LCP frames as required +by the standards). Incoming frames have the address and control fields +stripped automatically if present. +.Pp +Since all negotiation is handled outside the PPP node, the links +should not be connected and enabled until the corresponding link +has reached the network phase (i.e., LCP negotiation and authentication +have completed successfully) and the PPP node has been informed of +the link parameters via the +.Dv NGM_PPP_LINK_CONFIG +message. +.Pp +When a link is connected but disabled, all received frames are forwarded +directly out the +.Dv bypass +hook, and conversely, frames may be transmitted via the +.Dv bypass +hook as well. This mode is appropriate for the link authentication phase. +As soon as the link is enabled, the PPP node will +begin processing frames received on the link. +.Sh COMPRESSION AND ENCRYPTION +Compression is supported via two hooks, +.Dv compress +and +.Dv decompress . +When enabled and connected, the PPP node writes outgoing frames on the +.Dv comp +hook and expects to receive back the compressed frame on the same hook. +Similarly, the +.Dv decompress +hook is used to uncompress incoming frames when decompression is +negotiated (compression and decompression are independently negotiable). +The type of node attached to these hooks should correspond +to the type of compression negotiated, e.g., Deflate, Predictor-1, etc. +.Pp +Encryption works exactly analogously via the +.Dv encrypt +and +.Dv decrypt +nodes. Data is always compressed before being encrypted, +and decrypted before being decompressed. +.Pp +Only bundle-level compression and encryption is directly supported; +link-level compression and encryption can be handled transparently +by downstream nodes. +.Sh VAN JACOBSEN COMPRESSION +When all of the +.Dv vjc_ip , +.Dv vjc_vjcomp , +.Dv vjc_vjuncomp , +and +.Dv vjc_vjip +hooks are connected, and the corresponding configuration flag is +enabled, Van Jacobsen compression and/or decompression will become active. +Normally these hooks connect to the corresponding hooks of a single +.Xr ng_vjc 8 +node. The PPP node is compatible with the ``pass through'' modes of the +.Xr ng_vjc 8 +node type. +.Sh BYPASS HOOK +When a frame is received on a link with an unsupported protocol, +or a protocol which is disabled or for which the corresponding hook +is unconnected, the PPP node forwards the frame out the +.Dv bypass +hook, prepended with a four byte prefix. This first two bytes of +the prefix indicate the link number on which the frame was received +(in network order). +For such frames received over the bundle (i.e., encapsulated in the +multi-link protocol), the special link number +.Dv NG_PPP_BUNDLE_LINKNUM +is used. After the two byte link number is the two byte PPP protocol number +(also in network order). +The PPP protocol number is two bytes long even if the original frame +was protocol compressed. +.Pp +Conversely, any data written to the +.Dv bypass +hook is assumed to be in this same format. The four byte header is +stripped off, the PPP protocol number is prepended (possibly compressed), +and the frame is delivered over the desired link. +If the link number is +.Dv NG_PPP_BUNDLE_LINKNUM +the frame will be delivered over the multi-link bundle; or, if multi-link +is disabled, over the (single) PPP link. +.Pp +Typically when the controlling entity receives a packet on the bypass +hook it responds either by dropping the frame (if it's not ready for +the protocol) or with an LCP protocol reject (if it doesn't recognize +or expect the protocol). +.Sh MULTILINK OPERATION +To enable multi-link PPP, the corresponding configuration flag must be set +and at least one link connected. The PPP node will not allow more than +one link to be connected if multi-link is not enabled, nor will it allow +certain multi-link settings to be changed while multi-link operation is +active (e.g., short sequence number header format). +.Pp +Because packets are sent as fragments across multiple individual links, +it is important that when a link goes down the PPP node is notified +immediately, either by disconnecting the corresponding hook or disabling +the link via the +.Dv NGM_PPP_SET_CONFIG +control message. +.Pp +Each link has configuration parameters for latency (specified in +milliseconds) and bandwidth (specified in tens of bytes per second). +The PPP node can be configured for +.Em round-robin +or +.Em optimized +packet delivery. +.Pp +When configured for round-robin delivery, the latency and bandwidth +values are ignored and the PPP node simply sends each frame as a +single fragment, alternating frames across all the links in the +bundle. This scheme has the advantage that even if one link fails +silently, some packets will still get through. It has the disadvantage +of sub-optimal overall bundle latency, which is important for +interactive response time, and sub-optimal overall bundle bandwidth +when links with different bandwidths exist in the same bundle. +.Pp +When configured for optimal delivery, the PPP node distributes the +packet across the links in a way that minimizes the time it takes +for the completed packet to be received by the far end. This +involves taking into account each link's latency, bandwidth, and +current queue length. Therefore these numbers should be +configured as accurately as possible. The algorithm does require +some computation, so may not be appropriate for very slow machines +and/or very fast links. +.Pp +As a special case, if all links have identical latency and bandwidth, +then the above algorithm is disabled (because it is unnecessary) +and the PPP node simply fragments frames into equal sized portions +across all of the links. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -compact -width vjc_vjuncomp +.It Dv link<N> +Individual PPP link number +.Dv <N> +.It Dv compress +Connection to compression engine +.It Dv decompress +Connection to decompression engine +.It Dv encrypt +Connection to encryption engine +.It Dv decrypt +Connection to decryption engine +.It Dv vjc_ip +Connection to +.Xr ng_vjc 8 +.Dv ip +hook +.It Dv vjc_vjcomp +Connection to +.Xr ng_vjc 8 +.Dv vjcomp +hook +.It Dv vjc_vjuncomp +Connection to +.Xr ng_vjc 8 +.Dv vjuncomp +hook +.It Dv vjc_vjip +Connection to +.Xr ng_vjc 8 +.Dv vjip +hook +.It Dv inet +IP packet data +.It Dv atalk +AppleTalk packet data +.It Dv ipx +IPX packet data +.It Dv bypass +Bypass hook; frames have a four byte header consisting of +a link number and a PPP protocol number. +.El +.Pp +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPP_SET_CONFIG +This command configures all aspects of the node. This includes enabling +multi-link PPP, encryption, compression, Van Jacobsen compression, and IP, +AppleTalk, and IPX packet delivery. It includes per-link configuration, +including enabling the link, setting latency and bandwidth parameters, +and enabling protocol field compression. Note that no link or functionality +is active until the corresponding hook is also connected. +This command takes a +.Dv "struct ng_ppp_node_config" +as an argument: +.Bd -literal -offset 0 +/* Per-link config structure */ +struct ng_ppp_link_config { + u_char enableLink; /* enable this link */ + u_char enableProtoComp;/* enable protocol field compression */ + u_char enableACFComp; /* enable addr/ctrl field compression */ + u_int16_t mru; /* peer MRU */ + u_int32_t latency; /* link latency (in milliseconds) */ + u_int32_t bandwidth; /* link bandwidth (in bytes/second) */ +}; + +/* Node config structure */ +struct ng_ppp_node_config { + u_int16_t mrru; /* multilink peer MRRU */ + u_char enableMultilink; /* enable multilink */ + u_char recvShortSeq; /* recv multilink short seq # */ + u_char xmitShortSeq; /* xmit multilink short seq # */ + u_char enableRoundRobin; /* xmit whole packets */ + u_char enableIP; /* enable IP data flow */ + u_char enableAtalk; /* enable AppleTalk data flow */ + u_char enableIPX; /* enable IPX data flow */ + u_char enableCompression; /* enable PPP compression */ + u_char enableDecompression; /* enable PPP decompression */ + u_char enableEncryption; /* enable PPP encryption */ + u_char enableDecryption; /* enable PPP decryption */ + u_char enableVJCompression; /* enable VJ compression */ + u_char enableVJDecompression; /* enable VJ decompression */ + struct ng_ppp_link_config /* per link config params */ + links[NG_PPP_MAX_LINKS]; +}; +.Ed +.Pp +.It Dv NGM_PPP_GET_CONFIG +Returns the current configuration as a +.Dv "struct ng_ppp_node_config" . +.It Dv NGM_PPP_GET_LINK_STATS +This command takes a two byte link number as an argument and returns a +.Dv "struct ng_ppp_link_stat" +containing statistics for the corresponding link. Here +.Dv NG_PPP_BUNDLE_LINKNUM +is a valid link number corresponding to the multi-link bundle. +.It Dv NGM_PPP_CLR_LINK_STATS +This command takes a two byte link number as an argument and +clears the statistics for that link. +.It Dv NGM_PPP_GETCLR_LINK_STATS +Same as +.Dv NGM_PPP_GET_LINK_STATS , +but also atomically clears the statistics as well. +.El +.Pp +This node type also accepts the control messages accepted by the +.Xr ng_vjc 8 +node type. When received, these messages are simply forwarded to +the adjacent +.Xr ng_vjc 8 +node, if any. This is particularly useful when the individual +PPP links are able to generate +.Dv NGM_VJC_RECV_ERROR +messages (see +.Xr ng_vjc 8 +for a description). +.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_iface 8 , +.Xr ng_vjc 8 , +.Xr ng_pppoe 8 , +.Xr ngctl 8 . +.Rs +.%A W. Simpson +.%T "The Point-to-Point Protocol (PPP)" +.%O RFC 1661 +.Re +.Rs +.%A K. Sklower +.%A B. Lloyd +.%A G. McGregor +.%A D. Carr +.%A T. Coradetti +.%T "The PPP Multilink Protocol (MP)" +.%O RFC 1990 +.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 0000000..ed3756f --- /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 0000000..69d0016 --- /dev/null +++ b/sys/modules/netgraph/pppoe/ng_pppoe.4 @@ -0,0 +1,399 @@ +.\" 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_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd October 28, 1999 +.Dt NG_PPPOE 8 +.Os FreeBSD 4.0 +.Sh NAME +.Nm ng_pppoe +.Nd RFC 2516 PPPOE protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <net/ethernet.h> +.Fd #include <netgraph/ng_pppoe.h> +.Sh DESCRIPTION +The +.Nm +node type performs the PPPoE protocol. It is used in conjunction with the +.Xr netgraph 4 +extensions to the Ethernet framework to divert and inject Ethernet packets +to and from a PPP agent (which is not specified). +.Pp +The +.Dv NGM_PPPOE_GET_STATUS +control message can be used at any time to query the current status +of the PPPOE module. The only statistics presently available are the +total packet counts for input and output. This node does not yet support +the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv ethernet +The hook that should normally be connected to an Ethernet node. +.It Dv debug +Presently no use. +.It Dv [unspecified] +Any other name is assumed to be a session hook that will be connected to +a PPP client agent, or a ppp server agent. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPPOE_GET_STATUS +This command returns status information in a +.Dv "struct ngpppoestat" : +.Bd -literal -offset 4n +struct ngpppoestat { + u_int packets_in; /* packets in from ethernet */ + u_int packets_out; /* packets out towards ethernet */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +(not yet) +.It Dv NGM_PPPOE_CONNECT +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a client. It must be newly created and +a service name can be given as an argument. It is legal to specify a zero length +service name. This is common on some DSL setups. A session request packet +will be broadcast on the Ethernet. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.It Dv NGM_PPPOE_LISTEN +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a server listener. The argument +given is the name of the service to listen on behalf of. A zero length service +length will match all requests for service. A matching service request +packet will be passed unmodified back to the process responsible +for starting the service. It can then examine it and pass it on to +the session that is started to answer the request. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.It Dv NGM_PPPOE_OFFER +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a server. The argument +given is the name of the service to offer. A zero length service +is legal. The State machine will progress to a state where it will await +a request packet to be forwarded to it from the startup server, +which in turn probably received it from a LISTEN mode hook ( see above). +This is so +that information that is required for the session that is embedded in +the original session request packet, is made available to the state machine +that eventually answers the request. When the Session request packet is +received, the session negotiation will proceed. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.Pp +The three commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_init_data { + char hook[NG_HOOKLEN + 1]; /* hook to monitor on */ + u_int16_t data_len; /* service name length */ + char data[0]; /* init data goes here */ +}; +.Ed +.It Dv NGM_PPPOE_SUCCESS +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +successful Session negotiation. It uses the structure shown below, and +reports back the hook name corresponding to the successful session. +.It Dv NGM_NGM_PPPOE_FAIL +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +failed Session negotiation. It uses the structure shown below, and +reports back the hook name corresponding to the failed session. +The hook will probably have been removed immediately after sending this message +.It Dv NGM_NGM_PPPOE_CLOSE +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +a request to close a session. It uses the structure shown below, and +reports back the hook name corresponding to the closed session. +The hook will probably have been removed immediately after sending this +message. At present this message is not yet used and a 'failed' message +will be received at closure instead. +.Pp +The three commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_sts { + char hook[NG_HOOKLEN + 1]; /* hook associated with event session */ +}; + +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, when all session have been disconnected or when the +.Dv ethernet +hook is disconnected. +.Sh EXAMPLE USAGE +The following code uses +.Dv libnetgraph +to set up a +.Nm +node and connect it to both a socket node and an Ethernet node. It can handle +the case of when a +.Nm +node is already attached to the Ethernet. It then starts a client session. +.Bd -literal +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <sysexits.h> +#include <errno.h> +#include <err.h> + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/select.h> +#include <net/ethernet.h> + +#include <netgraph.h> +#include <netgraph/ng_ether.h> +#include <netgraph/ng_pppoe.h> +#include <netgraph/ng_socket.h> +static int setup(char *ethername, char *service, char *sessname, + int *dfd, int *cfd); + +int +main() +{ + int fd1, fd2; + setup("xl0", NULL, "fred", &fd1, &fd2); + sleep (30); +} + +static int +setup(char *ethername, char *service, char *sessname, + int *dfd, int *cfd) +{ + struct ngm_connect ngc; /* connect */ + struct ngm_mkpeer mkp; /* mkpeer */ + /******** nodeinfo stuff **********/ + u_char rbuf[2 * 1024]; + struct ng_mesg *const resp = (struct ng_mesg *) rbuf; + struct hooklist *const hlist + = (struct hooklist *) resp->data; + struct nodeinfo *const ninfo = &hlist->nodeinfo; + int ch, no_hooks = 0; + struct linkinfo *link; + struct nodeinfo *peer; + /****message to connect pppoe session*****/ + struct { + struct ngPPPoE_init_data idata; + char service[100]; + } message; + /********tracking our little graph ********/ + char path[100]; + char source_ID[NG_NODELEN + 1]; + char pppoe_node_name[100]; + int k; + + /* + * Create the data and control sockets + */ + if (NgMkSockNode(NULL, cfd, dfd) < 0) { + return (errno); + } + /* + * find the ether node of the name requested by asking it for + * it's inquiry information. + */ + if (strlen(ethername) > 16) + return (EINVAL); + sprintf(path, "%s:", ethername); + if (NgSendMsg(*cfd, path, NGM_GENERIC_COOKIE, + NGM_LISTHOOKS, NULL, 0) < 0) { + return (errno); + } + /* + * the command was accepted so it exists. Await the reply (It's + * almost certainly already waiting). + */ + if (NgRecvMsg(*cfd, resp, sizeof(rbuf), NULL) < 0) { + return (errno); + } + /** + * The following is available about the node: + * ninfo->name (string) + * ninfo->type (string) + * ninfo->id (u_int32_t) + * ninfo->hooks (u_int32_t) (count of hooks) + * check it is the correct type. and get it's ID for use + * with mkpeer later. + */ + if (strncmp(ninfo->type, NG_ETHER_NODE_TYPE, + strlen(NG_ETHER_NODE_TYPE)) != 0) { + return (EPROTOTYPE); + } + sprintf(source_ID, "[%08x]:", ninfo->id); + + /* + * look for a hook already attached. + */ + for (k = 0; k < ninfo->hooks; k++) { + /** + * The following are available about each hook. + * link->ourhook (string) + * link->peerhook (string) + * peer->name (string) + * peer->type (string) + * peer->id (u_int32_t) + * peer->hooks (u_int32_t) + */ + link = &hlist->link[k]; + peer = &hlist->link[k].nodeinfo; + + /* Ignore debug hooks */ + if (strcmp("debug", link->ourhook) == 0) + continue; + + /* If the orphans hook is attached, use that */ + if (strcmp(NG_ETHER_HOOK_ORPHAN, + link->ourhook) == 0) { + break; + } + /* the other option is the 'divert' hook */ + if (strcmp("NG_ETHER_HOOK_DIVERT", + link->ourhook) == 0) { + break; + } + } + + /* + * See if we found a hook there. + */ + if (k < ninfo->hooks) { + if (strcmp(peer->type, NG_PPPOE_NODE_TYPE) == 0) { + /* + * If it's a type pppoe, we skip making one + * ourself, but we continue, using + * the existing one. + */ + sprintf(pppoe_node_name, "[%08x]:", peer->id); + } else { + /* + * There is already someone hogging the data, + * return an error. Some day we'll try + * daisy-chaining.. + */ + return (EBUSY); + } + } else { + + /* + * Try make a node of type pppoe against node "ID" + * On hook NG_ETHER_HOOK_ORPHAN. + */ + snprintf(mkp.type, sizeof(mkp.type), + "%s", NG_PPPOE_NODE_TYPE); + snprintf(mkp.ourhook, sizeof(mkp.ourhook), + "%s", NG_ETHER_HOOK_ORPHAN); + snprintf(mkp.peerhook, sizeof(mkp.peerhook), + "%s", NG_PPPOE_HOOK_ETHERNET); + /* Send message */ + if (NgSendMsg(*cfd, source_ID, NGM_GENERIC_COOKIE, + NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { + return (errno); + } + /* + * Work out a name for the new node. + */ + sprintf(pppoe_node_name, "%s:%s", + source_ID, NG_ETHER_HOOK_ORPHAN); + } + /* + * We now have a pppoe node attached to the ethernet + * card. The Ethernet is addressed as ethername: The pppoe + * node is addressed as pppoe_node_name: attach to it. + * Connect socket node to specified node Use the same hook + * name on both ends of the link. + */ + snprintf(ngc.path, sizeof(ngc.path), "%s", pppoe_node_name); + snprintf(ngc.ourhook, sizeof(ngc.ourhook), "%s", sessname); + snprintf(ngc.peerhook, sizeof(ngc.peerhook), "%s", sessname); + + if (NgSendMsg(*cfd, ".:", NGM_GENERIC_COOKIE, + NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { + return (errno); + } + /* + * Send it a message telling it to start up. + */ + bzero(&message, sizeof(message)); + snprintf(message.idata.hook, sizeof(message.idata.hook), + "%s", sessname); + if (service == NULL) { + message.idata.data_len = 0; + } else { + snprintf(message.idata.data, + sizeof(message.idata.data), "%s", service); + message.idata.data_len = strlen(service); + } + /* Tell session/hook to start up as a client */ + if (NgSendMsg(*cfd, ngc.path, + NGM_PPPOE_COOKIE, NGM_PPPOE_CONNECT, &message.idata, + sizeof(message.idata) + message.idata.data_len) < 0) { + return (errno); + } + return (0); +} +.Ed +.Sh SEE ALSO +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ng_socket 8 , +.Xr ng_ppp 8 , +.Xr ngctl 8 . +.Rs +.%A L. Mamakos +.%A K. Lidl +.%A J. Evarts +.%A D. Carrel +.%A D. Simone +.%A R. Wheeler +.%T "A Method for transmitting PPP over Ethernet (PPPoE)" +.%O RFC 2516 +.Re +.Sh AUTHOR +Julian Elischer <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 0000000..69d0016 --- /dev/null +++ b/sys/modules/netgraph/pppoe/ng_pppoe.8 @@ -0,0 +1,399 @@ +.\" 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_pppoe.8,v 1.1 1999/01/25 23:46:27 archie Exp $ +.\" +.Dd October 28, 1999 +.Dt NG_PPPOE 8 +.Os FreeBSD 4.0 +.Sh NAME +.Nm ng_pppoe +.Nd RFC 2516 PPPOE protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <net/ethernet.h> +.Fd #include <netgraph/ng_pppoe.h> +.Sh DESCRIPTION +The +.Nm +node type performs the PPPoE protocol. It is used in conjunction with the +.Xr netgraph 4 +extensions to the Ethernet framework to divert and inject Ethernet packets +to and from a PPP agent (which is not specified). +.Pp +The +.Dv NGM_PPPOE_GET_STATUS +control message can be used at any time to query the current status +of the PPPOE module. The only statistics presently available are the +total packet counts for input and output. This node does not yet support +the +.Dv NGM_TEXT_STATUS +control message. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -width foobarbaz +.It Dv ethernet +The hook that should normally be connected to an Ethernet node. +.It Dv debug +Presently no use. +.It Dv [unspecified] +Any other name is assumed to be a session hook that will be connected to +a PPP client agent, or a ppp server agent. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPPOE_GET_STATUS +This command returns status information in a +.Dv "struct ngpppoestat" : +.Bd -literal -offset 4n +struct ngpppoestat { + u_int packets_in; /* packets in from ethernet */ + u_int packets_out; /* packets out towards ethernet */ +}; +.Ed +.It Dv NGM_TEXT_STATUS +This generic message returns is a human-readable version of the node status. +(not yet) +.It Dv NGM_PPPOE_CONNECT +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a client. It must be newly created and +a service name can be given as an argument. It is legal to specify a zero length +service name. This is common on some DSL setups. A session request packet +will be broadcast on the Ethernet. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.It Dv NGM_PPPOE_LISTEN +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a server listener. The argument +given is the name of the service to listen on behalf of. A zero length service +length will match all requests for service. A matching service request +packet will be passed unmodified back to the process responsible +for starting the service. It can then examine it and pass it on to +the session that is started to answer the request. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.It Dv NGM_PPPOE_OFFER +Tell a nominated newly created hook that it's session should enter +the state machine in a manner to become a server. The argument +given is the name of the service to offer. A zero length service +is legal. The State machine will progress to a state where it will await +a request packet to be forwarded to it from the startup server, +which in turn probably received it from a LISTEN mode hook ( see above). +This is so +that information that is required for the session that is embedded in +the original session request packet, is made available to the state machine +that eventually answers the request. When the Session request packet is +received, the session negotiation will proceed. +This command uses the +.Dv ngpppoe_init_data +structure shown below. +.Pp +The three commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_init_data { + char hook[NG_HOOKLEN + 1]; /* hook to monitor on */ + u_int16_t data_len; /* service name length */ + char data[0]; /* init data goes here */ +}; +.Ed +.It Dv NGM_PPPOE_SUCCESS +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +successful Session negotiation. It uses the structure shown below, and +reports back the hook name corresponding to the successful session. +.It Dv NGM_NGM_PPPOE_FAIL +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +failed Session negotiation. It uses the structure shown below, and +reports back the hook name corresponding to the failed session. +The hook will probably have been removed immediately after sending this message +.It Dv NGM_NGM_PPPOE_CLOSE +This command is sent to the node that started this session with one of the +above messages, and reports a state change. This message reports +a request to close a session. It uses the structure shown below, and +reports back the hook name corresponding to the closed session. +The hook will probably have been removed immediately after sending this +message. At present this message is not yet used and a 'failed' message +will be received at closure instead. +.Pp +The three commands above use a common data structure: +.Bd -literal -offset 4n +struct ngpppoe_sts { + char hook[NG_HOOKLEN + 1]; /* hook associated with event session */ +}; + +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, when all session have been disconnected or when the +.Dv ethernet +hook is disconnected. +.Sh EXAMPLE USAGE +The following code uses +.Dv libnetgraph +to set up a +.Nm +node and connect it to both a socket node and an Ethernet node. It can handle +the case of when a +.Nm +node is already attached to the Ethernet. It then starts a client session. +.Bd -literal +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <unistd.h> +#include <sysexits.h> +#include <errno.h> +#include <err.h> + +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/select.h> +#include <net/ethernet.h> + +#include <netgraph.h> +#include <netgraph/ng_ether.h> +#include <netgraph/ng_pppoe.h> +#include <netgraph/ng_socket.h> +static int setup(char *ethername, char *service, char *sessname, + int *dfd, int *cfd); + +int +main() +{ + int fd1, fd2; + setup("xl0", NULL, "fred", &fd1, &fd2); + sleep (30); +} + +static int +setup(char *ethername, char *service, char *sessname, + int *dfd, int *cfd) +{ + struct ngm_connect ngc; /* connect */ + struct ngm_mkpeer mkp; /* mkpeer */ + /******** nodeinfo stuff **********/ + u_char rbuf[2 * 1024]; + struct ng_mesg *const resp = (struct ng_mesg *) rbuf; + struct hooklist *const hlist + = (struct hooklist *) resp->data; + struct nodeinfo *const ninfo = &hlist->nodeinfo; + int ch, no_hooks = 0; + struct linkinfo *link; + struct nodeinfo *peer; + /****message to connect pppoe session*****/ + struct { + struct ngPPPoE_init_data idata; + char service[100]; + } message; + /********tracking our little graph ********/ + char path[100]; + char source_ID[NG_NODELEN + 1]; + char pppoe_node_name[100]; + int k; + + /* + * Create the data and control sockets + */ + if (NgMkSockNode(NULL, cfd, dfd) < 0) { + return (errno); + } + /* + * find the ether node of the name requested by asking it for + * it's inquiry information. + */ + if (strlen(ethername) > 16) + return (EINVAL); + sprintf(path, "%s:", ethername); + if (NgSendMsg(*cfd, path, NGM_GENERIC_COOKIE, + NGM_LISTHOOKS, NULL, 0) < 0) { + return (errno); + } + /* + * the command was accepted so it exists. Await the reply (It's + * almost certainly already waiting). + */ + if (NgRecvMsg(*cfd, resp, sizeof(rbuf), NULL) < 0) { + return (errno); + } + /** + * The following is available about the node: + * ninfo->name (string) + * ninfo->type (string) + * ninfo->id (u_int32_t) + * ninfo->hooks (u_int32_t) (count of hooks) + * check it is the correct type. and get it's ID for use + * with mkpeer later. + */ + if (strncmp(ninfo->type, NG_ETHER_NODE_TYPE, + strlen(NG_ETHER_NODE_TYPE)) != 0) { + return (EPROTOTYPE); + } + sprintf(source_ID, "[%08x]:", ninfo->id); + + /* + * look for a hook already attached. + */ + for (k = 0; k < ninfo->hooks; k++) { + /** + * The following are available about each hook. + * link->ourhook (string) + * link->peerhook (string) + * peer->name (string) + * peer->type (string) + * peer->id (u_int32_t) + * peer->hooks (u_int32_t) + */ + link = &hlist->link[k]; + peer = &hlist->link[k].nodeinfo; + + /* Ignore debug hooks */ + if (strcmp("debug", link->ourhook) == 0) + continue; + + /* If the orphans hook is attached, use that */ + if (strcmp(NG_ETHER_HOOK_ORPHAN, + link->ourhook) == 0) { + break; + } + /* the other option is the 'divert' hook */ + if (strcmp("NG_ETHER_HOOK_DIVERT", + link->ourhook) == 0) { + break; + } + } + + /* + * See if we found a hook there. + */ + if (k < ninfo->hooks) { + if (strcmp(peer->type, NG_PPPOE_NODE_TYPE) == 0) { + /* + * If it's a type pppoe, we skip making one + * ourself, but we continue, using + * the existing one. + */ + sprintf(pppoe_node_name, "[%08x]:", peer->id); + } else { + /* + * There is already someone hogging the data, + * return an error. Some day we'll try + * daisy-chaining.. + */ + return (EBUSY); + } + } else { + + /* + * Try make a node of type pppoe against node "ID" + * On hook NG_ETHER_HOOK_ORPHAN. + */ + snprintf(mkp.type, sizeof(mkp.type), + "%s", NG_PPPOE_NODE_TYPE); + snprintf(mkp.ourhook, sizeof(mkp.ourhook), + "%s", NG_ETHER_HOOK_ORPHAN); + snprintf(mkp.peerhook, sizeof(mkp.peerhook), + "%s", NG_PPPOE_HOOK_ETHERNET); + /* Send message */ + if (NgSendMsg(*cfd, source_ID, NGM_GENERIC_COOKIE, + NGM_MKPEER, &mkp, sizeof(mkp)) < 0) { + return (errno); + } + /* + * Work out a name for the new node. + */ + sprintf(pppoe_node_name, "%s:%s", + source_ID, NG_ETHER_HOOK_ORPHAN); + } + /* + * We now have a pppoe node attached to the ethernet + * card. The Ethernet is addressed as ethername: The pppoe + * node is addressed as pppoe_node_name: attach to it. + * Connect socket node to specified node Use the same hook + * name on both ends of the link. + */ + snprintf(ngc.path, sizeof(ngc.path), "%s", pppoe_node_name); + snprintf(ngc.ourhook, sizeof(ngc.ourhook), "%s", sessname); + snprintf(ngc.peerhook, sizeof(ngc.peerhook), "%s", sessname); + + if (NgSendMsg(*cfd, ".:", NGM_GENERIC_COOKIE, + NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { + return (errno); + } + /* + * Send it a message telling it to start up. + */ + bzero(&message, sizeof(message)); + snprintf(message.idata.hook, sizeof(message.idata.hook), + "%s", sessname); + if (service == NULL) { + message.idata.data_len = 0; + } else { + snprintf(message.idata.data, + sizeof(message.idata.data), "%s", service); + message.idata.data_len = strlen(service); + } + /* Tell session/hook to start up as a client */ + if (NgSendMsg(*cfd, ngc.path, + NGM_PPPOE_COOKIE, NGM_PPPOE_CONNECT, &message.idata, + sizeof(message.idata) + message.idata.data_len) < 0) { + return (errno); + } + return (0); +} +.Ed +.Sh SEE ALSO +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ng_socket 8 , +.Xr ng_ppp 8 , +.Xr ngctl 8 . +.Rs +.%A L. Mamakos +.%A K. Lidl +.%A J. Evarts +.%A D. Carrel +.%A D. Simone +.%A R. Wheeler +.%T "A Method for transmitting PPP over Ethernet (PPPoE)" +.%O RFC 2516 +.Re +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/pptpgre/Makefile b/sys/modules/netgraph/pptpgre/Makefile new file mode 100644 index 0000000..b8602e3 --- /dev/null +++ b/sys/modules/netgraph/pptpgre/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/11/29 23:14:33 archie Exp $ + +KMOD= ng_pptpgre +SRCS= ng_pptpgre.c +MAN8= ng_pptpgre.8 +KMODDEPS= netgraph + +.include <bsd.kmod.mk> diff --git a/sys/modules/netgraph/pptpgre/ng_pptpgre.4 b/sys/modules/netgraph/pptpgre/ng_pptpgre.4 new file mode 100644 index 0000000..7eadcc3 --- /dev/null +++ b/sys/modules/netgraph/pptpgre/ng_pptpgre.4 @@ -0,0 +1,136 @@ +.\" 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_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $ +.\" +.Dd November 29, 1999 +.Dt NG_PPTPGRE 8 +.Os FreeBSD +.Sh NAME +.Nm ng_pptpgre +.Nd PPP protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_pptpgre.h> +.Sh DESCRIPTION +The +.Nm pptpgre +node type performs Generic Routing Encapsulation (GRE) over IP +for the PPTP protocol as specified by RFC 2637. This involves packet +encapsulation, sequencing, acknowlegement, and an adaptive timeout +sliding window mechanism. This node type does not handle any of +the TCP control protocol or call negotiation defined by PPTP. +.Pp +The typical use for this node type would be to connect the +.Dv upper +hook to one of the link hooks of a +.Xr ng_ppp 8 +node, and the +.Dv lower +hook to the +.Dv "inet/raw/gre" +hook of a +.Xr ng_ksocket 8 +node. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -compact -width vjc_vjuncomp +.It Dv upper +Connection to the upper protocol layers +.It Dv lower +Connection to the lower protocol layers +.El +.Pp +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPTPGRE_SET_CONFIG +This command resets and configures the node for a session. +This command takes a +.Dv "struct ng_pptpgre_conf" +as an argument: +.Bd -literal -offset 0 +/* Configuration for a session */ +struct ng_pptpgre_conf { + u_char enabled; /* enables traffic flow */ + u_char enableDelayedAck; /* enables delayed acks */ + u_int16_t cid; /* my call id */ + u_int16_t peerCid; /* peer call id */ + u_int16_t recvWin; /* peer recv window size */ + u_int16_t peerPpd; /* peer packet processing delay + (in 1/10 of a second) */ +}; + +.Ed +The +.Dv enabled +field enables traffic flow through the node. The +.Dv enableDelayedAck +field enables delayed acknowledgement (maximum 250 miliseconds), which +is a useful optimization and should generally be turned on. +The remaining fields are as supplied by the PPTP virtual call setup process. +.It Dv NGM_PPTPGRE_GET_CONFIG +Returns the current configuration as a +.Dv "struct ng_pptpgre_conf" . +.El +.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 ng_ksocket 8 , +.Xr ng_ppp 8 , +.Xr ngctl 8 . +.Rs +.%A K. Hamzeh +.%A G. Pall +.%A W. Verthein +.%A J. Taarud +.%A W. Little +.%A G. Zorn +.%T "Point-to-Point Tunneling Protocol (PPTP)" +.%O RFC 2637 +.Re +.Rs +.%A S. Hanks +.%A T. \&Li +.%A D. Farinacci +.%A P. Traina +.%T "Generic Routing Encapsulation over IPv4 networks" +.%O RFC 1702 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/pptpgre/ng_pptpgre.8 b/sys/modules/netgraph/pptpgre/ng_pptpgre.8 new file mode 100644 index 0000000..7eadcc3 --- /dev/null +++ b/sys/modules/netgraph/pptpgre/ng_pptpgre.8 @@ -0,0 +1,136 @@ +.\" 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_pptpgre.8,v 1.2 1999/12/08 00:20:53 archie Exp $ +.\" +.Dd November 29, 1999 +.Dt NG_PPTPGRE 8 +.Os FreeBSD +.Sh NAME +.Nm ng_pptpgre +.Nd PPP protocol netgraph node type +.Sh SYNOPSIS +.Fd #include <netgraph/ng_pptpgre.h> +.Sh DESCRIPTION +The +.Nm pptpgre +node type performs Generic Routing Encapsulation (GRE) over IP +for the PPTP protocol as specified by RFC 2637. This involves packet +encapsulation, sequencing, acknowlegement, and an adaptive timeout +sliding window mechanism. This node type does not handle any of +the TCP control protocol or call negotiation defined by PPTP. +.Pp +The typical use for this node type would be to connect the +.Dv upper +hook to one of the link hooks of a +.Xr ng_ppp 8 +node, and the +.Dv lower +hook to the +.Dv "inet/raw/gre" +hook of a +.Xr ng_ksocket 8 +node. +.Sh HOOKS +This node type supports the following hooks: +.Pp +.Bl -tag -compact -width vjc_vjuncomp +.It Dv upper +Connection to the upper protocol layers +.It Dv lower +Connection to the lower protocol layers +.El +.Pp +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_PPTPGRE_SET_CONFIG +This command resets and configures the node for a session. +This command takes a +.Dv "struct ng_pptpgre_conf" +as an argument: +.Bd -literal -offset 0 +/* Configuration for a session */ +struct ng_pptpgre_conf { + u_char enabled; /* enables traffic flow */ + u_char enableDelayedAck; /* enables delayed acks */ + u_int16_t cid; /* my call id */ + u_int16_t peerCid; /* peer call id */ + u_int16_t recvWin; /* peer recv window size */ + u_int16_t peerPpd; /* peer packet processing delay + (in 1/10 of a second) */ +}; + +.Ed +The +.Dv enabled +field enables traffic flow through the node. The +.Dv enableDelayedAck +field enables delayed acknowledgement (maximum 250 miliseconds), which +is a useful optimization and should generally be turned on. +The remaining fields are as supplied by the PPTP virtual call setup process. +.It Dv NGM_PPTPGRE_GET_CONFIG +Returns the current configuration as a +.Dv "struct ng_pptpgre_conf" . +.El +.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 ng_ksocket 8 , +.Xr ng_ppp 8 , +.Xr ngctl 8 . +.Rs +.%A K. Hamzeh +.%A G. Pall +.%A W. Verthein +.%A J. Taarud +.%A W. Little +.%A G. Zorn +.%T "Point-to-Point Tunneling Protocol (PPTP)" +.%O RFC 2637 +.Re +.Rs +.%A S. Hanks +.%A T. \&Li +.%A D. Farinacci +.%A P. Traina +.%T "Generic Routing Encapsulation over IPv4 networks" +.%O RFC 1702 +.Re +.Sh AUTHOR +Archie Cobbs <archie@whistle.com> diff --git a/sys/modules/netgraph/rfc1490/Makefile b/sys/modules/netgraph/rfc1490/Makefile new file mode 100644 index 0000000..ac7562d --- /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 0000000..a2aa9d0 --- /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 4.0 +.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 Elischer <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 0000000..a2aa9d0 --- /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 4.0 +.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 Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/socket/Makefile b/sys/modules/netgraph/socket/Makefile new file mode 100644 index 0000000..d2779b3 --- /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 0000000..cb224bc --- /dev/null +++ b/sys/modules/netgraph/socket/ng_socket.4 @@ -0,0 +1,173 @@ +.\" 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 4.0 +.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. The process must have +root privileges to be able to create netgraph sockets however once created, +any process that has one may use it. +.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 +and not having a cookie value of +.Dv NGM_SOCKET_COOKIE +are received by the process, 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 +As a special case, to allow netgraph data sockets to be used as stdin or stdout +on naive programs, a +.Xr sendto 2 +with a NULL sockaddr pointer, a +.Xr send 2 +or a +.Xr write 2 +will succeed in the case where there is exactly ONE hook attached to +the socket node, (and thus the path is unambiguous). +.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 the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_SOCK_CMD_NOLINGER +When the last hook is removed from this node, it will shut down as +if it had received a +.Dv NGM_SHUTDOWN +message. Attempts to access the sockets associated will return +.Er ENOTCONN . +.It Dv NGM_SOCK_CMD_LINGER +This is the default mode. When the last hook is removed, the node will +continue to exist, ready to accept new hooks until it +is explicitly shut down. +.El +.Pp +All other messages +with neither the +.Dv NGM_SOCKET_COOKIE +or +.Dv NGM_GENERIC_COOKIE +will be passed unaltered up the +.Dv NG_CONTROL +socket. +.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 . +If the +.Dv NGM_SOCK_CMD_NOLINGER +message has been received, closure of the last hook will also initiate +a shutdown of the node. +.Sh BUGS +It is not possible to reject the connection of a hook, though any +data received on that hook can certainly be ignored. +.Pp +The controlling process is not notified of all events that an in-kernel node +would be notified of, e.g. a new hook, or hook removal. We should define +some node-initiated messages for this purpose (to be sent up the control +socket). +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ng_ksocket 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <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 0000000..cb224bc --- /dev/null +++ b/sys/modules/netgraph/socket/ng_socket.8 @@ -0,0 +1,173 @@ +.\" 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 4.0 +.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. The process must have +root privileges to be able to create netgraph sockets however once created, +any process that has one may use it. +.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 +and not having a cookie value of +.Dv NGM_SOCKET_COOKIE +are received by the process, 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 +As a special case, to allow netgraph data sockets to be used as stdin or stdout +on naive programs, a +.Xr sendto 2 +with a NULL sockaddr pointer, a +.Xr send 2 +or a +.Xr write 2 +will succeed in the case where there is exactly ONE hook attached to +the socket node, (and thus the path is unambiguous). +.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 the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_SOCK_CMD_NOLINGER +When the last hook is removed from this node, it will shut down as +if it had received a +.Dv NGM_SHUTDOWN +message. Attempts to access the sockets associated will return +.Er ENOTCONN . +.It Dv NGM_SOCK_CMD_LINGER +This is the default mode. When the last hook is removed, the node will +continue to exist, ready to accept new hooks until it +is explicitly shut down. +.El +.Pp +All other messages +with neither the +.Dv NGM_SOCKET_COOKIE +or +.Dv NGM_GENERIC_COOKIE +will be passed unaltered up the +.Dv NG_CONTROL +socket. +.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 . +If the +.Dv NGM_SOCK_CMD_NOLINGER +message has been received, closure of the last hook will also initiate +a shutdown of the node. +.Sh BUGS +It is not possible to reject the connection of a hook, though any +data received on that hook can certainly be ignored. +.Pp +The controlling process is not notified of all events that an in-kernel node +would be notified of, e.g. a new hook, or hook removal. We should define +some node-initiated messages for this purpose (to be sent up the control +socket). +.Sh SEE ALSO +.Xr socket 2 , +.Xr netgraph 3 , +.Xr netgraph 4 , +.Xr ng_ksocket 8 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/tee/Makefile b/sys/modules/netgraph/tee/Makefile new file mode 100644 index 0000000..118668f --- /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 0000000..1a774e6 --- /dev/null +++ b/sys/modules/netgraph/tee/ng_tee.4 @@ -0,0 +1,117 @@ +.\" 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 4.0 +.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 the generic control messages, plus the following. +.Bl -tag -width foo +.It Dv NGM_TEE_GET_STATS +Get statistics, returned as a +.Dv "struct ng_tee_stats" . +.It Dv NGM_TEE_CLR_STATS +Clear statistics. +.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 tee 1 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <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 0000000..1a774e6 --- /dev/null +++ b/sys/modules/netgraph/tee/ng_tee.8 @@ -0,0 +1,117 @@ +.\" 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 4.0 +.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 the generic control messages, plus the following. +.Bl -tag -width foo +.It Dv NGM_TEE_GET_STATS +Get statistics, returned as a +.Dv "struct ng_tee_stats" . +.It Dv NGM_TEE_CLR_STATS +Clear statistics. +.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 tee 1 , +.Xr netgraph 4 , +.Xr ngctl 8 . +.Sh AUTHOR +Julian Elischer <julian@whistle.com> diff --git a/sys/modules/netgraph/tty/Makefile b/sys/modules/netgraph/tty/Makefile new file mode 100644 index 0000000..5b9bd20 --- /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 0000000..c3f0aa5 --- /dev/null +++ b/sys/modules/netgraph/tty/ng_tty.4 @@ -0,0 +1,131 @@ +.\" 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 4.0 +.Sh NAME +.Nm ng_tty +.Nd netgraph node type that is also a line discipline +.Sh SYNOPSIS +.Fd #include <sys/ttycom.h> +.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, +.Dv NETGRAPHDISC , +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 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 0000000..c3f0aa5 --- /dev/null +++ b/sys/modules/netgraph/tty/ng_tty.8 @@ -0,0 +1,131 @@ +.\" 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 4.0 +.Sh NAME +.Nm ng_tty +.Nd netgraph node type that is also a line discipline +.Sh SYNOPSIS +.Fd #include <sys/ttycom.h> +.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, +.Dv NETGRAPHDISC , +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 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 0000000..b27f767 --- /dev/null +++ b/sys/modules/netgraph/vjc/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ +# $Whistle: Makefile,v 1.1 1999/01/24 06:48:07 archie Exp $ + +KMOD= ng_vjc +SRCS= ng_vjc.c slcompress.c +MAN8= ng_vjc.8 +KMODDEPS= netgraph + +.PATH: ${.CURDIR}/../../../net + +.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 0000000..c86be55 --- /dev/null +++ b/sys/modules/netgraph/vjc/ng_vjc.4 @@ -0,0 +1,210 @@ +.\" 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 4.0 +.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 compression, 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. +This node also supports ``always pass through'' mode in either direction. +.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 ip , +.Dv vjuncomp , +.Dv vjcomp , +and +.Dv vjip +nodes should be connected to the +.Xr ng_ppp 8 +node's +.Dv vjc_ip , +.Dv vjc_vjcomp , +.Dv vjc_vjuncomp , +and +.Dv vjc_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_SET_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 enableComp; /* Enable compression */ + u_char enableDecomp; /* Enable decompression */ + u_char maxChannel; /* Number of outgoing channels - 1 */ + u_char compressCID; /* OK to compress outgoing CID's */ +}; +.Ed +.Pp +When +.Dv enableComp +is set to zero, all packets received on the +.Dv ip +hook are forwarded unchanged out the +.Dv vjip +hook. Similarly, when +.Dv enableDecomp +is set to zero, all packets received on the +.Dv vjip +hook are forwarded unchanged out the +.Dv ip +hook, and packets are not accepted on the +.Dv vjcomp +and +.Dv vjuncomp +hooks. +When a node is first created, +both compression and decompression are disabled and the node is +therefore operating in bi-directional ``pass through'' mode. +.Pp +When enabling compression, +.Dv maxChannel +should be set to the number of outgoing compression channels minus one, +and is a value between 3 and 15, inclusive. Also, 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 +message 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 enableComp +or +.Dv enableDecomp +fields are changed from zero to one by a +.Dv NGM_VJC_SET_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 received 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 +Because the initialization routine in the kernel implementation of +Van Jacobsen compression initializes both compression and decompression +at once, this node does not allow compression and decompression to +be enabled in separate operations. In order to enable one when +the other is already enabled, first both must be disabled, then +both enabled. This of course resets the node state. This restriction +may be lifted in a later version. +.Pp +When built as a loadable kernel module, this module includes the file +.Dv "net/slcompress.c" . +Although loading the module should fail if +.Dv "net/slcompress.c" +already exists in the kernel, currently it does not, and the duplicate +copies of the file do not interfere. +However, this may change in the future. +.Sh SEE ALSO +.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 0000000..c86be55 --- /dev/null +++ b/sys/modules/netgraph/vjc/ng_vjc.8 @@ -0,0 +1,210 @@ +.\" 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 4.0 +.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 compression, 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. +This node also supports ``always pass through'' mode in either direction. +.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 ip , +.Dv vjuncomp , +.Dv vjcomp , +and +.Dv vjip +nodes should be connected to the +.Xr ng_ppp 8 +node's +.Dv vjc_ip , +.Dv vjc_vjcomp , +.Dv vjc_vjuncomp , +and +.Dv vjc_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_SET_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 enableComp; /* Enable compression */ + u_char enableDecomp; /* Enable decompression */ + u_char maxChannel; /* Number of outgoing channels - 1 */ + u_char compressCID; /* OK to compress outgoing CID's */ +}; +.Ed +.Pp +When +.Dv enableComp +is set to zero, all packets received on the +.Dv ip +hook are forwarded unchanged out the +.Dv vjip +hook. Similarly, when +.Dv enableDecomp +is set to zero, all packets received on the +.Dv vjip +hook are forwarded unchanged out the +.Dv ip +hook, and packets are not accepted on the +.Dv vjcomp +and +.Dv vjuncomp +hooks. +When a node is first created, +both compression and decompression are disabled and the node is +therefore operating in bi-directional ``pass through'' mode. +.Pp +When enabling compression, +.Dv maxChannel +should be set to the number of outgoing compression channels minus one, +and is a value between 3 and 15, inclusive. Also, 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 +message 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 enableComp +or +.Dv enableDecomp +fields are changed from zero to one by a +.Dv NGM_VJC_SET_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 received 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 +Because the initialization routine in the kernel implementation of +Van Jacobsen compression initializes both compression and decompression +at once, this node does not allow compression and decompression to +be enabled in separate operations. In order to enable one when +the other is already enabled, first both must be disabled, then +both enabled. This of course resets the node state. This restriction +may be lifted in a later version. +.Pp +When built as a loadable kernel module, this module includes the file +.Dv "net/slcompress.c" . +Although loading the module should fail if +.Dv "net/slcompress.c" +already exists in the kernel, currently it does not, and the duplicate +copies of the file do not interfere. +However, this may change in the future. +.Sh SEE ALSO +.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/nfs/Makefile b/sys/modules/nfs/Makefile new file mode 100644 index 0000000..34d4006 --- /dev/null +++ b/sys/modules/nfs/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nfs +KMOD= nfs +SRCS= vnode_if.h \ + nfs_bio.c nfs_node.c nfs_nqlease.c nfs_serv.c nfs_socket.c \ + nfs_srvcache.c nfs_subs.c nfs_syscalls.c nfs_vfsops.c \ + nfs_vnops.c opt_inet.h opt_nfs.h opt_vmpage.h opt_bootp.h +NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel +NOMAN= + +opt_inet.h: + touch ${.TARGET} +.if ${NFS_INET} > 0 + echo "#define INET 1" > ${.TARGET} +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/nfsclient/Makefile b/sys/modules/nfsclient/Makefile new file mode 100644 index 0000000..34d4006 --- /dev/null +++ b/sys/modules/nfsclient/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nfs +KMOD= nfs +SRCS= vnode_if.h \ + nfs_bio.c nfs_node.c nfs_nqlease.c nfs_serv.c nfs_socket.c \ + nfs_srvcache.c nfs_subs.c nfs_syscalls.c nfs_vfsops.c \ + nfs_vnops.c opt_inet.h opt_nfs.h opt_vmpage.h opt_bootp.h +NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel +NOMAN= + +opt_inet.h: + touch ${.TARGET} +.if ${NFS_INET} > 0 + echo "#define INET 1" > ${.TARGET} +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/nfsserver/Makefile b/sys/modules/nfsserver/Makefile new file mode 100644 index 0000000..34d4006 --- /dev/null +++ b/sys/modules/nfsserver/Makefile @@ -0,0 +1,18 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nfs +KMOD= nfs +SRCS= vnode_if.h \ + nfs_bio.c nfs_node.c nfs_nqlease.c nfs_serv.c nfs_socket.c \ + nfs_srvcache.c nfs_subs.c nfs_syscalls.c nfs_vfsops.c \ + nfs_vnops.c opt_inet.h opt_nfs.h opt_vmpage.h opt_bootp.h +NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel +NOMAN= + +opt_inet.h: + touch ${.TARGET} +.if ${NFS_INET} > 0 + echo "#define INET 1" > ${.TARGET} +.endif + +.include <bsd.kmod.mk> diff --git a/sys/modules/ntfs/Makefile b/sys/modules/ntfs/Makefile new file mode 100644 index 0000000..d13373b --- /dev/null +++ b/sys/modules/ntfs/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../ntfs +KMOD= ntfs +SRCS= vnode_if.h \ + ntfs_vfsops.c ntfs_vnops.c ntfs_subr.c ntfs_ihash.c \ + ntfs_compr.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/nullfs/Makefile b/sys/modules/nullfs/Makefile new file mode 100644 index 0000000..e895b4b --- /dev/null +++ b/sys/modules/nullfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/nullfs +KMOD= null +SRCS= vnode_if.h \ + null_subr.c null_vfsops.c null_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/nwfs/Makefile b/sys/modules/nwfs/Makefile new file mode 100644 index 0000000..0f8471f --- /dev/null +++ b/sys/modules/nwfs/Makefile @@ -0,0 +1,30 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nwfs + +KMOD= nwfs +KMODDEPS= ncp + +SRCS= vnode_if.h \ + nwfs_node.c nwfs_ioctl.c nwfs_io.c nwfs_vfsops.c nwfs_vnops.c \ + nwfs_subr.c opt_ncp.h opt_nwfs.h opt_vmpage.h + +NOMAN=true + +.if defined(VNPRINT) +CFLAGS+= -DVNPRINT +.endif + +opt_ncp.h: + echo "#define NCP 1" > ${.TARGET} + +load: nwfs.ko + kldload ./nwfs.ko + +unload: + @(if kldunload nwfs; then true; else true; fi) + +deinstall: + rm -f /modules/nwfs.ko + +.include <bsd.kmod.mk> diff --git a/sys/modules/osf1/Makefile b/sys/modules/osf1/Makefile new file mode 100644 index 0000000..459f429 --- /dev/null +++ b/sys/modules/osf1/Makefile @@ -0,0 +1,26 @@ +# $FreeBSD$ + +MAINTAINER= gallatin@FreeBSD.org + +.PATH: ${.CURDIR}/../../alpha/osf1 + +KMOD= osf1 +SRCS= osf1_ioctl.c osf1_misc.c osf1_signal.c osf1_sysent.c \ + osf1_mount.c imgact_osf1.c osf1_sysvec.c opt_compat.h \ + opt_simos.h opt_nfs.h vnode_if.h +MAN8= osf1.8 + +#CFLAGS+= -g +EXPORT_SYMS= _osf1 + +opt_compat.h: + echo "#define COMPAT_43 1" > ${.TARGET} + +opt_osf1.h opt_simos.h opt_nfs.h: + touch ${.TARGET} + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/osf1.sh ${DESTDIR}/usr/bin/osf1 + +.include <bsd.kmod.mk> diff --git a/sys/modules/osf1/osf1.8 b/sys/modules/osf1/osf1.8 new file mode 100644 index 0000000..a367dc9 --- /dev/null +++ b/sys/modules/osf1/osf1.8 @@ -0,0 +1,46 @@ +.\" Copyright (c) 1999 +.\" The FreeBSD Project. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 31, 1998 +.Dt OSF1 8 +.Os FreeBSD +.Sh NAME +.Nm osf1 +.Nd load the OSF/1 emulator kernel module +.Sh SYNOPSIS +.Nm osf1 +.Sh DESCRIPTION +The +.Nm +utility loads the OSF/1 image activator kernel module. +.Sh FILES +.Bl -tag -width /modules/osf1.ko +.It Pa /modules/osf1.ko +OSF/1 image activator loadable kernel module. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr kldstat 8 , +.Xr kldunload 8 diff --git a/sys/modules/osf1/osf1.sh b/sys/modules/osf1/osf1.sh new file mode 100644 index 0000000..b2b4d92 --- /dev/null +++ b/sys/modules/osf1/osf1.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright (c) 1999 +# The FreeBSD Project. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +FOUND=`kldstat -v | egrep 'osf1_ecoff'` + +if [ "x$FOUND" != x ] ; then + echo Osf1 driver already loaded + exit 1 +else + kldload osf1 +fi diff --git a/sys/modules/pccard/Makefile b/sys/modules/pccard/Makefile new file mode 100644 index 0000000..c1511fd --- /dev/null +++ b/sys/modules/pccard/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/pccard +KMOD= pccard +SRCS= pccard.c pccard_cis.c pccard_cis_quirks.c \ + device_if.h bus_if.h card_if.h card_if.c power_if.h power_if.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/pcic/Makefile b/sys/modules/pcic/Makefile new file mode 100644 index 0000000..5514ef9 --- /dev/null +++ b/sys/modules/pcic/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/pcic +KMOD= pcic +SRCS= i82365.c i82365_isa.c \ + device_if.h bus_if.h isa_if.h power_if.h card_if.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/portal/Makefile b/sys/modules/portal/Makefile new file mode 100644 index 0000000..5cc4767 --- /dev/null +++ b/sys/modules/portal/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/portal +KMOD= portal +SRCS= vnode_if.h \ + portal_vfsops.c portal_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/portalfs/Makefile b/sys/modules/portalfs/Makefile new file mode 100644 index 0000000..5cc4767 --- /dev/null +++ b/sys/modules/portalfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/portal +KMOD= portal +SRCS= vnode_if.h \ + portal_vfsops.c portal_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/procfs/Makefile b/sys/modules/procfs/Makefile new file mode 100644 index 0000000..28d8990 --- /dev/null +++ b/sys/modules/procfs/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/procfs +KMOD= procfs +SRCS= vnode_if.h \ + procfs_ctl.c procfs_map.c procfs_note.c procfs_rlimit.c \ + procfs_status.c procfs_subr.c procfs_type.c procfs_vfsops.c \ + procfs_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/rl/Makefile b/sys/modules/rl/Makefile new file mode 100644 index 0000000..03bd395 --- /dev/null +++ b/sys/modules/rl/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_rl +SRCS = if_rl.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +KMODDEPS = miibus + +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/sf/Makefile b/sys/modules/sf/Makefile new file mode 100644 index 0000000..1601e16 --- /dev/null +++ b/sys/modules/sf/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_sf +SRCS = if_sf.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +KMODDEPS = miibus + +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/sis/Makefile b/sys/modules/sis/Makefile new file mode 100644 index 0000000..a0e29ad --- /dev/null +++ b/sys/modules/sis/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_sis +SRCS = if_sis.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> diff --git a/sys/modules/sk/Makefile b/sys/modules/sk/Makefile new file mode 100644 index 0000000..3111b34 --- /dev/null +++ b/sys/modules/sk/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_sk +SRCS = if_sk.c opt_bdg.h device_if.h bus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/splash/Makefile b/sys/modules/splash/Makefile new file mode 100644 index 0000000..1c634bf --- /dev/null +++ b/sys/modules/splash/Makefile @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= bmp pcx + +.include <bsd.subdir.mk> diff --git a/sys/modules/splash/Makefile.inc b/sys/modules/splash/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/sys/modules/splash/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/sys/modules/splash/bmp/Makefile b/sys/modules/splash/bmp/Makefile new file mode 100644 index 0000000..af009a2 --- /dev/null +++ b/sys/modules/splash/bmp/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +KMOD= splash_bmp +SRCS= splash_bmp.c + +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/splash/bmp/splash_bmp.c b/sys/modules/splash/bmp/splash_bmp.c new file mode 100644 index 0000000..71a53b9 --- /dev/null +++ b/sys/modules/splash/bmp/splash_bmp.c @@ -0,0 +1,582 @@ +/*- + * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> + * Copyright (c) 1999 Kazutaka YOKOTA <yokota@freebsd.org> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/linker.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> + +#define FADE_TIMEOUT 15 /* sec */ +#define FADE_LEVELS 10 + +static int splash_mode = -1; +static int splash_on = FALSE; + +static int bmp_start(video_adapter_t *adp); +static int bmp_end(video_adapter_t *adp); +static int bmp_splash(video_adapter_t *adp, int on); +static int bmp_Init(const char *data, int swidth, int sheight, int sdepth); +static int bmp_Draw(video_adapter_t *adp); + +static splash_decoder_t bmp_decoder = { + "splash_bmp", bmp_start, bmp_end, bmp_splash, SPLASH_IMAGE, +}; + +SPLASH_DECODER(splash_bmp, bmp_decoder); + +static int +bmp_start(video_adapter_t *adp) +{ + /* currently only 256-color modes are supported XXX */ + static int modes[] = { + M_VESA_CG640x480, + M_VESA_CG800x600, + M_VESA_CG1024x768, + /* + * As 320x200 doesn't generally look great, + * it's least preferred here. + */ + M_VGA_CG320, + -1, + }; + video_info_t info; + int i; + + if ((bmp_decoder.data == NULL) || (bmp_decoder.data_size <= 0)) { + printf("splash_bmp: No bitmap file found\n"); + return ENODEV; + } + for (i = 0; modes[i] >= 0; ++i) { + if (((*vidsw[adp->va_index]->get_info)(adp, modes[i], &info) == 0) + && (bmp_Init((u_char *)bmp_decoder.data, + info.vi_width, info.vi_height, info.vi_depth) == 0)) + break; + } + splash_mode = modes[i]; + if (splash_mode < 0) + printf("splash_bmp: No appropriate video mode found\n"); + if (bootverbose) + printf("bmp_start(): splash_mode:%d\n", splash_mode); + return ((splash_mode < 0) ? ENODEV : 0); +} + +static int +bmp_end(video_adapter_t *adp) +{ + /* nothing to do */ + return 0; +} + +static int +bmp_splash(video_adapter_t *adp, int on) +{ + static u_char pal[256*3]; + static long time_stamp; + u_char tpal[256*3]; + static int fading = TRUE, brightness = FADE_LEVELS; + struct timeval tv; + int i; + + if (on) { + if (!splash_on) { + /* set up the video mode and draw something */ + if ((*vidsw[adp->va_index]->set_mode)(adp, splash_mode)) + return 1; + if (bmp_Draw(adp)) + return 1; + (*vidsw[adp->va_index]->save_palette)(adp, pal); + time_stamp = 0; + splash_on = TRUE; + } + /* + * This is a kludge to fade the image away. This section of the + * code takes effect only after the system is completely up. + * FADE_TIMEOUT should be configurable. + */ + if (!cold) { + getmicrotime(&tv); + if (time_stamp == 0) + time_stamp = tv.tv_sec; + if (tv.tv_sec > time_stamp + FADE_TIMEOUT) { + if (fading) + if (brightness == 0) { + fading = FALSE; + brightness++; + } + else brightness--; + else + if (brightness == FADE_LEVELS) { + fading = TRUE; + brightness--; + } + else brightness++; + for (i = 0; i < sizeof(pal); ++i) { + tpal[i] = pal[i] * brightness / FADE_LEVELS; + } + (*vidsw[adp->va_index]->load_palette)(adp, tpal); + time_stamp = tv.tv_sec; + } + } + return 0; + } else { + /* the video mode will be restored by the caller */ + splash_on = FALSE; + return 0; + } +} + +/* +** Code to handle Microsoft DIB (".BMP") format images. +** +** Blame me (msmith@freebsd.org) if this is broken, not Soren. +*/ + +typedef struct tagBITMAPFILEHEADER { /* bmfh */ + u_short bfType __attribute__ ((packed)); + int bfSize __attribute__ ((packed)); + u_short bfReserved1 __attribute__ ((packed)); + u_short bfReserved2 __attribute__ ((packed)); + int bfOffBits __attribute__ ((packed)); +} BITMAPFILEHEADER; + +typedef struct tagBITMAPINFOHEADER { /* bmih */ + int biSize __attribute__ ((packed)); + int biWidth __attribute__ ((packed)); + int biHeight __attribute__ ((packed)); + short biPlanes __attribute__ ((packed)); + short biBitCount __attribute__ ((packed)); + int biCompression __attribute__ ((packed)); + int biSizeImage __attribute__ ((packed)); + int biXPelsPerMeter __attribute__ ((packed)); + int biYPelsPerMeter __attribute__ ((packed)); + int biClrUsed __attribute__ ((packed)); + int biClrImportant __attribute__ ((packed)); +} BITMAPINFOHEADER; + +typedef struct tagRGBQUAD { /* rgbq */ + u_char rgbBlue __attribute__ ((packed)); + u_char rgbGreen __attribute__ ((packed)); + u_char rgbRed __attribute__ ((packed)); + u_char rgbReserved __attribute__ ((packed)); +} RGBQUAD; + +typedef struct tagBITMAPINFO { /* bmi */ + BITMAPINFOHEADER bmiHeader __attribute__ ((packed)); + RGBQUAD bmiColors[256] __attribute__ ((packed)); +} BITMAPINFO; + +typedef struct tagBITMAPF +{ + BITMAPFILEHEADER bmfh __attribute__ ((packed)); + BITMAPINFO bmfi __attribute__ ((packed)); +} BITMAPF; + +#define BI_RGB 0 +#define BI_RLE8 1 +#define BI_RLE4 2 + +/* +** all we actually care about the image +*/ +typedef struct +{ + int width,height; /* image dimensions */ + int swidth,sheight; /* screen dimensions for the current mode */ + u_char sdepth; /* screen depth (1, 4, 8 bpp) */ + int ncols; /* number of colours */ + u_char palette[256][3]; /* raw palette data */ + u_char format; /* one of the BI_* constants above */ + u_char *data; /* pointer to the raw data */ + u_char *index; /* running pointer to the data while drawing */ + u_char *vidmem; /* video memory allocated for drawing */ + video_adapter_t *adp; + int bank; +} BMP_INFO; + +static BMP_INFO bmp_info; + +static void +fill(BMP_INFO *info, int x, int y, int xsize, int ysize) +{ + u_char *window; + int banksize; + int bank; + int p; + + banksize = info->adp->va_window_size; + bank = (info->adp->va_line_width*y + x)/banksize; + window = (u_char *)info->adp->va_window; + (*vidsw[info->adp->va_index]->set_win_org)(info->adp, bank*banksize); + while (ysize > 0) { + p = (info->adp->va_line_width*y + x)%banksize; + for (; (p + xsize <= banksize) && ysize > 0; --ysize, ++y) { + generic_bzero(window + p, xsize); + p += info->adp->va_line_width; + } + if (ysize <= 0) + break; + if (p < banksize) { + /* the last line crosses the window boundary */ + generic_bzero(window + p, banksize - p); + } + ++bank; /* next bank */ + (*vidsw[info->adp->va_index]->set_win_org)(info->adp, bank*banksize); + if (p < banksize) { + /* the remaining part of the last line */ + generic_bzero(window, p + xsize - banksize); + ++y; + --ysize; + } + } + info->bank = bank; +} + +/* +** bmp_SetPix +** +** Given (info), set the pixel at (x),(y) to (val) +** +*/ +static void +bmp_SetPix(BMP_INFO *info, int x, int y, u_char val) +{ + int sofs, bofs; + u_char tpv, mask; + int newbank; + + /* + * range check to avoid explosions + */ + if ((x < 0) || (x >= info->swidth) || (y < 0) || (y >= info->sheight)) + return; + + /* + * calculate offset into video memory; + * because 0,0 is bottom-left for DIB, we have to convert. + */ + sofs = ((info->height - (y+1) + (info->sheight - info->height) / 2) + * info->adp->va_line_width); + + switch(info->sdepth) { + case 1: + sofs += ((x + (info->swidth - info->width) / 2) >> 3); + bofs = x & 0x7; /* offset within byte */ + + val &= 1; /* mask pixel value */ + mask = ~(0x80 >> bofs); /* calculate bit mask */ + tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bit */ + *(info->vidmem+sofs) = tpv | (val << (8-bofs)); /* write new bit */ + break; + + /* XXX only correct for non-interleaved modes */ + case 4: + sofs += ((x + (info->swidth - info->width) / 2) >> 1); + bofs = x & 0x1; /* offset within byte */ + + val &= 0xf; /* mask pixel value */ + mask = bofs ? 0x0f : 0xf0; /* calculate bit mask */ + tpv = *(info->vidmem+sofs) & mask; /* get screen contents, excluding masked bits */ + *(info->vidmem+sofs) = tpv | (val << (bofs ? 0 : 4)); /* write new bits */ + break; + + case 8: + sofs += x + (info->swidth - info->width) / 2; + newbank = sofs/info->adp->va_window_size; + if (info->bank != newbank) { + (*vidsw[info->adp->va_index]->set_win_org)(info->adp, newbank*info->adp->va_window_size); + info->bank = newbank; + } + sofs %= info->adp->va_window_size; + *(info->vidmem+sofs) = val; + break; + } +} + +/* +** bmp_DecodeRLE4 +** +** Given (data) pointing to a line of RLE4-format data and (line) being the starting +** line onscreen, decode the line. +*/ +static void +bmp_DecodeRLE4(BMP_INFO *info, int line) +{ + int count; /* run count */ + u_char val; + int x,y; /* screen position */ + + x = 0; /* starting position */ + y = line; + + /* loop reading data */ + for (;;) { + /* + * encoded mode starts with a run length, and then a byte with + * two colour indexes to alternate between for the run + */ + if (*info->index) { + for (count = 0; count < *info->index; count++, x++) { + if (count & 1) { /* odd count, low nybble */ + bmp_SetPix(info, x, y, *(info->index+1) & 0x0f); + } else { /* even count, high nybble */ + bmp_SetPix(info, x, y, (*(info->index+1) >>4) & 0x0f); + } + } + info->index += 2; + /* + * A leading zero is an escape; it may signal the end of the + * bitmap, a cursor move, or some absolute data. + */ + } else { /* zero tag may be absolute mode or an escape */ + switch (*(info->index+1)) { + case 0: /* end of line */ + info->index += 2; + return; + case 1: /* end of bitmap */ + info->index = NULL; + return; + case 2: /* move */ + x += *(info->index + 2); /* new coords */ + y += *(info->index + 3); + info->index += 4; + break; + default: /* literal bitmap data */ + for (count = 0; count < *(info->index + 1); count++, x++) { + val = *(info->index + 2 + (count / 2)); /* byte with nybbles */ + if (count & 1) { + val &= 0xf; /* get low nybble */ + } else { + val = (val >> 4); /* get high nybble */ + } + bmp_SetPix(info, x, y, val); + } + /* warning, this depends on integer truncation, do not hand-optimise! */ + info->index += 2 + ((count + 3) / 4) * 2; + break; + } + } + } +} + +/* +** bmp_DecodeRLE8 +** Given (data) pointing to a line of RLE4-format data and (line) being the starting +** line onscreen, decode the line. +*/ +static void +bmp_DecodeRLE8(BMP_INFO *info, int line) +{ + int count; /* run count */ + int x,y; /* screen position */ + + x = 0; /* starting position */ + y = line; + + /* loop reading data */ + for(;;) { + /* + * encoded mode starts with a run length, and then a byte with + * two colour indexes to alternate between for the run + */ + if (*info->index) { + for (count = 0; count < *info->index; count++, x++) + bmp_SetPix(info, x, y, *(info->index+1)); + info->index += 2; + /* + * A leading zero is an escape; it may signal the end of the + * bitmap, a cursor move, or some absolute data. + */ + } else { /* zero tag may be absolute mode or an escape */ + switch(*(info->index+1)) { + case 0: /* end of line */ + info->index += 2; + return; + case 1: /* end of bitmap */ + info->index = NULL; + return; + case 2: /* move */ + x += *(info->index + 2); /* new coords */ + y += *(info->index + 3); + info->index += 4; + break; + default: /* literal bitmap data */ + for (count = 0; count < *(info->index + 1); count++, x++) + bmp_SetPix(info, x, y, *(info->index + 2 + count)); + /* must be an even count */ + info->index += 2 + count + (count & 1); + break; + } + } + } +} + +/* +** bmp_DecodeLine +** +** Given (info) pointing to an image being decoded, (line) being the line currently +** being displayed, decode a line of data. +*/ +static void +bmp_DecodeLine(BMP_INFO *info, int line) +{ + int x; + + switch(info->format) { + case BI_RGB: + for (x = 0; x < info->width; x++, info->index++) + bmp_SetPix(info, x, line, *info->index); + info->index += 3 - (--x % 4); + break; + case BI_RLE4: + bmp_DecodeRLE4(info, line); + break; + case BI_RLE8: + bmp_DecodeRLE8(info, line); + break; + } +} + +/* +** bmp_Init +** +** Given a pointer (data) to the image of a BMP file, fill in bmp_info with what +** can be learnt from it. Return nonzero if the file isn't usable. +** +** Take screen dimensions (swidth), (sheight) and (sdepth) and make sure we +** can work with these. +*/ +static int +bmp_Init(const char *data, int swidth, int sheight, int sdepth) +{ + BITMAPF *bmf = (BITMAPF *)data; + int pind; + + bmp_info.data = NULL; /* assume setup failed */ + + /* check file ID */ + if (bmf->bmfh.bfType != 0x4d42) { + printf("splash_bmp: not a BMP file\n"); + return(1); /* XXX check word ordering for big-endian ports? */ + } + + /* do we understand this bitmap format? */ + if (bmf->bmfi.bmiHeader.biSize > sizeof(bmf->bmfi.bmiHeader)) { + printf("splash_bmp: unsupported BMP format (size=%d)\n", + bmf->bmfi.bmiHeader.biSize); + return(1); + } + + /* save what we know about the screen */ + bmp_info.swidth = swidth; + bmp_info.sheight = sheight; + bmp_info.sdepth = sdepth; + + /* where's the data? */ + bmp_info.data = (u_char *)data + bmf->bmfh.bfOffBits; + + /* image parameters */ + bmp_info.width = bmf->bmfi.bmiHeader.biWidth; + bmp_info.height = bmf->bmfi.bmiHeader.biHeight; + bmp_info.format = bmf->bmfi.bmiHeader.biCompression; + + switch(bmp_info.format) { /* check compression format */ + case BI_RGB: + case BI_RLE4: + case BI_RLE8: + break; + default: + printf("splash_bmp: unsupported compression format\n"); + return(1); /* unsupported compression format */ + } + + /* palette details */ + bmp_info.ncols = (bmf->bmfi.bmiHeader.biClrUsed); + bzero(bmp_info.palette,sizeof(bmp_info.palette)); + if (bmp_info.ncols == 0) { /* uses all of them */ + bmp_info.ncols = 1 << bmf->bmfi.bmiHeader.biBitCount; + } + if ((bmf->bmfi.bmiHeader.biBitCount != sdepth) + || (bmp_info.ncols > (1 << sdepth))) { + printf("splash_bmp: unsupported color depth (%d bits, %d colors)\n", + bmf->bmfi.bmiHeader.biBitCount, bmp_info.ncols); + return(1); + } + if ((bmp_info.height > bmp_info.sheight) || + (bmp_info.width > bmp_info.swidth) || + (bmp_info.ncols > (1 << sdepth))) { + return(1); /* beyond screen capacity */ + } + + /* read palette */ + for (pind = 0; pind < bmp_info.ncols; pind++) { + bmp_info.palette[pind][0] = bmf->bmfi.bmiColors[pind].rgbRed; + bmp_info.palette[pind][1] = bmf->bmfi.bmiColors[pind].rgbGreen; + bmp_info.palette[pind][2] = bmf->bmfi.bmiColors[pind].rgbBlue; + } + return(0); +} + +/* +** bmp_Draw +** +** Render the image. Return nonzero if that's not possible. +** +*/ +static int +bmp_Draw(video_adapter_t *adp) +{ + int line; + + if (bmp_info.data == NULL) { /* init failed, do nothing */ + return(1); + } + + /* clear the screen */ + bmp_info.vidmem = (u_char *)adp->va_window; + bmp_info.adp = adp; + /* XXX; the following line is correct only for 8bpp modes */ + fill(&bmp_info, 0, 0, bmp_info.swidth, bmp_info.sheight); + (*vidsw[adp->va_index]->set_win_org)(adp, 0); + bmp_info.bank = 0; + + /* initialise the info structure for drawing */ + bmp_info.index = bmp_info.data; + + /* set the palette for our image */ + (*vidsw[adp->va_index]->load_palette)(adp, (u_char *)&bmp_info.palette); + + for (line = 0; (line < bmp_info.height) && bmp_info.index; line++) { + bmp_DecodeLine(&bmp_info, line); + } + return(0); +} diff --git a/sys/modules/splash/pcx/Makefile b/sys/modules/splash/pcx/Makefile new file mode 100644 index 0000000..a64a618 --- /dev/null +++ b/sys/modules/splash/pcx/Makefile @@ -0,0 +1,7 @@ +# $FreeBSD$ + +KMOD= splash_pcx +SRCS= splash_pcx.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/splash/pcx/splash_pcx.c b/sys/modules/splash/pcx/splash_pcx.c new file mode 100644 index 0000000..544e8c7 --- /dev/null +++ b/sys/modules/splash/pcx/splash_pcx.c @@ -0,0 +1,261 @@ +/*- + * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> + * Copyright (c) 1999 Kazutaka YOKOTA <yokota@freebsd.org> + * Copyright (c) 1999 Dag-Erling Coïdan Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/linker.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> + +#define FADE_TIMEOUT 300 /* sec */ + +static int splash_mode = -1; +static int splash_on = FALSE; + +static int pcx_start(video_adapter_t *adp); +static int pcx_end(video_adapter_t *adp); +static int pcx_splash(video_adapter_t *adp, int on); +static int pcx_init(const char *data, int sdepth); +static int pcx_draw(video_adapter_t *adp); + +static splash_decoder_t pcx_decoder = { + "splash_pcx", pcx_start, pcx_end, pcx_splash, SPLASH_IMAGE, +}; + +SPLASH_DECODER(splash_pcx, pcx_decoder); + +static struct +{ + int width, height, bpsl; + int bpp, planes, zlen; + const u_char *zdata, *palette; +} pcx_info; + +static int +pcx_start(video_adapter_t *adp) +{ + static int modes[] = { + M_VGA_CG320, + M_VESA_CG640x480, + M_VESA_CG800x600, + M_VESA_CG1024x768, + -1, + }; + video_info_t info; + int i; + + if (pcx_decoder.data == NULL + || pcx_decoder.data_size <= 0 + || pcx_init((u_char *)pcx_decoder.data, pcx_decoder.data_size)) + return ENODEV; + + if (bootverbose) + printf("splash_pcx: image good:\n" + " width = %d\n" + " height = %d\n" + " depth = %d\n" + " planes = %d\n", + pcx_info.width, pcx_info.height, + pcx_info.bpp, pcx_info.planes); + + for (i = 0; modes[i] >= 0; ++i) { + if (get_mode_info(adp, modes[i], &info) != 0) + continue; + if (bootverbose) + printf("splash_pcx: considering mode %d:\n" + " vi_width = %d\n" + " vi_height = %d\n" + " vi_depth = %d\n" + " vi_planes = %d\n", + modes[i], + info.vi_width, info.vi_height, + info.vi_depth, info.vi_planes); + if (info.vi_width >= pcx_info.width + && info.vi_height >= pcx_info.height + && info.vi_depth == pcx_info.bpp + && info.vi_planes == pcx_info.planes) + break; + } + + splash_mode = modes[i]; + if (splash_mode == -1) + return ENODEV; + if (bootverbose) + printf("pcx_splash: selecting mode %d\n", splash_mode); + return 0; +} + +static int +pcx_end(video_adapter_t *adp) +{ + /* nothing to do */ + return 0; +} + +static int +pcx_splash(video_adapter_t *adp, int on) +{ + if (on) { + if (!splash_on) { + if (set_video_mode(adp, splash_mode) || pcx_draw(adp)) + return 1; + splash_on = TRUE; + } + return 0; + } else { + splash_on = FALSE; + return 0; + } +} + +struct pcxheader { + u_char manufactor; + u_char version; + u_char encoding; + u_char bpp; + u_short xmin, ymin, xmax, ymax; + u_short hres, vres; + u_char colormap[48]; + u_char rsvd; + u_char nplanes; + u_short bpsl; + u_short palinfo; + u_short hsize, vsize; +}; + +#define MAXSCANLINE 1024 + +static int +pcx_init(const char *data, int size) +{ + const struct pcxheader *hdr; + + hdr = (const struct pcxheader *)data; + + if (size < 128 + 1 + 1 + 768 + || hdr->manufactor != 10 + || hdr->version != 5 + || hdr->encoding != 1 + || hdr->nplanes != 1 + || hdr->bpp != 8 + || hdr->bpsl > MAXSCANLINE + || data[size-769] != 12) { + printf("splash_pcx: invalid PCX image\n"); + return 1; + } + pcx_info.width = hdr->xmax - hdr->xmin + 1; + pcx_info.height = hdr->ymax - hdr->ymin + 1; + pcx_info.bpsl = hdr->bpsl; + pcx_info.bpp = hdr->bpp; + pcx_info.planes = hdr->nplanes; + pcx_info.zlen = size - (128 + 1 + 768); + pcx_info.zdata = data + 128; + pcx_info.palette = data + size - 768; + return 0; +} + +static int +pcx_draw(video_adapter_t *adp) +{ + u_char *vidmem; + int swidth, sheight, sbpsl, sdepth, splanes; + int banksize, origin; + int c, i, j, pos, scan, x, y; + u_char line[MAXSCANLINE]; + + if (pcx_info.zlen < 1) + return 1; + + load_palette(adp, pcx_info.palette); + + vidmem = (u_char *)adp->va_window; + swidth = adp->va_info.vi_width; + sheight = adp->va_info.vi_height; + sbpsl = adp->va_line_width; + sdepth = adp->va_info.vi_depth; + splanes = adp->va_info.vi_planes; + banksize = adp->va_window_size; + + for (origin = 0; origin < sheight*sbpsl; origin += banksize) { + set_origin(adp, origin); + bzero(vidmem, banksize); + } + + x = (swidth - pcx_info.width) / 2; + y = (sheight - pcx_info.height) / 2; + origin = 0; + pos = y * sbpsl + x; + while (pos > banksize) { + pos -= banksize; + origin += banksize; + } + set_origin(adp, origin); + + for (scan = i = 0; scan < pcx_info.height; ++scan, ++y, pos += sbpsl) { + for (j = 0; j < pcx_info.bpsl && i < pcx_info.zlen; ++i) { + if ((pcx_info.zdata[i] & 0xc0) == 0xc0) { + c = pcx_info.zdata[i++] & 0x3f; + if (i >= pcx_info.zlen) + return 1; + } else { + c = 1; + } + if (j + c > pcx_info.bpsl) + return 1; + while (c--) + line[j++] = pcx_info.zdata[i]; + } + + if (pos > banksize) { + origin += banksize; + pos -= banksize; + set_origin(adp, origin); + } + + if (pos + pcx_info.width > banksize) { + /* scanline crosses bank boundary */ + j = banksize - pos; + bcopy(line, vidmem + pos, j); + origin += banksize; + pos -= banksize; + set_origin(adp, origin); + bcopy(line + j, vidmem, pcx_info.width - j); + } else { + bcopy(line, vidmem + pos, pcx_info.width); + } + } + + return 0; +} diff --git a/sys/modules/ste/Makefile b/sys/modules/ste/Makefile new file mode 100644 index 0000000..44d5b94 --- /dev/null +++ b/sys/modules/ste/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_ste +SRCS = if_ste.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> diff --git a/sys/modules/streams/Makefile b/sys/modules/streams/Makefile new file mode 100644 index 0000000..beda735 --- /dev/null +++ b/sys/modules/streams/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +MAINTAINER = newton@atdot.dotat.org +.if defined(DEBUG) +CFLAGS+= -DDEBUG_SVR4 +.endif + +.PATH: ${.CURDIR}/../../dev/streams +KMOD= streams +SRCS= streams.c opt_streams.h opt_devfs.h + +NOMAN= + +CFLAGS+= -O + +.include <bsd.kmod.mk> diff --git a/sys/modules/svr4/Makefile b/sys/modules/svr4/Makefile new file mode 100644 index 0000000..eb1ef57 --- /dev/null +++ b/sys/modules/svr4/Makefile @@ -0,0 +1,52 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../i386/svr4 ${.CURDIR}/../../svr4 +KMOD= svr4 +SRCS= svr4_sysent.c svr4_sysvec.c opt_compat.h opt_global.h opt_vmpage.h \ + vnode_if.h imgact_svr4.c svr4_signal.c svr4_fcntl.c svr4_misc.c \ + svr4_ioctl.c svr4_stat.c svr4_filio.c svr4_ttold.c svr4_termios.c \ + svr4_stream.c svr4_socket.c svr4_sockio.c svr4_machdep.c \ + svr4_resource.c svr4_ipc.c opt_svr4.h +OBJS= svr4_locore.o +NOMAN=1 +MAN8= svr4.8 +CFLAGS+= -DKERNEL +MAINTAINER= newton@freebsd.org + +EXPORT_SYMS=_svr4_mod +CLEANFILES= svr4_assym.h svr4_genassym svr4_genassym.o opt_svr4.h + +build-tools: svr4_genassym + +svr4.h: opt_global.h opt_svr4.h + +svr4_assym.h: svr4_genassym + ./svr4_genassym > svr4_assym.h + +svr4_locore.o: svr4_locore.s svr4_assym.h + ${CC} -c -x assembler-with-cpp -DLOCORE -DKERNEL ${CFLAGS} \ + ${.IMPSRC} -o ${.TARGET} + +svr4_genassym.o: svr4_genassym.c svr4.h @ machine + ${CC} -c ${CFLAGS} -UKERNEL ${.IMPSRC} + +svr4_genassym: svr4_genassym.o + ${CC} -static ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} + +opt_compat.h: + echo "#define COMPAT_43 1" > opt_compat.h + +opt_svr4.h: + echo "#define COMPAT_SVR4 1" > opt_svr4.h +.if defined(DEBUG) + echo "#define DEBUG_SVR4 1" >> opt_svr4.h +.endif + +opt_global.h: + touch opt_global.h + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/svr4.sh ${DESTDIR}/usr/sbin/svr4 + +.include <bsd.kmod.mk> diff --git a/sys/modules/svr4/README b/sys/modules/svr4/README new file mode 100644 index 0000000..0578721 --- /dev/null +++ b/sys/modules/svr4/README @@ -0,0 +1,38 @@ +This is a SysVR4 emulator derived from work done as part of the NetBSD +Project by Christos Zoulas. It has been ported to FreeBSD by Mark Newton. + +To use it: + +1. Choose one of: + a. Add "pseudo-device streams" to your kernel config file and rebuild, + reboot; or + b. Build and install the streams module in /sys/modules/streams + +2. Build and install the svr4 module in /sys/modules/svr4 + +3. Type "svr4" to start it up. + +4. Grab compat_sol26.tar.gz or compat_svr4.tar.gz from + http://www.freebsd.org/~newton/freebsd-svr4 and install them in + /compat/svr4 + +5. Run "sh SVR4_MAKEDEV all" in /compat/svr4/dev + +6. Mount a Solaris/x86 v2.6 or v7 CD-ROM on /cdrom (also works with + v2.4 and v2.5.1, but you need different symlinks in /compat/svr4) + +7. Brand any executables you want to run, and/or set the + kern.fallback_elf_brand sysctl to 'SVR4' to establish this as the + default emulator for unbranded executables. + +8. See if your SysVR4 programs work. + +It's early days yet, folks -- You'll probably have trouble getting 100% +functionality out of most things (specifically, poll() on a socket doesn't +look like it works at the moment, so Netscape doesn't work (among other +things)). Patches will be appreciated (use send-pr). + + - Mark Newton + newton@atdot.dotat.org + +$FreeBSD$ diff --git a/sys/modules/svr4/TO-DO b/sys/modules/svr4/TO-DO new file mode 100644 index 0000000..078b80d --- /dev/null +++ b/sys/modules/svr4/TO-DO @@ -0,0 +1,15 @@ +TO-DO list +---------- + + * svr4_getdents64() doesn't work properly in 'large' directories. + + * signals are still suspect + + * networking is notworking + + * VM86 and USER_LDT are currently disabled (low-priority) + + * Make SysV emulator use SysV shared memory support (duh) + + +$FreeBSD$ diff --git a/sys/modules/svr4/svr4.sh b/sys/modules/svr4/svr4.sh new file mode 100644 index 0000000..4cb7677 --- /dev/null +++ b/sys/modules/svr4/svr4.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# $FreeBSD$ + +STREAMS=`kldstat -v | egrep 'streams'` +SVR4=`kldstat -v | egrep 'svr4elf'` + +if [ "x$SVR4" != x ] ; then + echo SysVR4 driver already loaded + exit 1 +else + if [ "x$STREAMS" = x ] ; then + kldload streams + echo "Loaded SysVR4 STREAMS driver" + fi + kldload svr4 + echo "Loaded SysVR4 emulator" +fi diff --git a/sys/modules/syscons/Makefile b/sys/modules/syscons/Makefile new file mode 100644 index 0000000..4915900 --- /dev/null +++ b/sys/modules/syscons/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +SUBDIR = +SUBDIR += apm +SUBDIR += blank +SUBDIR += daemon +SUBDIR += fade +SUBDIR += fire +SUBDIR += green +SUBDIR += logo +SUBDIR += rain +SUBDIR += snake +SUBDIR += star +SUBDIR += warp + +.include <bsd.subdir.mk> diff --git a/sys/modules/syscons/Makefile.inc b/sys/modules/syscons/Makefile.inc new file mode 100644 index 0000000..265f86d --- /dev/null +++ b/sys/modules/syscons/Makefile.inc @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" diff --git a/sys/modules/syscons/apm/Makefile b/sys/modules/syscons/apm/Makefile new file mode 100644 index 0000000..00a889f --- /dev/null +++ b/sys/modules/syscons/apm/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= apm_saver +SRCS= apm_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/apm/apm_saver.c b/sys/modules/syscons/apm/apm_saver.c new file mode 100644 index 0000000..d7863ba --- /dev/null +++ b/sys/modules/syscons/apm/apm_saver.c @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 1999 Nick Sayer (who stole shamelessly from blank_saver) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +#include <sys/select.h> +#include <machine/apm_bios.h> +#include <machine/pc/bios.h> +#include <i386/apm/apm.h> + +extern int apm_display __P((int newstate)); + +extern struct apm_softc apm_softc; + +static int blanked=0; + +static int +apm_saver(video_adapter_t *adp, int blank) +{ + struct apm_softc *sc = &apm_softc; + + if (!sc->initialized || !sc->active) + return 0; + + if (blank==blanked) + return 0; + + blanked=blank; + + apm_display(!blanked); + + return 0; +} + +static int +apm_init(video_adapter_t *adp) +{ + struct apm_softc *sc = &apm_softc; + + if (!sc->initialized || !sc->active) + printf("WARNING: apm_saver module requires apm enabled\n"); + return 0; +} + +static int +apm_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t apm_module = { + "apm_saver", apm_init, apm_term, apm_saver, NULL, +}; + +SAVER_MODULE(apm_saver, apm_module); diff --git a/sys/modules/syscons/blank/Makefile b/sys/modules/syscons/blank/Makefile new file mode 100644 index 0000000..e299c92 --- /dev/null +++ b/sys/modules/syscons/blank/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= blank_saver +SRCS= blank_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/blank/blank_saver.c b/sys/modules/syscons/blank/blank_saver.c new file mode 100644 index 0000000..960acca --- /dev/null +++ b/sys/modules/syscons/blank/blank_saver.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1995-1998 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static int +blank_saver(video_adapter_t *adp, int blank) +{ + (*vidsw[adp->va_index]->blank_display)(adp, + (blank) ? V_DISPLAY_BLANK + : V_DISPLAY_ON); + return 0; +} + +static int +blank_init(video_adapter_t *adp) +{ + if ((*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) == 0) + return 0; + return ENODEV; +} + +static int +blank_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t blank_module = { + "blank_saver", blank_init, blank_term, blank_saver, NULL, +}; + +SAVER_MODULE(blank_saver, blank_module); diff --git a/sys/modules/syscons/daemon/Makefile b/sys/modules/syscons/daemon/Makefile new file mode 100644 index 0000000..ea34077 --- /dev/null +++ b/sys/modules/syscons/daemon/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= daemon_saver +SRCS= daemon_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/daemon/daemon_saver.c b/sys/modules/syscons/daemon/daemon_saver.c new file mode 100644 index 0000000..bc03f64 --- /dev/null +++ b/sys/modules/syscons/daemon/daemon_saver.c @@ -0,0 +1,393 @@ +/*- + * Copyright (c) 1997 Sandro Sigala, Brescia, Italy. + * Copyright (c) 1997 Chris Shenton + * Copyright (c) 1995 S ren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/module.h> +#include <sys/malloc.h> +#include <sys/kernel.h> +#include <sys/sysctl.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/pc/display.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +#define DAEMON_MAX_WIDTH 32 +#define DAEMON_MAX_HEIGHT 19 + +static char *message; +static int messagelen; +static int blanked; + +/* Who is the author of this ASCII pic? */ + +static char *daemon_pic[] = { + " , ,", + " /( )`", + " \\ \\___ / |", + " /- _ `-/ '", + " (/\\/ \\ \\ /\\", + " / / | ` \\", + " O O ) / |", + " `-^--'`< '", + " (_.) _ ) /", + " `.___/` /", + " `-----' /", + "<----. __ / __ \\", + "<----|====O)))==) \\) /====", + "<----' `--' `.__,' \\", + " | |", + " \\ / /\\", + " ______( (_ / \\______/", + " ,' ,-----' |", + " `--{__________)", + NULL +}; + +static char *daemon_attr[] = { + " R R", + " RR RR", + " R RRRR R R", + " RR W RRR R", + " RWWW W R RR", + " W W W R R", + " B B W R R", + " WWWWWWRR R", + " RRRR R R R", + " RRRRRRR R", + " RRRRRRR R", + "YYYYYY RR R RR R", + "YYYYYYYYYYRRRRYYR RR RYYYY", + "YYYYYY RRRR RRRRRR R", + " R R", + " R R RR", + " CCCCCCR RR R RRRRRRRR", + " CC CCCCCCC C", + " CCCCCCCCCCCCCCC", + NULL +}; + +/* + * Reverse a graphics character, or return unaltered if no mirror; + * should do alphanumerics too, but I'm too lazy. <cshenton@it.hq.nasa.gov> + */ + +static char +xflip_symbol(char symbol) +{ + static const char lchars[] = "`'(){}[]\\/<>"; + static const char rchars[] = "'`)(}{][/\\><"; + int pos; + + for (pos = 0; lchars[pos] != '\0'; pos++) + if (lchars[pos] == symbol) + return rchars[pos]; + + return symbol; +} + +static void +clear_daemon(sc_softc_t *sc, int xpos, int ypos, int dxdir, int xoff, int yoff, + int xlen, int ylen) +{ + int y; + + if (xlen <= 0) + return; + for (y = yoff; y < ylen; y++) { + sc_vtb_erase(&sc->cur_scp->scr, + (ypos + y)*sc->cur_scp->xsize + xpos + xoff, + xlen - xoff, + sc->scr_map[0x20], (FG_LIGHTGREY | BG_BLACK) << 8); + } +} + +static void +draw_daemon(sc_softc_t *sc, int xpos, int ypos, int dxdir, int xoff, int yoff, + int xlen, int ylen) +{ + int x, y; + int px; + int attr; + + for (y = yoff; y < ylen; y++) { + if (dxdir < 0) + px = xoff; + else + px = DAEMON_MAX_WIDTH - xlen; + if (px >= strlen(daemon_pic[y])) + continue; + for (x = xoff; (x < xlen) && (daemon_pic[y][px] != '\0'); x++, px++) { + switch (daemon_attr[y][px]) { +#ifndef PC98 + case 'R': attr = (FG_LIGHTRED|BG_BLACK)<<8; break; + case 'Y': attr = (FG_YELLOW|BG_BLACK)<<8; break; + case 'B': attr = (FG_LIGHTBLUE|BG_BLACK)<<8; break; + case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break; + case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break; + default: attr = (FG_WHITE|BG_BLACK)<<8; break; +#else /* PC98 */ + case 'R': attr = (FG_RED|BG_BLACK)<<8; break; + case 'Y': attr = (FG_BROWN|BG_BLACK)<<8; break; + case 'B': attr = (FG_BLUE|BG_BLACK)<<8; break; + case 'W': attr = (FG_LIGHTGREY|BG_BLACK)<<8; break; + case 'C': attr = (FG_CYAN|BG_BLACK)<<8; break; + default: attr = (FG_LIGHTGREY|BG_BLACK)<<8; break; +#endif /* PC98 */ + } + if (dxdir < 0) { /* Moving left */ + sc_vtb_putc(&sc->cur_scp->scr, + (ypos + y)*sc->cur_scp->xsize + + xpos + x, + sc->scr_map[daemon_pic[y][px]], + attr); + } else { /* Moving right */ + sc_vtb_putc(&sc->cur_scp->scr, + (ypos + y)*sc->cur_scp->xsize + + xpos + DAEMON_MAX_WIDTH + - px - 1, + sc->scr_map[xflip_symbol(daemon_pic[y][px])], + attr); + } + } + } +} + +static void +clear_string(sc_softc_t *sc, int xpos, int ypos, int xoff, char *s, int len) +{ + if (len <= 0) + return; + sc_vtb_erase(&sc->cur_scp->scr, + ypos*sc->cur_scp->xsize + xpos + xoff, len - xoff, + sc->scr_map[0x20], (FG_LIGHTGREY | BG_BLACK) << 8); +} + +static void +draw_string(sc_softc_t *sc, int xpos, int ypos, int xoff, char *s, int len) +{ + int x; + + for (x = xoff; x < len; x++) { + sc_vtb_putc(&sc->cur_scp->scr, + ypos*sc->cur_scp->xsize + xpos + x, + sc->scr_map[s[x]], (FG_LIGHTGREEN | BG_BLACK) << 8); + } +} + +static int +daemon_saver(video_adapter_t *adp, int blank) +{ + static int txpos = 10, typos = 10; + static int txdir = -1, tydir = -1; + static int dxpos = 0, dypos = 0; + static int dxdir = 1, dydir = 1; + static int moved_daemon = 0; + static int xoff, yoff, toff; + static int xlen, ylen, tlen; + sc_softc_t *sc; + scr_stat *scp; + int min, max; + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return EAGAIN; + scp = sc->cur_scp; + + if (blank) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + if (blanked == 0) { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) & ~0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + /* clear the screen and set the border color */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + set_border(scp, 0); + xlen = ylen = tlen = 0; + } + if (blanked++ < 2) + return 0; + blanked = 1; + + clear_daemon(sc, dxpos, dypos, dxdir, xoff, yoff, xlen, ylen); + clear_string(sc, txpos, typos, toff, (char *)message, tlen); + + if (++moved_daemon) { + /* + * The daemon picture may be off the screen, if + * screen size is chagened while the screen + * saver is inactive. Make sure the origin of + * the picture is between min and max. + */ + if (scp->xsize <= DAEMON_MAX_WIDTH) { + /* + * If the screen width is too narrow, we + * allow part of the picture go off + * the screen so that the daemon won't + * flip too often. + */ + min = scp->xsize - DAEMON_MAX_WIDTH - 10; + max = 10; + } else { + min = 0; + max = scp->xsize - DAEMON_MAX_WIDTH; + } + if (dxpos <= min) { + dxpos = min; + dxdir = 1; + } else if (dxpos >= max) { + dxpos = max; + dxdir = -1; + } + + if (scp->ysize <= DAEMON_MAX_HEIGHT) { + min = scp->ysize - DAEMON_MAX_HEIGHT - 10; + max = 10; + } else { + min = 0; + max = scp->ysize - DAEMON_MAX_HEIGHT; + } + if (dypos <= min) { + dypos = min; + dydir = 1; + } else if (dypos >= max) { + dypos = max; + dydir = -1; + } + + moved_daemon = -1; + dxpos += dxdir; dypos += dydir; + + /* clip the picture */ + xoff = 0; + xlen = DAEMON_MAX_WIDTH; + if (dxpos + xlen <= 0) + xlen = 0; + else if (dxpos < 0) + xoff = -dxpos; + if (dxpos >= scp->xsize) + xlen = 0; + else if (dxpos + xlen > scp->xsize) + xlen = scp->xsize - dxpos; + yoff = 0; + ylen = DAEMON_MAX_HEIGHT; + if (dypos + ylen <= 0) + ylen = 0; + else if (dypos < 0) + yoff = -dypos; + if (dypos >= scp->ysize) + ylen = 0; + else if (dypos + ylen > scp->ysize) + ylen = scp->ysize - dypos; + } + + if (scp->xsize <= messagelen) { + min = scp->xsize - messagelen - 10; + max = 10; + } else { + min = 0; + max = scp->xsize - messagelen; + } + if (txpos <= min) { + txpos = min; + txdir = 1; + } else if (txpos >= max) { + txpos = max; + txdir = -1; + } + if (typos <= 0) { + typos = 0; + tydir = 1; + } else if (typos >= scp->ysize - 1) { + typos = scp->ysize - 1; + tydir = -1; + } + txpos += txdir; typos += tydir; + + toff = 0; + tlen = messagelen; + if (txpos + tlen <= 0) + tlen = 0; + else if (txpos < 0) + toff = -txpos; + if (txpos >= scp->xsize) + tlen = 0; + else if (txpos + tlen > scp->xsize) + tlen = scp->xsize - txpos; + + draw_daemon(sc, dxpos, dypos, dxdir, xoff, yoff, xlen, ylen); + draw_string(sc, txpos, typos, toff, (char *)message, tlen); + } else { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) | 0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + blanked = 0; + } + return 0; +} + +static int +daemon_init(video_adapter_t *adp) +{ + messagelen = strlen(hostname) + 3 + strlen(ostype) + 1 + + strlen(osrelease); + message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); + sprintf(message, "%s - %s %s", hostname, ostype, osrelease); + blanked = 0; + return 0; +} + +static int +daemon_term(video_adapter_t *adp) +{ + free(message, M_DEVBUF); + return 0; +} + +static scrn_saver_t daemon_module = { + "daemon_saver", daemon_init, daemon_term, daemon_saver, NULL, +}; + +SAVER_MODULE(daemon_saver, daemon_module); diff --git a/sys/modules/syscons/fade/Makefile b/sys/modules/syscons/fade/Makefile new file mode 100644 index 0000000..5fc34eb --- /dev/null +++ b/sys/modules/syscons/fade/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= fade_saver +SRCS= fade_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/fade/fade_saver.c b/sys/modules/syscons/fade/fade_saver.c new file mode 100644 index 0000000..052fa92 --- /dev/null +++ b/sys/modules/syscons/fade/fade_saver.c @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 1995-1998 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static u_char palette[256*3]; +static int blanked; + +static int +fade_saver(video_adapter_t *adp, int blank) +{ + static int count = 0; + u_char pal[256*3]; + int i; + + if (blank) { + blanked = TRUE; + if (ISPALAVAIL(adp->va_flags)) { + if (count <= 0) + save_palette(adp, palette); + if (count < 256) { + pal[0] = pal[1] = pal[2] = 0; + for (i = 3; i < 256*3; i++) { + if (palette[i] - count > 60) + pal[i] = palette[i] - count; + else + pal[i] = 60; + } + load_palette(adp, pal); + count++; + } + } else { + (*vidsw[adp->va_index]->blank_display)(adp, + V_DISPLAY_BLANK); + } + } else { + if (ISPALAVAIL(adp->va_flags)) { + load_palette(adp, palette); + count = 0; + } else { + (*vidsw[adp->va_index]->blank_display)(adp, + V_DISPLAY_ON); + } + blanked = FALSE; + } + return 0; +} + +static int +fade_init(video_adapter_t *adp) +{ + if (!ISPALAVAIL(adp->va_flags) + && (*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) != 0) + return ENODEV; + blanked = FALSE; + return 0; +} + +static int +fade_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t fade_module = { + "fade_saver", fade_init, fade_term, fade_saver, NULL, +}; + +SAVER_MODULE(fade_saver, fade_module); diff --git a/sys/modules/syscons/fire/Makefile b/sys/modules/syscons/fire/Makefile new file mode 100644 index 0000000..e078f2c --- /dev/null +++ b/sys/modules/syscons/fire/Makefile @@ -0,0 +1,9 @@ + +KMOD= fire_saver +SRCS= fire_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. +CWARNFLAGS= -Wall -pedantic + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/fire/fire_saver.c b/sys/modules/syscons/fire/fire_saver.c new file mode 100644 index 0000000..59c7079 --- /dev/null +++ b/sys/modules/syscons/fire/fire_saver.c @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 1999 Brad Forschinger + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * brad forschinger, 19990504 <retch@flag.blackened.net> + * + * written with much help from warp_saver.c + * + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/syslog.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/random.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +#define X_SIZE 320 +#define Y_SIZE 200 + +static int blanked; +static u_char fire_pal[768]; +static u_char buf[X_SIZE * (Y_SIZE + 1)]; +static u_char *vid; + +static int +fire_saver(video_adapter_t *adp, int blank) +{ + int x, y; + + if (blank) { + if (blanked <= 0) { + int red, green, blue; + int palette_index; + + set_video_mode(adp, M_VGA_CG320); + + /* build and load palette */ + red = green = blue = 0; + for (palette_index = 0; palette_index < 256; palette_index++) { + red++; + if (red > 128) + green += 2; + + fire_pal[(palette_index * 3) + 0] = red; + fire_pal[(palette_index * 3) + 1] = green; + fire_pal[(palette_index * 3) + 2] = blue; + } + load_palette(adp, fire_pal); + + blanked++; + vid = (u_char *) adp->va_window; + } + /* make a new bottom line */ + for (x = 0, y = Y_SIZE; x < X_SIZE; x++) + buf[x + (y * X_SIZE)] = random() % 160 + 96; + + /* fade the flames out */ + for (y = 0; y < Y_SIZE; y++) { + for (x = 0; x < X_SIZE; x++) { + buf[x + (y * X_SIZE)] = (buf[(x + 0) + ((y + 0) * X_SIZE)] + + buf[(x - 1) + ((y + 1) * X_SIZE)] + + buf[(x + 0) + ((y + 1) * X_SIZE)] + + buf[(x + 1) + ((y + 1) * X_SIZE)]) / 4; + if (buf[x + (y * X_SIZE)] > 0) + buf[x + (y * X_SIZE)]--; + } + } + + /* blit our buffer into video ram */ + memcpy(vid, buf, X_SIZE * Y_SIZE); + } else { + blanked = 0; + } + + return 0; +} + +static int +fire_initialise(video_adapter_t *adp) +{ + video_info_t info; + + /* check that the console is capable of running in 320x200x256 */ + if (get_mode_info(adp, M_VGA_CG320, &info)) { + log(LOG_NOTICE, "fire_saver: the console does not support M_VGA_CG320\n"); + return (ENODEV); + } + blanked = 0; + + return 0; +} + +static int +fire_terminate(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t fire_module = { + "fire_saver", fire_initialise, fire_terminate, fire_saver, NULL +}; + +SAVER_MODULE(fire_saver, fire_module); diff --git a/sys/modules/syscons/green/Makefile b/sys/modules/syscons/green/Makefile new file mode 100644 index 0000000..f62b1f4 --- /dev/null +++ b/sys/modules/syscons/green/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= green_saver +SRCS= green_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/green/green_saver.c b/sys/modules/syscons/green/green_saver.c new file mode 100644 index 0000000..d6cfe80 --- /dev/null +++ b/sys/modules/syscons/green/green_saver.c @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 1995-1998 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static int +green_saver(video_adapter_t *adp, int blank) +{ + (*vidsw[adp->va_index]->blank_display)(adp, + (blank) ? V_DISPLAY_STAND_BY + : V_DISPLAY_ON); + return 0; +} + +static int +green_init(video_adapter_t *adp) +{ + if ((*vidsw[adp->va_index]->blank_display)(adp, V_DISPLAY_ON) == 0) + return 0; + return ENODEV; +} + +static int +green_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t green_module = { + "green_saver", green_init, green_term, green_saver, NULL, +}; + +SAVER_MODULE(green_saver, green_module); diff --git a/sys/modules/syscons/logo/Makefile b/sys/modules/syscons/logo/Makefile new file mode 100644 index 0000000..2a9ede2 --- /dev/null +++ b/sys/modules/syscons/logo/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= logo_saver +SRCS= logo_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. -I${.CURDIR} + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/logo/logo.c b/sys/modules/syscons/logo/logo.c new file mode 100644 index 0000000..be502fe --- /dev/null +++ b/sys/modules/syscons/logo/logo.c @@ -0,0 +1,352 @@ +#define logo_w 88 +#define logo_h 88 + +unsigned char logo_pal[768] = { + 0x00, 0x00, 0x00, + 0x33, 0x33, 0x33, + 0x66, 0x66, 0x66, + 0x99, 0x99, 0x99, + 0xcc, 0xcc, 0xcc, + 0xff, 0xff, 0xff, + 0x90, 0x8f, 0x90, + 0x56, 0x4b, 0x55, + 0xa3, 0xa5, 0xab, + 0xfd, 0xfd, 0xfd, + 0x6d, 0x6e, 0x74, + 0x41, 0x2b, 0x39, + 0xcb, 0xc8, 0xcb, + 0xcf, 0xbb, 0xba, + 0x8e, 0x82, 0x87, + 0x5c, 0x5d, 0x60, + 0x52, 0x2a, 0x37, + 0x7f, 0x76, 0x7d, + 0x82, 0x82, 0x85, + 0x7a, 0x3e, 0x45, + 0x7f, 0x6e, 0x70, + 0xef, 0xef, 0xed, + 0x53, 0x41, 0x4b, + 0x67, 0x2b, 0x35, + 0x6a, 0x55, 0x62, + 0xe7, 0xe2, 0xe3, + 0x64, 0x35, 0x3f, + 0xf7, 0xe0, 0xe7, + 0xb1, 0xb2, 0xb2, + 0x31, 0x2b, 0x35, + 0x7a, 0x2d, 0x37, + 0x69, 0x4c, 0x56, + 0x95, 0x9d, 0xa4, + 0x85, 0x61, 0x69, + 0x40, 0x34, 0x41, + 0x8f, 0x2e, 0x39, + 0x7a, 0x50, 0x5a, + 0xde, 0xe1, 0xe0, + 0x32, 0x33, 0x3d, + 0xa0, 0x9b, 0x9c, + 0x68, 0x63, 0x67, + 0x76, 0x60, 0x67, + 0xba, 0xb6, 0xb8, + 0x29, 0x24, 0x41, + 0x38, 0x21, 0x29, + 0x42, 0x21, 0x27, + 0xa2, 0x2a, 0x32, + 0x56, 0x55, 0x58, + 0x55, 0x21, 0x2b, + 0x7a, 0x20, 0x2a, + 0x37, 0x16, 0x21, + 0x4d, 0x18, 0x37, + 0x8a, 0x3a, 0x3e, + 0xc0, 0xc2, 0xc4, + 0x64, 0x23, 0x2c, + 0x37, 0x1a, 0x24, + 0x42, 0x18, 0x20, + 0x4c, 0x21, 0x2b, + 0xa0, 0x23, 0x2e, + 0x95, 0x6c, 0x76, + 0x26, 0x16, 0x1c, + 0xa5, 0x18, 0x23, + 0x84, 0x20, 0x2b, + 0x6d, 0x3f, 0x49, + 0xae, 0xa7, 0xac, + 0x2a, 0x1f, 0x24, + 0x90, 0x21, 0x30, + 0xa0, 0x39, 0x3e, + 0x95, 0x0f, 0x1c, + 0x84, 0x13, 0x1e, + 0x4e, 0x17, 0x24, + 0x8c, 0x56, 0x5f, + 0xe0, 0xc4, 0xcb, + 0xa5, 0x7f, 0x8e, + 0xff, 0xff, 0xf1, + 0x3d, 0x3d, 0x5d, + 0x61, 0x19, 0x26, + 0xd5, 0xd5, 0xd5, + 0xff, 0xf1, 0xed, + 0xb6, 0x9c, 0xa5, + 0x87, 0x4c, 0x5a, + 0xa0, 0x76, 0x76, + 0xc8, 0xa0, 0xa0, + 0xa2, 0xc1, 0xc8, + 0x91, 0xae, 0xb6, + 0x52, 0x8b, 0xae, + 0xb3, 0xd2, 0xd4, + 0x95, 0xb7, 0xc1, + 0x54, 0x6e, 0x83, + 0x67, 0x90, 0xa6, + 0x44, 0x3e, 0x45, + 0x23, 0x40, 0x6a, + 0x41, 0x6e, 0x97, + 0x7e, 0x8e, 0x91, + 0x52, 0x33, 0x41, + 0x39, 0x49, 0x68, + 0x1d, 0x2a, 0x48, + 0x17, 0x21, 0x45, + 0x90, 0x17, 0x1f, + 0x38, 0x54, 0x71, + 0x1c, 0x33, 0x58, + 0x1c, 0x1e, 0x23, + 0x6c, 0x17, 0x21, + 0xb0, 0xc5, 0xc1, + 0x5d, 0x7f, 0x96, + 0xe9, 0xbf, 0xc1, + 0x96, 0x06, 0x0f, + 0x78, 0x16, 0x1e, + 0xab, 0x0e, 0x18, + 0xa6, 0x06, 0x0e, + 0x4c, 0x4c, 0x54, + 0x61, 0x42, 0x4c, + 0x48, 0x5f, 0x84, + 0xa0, 0xb8, 0xbe, + 0x5c, 0x66, 0x7f, + 0x7b, 0x9e, 0xa9, + 0x6f, 0x75, 0x7f, + 0x45, 0x54, 0x74, + 0x32, 0x3e, 0x63, + 0xb1, 0xb4, 0xb3, + 0x66, 0x9d, 0xb4, + 0x7a, 0x9f, 0xbb, + 0x82, 0xaa, 0xba, + 0x13, 0x15, 0x17, + 0x0b, 0x0b, 0x0a, + 0x37, 0x66, 0x92, + 0x4c, 0x7f, 0xa5, + 0x24, 0x4c, 0x7b, + 0x25, 0x5f, 0x91, + 0x40, 0x7d, 0xa5, + 0x1d, 0x56, 0x88, + 0x2d, 0x6f, 0xa0, + 0x70, 0x81, 0x8f, + 0x58, 0x97, 0xbd, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, +}; + +unsigned char logo_img[logo_w*logo_h] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x09, 0x0a, 0x0b, 0x07, 0x0c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0d, 0x0e, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x0f, 0x0b, 0x10, 0x11, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x12, 0x13, 0x14, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x16, 0x0b, 0x17, 0x18, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x13, 0x1a, 0x1b, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x1c, 0x1d, 0x10, 0x1e, 0x1f, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x20, 0x0b, 0x1e, 0x21, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x22, 0x0b, 0x17, 0x23, 0x24, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x26, 0x10, 0x23, 0x27, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x11, 0x28, 0x29, 0x11, 0x06, 0x0d, 0x09, 0x05, 0x2a, 0x2b, 0x2c, 0x2d, 0x1e, 0x2e, 0x21, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2f, 0x0b, 0x30, 0x31, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x06, 0x16, 0x22, 0x1d, 0x2c, 0x32, 0x33, 0x17, 0x17, 0x17, 0x22, 0x14, 0x16, 0x1d, 0x2c, 0x2d, 0x1e, 0x2e, 0x34, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x2c, 0x36, 0x36, 0x35, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x27, 0x0b, 0x2c, 0x2c, 0x37, 0x32, 0x38, 0x2c, 0x2d, 0x39, 0x36, 0x17, 0x30, 0x2c, 0x2c, 0x2d, 0x2c, 0x2c, 0x1a, 0x3a, 0x3a, 0x3b, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2d, 0x2b, 0x33, 0x31, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x09, 0x28, 0x2c, 0x37, 0x3c, 0x32, 0x38, 0x38, 0x37, 0x2c, 0x30, 0x36, 0x36, 0x17, 0x31, 0x36, 0x23, 0x23, 0x17, 0x2c, 0x17, 0x3a, 0x3d, 0x13, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x2c, 0x37, 0x33, 0x3e, 0x31, 0x3f, 0x40, 0x19, 0x05, 0x11, 0x2c, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x37, 0x41, 0x30, 0x3a, 0x3a, 0x2e, 0x42, 0x43, 0x17, 0x1a, 0x13, 0x23, 0x31, 0x1a, 0x2e, 0x3d, 0x1a, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0b, 0x37, 0x32, 0x37, 0x33, 0x44, 0x44, 0x45, 0x17, 0x1a, 0x10, 0x2d, 0x37, 0x38, 0x46, 0x33, 0x46, 0x32, 0x2c, 0x23, 0x23, 0x47, 0x21, 0x13, 0x43, 0x34, 0x48, 0x19, 0x49, 0x34, 0x17, 0x1e, 0x3a, 0x13, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4b, 0x32, 0x32, 0x32, 0x32, 0x4c, 0x45, 0x44, 0x44, 0x42, 0x36, 0x30, 0x33, 0x46, 0x38, 0x33, 0x46, 0x38, 0x31, 0x23, 0x27, 0x09, 0x4a, 0x4d, 0x47, 0x43, 0x0d, 0x4e, 0x4a, 0x4f, 0x34, 0x1a, 0x2e, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x33, 0x32, 0x32, 0x32, 0x33, 0x4c, 0x31, 0x45, 0x3e, 0x31, 0x36, 0x46, 0x46, 0x33, 0x33, 0x39, 0x30, 0x23, 0x50, 0x4a, 0x4a, 0x4a, 0x4a, 0x4d, 0x47, 0x51, 0x4e, 0x4a, 0x4a, 0x0e, 0x13, 0x1a, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2b, 0x32, 0x32, 0x2b, 0x32, 0x33, 0x4c, 0x33, 0x4c, 0x4c, 0x36, 0x30, 0x30, 0x30, 0x30, 0x31, 0x23, 0x3a, 0x49, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4f, 0x50, 0x1b, 0x4e, 0x4a, 0x19, 0x50, 0x16, 0x0c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x32, 0x32, 0x32, 0x32, 0x2b, 0x33, 0x33, 0x30, 0x2d, 0x39, 0x30, 0x30, 0x30, 0x4c, 0x36, 0x42, 0x3a, 0x52, 0x05, 0x4a, 0x4a, 0x4a, 0x4a, 0x09, 0x3b, 0x52, 0x4e, 0x4a, 0x4a, 0x4f, 0x1a, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x2b, 0x2b, 0x32, 0x32, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2d, 0x10, 0x30, 0x30, 0x3e, 0x23, 0x3a, 0x0d, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x40, 0x51, 0x4a, 0x4a, 0x25, 0x15, 0x1f, 0x27, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x22, 0x2c, 0x32, 0x32, 0x32, 0x38, 0x2d, 0x2c, 0x41, 0x32, 0x39, 0x46, 0x4c, 0x31, 0x2e, 0x2e, 0x0c, 0x4a, 0x4a, 0x4a, 0x4a, 0x4a, 0x25, 0x53, 0x18, 0x4a, 0x54, 0x55, 0x56, 0x51, 0x11, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x22, 0x32, 0x32, 0x32, 0x38, 0x38, 0x32, 0x2c, 0x37, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3a, 0x2a, 0x4a, 0x4a, 0x05, 0x4a, 0x57, 0x58, 0x59, 0x5a, 0x35, 0x58, 0x5b, 0x5c, 0x5d, 0x5e, 0x4a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x07, 0x37, 0x32, 0x38, 0x38, 0x32, 0x32, 0x41, 0x38, 0x30, 0x30, 0x3e, 0x3a, 0x3d, 0x27, 0x05, 0x4a, 0x4a, 0x4a, 0x5c, 0x5f, 0x59, 0x1d, 0x29, 0x2f, 0x60, 0x61, 0x26, 0x0b, 0x1c, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4e, 0x0a, 0x2d, 0x38, 0x38, 0x32, 0x37, 0x32, 0x2d, 0x39, 0x36, 0x31, 0x62, 0x3d, 0x0e, 0x4a, 0x4a, 0x4a, 0x09, 0x63, 0x64, 0x64, 0x61, 0x2d, 0x1d, 0x65, 0x61, 0x2b, 0x17, 0x16, 0x4a, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x2c, 0x38, 0x38, 0x37, 0x37, 0x38, 0x2d, 0x30, 0x31, 0x42, 0x3a, 0x18, 0x09, 0x05, 0x05, 0x4a, 0x63, 0x60, 0x60, 0x2b, 0x10, 0x2d, 0x41, 0x41, 0x30, 0x42, 0x3e, 0x29, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x37, 0x32, 0x38, 0x32, 0x41, 0x38, 0x38, 0x30, 0x66, 0x31, 0x3a, 0x1e, 0x67, 0x4a, 0x4a, 0x05, 0x68, 0x64, 0x61, 0x2b, 0x17, 0x36, 0x10, 0x33, 0x31, 0x42, 0x3d, 0x45, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x1c, 0x2c, 0x32, 0x32, 0x37, 0x41, 0x2c, 0x46, 0x30, 0x36, 0x36, 0x42, 0x42, 0x29, 0x1b, 0x4a, 0x4a, 0x4d, 0x26, 0x60, 0x0b, 0x17, 0x36, 0x44, 0x45, 0x66, 0x3e, 0x44, 0x44, 0x1a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x2c, 0x32, 0x32, 0x38, 0x37, 0x32, 0x37, 0x30, 0x36, 0x4c, 0x31, 0x1e, 0x10, 0x1f, 0x52, 0x69, 0x52, 0x07, 0x2c, 0x10, 0x36, 0x62, 0x6a, 0x44, 0x6b, 0x3e, 0x44, 0x6c, 0x30, 0x09, 0x05, 0x05, 0x25, 0x54, 0x19, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x25, 0x2c, 0x37, 0x38, 0x37, 0x2c, 0x32, 0x32, 0x46, 0x30, 0x46, 0x4c, 0x31, 0x66, 0x4c, 0x36, 0x1a, 0x1a, 0x17, 0x37, 0x37, 0x10, 0x31, 0x62, 0x45, 0x4c, 0x3e, 0x44, 0x62, 0x30, 0x09, 0x05, 0x0a, 0x70, 0x71, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x22, 0x32, 0x32, 0x38, 0x41, 0x41, 0x38, 0x2d, 0x46, 0x66, 0x44, 0x6c, 0x6c, 0x6c, 0x3d, 0x3a, 0x42, 0x31, 0x32, 0x32, 0x32, 0x33, 0x33, 0x30, 0x36, 0x3e, 0x3e, 0x31, 0x07, 0x05, 0x12, 0x6e, 0x72, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2c, 0x38, 0x32, 0x41, 0x37, 0x2d, 0x46, 0x66, 0x6a, 0x6c, 0x6d, 0x6d, 0x6c, 0x3d, 0x3d, 0x31, 0x38, 0x38, 0x39, 0x33, 0x39, 0x36, 0x30, 0x30, 0x66, 0x30, 0x40, 0x4d, 0x5f, 0x4d, 0x4d, 0x05, 0x05, 0x05, 0x15, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x5a, 0x2d, 0x32, 0x32, 0x37, 0x37, 0x32, 0x38, 0x46, 0x46, 0x66, 0x45, 0x44, 0x62, 0x44, 0x44, 0x3e, 0x31, 0x31, 0x31, 0x31, 0x31, 0x33, 0x37, 0x30, 0x10, 0x06, 0x05, 0x12, 0x0a, 0x05, 0x05, 0x05, 0x08, 0x68, 0x73, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x32, 0x32, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x39, 0x39, 0x39, 0x36, 0x36, 0x6b, 0x3e, 0x3e, 0x3e, 0x3e, 0x31, 0x4c, 0x39, 0x2d, 0x10, 0x16, 0x2a, 0x05, 0x05, 0x74, 0x74, 0x05, 0x05, 0x0c, 0x75, 0x5f, 0x1c, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x2c, 0x32, 0x32, 0x32, 0x41, 0x37, 0x41, 0x2c, 0x2c, 0x41, 0x2c, 0x33, 0x36, 0x31, 0x36, 0x31, 0x31, 0x17, 0x46, 0x2c, 0x16, 0x40, 0x05, 0x05, 0x05, 0x05, 0x20, 0x5f, 0x4d, 0x72, 0x76, 0x06, 0x25, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x40, 0x0b, 0x2d, 0x37, 0x2d, 0x2c, 0x2c, 0x37, 0x37, 0x38, 0x2c, 0x37, 0x2c, 0x10, 0x10, 0x39, 0x30, 0x0b, 0x2c, 0x11, 0x09, 0x05, 0x09, 0x4a, 0x05, 0x05, 0x19, 0x1d, 0x26, 0x76, 0x08, 0x05, 0x05, 0x05, 0x15, 0x25, 0x4d, 0x53, 0x77, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4d, 0x5a, 0x2c, 0x37, 0x2d, 0x2c, 0x37, 0x37, 0x39, 0x39, 0x33, 0x38, 0x2c, 0x2d, 0x2d, 0x2c, 0x5e, 0x2a, 0x05, 0x15, 0x3b, 0x17, 0x1f, 0x19, 0x05, 0x06, 0x26, 0x60, 0x5f, 0x0c, 0x05, 0x05, 0x05, 0x35, 0x68, 0x78, 0x56, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x37, 0x2c, 0x37, 0x32, 0x46, 0x33, 0x46, 0x39, 0x11, 0x15, 0x05, 0x05, 0x18, 0x31, 0x44, 0x6a, 0x30, 0x6e, 0x2b, 0x4b, 0x11, 0x5f, 0x63, 0x72, 0x54, 0x20, 0x74, 0x58, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2c, 0x38, 0x2d, 0x39, 0x39, 0x2d, 0x37, 0x3c, 0x32, 0x37, 0x0b, 0x18, 0x05, 0x05, 0x05, 0x4e, 0x26, 0x32, 0x45, 0x6a, 0x46, 0x2b, 0x72, 0x4e, 0x05, 0x35, 0x0a, 0x75, 0x5f, 0x70, 0x08, 0x09, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x35, 0x22, 0x2d, 0x30, 0x6b, 0x6b, 0x66, 0x36, 0x30, 0x36, 0x4c, 0x36, 0x30, 0x18, 0x05, 0x05, 0x05, 0x09, 0x4b, 0x32, 0x46, 0x66, 0x38, 0x0b, 0x09, 0x05, 0x05, 0x05, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x2c, 0x2c, 0x31, 0x62, 0x62, 0x6b, 0x31, 0x45, 0x44, 0x44, 0x45, 0x31, 0x10, 0x0c, 0x4d, 0x0c, 0x08, 0x0b, 0x3c, 0x32, 0x33, 0x66, 0x17, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x22, 0x2c, 0x2d, 0x31, 0x45, 0x6b, 0x36, 0x31, 0x6b, 0x62, 0x45, 0x6a, 0x66, 0x30, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x37, 0x46, 0x6b, 0x44, 0x62, 0x5e, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x1d, 0x2c, 0x39, 0x36, 0x4c, 0x30, 0x30, 0x30, 0x36, 0x4c, 0x66, 0x4c, 0x36, 0x30, 0x37, 0x41, 0x2c, 0x2d, 0x2c, 0x3c, 0x33, 0x6b, 0x44, 0x44, 0x39, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x2d, 0x2d, 0x2d, 0x36, 0x39, 0x2d, 0x32, 0x38, 0x38, 0x46, 0x6a, 0x6d, 0x3d, 0x62, 0x46, 0x3c, 0x37, 0x2d, 0x32, 0x32, 0x32, 0x38, 0x4c, 0x30, 0x16, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0a, 0x37, 0x38, 0x38, 0x39, 0x37, 0x2c, 0x37, 0x37, 0x30, 0x45, 0x6d, 0x6d, 0x62, 0x62, 0x38, 0x3c, 0x3c, 0x32, 0x37, 0x32, 0x32, 0x32, 0x2c, 0x14, 0x15, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x6e, 0x37, 0x38, 0x38, 0x38, 0x37, 0x2c, 0x2d, 0x30, 0x31, 0x62, 0x6a, 0x6d, 0x6a, 0x6a, 0x46, 0x32, 0x32, 0x37, 0x37, 0x32, 0x30, 0x17, 0x29, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x0b, 0x38, 0x38, 0x38, 0x2c, 0x2c, 0x0b, 0x2d, 0x39, 0x4c, 0x45, 0x6a, 0x6a, 0x6a, 0x6a, 0x6a, 0x38, 0x37, 0x2c, 0x41, 0x18, 0x1c, 0x0c, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x15, 0x0b, 0x2d, 0x38, 0x38, 0x37, 0x2c, 0x2c, 0x2c, 0x37, 0x32, 0x4c, 0x6b, 0x44, 0x44, 0x45, 0x6a, 0x45, 0x38, 0x37, 0x1c, 0x09, 0x05, 0x05, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x1d, 0x38, 0x38, 0x38, 0x38, 0x2c, 0x3c, 0x37, 0x37, 0x32, 0x32, 0x46, 0x36, 0x1e, 0x6b, 0x4c, 0x46, 0x32, 0x22, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x37, 0x32, 0x37, 0x38, 0x38, 0x37, 0x32, 0x3c, 0x32, 0x32, 0x37, 0x38, 0x2d, 0x2d, 0x38, 0x2c, 0x2c, 0x4f, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x08, 0x3c, 0x37, 0x41, 0x38, 0x2d, 0x37, 0x37, 0x3c, 0x32, 0x3c, 0x32, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x0c, 0x41, 0x3c, 0x3c, 0x38, 0x32, 0x3c, 0x3c, 0x3c, 0x41, 0x32, 0x41, 0x37, 0x2c, 0x2c, 0x41, 0x38, 0x45, 0x18, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x37, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x2c, 0x2c, 0x2c, 0x2c, 0x4c, 0x45, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x11, 0x2c, 0x37, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x41, 0x37, 0x37, 0x4c, 0x44, 0x6d, 0x6a, 0x1a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x5a, 0x2c, 0x41, 0x3c, 0x3c, 0x3c, 0x32, 0x2c, 0x32, 0x2c, 0x2c, 0x38, 0x38, 0x36, 0x45, 0x62, 0x44, 0x45, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x2a, 0x2c, 0x3c, 0x3c, 0x3c, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x37, 0x39, 0x4c, 0x4c, 0x45, 0x62, 0x44, 0x62, 0x30, 0x2a, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x4a, 0x5a, 0x41, 0x3c, 0x3c, 0x3c, 0x3c, 0x32, 0x3c, 0x37, 0x37, 0x2d, 0x46, 0x4c, 0x6b, 0x6b, 0x45, 0x3e, 0x36, 0x29, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x27, 0x3c, 0x37, 0x3c, 0x3c, 0x37, 0x37, 0x32, 0x38, 0x37, 0x37, 0x37, 0x38, 0x39, 0x36, 0x4c, 0x30, 0x10, 0x16, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x25, 0x1d, 0x37, 0x37, 0x41, 0x32, 0x3c, 0x32, 0x41, 0x37, 0x32, 0x2c, 0x41, 0x37, 0x2c, 0x32, 0x37, 0x2c, 0x2c, 0x5a, 0x0c, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x05, 0x15, 0x5a, 0x37, 0x2c, 0x41, 0x2c, 0x2c, 0x41, 0x37, 0x41, 0x41, 0x3c, 0x2c, 0x41, 0x41, 0x3c, 0x37, 0x2c, 0x39, 0x0b, 0x0b, 0x25, 0x05, 0x05, 0x05, 0x05, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x2a, 0x22, 0x2d, 0x37, 0x2c, 0x3c, 0x1d, 0x2c, 0x38, 0x2c, 0x41, 0x2c, 0x2c, 0x2d, 0x39, 0x37, 0x3c, 0x37, 0x30, 0x1a, 0x5e, 0x6e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x2a, 0x6e, 0x0b, 0x2d, 0x38, 0x41, 0x41, 0x6e, 0x5a, 0x2c, 0x41, 0x32, 0x38, 0x32, 0x39, 0x3f, 0x6f, 0x16, 0x37, 0x1a, 0x1f, 0x1f, 0x16, 0x1d, 0x0c, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x40, 0x07, 0x2c, 0x37, 0x2c, 0x2d, 0x2c, 0x1d, 0x0e, 0x09, 0x0b, 0x4b, 0x07, 0x41, 0x38, 0x2d, 0x10, 0x2d, 0x10, 0x0b, 0x2b, 0x33, 0x3f, 0x21, 0x29, 0x07, 0x5e, 0x2f, 0x12, 0x08, 0x2a, 0x0c, 0x25, 0x09, 0x09, 0x09, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x19, 0x40, 0x28, 0x22, 0x2c, 0x38, 0x32, 0x32, 0x32, 0x1d, 0x0e, 0x19, 0x05, 0x35, 0x2c, 0x4b, 0x70, 0x0b, 0x32, 0x2c, 0x16, 0x16, 0x16, 0x0b, 0x22, 0x26, 0x0b, 0x10, 0x3f, 0x29, 0x1f, 0x47, 0x1f, 0x1f, 0x5e, 0x0b, 0x4b, 0x74, 0x84, 0x74, 0x84, 0x06, 0x35, 0x09, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x4d, 0x27, 0x0a, 0x22, 0x1d, 0x2c, 0x2c, 0x37, 0x32, 0x41, 0x41, 0x16, 0x27, 0x15, 0x09, 0x4a, 0x09, 0x28, 0x2d, 0x0b, 0x76, 0x2c, 0x37, 0x2d, 0x37, 0x32, 0x37, 0x0b, 0x0b, 0x5e, 0x5a, 0x4b, 0x0b, 0x0b, 0x07, 0x6e, 0x16, 0x5e, 0x10, 0x76, 0x5c, 0x68, 0x79, 0x7a, 0x53, 0x71, 0x54, 0x5d, 0x08, 0x4d, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x25, 0x27, 0x28, 0x0b, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x41, 0x41, 0x41, 0x22, 0x11, 0x35, 0x4d, 0x4d, 0x35, 0x1c, 0x06, 0x0a, 0x22, 0x38, 0x38, 0x37, 0x38, 0x38, 0x38, 0x2d, 0x39, 0x39, 0x39, 0x10, 0x39, 0x10, 0x4b, 0x12, 0x08, 0x35, 0x67, 0x2a, 0x08, 0x74, 0x70, 0x81, 0x55, 0x78, 0x79, 0x57, 0x53, 0x71, 0x71, 0x73, 0x84, 0x25, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x05, 0x09, 0x27, 0x16, 0x0b, 0x2c, 0x2d, 0x2c, 0x41, 0x41, 0x1d, 0x22, 0x5a, 0x0f, 0x14, 0x0a, 0x28, 0x0a, 0x28, 0x28, 0x28, 0x6e, 0x5a, 0x65, 0x1d, 0x0b, 0x2d, 0x38, 0x46, 0x38, 0x38, 0x38, 0x39, 0x2d, 0x46, 0x39, 0x30, 0x39, 0x4b, 0x68, 0x79, 0x7a, 0x57, 0x67, 0x67, 0x56, 0x53, 0x71, 0x68, 0x7e, 0x85, 0x59, 0x73, 0x79, 0x54, 0x7a, 0x54, 0x06, 0x1c, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x4d, 0x16, 0x0b, 0x10, 0x39, 0x2d, 0x0b, 0x28, 0x06, 0x2a, 0x25, 0x35, 0x06, 0x11, 0x0a, 0x28, 0x07, 0x5a, 0x22, 0x26, 0x5a, 0x41, 0x7b, 0x7c, 0x60, 0x76, 0x22, 0x1d, 0x32, 0x38, 0x46, 0x46, 0x46, 0x38, 0x38, 0x38, 0x38, 0x2b, 0x75, 0x7d, 0x7e, 0x55, 0x78, 0x7a, 0x57, 0x57, 0x57, 0x71, 0x20, 0x68, 0x55, 0x85, 0x7a, 0x57, 0x53, 0x71, 0x57, 0x5d, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x0c, 0x16, 0x0b, 0x30, 0x39, 0x18, 0x2a, 0x09, 0x05, 0x4e, 0x19, 0x25, 0x0c, 0x27, 0x11, 0x0a, 0x0a, 0x2f, 0x5a, 0x5a, 0x26, 0x5a, 0x7b, 0x7c, 0x7c, 0x61, 0x7f, 0x7f, 0x7f, 0x76, 0x22, 0x22, 0x0b, 0x2d, 0x0b, 0x2d, 0x2d, 0x33, 0x0b, 0x5f, 0x80, 0x7d, 0x5c, 0x81, 0x55, 0x59, 0x59, 0x73, 0x73, 0x54, 0x5c, 0x5c, 0x7e, 0x55, 0x59, 0x73, 0x7a, 0x71, 0x19, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x05, 0x05, 0x09, 0x25, 0x08, 0x07, 0x5e, 0x10, 0x22, 0x1c, 0x4a, 0x05, 0x09, 0x05, 0x15, 0x4d, 0x19, 0x19, 0x4d, 0x08, 0x12, 0x74, 0x0f, 0x6e, 0x5a, 0x26, 0x1d, 0x7b, 0x7b, 0x7c, 0x7c, 0x7c, 0x61, 0x5b, 0x82, 0x82, 0x80, 0x80, 0x82, 0x7f, 0x7f, 0x7f, 0x7f, 0x5b, 0x7f, 0x82, 0x80, 0x7d, 0x5c, 0x7e, 0x79, 0x54, 0x54, 0x7a, 0x73, 0x0f, 0x2a, 0x25, 0x19, 0x09, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x4d, 0x2a, 0x06, 0x74, 0x28, 0x22, 0x22, 0x2d, 0x2c, 0x0e, 0x05, 0x05, 0x05, 0x05, 0x05, 0x3b, 0x07, 0x19, 0x09, 0x25, 0x0c, 0x27, 0x12, 0x0f, 0x2f, 0x26, 0x26, 0x1d, 0x65, 0x65, 0x7c, 0x7c, 0x7b, 0x7c, 0x7b, 0x7b, 0x60, 0x5b, 0x7f, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x80, 0x80, 0x83, 0x83, 0x81, 0x7e, 0x59, 0x73, 0x73, 0x84, 0x5d, 0x25, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x19, 0x08, 0x12, 0x0a, 0x0f, 0x6e, 0x5a, 0x26, 0x22, 0x2c, 0x2c, 0x0b, 0x27, 0x05, 0x05, 0x05, 0x15, 0x1e, 0x1e, 0x6f, 0x0c, 0x09, 0x15, 0x0c, 0x20, 0x12, 0x0f, 0x6e, 0x5a, 0x26, 0x26, 0x26, 0x65, 0x65, 0x65, 0x65, 0x7b, 0x7c, 0x7b, 0x65, 0x7b, 0x61, 0x61, 0x60, 0x64, 0x64, 0x64, 0x5b, 0x5b, 0x5f, 0x63, 0x70, 0x63, 0x58, 0x5d, 0x2a, 0x15, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x4a, 0x4d, 0x27, 0x11, 0x0a, 0x28, 0x6e, 0x5a, 0x26, 0x65, 0x41, 0x1d, 0x2c, 0x2c, 0x5e, 0x29, 0x0e, 0x14, 0x17, 0x31, 0x6b, 0x30, 0x14, 0x25, 0x09, 0x15, 0x4d, 0x08, 0x74, 0x0a, 0x0f, 0x2f, 0x5a, 0x26, 0x26, 0x1d, 0x1d, 0x1d, 0x2b, 0x65, 0x1d, 0x41, 0x65, 0x65, 0x7b, 0x65, 0x65, 0x1d, 0x6e, 0x74, 0x5d, 0x1c, 0x25, 0x15, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x19, 0x4d, 0x08, 0x06, 0x0a, 0x2f, 0x6e, 0x2f, 0x6e, 0x26, 0x41, 0x7b, 0x65, 0x41, 0x37, 0x33, 0x30, 0x36, 0x36, 0x4c, 0x6b, 0x66, 0x30, 0x14, 0x35, 0x4a, 0x09, 0x15, 0x15, 0x25, 0x25, 0x0c, 0x1c, 0x08, 0x06, 0x5d, 0x5d, 0x5d, 0x0e, 0x06, 0x12, 0x06, 0x08, 0x1c, 0x2a, 0x0c, 0x19, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x09, 0x09, 0x19, 0x35, 0x08, 0x12, 0x28, 0x2f, 0x2f, 0x6e, 0x5a, 0x41, 0x7c, 0x3c, 0x3c, 0x2c, 0x41, 0x2d, 0x2d, 0x39, 0x30, 0x4c, 0x4c, 0x66, 0x66, 0x31, 0x24, 0x20, 0x4a, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x4a, 0x09, 0x4a, 0x09, 0x09, 0x05, 0x09, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x09, 0x15, 0x0c, 0x1c, 0x12, 0x28, 0x2f, 0x5a, 0x1d, 0x7c, 0x7b, 0x41, 0x7b, 0x3c, 0x7b, 0x3c, 0x41, 0x41, 0x5a, 0x16, 0x28, 0x14, 0x14, 0x14, 0x3b, 0x12, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x05, 0x4a, 0x09, 0x15, 0x1c, 0x12, 0x12, 0x0a, 0x0f, 0x2f, 0x07, 0x2f, 0x0a, 0x12, 0x27, 0x0c, 0x4d, 0x15, 0x09, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x09, 0x15, 0x15, 0x15, 0x19, 0x4e, 0x4e, 0x05, 0x4a, 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/sys/modules/syscons/logo/logo_saver.c b/sys/modules/syscons/logo/logo_saver.c new file mode 100644 index 0000000..2d2c660 --- /dev/null +++ b/sys/modules/syscons/logo/logo_saver.c @@ -0,0 +1,157 @@ +/*- + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/syslog.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static u_char *vid; +static int banksize, scrmode, bpsl, scrw, scrh; +static int blanked; + +#include "logo.c" + +static void +logo_blit(video_adapter_t *adp, int x, int y) +{ + int d, l, o, p; + + for (o = 0, p = y * bpsl + x; p > banksize; p -= banksize) + o += banksize; + set_origin(adp, o); + + for (d = 0; d < sizeof logo_img; d += logo_w) { + if (p + logo_w < banksize) { + bcopy(logo_img + d, vid + p, logo_w); + p += bpsl; + } else if (p < banksize) { + l = banksize - p; + bcopy(logo_img + d, vid + p, l); + set_origin(adp, (o += banksize)); + bcopy(logo_img + d + l, vid, logo_w - l); + p += bpsl - banksize; + } else { + p -= banksize; + set_origin(adp, (o += banksize)); + bcopy(logo_img + d, vid + p, logo_w); + p += bpsl; + } + } +} + +static void +logo_update(video_adapter_t *adp) +{ + static int xpos = 0, ypos = 0; + static int xinc = 1, yinc = 1; + + /* Turn when you hit the edge */ + if ((xpos + logo_w + xinc > scrw) || (xpos + xinc < 0)) + xinc = -xinc; + if ((ypos + logo_h + yinc > scrh) || (ypos + yinc < 0)) + yinc = -yinc; + xpos += xinc; + ypos += yinc; + + /* XXX Relies on margin around logo to erase trail */ + logo_blit(adp, xpos, ypos); +} + +static int +logo_saver(video_adapter_t *adp, int blank) +{ + int i, pl; + + if (blank) { + /* switch to graphics mode */ + if (blanked <= 0) { + pl = splhigh(); + set_video_mode(adp, scrmode); + load_palette(adp, logo_pal); +#if 0 /* XXX conflict */ + set_border(adp, 0); +#endif + blanked++; + vid = (u_char *)adp->va_window; + banksize = adp->va_window_size; + bpsl = adp->va_line_width; + splx(pl); + for (i = 0; i < bpsl*scrh; i += banksize) { + set_origin(adp, i); + bzero(vid, banksize); + } + } + logo_update(adp); + } else { + blanked = 0; + } + return 0; +} + +static int +logo_init(video_adapter_t *adp) +{ + video_info_t info; + + if (!get_mode_info(adp, M_VESA_CG800x600, &info)) { + scrmode = M_VESA_CG800x600; + } else if (!get_mode_info(adp, M_VGA_CG320, &info)) { + scrmode = M_VGA_CG320; + } else { + log(LOG_NOTICE, "logo_saver: no suitable graphics mode\n"); + return ENODEV; + } + + scrw = info.vi_width; + scrh = info.vi_height; + blanked = 0; + + return 0; +} + +static int +logo_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t logo_module = { + "logo_saver", logo_init, logo_term, logo_saver, NULL, +}; + +SAVER_MODULE(logo_saver, logo_module); diff --git a/sys/modules/syscons/rain/Makefile b/sys/modules/syscons/rain/Makefile new file mode 100644 index 0000000..ecc5ec3 --- /dev/null +++ b/sys/modules/syscons/rain/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +KMOD= rain_saver +SRCS= rain_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. +CWARNFLAGS= -Wall -pedantic + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/rain/rain_saver.c b/sys/modules/syscons/rain/rain_saver.c new file mode 100644 index 0000000..6d2ed39 --- /dev/null +++ b/sys/modules/syscons/rain/rain_saver.c @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/syslog.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/random.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static u_char *vid; + +#define SCRW 320 +#define SCRH 200 +#define MAX 63 + +static u_char rain_pal[768]; +static int blanked; + +static void +rain_update(video_adapter_t *adp) +{ + int i, t; + + t = rain_pal[(MAX*3+2)]; + for (i = (MAX*3+2); i > 5; i -= 3) + rain_pal[i] = rain_pal[i-3]; + rain_pal[5] = t; + load_palette(adp, rain_pal); +} + +static int +rain_saver(video_adapter_t *adp, int blank) +{ + int i, j, k, pl; + + if (blank) { + /* switch to graphics mode */ + if (blanked <= 0) { + pl = splhigh(); + set_video_mode(adp, M_VGA_CG320); + load_palette(adp, rain_pal); +#if 0 /* XXX conflict */ + set_border(adp, 0); +#endif + blanked++; + vid = (u_char *)adp->va_window; + splx(pl); + bzero(vid, SCRW*SCRH); + for (i = 0; i < SCRW; i += 2) + vid[i] = 1 + (random() % MAX); + for (j = 1, k = SCRW; j < SCRH; j++) + for (i = 0; i < SCRW; i += 2, k += 2) + vid[k] = (vid[k-SCRW] < MAX) ? 1 + vid[k-SCRW] : 1; + } + + /* update display */ + rain_update(adp); + + } else { + blanked = 0; + } + return 0; +} + +static int +rain_init(video_adapter_t *adp) +{ + video_info_t info; + int i; + + /* check that the console is capable of running in 320x200x256 */ + if (get_mode_info(adp, M_VGA_CG320, &info)) { + log(LOG_NOTICE, "rain_saver: the console does not support M_VGA_CG320\n"); + return ENODEV; + } + + /* intialize the palette */ + for (i = 3; i < (MAX+1)*3; i += 3) + rain_pal[i+2] = rain_pal[i-1] + 4; + + blanked = 0; + + return 0; +} + +static int +rain_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t rain_module = { + "rain_saver", rain_init, rain_term, rain_saver, NULL, +}; + +SAVER_MODULE(rain_saver, rain_module); diff --git a/sys/modules/syscons/snake/Makefile b/sys/modules/syscons/snake/Makefile new file mode 100644 index 0000000..6dab3ed --- /dev/null +++ b/sys/modules/syscons/snake/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= snake_saver +SRCS= snake_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/snake/snake_saver.c b/sys/modules/syscons/snake/snake_saver.c new file mode 100644 index 0000000..093e564 --- /dev/null +++ b/sys/modules/syscons/snake/snake_saver.c @@ -0,0 +1,148 @@ +/*- + * Copyright (c) 1995-1998 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/module.h> +#include <sys/malloc.h> +#include <sys/kernel.h> +#include <sys/sysctl.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/pc/display.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static char *message; +static int *messagep; +static int messagelen; +static int blanked; + +static int +snake_saver(video_adapter_t *adp, int blank) +{ + static int dirx, diry; + int f; + sc_softc_t *sc; + scr_stat *scp; + +/* XXX hack for minimal changes. */ +#define save message +#define savs messagep + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return EAGAIN; + scp = sc->cur_scp; + + if (blank) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + if (blanked <= 0) { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) & ~0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + set_border(scp, 0); + dirx = (scp->xpos ? 1 : -1); + diry = (scp->ypos ? + scp->xsize : -scp->xsize); + for (f=0; f< messagelen; f++) + savs[f] = scp->xpos + scp->ypos*scp->xsize; + sc_vtb_putc(&scp->scr, savs[0], sc->scr_map[*save], + (FG_LIGHTGREY | BG_BLACK) << 8); + blanked = 1; + } + if (blanked++ < 4) + return 0; + blanked = 1; + sc_vtb_putc(&scp->scr, savs[messagelen - 1], sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + for (f=messagelen-1; f > 0; f--) + savs[f] = savs[f-1]; + f = savs[0]; + if ((f % scp->xsize) == 0 || + (f % scp->xsize) == scp->xsize - 1 || + (random() % 50) == 0) + dirx = -dirx; + if ((f / scp->xsize) == 0 || + (f / scp->xsize) == scp->ysize - 1 || + (random() % 20) == 0) + diry = -diry; + savs[0] += dirx + diry; + for (f=messagelen-1; f>=0; f--) + sc_vtb_putc(&scp->scr, savs[f], sc->scr_map[save[f]], + (FG_LIGHTGREY | BG_BLACK) << 8); + } + else { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) | 0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + blanked = 0; + } + return 0; +} + +static int +snake_init(video_adapter_t *adp) +{ + messagelen = strlen(ostype) + 1 + strlen(osrelease); + message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK); + sprintf(message, "%s %s", ostype, osrelease); + messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK); + return 0; +} + +static int +snake_term(video_adapter_t *adp) +{ + free(message, M_DEVBUF); + free(messagep, M_DEVBUF); + return 0; +} + +static scrn_saver_t snake_module = { + "snake_saver", snake_init, snake_term, snake_saver, NULL, +}; + +SAVER_MODULE(snake_saver, snake_module); diff --git a/sys/modules/syscons/star/Makefile b/sys/modules/syscons/star/Makefile new file mode 100644 index 0000000..7ae11d7 --- /dev/null +++ b/sys/modules/syscons/star/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +KMOD= star_saver +SRCS= star_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/star/star_saver.c b/sys/modules/syscons/star/star_saver.c new file mode 100644 index 0000000..645e4fd --- /dev/null +++ b/sys/modules/syscons/star/star_saver.c @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 1995-1998 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/pc/display.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +#define NUM_STARS 50 + +static int blanked; + +/* + * Alternate saver that got its inspiration from a well known utility + * package for an inferior^H^H^H^H^H^Hfamous OS. + */ +static int +star_saver(video_adapter_t *adp, int blank) +{ + sc_softc_t *sc; + scr_stat *scp; + int cell, i; + char pattern[] = {"...........++++*** "}; +#ifndef PC98 + char colors[] = {FG_DARKGREY, FG_LIGHTGREY, + FG_WHITE, FG_LIGHTCYAN}; +#else + char colors[] = {FG_BLUE, FG_LIGHTGREY, + FG_LIGHTGREY, FG_CYAN}; +#endif /* PC98 */ + static u_short stars[NUM_STARS][2]; + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return EAGAIN; + scp = sc->cur_scp; + + if (blank) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + if (!blanked) { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) & ~0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + /* clear the screen and set the border color */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + set_border(scp, 0); + blanked = TRUE; + for(i=0; i<NUM_STARS; i++) { + stars[i][0] = + random() % (scp->xsize*scp->ysize); + stars[i][1] = 0; + } + } + cell = random() % NUM_STARS; + sc_vtb_putc(&scp->scr, stars[cell][0], + sc->scr_map[pattern[stars[cell][1]]], + colors[random()%sizeof(colors)] << 8); + if ((stars[cell][1]+=(random()%4)) >= sizeof(pattern)-1) { + stars[cell][0] = random() % (scp->xsize*scp->ysize); + stars[cell][1] = 0; + } + } + else { +#ifdef PC98 + if (epson_machine_id == 0x20) { + outb(0x43f, 0x42); + outb(0x0c17, inb(0xc17) | 0x08); + outb(0x43f, 0x40); + } +#endif /* PC98 */ + blanked = FALSE; + } + return 0; +} + +static int +star_init(video_adapter_t *adp) +{ + blanked = FALSE; + return 0; +} + +static int +star_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t star_module = { + "star_saver", star_init, star_term, star_saver, NULL, +}; + +SAVER_MODULE(star_saver, star_module); diff --git a/sys/modules/syscons/warp/Makefile b/sys/modules/syscons/warp/Makefile new file mode 100644 index 0000000..45a3af9 --- /dev/null +++ b/sys/modules/syscons/warp/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +KMOD= warp_saver +SRCS= warp_saver.c + +NOMAN= +CFLAGS+= -I${.CURDIR}/.. +CWARNFLAGS= -Wall -pedantic + +.include <bsd.kmod.mk> diff --git a/sys/modules/syscons/warp/warp_saver.c b/sys/modules/syscons/warp/warp_saver.c new file mode 100644 index 0000000..7e51407 --- /dev/null +++ b/sys/modules/syscons/warp/warp_saver.c @@ -0,0 +1,139 @@ +/*- + * Copyright (c) 1998 Dag-Erling Coïdan Smørgrav + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * in this position and unchanged. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 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 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/syslog.h> +#include <sys/consio.h> +#include <sys/fbio.h> + +#include <machine/random.h> + +#include <dev/fb/fbreg.h> +#include <dev/fb/splashreg.h> +#include <dev/syscons/syscons.h> + +static u_char *vid; +static int blanked; + +#define SCRW 320 +#define SCRH 200 +#define SPP 15 +#define STARS (SPP*(1+2+4+8)) + +static int star[STARS]; +static u_char warp_pal[768] = { + 0x00, 0x00, 0x00, + 0x66, 0x66, 0x66, + 0x99, 0x99, 0x99, + 0xcc, 0xcc, 0xcc, + 0xff, 0xff, 0xff + /* the rest is zero-filled by the compiler */ +}; + +static void +warp_update(void) +{ + int i, j, k, n; + + for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2) + for (j = 0; j < n; j++, k++) { + vid[star[k]] = 0; + star[k] += i; + if (star[k] > SCRW*SCRH) + star[k] -= SCRW*SCRH; + vid[star[k]] = i; + } +} + +static int +warp_saver(video_adapter_t *adp, int blank) +{ + int pl; + + if (blank) { + /* switch to graphics mode */ + if (blanked <= 0) { + pl = splhigh(); + set_video_mode(adp, M_VGA_CG320); + load_palette(adp, warp_pal); +#if 0 /* XXX conflict */ + set_border(adp, 0); +#endif + blanked++; + vid = (u_char *)adp->va_window; + splx(pl); + bzero(vid, SCRW*SCRH); + } + + /* update display */ + warp_update(); + + } else { + blanked = 0; + } + return 0; +} + +static int +warp_init(video_adapter_t *adp) +{ + video_info_t info; + int i; + + /* check that the console is capable of running in 320x200x256 */ + if (get_mode_info(adp, M_VGA_CG320, &info)) { + log(LOG_NOTICE, "warp_saver: the console does not support M_VGA_CG320\n"); + return ENODEV; + } + + /* randomize the star field */ + for (i = 0; i < STARS; i++) { + star[i] = random() % (SCRW*SCRH); + } + + blanked = 0; + + return 0; +} + +static int +warp_term(video_adapter_t *adp) +{ + return 0; +} + +static scrn_saver_t warp_module = { + "warp_saver", warp_init, warp_term, warp_saver, NULL, +}; + +SAVER_MODULE(warp_saver, warp_module); diff --git a/sys/modules/ti/Makefile b/sys/modules/ti/Makefile new file mode 100644 index 0000000..b91ae2a --- /dev/null +++ b/sys/modules/ti/Makefile @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_ti +SRCS = if_ti.c opt_bdg.h vlan.h device_if.h bus_if.h pci_if.h +CLEANFILES = vlan.h +CFLAGS += ${DEBUG_FLAGS} + +vlan.h: + touch vlan.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/tl/Makefile b/sys/modules/tl/Makefile new file mode 100644 index 0000000..810ed6f --- /dev/null +++ b/sys/modules/tl/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_tl +SRCS = if_tl.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> diff --git a/sys/modules/ugen/Makefile b/sys/modules/ugen/Makefile new file mode 100644 index 0000000..180f6c7 --- /dev/null +++ b/sys/modules/ugen/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = ugen +SRCS = bus_if.h device_if.h vnode_if.h opt_usb.h ugen.c +NOMAN = + +.include <bsd.kmod.mk> diff --git a/sys/modules/uhid/Makefile b/sys/modules/uhid/Makefile new file mode 100644 index 0000000..4f8af0b --- /dev/null +++ b/sys/modules/uhid/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = uhid +SRCS = bus_if.h device_if.h vnode_if.h opt_usb.h uhid.c +NOMAN = + +.include <bsd.kmod.mk> diff --git a/sys/modules/ukbd/Makefile b/sys/modules/ukbd/Makefile new file mode 100644 index 0000000..f9ccbe1 --- /dev/null +++ b/sys/modules/ukbd/Makefile @@ -0,0 +1,19 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = ukbd +SRCS = bus_if.h device_if.h vnode_if.h \ + opt_usb.h ukbd.h opt_kbd.h \ + ukbd.c +NOMAN = +CLEANFILES = ukbd.h opt_kbd.h + +ukbd.h: + echo > ukbd.h + +opt_kbd.h: + echo '#define KBD_INSTALL_CDEV 1' > opt_kbd.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/ulpt/Makefile b/sys/modules/ulpt/Makefile new file mode 100644 index 0000000..873005a --- /dev/null +++ b/sys/modules/ulpt/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = ulpt +SRCS = bus_if.h device_if.h vnode_if.h opt_usb.h ulpt.c +NOMAN = + +.include <bsd.kmod.mk> diff --git a/sys/modules/umapfs/Makefile b/sys/modules/umapfs/Makefile new file mode 100644 index 0000000..488590f --- /dev/null +++ b/sys/modules/umapfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/umapfs +KMOD= umap +SRCS= vnode_if.h \ + umap_subr.c umap_vfsops.c umap_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/umass/Makefile b/sys/modules/umass/Makefile new file mode 100644 index 0000000..ad9af06 --- /dev/null +++ b/sys/modules/umass/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = umass +SRCS = bus_if.h device_if.h \ + opt_usb.h opt_cam.h opt_scsi.h \ + umass.c +NOMAN = + +opt_scsi.h: + echo '#define SCSI_DELAY 15000' > opt_scsi.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/umodem/Makefile b/sys/modules/umodem/Makefile new file mode 100644 index 0000000..9b210c1 --- /dev/null +++ b/sys/modules/umodem/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = umodem +SRCS = bus_if.h device_if.h vnode_if.h opt_usb.h umodem.c +NOMAN = + +.include <bsd.kmod.mk> diff --git a/sys/modules/ums/Makefile b/sys/modules/ums/Makefile new file mode 100644 index 0000000..a18061e --- /dev/null +++ b/sys/modules/ums/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org + +.PATH: ${.CURDIR}/../../dev/usb +KMOD = ums +SRCS = bus_if.h device_if.h vnode_if.h opt_usb.h ums.c +NOMAN = + +.include <bsd.kmod.mk> diff --git a/sys/modules/union/Makefile b/sys/modules/union/Makefile new file mode 100644 index 0000000..6825a63 --- /dev/null +++ b/sys/modules/union/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/union +KMOD= union +SRCS= vnode_if.h \ + union_subr.c union_vfsops.c union_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/unionfs/Makefile b/sys/modules/unionfs/Makefile new file mode 100644 index 0000000..6825a63 --- /dev/null +++ b/sys/modules/unionfs/Makefile @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../miscfs/union +KMOD= union +SRCS= vnode_if.h \ + union_subr.c union_vfsops.c union_vnops.c +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/usb/Makefile b/sys/modules/usb/Makefile new file mode 100644 index 0000000..edd1cba --- /dev/null +++ b/sys/modules/usb/Makefile @@ -0,0 +1,38 @@ +# $FreeBSD$ + +MAINTAINER = n_hibma@freebsd.org +S = ${.CURDIR}/../.. + +.PATH: $S/dev/usb $S/pci +KMOD = usb +SRCS = bus_if.h device_if.h usb_if.h usb_if.c \ + vnode_if.h \ + opt_usb.h \ + hid.c hid.h usbhid.h \ + uhub.c \ + usb.c usb.h \ + usb_mem.h \ + usb_port.h \ + usb_quirks.c usb_quirks.h \ + usb_subr.c \ + usbdevs.h usbdevs_data.h \ + usbdi.c usbdi.h usbdivar.h \ + usbdi_util.c usbdi_util.h + +SRCS += uhci_pci.c uhci.c uhcireg.h uhcivar.h +SRCS += ohci_pci.c ohci.c ohcireg.h ohcivar.h +SRCS += opt_bus.h pci_if.h + +NOMAN = +CFLAGS += -g + +opt_usb.h: + echo > opt_usb.h +# echo "#define USB_DEBUG 1" >> opt_usb.h +# echo "#define UHCI_DEBUG 1" >> opt_usb.h +# echo "#define OHCI_DEBUG 1" >> opt_usb.h + +usb_devs.h: + perl $S/kern/makedevlist.pl -h $S/dev/usb/usb.devs + +.include <bsd.kmod.mk> diff --git a/sys/modules/vesa/Makefile b/sys/modules/vesa/Makefile new file mode 100644 index 0000000..16aa8d0 --- /dev/null +++ b/sys/modules/vesa/Makefile @@ -0,0 +1,19 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/syscons ${.CURDIR}/../../i386/isa +KMOD = vesa +SRCS = vesa.c scvesactl.c sc.h vga.h opt_syscons.h opt_vga.h \ + opt_vesa.h opt_fb.h +NOMAN = +CLEANFILES = sc.h vga.h + +sc.h: + echo "#define NSC 1" > sc.h + +vga.h: + echo "#define NVGA 1" > vga.h + +opt_vesa.h: + echo "#define VESA 1" > opt_vesa.h + +.include <bsd.kmod.mk> diff --git a/sys/modules/vinum/.gdbinit.crash b/sys/modules/vinum/.gdbinit.crash new file mode 100644 index 0000000..f3e6436 --- /dev/null +++ b/sys/modules/vinum/.gdbinit.crash @@ -0,0 +1,4 @@ +source .gdbinit.kernel +source .gdbinit.vinum.paths +source .gdbinit.vinum +asf diff --git a/sys/modules/vinum/.gdbinit.kernel b/sys/modules/vinum/.gdbinit.kernel new file mode 100644 index 0000000..c814d7f --- /dev/null +++ b/sys/modules/vinum/.gdbinit.kernel @@ -0,0 +1,645 @@ +set remotebaud 38400 +set remotetimeout 1 +set complaints 1 +set print pretty +define xi +x/10i $eip +end +define xs +x/12x $esp +end +define xb +x/12x $ebp +end +define z +ni +x/1i $eip +end +define zs +si +x/1i $eip +end +define xp +printf " esp: " +output/x $esp +echo ( +output (((int)$ebp)-(int)$esp)/4-4 +printf " words on stack)\n ebp: " +output/x $ebp +printf "\n eip: " +x/1i $eip +printf "Saved ebp: " +output/x *(int*)$ebp +printf " (maximum of " +output ((*(int*)$ebp)-(int)$ebp)/4-4 +printf " parameters possible)\nSaved eip: " +x/1i *(int*)($ebp+4) +printf "\nParm 1 at " +output/x (int) ($ebp+8) +printf ": " +output (char*) *(int*)($ebp+8) +printf "\nParm 2 at " +output/x (int) ($ebp+12) +printf ": " +output (char*) *(int*)($ebp+12) +printf "\nParm 3 at " +output/x (int) ($ebp+16) +printf ": " +output (char*) *(int*)($ebp+16) +printf "\nParm 4 at " +output/x (int) ($ebp+20) +printf ": " +output (char*) *(int*)($ebp+20) +echo \n +end +document xp +Show the register contents and the first four parameter +words of the current frame. +end +define xxp +printf " esp: " +output/x $esp +printf "\n ebp: " +output/x $ebp +printf "\n eip: " +x/1i $eip +printf "Saved ebp: " +output/x *(int*)$ebp +printf " (maximum of " +output ((*(int*)$ebp)-(int)$ebp)/4-4 +printf " parameters possible)\nSaved eip: " +x/1i *(int*)($ebp+4) +printf "\nParm 1 at " +output/x (int) ($ebp+8) +printf ": " +output (char*) *(int*)($ebp+8) +printf "\nParm 2 at " +output/x (int) ($ebp+12) +printf ": " +output (char*) *(int*)($ebp+12) +printf "\nParm 3 at " +output/x (int) ($ebp+16) +printf ": " +output (char*) *(int*)($ebp+16) +printf "\nParm 4 at " +output/x (int) ($ebp+20) +printf ": " +output (char*) *(int*)($ebp+20) +printf "\nParm 5 at " +output/x (int) ($ebp+24) +printf ": " +output (char*) *(int*)($ebp+24) +printf "\nParm 6 at " +output/x (int) ($ebp+28) +printf ": " +output (char*) *(int*)($ebp+28) +printf "\nParm 7 at " +output/x (int) ($ebp+32) +printf ": " +output (char*) *(int*)($ebp+32) +printf "\nParm 8 at " +output/x (int) ($ebp+36) +printf ": " +output (char*) *(int*)($ebp+36) +printf "\nParm 9 at " +output/x (int) ($ebp+40) +printf ": " +output (char*) *(int*)($ebp+40) +printf "\nParm 10 at " +output/x (int) ($ebp+44) +printf ": " +output (char*) *(int*)($ebp+44) +echo \n +end +document xxp +Show the register contents and the first ten parameter +words of the current frame. +end +define xp0 +x/12x *(int*)$esp +p *(int*)$esp +p (char*)*$esp +end +define xp1 +x/12x *(int*)($ebp+4) +p *(int*)($ebp+4) +p (char**)($ebp+4) +end +define xp2 +x/12x *(int*)($ebp+8) +p *(int*)($ebp+8) +p *(char**)($ebp+8) +end +define xp3 +x/12x *(int*)($ebp+12) +p *(int*)($ebp+12) +p (char**)($ebp+12) +end +define xp4 +x/12x *(int*)($ebp+16) +p *(int*)($ebp+16) +p (char**)($ebp+16) +end +document xp0 +Show the first parameter of current stack frame in various formats +end +document xp1 +Show the second parameter of current stack frame in various formats +end +document xp2 +Show the third parameter of current stack frame in various formats +end +document xp3 +Show the fourth parameter of current stack frame in various formats +end +document xp4 +Show the fifth parameter of current stack frame in various formats +end +define f0 +f 0 +xp +end +define f1 +f 1 +xp +end +define f2 +f 2 +xp +end +define f3 +f 3 +xp +end +define f4 +f 4 +xp +end +define f5 +f 5 +xp +end +document f0 +Select stack frame 0 and show assembler-level details +end +document f1 +Select stack frame 1 and show assembler-level details +end +document f2 +Select stack frame 2 and show assembler-level details +end +document f3 +Select stack frame 3 and show assembler-level details +end +document f4 +Select stack frame 4 and show assembler-level details +end +document f5 +Select stack frame 5 and show assembler-level details +end +document z +Single step 1 instruction (over calls) and show next instruction. +end +document zs +Single step 1 instruction (through calls) and show next instruction. +end +document xi +List the next 10 instructions from the current IP value +end +document xs +Show the last 12 words on stack in hex +end +document xb +Show 12 words starting at current BP value in hex +end +define tr +target remote /dev/cuaa1 +end +document tr +Attach to a remote kernel via /dev/cuaa0 +end +set output-radix 16 +define pname +p (char *)curproc->p_comm +end +document pname +Print the command name of the current process +end +define bpp +set $bp = (struct buf *) $arg0 + if $bp->b_dev + printf " Buffer at 0x%x: dev 0x%x data 0x%x bcount 0x%x blkno 0x%x resid 0x%x\n", \ + $bp, \ + $bp->b_dev->si_udev, \ + $bp->b_data, \ + $bp->b_bcount, \ + $bp->b_blkno, \ + $bp->b_resid + else + printf " Buffer at 0x%x: dev (none) data 0x%x bcount 0x%x blkno 0x%x resid 0x%x\n", \ + $bp, \ + $bp->b_data, \ + $bp->b_bcount, \ + $bp->b_blkno, \ + $bp->b_resid + end + printf " flags 0x%x: ", $bp->b_flags + if $bp->b_flags & 0x10 + printf "busy " + end + if $bp->b_flags & 0x40 + printf "call " + end + if $bp->b_flags & 0x200 + printf "done " + end + if $bp->b_flags & 0x800 + printf "error " + end + if $bp->b_flags & 0x40000 + printf "phys " + end + if $bp->b_flags & 0x100000 + printf "read " + end + printf "\n" +end +define bpl +set $bp = (struct buf *) $arg0 +printf "b_proc: " +output $bp->b_proc +printf "\nb_flags: " +output $bp->b_flags +printf "\nb_qindex: " +output $bp->b_qindex +printf "\nb_usecount: " +output $bp->b_usecount +printf "\nb_error: " +output $bp->b_error +printf "\nb_bufsize: " +output $bp->b_bufsize +printf "\nb_bcount: " +output $bp->b_bcount +printf "\nb_resid: " +output $bp->b_resid +printf "\nb_dev: " +output $bp->b_dev +printf "\nb_data: " +output $bp->b_data +printf "\nb_kvasize: " +output $bp->b_kvasize +printf "\nb_lblkno: " +output $bp->b_lblkno +printf "\nb_blkno: " +output $bp->b_blkno +printf "\nb_iodone: " +output $bp->b_iodone +printf "\nb_vp: " +output $bp->b_vp +printf "\nb_dirtyoff: " +output $bp->b_dirtyoff +printf "\nb_dirtyend: " +output $bp->b_dirtyend +printf "\nb_generation: " +output $bp->b_generation +printf "\nb_rcred: " +output $bp->b_rcred +printf "\nb_wcred: " +output $bp->b_wcred +printf "\nb_validoff: " +output $bp->b_validoff +printf "\nb_validend: " +output $bp->b_validend +printf "\nb_pblkno: " +output $bp->b_pblkno +printf "\nb_saveaddr: " +output $bp->b_saveaddr +printf "\nb_savekva: " +output $bp->b_savekva +printf "\nb_driver1: " +output $bp->b_driver1 +printf "\nb_driver2: " +output $bp->b_driver2 +printf "\nb_spc: " +output $bp->b_spc +printf "\nb_npages: " +output $bp->b_npages +printf "\n" +end +define bp +bpp bp +end +define bpd + printf "Buffer data:\n%s", (char *) bp->b_data +end +document bpd +Show the contents (char*) of bp->data in the current frame. +end +document bp +Show information about the buffer header pointed to by the +variable bp in the current frame. +end +document bpp +Show summary information about the buffer header (struct bp) pointed +at by the parameter. +end +document bpl +Show detailled information about the buffer header (struct bp) pointed +at by the parameter. +end +document bpl +Show detailled information about the buffer header (struct bp) pointed +at by the local variable bp. +end +define bx +printf "\n b_vnbufs " +output/x bp->b_vnbufs +printf "\n b_freelist " +output/x bp->b_freelist +printf "\n b_act " +output/x bp->b_act +printf "\n b_flags " +output/x bp->b_flags +printf "\n b_qindex " +output/x bp->b_qindex +printf "\n b_usecount " +output/x bp->b_usecount +printf "\n b_error " +output/x bp->b_error +printf "\n b_bufsize " +output/x bp->b_bufsize +printf "\n b_bcount " +output/x bp->b_bcount +printf "\n b_resid " +output/x bp->b_resid +printf "\n b_dev " +output/x bp->b_dev +printf "\n b_data " +output/x bp->b_data +printf "\n b_kvasize " +output/x bp->b_kvasize +printf "\n b_blkno " +output/x bp->b_blkno +printf "\n b_iodone_chain " +output/x bp->b_iodone_chain +printf "\n b_vp " +output/x bp->b_vp +printf "\n b_dirtyoff " +output/x bp->b_dirtyoff +printf "\n b_validoff " +output/x bp->b_validoff +echo \n +end +define ddb +set boothowto=0x80000000 +s +end +document ddb +Switch back to ddb. +end +define ps + set $nproc = nprocs + set $aproc = allproc.lh_first + set $proc = allproc.lh_first + printf " pid proc addr uid ppid pgrp flag stat comm wchan\n" + while (--$nproc >= 0) + set $pptr = $proc.p_pptr + if ($pptr == 0) + set $pptr = $proc + end + if ($proc.p_stat) + printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + $proc.p_pid, $aproc, \ + $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ + &$proc.p_comm[0] + if ($proc.p_wchan) + if ($proc.p_wmesg) + printf "%s ", $proc.p_wmesg + end + printf "%x", $proc.p_wchan + end + printf "\n" + end + set $aproc = $proc.p_list.le_next + if ($aproc == 0 && $nproc > 0) + set $aproc = zombproc + end + set $proc = $aproc + end +end +document ps +"ps" -- when kernel debugging, type out a ps-like listing of active processes. +end +define pcb + set $nproc = nprocs + set $aproc = allproc.lh_first + set $proc = allproc.lh_first + while (--$nproc >= 0) + set $pptr = $proc.p_pptr + if ($proc->p_pid == $arg0) + set $pcba = $pptr->p_addr->u_pcb + printf "ip: %08x sp: %08x bp: %08x bx: %08x\n", $pcba->pcb_eip, $pcba->pcb_esp, $pcba->pcb_ebp, $pcba->pcb_ebx + x/1i $pcba->pcb_eip + set $nproc = 0 + end + set $aproc = $proc.p_list.le_next + if ($aproc == 0 && $nproc > 0) + set $aproc = zombproc + end + set $proc = $aproc + end +end +document pcb +Show some pcb contents of process whose pid is specified. +end +define btr +set $frame = $arg0 +set $fno = 0 +while (*(int *) $frame > 0xc0000000) + set $myebp = *(int *) $frame + set $myeip = *(int *) ($frame + 4) + printf " frame %d at %p: ebp %8x, eip ", $fno, $frame, $myebp + x/1i $myeip + set $frame = $myebp + set $fno = $fno + 1 +end +end +document btr +Show a backtrace from the ebp address specified. This can be used to +get a backtrace from any stack resident in memory. +end +define btp + set $nproc = nprocs + set $aproc = allproc.lh_first + set $proc = allproc.lh_first + while (--$nproc >= 0) + if ($proc->p_pid == $arg0) + btr $proc->p_addr->u_pcb->pcb_ebp + set $nproc = 0 + else + set $aproc = $proc.p_list.le_next + if ($aproc == 0 && $nproc > 0) + set $aproc = zombproc + end + set $proc = $aproc + end + end +end +document btp +Show a backtrace for the process whose pid is specified as a parameter. +end +define btpa + set $nproc = nprocs + set $aproc = allproc.lh_first + set $proc = allproc.lh_first + printf " pid proc addr uid ppid pgrp flag stat comm wchan\n" + while (--$nproc >= 0) + set $pptr = $proc.p_pptr + if ($pptr == 0) + set $pptr = $proc + end + if ($proc.p_stat) + printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + $proc.p_pid, $aproc, \ + $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ + &$proc.p_comm[0] + if ($proc.p_wchan) + if ($proc.p_wmesg) + printf "%s ", $proc.p_wmesg + end + printf "%x", $proc.p_wchan + end + printf "\n" + if ($proc->p_flag & 4) + btr $proc->p_addr->u_pcb->pcb_ebp + else + echo (not loaded)\n + end + end + set $aproc = $proc.p_list.le_next + if ($aproc == 0 && $nproc > 0) + set $aproc = zombproc + end + set $proc = $aproc + end +end +document btpa +Show backtraces for all processes in the system. +end +define btpp + if ($myvectorproc->p_flag & 4) + btr $myvectorproc->p_addr->u_pcb->pcb_ebp + else + echo (not loaded)\n + end +end +document btpp +Show a backtrace for the process previously selected with 'defproc'. +end +define defproc + set $nproc = nprocs + set $aproc = allproc.lh_first + set $proc = allproc.lh_first + while (--$nproc >= 0) + if ($proc->p_pid == $arg0) + set $pptr = $proc.p_pptr + if ($pptr == 0) + set $pptr = $proc + end + set $myvectorproc = $proc + if ($proc.p_stat) + printf "%5d %08x %08x %4d %5d %5d %06x %d %-10s ", \ + $proc.p_pid, $aproc, \ + $proc.p_addr, $proc.p_cred->p_ruid, $pptr->p_pid, \ + $proc.p_pgrp->pg_id, $proc.p_flag, $proc.p_stat, \ + &$proc.p_comm[0] + if ($proc.p_wchan) + if ($proc.p_wmesg) + printf "%s ", $proc.p_wmesg + end + printf "%x", $proc.p_wchan + end + printf "\n" + end + btpp + set $nproc = 0 + else + set $proc = $proc.p_list.le_next + end + end +end +document defproc +Specify a process for btpp and fr commands. +end +define fr +set $fno = 0 +set $searching = 1 +if ($myvectorproc->p_flag & 4) + set $frame = $myvectorproc->p_addr->u_pcb->pcb_ebp + while (($searching == 1) && (*(int *) $frame > 0xc0000000)) + set $myebp = *(int *) $frame + set $myeip = *(int *) ($frame + 4) + if ($fno == $arg0) + printf " frame %d at %p: ebp %8x, eip ", $fno, $frame, $myebp + x/1i $myeip + printf "Called from %8x, stack frame at %8x\n", *(int *) ($myebp+4), *(int *) $myebp + printf "last 20 local variables:\n" + x/20x ($myebp-80) + printf "call parameters:\n" + x/8x ($myebp+8) + set $searching = 0 + else + set $frame = $myebp + set $fno = $fno + 1 + end + end + if ($searching == 1) + echo frame not found\n + end +else + printf "process %d is not loaded in memory\n", $myvectorproc->p_pid +end +end +document fr +Show the frame of the stack of the process previously selected with 'defproc'. +end +set height 70 +set width 120 +define vdev +if (vp->v_type == VBLK) + p *vp->v_un.vu_spec.vu_specinfo + printf "numoutput: %d\n", vp->v_numoutput +else + echo "Not a block device" +end +end +document vdev +Show some information of the vnode pointed to by the local variable vp. +end +define y +echo Check your .gdbinit, it contains a y command\n +end +define kldstat + set $file = files.tqh_first + printf "Id Refs Address Size Name\n" + while ($file != 0) + printf "%2d %4d 0x%8x %8x %s\n", \ + $file->id, \ + $file->refs, \ + $file->address, \ + $file->size, \ + $file->filename + set $file = $file->link.tqe_next + end +end +document kldstat +Equivalent of the kldstat(9) command, without options. +end +define msgbuf +printf "%s", msgbufp->msg_ptr +end +document msgbuf +Print the system message buffer (dmesg). This can take a long time due to the time it takes to transmit the data across a serial line. +end diff --git a/sys/modules/vinum/.gdbinit.serial b/sys/modules/vinum/.gdbinit.serial new file mode 100644 index 0000000..d302f8a --- /dev/null +++ b/sys/modules/vinum/.gdbinit.serial @@ -0,0 +1,5 @@ +source .gdbinit.kernel +source .gdbinit.vinum.paths +source .gdbinit.vinum +tr +asf diff --git a/sys/modules/vinum/.gdbinit.vinum b/sys/modules/vinum/.gdbinit.vinum new file mode 100644 index 0000000..d494be3 --- /dev/null +++ b/sys/modules/vinum/.gdbinit.vinum @@ -0,0 +1,299 @@ +define rq +rqq rq +end +document rq +Show information about the request pointed to by the variable rq in the current frame. +end +define rqq +set $rq = (struct request *) $arg0 +printf "Request: \n" +output/x *$rq +printf "\n" +bpp $rq->bp +set $rqg = $rq->rqg +while ($rqg != 0) + printf "\nRequest group at %x:\n", $rqg + output/x *$rqg + printf "\n" + set $rqno = 0 + while ($rqno < $rqg->count) + printf "rqg->rqe [%d]: ", $rqno + rrqe &$rqg->rqe[$rqno] + set $rqno = $rqno + 1 + end + set $rqg = $rqg->next + end +end +document rqq +Show information about the request (struct rq) pointed at by the parameter +end +define rqe +rrqe rqe +end +define rrqe +set $rqe = (struct rqelement *) $arg0 + printf "sdoffset 0x%x, useroffset 0x%x, dataoffset 0x%x, datalen 0x%x, groupoffset 0x%x, grouplen 0x%x, buflen 0x%x\n", \ + $rqe->sdoffset, \ + $rqe->useroffset, \ + $rqe->dataoffset, \ + $rqe->datalen, \ + $rqe->groupoffset, \ + $rqe->grouplen, \ + $rqe->buflen + printf " Flags 0x%x, Subdisk %d Drive %d\n", \ + $rqe->flags, \ + $rqe->sdno, \ + $rqe->driveno + bpp &$rqe->b +end +document rqe +Show information about the request element pointed to by the variable rqe in the current frame. +end +document rrqe +Show information about the request element (struct rqe) pointed at by the parameter. +end +define rqq0 +printf "rq->prq [0].rqe[0].sdno: " +output/x rq->prq[0].rqe[0].sdno +printf "\nBuffer: device: " +output/x rq->prq[0].rqe[0].b.b_dev +printf " data: " +output/x rq->prq[0].rqe[0].b.b_data +printf " length: " +output/x rq->prq[0].rqe[0].b.b_bcount +printf " drive offset: " +output/x rq->prq[0].rqe[0].b.b_blkno +printf " subdisk offset: " +output/x rq->prq[0].rqe[0].sdoffset +printf "\nFlags: " +if (rq->prq[0].rqe[0].b.b_flags & 0x10) +printf "busy " +end +if (rq->prq[0].rqe[0].b.b_flags & 0x200) +printf "done " +end +if (rq->prq[0].rqe[0].b.b_flags & 0x800) +printf "error " +end +if (rq->prq[0].rqe[0].b.b_flags & 0x100000) +printf "read " +end +output/x rq->prq[0].rqe[0].b.b_flags +printf "\nrq->prq [0].rqe[1].sdno: " +output/x rq->prq[0].rqe[1].sdno +printf "\nBuffer: device: " +output/x rq->prq[0].rqe[1].b.b_dev +printf " data: " +output/x rq->prq[0].rqe[1].b.b_data +printf " length: " +output/x rq->prq[0].rqe[1].b.b_bcount +printf " drive offset: " +output/x rq->prq[0].rqe[1].b.b_blkno +printf " subdisk offset: " +output/x rq->prq[0].rqe[1].sdoffset +printf "\nFlags: " +output/x rq->prq[0].rqe[1].b.b_flags +echo \n +end +define rqq1 +printf "\nrq->prq [1].rqe[0].sdno: " +output/x rq->prq[1].rqe[0].sdno +printf "\nBuffer: device: " +output/x rq->prq[1].rqe[0].b.b_dev +printf " data: " +output/x rq->prq[1].rqe[0].b.b_data +printf " length: " +output/x rq->prq[1].rqe[0].b.b_bcount +printf " drive offset: " +output/x rq->prq[1].rqe[0].b.b_blkno +printf " subdisk offset: " +output/x rq->prq[1].rqe[0].sdoffset +printf "\nFlags: " +output/x rq->prq[1].rqe[0].b.b_flags +printf "\nrq->prq [1].rqe[1].sdno: " +output/x rq->prq[1].rqe[1].sdno +printf "\nBuffer: device: " +output/x rq->prq[1].rqe[1].b.b_dev +printf " data: 0x%x length 0x%x drive offset 0x%x sd offset 0x%x\n" rq->prq[1].rqe[1].b.b_data, + rq->prq[1].rqe[1].b.b_bcount, + rq->prq[1].rqe[1].b.b_blkno, + rq->prq[1].rqe[1].sdoffset +printf "\nFlags: " +output/x rq->prq[1].rqe[1].b.b_flags +echo \n +end +define xy +bpp +echo stripeoffset +p stripeoffset +echo stripebase +p stripebase +echo sdno +p sdno +echo sdoffset +p sdoffset +echo rqe->sectors +p rqe->sectors +echo rqe->sdoffset +p rqe->sdoffset +end +# kernel equivalent of 'info -V' +define rqi + set $rqipe = rqip + set $rqip = $rqipe + 1 + set $rqend = rqinfo + 128 + if ($rqip == $rqend) + set $rqip = rqinfo + end + set $done = 0 + while ($done == 0) + if ($rqip->bp != 0) + printf "%X:\t%d.%06d\tUBP: %x\t", $rqip, $rqip->timestamp.tv_sec, $rqip->timestamp.tv_usec, $rqip->bp + p $rqip->type + printf " user " + bpp $rqip->bp + if ($rqip->type < loginfo_rqe) + printf " copied" + bpp &$rqip->info + else + rrqe &$rqip->info + end + end + set $rqip = $rqip + 1 + if ($rqip == $rqipe) + set $done = 1 + end + if ($rqip == $rqend) + set $rqip = rqinfo + end + end +end +define rqinfo + set $rqipe = rqip + set $rqip = $rqipe + 1 + set $rqend = rqinfo + 128 + if ($rqip == $rqend) + set $rqip = rqinfo + end + set $done = 0 + printf "\nTime\t\t\t Event\t\t Buf\tDev\t Offset\tBytes\tSD\tSDoff\tDoffset\tGoffset\n\n" + while ($done == 0) + if ($rqip->bp != 0) + printf "%d.%06d\t", $rqip->timestamp.tv_sec, $rqip->timestamp.tv_usec + if ($rqip->type == loginfo_user_bp) + if ($rqip->info.b.b_flags & 0x00100000) + printf "1VS Read" + else + printf "1VS Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.b.b_blkno, $rqip->info.b.b_bcount + end + + if ($rqip->type == loginfo_user_bpl) + if ($rqip->info.b.b_flags & 0x00100000) + printf "2LR Read" + else + printf "2LR Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.b.b_blkno, $rqip->info.b.b_bcount + end + + if ($rqip->type == loginfo_rqe) + if ($rqip->info.b.b_flags & 0x00100000) + printf "3RQ Read" + else + printf "3RQ Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.rqe.b.b_blkno, $rqip->info.rqe.b.b_bcount, $rqip->info.rqe.sdno, $rqip->info.rqe.sdoffset, $rqip->info.rqe.dataoffset, $rqip->info.rqe.groupoffset + end + + if ($rqip->type == loginfo_iodone) + if ($rqip->info.b.b_flags & 0x00100000) + printf "4DN Read" + else + printf "4DN Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.rqe.b.b_blkno, $rqip->info.rqe.b.b_bcount, $rqip->info.rqe.sdno, $rqip->info.rqe.sdoffset, $rqip->info.rqe.dataoffset, $rqip->info.rqe.groupoffset + end + + if ($rqip->type == loginfo_raid5_data) + if ($rqip->info.b.b_flags & 0x00100000) + printf "5RD Read" + else + printf "5RD Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.rqe.b.b_blkno, $rqip->info.rqe.b.b_bcount, $rqip->info.rqe.sdno, $rqip->info.rqe.sdoffset, $rqip->info.rqe.dataoffset, $rqip->info.rqe.groupoffset + end + + if ($rqip->type == loginfo_raid5_parity) + if ($rqip->info.b.b_flags & 0x00100000) + printf "6RP Read" + else + printf "6RP Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\t%d\t%x\t%x\t%x\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.rqe.b.b_blkno, $rqip->info.rqe.b.b_bcount, $rqip->info.rqe.sdno, $rqip->info.rqe.sdoffset, $rqip->info.rqe.dataoffset, $rqip->info.rqe.groupoffset + end + + if ($rqip->type == loginfo_sdio) + if ($rqip->info.b.b_flags & 0x00100000) + printf "7VS Read" + else + printf "7VS Write" + end + printf "\t%p\t\t 0x%-9x\t%ld\t%d\n", $rqip->bp, $rqip->info.b.b_blkno, $rqip->info.b.b_bcount, $rqip->devminor & 0xff + end + + if ($rqip->type == loginfo_sdiol) + if ($rqip->info.b.b_flags & 0x00100000) + printf "8LR Read" + else + printf "8LR Write" + end + printf "\t%p\t%d.%d\t0x%-9x\t%ld\n", $rqip->bp, $rqip->devmajor, $rqip->devminor & 0xff, $rqip->info.b.b_blkno, $rqip->info.b.b_bcount + end + + if ($rqip->type == loginfo_lockwait) + printf "Lockwait %p\t%d\t 0x%x\n", $rqip->bp, $rqip->info.lockinfo.plexno, $rqip->info.lockinfo.stripe + end + + if ($rqip->type == loginfo_lock) + printf "Lock \t%p\t%d\t 0x%x\n", $rqip->bp, $rqip->info.lockinfo.plexno, $rqip->info.lockinfo.stripe + end + + if ($rqip->type == loginfo_unlock) + printf "Unlock \t%p\t%d\t 0x%x\n", $rqip->bp, $rqip->info.lockinfo.plexno, $rqip->info.lockinfo.stripe + end + + if ($rqip->type == loginfo_sdiodone) + if ($rqip->info.b.b_flags & 0x00100000) + printf "9DN Read" + else + printf "9DN Write" + end + printf "\t%p\t\t 0x%-9x\t%ld\t%d\n", $rqip->bp, $rqip->info.b.b_blkno, $rqip->info.b.b_bcount, $rqip->devminor + end + + end + set $rqip = $rqip + 1 + if ($rqip == $rqipe) + set $done = 1 + end + if ($rqip == $rqend) + set $rqip = rqinfo + end + end +end +document rqinfo +Show the Vinum request log buffer, like 'vinum info -V' +end +define meminfo +printf "Block\tSequence\t size\t address\t line\t\tfile\n" +set $i = 0 +while $i < malloccount + printf "%6d\t%6d\t\t%6d\t0x%08x\t%6d\t\t%s\n", $i, malloced [$i].seq, malloced[$i].size, malloced[$i].address, malloced[$i].line, &malloced[$i].file + set $i = $i + 1 +end +end +document meminfo +Equivalent of 'vinum info -v' command +end diff --git a/sys/modules/vinum/.gdbinit.vinum.paths b/sys/modules/vinum/.gdbinit.vinum.paths new file mode 100644 index 0000000..104ffec --- /dev/null +++ b/sys/modules/vinum/.gdbinit.vinum.paths @@ -0,0 +1,19 @@ +dir /usr/src/sys/modules/vinum +dir /usr/src/sys/i386/conf +dir /usr/src/sys +define asf + set $file = linker_files.tqh_first + set $found = 0 + while ($found == 0) + if (*$file->filename == 'v') + set $found = 1 + else + set $file = $file->link.tqe_next + end + end + shell /usr/bin/objdump --section-headers /modules/vinum.ko | grep ' .text' | awk '{print "add-symbol-file /modules/vinum.ko \$file->address+0x" $4}' > .asf + source .asf +end +document asf +Find the load address of Vinum in the kernel and add the symbols at this address +end diff --git a/sys/modules/vinum/Makefile b/sys/modules/vinum/Makefile new file mode 100644 index 0000000..88c1189 --- /dev/null +++ b/sys/modules/vinum/Makefile @@ -0,0 +1,27 @@ +# $FreeBSD$ + +MAINTAINER = grog@FreeBSD.org + +.PATH: ${.CURDIR}/../../dev/vinum +KMOD= vinum +SRCS= vnode_if.h opt_vinum.h vinumstate.h vinumvar.h \ + vinumhdr.h request.h vinumext.h vinumio.h vinumkw.h \ + vinum.c vinumparser.c vinumconfig.c vinumio.c vinumutil.c \ + vinumstate.c vinummemory.c vinumrequest.c vinumlock.c \ + vinumrevive.c vinumioctl.c vinuminterrupt.c vinumdaemon.c vinumraid5.c + +NOMAN= + +# If you remove -DVINUMDEBUG here, you must also do it in src/sbin/Makefile. +# Otherwise a number of ioctls will fail. +CFLAGS+= -DVINUMDEBUG -g -O + +all: + +state.h: maketabs vinumstate.h + ./maketabs >state.h + +maketabs: maketabs.c + ${CC} -g -o maketabs maketabs.c + +.include <bsd.kmod.mk> diff --git a/sys/modules/vn/Makefile b/sys/modules/vn/Makefile new file mode 100644 index 0000000..3a342f0 --- /dev/null +++ b/sys/modules/vn/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../dev/vn +KMOD= vn +SRCS= vn.c vnode_if.h opt_devfs.h +NOMAN= + +.include <bsd.kmod.mk> diff --git a/sys/modules/vr/Makefile b/sys/modules/vr/Makefile new file mode 100644 index 0000000..4f8fc51 --- /dev/null +++ b/sys/modules/vr/Makefile @@ -0,0 +1,11 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_vr +SRCS = if_vr.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +KMODDEPS = miibus + +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/wb/Makefile b/sys/modules/wb/Makefile new file mode 100644 index 0000000..5428835 --- /dev/null +++ b/sys/modules/wb/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_wb +SRCS = if_wb.c opt_bdg.h device_if.h +SRCS += bus_if.h miibus_if.h pci_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> diff --git a/sys/modules/wi/Makefile b/sys/modules/wi/Makefile new file mode 100644 index 0000000..adfd2f4 --- /dev/null +++ b/sys/modules/wi/Makefile @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../i386/isa +KMOD = if_wi +SRCS = if_wi.c device_if.h bus_if.h +CFLAGS += ${DEBUG_FLAGS} + +.include <bsd.kmod.mk> diff --git a/sys/modules/xl/Makefile b/sys/modules/xl/Makefile new file mode 100644 index 0000000..4b7141c --- /dev/null +++ b/sys/modules/xl/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../pci +KMOD = if_xl +SRCS = if_xl.c opt_bdg.h device_if.h bus_if.h pci_if.h +SRCS += miibus_if.h +CFLAGS += ${DEBUG_FLAGS} +KMODDEPS = miibus + +.include <bsd.kmod.mk> |