aboutsummaryrefslogtreecommitdiff
path: root/share/examples
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>2002-02-04 19:23:42 +0000
committercvs2svn <cvs2svn@FreeBSD.org>2002-02-04 19:23:42 +0000
commitb3ea8abeca50df2e24167770d1e7484f1f877a7d (patch)
treef52b0378ac88b8ff9690c4e21a65813ff1177ed1 /share/examples
parent9164545f1ea589d7d2f682fd09efd4fa85fd3480 (diff)
Notes
Diffstat (limited to 'share/examples')
-rw-r--r--share/examples/BSD_daemon/FreeBSD.pfa32
-rw-r--r--share/examples/BSD_daemon/README76
-rw-r--r--share/examples/BSD_daemon/beastie.eps1507
-rw-r--r--share/examples/BSD_daemon/beastie.fig269
-rw-r--r--share/examples/BSD_daemon/eps.patch36
-rw-r--r--share/examples/BSD_daemon/poster.sh65
-rw-r--r--share/examples/FreeBSD_version/FreeBSD_version.c17
-rw-r--r--share/examples/FreeBSD_version/Makefile8
-rw-r--r--share/examples/FreeBSD_version/README4
-rw-r--r--share/examples/IPv6/USAGE529
-rw-r--r--share/examples/Makefile38
-rw-r--r--share/examples/atm/NOTES54
-rw-r--r--share/examples/atm/README140
-rw-r--r--share/examples/atm/Startup127
-rwxr-xr-xshare/examples/atm/atm-config.sh88
-rw-r--r--share/examples/atm/atm-sockets.txt572
-rw-r--r--share/examples/atm/cpcs-design.txt84
-rw-r--r--share/examples/atm/fore-microcode.txt92
-rw-r--r--share/examples/atm/sscf-design.txt129
-rw-r--r--share/examples/atm/sscop-design.txt220
-rw-r--r--share/examples/bootforth/README35
-rw-r--r--share/examples/bootforth/boot.4th22
-rw-r--r--share/examples/bootforth/frames.4th90
-rw-r--r--share/examples/bootforth/loader.rc34
-rw-r--r--share/examples/bootforth/menu.4th99
-rw-r--r--share/examples/bootforth/menuconf.4th110
-rw-r--r--share/examples/bootforth/screen.4th36
-rw-r--r--share/examples/cvsup/README37
-rw-r--r--share/examples/cvsup/cvs-supfile163
-rw-r--r--share/examples/cvsup/doc-supfile62
-rw-r--r--share/examples/cvsup/gnats-supfile63
-rw-r--r--share/examples/cvsup/ports-supfile124
-rw-r--r--share/examples/cvsup/refuse10
-rw-r--r--share/examples/cvsup/refuse.README57
-rw-r--r--share/examples/cvsup/stable-supfile110
-rw-r--r--share/examples/cvsup/www-supfile61
-rw-r--r--share/examples/diskless/209.157.86.12/README27
-rw-r--r--share/examples/diskless/209.157.86.12/rc.conf.local9
-rw-r--r--share/examples/diskless/HT.DISKLESS/fstab5
-rw-r--r--share/examples/diskless/HT.DISKLESS/rc.conf.local34
-rwxr-xr-xshare/examples/diskless/HT.DISKLESS/rc.local77
-rw-r--r--share/examples/diskless/HT.DISKLESS/syslog.conf3
-rw-r--r--share/examples/diskless/HT.DISKLESS/ttys52
-rw-r--r--share/examples/diskless/HT.DISKLESS/xdm-config15
-rw-r--r--share/examples/diskless/HT.STD/aliases30
-rw-r--r--share/examples/diskless/HT.STD/forward.map6
-rw-r--r--share/examples/diskless/HT.STD/ndomain.map11
-rw-r--r--share/examples/diskless/HT.STD/syslog.conf11
-rw-r--r--share/examples/diskless/HT.STD/ttys52
-rw-r--r--share/examples/diskless/ME37
-rw-r--r--share/examples/diskless/README.BOOTP157
-rw-r--r--share/examples/diskless/README.TEMPLATING286
-rw-r--r--share/examples/diskless/archive.backplane.com/README21
-rw-r--r--share/examples/diskless/archive.backplane.com/fstab8
-rw-r--r--share/examples/diskless/archive.backplane.com/ipfw.conf31
-rw-r--r--share/examples/diskless/archive.backplane.com/motd4
-rw-r--r--share/examples/diskless/archive.backplane.com/rc.conf.local19
-rw-r--r--share/examples/diskless/archive.backplane.com/resolv.conf9
-rwxr-xr-xshare/examples/diskless/clone_root144
-rw-r--r--share/examples/drivers/README45
-rwxr-xr-xshare/examples/drivers/make_device_driver.sh491
-rw-r--r--share/examples/drivers/make_pseudo_driver.sh311
-rw-r--r--share/examples/etc/README.examples66
-rw-r--r--share/examples/etc/bsd-style-copyright27
-rw-r--r--share/examples/etc/skey.access30
-rw-r--r--share/examples/find_interface/Makefile6
-rw-r--r--share/examples/find_interface/README9
-rw-r--r--share/examples/find_interface/find_interface.c111
-rw-r--r--share/examples/ibcs2/README3
-rw-r--r--share/examples/ibcs2/hello.uu677
-rwxr-xr-xshare/examples/ipfw/change_rules.sh123
-rw-r--r--share/examples/isdn/FAQ1079
-rw-r--r--share/examples/isdn/KERNEL80
-rw-r--r--share/examples/isdn/Overview307
-rw-r--r--share/examples/isdn/README342
-rw-r--r--share/examples/isdn/ROADMAP86
-rw-r--r--share/examples/isdn/ReleaseNotes154
-rw-r--r--share/examples/isdn/Resources113
-rw-r--r--share/examples/isdn/SupportedCards192
-rw-r--r--share/examples/isdn/ThankYou273
-rw-r--r--share/examples/isdn/contrib/README42
-rw-r--r--share/examples/isdn/contrib/anleitung.ppp142
-rw-r--r--share/examples/isdn/contrib/answer.c178
-rw-r--r--share/examples/isdn/contrib/answer.sh111
-rw-r--r--share/examples/isdn/contrib/convert.sh86
-rw-r--r--share/examples/isdn/contrib/hplay.c241
-rw-r--r--share/examples/isdn/contrib/i4b-ppp-newbie.txt237
-rw-r--r--share/examples/isdn/contrib/isdnctl111
-rw-r--r--share/examples/isdn/contrib/isdnd_acct137
-rw-r--r--share/examples/isdn/contrib/isdnd_acct.pl258
-rw-r--r--share/examples/isdn/contrib/isdntelmux.c197
-rw-r--r--share/examples/isdn/contrib/mrtg-isp0.sh53
-rw-r--r--share/examples/isdn/i4brunppp/Makefile19
-rw-r--r--share/examples/isdn/i4brunppp/README19
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc65
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp.848
-rw-r--r--share/examples/isdn/i4brunppp/i4brunppp.c224
-rw-r--r--share/examples/isdn/v21/Makefile12
-rw-r--r--share/examples/isdn/v21/README50
-rw-r--r--share/examples/isdn/v21/v21modem.c394
-rw-r--r--share/examples/kld/Makefile72
-rw-r--r--share/examples/kld/cdev/Makefile74
-rw-r--r--share/examples/kld/cdev/README131
-rw-r--r--share/examples/kld/cdev/module/Makefile91
-rw-r--r--share/examples/kld/cdev/module/cdev.c177
-rw-r--r--share/examples/kld/cdev/module/cdev.h81
-rw-r--r--share/examples/kld/cdev/module/cdevmod.c148
-rw-r--r--share/examples/kld/cdev/test/Makefile92
-rw-r--r--share/examples/kld/cdev/test/testcdev.c122
-rw-r--r--share/examples/kld/dyn_sysctl/Makefile18
-rw-r--r--share/examples/kld/dyn_sysctl/README8
-rw-r--r--share/examples/kld/dyn_sysctl/dyn_sysctl.c168
-rw-r--r--share/examples/kld/syscall/Makefile9
-rw-r--r--share/examples/kld/syscall/module/Makefile17
-rw-r--r--share/examples/kld/syscall/module/syscall.c86
-rw-r--r--share/examples/kld/syscall/test/Makefile6
-rw-r--r--share/examples/kld/syscall/test/call.c54
-rw-r--r--share/examples/libvgl/Makefile7
-rw-r--r--share/examples/libvgl/demo.c121
-rw-r--r--share/examples/mdoc/example.1153
-rw-r--r--share/examples/mdoc/example.3319
-rw-r--r--share/examples/mdoc/example.4100
-rw-r--r--share/examples/meteor/README1
-rw-r--r--share/examples/meteor/rgb16.c106
-rw-r--r--share/examples/meteor/rgb24.c101
-rw-r--r--share/examples/meteor/test-n.c162
-rw-r--r--share/examples/meteor/yuvpk.c118
-rw-r--r--share/examples/meteor/yuvpl.c138
-rw-r--r--share/examples/netgraph/ether.bridge167
-rw-r--r--share/examples/netgraph/frame_relay46
-rw-r--r--share/examples/netgraph/ngctl173
-rw-r--r--share/examples/netgraph/raw16
-rw-r--r--share/examples/netgraph/udp.tunnel53
-rw-r--r--share/examples/nwclient/dot.nwfsrc78
-rw-r--r--share/examples/nwclient/nwfs.sh.sample34
-rw-r--r--share/examples/perfmon/Makefile8
-rw-r--r--share/examples/perfmon/README25
-rw-r--r--share/examples/perfmon/perfmon.c195
-rw-r--r--share/examples/portal/README64
-rw-r--r--share/examples/portal/portal.conf3
-rw-r--r--share/examples/ppi/Makefile8
-rw-r--r--share/examples/ppi/ppilcd.c439
-rwxr-xr-xshare/examples/ppp/chap-auth97
-rw-r--r--share/examples/ppp/isdnd.rc69
-rwxr-xr-xshare/examples/ppp/login-auth74
-rw-r--r--share/examples/ppp/ppp.conf.isdn98
-rw-r--r--share/examples/ppp/ppp.conf.sample753
-rw-r--r--share/examples/ppp/ppp.conf.span-isp194
-rw-r--r--share/examples/ppp/ppp.conf.span-isp.working107
-rw-r--r--share/examples/ppp/ppp.linkdown.sample34
-rw-r--r--share/examples/ppp/ppp.linkdown.span-isp17
-rw-r--r--share/examples/ppp/ppp.linkdown.span-isp.working17
-rw-r--r--share/examples/ppp/ppp.linkup.sample49
-rw-r--r--share/examples/ppp/ppp.linkup.span-isp17
-rw-r--r--share/examples/ppp/ppp.linkup.span-isp.working17
-rw-r--r--share/examples/ppp/ppp.secret.sample41
-rw-r--r--share/examples/ppp/ppp.secret.span-isp6
-rw-r--r--share/examples/ppp/ppp.secret.span-isp.working9
-rw-r--r--share/examples/printing/README7
-rw-r--r--share/examples/printing/diablo-if-net7
-rw-r--r--share/examples/printing/hpdf59
-rw-r--r--share/examples/printing/hpif11
-rw-r--r--share/examples/printing/hpof8
-rw-r--r--share/examples/printing/hprf8
-rw-r--r--share/examples/printing/hpvf10
-rw-r--r--share/examples/printing/if-simple9
-rw-r--r--share/examples/printing/if-simpleX10
-rw-r--r--share/examples/printing/ifhp32
-rw-r--r--share/examples/printing/make-ps-header79
-rw-r--r--share/examples/printing/netprint24
-rw-r--r--share/examples/printing/psdf8
-rw-r--r--share/examples/printing/psdfX31
-rw-r--r--share/examples/printing/psif23
-rw-r--r--share/examples/printing/pstf6
-rw-r--r--share/examples/printing/pstfX6
-rw-r--r--share/examples/scsi_target/Makefile8
-rw-r--r--share/examples/scsi_target/scsi_target.c375
-rw-r--r--share/examples/ses/Makefile41
-rw-r--r--share/examples/ses/Makefile.inc48
-rw-r--r--share/examples/ses/getencstat/Makefile39
-rw-r--r--share/examples/ses/getencstat/getencstat.078
-rw-r--r--share/examples/ses/sesd/Makefile39
-rw-r--r--share/examples/ses/sesd/sesd.084
-rw-r--r--share/examples/ses/setencstat/Makefile39
-rw-r--r--share/examples/ses/setencstat/setencstat.072
-rw-r--r--share/examples/ses/setobjstat/Makefile39
-rw-r--r--share/examples/ses/setobjstat/setobjstat.067
-rw-r--r--share/examples/ses/srcs/chpmon.c128
-rw-r--r--share/examples/ses/srcs/eltsub.c167
-rw-r--r--share/examples/ses/srcs/getencstat.c155
-rw-r--r--share/examples/ses/srcs/getnobj.c66
-rw-r--r--share/examples/ses/srcs/getobjmap.c87
-rw-r--r--share/examples/ses/srcs/getobjstat.c76
-rw-r--r--share/examples/ses/srcs/inienc.c61
-rw-r--r--share/examples/ses/srcs/sesd.c165
-rw-r--r--share/examples/ses/srcs/setencstat.c68
-rw-r--r--share/examples/ses/srcs/setobjstat.c83
-rwxr-xr-xshare/examples/slattach/unit-command.sh18
-rw-r--r--share/examples/sliplogin/slip.hosts16
-rw-r--r--share/examples/sliplogin/slip.login18
-rw-r--r--share/examples/sliplogin/slip.logout14
-rw-r--r--share/examples/sliplogin/slip.slparms12
-rwxr-xr-xshare/examples/startslip/sldown.sh3
-rwxr-xr-xshare/examples/startslip/slip.sh4
-rwxr-xr-xshare/examples/startslip/slup.sh16
-rw-r--r--share/examples/sunrpc/Makefile25
-rw-r--r--share/examples/sunrpc/dir/Makefile26
-rw-r--r--share/examples/sunrpc/dir/dir.x37
-rw-r--r--share/examples/sunrpc/dir/dir_proc.c55
-rw-r--r--share/examples/sunrpc/dir/rls.c81
-rw-r--r--share/examples/sunrpc/msg/Makefile36
-rw-r--r--share/examples/sunrpc/msg/msg.x9
-rw-r--r--share/examples/sunrpc/msg/msg_proc.c30
-rw-r--r--share/examples/sunrpc/msg/printmsg.c45
-rw-r--r--share/examples/sunrpc/msg/rprintmsg.c74
-rw-r--r--share/examples/sunrpc/sort/Makefile36
-rw-r--r--share/examples/sunrpc/sort/rsort.c43
-rw-r--r--share/examples/sunrpc/sort/sort.x19
-rw-r--r--share/examples/sunrpc/sort/sort_proc.c27
-rw-r--r--share/examples/worm/README15
-rwxr-xr-xshare/examples/worm/makecdfs.sh29
221 files changed, 21996 insertions, 0 deletions
diff --git a/share/examples/BSD_daemon/FreeBSD.pfa b/share/examples/BSD_daemon/FreeBSD.pfa
new file mode 100644
index 000000000000..bcd7c70aff63
--- /dev/null
+++ b/share/examples/BSD_daemon/FreeBSD.pfa
@@ -0,0 +1,32 @@
+%!PS-AdobeFont-1.0: (FreeBSD) 001.003
+%$FreeBSD$
+%Created by NRB Systems
+10 dict begin
+/FontInfo 9 dict dup begin
+/version (001.003) readonly def
+/FullName (FreeBSD Bold) readonly def
+/FamilyName (FreeBSD) readonly def
+/Weight (Bold) readonly def
+/ItalicAngle 0 def
+/isFixedPitch false def
+/UnderlinePosition -113 def
+/UnderlineThickness 96 def
+/Notice (Free font with FreeBSD.) readonly def
+end readonly def
+/FontName /FreeBSD def
+/PaintType 0 def
+/FontType 1 def
+/FontMatrix [0.001 0 0 0.001 0 0] readonly def
+/FontBBox {-167 -236 1410 963 }readonly def
+/Encoding StandardEncoding def
+currentdict end
+currentfile eexec
+f0f0f0f011ee838241a0cec525a60ce01562fd01753ef17c08b804c2190d1aa4d3d7a12f3062687674aa2a92cf8242c0f344f7c7ff68f4dfea2890ffb217b7cfa0dc6862b09b5ec7382b9d9919be8dfa2ad48e471b50ed4f50092fd1b56974c018419c73755c5dd5db8b4a67edc9172c690e4d9554f8e038edbdaeca3f244f0f3f6f82fe5413751afdc1ff2ef33bc43f20a9b5db88ca37c067e2579f6237b5a64aff20041d5aa4a925c9f299ba942510249706a455aeb0441beb17ff67c90c618b823b3b9293fe399139c747d6675013b85dd4d7d53e532028c93e07edc9c1735332b79106ae1f6f0a2a421d2a10dfe430cc505331f5285400bac5b960c568e46bc60424cc7556af3ab80eed5068afa949d01aefa15a3635553b4d965c83f5321a0bab542b3ad3f05ca5a4e80771ea7dac758b3fb0281cd6473439050c4f3e7885bcdef7ed3d9be1528d2c035f25cda0ff44ab6d715cfa66af54087cdcc7cbcc8e92b3336acffc0486603c1bed8575b54104fb7aa35a3468aa96e14575833f832bd9c8ac4b41547fd5611878fba5911a73e2d96ed3d59abef1f0a250f0cefcee604733a7f538e5cda3c343401c6ca1bcc4948dd1d4cd045021df7ea5210a5f251a26202a24a16b6ae59ea7ef139883199bd2a490557aa0c2390283e10c826084239c39f6ea1b1e72f374ef7a6ce53480ddb967b2b2324834fe0419ea2c384b5e78ca3cc603cd05e18747fa2ca764904b60244cedc0fa74e54798785f812417c1770b4957ec91a2a25409bdb6f0b0af166f49d28f9c0774a589ba28526bbd0f665c339dd6cdb25e642beb864e1662f9ace50434fb76cd5546a78f8194f802b0ea4ce5f70e3b3dc05f80449b6f10bd78e3fae5a72f5428080e27bc58bc9905b8484973d53e6a6a41e0ca8e436629e4f649775d7e8a0a88c81940e22e332300b9475c66f25369840e0f72cd01c070c8667d5c0f8c8112af0f1aa6db12206b0722787891641c1e727c2e87cc401fa57340ae78e592ad8e2bc3b53657faf641973565fbaf90a44eab3388c0600dbf26a8d3405ec28f0fb9b82a4d3542000663d09224b7796d5881643cfb04bbee1b1c42528bdb2050b07c5a069a38d9dccdede2403dcd9b4573f53c4b37bb400c5f8f09c48e0edf917b1b38ee8871f61f289a4953b529adc4a2215f25770d0a4a2042a0fa54aca3afc4e6d4160ab84621f15c186c054169bcda02740d0a75201a68dc12f774826fe6fecde716fae9aafecbe5a10d0a732027439113c180e348426805353eb7448230c4611b0d0a7420949fb81757802e694b71a36a3f4d7235720d0a20204bf97720c2077fd1f95f57638711e28c333fda3ef2715c3329fc0d0a6b206238bf6952f35dd90c1a82c221915394abc594c83725697b35e3fdb00e6d5249bfe459a56f9b92fa8f0d0a65204b9711ad986dcdad852ce1b3fee159a7bd1bc1b8d4d40f800d0a65209ca7a2e007d4c7baf438865a2e88246978e9b1770d0a7020c396208dc65cb425042298200de19882b5a30db439654e06b1190d0a2020711958391b2c7f46c3adfb6e97b42a679029d8912ad08cc15fbd810215967e4fd40d0a6520fc7afc363bd4fd6bebce2630021597309113785b7dc875a0e71958b00d0a7820cc40b6c2e94a5977ebae9525a0f64d98a0d0401ad315690d4b9f6d550fe60d0a61209db21491114b877e71a69d674a6ea17eb8110d0a6d20289e64fa978047f8bd11704c674e0adf52624a7974f93ead75fc26b7c15ee0ea5b9a3ff90d0a6920ca27e2872590202d9e6e099ea9facbc85ead0964f8b737d0db9a5dc7384f5cbc6d79fe0d0a6e206bcc41e1962873d6c7f74453c82f5f25f7b311683dfd6f145d930d0a69205b0bd00c62cb912b1ce63f83dc6331456da0aeb62bf9f89d2f003cecad652e6d0d0a6e20d5af618d1e41770b42b9a269a587593874c4b35e31e6f1e40c7f0d0a6720714b7e71ab6e47018b51ed68c2bd71e4c491c6c99ebde984af511ec5fe31379ae9ec40920f7e0d0a2020beb1bdde2adef7119a3e9eeea099a51232af8e99613b84d3efeb0ae280268130de65ac30e90d0a6520ea14ee07dbee79a7012a045ff72e07a6aada6252690d0a7620c755ad4338be2fd18651a9d59bcae5b796dd0d0a652034cddd542863a58c6206b1eeaef9ff6645372af3f12872a0d18df926b5c0e69337b68e1bbb0d0a7220edc4e7f756f1d3be73aba324ad4ccdce0cd13f54f0f6fa6cfd46a4849d900d0a79207c571000f99aa9868eadfca224c4256a7cec0d0a2020ceddbb7223bce0d304d061286369a7305c696ae58d19d8317b77dcb77f7619eedabeab560d0a6c208b55bb029cfc67ec7b00cd034d2f82c1d450a5ec384e9b78fa5a7a611d88f9a856e64b0d0a6f20d2f751deba1aeb0a213347487f00081a0c911f1eee6bb7537935a10f4d0d0a772078a005da145704f706e9b46496e6d4530e353e5270d5fa6599b8d532625a2d0d0a20206ef91fbfe46fcb9dcf84d90b96ed207bdde15164357c900c9724010d0a6220681e686171539643482a58049f71949a181fa5e76b01c282fe0d0a69204e253812773456c004e417b9df2607b03971671426567a6aaa2eff0d0a642096817660b4418060acb4d05c25dbf155221dc14f9c9d582ecc0d0a2020401b77185cfecda1a53e81c8846980ec5c1483030f68f5a508330d0a71200f91ce6d9bdea78b2dff4a307354bef1b3f1b828f05bf3cb50c3c6e5f571a5469cd4d86874f0d4020d0a75207e73563dc4e2094c7d30749f93af8ef33485035bd4c4788a6af06a0c0cbae60d0a6f209efdbc6cff3aca5f89463ef6d0cdd24db08ad0716603d80d0a74203c4d00ee3f42b3bb134b62fcd6ca9744270fbe2879fefac07d2da7decbd612e1931ec9198b0d0a6520617f2a7e967646965e5b1ff71f130c31ed8eee2707268900c878160d0a642044af9dd9b1a5673f929db0b130e9f217ed926d3c7739e2ee3d0d0a20204e6bafd2d4e82b074ad64010ef0d1a0c716b559a93ff1f34fd30c6a7ed4b0d0a6620c06cdf04a317aa801a46bca9e0ae096546ea03e3ed75650d0a6f2064675d5c812a37771bb20adcfa37c13eee756870a340c251373f0d0a722020f707cdac1ba6f97723db63fea574cbe1d268bc7ced3522a6031e0d0a20203e442d77f6f3317c610da752063cd81e9dfed1533d2d2e65e322d148dc010d177b13c552efa8389b1af013ebcbff2cf16df3f7322a8a210d0a7a2064aa30c077b23638ccb725d4ab0c34044dee581c375598b6c439a2e90bae42b9102a77305b0d0a6920a28fdc09e4ca1b0f9675755a34d5e82516c126b833389426702996af7158d205862f670d0a6e20238224b151c8f2a2fa481dfdf6327ee29107319d27f74411dbf04b2d213c0d0a63205808f3022b12a49af53e8860eaacba07e9ae56ab54d683c2409564bb0d0a202054832f18a697a20e14fa1570f35ac823df21a5eeba2f510fcbade4fbe09b0d0a6520236c97f67cb16f5ddfc1d597f36e8f834e7fcc4c523d9411aa8091d5b8840d0a74209b6858fe1699fd9be7654683a71df52411e11b9948e08a8d95120d0a63206f111b8a97eb1d4a853769204cb0e85e66c882c0aab0e95e2885e9683ecd0d0a682029e71b2021a94e5bdd6463981c89f3ecdc31ced1210b5f052cec0d0a6920bcb172b7c7994a2095cf040c623904f7532f2e9bac4f5d247ca12e0f53320d0a6e205dcd3a1e9e199c8d90d16426cc72060175b779f7de91ae16475d750d0a6720b62a0b4b00f7d31388b33cae14e14eca3dcf7dc05e387525a1cc57f5487d49230d0a7320775879199c3fe2b076be7853626f8ffe3b37117cd9df45307e3bd40d0a2e20fb4c5d75432834b6bd2a8470fc28d07872f48fed69c952c161e78d92b60d0a2020f30a96881a9f8578430ffe17198f61b19cb6c0d61eadf947422dc17116fb0d0a4a20705c2c50d222e0f0708be5292433ccdcc16facbc63298523e06a0d0a75209749d4125822a56a992e6f5ec0c552439fc2e9f2adb1ee82359d110d0a73207590a638f70ae3b506f1f32ad76bed42d978a47b6b18bf044389c3a82e0879c50d0a7420b985b62542b9d3e4407c96840957e36a27e1e0990a63dfed6d0d0a2020b2cfba0c9408786d9eecd33897a2efe1d3ce7310630d01c326dc041bfc4ef4c0e9650d0a6b20db3c72d9c54a158d0f1ca934928ed76911c7c46ceaf94cf4ba24fd9579482aba98160d0a6520415f99b810ce393c53f0576ccb3a9636b29e7b01a6e258d28d885ea9330568e486db0d0a6520b9e74020f8363590ddb460084a67efe6eab1bab95a33180b0aebe5cfe6f77353b0780d0a7020f729a94c445f285cf40dc3c8276325ce6eeba334e42e05c376cc230448c72fb8cd0f0d0a202036249a76565ab7b261fb1af10ac8db6380dd6d146116acef6302e40ad309b8f2973ab871820d0a65203c2af0303b49f5b8013486e63805c16af5cbe8b1a574bb0d0a782050069303613b18697460a67772278c68c7caa60c3a169ef902f42b299118f95ac90d0a6120375c5338d58fc253b045a426a8c15ae4cfe14d7ad4f72a7be90332536712c259fe6777d60d0a6d20cd106f121b002f9ee47af6b37f6befbcdc93093ac6516f43e6c280fdde30941fe8cbd37e0d0a6920cebeb84dc4505d5a811722b5af2d0609b888cf8adc8e402f8a7548ae2717694177f8fdd40d0a6e20d8cf4836f492ca7f8c8cfc43a6f6081ee0a2d9e59a4a3b90ee6ad37be7f2e2b0ad90ec600d0a692075dc3ce64ef0cb4913e9167fd54b8ecc37eaf5f56c8b079945873eddd60d0a6e206b037f2573baa6c8687aee0bd2fb6d547ed3d559049ed04c64151184db0d0a6720b419249d4614a01a57524e2b163ac9894c524d7abead0ad5e00b395fbe0d0a2020e72499b2b9ad2575c7429be917246d4c8c41d27cd8ffe37c47987a445a0d0a65202f4f07ee4d49d554f3e75180b0f8c99ea6e6074df497a0a78c628fb8104b5cbfb20ce20d0a7620d5ce376f1995cca71984202c6ff0d58f7b27354234dee2c2587b4f6fb4beff43a9e26c290d0a652044a84169c41a31436886ed52cefd2b2e09eef40671adf319aa50f05d76fc79eeddd98b550d0a72202a4ba5beb4aba03e5bd7dabef1e75cba34bb5739e1deff4db50714e34feb33ace1eb3e340d0a7920cab3c3192a3236c0265f1b2b02d50df6c80ca1c15a096749f478b3b69a5b56e8b4c75eb70d0a20205cbaab4ffda32a87348bf3d85f168ad49171edb42a4bc5d8ccbb2812e2699c9b20a80b440d0a6c20937dbc6457ad6302e87945148cf96df25b01c042c98a8f7c911b616de1c9280bdeb064bb5e0d0a6f2096153950a73c0dc0c9956c0046d8422a41a6d2305b2e4947877eb1f3ac4d8a8f26a262ae0e0d0a7720e6a03e3d2cae6fc6200e53a0d4d5c0b0940737aceb48e6f7656db91671360d0a2020a8e8be9c80d64a1c12f01f591763f16fe1d94057dc01a0e23fa20d0a6220c9c050dd5f91c2bdbc4c188092d603730e6a7b729380bef8aaed7ade46b227a0c18d0d0a6920ebbf9670981bbb142957ae40a1dec346201908a1cfc28178b036ac8106a2a6ff81dcf0f7022c0d0a642085a7defa9a767cde5e1b2e9b6b52f036404675bbee155e86f09efa9f768e20c425b7ee1d90b00d0a2020028887e96da15a4529efdb2e203788196ddb821f2d44f5afac1cc00f6cb39226bf15091c9b890d0a71209a592827dbb280c2cb90df58e318ac0a183f0f6ef54f5687ce3fbe72992d996ee766b490133d0d0a7520b8aeeb47e68d9e5edcbe7652c21f1a2e2960392a61656397f0fb0d9f6d1d84049b6e0c091a7a0d0a6f2024624a82df9ad6a43434dc7510d3aba86dcfb98dc8888051eda7c92639d3c027920d0a742039d54073eb456a2c3b4984d3ae8d72560247b4d041902fe70e9da0e045cb80270d0a6520ff501dc22e9344f07fc5f7f4a698f82fc1672593365bd95d620ca9436fd81908a37d12f2c862270d0a6420ef494b5976d137e30d5fffa04705f470f48236ef3e0ea8446be6f8bc46ad9f076493dad0dc4fc1e20d0a20201e3aea24f0ab348f8c0513078e0ff81937678bf61595b5efc3a96e559d73541805da9d82d32b76d80d0a66209f400278ddd1f549e7e55e24848252393f0e66eaad40a59afe302efdc971e3d23ffc0e262debd6430d0a6f20028595d51f8b68f2ef83ce2cc8900d6346957b84caa3790981f852daa01d0d0a722037a2a4b7b5f6560384c5ae4271ca953316830481497f215d5f584d1370dd0d0a2020b4cbb202c5a9606050b8e064a4db8f69d76c3bbb41ec4ce53ed9625ef5cc0d0a7a20a83eab5609873ca3614858f9fcf642b945a85944a0248f31839e4a5f752e0d0a69200dd663a24042f0a6a6618b7b3f1d4a55272712d7dee63c22ce05df489428421c0106de0d0a6e2070ac1208aaf2ebed0819e8cca4daf7d623eab02132ab246522eec2280d0a6320d670756672aa7826ca4b637d403806bcdf318e6fae0c263d604e0d0a202085e153ba77648acfdc241096ecbe085932da2d3f540a8f49487216d483d86ae791ee5762020d0a652057dbcfad9c4e6f45cb6aca49bfb8afe9ec89c1af2133a00a362456fc9034adaffb95c829ba0d0a7420a7d20fd33af595b94d5616ef95bc08cfaf8f2ced5734080b57e132599d7f1d39ecae014c260d0a63203e2864fc552f48c4cf532630fe186f67ed5fbe644c10a722a014371dc44607bc8b9476d0630d0a682090db3f64fcf979f22fbf341a53ba241fc311c95dfd27aec3abc7b173aca6d6269dcb0489100d0a692031709c8432a44e1f158fdbbe7b328d31e19e9357ad63f032ae8668dfba741f0d0a6e20488e0f642668a35505017f8190b7e53d1ff320ebf19bd44dfae5dc9a7404930d0a6720de728173e284bd4618d916a30ec7084a0282e85fe32f98480d0a7320ed2b5cf2e589a14f0b4d9316e882c1d449cb46ee4e8a5542a96df79ed2c0e70d0a2e20be7c05bd4057c32eb1770df804f83e7c0f58421a0c367b7bd67e5f88d8ab730d0a2020a7cddc1c77ce5d83ee6af31befb5c5f4ae737ed9ad6445d20d0a4a20d48e8e8a4659250cdb50be64b2c7f710232e7e9df8620a41dfbeaf485f34f8970d0a7520f8b5fe2a8f5264a3c3a397d74dbd95cb51be7ff107e4c4641db7ca0e55abacca0d0a7320077fde251da7ec82e1f5ce6a4a9d6548d87316170a909c01cf4bbe1260b6a5a40d0a7420925c5ceed7d521a7841d140ad73e199ee437fb9426b3e0b0da099434d7fe957deee67f726c9f052d0d0a2020332781d61f01f6e6874f88c6135b4aa8db2d6abfef53638c065ef056061afe58389ea9000334d2130d0a6b20dafd87cb69dda55ab7d32c1133f8e1545359fca44a65a4d2fbf20e0d0a6520ff4ae7a28a5ed011c877bb0b175ea87dd3836d107d823e3385aad19f4e0d0a652016054f393dbb34ff565e188a64d400ba670a5110d8770d968df2720730b79153b07236eaf2b2df72a23802616dfc31696051edf2a7e602d3b466dab1190cf5bf869e0ceff0280d0d0a5420f69e6b0a456124addb2cf41806cc9d8a1180cf082ed0990d0a68204292ebee557183698938fcaae5b83a1764c38e76e9e093bb6c5b04b4902c945c55df64937da01e133549bb496aa04191cd3a9d66bd71a5e2da79657af875ebf7508146f47789836cf1a823b63cf314c295799f11430287f9d6c72df4f75b35fe1821397770ecb7c62a28ea0d0a65208c4ea4caf3776d82c6fdec9eacfcc6e7ea62639d0f71d6298cf233f92930aaa0c6efa85ecd563ca9da6f24db43f71669fd2a9dc30cda309933b569369ac51fa462badf760d0a202045c24f0e039f0f6573d84589510a36a00cab6fa1282c09c905d0bed077bc783f4d42d00cccce6cc4516f621e28d70e50e21ab052891ad25eea6eeede07f82a3c71bdb3bd147aaab617a6773542bb247a89fa01717cd2754ebba640da94964d6c521ed65aa1e4d6b7d63a53f1fe0141fb5efa5b1a3700d9c78be08c5fa7a6457a913e07f51e686b59c1518071b79d58b46de5e1a6039ce3965ef4132ce90865160d0a6d2029c38412a72b52bfa82fdd33b56b4848735d96cae2eb409c2b7b58dfada1766b7068178dbcc71e9fd96877e02452e4b1f774da425bafe6f89b7ea5684f3a2905f2ca3c5d98ccc3891420f4ead0d985ef232b880fda400151d484d86b6e0ca41938e3455d14e797ab2a66060a0838f51d6025020d4414d939d13418f0951eca9802f11ab7da52ef7474f515bfe73f578edcc1ad33562d05b7cc11517fe238556b0809c9af560938dbed27b6ccf33ba4e3f973e53292c8742999b955e0c9d6102f0d0a61204d8d9924fca6d40b7b9c35b9adb0b41dc10a4f750a36f1fa13aa8bcc624d2bc0a6e391a2b8541f5976bd95dca3dcbdbf0c72af08cc632efa811bc7945ca6073cd236af52aef868bae1f521e0d0633f6e813b59ed2479a8b9d748ccdab92cd5f92f1ceef0e96d6b84f4593168b750b73dafd419d087c62355bad1965be357d8bfc5275ebf360565a8edfcaf28e26ed7605b146a27d4594ef8f6f66e1e146679f484b4e3a40faeb10893db86c810a62dc3241612720e49edc5de5257780d0a69200b2379c14c4a8ae0c4a18aeaf1394b6fb6beae15d7ced918e24632482c9ce8a6a2b3b5c93b75fb3f66995a865d1445473dae7f6b6c500bb3bc48fd5cb02f2e9057005c82d1fe9faf70c51d2f994102ed725ab12512dd159ff947cd7113f2b048a6aecc846a3b2f43ff4c0b9e0fef72026196e3beffd11aa00922aed7e4567d22326a8a42c915aec64c85846f624dd227908d5b51d60c2f07dd720d4bceae7241729ed797b9bdb3c6f49058c1713612886def731a2e3c8e024705707937a19bcbf4f19e6cbab387f03ea32be529afb285706aca103a0d0a6e2052d47eeb2892d03c2a271f5c0653c010fa4e0188739295b39b2dc4ff05414f68068c109a988a506ecd91b4e9212797bb0d0a2020501ec10488391a2f7579465405dfca54b3c9e017ceeb6a3b12c25bd198afdbe88409e807df692d5955dab71b044fa8e9137e62ba4b7bfd9b2eeca5afe3f9ad28246b74b006ab41f590365155dd41c0656c4a4c8a50837b2d55996f60a11b850d0a61205b433512163a92c04c0012c2062ce734bca8dfc56096f34fe215786e28b897423a24dd6c3ab9550140c814b1c1ebb1b208c6d5c37e6888546af8cbe0f6b968c2c12dcff5404f8760614189fb731d55a89c2e7c1f24d16e4f4cb1a11235280d0a6420b2535c884be264b645c6c83af14749bf58372d5eec3a10f2e9f84ffd8f130ec429cc0f0d68309a771e9846f8ee78bb586c6478064d65155458a77d9bb8e6b75a727c9fa109955da6541950d1cd79873879acc79879266f64aba43f5a5d5e9cfc69bc400e173e206c33b1f206112701c57326d1e79def9c03f80d0a7620fa1fd7dfe04cb709fc4da7e35032e4d32db2140c8caddbc28c8498d840bab6b47c42ed8141a599bd95e5d19e5c94a959b1f17faefeac50f09952306fedd5a197d9990dd9b40d0a6120a6a313f738bddc30c0a1b117153f685258a87b83c798b5758ad94d4b2165da94ace23605ec7e5fa7341c50d3987226b7d5b66932ac28af6569c64b9cb8c495d2c5a00218cb9944962e0d0a6e202320bf2038fd3a186b6724f4dd1d5f6a3d592c00e70cd24a999c15703c9f52d0bd8b613428376e16f86d69541a27d6670d0a7420ff870c92b8e58e12f8bb83fdcc2984eb7c339c19145c5fbbf002386dd3f65f81254f31fb8635578b79266b08391191249c93e2ceac0d0a61209be4f9b198830b431b2657b211b470e2c5c869f2af5dec7363279024ed7795a7fa93f25d8aebc395dd3178b30ec3f00013bf0d0a6720f2fe0b0e82b8731889a4f1574470989c6125e932e1a6617045b6b36a4555136d32e389301b6a31d04c4ce58c83dbc881f70376b66ba213afd65e609a3e2985907e7ec38cd42fe431f84e2473492ee38d9331101cdf9f58cf7066413059cae726ea13e021ed660d0a6520e2e86c939cc58cbdc7f45f5597d1efa2a17587d06c95bcfa96d2ee0a0d72f0c7b9a6b45eee1da7cd1319bf8471d2e90d0a7320ff3bbf9a4d7ed10415a353c252e8a762687439500b2d13c0b0c7d04934332404163b1d89264f340bf1ba2f6adc50f8e5aa2c6a9c3fcf2bb2a55ec888ca10b8931b782eefc957c86b33ed68854ce4265f1ddcf2123c6109450ae17f5038d88531ff601db30d0a20202f95dfca5f7e4b8854fe2227100e2b91e80595dc147e8e095e9adf380fdc70e240e90fd7fa27c62c9e0b386ab458dcf4fce9197f6c22ebb1c342397e0eba1f82bd23b8ffc7e1d468e5dfd664b455dd2dc468b04c787dc725f11d29a41db99d8c003f873c01bc463b8b515298f3840d9299a5b257c2e35bf1bbd995cf004b54ecab22a41552c07117d70d0a6f2011b08bdaed6101ef6d0541d189e0ed88d188840db164d9e58e464ed904970ca81fb89b401a5ae830ec595bd7ad8f13e7a9400e3730ee72b8a5748ba72a090780fde5cbcee46b1c20d93190e51e4936514aa12b2f6086180f110d0a662053aa125db3464ae890fbd4843177c43d93460be33a42bedd50b214f6cb4371176c86209fdc3b9795e74f3b350389538db53c8a908db5ac0d6293752e80d49e935ee8dee4bdb66dbf2d844cb22f62451d3ce669e2623bc7e3a039aeea8cfc86f9169721f6929b6346ae14336abd78841c182d26e160e65d0d0a2020bfbc006e4f845c4f2fcf482e4b28e09fd20e2fee0855d6f6448d9362fcd8f896c8d7badda6d5551f3beea144619b5114fcd127b90a6c348bff10f5a0d7989ddcadf40211557114da12d742bff155ae56c0374ee92d2a1f5ae0e61c9f74fc7c62915b1d289687b6be28ac3ff81275ad56ec080520642f310ca9d8fde025a33ddb021a40b44a0d0a6120d5eb639120cb3b060782a0e95b5fea2d7354d6ffa0044df25a0b7e1ffc5693a2b472c762937b12ed5a93a61557afd2f75d43bff12f88801b23ba424ace821d0d0a202050084cf2ab7a590434882bc714cbc1d254175c60ee807f4b80302a948a720bb787d8d82c7747e6420a84e0fa62cc528a70c182802d293c3872275559661852b533e336805a0ddbd98ea554188eb529d2395641fe1c6ddd9fa9076e0fb3b91b8bc6a0457f05ac678ef32d24d6fac7461aca7d3a32f65457c34395a93fc87dc1b4336007f60e264400e76a93154928b65a6698f824d9eb596061fb1e5ffbdf2a5b52e3fcdd84cd735ef7591691d2db518d010d0a6420276acc70e256104396fe961964d62830e6aaee75da7ae9a71e26a264c26df317644afc91920d46b146bbe440e7db0dc7bcac65a5c16ace7a7ff23e37045b36f9d83d6a46457c4b30f5d365a274e35aad051873138ef50861d18c2d9eb5fb294f3a85d2c2b483e7557cb2b7f2f7ffbd4a651b5cddd277ec66f5404e87c2fad4e8c442f9c4c00d0a6920ab28736f70f02d27ee108fe3e752c846dfec15ee4e8d7b73278d96141f625dd76f0fc148ef06f9b4ae4ed971a255dcf8ecf0260a64586d781b25836a620dddf7817a773dd8484f7263564c48b091ffaf9d7f52e1c1d20d0a6720729021fa1722d3b929b88b76b787577c4eb52e5f704649053763dbbea06cb0036a0cc70514ebcbbb4a595380f7ab7a8211ed0cb3430a1230d896e0219fe9087d0c6c5e94da4bba82ddbd012291bcfd1b3f8f9dbd85a0a646952d24a64dc1ec3d0cc1cfcf0d0a6920b562ff2484e0f03dc0754dcbd4ad92cabcb3056ea49b639a76df7fe06dd4d8d20236b7001d9b398ee5e96627d39e45f8cf29b2a4721e50880de18af3871a6801020d0a7420ba5afa2d563accb973b7b5b5e9dbec290678a21ad7a75f13ed0e1089f129cd4b788f262242c703df0f7dcc6748404647e026411143e8f08d0ad5742c7941a9c9a40d0a6120ed61c4724be086144cd4394127879f18f6c3ae2a1517a18745a567d4df32a9fa0abb2d2377b69cda25eedc22bce867e7332502658cb298e481b7ddbff2f32ee884540d0a6c20afc1d7dcb2a7473bf006ac50f8788def7d188ff00c9e0360baa6245d73ad42db74a2706558bea5733707a718cd550c38d4c5dbc4c39543ad5bb1e1a58d5049d551a5c11279ec0d0ad893162ac5c51a74c2aa410f25b3feec0dfce33dc9366ffd3c4f47f6bcb8195bab6a4212b9532f973dee1d720a6f390478167d3bfa8601960fe0f453e08cfbf00d0a202038f7859cb5cc0bb441658695df18d5109589d4423e0ef71a00be32ca90fc255197848065d87c566caa01446bb4f4c65a523f8fec878f72106d9505800c028818bc0c099f9f1755728a3a29ae6b7371b21011d5ac6a0e2ed6a4ee5a559433f9ccbe300d2eb0dd3a9fa602d5a7726ab1df0b917ab399829469938d98bd0cc0d3e82a6c898d61e5a67b04abc2e324031738db2280727242a1a3d8b383743a3da83d94e1a5a14a8ffb4386d900be9868150b1f528f0002b8006f20423ce5b2c6aca801a8507322e5171dd9d3996f6f88275306f6706b70f210f45fa76043ba1af53f0e09f28e77d2db6aa1aaade541611bf9d1b612c89cf9a529e48f9229f850735c542f414c388d54f605ecc00b582f30c6df0d0a64207918079bd8033c5c6d88858dc110c6ddcdc4d515f9961c1a9f54a5b653eb1b4640b5cc2a7af730f4db53be1f8ecaa4d7c992cfa79172f8601625a79ca7ca309593bae51037ce07ce87044bd4c152414be99bb4116c0d0a6120c926c4b086ef2dff3c38b15ea858c758ae3dd38dea8d1fac44270fa7354ccf2708f2b8ec1d9a93f446e64c466f371aea6cf60c298a0a5bb4c888b01d33b6d4b2ac7508ae2c591ed624618151d589436777c19183f0e95abfd92c927a266e4757764568d716826d2c6a7d260ebb3ce4817f7c5020596ef54469a6a42fbb0d5046d4a333a00a763d99e2ee37965b3505ddbe0d0a74208e29ab773e3d625ec81ab4acd1b46a6a7cadd8d6ffa6660895bc825f8594063e5ca6bbb33eeb90698c3ce1d826b81fd361f6e6616c516fc8966cbc0134dce50bffd9503438bf81328704d9ad1c884ed223bb8f790c8393f978aa69c291e5035c9d9aa548772a8d012b7f858600c70d0a6120d50c8e685776c6c46f551900090a66a26ca0d1daf761ac6b96215dcc4d850c134d2fcd13f500f9e22a4695bc8d819ae8ee078dc70d42a2b6d10b5e2d92474ebfac22748d49f59ebeea6928cba19942cd1cc85a57b146ebdc50cb1c2a778ec08d314e94e90c2701c4ccd931490d0a2020c9398326471525c772bd912fe207caa074ee330f83c1e6f76290c70a98b29ea35b49b743dfb6ca74a31d65c4c42b0fbff46027941542885b22ca577e65238bb91c663c55e74007df616fa00d0a7320158b710b661e877329726b8c71527e3e28e52bf13f2e25f176ab5bc34f228ca4ed007c8c80adb5b4aaa80868cc3bd07132b4e88d15fa6e26c6b26e3d73753447accf34c3400d0a742048f70c877e5040fa8798518637ba040cc17effe536ca576cf71f7ed2f69365a980052d57772af07d48c551fc328729e8b5764a9331eeaea9d562c09b2f709fc372eaac3a874c9b4a9869f865ffd6b094147ff1214e3f7111ff408dd4eef6b28b3eafc5b5289083341a0b8987ff0e527ee7487a95ab3800ccf3efb2be480bb726d61e550d0a722062cc68235cb0ccb2103491922cf5cf1198c62fabb39507932ce4adc3bb98e129616027b7d7a562d6a89605c7fec45423515211da7426abcadef59c16cef33215a2ae407623b1969597bc310080cd0d0a652052946808d22f61742b7f8f277dcac79c497e655f8512203f56f054bc0db2e642ad43a1385c717099d9ec60160d0a612075862a576494ff79ba653eec778ad0cf0cb071ed87b7acbafea90c113536a3cca3c99f8b17c997960a5c8defda1d972cd21b46e554f96bad17cc22f42736a00d0a6d200184707d3aa2901b59336c71276dbbd599db6d5b3a4849300cfed57cf370be84c240114e1ec05d620a6b8e98942985575e0f5bf27a1b904f9b99a40d875e1797d1f3e54c13ef1b88970d0a20204956b8172c834398f56760c11531331fb876a0f1a5a3e3bd29a76bc26a16370d8deb3ad404c404544e752b046f2a4787386ccd0d0a6120a99b45f0f43139aa5e003337b4d211e0840b57fd4af34474247494dd02f8441d6c7ada218bc380450b3fb9abf5dcaeb4613eba492ab55d854a165027f6ff35ef7446d5a886605d57fd7987993422a5eaa00d0a722024bfde2ccbad9d06af42a88a77bb97c490d4ea880c9284b014f9ccb55a442c301b42abf2878780cef0096d021c323273f9ca91da60549e8a93f99b12b20c578f7250d29a545c674a73b8b7860d0a652032bcb294bb63f24cf1e31bb163ebc4cdaea3586a2d915e9502d732c25c2fe738c4456c77d1f4530c1613bd7595d3583bc971731c39d0924d7887ea75ec4848e49fa8afe410ff02e9f751ef1234b3414b0f8a4aab4ab6859418b0c6919109fc8a8583ac1b89afa01ab6536b9cb3a5fe37b8bd930fc34365580fe15e73d81df053016cbc620d0a202021fadd888abb83894fbb84707e333a6af2447302c3ace25d1eb8cc379a705ba8add551815117bd632983bd4f43c694768e661da35e88c29c688445c91652c1d9ffaa9f3658df567332c7c531a0074a56ee635c74a8e1db9fea90af489f03f90d0a63208488f03d3eb6c514fa3d94066ab684f260cca5506f4d7f99c599536bb5c242f38ed97f209c1b52845872249d80e337c73dec051137bf0e2741a4d4a4af4dd387d22d69e2f7cc1cc91f6ba1d334b8a8923c67491d69f60460c8b0791a314fa5dfc25c1b54c031095a8234b36589d0a7ad317952f78857cf2323e7cd53ff61dac3e7d8a00bd9e6c3333009e22da75410121a62c9945e91655bda6dd76eb1acc00d0a6c200415be4058093de9aa2316cceed4e1e31f33b352df0f3a5665e4b82a18ed60711eeb3a0ca53a942ace3aaafaee9ec442cd4549c0779dbb354a10c3882bed259c749b268e7028d21fbc13bf9464541edd8d7c960617303c1648dc28e63e665a6671885a136b67fdf2ba67f3a50e806d9a53f0ccbb7f7225aaad5838f4d4f30d0a61207e720f01fc9c5f0fa38d35a1063bfd5127fb36de943cc5d0e3cbcd3d617ba56369e49f49bb240cd65bd20894e7bc3115035a2009f5d3ac1efef14a4ba758d2f78854eb2ae878a4c8be93583f800f49238ce507c75d51a708ab4484f765ba416571abc98fb038e03556aa19cb30ccaf803ae0332eef25df23eb4306452a4e92ef530b4968ab7e1f3b0d0a7220cb744f6b008094d69881af23c7e33d3506a3405a20487d17aa51a679cf734f91aea14a5a7c1a0337878dc28d06130f795d52822f715d5986f0126a0d0a692024f94ea80b80b9fbc33778f8bc82cb60a5c6892edb8102041ab3ea236692e1583709f096f18a4a1e8e8e534ba1c1908a5ccdfb588e080a239212eeff33ca0763a0183be73ea3d8bb9d62303e7bf49fbf593d719863f52d09cd85a90d0a74208d3ebe4fddd8dd9979094c906c85a5a96cb240e5be6c36a9e3de5768c0dbede0707ad6ea1df5c8f907f1d65982a3b9b8d1c20ac781c2f9198dcee68bfa77530d0a79200c3ab52318b338558f737e0a14283d4a08c2c0e9745f46cb57f1d7e68057543175dbeccaab8de82a8983fc48231a97f761edff290046a58dcfa5b78d912702778b6300954f5500f2544c48654170300f82be7254dc152b2c0d0a2c2031804cffee53e36ef173067f30170bf95a73096321d91ff86b303303b8875394d480710dbf8269e74adb8830380c53aea2caa50039b6a3cbc10bfaed05bd67b186d9c3ebcdcb619a571c6504ac3b2a29439fdc8f0d0a2020c6699929db1bb745c643eff9f51e8f65ec5f211c70e713228df39295dbe2ca9c2efecaab338d77095a081ace85fc72cb444e8e0d9fc1ae30fab92dcef43e8445f108eddb1b0d0a7220ecf1826f5d96c901c62726d9e141eeff8a2a410dab110a6286aaa706a5f53ec1f0168d69f3e6168ca9527cd3f2068abb5138c96540981bfde3a2581e7fd2e2b273241e2f44b4d6e40d0a6520d00509576abd328e2e715698997ab82b6070fbc94ce9d17921d57ad65684f5bdff26ff0d7e10b3a9728c3588f2d7f4975d83d852133b1dbc21ce46c9a1085d6e805a23070d0a6120ae79995e1ca0a1a0008d34a50b9f28bbb37ec71b32bce14bb0af83a919abe1fafb54c24e42800b8046e13f909ea588a3336a296cd7171bd9aa0d0a642017ea3593bcd590f325779a69e597a4c7ab9b8030ee4714578470a4b7085e8dbae56031b94cef069855a3a4b86d5965ac1e1f1fd81c9d481e3cddeaaf1d3e2d2a12b39e0de7417f26090d0a61202ad7433c150e0613d7d5067ca205502505663f5bf781037e42ea9c649962225173bb20819df4b984205ad6359ce4d7e7937c4a1fae3859a5c13decdff428a794800fb0fdec62467e0d0a6220ce16e26b0aad61c694c26178a2cc086c249b609595ac2834233cb27e92c9c7146f44ca4e557533bf99ca64a80d0a69200202da67e274a694c6202b46d601e79ed784bfa7c3d068ba44d23a6c4821d659e9346760c73cc2a8bd502ebb6b3274d5cd2d0d0a6c20e87a875e9e430ca30e536d2db39f665f9b07cfcfb7a64456e7c72c5bc49893fe86a29be8ff769cdc0d1f8dc1a366fc407ba65d1222e6d4e316d853c02770d2e7a7d71204827690429c0facd704145d445206b597a503c4c77181e2e05d82b92b2d9f7fadd14af71ffa2eb684eac3b6596e30c9e9a5d855a6d66ff074651ca4d411ea97756338e5f7171a12497fc9b5e023a88723fd17fae998be0ddbd3960d0a69201048b3cc3544e7ac0fc23ecb356de1a4369050c5f0e0b20b127fa3cfd99e4f64ba775987a6c5aba8cf032ec1dda95ef0758f81e5b4c19e252285b62b89e4077c033a90fd5cadb5d9515de054d94a941d8cbe15d8ba19b7ee99c7f21ce7d080e010aa7ea3590a0b19320e0eb3ee52466d0d0a74201c64f425bb2169df311a2f5597270edf99ca9649e0e7b309d11a30647342f61aaf5293858da0bf69b3279470faf7267088b9914ce3dfe9b24eb9196f0f18cc91b9c3559555c48510971ffe8a7b8ef129a01829d8dce55afd03b470e6ab06e89b0d0a79209083a1c2bdf8e16aa3165c310cfbbecaf18b5fa1eba09f16cc06358001374bb3b3ee06af037d43421e99a19d33ba4088ba999c8cd207a74c737bf32490902b7730ce78b4ca848dc2534277781312298eb0e2f2887747195363b57fb951429bcd95888ffce4359a5cb9ae6a8b7ecd6ee67a4935974ced934d36d52333553cd08c3570c3f68c1da63a495464ebdb1f0d0a202003e91a62346717298bff3cbdf1ecc18a9e53867aeb9b9f19106fc20b843836e419e299f98a3c9ce0d93084d90d7aa8cdc81fa25766a17b659aa2e52985ab19c99322483d840c04d6c2d029195c235af6fe0771e7df0899b84968a861e0f150fd62b31f02a8891464fb126177223c0c93b27d15d6c70d0a6120252fbc5de63dc9375766a4b2073005eadf1995705bfb3d7de706ce838e1540ebb4a25c989990f0b41ffa7909f10fe3e0d90f99082543bd7341d812a413a6bd015bf2ca372f9070f5e18d7e009847e3cf514bc9abefb147567c2703370d0a6e2020a8d4ac234409caa1c9d598dd328e229bd10365903a7504cd8997b23dcd06e503468ef2115e7ba397ddcc82ad81d267a8ed08ca80ca7b7b3cc1a3f4ca12d572d9e4a32c2ad17550efd3ce38e840bf1dd736c25bbf8ae87dad30018040bf4bc6575b26b2775b28d7d722d5f293bc856cfd437bcec2023907e8dba2f02ae69261ecc065397d1768acfea754bd351e55d3cbf3cd3b76271636e173359da81b0aa4e7b1716e2321c49a800ee30a3537533cec680c3030292128152da97e2c9757834c1c04fb21152fe267803685abca8839bd9b5dc81527b90d0a642088b4640b8a707a89ac671452912fbe5cab38fd866fc1fceea9232f739bdc46eb3123fde09cf62d45c8bafebed615057d1d6c74eaa8ff08e2bc7da50dd88462e13986493974fbb6446ea692e364208675f8f2ab161c73469dd7f60d0a2020fdd0622da8333890bcfad4720eed78eac5861fbcf77b270595c1e30d49d86599910d7fc96a369a14ec23aa1ea6c4f6431175fe792ee93e48f6c279dc3aa3152113b0c16134872cb1c1a7e9460d0a652096e05b928c62d916ace0271d7328a119fe165496ca0cfb3ed544864093cfcd48e53ad5c2ebfd70fa4dc9269f2087a43052f2e93fb122d9d4fc0dad4e6c98c8bc9d40831497b059fbc98b9fb37314ab6589c45a4edab176f362cc6ce5caa30d0a61201b2067c0706ade699715ae36027e3812c721b10a3c54d05af56f6f6c9136e8cab69b1d268649baa4f97ed3cea1ae8b96400d797cb9e391931189c607a9f653b10058773a3c4a7f4ba5af600c4ded0d0a7320080bbef2729d0dd4bdaca4c6f133545062f55e3abd13c04924dcd0614e7bdd1c99eac038a1f0ae7fa0789b74a80d0a652025a9ba65e4484c4ca9261b30a5d0d2c9581ecde45ee60fe6819920556e46d449d281acf686d4bf3ee16091d3b3d5e4dbe82307044006938d43b84e4bdfa4c8746e1ad97dcc9ae61c95b3bbb47fc4ccd06ee15c04f0091998b1a176d8c8181a435b05465469d4d1334aa28af892d28569afe26c02228a52a59a0bed56d76c87446fe27139d732d993e487df38e40d0a20205d1c4ae4d90b7576d6f5dfd6cf58a2b23aba655c320cf8ab28506e3b0277f054cd77ef6540b5f09bfe59e8a52d4c2432db40b23dd93b506c897249f08488994985b720eeb7458e268366eeb89b2f9c7b457a80cc99b0c91788c3712579e04b874eff0f41bf0d0a6f20cecf59d0237445adef1e61090a1c63533780e25f252998333986c0a7f44eb262c7767f28fc41a51856b360e724973c3f0a8c70b4c24e6933eecb17240a1ca579e803391ccd01a304c17595e27df95a8251d1a57a467ea7eb1ea6117d660d0a66202dedf71f7a6457cca206d9d9f8198119acaedc29a521ea4a25509ac49ebb93cb17ed252097ea4083a01907175923d0616bcbd57f31fed51c0b68534f06840707265caf28798a70fb9f8eb82bb703ebdcceaa210eacacb6f847bcfd1420ee66a87a8c251e00dec80ea4183c1cbb14a430a97fcc6f45cd091d9e76b4bedb4660c476c8748a150cef520d0a2020687b4b93f6c1a7361ae79e082698197fe451fcb7c3e08b7cd645b82a8b7d2464e29a69f95b476c92fabf4b9aecf1a305dd94b90d1fc71b1632506572eb2a7209ea4b10fb3e55ef63f79b947980d02cc219de590e0f1d171a88cfdaa8213868cdeafb6b2c7dc5f8974c8039fc841ae34de1108966a0a6f33273018d307d81ccb3e650509fb60d0a752068e1658613d75b5c49086484aa8f476276daa4cf09ca2d2eec45a333340cd3a3aa712ef4b4e82de51e1aeeb207687a3aec203dc2af65e610010038ba92579ac4c61f36e3e5d3a914ff6befce08ad736486b87501b6f0b5d4d9669da9e829bdf6220d0a6e206c46d50506eac42ad6b3196d0d0e04ab75df8bb59984fdede47f75cb94a96497502a7ab6ce82175b56598bf7ebdef99680eeebee4c9cbd9cd1dbc1ba6f682ac8891d84d068453dd95a32d1f8ee714e9fe588890687ee061ae65cdbff7e8bb6947c8e63c5376e8e0673c7a5aa9e5315c952610a32a7ffe6e3260d0a642086a9ad508b454d43295a12c340b3839c5c19061fd89e245acd14492ad55df9f27214907a5a2fba2932fa1023ee8fe2edef76c89642ee24aaf2e9048039eaafb17e549de90586848ae39ba3095c9e75583b1a45fd8cbd46606be46e7e210d0a6520d5cbc5f346e18c96491593531b24894075e56e80a05ecfebe0d1d35dcc0c587a4dd451b73d9740ecd10794be5b371ea9d23639fd756bc7578c064e73bda35d2faf544cc3602f0071ae637bf000b73b28e36127465780f78de0c9d9e247864b66c94e840d0a7220b383911d102ca8b133cf60788955143b1a22ba5cd4aeadac73f40776e5e8543138db4f5b0c59e9d5896d12f8c1a139f0ddaa8c4536d66274c55d5519590d0a73205c7f46b8618dc52191ccd43a56ec9cbfbb35345acc94b172c888d79b7b967bb9ab7df03f7f2242a6670b50fbc8ffb4270b772978ecdfb6554242b34d13295aa433dccf35ceb9ae1bcfcb9b0eb701393cf2c2f4870d0a74205e256914c56201bade90466be9a34e8fb97025e744f29e9f661029af0037ec83208571ae9d13c9666cda67692fa88a5d89ecc934e346760f96b9f081b03a8134980e6a60761224df65b7944e538eefba0d0a6120157b667be8e539a57b7a29dad22480022634a628d5bc33d6bf91186ee569af513cf20228187ebdea378e780498e0e0f4d6f632c7c0b0e57910d0c955653de703e65b9ba0d70d0a6e2010dd198922365136f8c873a18a504077cc2c5ec6448c8f5bdc89907f0df22ac6375c84fd07936a02032874ef78bda9c29706131e1bacecadf889139a98965a7b787b492b50f8b70d0a6420b792faa3ff43a09849069c6a22dcf047b34f696e790483a88b0ca602b91ebb172a1ec56c4a3aef090a58f5859fc5a4c91fa7d9eccf7a228fa6899a17572e3d6e1db1ed51ed018529f94e28e26ee194896d95b52776f228fa59c1365999c6d33fe3d2ecc5f9b96545f2d869e63d599548142d565612c06a49e0c9a568a49abb22825038add6260e8d97dd80cc6717e59700f038be4afc7970b5ed765cb1efee6579755c4cbd0d0a692028ff62d0979d36cdad5432ef66900a6ae16c5cb3d91191ec142d36f8c4fb51ddc1b3700f249ce50a6a85e3f1f15f986de69c6e87ae9b0d0a6e20a46063cc6f01188ac466ae7495560199061bc621b53ff30c321c28c14874f7f796a2913ae36b7ddba7bf759419b3cebfea71bc8ad5bb9d65b9ba06c21400f844172300c8dad123fad55fa64809e61ce05b22b51a7f4467bc55eab3e7f958730a2bb6c04af4a49f606faf0aca8ecaf4fb9cf1c85c0fd99e8b53671f0ed8f78d95b933b496e930bf9e314a38fad611ea418007326b537de3ea7d316a8893950d0a6720a6aa83643d6fc8e800d7c94cf2783123de5fbb187ce581a87d1a357b9aaa94641df0334d28fc54dada438913ce69e7da968e5f4ac240b6e915a907d770b3118a9ffb18bb5a5edd39b31e6f27732a3b1556daee5fca110ac3436116483f31e5dc4d59aad60120fb9e20e21159ae626c1b0f87025e6e64360d0a2e202df8d388f4a98eda8dfd74c40b4ae1b3573bf1eab3b9ec161c7d2d5f25ebfd6abcfe0033832779c8439d4b64e0d3f2cbf5731a635a9d551347d1520c3df31a4442581337f5271267beed0d0a20201e444f2e6ae5c5a075fec3e0fcae8a87953265037502055a972bfa716206514b4e1a37e80976d4f60ccd4a2745ae98a239967b7fc52c70048133086b3316f4da819e44e0ea68afdb291951f14d5b33c0d0170727f2592319cce3e0069a5cf1eddf898a40188993833306282e7a357efe033b04d55e0d3992262d48a20be64483c333865ad7329c19c62e49f19caaa37c0d0a4c202feded620f8653b2d06c9b816dd80518c9d1dce1cbcc0875f928821471fee26472ad6cc2ae2a4b75f05dfae4a9654f1625301fbb2784d9080e85c7448551cc1ade66fd97329581f9e1b36fe1287cdeee645f87e416901062cea4e3bdb042f5d9c17a0e511b66f378fa3dccf3f809d5dad2164d00ab271cc20d0a692069f06059fa598ea32d104e014219ae8ccc3e14788fb79b35dcfff963df6ed228fbe22f4573b6f042c55497d70b7e90c1bc6d610fabdb83e0e53f1626815884f580dce278024a6ca81d62598e947e6bed51bd41764462a14441046d4fc436cd44f9fc3c0d4cd9af41ae7e7239cd79e139640d0a6b20202a6ff2bbb3241e3ff1199145a803f734acacf1c0cf3394b2a3f7349ff46d37e16248d5048fee5f26a4386e7fba4f35df18a431be05ebcccc89b16c310acde47f9b2541a380b6adcac07f02d539d76bb1fa56cb34482caf857bf97a9c53de2c383b0d0a6520b68f0dfb8f8f5c401b8fcc5c2533cf7f926f63a7785ab6f1e52de7a92667da9e4cb5162b2234469e2cd77427e9421d0b5ce3d90a545765a8662bd1ff043743234ffeb36d50f0e46d9d9095bc69bfb66b3f091c88b443da23a9c6ec36d021c55e2e48e0ccc9f10bea5c0d831b3ca20b7c6051346e7015ed7bbec794854b63b1511b4e7617c734cb9d91854cfd0d0a20204ed12678159bb0e870122a76c4694a76a913a56eb23cb21ad2f6283f52953356903c5ff32430042ffb50ac84674c52937dc7a3aff7a588ac830b9c9432af0d0a7420f3e9ada42cc8665f85fce50b09b94da70b38e887b26026c9dee1615529519bc4379b404bb94e2b10bdd1502a861bca1c39a838ef4674d9ae3f65171ee93b9510baa05546ae773584205f60589a5ca6be5005d61d5cbd2cb4ebefd3e20fdd7d5b3dd0e5a1483a2bec0bcc0f0ba58af57ce12eb8962f093d1316d645e8a37b9963cf1c46331f2a3f9a91e1a3dfbb4d496628e405a767b1e5c1e530eb7eb3fae099b5f375860fcabd00ce4c0cefa36484299a64579b1aec880d89496d0dc5bed8b00352c982a9c75f13f909df2300c9e6c79305ad19a32637d19207fe58530969433948307dbf812a82201112564fd52dffd8ea200d0a6820423ed19773461c4afead5daccb42a2e266538660d147e77f3450d8237eaa708fe49b6d9481ec5dc7121da411f11f4a0685812e84d6a9d7b5b740abcac0bd7953d0789bc2fc21354c369f7f9323882b5688368829894010230644e816e3dc41e98c341da3c2c1cc719b42d4b3f3e9ba8fe16dbf26f6bed22a3ca0aef9d07d93d92067719ad7a58fd63489a1637b5752011f579aaeb74e58dc5f08270e553793d26914f9d96180872677c1e3027a59d60d0a692049aee780f7781691ca0c0751d677f481addb0ab637864b92f9fdb962e7f4f45b6bb0488e8e0a2729d93a40323b8a11d5a58e33a57ea02c69a271d5e4922e000d0a73209ec862189cba31549faf7f8a92c1ce32773aae6cb940f6f7c67c961573a9cd4ff965a2d87f2fb0f4ef8e03c50ab1ebac0ec0cf6d09f57654cc795dfda8afe912bc4b011a4c47598fb7963df1302e75bcad5a4a41e50e6dd0191978af5cd60f1325bc1d4e7a8e6d8416cb0585194509eadfec9096d989ad676157d7d0913d51a063b1b479935ef888fb22036fc3fc7293b3b4bc3320f4a15e8ffc1af9f693d40d0a2e20c549c228021255f3ffa568da1de61d9e9918dd9ffd678de224671ce11ee7f0ccc1edff459ba94e4e32586355fa674fff47d484d8c7e4cec9a197266ececb882272047f38886716abbd413b176d760d0a2020b58940833421df4bbf670f91236063f2580937a825b43c386b50df0fb6a2d2195ba8e2c6c51563303d3c35bf3d687bff1fd6b6ffb9dddf72286ae8a015a434cfc02c1f8686ba53d56fbecf1132923ace050d0a3a29bd6b6e4ef6b489fee76441feb12d389e7cb40c0d257b13f194f7e4fc384351174c378b85a5252147e951ae8411bea60899bab63314777932c83e1270437a0b67373fceecd96a280d1045856715eaadcee254110b3b7aca46c41914f2d21654272d124de275b59729024d47ff8ab89b22fe7852477c2cbe8bac525ad9518eaa0d0a20208dd25ae30a86b787a86dfdcb430078d74ec3267a243791881ecc0b5bead8cae9b4178322240882f56dabebf7c661515dc38229a1381ecf2194884f9127a12d96c29af1f3f94962748b42be9896a62ee3e5ef808a5b66a3fa1f33f2e5b338c2cb8f60184394f6f2efe9ae1f48a639b15cf5034df7b7687f0d0a5420ed5c6e5dded93b7310a645ecf311ab939c3a486d511ece8bfb2be92fab60403d249e62f06fddf17753c454ab14b80ac4761de0bb9cef9f5c3f0d0a68204b53388a72e04c61be8f19db704a23e64df9bdabe4d704cf081c16a9c577675462b736eecb27ad8575a861f64c0d0a6520444386efd170fad91d8d9d8936ed576c7554d5cebbf18191d858e0417a874a99ef45613b1f80326b40b4a6be0d0a2020644d21522c5ad49c6f06d75270f0c599066b4708e324ff499e5ab5d321742aaf33b36685e7dd9735ed1815c54c159db55f34eeed1bab87d4bef941677f439b048f559a997f8941b76d52bc3b2b63d5f1b21f227ac9c264314bd327037d00b8c7338b472b59ffaaa242d8c2d80d0a6d20d531096696d128efc37f518d9e9e6aa4699686751bd26fb3beecd352f49664e77d84cb2b362eccd159bf981b4a8114494f33164c90e94aa50dc7540fdc0a8cbd372be4bcc8054b6568c971bf920acf39dc73e64200365382698454d18ae894c75544855d658779e10d0a6120c86cfaebccd9cc3838d447652063382df27807a6f805a3725a60b84aa121ec23a8d2cf2d8da27975c9a60afbda150864bba9d37804ac8f4338b801ef6c5bac3852f4e84048c6f72564345668501dce6b7dd6ef76f11471e7456b501e8b258b4f72e649b45dd8c2bacd04b1c299c422ccafa0f3c00e470a70c56a978297e49a072ce4b235a9a7d41a64c760c1163af16bfdb2712dffcc255bb9df4123f57ea45f944ca20d0a6920c322cefe8772fefe54881cbf0041b7851c6b93d678c4575e18243381eb714e242e2d272ac7d101a0d53f1ad82d6c00bb8d99d9065c58cc1078a969a50d0a6e20a12d37ce4348fcfd601188d842da25855b2188fe46c86dd4ad962abe6327f3423f2d51febdf7aeb0323df97f42682c0693186aa043ecd18dc1496cc1f0b78bad4a22beead3db4659b34abd7fec095eebb6c96a8e766482a887d7ceca3f67d1f938eb2d8eccbf5dfc5774f792d4d4f8179ce17991303dc511782861056675386e2e948149e98042560120b7eea7185296ccff114364269114430e1548fb97ab5f05c0b903a32bdadf4d9a9a5bd2fbf54df5707d58ee14b7390d0a2020a2b082febb143fc54d0fb300401517b70a81a3c523b20e552b076edccf4d50eb41abd68df4e5d973dec9e5bad5338640e93c73ce0896b72028dc7ff4a0e4bc1f198ffb19d10b3dfe847cdec453bd02882d115a29e657c7b5e0564e0f377f2fb20a8dddc18d360299e440efa4b60145219d2ae07fb8b150be6cd68b00f2f624d69a5be89b9aba6c3b0a3f10080c0d0a6120cb8fbc85c160203f39649d36eb817bd7d53081f3a838e4761bfa94f04f58d1e431f2276e411608db6b59f31d96ecde3e818b489ee1489ff9fd558e124856857a7bc5270b26896b1721749ce1b5a0c922b7ce4413603d1b749173bbdc191411fa4ab542def6644c499bc60d0a64209a301e1b9cdecf4ec29afc1a407d688236ce6b6ecdc311f88e3da601d720174700f66d28646480a6db83d7a9eed22e0dde0e4458a7db1b8467ee46285a4a93cfdc10f21d4dd64afef123e87a11113786de50668bfd979f93b7aae014e3f309eb6489aa0b58d9c291e17af7d6ad72b65b69b6d4bee849fa358fba208407e051f80f24d07d45b7fd41a0b9771da1caa7cc77bffe995a2e2c0dbc1b9e0e0b73a514a84ddb2f6194b77a0e400d0a7620c3ee56f272667f9d49dfa1bdd9020b738f4cb57995b999eef66c5104432a00616d23249bfafa4001e1669fcc25dbf997508a4a701c8c631fb74b20c58e2e91532c628726aa2973f73c8ddf31f01082584f85692ea5212451ab1de77232ee85d2e6d487b2585fa635cd911ae389ea51930aea15e32a54feab22c7e1462dc58f38705ed4a922dc969f463cff60bca6e5139ce54d544e0d0a6120acc62baf053e52ec5df71ea2f3f7dbc443b8e9529243880b4376f51160baaffdcfb33e1e9658a20ad2c5adc447793439020db0ac7f001459c7f65c382191bc16b54d4b3f7a38445e57337111d9fbdd1c9383ac280451b03d52e416b39a5ff91bb66bb4925f7c5bdb7bfa62def65b5f21a3bc34b8ba335e88c50fb6a4afd8bbccd874b961a6d4aec278b3ca7fd4fdfede0f69e4a410f1279ce11c8b6a20247b0d0a6e207eb70bb633a6f1d6d8efb853b7a02b729a9a2e2f5520e953dfb10928614a53063aeba01674d82bda97e8d12e41ec15c4ed2b8ea6892f696e8b9e2d0becc6c9b18d87be6f9134d3ce964b928af7ba8606b83ae3d314ff1d61048dbfeaa3893f86279f272b1c247df2fefaaf286154af8aa1458cb2f2a2456a870d0a74209763b352d43543781c8abc626a642a923e41dca0a3099c7a6bad5042a4f472f28ff1c56e8dcfa149257be840573d62e17b9355785d52d57ed42c92743ebdab64fd37e42b64f10d0a61203b634d9c6bd4ad654dd9a46d90478c1c378eb877c66e82d4751a1d53284a867b7b1f5441f160fdcff3f6735979f26d8529a0fb9ecd6368e4956c082bbd623ece0645dabb6f49fde66dcc9f1432e3c18d569baacc2a429d5109fd77d135de797ca7c805760af594938293ddaf711b991ada1a39adc06c4c62e4b6be39da7c4b1dde1120898af64d7fe2f43f4d42541c76b9b0de9365d0aeb4a2f4d20d0fc41630ec032334e07c0cb51fcb67daadc920bde27f5189b289c730196bdf99c59c9ed4a2d9131bee88e98c0d0a6720362ce1ea9c95ae5ed7b7ee5e9366355aefbf1c9d2d590adf113ed2ade0ac99739da03a21579e4151c55f972e510ca6a283456e8d779b18ae427554aea9f4083aa39bf85d1a356bc5a8a830c4c3ecc7c233f99815d552c3ed6a0d0a652009faec42d61bcc1089187b4f311111cefef0daca7131395e9d79012f3d1dd3cd848e80c81e5c36a4cef5019d9fd6b32a75dda4988fd2e3ff9cefa66a17382f800158472e0c2e182852d0a2fe5869361a574c70f397b10201908090f69581789418a2fe58f9bd3bd82217dfd34f5392b2bb182106efc458c19f878a76c08dd8c5238ba325744e5b40dd1ced6548e4ea36e896bf4c84ff3d9fe6b2e33eed1be4755ef99c02490c76708ce9694a939c5266a0773d6d39c33c8500a1745325299ad27ed8e995dd4a1878398b928c7842e05debf3823906b5c45550f22046bbb5c72181c0a19e82adf12f40326fa60ff9418332f2350d0a73204ad1d75dccca2b189073b340e724a7400431ebfa565493bfa299abd71e1906dff641fc45552f41b89695bdfb2cb8edcffab810c4a065f1d9afd2e13197a959501a9a4be65e0de7d00e300a3b848d359464b852897508beb6c84272b56ba994c4b5fba0eaee1a740316c1cae1b2c7cbc9a1551fbf51a2806789cef7602dc0bd09a03b3cc5c88f019e70e06c677fc1695165737bccf8cb150cd52438b39c21ef790b40aa376c080e0d0a20201f89710ac2330a7155bd332883260401ec8b82679b862c5caf37bf3e7f643c93e3dc7638019d6d712f3dfb4e1a33ab846120a29401ed9cce2f04c7e6b632727b1ff5a63e64a41dc043b8c22c4898f79b10a87a1eff12463ed7ab279374d454a61ef18d2eede31bbf9a6bda0d0a6f20952e6bff47e012a5b57039af3aedbb3423302c1ef445652d6728212138e46338abccd0103fb6f8039609f68e432723fa57c0bd0d0a66207e8cee6b0d534c26329f93b6148eb4ccfef411547ba1f743285c007c998cc7814d7ffbe36cdc59b60d026139c1fb4e28e32fb30d0a20209c8c71041ac5e70c9d376442ca65745dc5dd9b02203db168a3ca53d31b9649104976be6e1e2d8d6a703306413035e857029f9486fc970016f2e1f89de52b737402e354e258cbb6d45c0c6c1952d6b92aedd025e0e4c52fa5f88527bfea82970bb659a03a2d5b0c81d5123d1867a69d77bdbb1fca950676d82ce3755300a10df309407305829ef2d80d9cf602ee7d6f41fdb541b99d42e98489b24d614162bbbd8fffd08b2d18a220fc3d113b9f1f50e25ab782f53c40e58cfc5e59e6bdd66a21e3986e5e5c4f31e43d90c809c8abf8c6b4754bce3d5b1a663f200e328e8c710a599d636599847188b4e47f190ed198b7d00d0a612091e5f33a11a04e689f9d649caa1b9a90da7f557de136a8e61653a0aa104eaf330ac6367a87f99d48d8db517431690d0a202084ffd16c7c24c0fbdda88692a46f93a66e9b9cbab4aeae5c090dd61be08e7b3ba38727e94eae2bd889e2e5c6a8c3b0ed9fcdea8aba91736a452010d5096f30ac4cb9a2998ca85bbbc2bc132f76cafa531429fc8eb7561e63d8380d0a6420c3659b0977fe471d026d28bb331d1bf2247a1e99d9f9d48b00f61e0473c06290d0cc1adfa569ab7dad0730395d07f3a849e185e4fc8b2de97df2ed374b133c947ed6e5bddcb0689f7d17580adec68bc21d57d77d0a449426cdea7e7ac8e90d0a692066e62a5566731d67d8d6bcc43bf81905c7d7e8c97f1b5a196b3e98c712f4b651fa85136f9c1f7a2529806235b89346b00207af3877db29208ddaafd17e9243eed830fa80d45fd8f99063a3799adeeb06001fb6b88e9bac523dcaa8a5d9a26f7aacd46df7130d0a6720a6a45d20e2b21a34b22c17759fe3a1ff1d5928b87333a201fd005e3e43657247064b37a360b2a3a2628bc376e5778b0697f321cd15ad2a85c6a5ef9ea33219e784a64e917b6ec63e1c3a29f4b50ec40e91d5cc3157dbaee9a9309e0526617264f46a911b8eb5c193b44f1ff7d8acbb5a51e86738dbb1f42fde8f2714dbb7ab65d6f1417ebd0d0a6920848ca071dcd66a149fc305f9f1f0c3634a3f3b9b24bb980e85e60683561c5db783c76eea3bf704c4ae71598d76f4b9e40d0a7420413b2daa0a25d83a46bf55e20f64c7157887f02705e1c551f53a3197290fad606b5b0214c3cca613b3df3043f7da2b8abbd5996a6e847c701b86bb1f4a7633f2b958260da722c76425e77b962567cea6bc2c94450fc6a09b1170e4b53cc0249f67431290586ad7e07bb8528c70e25f3134b929016886c9a468ce271be5fb2c6b47070d0a6120af85faef8e71447b6b90a10ccc17cd8962b33c093b0928508c6e6186fea923e78c430d5e00e7d4d7217d01d1fdb651415f573e7bf472249055ac017c4afd86718cece36859f316981dc0222562650a681a8f503bfebe8a162c7fa80d0a6c203a3587ef3312427a1f33244412c74368acb4f00b26ff8e9cdaa0f89658fda195f31f37e3b16a292ff33a46cff8ce9fab623a0932a70c3b94700d0a2020983efc342f3e9ddb7b84c902b62dc3a71d3f0388f4859a03b1537881f36fd02ecc0bdda9f7009c0dd8e7877448c2c23cc07766e57cc0e84786780ac62187088e6185fd938f667d37c067fab76495f85c80aa5ff08e26ddcbc72cdcfd87c163765f589b4bee1a0d0a6420b01f522bbd57144fa04f6bc2b8b6c6a07a3822429525bfa14be94c442f7e6d9c945807a09708e84170b36d8dce7f4652a6cc4e84f452f5610d0a6120c0bd8ea00e1a2cbecf3466d9f5826a35bf0e8d77471bfa7d348e87613e4279e848646dc7593d8b761dc27f854a5244e7ece059f6dec39632dff07aa7df53dc39f0ad61ac31c12d806f9c1a7a5e786909e47b702b89f640cb8447a9139185367fc947743fdd0d0a74209df964bde9e9d401dc6c4b3ea5dee2b99433cfbf55db5c72c4bd30ccb19714dfd27898609c05cfc913c8531a4645b36d470a97e78a7edb17e80e69814db4815d5b8abac67485cd578a1c14c9e21fba771471ec828d16078fc810caa791e82e606f24eb3cebdf2279dfb15b310d0a61200999c496ae6b2beea515a9c27070a80c88c4cb94372225ef73bd969a6b864db7344a4710b8a0a4fce1e7a6f6b942b8298748407507db695e05c7c36673794ce9e8ff89c9d5b16b3930ae3989bc29d597b79eaecfb3f05e883fd00ed3f3ff41006421023d16a263d55a6e4e163b062232ac2b4aee521e96d90f46a5d5f4287775259c6e7484630d0a2020ee75b750481297393144bf444adac55b3513fbc15cb463365774e511d150ae908aeb505e65df7b6c71fff120512e61c15c526ce50a08d63387bd02a794d8b08edf2eda3a30869a2a74e6491b740c44f2df51d8757bdf91e12616b9e2b3e5d40df4d4337c2fa5f92d2f107f36163b52bf3cbca4b5284af1cfb3b1f5d21936c92b7260625c08d631cd8b659a678d327c38b1a1ab2accaa630d0a73204e34c9aed34ee564ebc974430327796ace0632eb4c861815cfeecc69946ffca904af8b761d7da78bdd0653bc3aef44f996518c5838851249d6abfe2a5a946f05a7733f906624be72df50a23da61f13b539d87baf6f9bdfd672c45be6c585d7e5f9c082c7b877ef1abb2be00b55b8c03cb265503d201126f7088b6117da28a301418fbf42fe0a7c8dfe8f7a629382c526c6899e0d3d45e947dc4aaf961539b1be3ce59a6793d3bda358725d527964a1a9a50313a590328ff78ccbc15e1abd63bf1dae75d3892a9bc5072f0bbbffac8621e7ab661e33e8f868e91a782f0cbd350d0a7420f6555fe503464d09267f2db9328d7521e0fca7eb1d32d5cd459c3b609d1aff4574d72a247b2463fc0ecdae1928a0e6bc0c8dffb5e290285942224ed6e348aea98c3d35a15a18310602365ac81315824cafb3c351ae3f0b7030759ff36abd135d3958b1e83928b2176bae93ac396888bd6eb64fb418ca037efc0975f095251aa5aa3ce767495400e5801adea52e0d0a72207a4ea0f8256dd47d3d40ccf6fe1cad20df157ad3f15b15fbc076f3144631cee25c5c1a98f168555bab6a55bab90d8cdeacb9afe724f9bb16c6cd771ffe9893f0ff0324892c45f6360e25cf169523bd393fc9e829eb872d70595619a5cc8cfaa4aacf13bbdd7e086aae2886b8cec116a13e707e0d0a65207b97550659ff4decc16d143a53afbae032c4375d62437045ceaf14ec6f1d0c6dcc7b666e9db69c528a7afa15da8ed657c050ae662c16a09eb9c1845f27f238f79960faaae677b6f9f3e23d20250be482291b9873d49c3cf50aa279ca952fc96882177eb3e5d9f1a994545f90592cca1f589b4080a377db2d0d0a61203a568dc3c64de5d828033e1d39a1cc97b6a07476273afe70e855599115af6ff242f712f9f14256a59d934bf17fbc84b17f0015694e6f5eb9fcf727349a0eaa0a15b94499206e3f2f8fb40f3db3230d6ad1aebd7865671d8ec3a1f0bc1b2f9afea019560b8d03b46d46be344ae52a610d6421edfc0cecfcab9a0d0a6d208978679f49857f4700fb49fbf3b5cc679a54887e5b47a4be889a85e2f367dc8a6ca9ba3f32ac1a9f23ea95799ed3654b978bdbef4660fad214a2d72d7404943ee24f795d6290673aea995ce0e65a9effbacc5b6aa31f3b3bbaadbf3830426f44cd814346e9e24e0fccf47fb506000a919f51a9b0abef9d617a2ef11736b102ee53b2b4d384b74f53d64adb5afbabf8a2ee8993fa4c10e0fa73263c6f31f1f909f6e4e245cfed6a289c010d0a202006a7bd4e663e2245d613628077aa10cec85eb8c16f1b18e6419734f84b3af451b166ad2c254642823b544a6edc144e6c26482b9b7518a8dc0783cc35d2b649fce24254d0a31951f11a0ba5ae310b67265b7468ef163d65ee44b15a4b1e2311a385289401ba4360576109c8bd9e5d63aee055017b9029618efd5b5775c8e4b0de809ac5266fc57dc2decb2d19e936178239f5665a9e0d0a6120077510931dcd7d855bb461c608ddb07fb111abb97496e47b192fa02cc24d679f9896222d96d188ad204afc5a2e701cdf6fdd59e38a6d0921d09c7cffd210464603bcf025a918b1e75998211aff991e0faa3b1d0209de83e505a5f18fd27838fca08eaa57451d4d66edb2d140b568bcf7965cea8e762d759f4c95db1a6be6dccab9bb3cb67387a49adeb719d52c334690315848f1a808f1dd0d0a7220567d92751dd5a270f46d92be6616d649a1ce1fdd36226c5f810d4dc72f6ee0c5ad1e8b2230173ff8a534ab87303e36db11ad54b90ae9036e85888567aead28f17aca48ff09bb4327c596f9ce8b0027184aae005d8b847494c883905600054573e31e1d09348fe37a5482617dc252bb0a936a7d7785ac76bca94294948ef30b0d5ef70d0a6520ce7a6132c19e77238d007bcc30737306f57f58a5542f8554c82dba91d8f1622cabb50bd9e6fd9722e7cd4cd690ccc343ea8eb6fb4d05246f87e457f8f635220acdf8bd373fbc4fd72bf9bc607557ac0a0a4f5858b6f36990bd113d66178af836aca98c4b48f83d89b124cf7602a7c795f43b162ebf9908e4d708505a26cb177e204a07ff940fc8a0c850d27692708145295983a7c931d07383cd079132755019d735890e6b4bc7493b847df2615f4076b53cbc82db00febb0d0a2020c4118525613e87b5bf89fdf7b89aa3c6c57db937cbc65528afa1d0fe0e7b39f9b0dbf8243dfcc8df6c76ea192d5e4f74df147f9796724f13a5fba24641877d3848f4864eaa04689b230639aecc7f667b801514a0e1d28cca2481a64df89c584c9225e52e971f6a0d0a63203f8ae53b47209a24359517bfb2dd4034e86ad73dacd1e0806a252169a62fb9914345a38cdf6e5227f755fa2e415df05e62ecd76a17f7666645019a36011498f3a479bdbd1104e7264d7ed1d83007a6c34621dc853c48491c1fa25c63b9279c401a67a51878ffbb7a232ea5940d0a6c20c0054b7a036bd92aea66c07fdd1e18d6a7c4895522d179ec444ea2cfb647f019963e2904d243c72a159bd6800b81a1f79a984d30ae4066a8ad9df1acecad0240e57e3c9ae04254e86e41f28687c62668cac4d27f98e120ddabed76502f0ba22b2ab9f9e721eb1f6b420c7856d5400d0a6120e4832be3558b5ec9a426eb798e50b50cf3c905c5c3461584796b17bf69087f09f85f77f354ad25e5424673f2662f117061f179259eabd1f6c4678cf42e22adb31e17e65009b9cc5e159b1aa9ca8fe16fc2c52b57a2d170bd2ee91ccb99dda9d78b48b623b611a7c70f7eb9f83c28ca8d3a39cd78699bc65cf9518f6959d522d2c5e46efc479350b20d0a7220ba97ccd6b5c159b8a44635855c860c0c4a718584fc60a1a50391862d9be3645dfee5fa9d71c6cf6646299d3888b88bf4723c5d98a1a3adbae1ea8b675e73b48540bc72762a7511393eb8e3231dd1e10d0a692062fa25468d4c7d0296517b9cdb5691e31857af79fac43522101e210915e1b84f09a9ecc05e355c6c2da603e4d172a7512fa5c6d438987185300cc349c6819f69fa2976352dfe7b431867807d63873189ad0d0a742029a137ea0756b4d411c2e7b048cc0465a185915e735592075697bdb048fc9f97a33a17d824b8b7521effcb86504237363429682305058be85166b8a3cc6e6a7d34b534da92ddc5df4a76cb5f799ce418d7920dabd20d0a79208510cdf6fc33c67d4114dd161e64b5f1c85f02b55e1a5cc8bef6d0bf705f98fec4be34ce38f25c27d61e1403eb59acf65e6e3b9ac0d508c4fc7dc9c2bc3a192c12c9b967b888722c2bbfc621ec88aedf0e4151f6ea6700974031e3d0475035b442ecba202c498434b9977f8fffa80d0a2c200ce15b24ba56eea5884e1ded5d64b9dafe0f978e93ed8c37901c21af4f63697f19493dae37a4289b08f9beaf56d45fbc40559c9de7b02828c7456ff219e9a0b90822e32004447f90819ee810dfa999d08c1f0ee395a3de3b5a7341ec577f18f7e3263a51b774d4c10677e964951195d152aa0330d50e2eaeb4dbd48e6244640ff057ca19235d46495d182e0c12e8430d0a202005f4c66bc6c871a67ca42a5682a793077d67676319d3941e4495fe5c5553f78f285fe0e1384ac9220f77b772adade6a618d095e86fc1e2f7511ccfe51acc4c8f6fed2703c2827122b412e435a3eba575db63190f4a015677e33bd815f102712ccdc9ef199496187b6198032be829ebd52d6c48163b87bbe7247251138e77ace60c1f9668ba39116b24d1c2eb2e18b82528ff712b6f76b59de1a90d0a722060fbd6549fba215c5519cc58a494f0b51c1ce1e5ca2474eab509365e490c03794103c496446f524fa7ff55b89a0113de0d673ce2f73846e606713819ac52aec59bc7910f88eb7e4a5a51de35187176f64a1d266de5f336c2694c3d975bd4bebda548fb3460ffadd3aa4c2e8df6bf440731e6bafac8dc5c76bf64d9e91e69e1efd57e0712a4d5246b28a09d9175f7268bcb751835e7ac76351d3bd5de472490620d0a6520d368bf687d6942fe025ab4258b403dee8b4f458056a6650d93c508383629d65b5103675130b50c6da685088990a8ba89b877808aac4a78225cd9300b4f56813925a7fd3454c40b1e69f7233e9ff00ca3ab2a9a5dfcc78d191cbc534f8442974a22be04d00a43eb6749edcb342ffd24a1dc9dc2f770f066c73e2b3a5d233969f2928e401064f1c9e8a420efd1a628d4a56008b29b53987e2bccfd7253b5d4ac4ebe46ba45090d0a6120f5c3068758c2f30599e9947c5ebbf02e8f7f5321d8acfeb2ba0f6e7644466ce85a624e17edabda187022ae3dcee937b95a19869d0f575735fc982a445da0cb18eb63965bb15e9bc00df46d927d70ce1fbe26e2fbfed19cb352a35d480ec73a87f6dc05c33f5c5c75d07d27227cd5c32ca267de3951a318e8fd4e40d1fd35c27d272403d96445b0dcc4f8bb057286467ebcbab76ad52ce372cac94bc1e2484ec0ee5aac00aa0c0d0a64207ab408a47ac6a643c2153baa19af7a166c4174d24cbfa4d572cd7d086828de49b655d00710595bf06d0ce848ef4c1ed7b9603245e0e21210bc43870ce792842b5b97ae0f426df9e57221ce68f174b2c9d857fb119288a51a4328fb9a8e0d92bb862e42348db78a02d5c49ce65bed181ac578551e67eca5ba3f2d94858378a53a31375fdbbfad5d4a4bda0f08a398b779ca4449cc7d47c892621035307705ae13ed326a83102958fae85af00d83d6fa4040ed7d10017bd88705e11434318b31b7c379615acb0c6423a206f5d1851528057eb91a52fc3ff10d0a61203ab9bde3659650bb7d4f2392c8a9b8be1bee7543f9d176b9082c3311e0a1d9845b7a0b3ebb40928f83a916fff58ae81fdd4dc27afc9960251ab8485ed97937f214a4e60caaf2639fa71139b1d7558a1411903ffca31ef1df61d8d81e18d2b720d200db314e9d74ed79044ac463ff4eeb27daa31bb0b7e22a0ec0e9225d8f0980009df47627105d51208c6edfa718c894d7ea92ef6e06fbad37985952038e240f3943f09e9eacab84797f0468215640f5a9f3f4b0092b374f2cdc60200fff98c513c9f61c0d0a62203e2292df4d03f1b4b7c7dc7da08cc4f73ddf99002cfc72b9ddf545b2e256dbda08167290732305d4bd42eba3d366c182e4b1714bc6ef1b9b687c5bf36090cbde3e1867d901e4e483e34005732410bc882aa45d55c87c85d243b72b0d0a69204f7a0facb3c7fd8667203faba600a0754aa13f01c2fdef444ca7d6eb456b62ea36dd8fdf9eb85cd0fea7f92931f901245b2256b71f06403b231f3a3693a6acf8d5b9bf3e1151326337aae294a0b823910aa2935cf75954eac6c67b8a1be39845d753ba61fcaba66b2cbc6155c85d867e353c62653995fe4faae5a8559b783199b7805287fc9ae1e12d0fa61a3e3bdf19e9eb6767f3324f922c6e62c0d3ca99f2867331b1fffa4aa383da4510eb78fa82213b70b07a0d0a6c20c22d550dddb53a9de08f3a4c8c5caa7e85c00dac045715c80f5331125ffc4ea6582bc008cd5a7d94efa94d0cf158d059b2109f7cb21e2df6ff42c03af7b47113017965423983a5c532637f124ae9cc4001d357a62991de2876567569aa7e058696725ce1cf977579f10c7ce3561bb34f9c93780d0a69204984c3fc7922aaa9b443000c5c898f08bd2ca34a8ac5a78a1ca9de20396ba00ae6e3161739c32cef663d9d55edb0fa82e8cf06c2c6dd7ad981e2cdbb0bb2759511a9e465fee4b0c9c6a6e39d30ec0d373f67476dea79a41a3ed7b658a98588adf06c0ff6729a0cd3d06e07e1baa5fc1a26b424ff722bb5ce303b2d41288a37a1bb1390bbc0b70d0a7420633b1a45cf71df1da79d2b7347a6d74f2203f688a9769bcb6debee88a4dd333b51550ea57afd98ea3b2ccd117d86b41b53a45574d0e98588b1a3b2d3dd570259851896eeede3e61eb4527577d36d37eea91ffdfe9513c2cea1594c3cc16e33df8dcc3e6d91ed7eff4ecc14cd41919926bff2b90d0a79208f71dfb91623d5eaa9a453a05e7f48bee3dd09267b37358b6cf1df16c9be20bcb38954b541fc9f6488d3049046027013fc11c129c8fa1fc6c942bb1568113f5285ac0c00c4ee9ec95e41e5e3e55a23c2e65abaaa0d71c71eef6e3fbf00299d86abd587d415ff2d8d66b96b99d68438fce8345a9bb792105fb5243ee10bb0900c95b352f028c4b6100b35e1b52b4dfd475a140d55d1860d0a2020d900cdd1b3a97e3b1d0f7b1f714e43649f5075c5634a8fcd54c0b846ee285a224cfac5e674a697be7c575c7c66fc611384d447f86813bd602c4abca2351e8f1413eb4f10273101c1f398eef224a9dd0dd5cf49273bb4811f17f1dc9381cce27012c6d4590d0a6120823b838f94a4b71bab513e9ae4b36f9724d0c9694db74ca546671c14deed786ff63c502aff3396b8ad576bcd76d84aeb26f68c72e8635b4ba6ea9ac6a8cdb8b4769beddeb10862b316359aa93c95a08dc7105eb74b7ef02c7bde86a1b8c8b3a41738676779978ee1f0abbcb9daf0f7022c0d0a6e2012c6853733da2cddb7c7a58f79c77a9bb2358fbb170ec124834f0c4bd55eaaf0cc1109bd0aae1bfd0d85524742a818d0b1baee8e49de15b26d0233ce050221f9e07e2f75b676a67ceca104429ddc76dbef9053e4c9f935fe865a49eb232c98568e74ab2eae757fd122ab58629289b9b2387bad7302c5b0604b27e5e4c411f0c884196d9f419998652259ea2f0bd6ef1f822efa660d0a64205e35abb814d0a87de631fcf0770dc873b1ac7533be34b4743e8b3f7e890299299c057ea5fa7bc38ff767fe9c46ebe5ab62bb29463208e239797e3353bf559b81b551d8890ba97eba5318321f288f4b3d047a49a391407929faf7e94d4d91239de55bbbdb00a140d01fc9e60f18a07b42331f759e1b10355bcfef57c9e83b397d5205a3e4b80860cc4ab712bff37a90c5234ecc941bc46c58f86c7694f1835daeee77b207b47d96b658c1d1801b3ab6fb1a9e1c54a10d0a2020894e5b722dc3d1f3a0bd306de6afd137dbb463990e773a6c9f6cc087af6845ca68e5e815006309c3f2360831c3175148b1ef65e4cec0354df0037146a8ca49201fdadbab4be559e3aa2e6ca07dc97ba73e31753f2b7325df8dff461a8350bc80f277d75f37c2c2eb80ed7f85c13e33f057200635c397668b579171415d1dd58b4561b2df2c61fab3172f61ef832ac2405f57517e1922dee8ba0f70f77450b6c1bb863f6a62ec05dc4e9aa0669e0b8d6c53a31fa2c55b223ca2d7ac0d0a65202d52efe9c927413205fe447b055d8d3f5ab36fe0bdfd85bd2a418f11ceb5b0f9180e08db00e4852ae063e5b37d30eb5ebd969709ef9d71f5f6878d56f38072e865310fbe7db01df412f700625da7fb7442055098252a2d2f8ff9d3fb984f4ebc1c1480de5a39b5a807c5392362537b724935ad92b77b841ee3cc6f102299ecdf32fde87651972444d908f8483ea071d99f865c1e47e5861e53577d32ace31ae093ea8360ce5debbe53df1ddabb460c08fbf36052523978c47bf80d0a612027c752b38854e93e460c3f8966ba3662ee1874338638f12dddae70ea9cc5be2f80c90ee4abc2286e64e1cc8789ed7ba29129b20fabbd3f6a3e1cdad4cabf09206605b3969ed8f574565e9557bdef47556cfc5d34e36e097268699d0fa5004ad84de530bd99b8acbf046de63636772944d285921aeb3d7c8b0bea2505981f453da101d2e6fdfe2a527e5fc28ab87fb52347982863086f4cf4a8b2262ff5b96ceab6fbcde257abd6c2e7eaf76b0f2b40cae11628ae72aff2ed172e727897bedf5c51fa8bc6219571fe01523e5ec882a62e1e6a15a7d0e87e2c1a02297ba1a06356e8476d1af04eea0d884877d00d0a732011d45f56e22fbe0795930925c5e643a72cf701d4b348779f3a7b03c5e6984631f7afc76bc11b599cb1f698e8abc69c8081c3fdb8c26827ab698b15ed4daace45b8930a83e86cafa4be2a974f92e5ffd684b38e11fca2d6ee43ec5d4204d1504b390c3be4f95e9f4edb754ae649ef7b06dc65f3210c8d621200498c905760a75c09445a6ee361cbed1d6d5e90a3fd497d4da9e024993e01f88cd9359488007779f8470ca381d6ce49128256ce88ad27ad949a7ff0e25b6839e09ee7e803dd2648912c002600a08af49aed472c5b31bac47a6f9f7bb80d0a65206af63cd5e96f774041e85a40d85f085ff647639ec907e6facc4998b3201591cbacc1c3527d05b8d0233f4b7dba2c542d66ad9c401f845f587a553938116165642c572b032a2111e809d9138816fed5eb722dcd02c730685516d8067b91403af5a776e0a056219595750e7b915f6f11c5d1eb1bb6a8f89726ae0efc82521736d53cf9c2587961844faa7a10acb00267ffe95845871c1e2130dbb64b74d0a2ef55b95b61f99137d4d2c1b78f18cccd8d5f490090749f780d672b9103acfc92188c06d79997fdd023924a0df69cbf5b647ee336461a3f0b28f471170d0a2020e722cffe1ea849b5aaa80ba7f1f26ad7bb0ded862ad99c4c15b1478c91f76f83f82154175acd033999e2b64ce5f805f301118abfb76f13ee2fdadf9becd2685da928732ffc094209c5e096504c5fcce0d8485735b47d548544178efae1aaf9a56e53003170c9eabc906a619c6467fda8c811b161aaecf2dc98f1255599c7104692e401b6eece678e552e228e781f9670e374a0de8fc8f15e354bc5bbcf9bfbdbcda316d1c84844a4b67a4424bd3d731938af334ea097c067106a9eb210008cb6afd258eee097084e4da11d4b57dc32854871210d0a6f20b16c8ee7abec8854d61cba7ee4bb60a69ba1e2a2c5adc3313c6e9fbbc9ba440ff315a4b9c07936790a975d57e90440374ddabfd14467395b8969dd68dd7eaf341c9510735b757ca7ffa5e3228ff0ac42a8a1af8fdd645efcd07a463c3eb681e7779e970b80092343d15aa93d5ac35d94bfbf597aeae2fe5da2f4517152fde8d4090baa3cfa6fd9f593ae112166f0dc384eb0fd13d0267750648799555f0804d555385f3de31e2edc39ff0d0a66206704b4ba924132a3e0c7ade69964c58d1b0e559767efc0e3ac73a47100095a11ee0091a0a88885293ea76be5b8427613205568f18c039e8be1d67b545c1ad31275ad780a52ee5be8afde7823e2636be5fb73098614716d98a8515dbe758cd1f67edd30d33264fb8c216957837b34f7fa818d603d5b4bc5f73076db3b1b1a48c6b37f9cce8953ae7f67f613380d0a2020f03904b8054c357ae60ec837e4eb1a9d152a0c7597e8bb99e3df4f59efa3c486b8e551e403fb267b967573a3377bcfe5c6005f6f865673889d8d8c7f6a0376f8afbcf39e78227261c116a832b5fe52d001612a36107162f81147b8a172ef2599a9376d475a98eeca6d48bc49a30d83ea935c7cae8b875186a3d12b8be6688090d061d4f6a1e5b14fe71891d973e898030d0a752099c07a05826c9eaa0f00e94268b8b4d76f2746725bb319c0041874a704dbd08cff37eced6f2d1a2c397ca36d49697b210b63a969405e88fef16c58fd6832a89255291de37aa4cc72c2a73d6157b86a5b779112ddc39382edd9333ba36d0ee96c7a859594c704ec5c290c6dd4fb86e6db7f4bff57660554e7138b7d6188bb4b77996f9e8225e02cb5fe6d109b6370fed27e3d0d0a6e20469c411026fe9816cf9ed22fb7b20b31ec11b964a508fbf099296771952baffdf597d90438e4e53714926d971aca68ca83a459eaabae572a5f7dcd37a452ef4c171ae492293454a97d21f5378a5903c086c4b692749214f25857d6849544ef12b10230b087b395348f615a044c165df80649f1ea46de553b82389ad307df29edc8d94a94a648964461edc693f86d47ffa9a81b3cbdf7e6e2e96136c1f6d5a231be03844d624d59e33b37fdf80d0a6420509801d74c88442dea5290ccaecfb341de0a0f33bedffabf2c91113cf8570db02720603423890f7b834e2dd0c8dc6f90da816eaceb1c7dd684214fe6a3bf3af22ae70539f4fb3b2f41911030371ffa0d0a652026fcc39b3a037ee05b72d5104e22081aa303754ef3afc157dd48dd9e18c1c889c3556033e3ea385b05fa28c49c3b0783b8af685b02063ce4b145d124659b8ec52f07159e302135e7f5cd237e5b19f525180d0a722057b98f5841dd11e9a7ee56cff9293bb382d082b78918c59a3934e78889d7ed3f8828930bf6e9deee084eba8caa9bf589a5acab305d9eb07cc8c3e765570ac78fa3a5098e484f9610083b1ce23ecbb01f629c29348a0d0a73201162c1601cde400947fd52913ea8401f06c03402593dd35b01652fafa547836dde6a94bff5166d07e06e4ebc760648660687a38118d540e7cc7464f221fa9f8000bf593a585c2dc3e07f084c4facca98d0701c227b67ee0ed302569c493b5660c421ae17062f81c38b50ddf90d0a7420c4d02934e558b3e19e1c7cd1ab61578e494e0f0bd3448a4a3c9de3465eb5b4ce71b9555443918320446263890d26b7c494b21447c013edaccf1d7ddbc1a25f38f21398bb36547c1c976a472c3b733014cff09b176fb8bbd1360f2f57b1da5509b09689b3b6845b65843516e418873c9fa1271a7c622d6f9d3b3d7b49f2ca3cb466fe76da3bed0b7597fdfebefc4b5c0cef015081a4d1ae3518348210060d0a6120fef0e6eaa94a61588e8403d09b4f233e1aa1e5ec82ab24c3594524e0ea21e473896a2414a8df276d712a45525f263aeff0c0a85dc01ad631dd00093151ea9f89be5045cd1b1a1b96ba2b38b1d7cc89972f9dcf570ca700d97e3828ba5f33c922f130b9382fedea2c54e0652c0a51da7e3dd6ed6e42a1150f86b18e62eff03d715b86e5052afcdf3d4dd294d99eee841b90a26d9268b73232fe8bf556071f2a0f7f88fe0a13d948adf1dbdb9d6910d43fa9739e751050953fac0d0a6e20318b7ed1cd842378e41e5ef5c0ac515c7366345e7c430458857eec676e55550cf4d7450a296928b98fa03fa75281e18f08c3b4c63620b64e431f53a5712f3c9cf7b864e2ce9aef1413b72f1f28391b90308a7e06503fea894763abf65ce0e36bdfd0a71b039684506f7c22c31f8f5b58f7e9e2bc6e9d1546480d0a6420e1f39b229f140387977acf2defad5d687e5199a25fc7e3e54dd2023036df7e68746bf1bf923d6e44d9bc581ae99bb28d0b3ad0fbdf0fd54914a6826fa12d07ff49fc539d11e90cab9fb2812b09ba3626a0a5a8d2cb02482a747e14587e6ec6f66a854ebcf754112d5d66772651786eec2fb87102fbdfe3dbc672263c4c2d0d0a69203376b674f634c799ec83ee3b1fd5a73284d66fec50447fba32c8b70ff2d136a3205c83dc2fda0e37a0e9f97713630d94d569e5400031629514cad66da8ad2cff1a07b0a7c73365a686e8771477275096707b3af22e614a4d7720237350e28d674410c753f211abad545e8a1a276b8ddd2966f46e5a0d01d80d267cbf2f6c660d0a6e2069effc528ae49e4112ce0881ae09339024667d4431ddfa0a968bef88505de574d01ebe2870e2bd68c368e29285f41a6834cff7a0b5d794f447d6ab005211a759bc98af052578cd944a3f10b62582d4a9c3a0820750eb4b9fb05562054a5cc23344dbbaf8bca6c7ec5f0962682e0873755b1962eeeed4b1204c64cfa755f7901042429e88c1c2b610f47090cf07bc86d55841c41544a1c8dda414f42db0736e9dbc019dd46e18126d0bb79a88c67e58ab0d0a6720a4a7b983c1d3fe4808911c0130c210a3ba0019c4ac9a0470afd48d688eebfab00647a1c865572e54ce89b2b9905456d4baa83eae45be83709d0473ea5b3e80f89f4d0ccf9d929c31b5ce3531d3bff2e540eb0967e974874c0f3dbd144fa55233337a7740b57f2044886c947bde4330c446a12f5a81a06c8fb26fd789f359b7ddc3716c2199e7d45e75332f1c89e518bf71e339219351ef2a4a0d0a2e20e4ef514ef69eb2cc196ebf8611334ec1aff587371a8e91e21d640cfec661c27ba31e0db979109ce958e9187bc31a9a3f51d176d56b6c5b10f1691f2bb6b4a8c41a55e1d9b3c1712c83131d3ef6cfb1cf5ee61eaefd203d0988d5d88fa410c61ce48f3d05a60065915f089f0db66e6cad0d0a20203e7cc17ff531668a03e8ba840e5440a992bce538f94ddbb81e8c4966383468329c0fc689e65e46d4b18488be8b00b7f14d29ef53761a516dd741157a80b9609dfd78c3f0b219d22bfe1cdc617e2dd194e5807eef68cd9caf6ac7c059bb6c5f26b7cd81614d5be7f82030c8450489ed9eef4ad5e335466e4e76315e40a6cbafaa7e9dfcd7e0b87394a3817ba3fca9fc4a09f2b84b280bc184fb96e78357027a24d36ba2e11f0d0a4c20b93445f22110cda9200b54daaf1f0bfad67b3ec2470b8f205213fc864fa82e12b14992b64dd8232e9ea3953c410bbd9642162df9938d644b25111a8368e8cb757ce26b4ba700e51e3d1afae490a7f7e6e4d9af9b282a834455ca2cc87b6c577c0cf72846b222f561982919c0276a2066cf13184024e40cb5965b6678f2e1328f1e067ec47fb00d0a6920554ca17873089acb6d298dcc0a99504e527fa35710343ae378a332c28542f316b9076aaee0ff9f5b61683d31022740e4e47e5c200ac2d32376dd043d6f47d8e0b583e9947ae06da7e337a456273e0acdf59d23263d7974411008162e49aa62bc06abdbf848ea47b534715758c042c18709f49c701ce7c48b3a32361696fedc4749dc0d0a6b20f7916ea5374052277b8473d149459fd49b42ce04d0e3c84db44eb15db4ca420381279f3326db892f24608929619f8bc76007a77b1cf9b6567eee5f1d76d8abe84ea5de64654a5f409d36f4fc9f24fc9c846928250ec917b930e47aa073b717bba66521c58e75a8ffff43c31dcab3080d0a65207eede4f65df954a2d57ebb2ffe290ec1d32b9c7e71004349161cd7c2e227265597fdf6ca0eae35058cc2d8e964bb81a750339aa600574095b4dbf0091a6e57146069c76f2df30178fd81f54bef9b2a1b11d912f9dc1f0638e55f68388ebf29d4a017bfd265106eaea8b3e68fa023338604bd9d7b3a776981dbbc83d699c8c8bcad7dfc6df86a7ac247484d6288e9a8e376428063b3f51b92aa19e841fba12859863e9fe6b5410d0a2020257c4b62f1e51555ffb134087a11acd287a4b8d033590240faf1cf857a79d5da73115118621869bcaf30953e02044097344db0f749b7cd3df6a5f65f2db35ffffe198ced24412a5e61ec3b3b30bbcca94d45b371f1a8bf5961db810ced1a078e5c8ec90d0a74206903e7d157671c18a0aeded00e387b64e629856732d487903ea7e5ee8e15045d4201b2907efc298e952983e27ccda2824e6f74a6e84eeda9cd1aa39e39eb9b4470ee92e184b7d1d8330461e4af0f233c4dd5b20ffc3364464db8625fd5904211c4b677f79a5c29f6d785ef0ab3df70069a791a4e1c3902b71d2214a33eabb1e90ca9125a3b0d0a6820f88f524fd0323808d6855c4c2f71c5db2f2af7fb4c8d3d33c09d3fc734963051213604dfee03b313e5208fdb740d186c193c6967c8a88aecb8a2822dc60c1b008d87f1542f0854edc33c47861442d79f8d556b903a1e689e536fbf2142f24407ba4222d8d7a9868412a9a9aa74fa0aed6b1ac8167eb08347cdc00389ccb29c6debce71f80d0a69208c23c1f0b8d92eb72b7c25b7239f24e6d4d467b26758180d0a7320690c5772a50f6dca26bfab7d1c168953fa9d5dae1cdbf6c89cc93f45a2faf6078b5348ef8081943cf005b8f6a5f5860750baa81a45f2befdc40e8dd064b3b029c8cd823fb2e53a18c0251f65bc26b7064eaa0d0a2e20489119e7391040a09191d70ff16dd52961a73fbb74913b1fbf29fc344ed575ae8994f070f14485c1da28371a823050ada4cc03a318f28f1f9ca98d467840bf71dd9b1746489442aa05de87b1780971c74b0f35e7bfe6f1ccdf29c1378ee6b7462ddaf5e2610d0a202050a69b7d9ce2d67914c85e92ecc72c1e1097235cee395b02257f175259ac93730ea2becd4f1895282fc14aa0f98806c2155624633364dae4277305ce483104d0e76ed59f3e0d0a3a290e917bf68aade88056316e361684e59ad4925b7e3cd675aa61836027e1c056f555a117d2bd4fd45cf507760abd6363f94149c566eb86b180e3498ae8e4ed0d0a2020b74016ba601b19300f6f6dd300f0b4d7119db0fe263ad3ee9f7dc4175b36a843d6b983cbfb5c381d781ea61d27102576ed07330a1cc9923f93bebf0d0a54208ae7ab43255173c03ad0bbd41a8fa6348d1ddeb9114a8463871308448fd0384bbac154aec1e4a4efe433c4ee8a4a0d0a6820df01f7578cb080f588cf6b3141867094c9765f3b1245bbebfe185581c80dfb7ab002ca47cef7e9ea5c5a1b9a65db4defcce1c9a6bbb41ed1b78bc3c6cf84fb1b38aff6712201ee69b58280337da9d2ede8868bc371359ebe10aaa681d460f375d08295a3038a28b4e6846f5c9de34aaf9aa8e4a75cb78c19a7db607bd97b96c8a79cfe10ef942743e068118f330d0a65208c63706d10716f3a638556dca971e905fafe65fb046c8da4bd5ab88517da789501f4a9f23e655154a053df358068de90deb919c0a74a5cfc74f632e6ff1f0772ee570a76d2431b8c0735431462de5bedcaed963e97cb7cbad2324a52408d91cccf8a6730ad281b3d1940ff933d93efe37dcbe1cfa00218c86ec92fa90d0a2020e6b2d2c1e783954de27288e778e76b835ce72d922bb5143c860f7c964bdcc2ad1cce4c8d65d9a6c9815ee38c6058b03bef18b8b3dd88e268700d0a6d205c52a0dc69c8cb3b736f0ca20f3ae6b78049c47268d3a777266b2f0b21480f59fcb5d9870be4e7d2e07b4c0d60d9970f79d81b03444fbd2477e60d71e86ed656749e89239710c610d73673710d0a6120d2bdcad090f6f9a0b4e0b030d233e0287a1d8593d75dc9f0b986fbdead4568b524815cb03074f76b4881badcd4976f4e420ad93bd350589d6003aa02e9d6e54cfc73018df041280d0a6920f24b22af03b00b2a61d577e3b9688cdecea331fcb5409a8edda7952899692a88c88e15521ff4ef30c25363efd03618ed432c326477e81424db17ee63175b9d3fa2d3a7c70d0a6e20632fa8c0376c0e15e278e8ab2dfa992c6946826c534e7897175529d8e8677cf44d46cb9f725ad428f40f2842059310f155e5124e1ae7f1f803b04b01033b0cf8d3b071b616bda9fb3a3896d78d239361c8efc436173d5d0d0a202063a50c95d4f103448a782e167218c45a68ae44ab75c3c19367ab89df6c6159f20ab9562ef87fc35739bacd07b44d6edc951afd019f82d1bee874f4eef7f33eaf8055affa89948e74b514591ce348c0304f8738ec4a0538a65c2cc18bc6ec102e3ed360ff5857b625481947d4857060e12a97e214273df03f7de2d1e9b79231afbe1c5a8cc90934cadefe9b600fb36febd71f107b9275b22c130af4723a92a00c2a67b2583d1b4d5c03a6721bab338631cc34c7465015af934c57da63c10000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+0000000000000000000000000000000000000000000000000000000000000000
+cleartomark
diff --git a/share/examples/BSD_daemon/README b/share/examples/BSD_daemon/README
new file mode 100644
index 000000000000..9aa1173836a9
--- /dev/null
+++ b/share/examples/BSD_daemon/README
@@ -0,0 +1,76 @@
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
+# can do whatever you want with this stuff. If we meet some day, and you think
+# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+
+This directory contains various stuff relating to the FreeBSD daemon
+logo "beastie" and graphic profile.
+
+Kirk Mckusick <mckusick@FreeBSD.org> holds the copyright to the
+BSD Daemon and you may need to get his explicit permission before
+you use it. Please see his web-page on the subject:
+ http://www.mckusick.com/beastie/mainpage/copyright.html
+
+beastie.fig
+ An Xfig(1) drawing of the 4.3 daemon.
+
+ This rendering of "beastie" was produced by Poul-Henning
+ Kamp <phk@FreeBSD.org> and is released under the "beerware"
+ license. In addition to beer Poul-Henning collects FreeBSD
+ merchandise ("nudge nudge, wink wink, he said knowingly.")
+
+ In difference from the rasterized renderings of beastie,
+ this vector-based beastie can be rendered in any size and
+ still look great.
+
+beastie.eps
+ Created from the beastie.fig with
+ fig2dev -L eps beastie.fig beastie.eps
+ patch < eps.patch
+ Before committing this, clean out the comment brought
+ over from the .fig file to avoid Dollar-FreeBSD-Dollar junk
+
+eps.patch
+ Add some comments about tweakables in the .eps file and set
+ the linecaps to round to improve visual appearance.
+
+FreeBSD.pfa
+ This is the font used for the "FreeBSD" text on the CDrom
+ products from BSDi / (Walnut Creek). It was originally
+ found on the on the WC/BSDi CDROM "Font Garden" under the
+ name "NRBWelshGillianBold", but the designer of the font,
+
+ Neil Beshoori
+ NRB Systems
+ + 44 1273 581366
+ besh@cix.compulink.co.uk
+
+ has donated a FreeBSD version of the font to us and allowed
+ us to include it in FreeBSD with no strings attached.
+
+poster.sh
+ An example of how to use the stuff above. Outputs a simple
+ FreeBSD poster suitable for A4 paper.
+
+ If you want it in A3 format instead insert the line
+ 1.41 dup scale
+ above the "/mm" definition. You can scale it to any
+ other size in similar ways.
+
+
+If you want a GIF with transparent background:
+
+ fig2dev -L gif -g '#f0f0f0' -t '#f0f0f0' beastie.fig beastie.gif
+
+If you want a PNG file:
+
+ fig2dev -L png beastie.fig beastie.png
+
+enjoy
+
+/Poul-Henning
diff --git a/share/examples/BSD_daemon/beastie.eps b/share/examples/BSD_daemon/beastie.eps
new file mode 100644
index 000000000000..587fe508c36b
--- /dev/null
+++ b/share/examples/BSD_daemon/beastie.eps
@@ -0,0 +1,1507 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: beastie.eps
+%%Creator: fig2dev Version 3.2.3 Patchlevel
+%%CreationDate: Sat Mar 3 15:57:53 2001
+%%For: $FreeBSD$
+%%BoundingBox: 0 0 384 417
+%%Magnification: 1.0000
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+
+% This controls the linethickness. I think large posters look better if
+% you use a value of 2. Small daemons looks better with a value of 1.
+/linethickness 1 def
+
+% If you want to fiddle the colors:
+% col0 below is black (the lines)
+% col3 below is cyan (the shoelaces)
+% col7 below is white (eyes, shoes)
+% col13 below is green (the shooes)
+% col20 below is red (the daemon)
+% col31 below is gold (the pitchfork)
+
+% This sets round ends on the lines, this looks better than sharp edges
+% but I have not found a way to convince xfig to do this.
+1 setlinecap
+
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+newpath 0 417 moveto 0 0 lineto 384 0 lineto 384 417 lineto closepath clip newpath
+-51.0 455.0 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {linethickness mul setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+$F2psBegin
+%%Page: 1 1
+10 setmiterlimit
+ 0.06000 0.06000 sc
+% Polyline
+30.000 slw
+n 2174 2967 m 2179 2956 l 2183 2946 l 2189 2935 l 2195 2923 l 2202 2911 l
+ 2210 2898 l 2219 2886 l 2227 2873 l 2236 2861 l 2246 2848 l
+ 2254 2839 l 2262 2829 l 2270 2818 l 2280 2807 l 2289 2795 l
+ 2299 2783 l 2309 2770 l 2319 2756 l 2329 2743 l 2338 2730 l
+ 2347 2718 l 2355 2705 l 2362 2693 l 2369 2681 l 2374 2669 l
+ 2380 2657 l 2385 2644 l 2390 2631 l 2394 2617 l 2399 2603 l
+ 2403 2588 l 2406 2573 l 2410 2558 l 2414 2543 l 2417 2528 l
+ 2420 2513 l 2423 2498 l 2427 2484 l 2430 2469 l 2434 2453 l
+ 2439 2436 l 2443 2419 l 2448 2401 l 2452 2383 l 2457 2365 l
+ 2461 2347 l 2466 2329 l 2470 2313 l 2473 2297 l 2476 2282 l
+ 2479 2269 l 2481 2256 l 2483 2240 l 2485 2224 l 2485 2209 l
+ 2485 2194 l 2485 2180 l 2483 2167 l 2482 2155 l 2480 2143 l
+ 2478 2132 l 2476 2122 l 2474 2113 l 2472 2104 l 2470 2094 l
+ 2468 2083 l 2466 2071 l 2463 2059 l 2461 2046 l 2458 2032 l
+ 2456 2019 l 2453 2005 l 2450 1990 l 2448 1975 l 2445 1962 l
+ 2442 1947 l 2439 1932 l 2437 1916 l 2433 1898 l 2430 1880 l
+ 2427 1862 l 2424 1844 l 2421 1826 l 2419 1808 l 2416 1791 l
+ 2414 1775 l 2412 1760 l 2411 1746 l 2409 1730 l 2408 1715 l
+ 2407 1699 l 2406 1684 l 2406 1668 l 2407 1653 l 2408 1638 l
+ 2409 1624 l 2410 1610 l 2412 1597 l 2415 1584 l 2418 1571 l
+ 2421 1559 l 2424 1545 l 2428 1532 l 2432 1517 l 2437 1503 l
+ 2442 1489 l 2446 1475 l 2451 1462 l 2455 1450 l 2459 1439 l
+ 2463 1429 l 2466 1420 l 2469 1411 l 2472 1403 l 2475 1395 l
+ 2479 1386 l 2483 1378 l 2489 1369 l 2495 1359 l 2502 1349 l
+ 2511 1338 l 2521 1325 l 2529 1316 l 2537 1306 l 2546 1295 l
+ 2556 1283 l 2568 1270 l 2580 1255 l 2593 1241 l 2607 1225 l
+ 2621 1209 l 2636 1193 l 2651 1178 l 2665 1162 l 2680 1147 l
+ 2694 1132 l 2709 1117 l 2723 1103 l 2735 1091 l 2748 1078 l
+ 2762 1066 l 2775 1053 l 2789 1041 l 2804 1028 l 2819 1015 l
+ 2834 1002 l 2849 989 l 2864 976 l 2879 964 l 2894 951 l
+ 2909 940 l 2924 929 l 2938 918 l 2951 908 l 2964 898 l
+ 2978 889 l 2992 878 l 3008 868 l 3023 857 l 3039 847 l
+ 3055 836 l 3071 826 l 3088 815 l 3104 805 l 3121 795 l
+ 3136 786 l 3152 777 l 3167 768 l 3181 760 l 3194 753 l
+ 3207 746 l 3219 740 l 3234 731 l 3250 724 l 3265 716 l
+ 3281 709 l 3296 703 l 3311 697 l 3325 692 l 3339 688 l
+ 3351 685 l 3363 683 l 3374 682 l 3384 682 l 3393 683 l
+ 3402 684 l 3412 687 l 3420 690 l 3429 694 l 3436 698 l
+ 3443 703 l 3448 709 l 3453 715 l 3456 720 l 3457 726 l
+ 3458 732 l 3457 738 l 3455 745 l 3450 753 l 3444 761 l
+ 3437 770 l 3429 779 l 3419 788 l 3410 797 l 3400 805 l
+ 3391 815 l 3382 822 l 3374 831 l 3365 840 l 3355 850 l
+ 3345 860 l 3335 871 l 3325 882 l 3315 893 l 3305 904 l
+ 3296 915 l 3287 925 l 3278 936 l 3269 946 l 3260 957 l
+ 3251 969 l 3242 981 l 3232 993 l 3223 1005 l 3214 1017 l
+ 3205 1029 l 3197 1040 l 3189 1050 l 3182 1060 l 3176 1069 l
+ 3168 1080 l 3161 1090 l 3154 1100 l 3148 1110 l 3141 1120 l
+ 3136 1130 l 3131 1139 l 3126 1148 l 3123 1156 l 3120 1164 l
+ 3116 1174 l 3113 1185 l 3111 1196 l 3109 1209 l 3108 1221 l
+ 3107 1233 l 3106 1245 l 3106 1257 l 3106 1268 l 3107 1281 l
+ 3107 1294 l 3109 1308 l 3110 1321 l 3112 1334 l 3114 1345 l
+ 3117 1356 l 3120 1365 l 3124 1375 l 3128 1383 l 3133 1392 l
+ 3139 1399 l 3145 1405 l 3152 1410 l 3159 1414 l 3166 1416 l
+ 3175 1418 l 3185 1419 l 3196 1418 l 3208 1416 l 3221 1414 l
+ 3234 1410 l 3248 1405 l 3258 1401 l 3268 1397 l 3280 1392 l
+ 3292 1387 l 3305 1381 l 3319 1375 l 3334 1368 l 3348 1362 l
+ 3363 1356 l 3378 1350 l 3392 1344 l 3407 1339 l 3419 1334 l
+ 3432 1329 l 3446 1325 l 3461 1320 l 3476 1316 l 3492 1311 l
+ 3509 1307 l 3525 1303 l 3542 1299 l 3559 1296 l 3575 1292 l
+ 3591 1289 l 3607 1287 l 3622 1285 l 3638 1282 l 3654 1280 l
+ 3671 1279 l 3688 1277 l 3707 1275 l 3726 1274 l 3745 1273 l
+ 3764 1272 l 3784 1272 l 3803 1271 l 3822 1271 l 3840 1272 l
+ 3858 1272 l 3875 1273 l 3890 1273 l 3906 1274 l 3923 1275 l
+ 3940 1277 l 3958 1278 l 3976 1281 l 3996 1283 l 4016 1286 l
+ 4036 1289 l 4057 1293 l 4078 1297 l 4099 1301 l 4120 1306 l
+ 4141 1311 l 4162 1317 l 4183 1323 l 4201 1328 l 4219 1333 l
+ 4238 1339 l 4257 1345 l 4278 1352 l 4299 1359 l 4320 1366 l
+ 4342 1374 l 4364 1383 l 4386 1391 l 4408 1400 l 4430 1409 l
+ 4451 1417 l 4472 1426 l 4491 1435 l 4510 1443 l 4528 1452 l
+ 4545 1460 l 4561 1468 l 4576 1476 l 4596 1487 l 4616 1499 l
+ 4634 1511 l 4652 1523 l 4669 1535 l 4686 1547 l 4701 1560 l
+ 4715 1572 l 4728 1583 l 4740 1594 l 4751 1604 l 4760 1614 l
+ 4769 1623 l 4777 1631 l 4787 1642 l 4797 1653 l 4807 1663 l
+ 4817 1672 l 4827 1681 l 4836 1689 l 4846 1696 l 4855 1701 l
+ 4864 1705 l 4874 1709 l 4882 1711 l 4891 1712 l 4902 1713 l
+ 4913 1713 l 4925 1712 l 4938 1710 l 4952 1708 l 4966 1705 l
+ 4981 1701 l 4996 1697 l 5011 1692 l 5026 1686 l 5040 1681 l
+ 5055 1675 l 5070 1668 l 5086 1661 l 5103 1653 l 5120 1644 l
+ 5136 1636 l 5153 1627 l 5169 1618 l 5184 1609 l 5198 1601 l
+ 5210 1593 l 5221 1585 l 5231 1578 l 5241 1570 l 5250 1562 l
+ 5258 1553 l 5264 1545 l 5270 1536 l 5274 1526 l 5278 1516 l
+ 5280 1505 l 5282 1494 l 5283 1483 l 5284 1471 l 5284 1459 l
+ 5285 1447 l 5285 1434 l 5284 1420 l 5284 1405 l 5283 1388 l
+ 5282 1371 l 5281 1353 l 5279 1335 l 5277 1316 l 5274 1298 l
+ 5271 1280 l 5267 1263 l 5263 1246 l 5259 1230 l 5254 1214 l
+ 5248 1198 l 5241 1181 l 5234 1165 l 5227 1148 l 5219 1131 l
+ 5210 1115 l 5202 1098 l 5193 1083 l 5185 1069 l 5178 1055 l
+ 5170 1043 l 5164 1031 l 5158 1021 l 5150 1007 l 5143 993 l
+ 5136 981 l 5131 969 l 5126 957 l 5123 947 l 5121 938 l
+ 5120 929 l 5121 922 l 5122 916 l 5125 910 l 5129 905 l
+ 5135 899 l 5141 894 l 5149 890 l 5158 886 l 5167 883 l
+ 5177 880 l 5187 879 l 5197 878 l 5208 877 l 5219 877 l
+ 5232 878 l 5245 880 l 5259 883 l 5273 887 l 5287 891 l
+ 5300 896 l 5314 902 l 5326 908 l 5335 913 l 5345 918 l
+ 5354 925 l 5365 932 l 5375 940 l 5386 949 l 5398 958 l
+ 5410 969 l 5422 980 l 5434 992 l 5446 1004 l 5458 1016 l
+ 5470 1030 l 5482 1044 l 5492 1055 l 5502 1067 l 5513 1080 l
+ 5524 1093 l 5536 1108 l 5548 1123 l 5560 1139 l 5573 1155 l
+ 5585 1172 l 5598 1189 l 5610 1206 l 5622 1223 l 5633 1240 l
+ 5644 1256 l 5654 1272 l 5663 1287 l 5673 1302 l 5681 1317 l
+ 5690 1333 l 5699 1349 l 5707 1365 l 5715 1382 l 5723 1399 l
+ 5730 1416 l 5737 1434 l 5744 1451 l 5750 1468 l 5756 1485 l
+ 5762 1502 l 5767 1518 l 5771 1534 l 5776 1549 l 5780 1563 l
+ 5783 1578 l 5787 1592 l 5790 1607 l 5794 1622 l 5797 1637 l
+ 5800 1653 l 5804 1670 l 5806 1687 l 5809 1704 l 5811 1721 l
+ 5813 1738 l 5815 1754 l 5816 1771 l 5817 1786 l 5817 1802 l
+ 5817 1817 l 5816 1832 l 5815 1847 l 5814 1862 l 5812 1877 l
+ 5810 1893 l 5807 1910 l 5803 1928 l 5799 1945 l 5794 1964 l
+ 5788 1982 l 5782 2000 l 5775 2019 l 5768 2037 l 5760 2055 l
+ 5752 2072 l 5744 2089 l 5735 2107 l 5726 2122 l 5717 2138 l
+ 5707 2155 l 5697 2172 l 5686 2190 l 5674 2208 l 5661 2227 l
+ 5647 2245 l 5634 2264 l 5619 2283 l 5605 2302 l 5590 2320 l
+ 5576 2338 l 5561 2355 l 5547 2371 l 5532 2387 l 5518 2402 l
+ 5504 2417 l 5490 2431 l 5475 2445 l 5460 2458 l 5445 2472 l
+ 5429 2486 l 5412 2500 l 5396 2514 l 5379 2527 l 5362 2540 l
+ 5346 2553 l 5330 2566 l 5314 2577 l 5299 2589 l 5284 2599 l
+ 5270 2609 l 5257 2618 l 5245 2627 l 5233 2636 l 5216 2648 l
+ 5199 2659 l 5183 2671 l 5168 2681 l 5153 2692 l 5139 2701 l
+ 5126 2710 l 5115 2718 l 5105 2724 l 5097 2730 l 5090 2734 l
+ 5085 2737 l 5081 2739 l 5078 2741 l 5075 2743 l 5073 2744 l
+ 5072 2746 l 5071 2747 l 5070 2750 l 5070 2753 l 5070 2756 l
+ 5071 2761 l 5071 2766 l 5072 2772 l 5073 2780 l 5073 2789 l
+ 5074 2798 l 5074 2809 l 5074 2821 l 5074 2834 l 5074 2849 l
+ 5074 2865 l 5073 2883 l 5073 2901 l 5072 2921 l 5070 2940 l
+ 5069 2960 l 5067 2979 l 5066 2999 l 5064 3018 l 5061 3036 l
+ 5059 3055 l 5056 3073 l 5053 3092 l 5050 3111 l 5046 3130 l
+ 5042 3150 l 5037 3170 l 5032 3190 l 5026 3211 l 5021 3231 l
+ 5015 3251 l 5008 3270 l 5002 3289 l 4996 3307 l 4989 3324 l
+ 4982 3340 l 4976 3356 l 4968 3372 l 4961 3387 l 4953 3403 l
+ 4944 3419 l 4935 3436 l 4925 3452 l 4915 3469 l 4904 3486 l
+ 4893 3503 l 4882 3519 l 4870 3535 l 4859 3550 l 4847 3565 l
+ 4835 3580 l 4823 3594 l 4812 3608 l 4799 3622 l 4786 3636 l
+ 4773 3650 l 4759 3665 l 4744 3680 l 4730 3695 l 4714 3710 l
+ 4699 3726 l 4684 3741 l 4670 3756 l 4656 3770 l 4643 3783 l
+ 4630 3796 l 4619 3808 l 4608 3819 l 4599 3830 l 4587 3843 l
+ 4576 3856 l 4565 3869 l 4556 3882 l 4547 3895 l 4539 3907 l
+ 4532 3919 l 4526 3930 l 4521 3941 l 4517 3951 l 4513 3961 l
+ 4510 3970 l 4506 3981 l 4503 3992 l 4501 4004 l 4498 4016 l
+ 4496 4029 l 4494 4042 l 4493 4054 l 4493 4066 l 4493 4078 l
+ 4493 4089 l 4493 4100 l 4494 4112 l 4496 4124 l 4498 4137 l
+ 4501 4150 l 4504 4164 l 4507 4177 l 4511 4189 l 4515 4200 l
+ 4520 4212 l 4525 4223 l 4530 4234 l 4537 4246 l 4543 4259 l
+ 4551 4272 l 4558 4284 l 4565 4297 l 4572 4309 l 4579 4320 l
+ 4585 4331 l 4591 4343 l 4597 4354 l 4603 4367 l 4609 4380 l
+ 4615 4394 l 4621 4408 l 4626 4422 l 4631 4436 l 4636 4450 l
+ 4640 4464 l 4643 4474 l 4646 4485 l 4649 4496 l 4652 4508 l
+ 4654 4521 l 4657 4534 l 4660 4549 l 4663 4563 l 4665 4579 l
+ 4667 4594 l 4669 4610 l 4671 4625 l 4673 4641 l 4675 4658 l
+ 4676 4672 l 4677 4688 l 4678 4704 l 4679 4721 l 4680 4739 l
+ 4681 4757 l 4682 4776 l 4682 4795 l 4683 4814 l 4683 4832 l
+ 4683 4851 l 4684 4868 l 4684 4884 l 4683 4900 l 4683 4915 l
+ 4683 4929 l 4682 4946 l 4682 4963 l 4681 4980 l 4679 4996 l
+ 4678 5012 l 4676 5028 l 4674 5043 l 4671 5056 l 4669 5069 l
+ 4666 5081 l 4663 5092 l 4661 5103 l 4657 5115 l 4652 5128 l
+ 4648 5141 l 4643 5154 l 4638 5168 l 4633 5181 l 4628 5194 l
+ 4624 5206 l 4621 5218 l 4618 5229 l 4616 5238 l 4615 5247 l
+ 4614 5257 l 4613 5268 l 4613 5280 l 4614 5292 l 4616 5305 l
+ 4618 5319 l 4620 5334 l 4624 5349 l 4628 5365 l 4632 5382 l
+ 4636 5395 l 4640 5410 l 4645 5425 l 4650 5442 l 4656 5460 l
+ 4663 5479 l 4670 5498 l 4677 5519 l 4685 5540 l 4693 5560 l
+ 4702 5581 l 4710 5602 l 4719 5621 l 4728 5641 l 4737 5660 l
+ 4746 5678 l 4754 5694 l 4762 5711 l 4771 5727 l 4780 5744 l
+ 4790 5762 l 4801 5779 l 4812 5797 l 4823 5814 l 4834 5832 l
+ 4846 5849 l 4859 5866 l 4871 5883 l 4883 5899 l 4895 5914 l
+ 4908 5929 l 4920 5943 l 4932 5957 l 4944 5970 l 4957 5983 l
+ 4970 5996 l 4984 6009 l 4998 6021 l 5013 6034 l 5028 6048 l
+ 5044 6061 l 5061 6074 l 5078 6087 l 5095 6099 l 5113 6112 l
+ 5130 6124 l 5147 6135 l 5164 6146 l 5181 6156 l 5198 6167 l
+ 5214 6176 l 5230 6186 l 5247 6195 l 5264 6204 l 5281 6213 l
+ 5299 6222 l 5318 6232 l 5337 6241 l 5357 6250 l 5378 6260 l
+ 5399 6269 l 5420 6278 l 5441 6287 l 5462 6295 l 5483 6303 l
+ 5503 6311 l 5523 6318 l 5543 6325 l 5563 6332 l 5582 6338 l
+ 5600 6344 l 5618 6350 l 5637 6355 l 5656 6361 l 5676 6366 l
+ 5697 6372 l 5718 6377 l 5740 6383 l 5762 6389 l 5785 6394 l
+ 5807 6400 l 5830 6405 l 5853 6410 l 5875 6416 l 5898 6421 l
+ 5919 6425 l 5941 6430 l 5962 6435 l 5983 6439 l 6004 6444 l
+ 6025 6448 l 6046 6453 l 6068 6457 l 6090 6462 l 6113 6467 l
+ 6136 6472 l 6160 6477 l 6185 6482 l 6209 6487 l 6233 6492 l
+ 6258 6497 l 6282 6502 l 6305 6507 l 6328 6512 l 6350 6517 l
+ 6371 6522 l 6391 6526 l 6411 6531 l 6430 6535 l 6448 6539 l
+ 6470 6544 l 6491 6549 l 6513 6555 l 6535 6560 l 6556 6565 l
+ 6578 6571 l 6599 6576 l 6620 6582 l 6640 6587 l 6659 6593 l
+ 6678 6598 l 6695 6603 l 6712 6608 l 6727 6613 l 6742 6618 l
+ 6756 6622 l 6772 6627 l 6788 6632 l 6803 6638 l 6819 6643 l
+ 6835 6649 l 6851 6655 l 6867 6662 l 6882 6668 l 6897 6674 l
+ 6912 6681 l 6925 6687 l 6938 6694 l 6951 6700 l 6963 6707 l
+ 6975 6713 l 6987 6721 l 7000 6728 l 7012 6736 l 7025 6745 l
+ 7038 6754 l 7051 6763 l 7063 6773 l 7075 6783 l 7086 6792 l
+ 7096 6802 l 7106 6811 l 7115 6820 l 7123 6829 l 7132 6840 l
+ 7140 6851 l 7148 6863 l 7156 6875 l 7163 6888 l 7170 6901 l
+ 7176 6914 l 7181 6927 l 7186 6940 l 7189 6951 l 7193 6963 l
+ 7196 6974 l 7198 6987 l 7200 7000 l 7202 7014 l 7203 7029 l
+ 7202 7043 l 7201 7058 l 7198 7072 l 7194 7086 l 7189 7099 l
+ 7183 7111 l 7177 7122 l 7170 7132 l 7162 7144 l 7153 7155 l
+ 7143 7167 l 7132 7179 l 7120 7190 l 7108 7201 l 7097 7211 l
+ 7085 7221 l 7074 7230 l 7063 7238 l 7054 7245 l 7044 7252 l
+ 7034 7258 l 7023 7265 l 7012 7271 l 6999 7277 l 6986 7284 l
+ 6973 7290 l 6958 7295 l 6943 7301 l 6928 7306 l 6912 7311 l
+ 6895 7316 l 6878 7321 l 6862 7325 l 6844 7330 l 6826 7334 l
+ 6806 7339 l 6786 7343 l 6764 7348 l 6742 7352 l 6720 7357 l
+ 6699 7361 l 6677 7366 l 6657 7370 l 6638 7373 l 6620 7377 l
+ 6604 7380 l 6589 7383 l 6576 7385 l 6560 7388 l 6546 7391 l
+ 6534 7393 l 6524 7396 l 6515 7398 l 6507 7400 l 6502 7403 l
+ 6498 7405 l 6495 7408 l 6493 7411 l 6493 7414 l 6493 7417 l
+ 6494 7425 l 6496 7436 l 6499 7448 l 6502 7460 l 6504 7471 l
+ 6504 7480 l 6502 7484 l 6500 7487 l 6497 7491 l 6491 7493 l
+ 6484 7495 l 6475 7497 l 6464 7499 l 6450 7500 l 6435 7500 l
+ 6418 7501 l 6408 7501 l 6396 7502 l 6384 7502 l 6370 7502 l
+ 6355 7502 l 6338 7503 l 6321 7503 l 6302 7503 l 6282 7504 l
+ 6262 7504 l 6241 7505 l 6219 7505 l 6198 7505 l 6176 7506 l
+ 6154 7506 l 6131 7507 l 6109 7507 l 6087 7508 l 6066 7509 l
+ 6044 7509 l 6022 7510 l 5999 7511 l 5975 7511 l 5951 7512 l
+ 5925 7513 l 5900 7514 l 5873 7515 l 5847 7516 l 5821 7517 l
+ 5795 7518 l 5770 7519 l 5745 7520 l 5722 7521 l 5699 7522 l
+ 5677 7523 l 5656 7524 l 5636 7525 l 5617 7526 l 5594 7527 l
+ 5571 7528 l 5549 7530 l 5528 7531 l 5506 7532 l 5485 7533 l
+ 5465 7535 l 5446 7536 l 5428 7537 l 5410 7538 l 5394 7539 l
+ 5380 7539 l 5367 7540 l 5355 7540 l 5344 7541 l 5334 7541 l
+ 5320 7541 l 5307 7541 l 5296 7540 l 5286 7539 l 5277 7538 l
+ 5270 7536 l 5266 7534 l 5262 7532 l 5261 7530 l 5260 7527 l
+ 5260 7525 l 5262 7522 l 5265 7518 l 5270 7514 l 5277 7508 l
+ 5286 7502 l 5298 7494 l 5313 7485 l 5330 7474 l 5350 7462 l
+ 5373 7449 l 5399 7435 l 5414 7426 l 5431 7417 l 5449 7407 l
+ 5468 7396 l 5488 7385 l 5510 7373 l 5533 7361 l 5556 7348 l
+ 5581 7334 l 5606 7321 l 5632 7306 l 5657 7292 l 5683 7278 l
+ 5708 7264 l 5733 7251 l 5758 7237 l 5781 7224 l 5804 7212 l
+ 5825 7200 l 5846 7189 l 5865 7178 l 5884 7168 l 5908 7154 l
+ 5932 7141 l 5954 7128 l 5975 7116 l 5996 7104 l 6016 7092 l
+ 6035 7081 l 6052 7071 l 6069 7061 l 6084 7052 l 6098 7043 l
+ 6111 7035 l 6122 7028 l 6133 7021 l 6142 7015 l 6151 7010 l
+ 6163 7001 l 6175 6993 l 6187 6985 l 6197 6977 l 6207 6971 l
+ 6217 6965 l 6225 6961 l 6232 6958 l 6238 6956 l 6244 6956 l
+ 6249 6956 l 6254 6957 l 6259 6960 l 6264 6964 l 6269 6968 l
+ 6274 6974 l 6279 6980 l 6284 6986 l 6288 6992 l 6293 6999 l
+ 6298 7007 l 6304 7016 l 6310 7026 l 6316 7036 l 6322 7046 l
+ 6328 7057 l 6333 7066 l 6338 7076 l 6342 7085 l 6346 7095 l
+ 6351 7105 l 6355 7115 l 6359 7125 l 6363 7134 l 6367 7142 l
+ 6370 7150 l 6373 7156 l 6377 7162 l 6381 7167 l 6386 7172 l
+ 6392 7177 l 6399 7182 l 6406 7185 l 6415 7188 l 6424 7190 l
+ 6435 7191 l 6444 7191 l 6455 7191 l 6467 7190 l 6481 7189 l
+ 6495 7187 l 6510 7185 l 6526 7183 l 6542 7180 l 6557 7177 l
+ 6572 7173 l 6586 7170 l 6599 7167 l 6613 7163 l 6626 7159 l
+ 6639 7155 l 6653 7151 l 6667 7146 l 6680 7141 l 6694 7136 l
+ 6706 7131 l 6719 7126 l 6730 7121 l 6741 7116 l 6752 7111 l
+ 6764 7104 l 6776 7098 l 6789 7090 l 6801 7083 l 6813 7075 l
+ 6825 7066 l 6835 7058 l 6844 7050 l 6851 7043 l 6857 7036 l
+ 6861 7030 l 6864 7024 l 6867 7017 l 6869 7010 l 6870 7004 l
+ 6870 6996 l 6869 6989 l 6867 6982 l 6865 6975 l 6862 6968 l
+ 6858 6961 l 6853 6954 l 6848 6947 l 6842 6939 l 6835 6931 l
+ 6826 6923 l 6817 6914 l 6807 6905 l 6796 6896 l 6784 6888 l
+ 6773 6879 l 6761 6871 l 6748 6864 l 6736 6857 l 6726 6852 l
+ 6716 6847 l 6705 6842 l 6694 6837 l 6681 6831 l 6667 6826 l
+ 6652 6821 l 6636 6816 l 6620 6811 l 6602 6806 l 6584 6801 l
+ 6565 6797 l 6546 6792 l 6526 6788 l 6506 6784 l 6485 6780 l
+ 6467 6777 l 6448 6774 l 6428 6770 l 6407 6767 l 6384 6764 l
+ 6361 6760 l 6337 6757 l 6312 6753 l 6286 6749 l 6259 6746 l
+ 6232 6742 l 6206 6738 l 6179 6735 l 6153 6731 l 6127 6728 l
+ 6102 6724 l 6078 6721 l 6054 6717 l 6031 6714 l 6009 6711 l
+ 5986 6707 l 5964 6704 l 5942 6700 l 5920 6696 l 5897 6693 l
+ 5874 6689 l 5851 6685 l 5828 6681 l 5805 6676 l 5783 6672 l
+ 5760 6668 l 5738 6664 l 5717 6660 l 5696 6655 l 5676 6651 l
+ 5657 6647 l 5639 6644 l 5622 6640 l 5605 6636 l 5588 6633 l
+ 5568 6628 l 5547 6623 l 5527 6619 l 5507 6614 l 5486 6609 l
+ 5465 6603 l 5444 6598 l 5423 6593 l 5402 6587 l 5382 6582 l
+ 5363 6577 l 5344 6571 l 5326 6566 l 5309 6561 l 5292 6557 l
+ 5276 6552 l 5260 6547 l 5243 6542 l 5227 6537 l 5210 6531 l
+ 5192 6526 l 5175 6520 l 5157 6514 l 5140 6508 l 5122 6502 l
+ 5105 6496 l 5089 6491 l 5073 6485 l 5058 6480 l 5044 6475 l
+ 5030 6470 l 5017 6465 l 5003 6460 l 4988 6454 l 4974 6449 l
+ 4959 6443 l 4944 6437 l 4929 6431 l 4915 6425 l 4900 6419 l
+ 4887 6413 l 4873 6407 l 4861 6401 l 4849 6395 l 4838 6389 l
+ 4827 6383 l 4814 6375 l 4801 6368 l 4788 6360 l 4775 6351 l
+ 4762 6342 l 4748 6333 l 4735 6324 l 4722 6315 l 4710 6306 l
+ 4698 6298 l 4687 6290 l 4676 6283 l 4666 6275 l 4655 6268 l
+ 4644 6260 l 4633 6252 l 4621 6244 l 4610 6236 l 4598 6227 l
+ 4587 6219 l 4577 6211 l 4566 6203 l 4557 6195 l 4547 6187 l
+ 4536 6177 l 4525 6167 l 4513 6156 l 4501 6145 l 4490 6133 l
+ 4478 6123 l 4467 6113 l 4457 6105 l 4448 6098 l 4440 6093 l
+ 4433 6089 l 4427 6086 l 4419 6085 l 4410 6084 l 4400 6086 l
+ 4388 6088 l 4373 6092 l 4356 6097 l 4337 6104 l 4316 6113 l
+ 4292 6122 l 4265 6133 l 4250 6139 l 4234 6146 l 4217 6153 l
+ 4198 6160 l 4179 6167 l 4158 6175 l 4136 6183 l 4112 6191 l
+ 4088 6199 l 4062 6207 l 4036 6215 l 4009 6223 l 3982 6230 l
+ 3954 6237 l 3926 6243 l 3897 6248 l 3869 6253 l 3841 6257 l
+ 3814 6261 l 3787 6263 l 3760 6265 l 3733 6265 l 3707 6265 l
+ 3681 6264 l 3655 6261 l 3629 6258 l 3603 6254 l 3577 6248 l
+ 3550 6242 l 3523 6235 l 3496 6227 l 3469 6218 l 3441 6208 l
+ 3414 6198 l 3387 6187 l 3361 6176 l 3335 6165 l 3310 6153 l
+ 3286 6141 l 3263 6130 l 3242 6118 l 3221 6107 l 3201 6096 l
+ 3183 6085 l 3166 6075 l 3151 6066 l 3136 6057 l 3123 6048 l
+ 3102 6035 l 3083 6022 l 3067 6011 l 3052 6000 l 3039 5990 l
+ 3028 5980 l 3019 5971 l 3010 5963 l 3003 5955 l 2997 5947 l
+ 2992 5939 l 2987 5932 l 2982 5924 l 2977 5916 l 2972 5907 l
+ 2966 5897 l 2959 5886 l 2952 5874 l 2944 5862 l 2936 5849 l
+ 2927 5835 l 2918 5821 l 2910 5807 l 2902 5793 l 2894 5780 l
+ 2886 5767 l 2879 5755 l 2873 5744 l 2865 5730 l 2858 5717 l
+ 2852 5704 l 2845 5690 l 2839 5676 l 2834 5663 l 2828 5649 l
+ 2824 5636 l 2820 5624 l 2816 5612 l 2813 5600 l 2811 5589 l
+ 2809 5578 l 2807 5566 l 2805 5554 l 2804 5541 l 2803 5528 l
+ 2802 5515 l 2801 5502 l 2801 5489 l 2801 5477 l 2801 5465 l
+ 2802 5454 l 2802 5444 l 2803 5431 l 2805 5418 l 2806 5406 l
+ 2808 5392 l 2810 5379 l 2813 5366 l 2816 5354 l 2819 5343 l
+ 2822 5332 l 2825 5322 l 2830 5309 l 2835 5297 l 2840 5284 l
+ 2846 5271 l 2852 5259 l 2857 5248 l 2862 5239 l 2866 5231 l
+ 2870 5221 l 2874 5212 l 2876 5205 l 2877 5197 l 2878 5191 l
+ 2877 5186 l 2875 5181 l 2872 5175 l 2867 5168 l 2862 5161 l
+ 2855 5154 l 2848 5146 l 2841 5139 l 2834 5131 l 2826 5122 l
+ 2817 5113 l 2809 5103 l 2802 5093 l 2795 5083 l 2789 5074 l
+ 2785 5064 l 2781 5054 l 2778 5043 l 2775 5032 l 2774 5022 l
+ 2773 5012 l 2773 5003 l 2774 4995 l 2774 4988 l 2776 4981 l
+ 2777 4974 l 2778 4968 l 2778 4962 l 2777 4957 l 2775 4953 l
+ 2772 4951 l 2766 4948 l 2756 4945 l 2745 4944 l 2732 4942 l
+ 2720 4941 l 2709 4940 l 2700 4938 l 2691 4936 l 2682 4933 l
+ 2675 4929 l 2668 4925 l 2663 4921 l 2658 4916 l 2652 4910 l
+ 2647 4904 l 2641 4898 l 2635 4892 l 2628 4888 l 2624 4885 l
+ 2620 4882 l 2614 4878 l 2607 4873 l 2599 4866 l 2589 4857 l
+ 2578 4846 l 2565 4832 l 2551 4816 l 2536 4796 l 2526 4784 l
+ 2516 4770 l 2505 4755 l 2493 4739 l 2481 4722 l 2469 4703 l
+ 2456 4683 l 2443 4663 l 2431 4643 l 2418 4622 l 2407 4601 l
+ 2396 4580 l 2386 4561 l 2377 4542 l 2369 4524 l 2363 4507 l
+ 2358 4491 l 2354 4476 l 2352 4463 l 2351 4451 l 2351 4439 l
+ 2352 4428 l 2354 4417 l 2357 4407 l 2361 4397 l 2366 4388 l
+ 2372 4379 l 2379 4370 l 2387 4362 l 2395 4355 l 2404 4348 l
+ 2414 4342 l 2424 4337 l 2434 4331 l 2445 4327 l 2455 4323 l
+ 2466 4319 l 2477 4315 l 2492 4311 l 2507 4307 l 2522 4304 l
+ 2539 4301 l 2556 4298 l 2574 4295 l 2592 4292 l 2611 4290 l
+ 2630 4288 l 2649 4287 l 2668 4285 l 2686 4284 l 2703 4284 l
+ 2720 4283 l 2736 4283 l 2752 4283 l 2769 4284 l 2787 4284 l
+ 2805 4285 l 2823 4286 l 2841 4287 l 2860 4289 l 2878 4291 l
+ 2895 4292 l 2912 4294 l 2928 4296 l 2943 4298 l 2957 4300 l
+ 2970 4302 l 2983 4304 l 2999 4306 l 3015 4308 l 3030 4311 l
+ 3046 4312 l 3061 4314 l 3075 4314 l 3088 4314 l 3099 4313 l
+ 3110 4311 l 3119 4308 l 3128 4304 l 3137 4299 l 3146 4292 l
+ 3155 4285 l 3163 4276 l 3170 4267 l 3177 4257 l 3183 4248 l
+ 3188 4238 l 3193 4229 l 3196 4219 l 3200 4209 l 3203 4199 l
+ 3205 4188 l 3207 4177 l 3208 4166 l 3208 4155 l 3208 4145 l
+ 3208 4135 l 3207 4126 l 3205 4114 l 3201 4102 l 3197 4090 l
+ 3192 4078 l 3186 4066 l 3179 4056 l 3172 4046 l 3165 4039 l
+ 3157 4031 l 3147 4025 l 3137 4019 l 3126 4013 l 3114 4007 l
+ 3102 4002 l 3091 3997 l 3081 3992 l 3072 3988 l 3063 3984 l
+ 3053 3979 l 3043 3974 l 3033 3969 l 3023 3963 l 3013 3957 l
+ 3003 3950 l 2993 3944 l 2984 3938 l 2975 3931 l 2965 3923 l
+ 2955 3915 l 2943 3906 l 2932 3897 l 2920 3888 l 2908 3879 l
+ 2896 3870 l 2885 3861 l 2873 3853 l 2863 3846 l 2853 3840 l
+ 2842 3833 l 2831 3826 l 2819 3818 l 2807 3811 l 2795 3804 l
+ 2783 3797 l 2771 3790 l 2761 3784 l 2751 3777 l 2741 3772 l
+ 2730 3764 l 2719 3757 l 2707 3750 l 2696 3743 l 2684 3735 l
+ 2672 3728 l 2660 3721 l 2649 3715 l 2638 3710 l 2627 3705 l
+ 2618 3701 l 2608 3697 l 2597 3693 l 2586 3689 l 2574 3685 l
+ 2562 3681 l 2550 3677 l 2537 3672 l 2525 3668 l 2513 3663 l
+ 2501 3659 l 2490 3654 l 2478 3649 l 2466 3643 l 2454 3636 l
+ 2441 3629 l 2428 3621 l 2414 3613 l 2401 3604 l 2388 3595 l
+ 2375 3585 l 2363 3576 l 2352 3567 l 2342 3557 l 2331 3547 l
+ 2321 3537 l 2311 3526 l 2300 3514 l 2290 3502 l 2280 3490 l
+ 2270 3477 l 2261 3465 l 2252 3454 l 2244 3443 l 2237 3433 l
+ 2231 3424 l 2223 3413 l 2216 3402 l 2209 3391 l 2202 3380 l
+ 2195 3368 l 2189 3357 l 2184 3346 l 2178 3335 l 2174 3325 l
+ 2170 3314 l 2166 3303 l 2162 3291 l 2158 3278 l 2154 3265 l
+ 2151 3251 l 2148 3237 l 2145 3223 l 2142 3211 l 2141 3199 l
+ 2139 3188 l 2138 3177 l 2137 3166 l 2136 3156 l 2136 3145 l
+ 2136 3133 l 2136 3122 l 2137 3112 l 2138 3101 l 2140 3092 l
+ 2141 3082 l 2143 3072 l 2145 3061 l 2148 3049 l 2151 3037 l
+ 2154 3025 l 2158 3012 l 2162 3000 l 2166 2988 l 2170 2977 l
+
+ cp gs col20 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 2420 6449 m 2432 6448 l 2444 6448 l 2457 6447 l 2471 6446 l 2484 6446 l
+ 2498 6445 l 2511 6445 l 2524 6445 l 2536 6445 l 2548 6445 l
+ 2560 6444 l 2572 6444 l 2584 6444 l 2597 6444 l 2610 6444 l
+ 2623 6444 l 2635 6444 l 2647 6444 l 2658 6444 l 2669 6444 l
+ 2679 6443 l 2689 6443 l 2700 6443 l 2711 6442 l 2722 6441 l
+ 2733 6440 l 2743 6439 l 2752 6437 l 2761 6435 l 2770 6433 l
+ 2780 6429 l 2790 6424 l 2801 6419 l 2812 6413 l 2822 6407 l
+ 2833 6401 l 2843 6396 l 2854 6391 l 2864 6386 l 2875 6382 l
+ 2887 6377 l 2900 6372 l 2913 6368 l 2925 6364 l 2936 6360 l
+ 2947 6356 l 2957 6352 l 2967 6348 l 2977 6344 l 2987 6339 l
+ 2997 6335 l 3006 6330 l 3013 6326 l 3021 6323 l 3029 6318 l
+ 3037 6312 l 3045 6306 l 3051 6300 l 3056 6292 l 3060 6285 l
+ 3061 6278 l 3062 6270 l 3062 6261 l 3062 6251 l 3061 6241 l
+ 3059 6232 l 3057 6223 l 3055 6215 l 3052 6207 l 3049 6198 l
+ 3046 6190 l 3042 6181 l 3038 6173 l 3034 6164 l 3030 6156 l
+ 3027 6148 l 3023 6139 l 3019 6129 l 3015 6119 l 3011 6108 l
+ 3008 6096 l 3004 6086 l 3001 6075 l 2999 6066 l 2995 6054 l
+ 2992 6041 l 2990 6029 l 2989 6018 l 2989 6009 l 2990 6003 l
+ 2991 6000 l 2992 5998 l 2995 5996 l 2997 5994 l 3001 5994 l
+ 3004 5993 l 3008 5994 l 3012 5995 l 3017 5996 l 3021 5998 l
+ 3029 6001 l 3037 6006 l 3047 6012 l 3057 6018 l 3065 6025 l
+ 3073 6031 l 3080 6038 l 3088 6044 l 3095 6051 l 3103 6057 l
+ 3110 6062 l 3118 6065 l 3126 6066 l 3136 6066 l 3147 6065 l
+ 3158 6064 l 3169 6062 l 3180 6061 l 3188 6060 l 3197 6059 l
+ 3206 6059 l 3215 6059 l 3224 6059 l 3233 6059 l 3241 6060 l
+ 3249 6060 l 3258 6060 l 3268 6061 l 3279 6062 l 3289 6064 l
+ 3297 6066 l 3305 6068 l 3312 6071 l 3320 6075 l 3327 6081 l
+ 3335 6087 l 3342 6093 l 3348 6100 l 3355 6106 l 3362 6114 l
+ 3370 6122 l 3378 6129 l 3387 6134 l 3395 6138 l 3404 6140 l
+ 3413 6140 l 3424 6140 l 3434 6138 l 3443 6137 l 3452 6136 l
+ 3460 6135 l 3468 6134 l 3477 6135 l 3484 6137 l 3491 6139 l
+ 3496 6143 l 3501 6148 l 3505 6154 l 3510 6162 l 3514 6171 l
+ 3517 6180 l 3520 6189 l 3522 6196 l 3524 6204 l 3526 6212 l
+ 3528 6221 l 3530 6229 l 3532 6238 l 3533 6245 l 3534 6253 l
+ 3535 6262 l 3536 6271 l 3538 6279 l 3539 6285 l 3541 6288 l
+ 3543 6288 l 3545 6285 l 3548 6279 l 3552 6270 l 3556 6259 l
+ 3560 6247 l 3564 6236 l 3567 6227 l 3571 6218 l 3574 6208 l
+ 3578 6198 l 3582 6188 l 3586 6178 l 3590 6169 l 3594 6161 l
+ 3598 6152 l 3602 6143 l 3607 6134 l 3612 6126 l 3617 6117 l
+ 3623 6109 l 3628 6103 l 3634 6097 l 3639 6091 l 3646 6086 l
+ 3653 6081 l 3661 6076 l 3670 6072 l 3678 6069 l 3686 6066 l
+ 3694 6064 l 3701 6062 l 3710 6060 l 3719 6059 l 3728 6058 l
+ 3737 6057 l 3746 6057 l 3755 6057 l 3763 6058 l 3770 6058 l
+ 3778 6059 l 3787 6061 l 3795 6063 l 3804 6065 l 3812 6068 l
+ 3820 6070 l 3828 6074 l 3835 6077 l 3843 6081 l 3851 6086 l
+ 3860 6091 l 3869 6096 l 3877 6102 l 3885 6107 l 3893 6112 l
+ 3900 6117 l 3908 6123 l 3916 6129 l 3924 6135 l 3931 6141 l
+ 3938 6147 l 3944 6153 l 3950 6159 l 3956 6166 l 3962 6173 l
+ 3967 6179 l 3971 6184 l 3974 6188 l 3977 6189 l 3979 6187 l
+ 3981 6182 l 3983 6175 l 3986 6168 l 3989 6161 l 3992 6157 l
+ 3995 6154 l 3999 6151 l 4004 6148 l 4010 6146 l 4016 6144 l
+ 4023 6142 l 4030 6141 l 4038 6140 l 4046 6139 l 4056 6139 l
+ 4067 6138 l 4078 6138 l 4089 6138 l 4099 6137 l 4110 6137 l
+ 4120 6137 l 4131 6136 l 4142 6135 l 4154 6134 l 4166 6133 l
+ 4177 6132 l 4188 6130 l 4198 6128 l 4208 6126 l 4218 6123 l
+ 4229 6120 l 4240 6117 l 4251 6113 l 4261 6110 l 4271 6107 l
+ 4280 6104 l 4288 6101 l 4296 6098 l 4305 6095 l 4314 6091 l
+ 4323 6088 l 4332 6085 l 4340 6081 l 4348 6078 l 4356 6074 l
+ 4365 6071 l 4374 6067 l 4383 6064 l 4392 6062 l 4401 6062 l
+ 4409 6063 l 4416 6066 l 4423 6070 l 4429 6077 l 4436 6086 l
+ 4443 6097 l 4450 6109 l 4456 6122 l 4462 6134 l 4468 6147 l
+ 4473 6157 l 4478 6168 l 4483 6180 l 4489 6192 l 4495 6205 l
+ 4501 6218 l 4507 6231 l 4513 6243 l 4518 6255 l 4524 6267 l
+ 4528 6277 l 4533 6287 l 4537 6298 l 4542 6310 l 4548 6321 l
+ 4553 6334 l 4558 6346 l 4563 6358 l 4567 6370 l 4572 6381 l
+ 4576 6392 l 4580 6403 l 4584 6414 l 4588 6425 l 4592 6437 l
+ 4596 6449 l 4600 6461 l 4604 6474 l 4608 6486 l 4611 6498 l
+ 4615 6510 l 4618 6521 l 4622 6531 l 4625 6542 l 4629 6553 l
+ 4633 6565 l 4637 6578 l 4641 6590 l 4645 6602 l 4649 6614 l
+ 4653 6625 l 4657 6635 l 4660 6644 l 4663 6653 l 4665 6660 l
+ 4667 6668 l 4669 6675 l 4670 6682 l 4670 6690 l 4669 6698 l
+ 4667 6705 l 4663 6713 l 4659 6720 l 4653 6728 l 4647 6734 l
+ 4641 6740 l 4633 6747 l 4625 6755 l 4614 6763 l 4602 6771 l
+ 4589 6781 l 4574 6790 l 4558 6800 l 4540 6810 l 4522 6820 l
+ 4503 6831 l 4482 6841 l 4461 6852 l 4447 6858 l 4431 6866 l
+ 4415 6873 l 4398 6880 l 4380 6888 l 4361 6896 l 4341 6905 l
+ 4320 6913 l 4299 6922 l 4276 6931 l 4253 6940 l 4230 6949 l
+ 4206 6957 l 4183 6966 l 4159 6974 l 4136 6982 l 4112 6990 l
+ 4089 6997 l 4067 7004 l 4045 7011 l 4022 7018 l 4001 7024 l
+ 3979 7030 l 3956 7036 l 3934 7042 l 3910 7047 l 3887 7053 l
+ 3862 7058 l 3837 7063 l 3812 7068 l 3786 7073 l 3759 7078 l
+ 3732 7083 l 3705 7087 l 3679 7091 l 3652 7095 l 3625 7098 l
+ 3599 7102 l 3573 7105 l 3547 7107 l 3522 7110 l 3497 7112 l
+ 3473 7114 l 3448 7116 l 3425 7118 l 3402 7119 l 3378 7120 l
+ 3354 7121 l 3330 7122 l 3305 7123 l 3279 7124 l 3253 7125 l
+ 3226 7125 l 3199 7125 l 3172 7126 l 3146 7126 l 3119 7125 l
+ 3092 7125 l 3066 7125 l 3041 7124 l 3016 7123 l 2992 7123 l
+ 2969 7122 l 2947 7121 l 2925 7119 l 2904 7118 l 2884 7117 l
+ 2865 7115 l 2839 7113 l 2814 7110 l 2790 7107 l 2765 7104 l
+ 2741 7101 l 2717 7097 l 2693 7092 l 2669 7087 l 2646 7082 l
+ 2624 7077 l 2603 7071 l 2582 7065 l 2563 7058 l 2545 7051 l
+ 2527 7044 l 2511 7037 l 2496 7030 l 2481 7022 l 2467 7014 l
+ 2453 7005 l 2438 6996 l 2424 6986 l 2410 6975 l 2396 6964 l
+ 2382 6952 l 2368 6939 l 2354 6926 l 2340 6913 l 2326 6899 l
+ 2313 6885 l 2300 6872 l 2288 6858 l 2276 6844 l 2264 6831 l
+ 2252 6817 l 2241 6804 l 2228 6788 l 2215 6772 l 2202 6755 l
+ 2188 6738 l 2175 6721 l 2162 6703 l 2149 6685 l 2137 6667 l
+ 2127 6650 l 2117 6633 l 2109 6617 l 2102 6602 l 2098 6588 l
+ 2094 6575 l 2093 6564 l 2094 6553 l 2096 6542 l 2101 6532 l
+ 2108 6523 l 2118 6514 l 2129 6506 l 2142 6499 l 2157 6493 l
+ 2173 6487 l 2189 6482 l 2205 6478 l 2221 6475 l 2236 6472 l
+ 2251 6470 l 2265 6468 l 2280 6465 l 2295 6463 l 2310 6461 l
+ 2324 6459 l 2338 6457 l 2352 6456 l 2365 6454 l 2377 6453 l
+ 2389 6452 l 2400 6451 l 2410 6450 l
+ cp gs col13 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 2452 4170 m 2451 4170 l 2448 4167 l 2439 4160 l 2424 4149 l 2405 4135 l
+ 2384 4118 l 2362 4102 l 2341 4086 l 2322 4071 l 2305 4059 l
+ 2290 4047 l 2277 4037 l 2265 4028 l 2254 4020 l 2242 4010 l
+ 2230 4000 l 2218 3991 l 2206 3981 l 2195 3972 l 2184 3963 l
+ 2174 3954 l 2164 3946 l 2155 3939 l 2147 3932 l 2140 3926 l
+ 2134 3920 l 2125 3912 l 2117 3905 l 2110 3897 l 2103 3891 l
+ 2098 3884 l 2093 3879 l 2090 3874 l 2088 3869 l 2087 3863 l
+ 2087 3858 l 2089 3852 l 2091 3846 l 2095 3840 l 2098 3834 l
+ 2102 3829 l 2107 3822 l 2112 3815 l 2117 3807 l 2122 3798 l
+ 2126 3790 l 2129 3784 l 2132 3776 l 2135 3768 l 2137 3760 l
+ 2140 3751 l 2142 3743 l 2144 3735 l 2146 3728 l 2147 3719 l
+ 2149 3710 l 2150 3700 l 2151 3689 l 2152 3679 l 2152 3669 l
+ 2152 3660 l 2152 3651 l 2152 3641 l 2151 3630 l 2151 3619 l
+ 2150 3609 l 2149 3598 l 2148 3589 l 2147 3579 l 2145 3570 l
+ 2143 3559 l 2140 3549 l 2138 3538 l 2135 3528 l 2132 3518 l
+ 2129 3508 l 2126 3499 l 2123 3489 l 2119 3478 l 2114 3466 l
+ 2109 3455 l 2104 3444 l 2098 3434 l 2091 3424 l 2086 3416 l
+ 2079 3408 l 2072 3400 l 2064 3392 l 2056 3384 l 2048 3376 l
+ 2040 3369 l 2032 3363 l 2025 3358 l 2018 3353 l 2010 3348 l
+ 2002 3344 l 1994 3340 l 1988 3337 l 1982 3333 l 1979 3329 l
+ 1978 3326 l 1978 3321 l 1981 3316 l 1985 3310 l 1990 3302 l
+ 1996 3294 l 2001 3286 l 2005 3277 l 2006 3269 l 2005 3262 l
+ 2002 3255 l 1995 3248 l 1985 3241 l 1974 3234 l 1961 3227 l
+ 1948 3221 l 1935 3216 l 1923 3211 l 1912 3207 l 1901 3202 l
+ 1891 3198 l 1880 3194 l 1870 3190 l 1860 3185 l 1851 3182 l
+ 1843 3178 l 1835 3174 l 1826 3170 l 1817 3165 l 1807 3160 l
+ 1797 3154 l 1787 3149 l 1777 3144 l 1767 3140 l 1759 3136 l
+ 1750 3132 l 1741 3127 l 1730 3123 l 1720 3118 l 1709 3113 l
+ 1698 3109 l 1687 3104 l 1677 3099 l 1667 3095 l 1655 3089 l
+ 1642 3083 l 1629 3077 l 1616 3072 l 1605 3067 l 1597 3065 l
+ 1590 3064 l 1586 3065 l 1585 3068 l 1585 3073 l 1588 3080 l
+ 1593 3089 l 1599 3098 l 1605 3108 l 1612 3118 l 1619 3127 l
+ 1625 3135 l 1632 3144 l 1639 3153 l 1646 3162 l 1652 3171 l
+ 1659 3180 l 1665 3189 l 1671 3198 l 1676 3207 l 1682 3217 l
+ 1688 3228 l 1694 3240 l 1700 3251 l 1706 3262 l 1711 3272 l
+ 1716 3282 l 1721 3291 l 1725 3300 l 1730 3309 l 1735 3319 l
+ 1740 3329 l 1744 3340 l 1748 3350 l 1752 3360 l 1756 3372 l
+ 1760 3384 l 1764 3397 l 1768 3410 l 1773 3422 l 1778 3433 l
+ 1782 3441 l 1787 3447 l 1791 3450 l 1795 3451 l 1800 3451 l
+ 1805 3451 l 1810 3449 l 1816 3446 l 1821 3442 l 1826 3438 l
+ 1831 3434 l 1836 3430 l 1845 3423 l 1854 3416 l 1863 3410 l
+ 1873 3405 l 1882 3402 l 1891 3402 l 1897 3403 l 1903 3406 l
+ 1910 3411 l 1917 3416 l 1924 3423 l 1931 3430 l 1938 3437 l
+ 1944 3445 l 1951 3452 l 1958 3461 l 1965 3470 l 1972 3479 l
+ 1979 3489 l 1986 3498 l 1991 3507 l 1996 3516 l 2000 3525 l
+ 2004 3534 l 2008 3544 l 2011 3554 l 2013 3564 l 2015 3574 l
+ 2017 3582 l 2018 3590 l 2020 3599 l 2021 3608 l 2021 3618 l
+ 2021 3627 l 2021 3636 l 2020 3644 l 2018 3653 l 2016 3662 l
+ 2013 3672 l 2009 3681 l 2005 3690 l 2000 3698 l 1994 3704 l
+ 1987 3711 l 1979 3718 l 1971 3724 l 1963 3730 l 1957 3735 l
+ 1950 3740 l 1944 3745 l 1937 3749 l 1931 3753 l 1924 3755 l
+ 1918 3756 l 1912 3754 l 1905 3751 l 1897 3747 l 1889 3742 l
+ 1881 3736 l 1874 3730 l 1868 3725 l 1861 3719 l 1853 3713 l
+ 1846 3707 l 1839 3701 l 1833 3696 l 1826 3691 l 1819 3686 l
+ 1812 3680 l 1804 3674 l 1796 3668 l 1789 3663 l 1784 3659 l
+ 1778 3654 l 1771 3649 l 1764 3643 l 1757 3637 l 1749 3632 l
+ 1742 3627 l 1735 3622 l 1728 3616 l 1721 3611 l 1713 3605 l
+ 1706 3598 l 1700 3592 l 1695 3585 l 1692 3578 l 1691 3571 l
+ 1691 3564 l 1693 3556 l 1697 3548 l 1702 3539 l 1707 3530 l
+ 1712 3522 l 1717 3515 l 1721 3509 l 1722 3507 l 1723 3505 l
+ 1724 3502 l 1725 3500 l 1726 3498 l 1726 3496 l 1726 3494 l
+ 1726 3493 l 1726 3491 l 1725 3489 l 1724 3487 l 1722 3486 l
+ 1720 3485 l 1718 3483 l 1716 3482 l 1713 3481 l 1709 3480 l
+ 1706 3479 l 1702 3478 l 1697 3477 l 1689 3476 l 1679 3475 l
+ 1668 3473 l 1654 3471 l 1639 3469 l 1623 3466 l 1605 3462 l
+ 1587 3457 l 1568 3452 l 1550 3446 l 1531 3439 l 1512 3431 l
+ 1495 3423 l 1477 3414 l 1459 3405 l 1440 3394 l 1421 3384 l
+ 1402 3373 l 1383 3362 l 1365 3352 l 1349 3343 l 1334 3336 l
+ 1321 3329 l 1310 3325 l 1301 3322 l 1294 3321 l 1288 3322 l
+ 1285 3325 l 1283 3330 l 1283 3337 l 1285 3346 l 1288 3356 l
+ 1292 3368 l 1297 3380 l 1304 3394 l 1310 3407 l 1317 3421 l
+ 1324 3435 l 1332 3448 l 1339 3462 l 1346 3477 l 1354 3492 l
+ 1362 3507 l 1370 3523 l 1378 3538 l 1386 3554 l 1393 3569 l
+ 1400 3583 l 1406 3597 l 1411 3609 l 1416 3620 l 1420 3631 l
+ 1426 3645 l 1430 3660 l 1434 3674 l 1438 3687 l 1441 3699 l
+ 1443 3709 l 1446 3718 l 1448 3725 l 1450 3732 l 1452 3737 l
+ 1455 3743 l 1458 3747 l 1461 3751 l 1464 3754 l 1467 3755 l
+ 1470 3756 l 1475 3756 l 1480 3754 l 1486 3750 l 1493 3746 l
+ 1500 3740 l 1507 3733 l 1513 3728 l 1519 3722 l 1526 3715 l
+ 1533 3709 l 1541 3703 l 1548 3699 l 1555 3695 l 1562 3694 l
+ 1568 3693 l 1575 3695 l 1582 3697 l 1590 3702 l 1598 3707 l
+ 1606 3713 l 1614 3719 l 1622 3726 l 1630 3733 l 1639 3740 l
+ 1649 3748 l 1660 3757 l 1670 3766 l 1680 3774 l 1689 3782 l
+ 1698 3789 l 1706 3795 l 1714 3802 l 1721 3810 l 1729 3817 l
+ 1736 3825 l 1743 3833 l 1748 3840 l 1754 3848 l 1758 3856 l
+ 1762 3865 l 1766 3874 l 1769 3885 l 1771 3895 l 1772 3904 l
+ 1772 3913 l 1770 3921 l 1767 3929 l 1762 3936 l 1756 3944 l
+ 1747 3952 l 1736 3959 l 1724 3966 l 1711 3973 l 1696 3980 l
+ 1687 3984 l 1677 3988 l 1666 3992 l 1654 3996 l 1641 4000 l
+ 1628 4004 l 1613 4008 l 1598 4011 l 1582 4014 l 1566 4016 l
+ 1551 4017 l 1535 4018 l 1519 4018 l 1503 4018 l 1487 4017 l
+ 1470 4015 l 1453 4012 l 1435 4008 l 1416 4004 l 1398 4000 l
+ 1380 3995 l 1362 3989 l 1346 3984 l 1331 3978 l 1318 3972 l
+ 1306 3967 l 1297 3962 l 1289 3957 l 1284 3953 l 1280 3950 l
+ 1277 3946 l 1274 3943 l 1272 3940 l 1271 3936 l 1270 3933 l
+ 1270 3930 l 1270 3927 l 1271 3923 l 1273 3920 l 1274 3917 l
+ 1277 3914 l 1279 3911 l 1282 3909 l 1285 3906 l 1288 3904 l
+ 1291 3901 l 1294 3899 l 1297 3897 l 1305 3892 l 1313 3886 l
+ 1321 3881 l 1329 3875 l 1336 3869 l 1343 3863 l 1348 3857 l
+ 1352 3852 l 1354 3848 l 1355 3843 l 1356 3839 l 1356 3834 l
+ 1356 3829 l 1354 3824 l 1351 3819 l 1348 3814 l 1343 3809 l
+ 1338 3805 l 1331 3801 l 1323 3797 l 1314 3794 l 1304 3790 l
+ 1292 3786 l 1278 3782 l 1263 3777 l 1247 3772 l 1229 3767 l
+ 1212 3761 l 1194 3755 l 1176 3748 l 1159 3740 l 1141 3732 l
+ 1126 3724 l 1111 3716 l 1095 3706 l 1079 3696 l 1062 3686 l
+ 1046 3675 l 1029 3664 l 1014 3654 l 998 3644 l 984 3635 l
+ 972 3627 l 960 3620 l 950 3614 l 941 3610 l 936 3608 l
+ 932 3607 l 928 3606 l 924 3605 l 921 3605 l 917 3605 l
+ 914 3605 l 912 3606 l 909 3607 l 907 3608 l 905 3610 l
+ 903 3612 l 902 3615 l 901 3618 l 900 3621 l 900 3624 l
+ 899 3628 l 899 3632 l 900 3636 l 900 3641 l 901 3645 l
+ 902 3650 l 903 3655 l 905 3660 l 906 3665 l 908 3671 l
+ 912 3681 l 916 3692 l 921 3705 l 928 3718 l 935 3733 l
+ 943 3748 l 951 3764 l 961 3781 l 970 3797 l 980 3814 l
+ 991 3830 l 1001 3846 l 1012 3862 l 1022 3878 l 1032 3891 l
+ 1042 3905 l 1053 3919 l 1064 3934 l 1076 3948 l 1089 3963 l
+ 1101 3978 l 1115 3993 l 1128 4008 l 1141 4022 l 1154 4035 l
+ 1167 4047 l 1180 4059 l 1192 4069 l 1204 4079 l 1216 4088 l
+ 1229 4098 l 1242 4107 l 1256 4115 l 1271 4123 l 1285 4131 l
+ 1301 4138 l 1316 4144 l 1331 4150 l 1347 4155 l 1362 4159 l
+ 1376 4163 l 1391 4167 l 1405 4170 l 1419 4173 l 1432 4175 l
+ 1447 4177 l 1462 4180 l 1477 4182 l 1493 4184 l 1510 4185 l
+ 1526 4186 l 1542 4187 l 1558 4188 l 1574 4188 l 1589 4188 l
+ 1603 4187 l 1616 4186 l 1629 4185 l 1643 4183 l 1658 4180 l
+ 1672 4177 l 1687 4173 l 1702 4168 l 1716 4163 l 1730 4158 l
+ 1744 4152 l 1757 4146 l 1769 4141 l 1781 4135 l 1792 4130 l
+ 1805 4124 l 1818 4117 l 1831 4110 l 1845 4103 l 1858 4096 l
+ 1871 4089 l 1882 4082 l 1893 4076 l 1902 4071 l 1909 4066 l
+ 1916 4062 l 1923 4057 l 1929 4053 l 1935 4050 l 1941 4047 l
+ 1947 4046 l 1952 4045 l 1958 4045 l 1964 4046 l 1971 4049 l
+ 1978 4052 l 1987 4057 l 1996 4064 l 2007 4071 l 2019 4080 l
+ 2031 4089 l 2043 4099 l 2055 4109 l 2067 4120 l 2079 4130 l
+ 2089 4139 l 2100 4148 l 2111 4158 l 2122 4168 l 2134 4178 l
+ 2146 4189 l 2158 4199 l 2170 4210 l 2181 4220 l 2192 4229 l
+ 2202 4238 l 2212 4246 l 2222 4254 l 2232 4262 l 2242 4271 l
+ 2254 4280 l 2267 4290 l 2281 4300 l 2296 4312 l 2309 4322 l
+ 2321 4331 l 2328 4336 l 2331 4339 l
+ 2332 4339 l gs col31 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 2876 5202 m 2877 5203 l 2880 5207 l 2887 5217 l 2897 5231 l 2908 5246 l
+ 2919 5259 l 2928 5271 l 2936 5281 l 2943 5289 l 2949 5296 l
+ 2957 5304 l 2965 5312 l 2974 5320 l 2983 5327 l 2993 5334 l
+ 3002 5341 l 3011 5347 l 3020 5352 l 3029 5358 l 3039 5364 l
+ 3050 5370 l 3062 5377 l 3073 5383 l 3084 5389 l 3094 5393 l
+ 3104 5398 l 3113 5401 l 3122 5405 l 3132 5408 l 3141 5411 l
+ 3151 5413 l 3159 5415 l 3168 5417 l 3175 5419 l 3183 5421 l
+ 3191 5423 l 3199 5424 l 3208 5426 l 3217 5428 l 3226 5430 l
+ 3234 5431 l 3242 5432 l 3250 5433 l 3259 5434 l 3268 5435 l
+ 3277 5436 l 3286 5436 l 3294 5436 l 3302 5437 l 3309 5437 l
+ 3317 5437 l 3325 5436 l 3335 5436 l 3345 5435 l 3351 5434 l
+
+ 3352 5434 l gs col0 s gr
+% Polyline
+n 3161 5427 m 3162 5427 l 3166 5430 l 3176 5436 l 3192 5446 l 3211 5457 l
+ 3231 5469 l 3249 5480 l 3266 5489 l 3280 5497 l 3293 5504 l
+ 3303 5509 l 3314 5514 l 3325 5519 l 3336 5524 l 3347 5528 l
+ 3359 5532 l 3370 5535 l 3381 5538 l 3392 5540 l 3402 5543 l
+ 3412 5544 l 3422 5546 l 3432 5548 l 3442 5550 l 3454 5551 l
+ 3466 5553 l 3478 5554 l 3491 5556 l 3503 5556 l 3514 5557 l
+ 3525 5557 l 3536 5557 l 3546 5556 l 3556 5555 l 3566 5553 l
+ 3577 5551 l 3588 5549 l 3599 5546 l 3610 5543 l 3620 5540 l
+ 3630 5537 l 3640 5534 l 3650 5531 l 3661 5528 l 3672 5525 l
+ 3683 5521 l 3695 5518 l 3707 5514 l 3719 5511 l 3731 5507 l
+ 3741 5504 l 3752 5501 l 3762 5497 l 3773 5494 l 3784 5490 l
+ 3796 5487 l 3808 5483 l 3820 5479 l 3833 5476 l 3845 5473 l
+ 3856 5470 l 3868 5468 l 3879 5465 l 3892 5463 l 3905 5461 l
+ 3919 5459 l 3934 5457 l 3949 5455 l 3963 5453 l 3977 5452 l
+ 3990 5450 l 4002 5449 l 4015 5448 l 4027 5446 l 4041 5444 l
+ 4055 5442 l 4069 5440 l 4083 5438 l 4097 5435 l 4111 5431 l
+ 4125 5428 l 4138 5424 l 4149 5420 l 4160 5416 l 4173 5412 l
+ 4186 5407 l 4199 5401 l 4213 5396 l 4226 5390 l 4239 5384 l
+ 4252 5378 l 4265 5373 l 4276 5367 l 4288 5362 l 4301 5356 l
+ 4314 5350 l 4328 5344 l 4342 5338 l 4356 5332 l 4370 5326 l
+ 4383 5320 l 4395 5315 l 4407 5310 l 4418 5305 l 4429 5300 l
+ 4441 5296 l 4452 5291 l 4464 5286 l 4476 5280 l 4487 5275 l
+ 4498 5270 l 4508 5265 l 4517 5260 l 4525 5256 l 4535 5249 l
+ 4545 5242 l 4554 5235 l 4564 5227 l 4573 5218 l 4582 5209 l
+ 4590 5200 l 4597 5191 l 4603 5183 l 4609 5174 l 4616 5164 l
+ 4624 5152 l 4633 5137 l 4643 5122 l 4651 5108 l 4658 5098 l
+ 4661 5094 l
+ 4661 5093 l gs col0 s gr
+% Polyline
+n 2640 4897 m 2643 4902 l 2647 4907 l 2652 4912 l 2656 4917 l 2661 4921 l
+ 2666 4925 l 2672 4928 l 2678 4931 l 2685 4934 l 2692 4936 l
+ 2699 4938 l 2706 4939 l 2713 4940 l 2721 4941 l 2729 4942 l
+ 2736 4943 l 2743 4944 l 2750 4944 l 2756 4945 l 2763 4946 l
+ 2770 4947 l 2776 4947 l 2781 4948 l 2786 4947 l 2792 4947 l
+ 2798 4946 l 2805 4945 l 2813 4943 l 2821 4942 l 2828 4940 l
+ 2836 4939 l 2844 4937 l 2854 4935 l 2864 4933 l 2873 4930 l
+ 2881 4928 l 2889 4925 l 2899 4921 l 2908 4916 l 2918 4911 l
+ 2926 4905 l 2934 4899 l 2940 4894 l 2946 4889 l 2952 4883 l
+ 2958 4876 l 2964 4870 l 2969 4863 l 2974 4856 l 2980 4849 l
+ 2986 4841 l 2992 4832 l 2999 4822 l 3005 4813 l 3012 4805 l
+ 3018 4796 l 3024 4787 l 3031 4778 l 3038 4770 l 3044 4762 l
+ 3050 4756 l 3055 4751 l 3059 4745 l 3064 4740 l 3068 4736 l
+ 3071 4731 l 3074 4727 l 3076 4722 l 3077 4715 l 3077 4708 l
+ 3077 4701 l 3076 4695 l 3075 4689 l 3073 4682 l 3071 4674 l
+ 3069 4667 l 3066 4661 l 3064 4656 l 3062 4650 l 3059 4644 l
+ 3056 4639 l 3054 4633 l 3051 4628 l 3048 4623 l 3044 4617 l
+ 3041 4611 l 3037 4605 l 3033 4599 l 3029 4593 l 3028 4591 l
+ 3026 4589 l 3024 4587 l 3022 4585 l 3020 4583 l 3017 4582 l
+ 3013 4581 l 3008 4581 l 3003 4582 l 2997 4584 l 2991 4586 l
+ 2983 4589 l 2975 4593 l 2966 4598 l 2956 4605 l 2945 4612 l
+ 2934 4619 l 2923 4627 l 2910 4637 l 2896 4647 l 2881 4658 l
+ 2866 4670 l 2850 4683 l 2833 4697 l 2816 4710 l 2800 4724 l
+ 2783 4738 l 2767 4751 l 2752 4764 l 2738 4776 l 2725 4788 l
+ 2713 4799 l 2702 4809 l 2692 4818 l 2679 4830 l 2668 4841 l
+ 2659 4851 l 2651 4860 l 2646 4868 l 2641 4875 l 2639 4880 l
+ 2637 4885 l 2637 4889 l 2637 4892 l 2638 4895 l
+ cp gs col20 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 2891 5190 m 2893 5191 l 2902 5194 l 2915 5198 l 2928 5203 l 2938 5206 l
+ 2947 5209 l 2955 5212 l 2964 5215 l 2974 5218 l 2983 5221 l
+ 2992 5224 l 3001 5226 l 3009 5228 l 3018 5230 l 3028 5231 l
+ 3037 5232 l 3046 5234 l 3054 5235 l 3062 5235 l 3070 5236 l
+ 3078 5237 l 3086 5237 l 3094 5238 l 3101 5238 l 3108 5239 l
+ 3115 5239 l 3123 5239 l 3131 5239 l 3139 5239 l 3145 5239 l
+ 3153 5239 l 3161 5239 l 3169 5239 l 3176 5239 l 3180 5238 l
+ 3182 5238 l 3183 5238 l 3184 5238 l 3185 5237 l 3186 5237 l
+ 3186 5236 l 3187 5236 l
+ 3187 5235 l gs col0 s gr
+% Polyline
+n 2468 6609 m 2462 6602 l 2456 6595 l 2448 6588 l 2440 6581 l 2432 6573 l
+ 2423 6566 l 2415 6559 l 2408 6553 l 2400 6547 l 2391 6540 l
+ 2382 6534 l 2373 6527 l 2363 6521 l 2353 6515 l 2344 6510 l
+ 2335 6506 l 2325 6501 l 2314 6497 l 2303 6494 l 2290 6490 l
+ 2278 6487 l 2265 6484 l 2253 6482 l 2242 6480 l 2232 6479 l
+ 2222 6478 l 2212 6476 l 2201 6476 l 2190 6475 l 2178 6474 l
+ 2167 6474 l 2155 6474 l 2144 6473 l 2134 6474 l 2122 6474 l
+ 2111 6474 l 2098 6475 l 2085 6475 l 2071 6476 l 2058 6477 l
+ 2044 6479 l 2031 6480 l 2018 6482 l 2006 6484 l 1996 6485 l
+ 1985 6487 l 1974 6489 l 1963 6491 l 1951 6493 l 1938 6496 l
+ 1926 6499 l 1913 6502 l 1900 6505 l 1887 6508 l 1875 6511 l
+ 1862 6515 l 1851 6517 l 1839 6521 l 1826 6524 l 1813 6527 l
+ 1799 6531 l 1785 6535 l 1770 6540 l 1755 6544 l 1740 6549 l
+ 1726 6553 l 1711 6558 l 1697 6563 l 1684 6567 l 1671 6572 l
+ 1656 6578 l 1640 6584 l 1624 6590 l 1608 6596 l 1592 6603 l
+ 1575 6611 l 1560 6618 l 1545 6625 l 1531 6631 l 1519 6637 l
+ 1508 6643 l 1498 6649 l 1484 6657 l 1472 6665 l 1461 6673 l
+ 1450 6682 l 1442 6690 l 1435 6697 l 1429 6704 l 1424 6710 l
+ 1418 6718 l 1413 6727 l 1409 6737 l 1406 6747 l 1404 6757 l
+ 1403 6767 l 1403 6775 l 1403 6783 l 1404 6793 l 1406 6803 l
+ 1408 6813 l 1410 6824 l 1412 6833 l 1415 6843 l 1418 6852 l
+ 1421 6861 l 1425 6871 l 1430 6881 l 1435 6891 l 1441 6901 l
+ 1446 6910 l 1453 6918 l 1459 6925 l 1467 6933 l 1476 6941 l
+ 1486 6949 l 1496 6956 l 1507 6963 l 1518 6969 l 1529 6975 l
+ 1538 6979 l 1548 6984 l 1558 6988 l 1570 6992 l 1582 6996 l
+ 1594 7000 l 1606 7004 l 1618 7007 l 1630 7010 l 1642 7013 l
+ 1654 7015 l 1667 7017 l 1680 7019 l 1695 7021 l 1710 7022 l
+ 1726 7024 l 1741 7025 l 1756 7026 l 1770 7027 l 1785 7028 l
+ 1796 7028 l 1809 7029 l 1822 7029 l 1835 7030 l 1849 7030 l
+ 1863 7030 l 1877 7031 l 1891 7031 l 1904 7031 l 1916 7032 l
+ 1928 7032 l 1939 7033 l 1952 7033 l 1965 7033 l 1979 7034 l
+ 1992 7034 l 2006 7035 l 2020 7035 l 2032 7036 l 2044 7036 l
+ 2056 7037 l 2067 7037 l 2077 7037 l 2088 7037 l 2099 7038 l
+ 2111 7038 l 2123 7038 l 2136 7038 l 2148 7038 l 2160 7038 l
+ 2172 7038 l 2183 7038 l 2191 7038 l 2200 7038 l 2209 7037 l
+ 2219 7036 l 2229 7035 l 2240 7033 l 2251 7029 l 2262 7025 l
+ 2273 7020 l 2284 7013 l 2295 7006 l 2306 6997 l 2317 6987 l
+ 2328 6976 l 2337 6964 l 2347 6951 l 2357 6937 l 2367 6922 l
+ 2377 6905 l 2388 6887 l 2398 6868 l 2408 6849 l 2418 6830 l
+ 2428 6811 l 2437 6793 l 2445 6775 l 2452 6759 l 2458 6743 l
+ 2464 6729 l 2469 6717 l 2474 6701 l 2478 6687 l 2481 6674 l
+ 2483 6663 l 2483 6653 l 2483 6643 l 2482 6635 l 2480 6628 l
+ 2478 6622 l 2475 6617 l 2472 6613 l
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 4102 4658 m 4100 4659 l 4092 4665 l 4080 4673 l 4068 4681 l 4059 4686 l
+ 4051 4690 l 4044 4693 l 4036 4696 l 4027 4698 l 4018 4700 l
+ 4009 4701 l 4001 4702 l 3994 4703 l 3986 4703 l 3978 4704 l
+ 3969 4704 l 3960 4705 l 3952 4705 l 3944 4705 l 3936 4706 l
+ 3927 4706 l 3917 4706 l 3907 4706 l 3897 4705 l 3888 4704 l
+ 3880 4703 l 3871 4701 l 3861 4699 l 3850 4696 l 3839 4693 l
+ 3829 4690 l 3819 4686 l 3811 4683 l 3802 4680 l 3793 4676 l
+ 3783 4672 l 3773 4668 l 3764 4663 l 3755 4658 l 3746 4654 l
+ 3737 4648 l 3728 4642 l 3719 4636 l 3709 4629 l 3699 4622 l
+ 3690 4615 l 3682 4609 l 3674 4603 l 3667 4597 l 3659 4591 l
+ 3651 4585 l 3643 4579 l 3635 4573 l 3627 4567 l 3619 4562 l
+ 3611 4557 l 3603 4552 l 3594 4547 l 3585 4541 l 3575 4536 l
+ 3564 4530 l 3554 4525 l 3544 4521 l 3535 4516 l 3525 4512 l
+ 3515 4507 l 3504 4503 l 3492 4499 l 3480 4494 l 3468 4490 l
+ 3456 4487 l 3445 4484 l 3435 4481 l 3425 4479 l 3414 4477 l
+ 3403 4475 l 3391 4473 l 3379 4471 l 3367 4469 l 3356 4468 l
+ 3345 4466 l 3335 4465 l 3325 4464 l 3314 4464 l 3303 4463 l
+ 3292 4462 l 3281 4462 l 3270 4462 l 3259 4462 l 3248 4462 l
+ 3238 4463 l 3229 4463 l 3217 4465 l 3204 4466 l 3192 4468 l
+ 3179 4471 l 3167 4474 l 3156 4476 l 3146 4479 l 3137 4482 l
+ 3129 4485 l 3122 4489 l 3114 4493 l 3106 4497 l 3099 4502 l
+ 3091 4506 l 3083 4511 l 3075 4517 l 3068 4521 l 3060 4526 l
+ 3050 4532 l 3039 4539 l 3025 4547 l 3010 4556 l 2996 4565 l
+ 2986 4571 l 2982 4574 l
+ 2981 4574 l gs col0 s gr
+% Polyline
+n 2940 2986 m 2939 2985 l 2932 2981 l 2920 2973 l 2905 2963 l 2891 2954 l
+ 2879 2947 l 2869 2941 l 2859 2937 l 2849 2933 l 2839 2930 l
+ 2827 2927 l 2816 2924 l 2804 2922 l 2792 2920 l 2781 2919 l
+ 2770 2918 l 2760 2918 l 2748 2917 l 2736 2918 l 2724 2918 l
+ 2712 2919 l 2700 2921 l 2689 2923 l 2679 2925 l 2669 2928 l
+ 2659 2932 l 2648 2936 l 2637 2941 l 2627 2946 l 2617 2952 l
+ 2608 2957 l 2601 2963 l 2593 2969 l 2586 2976 l 2579 2983 l
+ 2572 2991 l 2566 2999 l 2560 3008 l 2556 3016 l 2552 3024 l
+ 2548 3033 l 2545 3042 l 2542 3053 l 2540 3063 l 2538 3074 l
+ 2536 3085 l 2535 3095 l 2534 3105 l 2534 3114 l 2534 3124 l
+ 2534 3135 l 2534 3145 l 2536 3156 l 2537 3166 l 2540 3175 l
+ 2542 3184 l 2546 3193 l 2550 3202 l 2555 3212 l 2560 3222 l
+ 2567 3231 l 2573 3240 l 2579 3248 l 2586 3255 l 2592 3262 l
+ 2599 3268 l 2607 3275 l 2616 3281 l 2624 3288 l 2632 3293 l
+ 2640 3298 l 2648 3303 l 2656 3307 l 2664 3311 l 2673 3315 l
+ 2683 3319 l 2693 3323 l 2702 3326 l 2712 3329 l 2721 3331 l
+ 2730 3333 l 2740 3335 l 2750 3336 l 2762 3338 l 2773 3339 l
+ 2783 3340 l 2794 3340 l 2803 3341 l 2812 3341 l 2822 3341 l
+ 2832 3342 l 2842 3342 l 2852 3341 l 2862 3341 l 2871 3341 l
+ 2880 3340 l 2889 3339 l 2898 3339 l 2907 3337 l 2917 3336 l
+ 2926 3335 l 2935 3334 l 2944 3332 l 2951 3331 l 2961 3329 l
+ 2970 3328 l 2980 3326 l 2989 3324 l 2997 3323 l 3005 3323 l
+ 3012 3322 l 3019 3322 l 3026 3323 l 3033 3324 l 3040 3326 l
+ 3047 3329 l 3053 3332 l 3061 3336 l 3070 3340 l 3079 3344 l
+ 3088 3348 l 3097 3350 l 3107 3352 l 3117 3353 l 3129 3352 l
+ 3140 3352 l 3150 3351 l 3159 3349 l 3167 3348 l 3175 3346 l
+ 3182 3343 l 3188 3340 l 3193 3336 l 3197 3331 l 3200 3325 l
+ 3203 3317 l 3205 3308 l 3206 3298 l 3206 3287 l 3206 3278 l
+ 3205 3268 l 3204 3257 l 3201 3246 l 3198 3235 l 3195 3225 l
+ 3191 3217 l 3187 3210 l 3181 3203 l 3173 3195 l 3164 3187 l
+ 3158 3182 l
+ 3157 3181 l gs col0 s gr
+% Polyline
+n 3309 2031 m 3318 2017 l 3328 2004 l 3338 1992 l 3349 1979 l 3360 1967 l
+ 3371 1955 l 3382 1943 l 3394 1932 l 3405 1922 l 3417 1913 l
+ 3428 1904 l 3440 1895 l 3452 1886 l 3466 1878 l 3480 1869 l
+ 3495 1861 l 3511 1853 l 3528 1845 l 3544 1839 l 3561 1834 l
+ 3577 1830 l 3592 1828 l 3607 1828 l 3621 1829 l 3632 1831 l
+ 3644 1835 l 3656 1839 l 3668 1845 l 3679 1853 l 3691 1861 l
+ 3702 1871 l 3713 1882 l 3723 1893 l 3733 1904 l 3741 1916 l
+ 3749 1928 l 3756 1940 l 3762 1952 l 3767 1965 l 3772 1978 l
+ 3777 1991 l 3781 2006 l 3785 2021 l 3788 2037 l 3791 2054 l
+ 3793 2071 l 3795 2088 l 3797 2106 l 3798 2123 l 3798 2140 l
+ 3799 2157 l 3799 2174 l 3799 2189 l 3799 2205 l 3798 2222 l
+ 3798 2239 l 3797 2258 l 3796 2277 l 3795 2296 l 3793 2316 l
+ 3792 2336 l 3790 2356 l 3787 2376 l 3785 2395 l 3783 2414 l
+ 3780 2433 l 3777 2451 l 3774 2469 l 3770 2486 l 3767 2504 l
+ 3763 2522 l 3758 2541 l 3753 2560 l 3748 2580 l 3743 2599 l
+ 3737 2619 l 3731 2638 l 3724 2657 l 3718 2676 l 3711 2693 l
+ 3705 2710 l 3698 2726 l 3692 2741 l 3685 2756 l 3677 2773 l
+ 3669 2789 l 3661 2805 l 3651 2821 l 3641 2837 l 3631 2853 l
+ 3620 2869 l 3609 2884 l 3597 2899 l 3586 2912 l 3574 2925 l
+ 3562 2936 l 3551 2947 l 3539 2957 l 3527 2967 l 3514 2976 l
+ 3500 2985 l 3486 2993 l 3471 3001 l 3455 3009 l 3439 3016 l
+ 3422 3022 l 3405 3027 l 3389 3031 l 3373 3034 l 3358 3036 l
+ 3343 3037 l 3328 3038 l 3313 3037 l 3298 3036 l 3283 3033 l
+ 3267 3030 l 3251 3025 l 3235 3019 l 3219 3013 l 3204 3005 l
+ 3189 2997 l 3175 2988 l 3162 2979 l 3150 2969 l 3139 2958 l
+ 3129 2948 l 3120 2936 l 3111 2924 l 3103 2911 l 3095 2896 l
+ 3087 2881 l 3080 2865 l 3074 2849 l 3068 2832 l 3063 2816 l
+ 3059 2799 l 3055 2784 l 3052 2768 l 3049 2754 l 3047 2740 l
+ 3045 2726 l 3044 2712 l 3043 2697 l 3042 2683 l 3042 2667 l
+ 3042 2652 l 3043 2636 l 3044 2620 l 3046 2604 l 3048 2588 l
+ 3051 2572 l 3055 2557 l 3058 2542 l 3062 2526 l 3066 2512 l
+ 3071 2498 l 3076 2483 l 3081 2467 l 3088 2451 l 3094 2433 l
+ 3101 2416 l 3109 2398 l 3116 2379 l 3124 2361 l 3132 2344 l
+ 3140 2326 l 3148 2309 l 3156 2293 l 3164 2277 l 3172 2262 l
+ 3180 2247 l 3188 2231 l 3196 2216 l 3204 2200 l 3213 2184 l
+ 3222 2168 l 3232 2152 l 3241 2136 l 3250 2120 l 3260 2105 l
+ 3269 2091 l 3277 2077 l 3286 2065 l 3294 2053 l 3301 2041 l
+
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+45.000 slw
+n 2498 3459 m 2499 3459 l 2505 3459 l 2517 3459 l 2532 3460 l 2545 3461 l
+ 2555 3461 l 2563 3462 l 2571 3464 l 2579 3467 l 2587 3471 l
+ 2595 3476 l 2603 3481 l 2610 3488 l 2617 3495 l 2623 3501 l
+ 2629 3507 l 2636 3514 l 2643 3522 l 2651 3530 l 2658 3538 l
+ 2665 3546 l 2672 3553 l 2679 3560 l 2686 3568 l 2693 3576 l
+ 2701 3584 l 2708 3592 l 2716 3599 l 2723 3606 l 2730 3613 l
+ 2737 3620 l 2744 3627 l 2752 3634 l 2761 3642 l 2769 3649 l
+ 2777 3657 l 2785 3664 l 2792 3672 l 2799 3679 l 2807 3687 l
+ 2815 3695 l 2824 3704 l 2833 3713 l 2841 3722 l 2850 3730 l
+ 2859 3737 l 2866 3743 l 2874 3749 l 2883 3756 l 2892 3762 l
+ 2902 3769 l 2911 3775 l 2921 3781 l 2931 3787 l 2940 3793 l
+ 2950 3798 l 2959 3803 l 2969 3809 l 2979 3814 l 2990 3820 l
+ 3001 3826 l 3012 3831 l 3024 3836 l 3035 3841 l 3045 3845 l
+ 3056 3849 l 3066 3853 l 3077 3856 l 3089 3859 l 3101 3862 l
+ 3114 3865 l 3127 3868 l 3141 3870 l 3154 3872 l 3166 3874 l
+ 3179 3876 l 3189 3877 l 3201 3878 l 3212 3879 l 3225 3879 l
+ 3238 3880 l 3251 3880 l 3264 3881 l 3277 3881 l 3289 3881 l
+ 3301 3881 l 3312 3880 l 3323 3880 l 3336 3879 l 3349 3878 l
+ 3362 3876 l 3376 3875 l 3390 3872 l 3404 3870 l 3417 3867 l
+ 3430 3864 l 3442 3860 l 3454 3857 l 3466 3852 l 3478 3848 l
+ 3491 3843 l 3504 3837 l 3518 3831 l 3531 3825 l 3544 3818 l
+ 3556 3813 l 3568 3807 l 3579 3802 l 3590 3796 l 3601 3791 l
+ 3612 3785 l 3624 3780 l 3636 3774 l 3647 3768 l 3659 3762 l
+ 3670 3756 l 3681 3750 l 3692 3744 l 3703 3738 l 3715 3731 l
+ 3727 3724 l 3739 3717 l 3751 3709 l 3764 3701 l 3775 3693 l
+ 3785 3686 l 3795 3680 l 3803 3673 l 3812 3666 l 3821 3658 l
+ 3829 3650 l 3837 3643 l 3844 3637 l 3852 3631 l 3859 3626 l
+ 3866 3622 l 3873 3619 l 3881 3617 l 3891 3614 l 3901 3613 l
+ 3910 3612 l 3920 3611 l 3928 3610 l 3936 3610 l 3945 3610 l
+ 3954 3609 l 3964 3609 l 3975 3609 l 3982 3609 l
+ 3983 3609 l gs col0 s gr
+% Polyline
+30.000 slw
+n 2870 2736 m 2876 2727 l 2882 2719 l 2888 2710 l 2895 2701 l 2901 2690 l
+ 2907 2679 l 2913 2667 l 2919 2654 l 2925 2640 l 2931 2625 l
+ 2935 2612 l 2940 2599 l 2945 2585 l 2950 2569 l 2956 2552 l
+ 2962 2534 l 2967 2515 l 2973 2496 l 2979 2477 l 2985 2459 l
+ 2991 2440 l 2996 2423 l 3001 2406 l 3006 2390 l 3011 2374 l
+ 3016 2359 l 3021 2343 l 3026 2327 l 3031 2311 l 3036 2295 l
+ 3041 2279 l 3046 2264 l 3051 2249 l 3056 2235 l 3061 2222 l
+ 3065 2210 l 3069 2199 l 3073 2188 l 3078 2175 l 3083 2163 l
+ 3088 2151 l 3092 2139 l 3097 2127 l 3102 2114 l 3107 2102 l
+ 3112 2091 l 3117 2080 l 3121 2070 l 3125 2060 l 3129 2051 l
+ 3133 2039 l 3138 2028 l 3142 2016 l 3147 2003 l 3152 1991 l
+ 3156 1979 l 3160 1968 l 3164 1957 l 3167 1948 l 3170 1939 l
+ 3173 1929 l 3176 1919 l 3179 1909 l 3180 1899 l 3181 1889 l
+ 3180 1879 l 3179 1869 l 3176 1859 l 3173 1851 l 3170 1844 l
+ 3166 1836 l 3161 1827 l 3155 1819 l 3149 1811 l 3141 1803 l
+ 3133 1796 l 3125 1790 l 3116 1785 l 3107 1782 l 3098 1780 l
+ 3088 1778 l 3077 1778 l 3066 1780 l 3053 1782 l 3040 1785 l
+ 3027 1789 l 3014 1794 l 3001 1800 l 2989 1805 l 2978 1811 l
+ 2967 1816 l 2958 1822 l 2947 1829 l 2936 1836 l 2926 1843 l
+ 2916 1851 l 2906 1860 l 2896 1870 l 2886 1880 l 2876 1891 l
+ 2866 1902 l 2856 1915 l 2848 1924 l 2840 1934 l 2831 1946 l
+ 2822 1958 l 2812 1971 l 2801 1986 l 2790 2000 l 2780 2016 l
+ 2769 2031 l 2758 2047 l 2748 2062 l 2738 2077 l 2729 2092 l
+ 2720 2107 l 2711 2122 l 2702 2137 l 2693 2153 l 2684 2169 l
+ 2675 2185 l 2666 2202 l 2658 2219 l 2650 2235 l 2642 2251 l
+ 2635 2265 l 2628 2279 l 2622 2292 l 2616 2304 l 2611 2315 l
+ 2605 2327 l 2600 2339 l 2595 2350 l 2591 2361 l 2586 2373 l
+ 2582 2385 l 2578 2396 l 2575 2408 l 2572 2421 l 2569 2433 l
+ 2566 2446 l 2564 2460 l 2562 2472 l 2560 2486 l 2558 2500 l
+ 2557 2516 l 2555 2533 l 2554 2551 l 2553 2568 l 2552 2586 l
+ 2551 2604 l 2551 2621 l 2552 2637 l 2552 2652 l 2553 2666 l
+ 2555 2680 l 2558 2697 l 2562 2713 l 2567 2728 l 2573 2742 l
+ 2579 2756 l 2586 2768 l 2593 2779 l 2600 2788 l 2607 2796 l
+ 2614 2803 l 2622 2810 l 2630 2817 l 2639 2824 l 2648 2829 l
+ 2658 2834 l 2667 2838 l 2677 2841 l 2686 2843 l 2696 2845 l
+ 2708 2845 l 2720 2845 l 2733 2844 l 2747 2841 l 2760 2838 l
+ 2772 2832 l 2783 2826 l 2792 2820 l 2802 2813 l 2811 2804 l
+ 2821 2795 l 2830 2785 l 2839 2774 l 2848 2764 l 2856 2754 l
+ 2863 2744 l
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 3489 1649 m 3490 1649 l 3494 1646 l 3504 1640 l 3520 1632 l 3539 1622 l
+ 3559 1611 l 3578 1601 l 3596 1593 l 3612 1586 l 3626 1581 l
+ 3639 1577 l 3652 1573 l 3665 1571 l 3678 1569 l 3692 1568 l
+ 3706 1568 l 3721 1568 l 3736 1569 l 3751 1571 l 3766 1573 l
+ 3780 1576 l 3793 1580 l 3805 1584 l 3817 1588 l 3829 1593 l
+ 3840 1599 l 3852 1605 l 3863 1612 l 3875 1621 l 3886 1630 l
+ 3897 1640 l 3907 1650 l 3917 1661 l 3925 1672 l 3933 1684 l
+ 3940 1696 l 3946 1707 l 3952 1719 l 3957 1733 l 3962 1748 l
+ 3968 1765 l 3974 1785 l 3980 1807 l 3986 1830 l 3992 1852 l
+ 3998 1873 l 4002 1888 l 4004 1897 l 4005 1901 l
+ 4005 1902 l gs col0 s gr
+% Polyline
+n 3278 1680 m 3278 1679 l 3277 1674 l 3274 1664 l 3270 1650 l 3265 1634 l
+ 3260 1620 l 3256 1607 l 3251 1598 l 3246 1589 l 3241 1583 l
+ 3234 1576 l 3227 1571 l 3219 1566 l 3209 1561 l 3199 1557 l
+ 3188 1553 l 3177 1550 l 3165 1548 l 3154 1546 l 3143 1545 l
+ 3132 1544 l 3120 1543 l 3107 1543 l 3093 1544 l 3079 1545 l
+ 3064 1547 l 3050 1550 l 3037 1554 l 3024 1558 l 3011 1563 l
+ 3001 1569 l 2991 1575 l 2980 1582 l 2969 1590 l 2957 1599 l
+ 2945 1609 l 2933 1620 l 2920 1631 l 2908 1643 l 2896 1654 l
+ 2885 1666 l 2873 1678 l 2864 1688 l 2854 1697 l 2844 1708 l
+ 2834 1719 l 2823 1730 l 2812 1742 l 2801 1755 l 2789 1768 l
+ 2778 1782 l 2766 1795 l 2755 1809 l 2744 1823 l 2734 1836 l
+ 2724 1849 l 2714 1862 l 2705 1876 l 2696 1889 l 2687 1903 l
+ 2678 1917 l 2669 1932 l 2660 1948 l 2651 1964 l 2642 1980 l
+ 2633 1997 l 2624 2014 l 2616 2030 l 2608 2046 l 2601 2062 l
+ 2594 2077 l 2588 2092 l 2582 2106 l 2576 2119 l 2570 2134 l
+ 2564 2150 l 2558 2165 l 2553 2181 l 2547 2197 l 2541 2213 l
+ 2536 2229 l 2531 2244 l 2526 2260 l 2521 2274 l 2517 2288 l
+ 2512 2301 l 2508 2313 l 2504 2325 l 2499 2338 l 2495 2352 l
+ 2489 2366 l 2484 2380 l 2479 2394 l 2473 2409 l 2467 2423 l
+ 2462 2437 l 2456 2451 l 2451 2464 l 2446 2477 l 2441 2490 l
+ 2437 2503 l 2432 2517 l 2426 2532 l 2420 2549 l 2413 2568 l
+ 2406 2590 l 2398 2613 l 2391 2635 l 2385 2652 l 2381 2664 l
+ 2379 2669 l
+ 2379 2670 l gs col0 s gr
+% Polyline
+n 4036 5613 m 4048 5621 l 4060 5629 l 4071 5637 l 4083 5644 l 4095 5652 l
+ 4106 5659 l 4117 5666 l 4128 5673 l 4138 5679 l 4147 5685 l
+ 4157 5691 l 4165 5696 l 4176 5703 l 4187 5710 l 4198 5717 l
+ 4210 5724 l 4221 5732 l 4233 5739 l 4245 5747 l 4255 5754 l
+ 4265 5760 l 4275 5767 l 4284 5773 l 4294 5779 l 4304 5785 l
+ 4314 5792 l 4323 5798 l 4333 5805 l 4342 5810 l 4350 5816 l
+ 4357 5820 l 4363 5824 l 4373 5831 l 4382 5836 l 4391 5841 l
+ 4399 5845 l 4406 5848 l 4412 5850 l 4419 5851 l 4426 5851 l
+ 4433 5851 l 4440 5850 l 4446 5848 l 4451 5846 l 4457 5844 l
+ 4462 5840 l 4467 5837 l 4471 5834 l 4475 5830 l 4479 5826 l
+ 4482 5821 l 4486 5816 l 4490 5811 l 4493 5806 l 4497 5801 l
+ 4501 5796 l 4506 5790 l 4509 5785 l 4512 5780 l 4516 5774 l
+ 4519 5767 l 4521 5760 l 4523 5753 l 4524 5747 l 4524 5740 l
+ 4524 5734 l 4523 5727 l 4522 5719 l 4521 5713 l 4520 5707 l
+ 4518 5702 l 4515 5697 l 4512 5691 l 4508 5686 l 4504 5682 l
+ 4499 5677 l 4494 5673 l 4489 5668 l 4482 5663 l 4475 5658 l
+ 4468 5653 l 4461 5648 l 4454 5643 l 4446 5638 l 4437 5632 l
+ 4427 5626 l 4417 5620 l 4408 5614 l 4400 5609 l 4391 5604 l
+ 4382 5598 l 4371 5591 l 4361 5584 l 4351 5578 l 4341 5571 l
+ 4332 5565 l 4322 5559 l 4313 5553 l 4303 5546 l 4292 5540 l
+ 4283 5534 l 4274 5528 l 4266 5523 l 4258 5519 l 4252 5515 l
+ 4245 5511 l 4238 5507 l 4231 5503 l 4224 5499 l 4217 5495 l
+ 4210 5491 l 4203 5486 l 4195 5480 l 4186 5474 l 4177 5468 l
+ 4167 5460 l 4158 5453 l 4149 5447 l 4142 5442 l 4136 5437 l
+ 4131 5434 l 4127 5431 l 4124 5429 l 4120 5428 l 4116 5428 l
+ 4112 5428 l 4106 5428 l 4100 5429 l 4093 5430 l 4085 5431 l
+ 4076 5433 l 4066 5434 l 4054 5436 l 4042 5438 l 4029 5440 l
+ 4017 5441 l 4005 5443 l 3993 5445 l 3981 5447 l 3969 5449 l
+ 3957 5450 l 3944 5452 l 3932 5455 l 3920 5457 l 3910 5459 l
+ 3900 5460 l 3892 5462 l 3885 5464 l 3882 5465 l 3880 5465 l
+ 3878 5466 l 3876 5467 l 3874 5468 l 3872 5468 l 3871 5469 l
+ 3869 5470 l 3868 5471 l 3867 5472 l 3867 5474 l 3866 5475 l
+ 3866 5476 l 3866 5478 l 3866 5479 l 3867 5481 l 3868 5483 l
+ 3869 5485 l 3870 5487 l 3872 5489 l 3874 5491 l 3876 5493 l
+ 3878 5496 l 3881 5498 l 3884 5501 l 3887 5504 l 3894 5510 l
+ 3904 5517 l 3914 5526 l 3926 5535 l 3939 5545 l 3954 5555 l
+ 3968 5566 l 3983 5576 l 3997 5586 l 4011 5596 l 4024 5605 l
+
+ cp gs col31 1.00 shd ef gr gs col0 s gr
+7.500 slw
+% Rotated Ellipse
+gs
+3291 2663 tr
+-345.998 rot
+n 0 0 179 279 0 360 DrawEllipse 345.998 rot
+gs 0.00 setgray ef gr gs col0 s gr
+gr
+
+% Polyline
+30.000 slw
+n 2303 4762 m 2309 4770 l 2316 4777 l 2323 4784 l 2330 4792 l 2337 4799 l
+ 2344 4805 l 2350 4811 l 2356 4816 l 2364 4823 l 2372 4830 l
+ 2381 4837 l 2390 4843 l 2399 4848 l 2408 4852 l 2415 4854 l
+ 2423 4857 l 2432 4859 l 2441 4861 l 2451 4863 l 2461 4864 l
+ 2471 4866 l 2480 4867 l 2489 4867 l 2500 4868 l 2510 4869 l
+ 2522 4869 l 2533 4869 l 2543 4869 l 2554 4869 l 2563 4868 l
+ 2572 4867 l 2582 4866 l 2592 4865 l 2602 4863 l 2613 4861 l
+ 2623 4859 l 2633 4857 l 2642 4855 l 2651 4853 l 2661 4850 l
+ 2672 4848 l 2682 4845 l 2693 4842 l 2703 4839 l 2712 4836 l
+ 2720 4833 l 2728 4831 l 2736 4827 l 2744 4824 l 2751 4820 l
+ 2759 4816 l 2766 4812 l 2773 4807 l 2779 4802 l 2785 4797 l
+ 2792 4791 l 2799 4784 l 2807 4777 l 2815 4769 l 2823 4760 l
+ 2830 4752 l 2838 4744 l 2844 4737 l 2851 4730 l 2858 4723 l
+ 2865 4715 l 2873 4706 l 2880 4698 l 2888 4690 l 2895 4682 l
+ 2901 4674 l 2908 4667 l 2915 4658 l 2923 4649 l 2931 4640 l
+ 2939 4630 l 2947 4621 l 2953 4612 l 2960 4604 l 2965 4597 l
+ 2970 4589 l 2975 4582 l 2979 4574 l 2984 4566 l 2987 4558 l
+ 2990 4551 l 2993 4544 l 2994 4537 l 2996 4530 l 2996 4522 l
+ 2997 4514 l 2997 4506 l 2997 4497 l 2996 4488 l 2996 4480 l
+ 2995 4472 l 2994 4464 l 2993 4455 l 2991 4446 l 2989 4437 l
+ 2987 4427 l 2984 4418 l 2981 4410 l 2977 4403 l 2972 4395 l
+ 2967 4388 l 2961 4381 l 2954 4373 l 2947 4367 l 2939 4360 l
+ 2932 4354 l 2926 4349 l 2919 4344 l 2912 4340 l 2904 4335 l
+ 2896 4330 l 2888 4326 l 2881 4322 l 2873 4318 l 2866 4315 l
+ 2859 4311 l 2851 4308 l 2843 4305 l 2834 4302 l 2825 4300 l
+ 2817 4297 l 2809 4295 l 2801 4294 l 2793 4293 l 2785 4292 l
+ 2776 4291 l 2767 4291 l 2758 4291 l 2750 4291 l 2742 4292 l
+ 2734 4293 l 2724 4294 l 2714 4296 l 2704 4298 l 2693 4302 l
+ 2684 4305 l 2676 4309 l 2672 4312 l 2667 4315 l 2661 4320 l
+ 2654 4326 l 2645 4333 l 2635 4342 l 2623 4353 l 2609 4366 l
+ 2593 4380 l 2575 4397 l 2564 4407 l 2552 4418 l 2538 4430 l
+ 2524 4443 l 2509 4457 l 2493 4472 l 2477 4487 l 2460 4503 l
+ 2443 4519 l 2426 4535 l 2410 4552 l 2394 4567 l 2380 4582 l
+ 2366 4597 l 2353 4610 l 2342 4623 l 2331 4635 l 2322 4646 l
+ 2314 4658 l 2306 4668 l 2300 4679 l 2295 4688 l 2291 4698 l
+ 2288 4706 l 2287 4714 l 2286 4722 l 2286 4729 l 2287 4735 l
+ 2289 4741 l 2291 4746 l 2294 4750 l 2297 4755 l 2300 4759 l
+
+ cp gs col20 1.00 shd ef gr gs col0 s gr
+7.500 slw
+% Rotated Ellipse
+gs
+2748 2543 tr
+-345.998 rot
+n 0 0 130 238 0 360 DrawEllipse 345.998 rot
+gs 0.00 setgray ef gr gs col0 s gr
+gr
+
+% Rotated Ellipse
+gs
+2738 2495 tr
+-350.003 rot
+n 0 0 55 105 0 360 DrawEllipse 350.003 rot
+gs col7 1.00 shd ef gr gs col0 s gr
+gr
+
+% Polyline
+30.000 slw
+n 2288 6848 m 2292 6837 l 2298 6827 l 2305 6815 l 2313 6804 l 2322 6793 l
+ 2332 6783 l 2342 6773 l 2351 6764 l 2360 6757 l 2369 6750 l
+ 2378 6743 l 2386 6738 l 2395 6732 l 2403 6726 l 2413 6721 l
+ 2422 6716 l 2430 6711 l 2439 6707 l 2448 6703 l 2456 6699 l
+ 2465 6694 l 2474 6689 l 2484 6684 l 2495 6679 l 2506 6674 l
+ 2518 6668 l 2529 6663 l 2540 6658 l 2550 6653 l 2560 6649 l
+ 2570 6645 l 2580 6641 l 2591 6637 l 2602 6633 l 2614 6629 l
+ 2626 6626 l 2637 6622 l 2648 6619 l 2659 6616 l 2670 6614 l
+ 2681 6611 l 2692 6608 l 2705 6606 l 2718 6603 l 2731 6601 l
+ 2744 6598 l 2757 6596 l 2770 6594 l 2782 6592 l 2794 6591 l
+ 2805 6589 l 2817 6588 l 2829 6586 l 2842 6585 l 2855 6584 l
+ 2868 6583 l 2880 6583 l 2892 6582 l 2903 6582 l 2914 6582 l
+ 2925 6581 l 2936 6582 l 2948 6582 l 2960 6582 l 2972 6583 l
+ 2985 6584 l 2997 6585 l 3008 6586 l 3020 6587 l 3031 6589 l
+ 3041 6590 l 3053 6592 l 3065 6594 l 3077 6597 l 3090 6599 l
+ 3102 6602 l 3114 6605 l 3126 6607 l 3136 6610 l 3146 6613 l
+ 3158 6617 l 3170 6620 l 3182 6625 l 3195 6629 l 3207 6634 l
+ 3218 6639 l 3228 6644 l 3238 6650 l 3248 6655 l 3258 6661 l
+ 3268 6668 l 3279 6676 l 3290 6684 l 3300 6692 l 3309 6700 l
+ 3318 6709 l 3325 6715 l 3332 6722 l 3339 6730 l 3346 6738 l
+ 3353 6746 l 3360 6755 l 3367 6763 l 3373 6772 l 3378 6780 l
+ 3383 6788 l 3389 6797 l 3394 6808 l 3399 6820 l 3404 6832 l
+ 3409 6844 l 3413 6856 l 3416 6868 l 3420 6879 l 3422 6888 l
+ 3424 6898 l 3426 6908 l 3428 6919 l 3430 6930 l 3432 6940 l
+ 3433 6951 l 3435 6960 l 3436 6970 l 3437 6978 l 3437 6983 l
+ 3437 6988 l 3437 6993 l 3436 6998 l 3435 7004 l 3433 7009 l
+ 3431 7014 l 3427 7020 l 3422 7025 l 3417 7030 l 3410 7036 l
+ 3402 7041 l 3393 7046 l 3382 7050 l 3371 7055 l 3358 7060 l
+ 3346 7064 l 3333 7068 l 3319 7072 l 3303 7076 l 3287 7080 l
+ 3268 7084 l 3248 7088 l 3227 7091 l 3205 7095 l 3182 7098 l
+ 3157 7101 l 3133 7104 l 3107 7106 l 3081 7108 l 3056 7109 l
+ 3030 7109 l 3004 7110 l 2978 7109 l 2952 7108 l 2926 7107 l
+ 2902 7105 l 2877 7102 l 2852 7099 l 2826 7096 l 2800 7092 l
+ 2773 7088 l 2746 7083 l 2718 7077 l 2690 7071 l 2662 7065 l
+ 2634 7059 l 2607 7052 l 2581 7045 l 2556 7038 l 2531 7031 l
+ 2508 7024 l 2486 7017 l 2466 7010 l 2447 7003 l 2429 6996 l
+ 2413 6990 l 2398 6983 l 2381 6976 l 2366 6968 l 2352 6960 l
+ 2339 6952 l 2328 6944 l 2318 6936 l 2309 6928 l 2302 6920 l
+ 2296 6912 l 2291 6904 l 2288 6896 l 2285 6888 l 2284 6881 l
+ 2283 6874 l 2283 6867 l 2284 6861 l 2286 6854 l
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 2232 4239 m 2224 4242 l 2216 4247 l 2207 4251 l 2198 4256 l 2190 4261 l
+ 2183 4267 l 2176 4272 l 2169 4278 l 2162 4286 l 2154 4294 l
+ 2147 4303 l 2140 4313 l 2135 4320 l 2130 4329 l 2125 4338 l
+ 2119 4349 l 2114 4359 l 2110 4369 l 2106 4379 l 2104 4387 l
+ 2101 4396 l 2099 4405 l 2098 4414 l 2097 4423 l 2096 4432 l
+ 2096 4441 l 2096 4449 l 2095 4458 l 2095 4466 l 2095 4475 l
+ 2095 4484 l 2095 4495 l 2095 4505 l 2096 4514 l 2096 4523 l
+ 2098 4532 l 2099 4540 l 2102 4548 l 2105 4557 l 2109 4566 l
+ 2114 4575 l 2119 4583 l 2125 4591 l 2131 4599 l 2138 4606 l
+ 2147 4614 l 2156 4622 l 2166 4630 l 2176 4638 l 2186 4645 l
+ 2196 4651 l 2204 4656 l 2213 4661 l 2222 4665 l 2231 4668 l
+ 2240 4671 l 2250 4674 l 2260 4676 l 2269 4677 l 2279 4679 l
+ 2289 4680 l 2300 4681 l 2312 4683 l 2325 4684 l 2338 4685 l
+ 2351 4686 l 2362 4686 l 2373 4687 l 2384 4688 l 2395 4688 l
+ 2407 4688 l 2418 4688 l 2430 4688 l 2442 4686 l 2452 4685 l
+ 2463 4683 l 2472 4680 l 2481 4677 l 2490 4674 l 2500 4670 l
+ 2510 4665 l 2521 4660 l 2530 4655 l 2540 4650 l 2548 4644 l
+ 2557 4639 l 2567 4632 l 2577 4624 l 2587 4616 l 2597 4607 l
+ 2606 4598 l 2614 4589 l 2620 4581 l 2626 4573 l 2631 4565 l
+ 2635 4558 l 2639 4550 l 2642 4541 l 2645 4533 l 2647 4526 l
+ 2648 4519 l 2650 4512 l 2651 4504 l 2653 4494 l 2654 4484 l
+ 2654 4473 l 2654 4462 l 2653 4451 l 2651 4442 l 2649 4432 l
+ 2647 4421 l 2644 4410 l 2641 4398 l 2637 4387 l 2633 4377 l
+ 2630 4368 l 2626 4359 l 2621 4351 l 2616 4342 l 2610 4334 l
+ 2604 4326 l 2597 4319 l 2591 4312 l 2584 4306 l 2577 4301 l
+ 2571 4296 l 2563 4291 l 2554 4286 l 2544 4281 l 2533 4276 l
+ 2521 4271 l 2509 4266 l 2496 4262 l 2483 4257 l 2471 4254 l
+ 2458 4250 l 2444 4247 l 2429 4244 l 2413 4240 l 2397 4237 l
+ 2381 4234 l 2365 4232 l 2351 4230 l 2337 4228 l 2325 4227 l
+ 2314 4226 l 2299 4225 l 2286 4225 l 2274 4226 l 2263 4228 l
+ 2253 4230 l 2245 4233 l 2238 4236 l
+ cp gs col20 1.00 shd ef gr gs col0 s gr
+7.500 slw
+% Rotated Ellipse
+gs
+3260 2603 tr
+-350.003 rot
+n 0 0 55 105 0 360 DrawEllipse 350.003 rot
+gs col7 1.00 shd ef gr gs col0 s gr
+gr
+
+% Polyline
+30.000 slw
+n 2246 4048 m 2247 4040 l 2248 4030 l 2251 4020 l 2254 4009 l 2259 3999 l
+ 2263 3989 l 2268 3983 l 2272 3976 l 2278 3969 l 2284 3963 l
+ 2291 3957 l 2298 3951 l 2304 3946 l 2311 3941 l 2317 3937 l
+ 2324 3932 l 2331 3928 l 2339 3924 l 2346 3920 l 2354 3916 l
+ 2362 3913 l 2369 3911 l 2377 3908 l 2385 3906 l 2394 3903 l
+ 2404 3901 l 2413 3899 l 2423 3898 l 2431 3896 l 2440 3896 l
+ 2448 3895 l 2456 3894 l 2465 3894 l 2474 3893 l 2483 3893 l
+ 2492 3893 l 2499 3893 l 2507 3892 l 2517 3892 l 2527 3892 l
+ 2538 3891 l 2548 3891 l 2558 3891 l 2567 3891 l 2576 3891 l
+ 2585 3892 l 2594 3893 l 2604 3895 l 2612 3897 l 2620 3899 l
+ 2628 3901 l 2637 3905 l 2646 3909 l 2655 3913 l 2665 3919 l
+ 2674 3925 l 2681 3929 l 2688 3935 l 2697 3941 l 2705 3948 l
+ 2713 3955 l 2721 3962 l 2727 3969 l 2733 3975 l 2738 3981 l
+ 2743 3988 l 2747 3996 l 2751 4003 l 2754 4011 l 2757 4019 l
+ 2759 4026 l 2761 4033 l 2763 4040 l 2765 4048 l 2767 4057 l
+ 2768 4066 l 2770 4076 l 2771 4085 l 2772 4095 l 2772 4105 l
+ 2773 4115 l 2773 4125 l 2772 4137 l 2771 4149 l 2770 4161 l
+ 2768 4173 l 2765 4184 l 2762 4193 l 2758 4202 l 2754 4211 l
+ 2748 4220 l 2741 4228 l 2733 4236 l 2725 4243 l 2717 4250 l
+ 2708 4255 l 2701 4259 l 2693 4263 l 2684 4267 l 2674 4270 l
+ 2664 4274 l 2654 4277 l 2643 4280 l 2633 4282 l 2622 4284 l
+ 2612 4286 l 2602 4287 l 2591 4288 l 2579 4289 l 2566 4290 l
+ 2553 4291 l 2540 4292 l 2527 4292 l 2515 4292 l 2503 4292 l
+ 2492 4292 l 2481 4291 l 2470 4291 l 2458 4290 l 2447 4289 l
+ 2435 4287 l 2423 4285 l 2412 4283 l 2402 4281 l 2392 4278 l
+ 2383 4275 l 2373 4270 l 2362 4265 l 2351 4259 l 2341 4251 l
+ 2331 4243 l 2322 4235 l 2314 4227 l 2306 4219 l 2299 4211 l
+ 2292 4202 l 2286 4192 l 2279 4182 l 2273 4172 l 2268 4162 l
+ 2264 4153 l 2261 4145 l 2257 4135 l 2254 4125 l 2252 4115 l
+ 2251 4106 l 2250 4098 l 2249 4091 l 2248 4085 l 2247 4078 l
+ 2246 4071 l 2246 4063 l 2246 4056 l
+ cp gs col20 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 1481 6669 m 1482 6670 l 1487 6673 l 1499 6680 l 1516 6690 l 1534 6700 l
+ 1551 6710 l 1567 6719 l 1580 6726 l 1593 6732 l 1605 6737 l
+ 1615 6741 l 1626 6745 l 1637 6749 l 1649 6752 l 1661 6756 l
+ 1674 6759 l 1687 6762 l 1700 6765 l 1713 6767 l 1725 6770 l
+ 1737 6771 l 1749 6773 l 1762 6775 l 1774 6776 l 1788 6778 l
+ 1802 6779 l 1817 6780 l 1833 6781 l 1848 6782 l 1864 6783 l
+ 1879 6783 l 1894 6784 l 1908 6784 l 1922 6784 l 1934 6784 l
+ 1946 6784 l 1959 6784 l 1973 6784 l 1987 6784 l 2002 6783 l
+ 2017 6783 l 2032 6783 l 2047 6782 l 2062 6782 l 2077 6781 l
+ 2092 6780 l 2107 6780 l 2121 6779 l 2138 6779 l 2156 6778 l
+ 2175 6777 l 2194 6776 l 2213 6776 l 2232 6775 l 2250 6774 l
+ 2267 6773 l 2282 6773 l 2295 6772 l 2306 6772 l 2315 6771 l
+ 2317 6771 l 2319 6771 l 2321 6771 l 2323 6771 l 2325 6771 l
+ 2326 6771 l 2328 6771 l 2329 6771 l 2330 6771 l 2331 6771 l
+ 2332 6770 l 2333 6770 l 2334 6770 l 2335 6770 l 2334 6771 l
+ 2333 6771 l 2332 6771 l 2331 6771 l 2330 6771 l 2329 6771 l
+ 2328 6771 l
+ 2327 6771 l gs col0 s gr
+% Polyline
+n 3533 6267 m 3533 6268 l 3534 6275 l 3535 6289 l 3536 6305 l 3537 6320 l
+ 3538 6331 l 3538 6341 l 3538 6349 l 3536 6359 l 3535 6368 l
+ 3532 6377 l 3529 6385 l 3525 6392 l 3522 6398 l 3517 6404 l
+ 3512 6410 l 3506 6417 l 3500 6423 l 3493 6428 l 3486 6433 l
+ 3480 6436 l 3474 6440 l 3466 6443 l 3458 6447 l 3448 6450 l
+ 3439 6453 l 3429 6456 l 3419 6459 l 3410 6461 l 3400 6463 l
+ 3390 6466 l 3377 6469 l 3364 6472 l 3350 6476 l 3335 6480 l
+ 3319 6485 l 3304 6489 l 3287 6495 l 3275 6499 l 3261 6504 l
+ 3246 6509 l 3229 6516 l 3210 6523 l 3188 6531 l 3164 6541 l
+ 3139 6551 l 3114 6560 l 3091 6569 l 3075 6576 l 3064 6580 l
+ 3060 6582 l
+ 3059 6582 l gs col0 s gr
+% Polyline
+n 3983 6181 m 3983 6182 l 3983 6186 l 3984 6196 l 3986 6211 l 3987 6230 l
+ 3989 6250 l 3991 6268 l 3992 6284 l 3993 6299 l 3994 6311 l
+ 3995 6322 l 3996 6333 l 3997 6345 l 3997 6357 l 3998 6369 l
+ 3998 6380 l 3998 6392 l 3998 6403 l 3998 6413 l 3997 6423 l
+ 3997 6431 l 3996 6439 l 3994 6448 l 3991 6457 l 3988 6465 l
+ 3984 6474 l 3979 6481 l 3974 6488 l 3968 6494 l 3962 6499 l
+ 3955 6503 l 3947 6507 l 3937 6511 l 3927 6516 l 3915 6520 l
+ 3903 6523 l 3892 6527 l 3880 6531 l 3869 6533 l 3859 6537 l
+ 3847 6540 l 3834 6544 l 3821 6547 l 3807 6551 l 3793 6555 l
+ 3779 6558 l 3766 6561 l 3753 6564 l 3742 6566 l 3730 6569 l
+ 3718 6571 l 3704 6573 l 3690 6576 l 3675 6579 l 3660 6583 l
+ 3645 6586 l 3629 6590 l 3614 6595 l 3598 6599 l 3582 6604 l
+ 3570 6609 l 3557 6613 l 3543 6618 l 3528 6624 l 3511 6631 l
+ 3493 6639 l 3472 6648 l 3449 6658 l 3426 6668 l 3403 6679 l
+ 3381 6688 l 3363 6696 l 3350 6702 l 3343 6705 l
+ 3339 6707 l gs col0 s gr
+% Polyline
+n 2263 6883 m 2260 6890 l 2258 6899 l 2256 6908 l 2254 6916 l 2254 6925 l
+ 2253 6933 l 2253 6942 l 2252 6951 l 2252 6962 l 2252 6972 l
+ 2253 6982 l 2253 6991 l 2254 7000 l 2254 7009 l 2256 7018 l
+ 2257 7027 l 2259 7036 l 2262 7044 l 2264 7049 l 2267 7055 l
+ 2271 7062 l 2277 7069 l 2284 7076 l 2292 7084 l 2301 7091 l
+ 2312 7099 l 2320 7104 l 2330 7109 l 2340 7115 l 2352 7122 l
+ 2364 7128 l 2378 7135 l 2392 7142 l 2406 7148 l 2420 7155 l
+ 2433 7160 l 2446 7166 l 2459 7171 l 2472 7175 l 2485 7179 l
+ 2498 7184 l 2512 7188 l 2527 7192 l 2542 7195 l 2558 7199 l
+ 2574 7202 l 2590 7205 l 2606 7208 l 2623 7210 l 2639 7212 l
+ 2654 7214 l 2669 7215 l 2686 7217 l 2703 7219 l 2721 7220 l
+ 2741 7222 l 2760 7223 l 2780 7225 l 2799 7226 l 2818 7227 l
+ 2837 7229 l 2854 7230 l 2871 7231 l 2887 7232 l 2903 7232 l
+ 2919 7233 l 2935 7234 l 2951 7235 l 2968 7236 l 2985 7237 l
+ 3002 7237 l 3020 7238 l 3037 7239 l 3054 7240 l 3071 7240 l
+ 3088 7241 l 3104 7242 l 3121 7243 l 3135 7243 l 3151 7244 l
+ 3166 7244 l 3183 7245 l 3201 7246 l 3219 7246 l 3237 7247 l
+ 3256 7247 l 3274 7248 l 3293 7248 l 3311 7249 l 3328 7249 l
+ 3345 7249 l 3361 7249 l 3377 7249 l 3392 7249 l 3408 7249 l
+ 3425 7248 l 3442 7248 l 3459 7247 l 3476 7246 l 3494 7245 l
+ 3512 7244 l 3530 7242 l 3548 7241 l 3566 7239 l 3583 7238 l
+ 3600 7236 l 3617 7234 l 3634 7232 l 3649 7230 l 3664 7228 l
+ 3680 7226 l 3697 7224 l 3715 7222 l 3733 7220 l 3752 7217 l
+ 3771 7215 l 3789 7212 l 3807 7209 l 3825 7207 l 3842 7204 l
+ 3859 7202 l 3874 7199 l 3889 7197 l 3903 7195 l 3918 7192 l
+ 3933 7189 l 3948 7186 l 3963 7183 l 3978 7180 l 3993 7177 l
+ 4007 7174 l 4021 7171 l 4035 7167 l 4049 7164 l 4061 7160 l
+ 4074 7157 l 4085 7153 l 4097 7150 l 4109 7146 l 4121 7143 l
+ 4133 7138 l 4146 7134 l 4160 7129 l 4174 7124 l 4188 7119 l
+ 4203 7114 l 4217 7108 l 4232 7103 l 4246 7097 l 4260 7092 l
+ 4273 7086 l 4287 7081 l 4300 7075 l 4314 7070 l 4329 7063 l
+ 4344 7057 l 4359 7050 l 4375 7044 l 4391 7037 l 4407 7030 l
+ 4423 7023 l 4437 7017 l 4452 7010 l 4465 7004 l 4478 6999 l
+ 4490 6994 l 4503 6988 l 4516 6982 l 4529 6976 l 4542 6970 l
+ 4555 6964 l 4567 6959 l 4578 6954 l 4589 6949 l 4598 6944 l
+ 4607 6940 l 4615 6937 l 4622 6934 l 4634 6928 l 4644 6922 l
+ 4654 6917 l 4662 6912 l 4668 6907 l 4673 6902 l 4677 6897 l
+ 4682 6890 l 4686 6883 l 4689 6876 l 4692 6869 l 4694 6862 l
+ 4695 6856 l 4696 6849 l 4696 6842 l 4697 6835 l 4696 6828 l
+ 4696 6822 l 4695 6816 l 4695 6809 l 4694 6802 l 4693 6795 l
+ 4693 6788 l 4692 6782 l 4692 6775 l 4691 6768 l 4691 6760 l
+ 4690 6751 l 4690 6743 l 4689 6734 l 4688 6729 l 4688 6723 l
+ 4686 6717 l 4684 6712 l 4682 6706 l 4679 6701 l 4675 6698 l
+ 4671 6695 l 4666 6693 l 4660 6693 l 4653 6693 l 4645 6695 l
+ 4635 6699 l 4624 6703 l 4612 6709 l 4598 6715 l 4584 6722 l
+ 4570 6730 l 4556 6737 l 4542 6745 l 4529 6751 l 4516 6758 l
+ 4502 6765 l 4487 6772 l 4471 6779 l 4455 6787 l 4439 6794 l
+ 4424 6802 l 4408 6808 l 4394 6815 l 4380 6821 l 4368 6826 l
+ 4355 6831 l 4342 6836 l 4329 6841 l 4316 6846 l 4303 6851 l
+ 4289 6856 l 4276 6860 l 4262 6864 l 4250 6869 l 4237 6873 l
+ 4225 6876 l 4213 6880 l 4202 6883 l 4191 6886 l 4179 6890 l
+ 4167 6893 l 4154 6897 l 4140 6901 l 4126 6905 l 4111 6908 l
+ 4096 6912 l 4081 6916 l 4067 6919 l 4052 6923 l 4038 6926 l
+ 4023 6930 l 4008 6933 l 3992 6936 l 3976 6939 l 3959 6943 l
+ 3941 6946 l 3922 6950 l 3903 6953 l 3884 6957 l 3865 6960 l
+ 3846 6963 l 3829 6965 l 3812 6968 l 3795 6970 l 3780 6973 l
+ 3764 6974 l 3748 6976 l 3732 6978 l 3716 6980 l 3700 6982 l
+ 3683 6983 l 3666 6985 l 3649 6986 l 3633 6987 l 3617 6988 l
+ 3601 6989 l 3587 6990 l 3572 6991 l 3558 6992 l 3544 6993 l
+ 3529 6994 l 3514 6994 l 3498 6995 l 3481 6996 l 3463 6997 l
+ 3445 6997 l 3426 6998 l 3407 6999 l 3388 7000 l 3369 7000 l
+ 3350 7001 l 3331 7001 l 3312 7002 l 3296 7002 l 3280 7003 l
+ 3263 7003 l 3245 7004 l 3226 7004 l 3207 7005 l 3187 7005 l
+ 3167 7006 l 3146 7006 l 3125 7006 l 3104 7006 l 3084 7007 l
+ 3064 7007 l 3044 7007 l 3025 7007 l 3007 7007 l 2989 7007 l
+ 2972 7007 l 2953 7006 l 2934 7006 l 2915 7005 l 2895 7005 l
+ 2875 7004 l 2856 7003 l 2836 7002 l 2817 7001 l 2798 7000 l
+ 2780 6999 l 2763 6997 l 2746 6996 l 2731 6995 l 2717 6993 l
+ 2703 6992 l 2691 6991 l 2674 6988 l 2658 6986 l 2643 6984 l
+ 2628 6982 l 2613 6979 l 2598 6976 l 2584 6973 l 2571 6970 l
+ 2559 6967 l 2548 6965 l 2538 6962 l 2528 6959 l 2517 6956 l
+ 2505 6952 l 2493 6948 l 2482 6944 l 2470 6940 l 2459 6936 l
+ 2449 6932 l 2439 6928 l 2431 6924 l 2424 6920 l 2415 6915 l
+ 2406 6910 l 2398 6904 l 2390 6899 l 2382 6893 l 2375 6888 l
+ 2369 6883 l 2364 6878 l 2356 6872 l 2348 6866 l 2340 6860 l
+ 2332 6855 l 2325 6850 l 2320 6846 l 2316 6843 l 2312 6840 l
+ 2308 6838 l 2305 6836 l 2301 6835 l 2298 6835 l 2295 6836 l
+ 2292 6838 l 2287 6842 l 2282 6848 l 2276 6856 l 2271 6865 l
+ 2267 6874 l
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+n 3095 6246 m 3096 6246 l 3100 6246 l 3109 6246 l 3123 6247 l 3141 6248 l
+ 3159 6248 l 3177 6249 l 3193 6251 l 3207 6252 l 3220 6253 l
+ 3232 6255 l 3244 6257 l 3256 6260 l 3269 6263 l 3283 6266 l
+ 3299 6271 l 3317 6276 l 3337 6282 l 3358 6289 l 3378 6295 l
+ 3394 6301 l 3405 6304 l 3409 6306 l
+ 3410 6306 l gs col3 s gr
+% Polyline
+n 3599 6276 m 3600 6276 l 3605 6277 l 3616 6278 l 3633 6279 l 3654 6281 l
+ 3676 6283 l 3697 6285 l 3717 6287 l 3734 6289 l 3749 6291 l
+ 3763 6293 l 3777 6295 l 3791 6297 l 3805 6300 l 3821 6302 l
+ 3838 6306 l 3858 6309 l 3879 6314 l 3902 6318 l 3924 6323 l
+ 3942 6326 l 3953 6329 l 3958 6330 l
+ 3959 6330 l gs col3 s gr
+% Polyline
+15.000 slw
+n 4281 6302 m 4288 6296 l 4297 6291 l 4305 6287 l 4314 6283 l 4322 6281 l
+ 4330 6280 l 4337 6279 l 4344 6279 l 4352 6280 l 4359 6282 l
+ 4366 6284 l 4373 6287 l 4380 6290 l 4387 6294 l 4394 6300 l
+ 4401 6306 l 4408 6312 l 4414 6319 l 4420 6326 l 4426 6334 l
+ 4432 6343 l 4437 6353 l 4441 6363 l 4444 6373 l 4445 6380 l
+ 4446 6388 l 4447 6397 l 4447 6407 l 4446 6417 l 4445 6426 l
+ 4444 6435 l 4443 6444 l 4441 6452 l 4439 6461 l 4436 6470 l
+ 4433 6479 l 4430 6489 l 4426 6497 l 4422 6505 l 4418 6513 l
+ 4413 6519 l 4408 6526 l 4401 6533 l 4395 6540 l 4387 6546 l
+ 4380 6551 l 4373 6554 l 4366 6558 l 4357 6560 l 4346 6562 l
+ 4336 6562 l 4325 6561 l 4315 6559 l 4306 6557 l 4297 6554 l
+ 4288 6550 l 4279 6545 l 4271 6541 l 4263 6536 l 4257 6531 l
+ 4250 6526 l 4245 6521 l 4239 6516 l 4234 6510 l 4230 6504 l
+ 4227 6499 l 4224 6492 l 4221 6486 l 4219 6478 l 4218 6470 l
+ 4217 6462 l 4217 6454 l 4216 6446 l 4217 6437 l 4217 6428 l
+ 4218 6418 l 4220 6409 l 4221 6402 l 4223 6394 l 4224 6386 l
+ 4227 6378 l 4230 6370 l 4234 6361 l 4238 6354 l 4242 6347 l
+ 4246 6341 l 4251 6333 l 4257 6326 l 4263 6319 l 4269 6312 l
+ 4275 6306 l
+ cp gs col7 1.00 shd ef gr gs col0 s gr
+% Polyline
+30.000 slw
+n 3248 6546 m 3249 6546 l 3254 6546 l 3265 6547 l 3280 6548 l 3296 6550 l
+ 3312 6552 l 3326 6553 l 3338 6555 l 3349 6557 l 3359 6560 l
+ 3369 6562 l 3380 6566 l 3392 6570 l 3406 6576 l 3422 6582 l
+ 3438 6589 l 3453 6596 l 3464 6600 l 3469 6603 l
+ 3470 6603 l gs col3 s gr
+% Polyline
+n 3440 6504 m 3441 6504 l 3445 6504 l 3456 6504 l 3470 6504 l 3485 6504 l
+ 3500 6505 l 3513 6505 l 3525 6506 l 3535 6507 l 3545 6508 l
+ 3555 6510 l 3565 6512 l 3577 6515 l 3590 6518 l 3606 6523 l
+ 3622 6528 l 3637 6532 l 3647 6535 l 3652 6537 l
+ 3653 6537 l gs col3 s gr
+% Polyline
+n 3560 6402 m 3561 6402 l 3566 6403 l 3578 6404 l 3597 6405 l 3620 6407 l
+ 3644 6409 l 3666 6411 l 3686 6413 l 3704 6415 l 3720 6417 l
+ 3734 6419 l 3747 6421 l 3760 6423 l 3774 6425 l 3787 6428 l
+ 3803 6431 l 3819 6434 l 3838 6439 l 3857 6443 l 3875 6447 l
+ 3890 6451 l 3899 6453 l 3903 6454 l
+ 3904 6454 l gs col3 s gr
+% Polyline
+n 2861 6429 m 2863 6429 l 2866 6430 l 2872 6431 l 2881 6432 l 2887 6433 l
+ 2894 6434 l 2902 6435 l 2912 6437 l 2923 6439 l 2935 6442 l
+ 2947 6444 l 2959 6447 l 2971 6450 l 2983 6454 l 2993 6457 l
+ 3004 6460 l 3016 6464 l 3029 6469 l 3044 6474 l 3060 6480 l
+ 3078 6487 l 3095 6493 l 3109 6499 l 3117 6502 l 3121 6504 l
+
+ 3122 6504 l gs col3 s gr
+% Polyline
+n 2594 6492 m 2595 6492 l 2600 6492 l 2611 6493 l 2628 6493 l 2649 6494 l
+ 2671 6495 l 2692 6497 l 2712 6498 l 2729 6499 l 2745 6501 l
+ 2759 6502 l 2774 6504 l 2786 6506 l 2799 6508 l 2813 6511 l
+ 2828 6514 l 2845 6517 l 2864 6521 l 2884 6526 l 2906 6531 l
+ 2927 6536 l 2945 6540 l 2959 6543 l 2968 6545 l 2971 6546 l
+
+ 2972 6546 l gs col3 s gr
+% Polyline
+n 3023 6360 m 3024 6360 l 3028 6361 l 3037 6362 l 3052 6365 l 3070 6368 l
+ 3089 6371 l 3107 6374 l 3123 6377 l 3138 6380 l 3151 6383 l
+ 3163 6385 l 3175 6388 l 3187 6391 l 3200 6395 l 3213 6399 l
+ 3228 6403 l 3246 6409 l 3265 6415 l 3285 6421 l 3304 6428 l
+ 3320 6433 l 3330 6436 l 3334 6438 l
+ 3335 6438 l gs col3 s gr
+$F2psEnd
+rs
diff --git a/share/examples/BSD_daemon/beastie.fig b/share/examples/BSD_daemon/beastie.fig
new file mode 100644
index 000000000000..1c156ca5eced
--- /dev/null
+++ b/share/examples/BSD_daemon/beastie.fig
@@ -0,0 +1,269 @@
+#FIG 3.2
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
+# can do whatever you want with this stuff. If we meet some day, and you think
+# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+Landscape
+Center
+Inches
+A4
+100.00
+Single
+-2
+1200 2
+1 1 0 1 0 0 47 0 20 0.000 1 6.0388 2748 2543 130 238 2748 2543 2878 2305
+1 1 0 1 0 7 46 0 20 0.000 1 6.1087 2738 2495 55 105 2738 2495 2793 2495
+1 1 0 1 0 0 47 0 20 0.000 1 6.0388 3291 2663 179 279 3291 2663 3470 2384
+1 1 0 1 0 7 46 0 20 0.000 1 6.1087 3260 2603 55 105 3260 2603 3315 2603
+3 0 0 3 0 7 49 0 -1 0.000 0 0 0 16
+ 4102 4658 4050 4695 4005 4703 3933 4706 3881 4706 3821 4688
+ 3746 4658 3671 4601 3615 4556 3536 4515 3450 4481 3333 4463
+ 3228 4459 3127 4481 3086 4511 2981 4574
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 1 0 3 0 20 50 0 20 0.000 0 0 0 18
+ 2628 4864 2636 4898 2666 4928 2696 4939 2745 4943 2782 4950
+ 2812 4943 2895 4928 2943 4894 2973 4860 3011 4804 3052 4751
+ 3078 4729 3078 4695 3067 4661 3052 4628 3030 4594 3003 4553
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000
+3 1 0 3 0 20 47 0 20 0.000 0 0 0 21
+ 2250 4691 2302 4766 2358 4819 2403 4856 2478 4868 2565 4871
+ 2640 4856 2726 4834 2778 4808 2835 4748 2910 4665 2970 4594
+ 3000 4538 2996 4474 2985 4399 2925 4346 2868 4313 2801 4290
+ 2733 4290 2673 4305 2632 4346
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000
+3 1 0 3 0 20 46 0 20 0.000 0 0 0 19
+ 2287 4215 2231 4238 2182 4264 2141 4305 2096 4391 2096 4455
+ 2092 4534 2122 4598 2208 4665 2272 4680 2377 4688 2460 4691
+ 2561 4643 2636 4571 2651 4511 2658 4459 2632 4361 2591 4305
+ 2505 4256
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000
+3 1 0 3 0 20 45 0 20 0.000 0 0 0 20
+ 2250 4088 2242 4054 2257 3986 2310 3938 2366 3908 2441 3893
+ 2508 3893 2568 3889 2621 3896 2670 3919 2741 3975 2763 4031
+ 2775 4099 2771 4200 2715 4260 2617 4290 2490 4294 2377 4283
+ 2302 4223 2253 4140
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000
+3 0 0 3 0 7 49 0 -1 0.000 0 0 0 22
+ 2940 2986 2861 2930 2771 2915 2677 2919 2595 2960 2546 3020
+ 2531 3106 2535 3185 2583 3260 2647 3305 2718 3335 2805 3342
+ 2880 3342 2955 3331 3007 3320 3045 3324 3093 3357 3165 3350
+ 3202 3339 3210 3279 3195 3211 3157 3181
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 3 0 7 50 0 -1 0.000 0 0 0 8
+ 2891 5190 2947 5209 3000 5228 3056 5235 3101 5239 3146 5239
+ 3187 5239 3187 5235
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 3 0 7 50 0 -1 0.000 0 0 0 8
+ 2876 5202 2951 5306 3015 5351 3108 5404 3176 5419 3240 5434
+ 3315 5438 3352 5434
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 3 0 7 50 0 -1 0.000 0 0 0 14
+ 3161 5427 3326 5528 3416 5546 3540 5565 3637 5535 3753 5501
+ 3862 5464 4005 5449 4132 5434 4293 5359 4421 5303 4533 5258
+ 4597 5198 4661 5093
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 0.000
+3 1 0 3 0 31 48 0 20 0.000 0 0 0 22
+ 3851 5483 4050 5625 4166 5696 4278 5768 4372 5831 4413 5854
+ 4447 5850 4473 5835 4488 5813 4515 5779 4526 5749 4522 5704
+ 4503 5678 4462 5648 4413 5618 4331 5565 4252 5513 4211 5494
+ 4121 5426 4121 5426 3993 5445 3866 5464
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000
+3 1 0 3 0 13 51 0 20 0.000 0 0 0 55
+ 2291 6462 2420 6447 2549 6444 2672 6444 2774 6441 2849 6387
+ 2951 6357 3026 6321 3068 6294 3059 6210 3026 6153 2996 6063
+ 2981 5991 3017 5991 3077 6030 3113 6075 3179 6057 3251 6060
+ 3308 6063 3347 6096 3392 6150 3455 6132 3500 6135 3521 6186
+ 3536 6255 3539 6309 3563 6237 3593 6159 3629 6090 3692 6060
+ 3764 6054 3827 6069 3893 6111 3956 6159 3980 6204 3983 6156
+ 4022 6138 4109 6138 4199 6132 4283 6102 4346 6081 4421 6042
+ 4466 6144 4523 6264 4583 6402 4625 6546 4667 6663 4682 6717
+ 4520 6837 4004 7044 3467 7131 2816 7128 2456 7047 2246 6816
+ 2006 6510
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+3 1 0 3 0 7 49 0 20 0.000 0 0 0 13
+ 3168 2255 3315 2009 3424 1894 3629 1784 3784 1943 3806 2158
+ 3786 2470 3693 2773 3553 2975 3328 3070 3103 2971 3034 2731
+ 3043 2543
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000
+3 0 0 3 0 7 45 0 -1 0.000 0 0 0 7
+ 1481 6669 1601 6744 1744 6777 1919 6787 2111 6780 2363 6769
+ 2327 6771
+ 0.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 1 0 3 0 7 44 0 20 0.000 0 0 0 36
+ 2294 6825 2258 6885 2252 6930 2252 6993 2258 7044 2288 7092
+ 2462 7179 2618 7215 2900 7233 3104 7242 3407 7254 3617 7236
+ 3926 7194 4094 7155 4280 7086 4505 6987 4637 6927 4676 6906
+ 4697 6861 4697 6822 4691 6783 4691 6738 4679 6669 4553 6741
+ 4358 6834 4220 6879 4037 6930 3770 6978 3560 6993 3338 7002
+ 2957 7011 2666 6993 2522 6960 2414 6921 2363 6876 2315 6843
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000
+3 1 0 3 0 7 49 0 20 0.000 0 0 0 21
+ 2504 6663 2474 6609 2408 6552 2339 6501 2243 6477 2138 6471
+ 2006 6480 1874 6510 1669 6567 1475 6654 1418 6711 1397 6762
+ 1412 6843 1445 6921 1523 6978 1637 7017 1781 7029 1946 7032
+ 2069 7038 2177 7038 2321 7038
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3599 6276 3776 6291 3959 6330
+ 0.000 1.000 0.000
+3 1 0 2 0 7 43 0 20 0.000 0 0 0 14
+ 4232 6357 4280 6294 4331 6276 4373 6282 4415 6315 4451 6369
+ 4445 6444 4424 6516 4367 6567 4304 6561 4253 6531 4223 6501
+ 4214 6456 4220 6399
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000
+3 0 0 3 0 7 45 0 -1 0.000 0 0 0 7
+ 3533 6267 3542 6357 3524 6399 3491 6435 3428 6459 3309 6482
+ 3059 6582
+ 0.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3440 6504 3544 6502 3653 6537
+ 0.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3248 6546 3359 6552 3470 6603
+ 0.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3560 6402 3755 6417 3904 6454
+ 0.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 4
+ 2861 6429 2861 6429 2979 6447 3122 6504
+ 0.000 1.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 2594 6492 2769 6497 2972 6546
+ 0.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3023 6360 3173 6383 3335 6438
+ 0.000 1.000 0.000
+3 0 0 3 0 7 45 0 -1 0.000 0 0 0 8
+ 3983 6181 3998 6342 4001 6447 3971 6504 3887 6528 3758 6567
+ 3599 6588 3339 6707
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 0.000
+3 0 0 3 3 7 43 0 -1 0.000 0 0 0 3
+ 3095 6246 3240 6248 3410 6306
+ 0.000 1.000 0.000
+3 1 0 3 0 7 46 0 20 0.000 0 0 0 17
+ 2291 6976 2265 6844 2375 6738 2450 6702 2561 6645 2666 6612
+ 2795 6588 2915 6579 3029 6585 3152 6612 3239 6645 3320 6705
+ 3389 6786 3422 6876 3440 6984 3437 7056 2957 7152
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000
+3 0 0 4 0 7 49 0 -1 0.000 0 0 0 18
+ 2498 3459 2578 3459 2613 3489 2673 3554 2728 3614 2793 3669
+ 2853 3739 2948 3799 3053 3854 3173 3879 3328 3884 3453 3864
+ 3583 3799 3688 3749 3818 3669 3858 3614 3943 3609 3983 3609
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 0.000
+3 1 0 3 0 7 49 0 20 0.000 0 0 0 17
+ 2786 2845 2877 2727 2925 2661 3009 2376 3075 2175 3131 2050
+ 3174 1929 3192 1869 3114 1746 2940 1824 2871 1890 2712 2103
+ 2598 2340 2562 2427 2538 2709 2616 2814 2679 2850
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000
+3 1 0 3 0 20 52 0 20 0.000 0 0 0 142
+ 2136 3087 2170 2963 2229 2861 2391 2682 2418 2498 2498 2228
+ 2476 2126 2452 2000 2401 1725 2407 1577 2476 1395 2483 1365
+ 2719 1094 2978 878 3235 725 3394 659 3490 731 3394 806
+ 3277 932 3166 1080 3112 1163 3103 1253 3112 1364 3151 1425
+ 3235 1418 3397 1334 3616 1277 3871 1265 4150 1298 4628 1478
+ 4793 1646 4861 1725 5006 1706 5273 1568 5288 1490 5281 1223
+ 5141 998 5101 908 5189 866 5326 893 5465 1010 5708 1328
+ 5789 1577 5836 1830 5765 2093 5513 2438 5207 2654 5056 2760
+ 5078 2729 5072 3058 4988 3368 4829 3607 4565 3850 4502 3970
+ 4486 4088 4511 4213 4589 4330 4643 4455 4679 4633 4688 4958
+ 4667 5107 4607 5230 4613 5344 4733 5685 4928 5985 5221 6195
+ 5570 6348 5993 6443 6480 6542 6773 6623 6966 6698 7141 6825
+ 7206 6977 7208 7110 7062 7250 6923 7320 6513 7397 6481 7403
+ 6518 7493 6468 7502 6120 7505 5571 7526 5298 7547 5241 7532
+ 5298 7487 5958 7130 6174 6998 6249 6935 6291 6995 6342 7076
+ 6368 7155 6408 7205 6608 7170 6756 7115 6878 7035 6873 6959
+ 6750 6851 6543 6779 5985 6713 5568 6632 5271 6554 5003 6462
+ 4821 6389 4673 6278 4545 6194 4431 6068 4371 6089 3675 6375
+ 3016 5993 2997 5942 2859 5732 2802 5591 2798 5438 2820 5318
+ 2873 5220 2883 5186 2856 5153 2778 5075 2768 4988 2791 4943
+ 2701 4943 2661 4925 2633 4883 2577 4868 2273 4422 2457 4299
+ 2763 4274 3001 4305 3128 4328 3203 4230 3216 4124 3173 4028
+ 3081 3995 2986 3945 2880 3851 2733 3770 2634 3698 2493 3665
+ 2334 3566 2221 3413 2166 3323 2133 3179
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000
+3 0 0 3 0 7 49 0 -1 0.000 0 0 0 5
+ 3489 1649 3649 1554 3825 1575 3953 1675 4005 1902
+ 0.000 1.000 1.000 1.000 0.000
+3 0 0 3 0 7 49 0 -1 0.000 0 0 0 10
+ 3278 1680 3254 1569 3149 1539 3009 1544 2883 1665 2696 1865
+ 2564 2129 2505 2334 2441 2484 2379 2670
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 0.000
+3 0 0 3 0 31 51 0 20 0.000 0 0 0 71
+ 2452 4170 2238 4009 2122 3911 2078 3867 2096 3836 2128 3795
+ 2148 3725 2153 3675 2151 3587 2131 3510 2101 3423 2013 3341
+ 1954 3332 2041 3258 1914 3207 1843 3180 1773 3140 1668 3097
+ 1557 3040 1621 3132 1671 3192 1718 3287 1753 3350 1783 3475
+ 1836 3430 1891 3385 1943 3442 2003 3515 2021 3595 2023 3642
+ 2006 3702 1953 3735 1921 3767 1873 3730 1833 3695 1791 3665
+ 1738 3622 1669 3576 1731 3501 1731 3474 1529 3466 1222 3248
+ 1344 3469 1433 3645 1446 3735 1468 3765 1503 3740 1563 3675
+ 1616 3722 1703 3792 1758 3842 1786 3927 1718 3977 1518 4045
+ 1229 3950 1297 3894 1364 3856 1357 3792 1147 3759 903 3564
+ 884 3646 1008 3875 1218 4119 1413 4179 1641 4200 1796 4130
+ 1926 4060 1956 4027 2076 4125 2216 4253 2332 4339
+ 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000
+ 1.000 1.000 1.000 1.000 1.000 1.000 0.000
diff --git a/share/examples/BSD_daemon/eps.patch b/share/examples/BSD_daemon/eps.patch
new file mode 100644
index 000000000000..984921449a1c
--- /dev/null
+++ b/share/examples/BSD_daemon/eps.patch
@@ -0,0 +1,36 @@
+# $FreeBSD$
+--- beastie.eps.ref Sun Feb 11 22:46:59 2001
++++ beastie.eps Sun Feb 11 23:01:43 2001
+@@ -19,6 +19,23 @@
+ %
+ /$F2psDict 200 dict def
+ $F2psDict begin
++
++% This controls the linethickness. I think large posters look better if
++% you use a value of 2. Small daemons looks better with a value of 1.
++/linethickness 1 def
++
++% If you want to fiddle the colors:
++% col0 below is black (the lines)
++% col3 below is cyan (the shoelaces)
++% col7 below is white (eyes, shoes)
++% col13 below is green (the shooes)
++% col20 below is red (the daemon)
++% col31 below is gold (the pitchfork)
++
++% This sets round ends on the lines, this looks better than sharp edges
++% but I have not found a way to convince xfig to do this.
++1 setlinecap
++
+ $F2psDict /mtrx matrix put
+ /col-1 {0 setgray} bind def
+ /col0 {0.000 0.000 0.000 srgb} bind def
+@@ -74,7 +91,7 @@
+ /sh {show} bind def
+ /slc {setlinecap} bind def
+ /slj {setlinejoin} bind def
+-/slw {setlinewidth} bind def
++/slw {linethickness mul setlinewidth} bind def
+ /srgb {setrgbcolor} bind def
+ /rot {rotate} bind def
+ /sc {scale} bind def
diff --git a/share/examples/BSD_daemon/poster.sh b/share/examples/BSD_daemon/poster.sh
new file mode 100644
index 000000000000..c7a21216cb0d
--- /dev/null
+++ b/share/examples/BSD_daemon/poster.sh
@@ -0,0 +1,65 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42):
+# <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you
+# can do whatever you want with this stuff. If we meet some day, and you think
+# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+
+echo '%!'
+echo '/beastie {'
+cat beastie.eps
+echo '} def'
+cat FreeBSD.pfa
+
+echo '
+
+/mm {25.4 div 72 mul} def
+/FreeBSD findfont 120 scalefont setfont
+/center 210 mm 2 div def
+/top 297 mm def
+/cshow { dup stringwidth pop 2 div neg 0 rmoveto show } def
+
+% "FreeBSD" across the top.
+% 691 is "top - height of caps - (left - X("F"))"
+center 691 moveto
+(FreeBSD) cshow
+
+% Put beastie in the center
+/sc 1.25 def
+center 125 moveto
+384 sc mul 2 div neg 0 rmoveto
+gsave currentpoint translate sc sc scale beastie grestore
+
+% A box for the bottom text
+gsave
+10 10 moveto
+210 mm 20 sub 0 rlineto
+0 70 rlineto
+210 mm 20 sub neg 0 rlineto
+closepath
+.7 .7 .9 setrgbcolor
+fill
+grestore
+
+% Bottom text
+center 70 moveto
+/NRBWelshGillianBold findfont 50 scalefont setfont
+
+center 30 moveto
+(http://www.FreeBSD.org) cshow
+
+% Do not forget Kirks copyright string.
+10 10 moveto
+/Times-Roman findfont 8 scalefont setfont
+(BSD Daemon ) show
+/Symbol findfont 8 scalefont setfont
+(\343 ) show
+/Times-Roman findfont 8 scalefont setfont
+(Copyright 1988 by Marshall Kirk McKusick. All Rights Reserved.) show
+
+showpage
+'
diff --git a/share/examples/FreeBSD_version/FreeBSD_version.c b/share/examples/FreeBSD_version/FreeBSD_version.c
new file mode 100644
index 000000000000..1d75897b9683
--- /dev/null
+++ b/share/examples/FreeBSD_version/FreeBSD_version.c
@@ -0,0 +1,17 @@
+#if __FreeBSD__ == 0 /* 1.0 did not define __FreeBSD__ */
+#define __FreeBSD_version 199401
+#elif __FreeBSD__ == 1 /* 1.1 defined it to be 1 */
+#define __FreeBSD_version 199405
+#else /* 2.0 and higher define it to be 2 */
+#include <osreldate.h> /* and this works */
+#endif
+
+int main(void) {
+ extern int getosreldate(void);
+ printf("Compilation release date: %d\n", __FreeBSD_version);
+#if __FreeBSD_version >= 199408
+ printf("Execution environment release date: %d\n", getosreldate());
+#else
+ printf("Execution environment release date: can't tell\n");
+#endif
+}
diff --git a/share/examples/FreeBSD_version/Makefile b/share/examples/FreeBSD_version/Makefile
new file mode 100644
index 000000000000..69dc00b759a7
--- /dev/null
+++ b/share/examples/FreeBSD_version/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+PROG= FreeBSD_version
+NOMAN=
+
+install:
+
+.include <bsd.prog.mk>
diff --git a/share/examples/FreeBSD_version/README b/share/examples/FreeBSD_version/README
new file mode 100644
index 000000000000..acf9eb1a963f
--- /dev/null
+++ b/share/examples/FreeBSD_version/README
@@ -0,0 +1,4 @@
+This is an example of how to determine the version of FreeBSD that
+a program was compiled on, and maybe running on (if 2.0 or better).
+
+This program is in the public domain.
diff --git a/share/examples/IPv6/USAGE b/share/examples/IPv6/USAGE
new file mode 100644
index 000000000000..d91918995b35
--- /dev/null
+++ b/share/examples/IPv6/USAGE
@@ -0,0 +1,529 @@
+ USAGE
+ KAME Project
+ $KAME: USAGE,v 1.33 2000/11/22 10:22:57 itojun Exp $
+ $FreeBSD$
+
+This is a introduction of how to use the commands provided in the KAME
+kit. For more information, please refer to each man page.
+
+
+<<<ifconfig>>>
+
+A link-local address is automatically assigned to each interface, when
+the interface becomes up for the first time. Even if you find an interface
+without a link-local address, do not panic. The link-local address will be
+assigned when it becomes up (with "ifconfig IF up").
+
+If you do not see a link-local address assigned to an interface on "ifconfig
+up", the interface does not support IPv6 for some reasons - for example,
+if the interface does not support link-layer multicast (IFF_MULTICAST is not
+set), the interface cannot be used for IPv6.
+
+Some network drivers allow an interface to become up even without a
+hardware address (for example, PCMCIA network cards). In such cases, it is
+possible that an interface has no link-local address even if the
+interface is up. If you see such situation, please disable the
+interface once and then re-enable it (i.e. do `ifconfig IF down;
+ifconfig IF up').
+
+Pseudo interfaces (like "gif" tunnel device) will borrow IPv6
+interface identifier (lowermost 64bit of the address) from
+EUI64/IEEE802 sources, like ethernet cards. Pseudo interfaces will be
+able to get an IPv6 link-local address, if you have other "real"
+interface configured beforehand. If you have no EUI64/IEEE802 sources
+on the node, we have last-resort code in the kernel, which generates
+interface identifier from MD5(hostname). MD5(hostname) may not be suitable
+for your usage (for example, if you configure same hostname on both sides of
+gif tunnel, you will be doomed), and if so, you may need to configure
+link-local address manually.
+See RFC2472 for more discussion on how to generate an interface ID for
+pseudo interfaces.
+
+If you have a router announcing Router Advertisement,
+global addresses will be assigned automatically. So, neither
+"ifconfig" nor "prefix" is necessary for your *host* (non-router node).
+(Please refer to "sysctl" section for configuring a host to accept
+Router Advertisement.)
+
+If you want to set up a router, you need to assign global addresses
+for two or more interfaces by "ifconfig" or "prefix" (prefix command
+is described at next section).
+If you want to assign a global address by "ifconfig", don't forget to
+specify the "alias" argument to keep the link-local address.
+
+# ifconfig de0 inet6 3ffe:501:808:1:200:f8ff:fe01:6317 prefixlen 64 alias
+# ifconfig de0
+de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe01:6317%de0 prefixlen 64 scopeid 0x1
+ inet 163.221.202.12 netmask 0xffffff00 broadcast 163.221.202.255
+ inet6 3ffe:501:808:1:200:f8ff:fe01:6317 prefixlen 64
+ ether 00:00:f8:01:63:17
+ media: 100baseTX status: active
+
+See also "/etc/rc.network6" for actual examples.
+
+<<prefix>>
+
+In the IPv6 architecture, an IPv6 address of an interface can be
+generated from a prefix assigned to the interface, and a
+link-dependent identifier for the interface. So assigning a full IPv6
+address by ifconfig is not necessary anymore, because user can only
+take care of prefix, by letting system take care of interface
+identifier.
+
+The newly added "prefix" command enables user to just assign prefixes
+for interfaces, and let your system automatically generate IPv6
+addresses. Prefixes added by the "prefix" command is maintained in
+the kernel consistently with prefixes assigned by Router
+Advertisement (in case of hosts) and with prefixes assigned by Router
+Renumbering (in case of routers). Manual assignment of prefixes or
+change of prefix properties take precedence over ones assigned by
+Router Advertisement or Router Renumbering.
+
+prefix command works only on routers.
+
+If you want to assign a prefix (and consequently address) manually, do
+as follows:
+
+# ifconfig de0
+de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe01:6317%de0 prefixlen 64 scopeid 0x1
+ inet 163.221.202.12 netmask 0xffffff00 broadcast 163.221.202.255
+ ether 00:00:f8:01:63:17
+ media: 100baseTX status: active
+# prefix de0 3ffe:501:808:1::
+# ifconfig de0
+de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe01:6317%de0 prefixlen 64 scopeid 0x1
+ inet 163.221.202.12 netmask 0xffffff00 broadcast 163.221.202.255
+ inet6 3ffe:501:808:1:200:f8ff:fe01:6317 prefixlen 64
+ ether 00:00:f8:01:63:17
+ media: 100baseTX status: active
+
+To check assigned prefix, use the "ndp" command (See description of
+ndp command about its usage).
+
+# ndp -p
+3ffe:501:808:1::/64 if=de0
+ flags=LA, vltime=2592000, pltime=604800, expire=Never, origin=RR
+ No advertising router
+
+The "prefix" command also has node internal prefix renumbering
+ability.
+
+If you have multiple prefixes which have 3ffe:501:808:/48 at the top,
+and would like to renumber them to 3ffe:501:4819:/48, then use the
+"prefix" command with the "matchpr" argument and the "usepr" argument.
+
+Suppose that current state of before renumbering as follows:
+
+# ifconfig de0
+de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe01:6317%de0 prefixlen 64 scopeid 0x1
+ inet 163.221.202.12 netmask 0xffffff00 broadcast 163.221.202.255
+ inet6 3ffe:501:808:1:200:f8ff:fe01:6317 prefixlen 64
+ ether 00:00:f8:01:63:17
+ media: 100baseTX status: active
+# ifconfig de1
+de1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe55:7011%de1 prefixlen 64 scopeid 0x2
+ inet 163.221.203.12 netmask 0xffffff00 broadcast 163.221.203.255
+ inet6 3ffe:501:808:2:200:f8ff:fe55:7011 prefixlen 64
+ ether 00:00:f8:55:70:11
+ media: 100baseTX status: active
+# ndp -p
+3ffe:501:808:1::/64 if=de0
+ flags=LA, vltime=2592000, pltime=604800, expire=Never, origin=RR
+ No advertising router
+3ffe:501:808:2::/64 if=de1
+ flags=LA, vltime=2592000, pltime=604800, expire=Never, origin=RR
+ No advertising router
+
+Then do as follows:
+
+# prefix -a matchpr 3ffe:501:808:: mp_len 48 usepr 3ffe:501:4819:: up_uselen 48 change
+
+If command is successful, prefixes and addresses will be renumbered as
+follows.
+
+# ifconfig de0
+de0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe01:6317%de0 prefixlen 64 scopeid 0x1
+ inet 163.221.202.12 netmask 0xffffff00 broadcast 163.221.202.255
+ inet6 3ffe:501:4819:1:200:f8ff:fe01:6317 prefixlen 64
+ ether 00:00:f8:01:63:17
+ media: 100baseTX status: active
+# ifconfig de1
+de1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
+ inet6 fe80::200:f8ff:fe55:7011%de0 prefixlen 64 scopeid 0x2
+ inet 163.221.203.12 netmask 0xffffff00 broadcast 163.221.203.255
+ inet6 3ffe:501:4819:2:200:f8ff:fe55:7011 prefixlen 64
+ ether 00:00:f8:55:70:11
+ media: 100baseTX status: active
+# ndp -p
+3ffe:501:4819:1::/64 if=de0
+ flags=LA, vltime=2592000, pltime=604800, expire=Never, origin=RR
+ No advertising router
+3ffe:501:4819:2::/64 if=de1
+ flags=LA, vltime=2592000, pltime=604800, expire=Never, origin=RR
+ No advertising router
+
+See also "/etc/rc.network6" for actual examples.
+
+
+<<<route>>>
+
+If there is a router announcing Router Advertisement on a subnet,
+you need not to add a default route for your host by hand
+(Please refer to "sysctl" section to accept Router Advertisement).
+
+If you want to add a default route manually, do like:
+
+# route add -inet6 default fe80::200:a2ff:fe0e:7543%ed0
+
+"default" means ::/0. In other cases, if "prefixlen" is omitted, 64
+is assumed for "prefixlen" to get along with the aggregatable address.
+
+Note that, in IPv6, a link-local address should be used as gateway
+("fe80::200:a2ff:fe0e:7543%ed0" in the above). If you use global addresses,
+ICMPv6 redirect will not work properly. Also note that we use a special form
+of link-local address as gateway. See Section 1.3 of IMPLEMENTATION for
+more details.
+For ease of configuration we recommend you to avoid static routes and run
+a routing daemon (route6d for example) instead.
+
+
+<<<ping6>>>
+
+Reachability can be checked by "ping6". This "ping6" allows multicast
+for its argument.
+
+% ping6 -n -I ed0 ff02::1
+
+PING6(56=40+8+8 bytes) fe80::5254:ff:feda:cb7d --> ff02::1%ed0
+56 bytes from fe80::5254:ff:feda:cb7d%lo0, icmp_seq=0 hlim=64 time=0.25 ms
+56 bytes from fe80::2a0:c9ff:fe84:ed6c%ed0, icmp_seq=0 hlim=64 time=1.333 ms(DUP!)
+56 bytes from fe80::5254:ff:feda:d161%ed0, icmp_seq=0 hlim=64 time=1.459 ms(DUP!)
+56 bytes from fe80::260:97ff:fec2:80bf%ed0, icmp_seq=0 hlim=64 time=1.538 ms(DUP!)
+56 bytes from 3ffe:501:4819:2000:5054:ff:fedb:aa46, icmp_seq=0 hlim=255 time=1.615 ms(DUP!)
+
+
+<<<ping6 -w>>>
+
+Name resolution is possible by ICMPv6 node information query message.
+This is very convenient for link-local addresses whose host name cannot be
+resolved by DNS. Specify the "-w" option to "ping6".
+
+% ping6 -n -I ed0 -w ff02::1
+
+64 bytes from fe80::5254:ff:feda:cb7d%lo0: fto.kame.net
+67 bytes from fe80::5254:ff:feda:d161%ed0: banana.kame.net
+69 bytes from fe80::2a0:c9ff:fe84:ebd9%ed0: paradise.kame.net
+66 bytes from fe80::260:8ff:fe8b:447f%ed0: taroh.kame.net
+66 bytes from fe80::2a0:c9ff:fe84:ed6c%ed0: ayame.kame.net
+
+
+<<<traceroute6>>>
+
+The route for a target host can be checked by "traceroute6".
+
+% traceroute6 tokyo.v6.wide.ad.jp
+
+traceroute to tokyo.v6.wide.ad.jp (3ffe:501:0:401:200:e8ff:fed5:8923), 30 hops max, 12 byte packets
+ 1 nr60.v6.kame.net 1.239 ms 0.924 ms 0.908 ms
+ 2 otemachi.v6.wide.ad.jp 28.953 ms 31.451 ms 26.567 ms
+ 3 tokyo.v6.wide.ad.jp 26.549 ms 26.58 ms 26.186 ms
+
+If the -l option is specified, both address and name are shown in each line.
+% traceroute6 -l tokyo.v6.wide.ad.jp
+
+traceroute to tokyo.v6.wide.ad.jp (3ffe:501:0:401:200:e8ff:fed5:8923), 30 hops max, 12 byte packets
+ 1 nr60.v6.kame.net (3ffe:501:4819:2000:260:97ff:fec2:80bf) 1.23 ms 0.952 ms 0.92 ms
+ 2 otemachi.v6.wide.ad.jp (3ffe:501:0:1802:260:97ff:feb6:7ff0) 27.345 ms 26.706 ms 26.563 ms
+ 3 tokyo.v6.wide.ad.jp (3ffe:501:0:401:200:e8ff:fed5:8923) 26.329 ms 26.36 ms 28.63 ms
+
+
+<<<ndp>>>
+
+To display the current Neighbor cache, use "ndp":
+
+% ndp -a
+Neighbor Linklayer Address Netif Expire St Flgs Prbs
+nr60.v6.kame.net 0:60:97:c2:80:bf ed0 expired S R
+3ffe:501:4819:2000:2c0:cff:fe 0:c0:c:10:3a:53 ed0 permanent R
+paradise.v6.kame.net 52:54:0:dc:52:17 ed0 expired S R
+fe80::200:eff:fe49:f929%ed0 0:0:e:49:f9:29 ed0 expired S R
+fe80::200:86ff:fe05:80da%ed0 0:0:86:5:80:da ed0 expired S
+fe80::200:86ff:fe05:c2d8%ed0 0:0:86:5:c2:d8 ed0 9s R
+
+To flush all of the NDP cache entries, execute the following as root.
+
+# ndp -c
+
+To display the prefix list:
+
+% ndp -p
+3ffe:501:4819:2000::/64 if=ed0
+ flags=LA, vltime=2592000, pltime=604800, expire=29d23h59m58s, origin=RA
+ advertised by
+ fe80::5254:ff:fedc:5217%ed0 (reachable)
+ fe80::260:97ff:fec2:80bf%ed0 (reachable)
+ fe80::200:eff:fe49:f929%ed0 (no neighbor state)
+
+To display the default router list:
+
+% ndp -r
+fe80::260:97ff:fec2:80bf if=ed0, flags=, expire=29m55s
+fe80::5254:ff:fedc:5217 if=ed0, flags=, expire=29m7s
+fe80::200:eff:fe49:f929 if=ed0, flags=, expire=28m47s
+
+
+<<<rtsol>>>
+
+To generate a Router Solicitation message right now to get global
+addresses, use "rtsol".
+
+# ifconfig ef0
+ef0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
+ link type ether 0:a0:24:ab:83:9b mtu 1500 speed 10Mbps
+ media 10baseT status active
+ inet6 fe80::2a0:24ff:feab:839b%ef0 prefixlen 64 scopeid 0x2
+# rtsol ef0
+# ifconfig ef0
+ef0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
+ link type ether 0:a0:24:ab:83:9b mtu 1500 speed 10Mbps
+ media 10baseT status active
+ inet6 fe80::2a0:24ff:feab:839b%ef0 prefixlen 64 scopeid 0x2
+ inet6 3ffe:501:4819:2000:2a0:24ff:feab:839b prefixlen 64
+
+
+<<<rtsold>>>
+
+rtsold is a daemon version of rtsol. If you run KAME IPv6 on a laptop
+computer and frequently move with it, the daemon is useful since it watches
+the interface and sends router solicitations when the status of the interface
+changes. Note, however, that the feature is disabled by default. Please
+add -m option when invocation of rtsold.
+
+rtsold also supports multiple interfaces. For example, you can
+invoke the daemon as follows:
+
+# rtsold -m ep0 cnw0
+
+
+<<<netstat>>>
+
+To see routing table:
+
+# netstat -nr
+# netstat -nrl
+ long format with Ref and Use. Note that bsdi4 does not support the
+ -l option. You should use the -O option instead.
+
+
+<<<sysctl>>>
+
+If "net.inet6.ip6.accept_rtadv" is 1, Router Advertisement is
+accepted. This means that global addresses and default route are
+automatically set up. Otherwise, the announcement is rejected. The
+default value is 0. To set "net.inet6.ip6.accept_rtadv" to 1, execute
+as follows:
+
+# sysctl -w net.inet6.ip6.accept_rtadv=1
+
+
+<<<gifconfig>>>
+
+"gif" interface enables you to perform IPv{4,6} over IPv{4,6}
+protocol tunneling. To use this interface, you must specify the
+outer IPv{4,6} address by using gifconfig, like:
+
+# gifconfig gif0 163.221.198.61 163.221.11.21
+
+"ifconfig gif0" will configure the address pair used for inner
+IPv{4,6} header.
+
+It is not required to configure inner IPv{4,6} address pair. If
+you do not configure inner IPv{4,6} address pair, tunnel link is
+considered as un-numbered link and the source address of inner
+IPv{4,6} address pair will be borrowed from other interfaces.
+
+The following example configures un-numbered IPv6-over-IPv4 tunnel:
+# gifconfig gif0 10.0.0.1 10.0.0.1 netmask 255.255.255.0
+
+The following example configures numbered IPv6-over-IPv4 tunnel:
+# gifconfig gif0 10.0.0.1 10.0.0.1 netmask 255.255.255.0
+# ifconfig gif0 inet6 3ffe:501:808:5::1 3ffe:501:808:5::2 prefixlen 64 alias
+
+IPv6 spec allows you to use point-to-point link without global IPv6
+address assigned to the interface. Routing protocol (such as RIPng)
+uses link-local addresses only. If you are to configure IPv6-over-IPv4
+tunnel, you need not to configure an address pair for inner IPv6
+header. We suggest you to use the former example (un-numbered
+IPv6-over-IPv4 tunnel) to connect to 6bone for simplicity.
+
+Note that it is so easy to make an infinite routing loop using gif
+interface, if you configure a tunnel using the same protocol family
+for inner and outer header (i.e. IPv4-over-IPv4).
+
+Refer to gifconfig(8) for more details.
+
+
+<<<6to4>>>
+
+WARNING: malicious party can abuse 6to4 relay routers/sites, read through
+internet draft draft-itojun-ipv6-transition-abuse-xx.txt before configuring it.
+
+"stf" interface enables you to perform 6to4 IPv6-over-IPv4 encapsulation,
+as documented in draft-ietf-ngtrans-6to4-06.txt. See stf(4) for details.
+
+
+<<<inetd>>>
+
+Inetd supports AF_INET and AF_INET6 sockets, with IPsec policy
+configuration support.
+
+Refer to inetd(8) for more details.
+
+
+<<<IPsec>>>
+
+IPsec requires fairly complex configuration, so here we show transport
+mode only. http://www.kame.net/newsletter/ has more comprehensive
+examples.
+
+Let us setup security association to deploy a secure channel between
+HOST A (10.2.3.4) and HOST B (10.6.7.8). Here we show a little
+complicated example. From HOST A to HOST B, only old AH is used.
+From HOST B to HOST A, new AH and new ESP are combined.
+
+Now we should choose algorithm to be used corresponding to "AH"/"new
+AH"/"ESP"/"new ESP". Please refer to the "setkey" man page to know
+algorithm names. Our choice is MD5 for AH, new-HMAC-SHA1 for new AH,
+and new-DES-expIV with 8 byte IV for new ESP.
+
+Key length highly depends on each algorithm. For example, key
+length must be equal to 16 bytes for MD5, 20 for new-HMAC-SHA1,
+and 8 for new-DES-expIV. Now we choose "MYSECRETMYSECRET",
+"KAMEKAMEKAMEKAMEKAME", "PASSWORD", respectively.
+
+OK, let us assign SPI (Security Parameter Index) for each protocol.
+Please note that we need 3 SPIs for this secure channel since three
+security headers are produced (one for from HOST A to HOST B, two for
+from HOST B to HOST A). Please also note that SPI MUST be greater
+than or equal to 256. We choose, 1000, 2000, and 3000, respectively.
+
+
+ (1)
+ HOST A ------> HOST B
+
+ (1)PROTO=AH
+ ALG=MD5(RFC1826)
+ KEY=MYSECRETMYSECRET
+ SPI=1000
+
+ (2.1)
+ HOST A <------ HOST B
+ <------
+ (2.2)
+
+ (2.1)
+ PROTO=AH
+ ALG=new-HMAC-SHA1(new AH)
+ KEY=KAMEKAMEKAMEKAMEKAME
+ SPI=2000
+
+ (2.2)
+ PROTO=ESP
+ ALG=new-DES-expIV(new ESP)
+ IV length = 8
+ KEY=PASSWORD
+ SPI=3000
+
+Now, let us setup security association. Execute "setkey" on both HOST
+A and B:
+
+# setkey -c
+add 10.2.3.4 10.6.7.8 ah 1000 -m transport -A keyed-md5 "MYSECRETMYSECRET" ;
+add 10.6.7.8 10.2.3.4 ah 2000 -m transport -A hmac-sha1 "KAMEKAMEKAMEKAMEKAME" ;
+add 10.6.7.8 10.2.3.4 esp 3000 -m transport -E des-cbc "PASSWORD" ;
+^D
+
+Actually, IPsec communication doesn't process until security policy
+entries will be defined. In this case, you must setup each host.
+
+At A:
+# setkey -c
+spdadd 10.2.3.4 10.6.7.8 any -P out ipsec
+ ah/transport/10.2.3.4-10.6.7.8/require ;
+^D
+
+At B:
+spdadd 10.6.7.8 10.2.3.4 any -P out ipsec
+ esp/transport//require
+ ah/transport//require ;
+^D
+
+To utilize the security associations installed into the kernel, you
+must set the socket security level by using setsockopt().
+This is per-application (or per-socket) security. For example,
+the "ping" command has the -P option with parameter to enable AH and/or ESP.
+
+For example:
+% ping -P "out ipsec \
+ ah/transport//use \
+ esp/tunnel/10.0.1.1-10.0.1.2/require" 10.0.2.2
+
+If there are proper SAs, this policy specification causes ICMP packet
+to be AH transport mode inner ESP tunnel mode like below.
+
+ HOST C -----------> GATEWAY D ----------> HOST E
+ 10.0.1.1 10.0.1.2 10.0.2.1 10.0.2.2
+ | | | |
+ | ======= ESP ======= |
+ ==================== AH ==================
+
+
+<<<EDNS0>>>
+
+EDNS0 is defined in RFC2671. With EDNS0, the resolver library can tell DNS
+server of its receiving buffer size, and permit DNS server to transmit large
+reply packet. EDNS0 is necessary to take advantage of larger minimum MTU
+in IPv6. KAME libinet6 includes resolver side support for EDNS0.
+Server side support for EDNS0 is included in ISC BIND9.
+
+ query packet with EDNS0
+ tells receive buffer size
+KAME box -----------------------------> BIND9 DNS server
+KAME box <----------------------------- BIND9 DNS server
+ can transmit jumbo reply, since DNS server
+ knows receive buffer size of KAME box
+
+How to play with it:
+- prepare KAME box and BIND9 DNS server (can be a same node)
+- add the following into /etc/resolv.conf on KAME box:
+ options edns0 <--- enables EDNS0
+ nameserver <IPv4 or v6 address of BIND9 box>
+- run applications compiled with libinet6 (like /usr/local/v6/bin/telnet),
+ see EDNS0 packet fly on the wire by tcpdump or some other method.
+
+Caveats:
+- BIND 4/8 DNS server will choke with EDNS0 packet, so you must not
+ turn the option on if you have BIND 4/8 DNS server. If you enable
+ "options edns0" against BIND 4/8 DNS server, you will never be able
+ to resolve names.
+- If you use IPv6 UDP as DNS transport, path MTU discovery may
+ affect the traffic. KAME box tries to fragment packet to 1280
+ bytes, however, BIND9 may not.
+- Some of our platforms do not use our extended resolver code in libinet6.
+ See COVERAGE for detail.
+
+
+<<Further readings>>
+
+http://www.netbsd.org/Documentation/network/ipv6/
+ Even if you are on non-netbsd operating system, the URL should be
+ useful.
+http://www.kame.net/
+
+ <end of USAGE>
diff --git a/share/examples/Makefile b/share/examples/Makefile
new file mode 100644
index 000000000000..3591fc648403
--- /dev/null
+++ b/share/examples/Makefile
@@ -0,0 +1,38 @@
+# $FreeBSD$
+#
+# Doing a make install builds /usr/share/examples
+
+DIRS!= for i in *; do if test -d $$i -a $$i != CVS; then echo $$i; fi; done
+
+DDIR= ${DESTDIR}/usr/share/examples
+
+NOOBJ= noobj
+
+# Define SHARED to indicate whether you want symbolic links to the system
+# source (``symlinks''), or a separate copy (``copies''); (latter useful
+# in environments where it's not possible to keep /sys publicly readable)
+SHARED?= copies
+
+all clean cleandir depend lint tags:
+
+beforeinstall: etc-examples ${SHARED}
+
+.for dir in ${DIRS}
+FILES!= find -L ${dir} \( -name CVS -prune \) -o -type f -print
+.for file in ${FILES}
+copies::
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${file} ${DDIR}/${file}
+.endfor
+.endfor
+
+.for dir in ${DIRS}
+symlinks::
+ rm -rf ${DDIR}/${dir}; ln -s ${.CURDIR}/${dir} ${DDIR}
+.endfor
+
+etc-examples:
+.if ${SHARED} != "symlinks"
+ (cd ${.CURDIR}/../../etc; ${MAKE} etc-examples)
+.endif
+
+.include <bsd.prog.mk>
diff --git a/share/examples/atm/NOTES b/share/examples/atm/NOTES
new file mode 100644
index 000000000000..aad41906178e
--- /dev/null
+++ b/share/examples/atm/NOTES
@@ -0,0 +1,54 @@
+
+ HARP Notes
+ 1998-09-14
+
+This is a list of currently known incompatibilities and miscellaneous gotchas
+in HARP.
+
+To report new items, please send mail to harp-bugs@magic.net.
+
+================================================================================
+
+
+Efficient Driver and DMA sizes
+==============================
+
+The Efficient adapter moves PDUs between host memory and adapter memory with
+the help of DMA descriptor lists. Each DMA descriptor consists of two words.
+Word 0 contains a DMA type identifier and a repetition count. Word 1 contains
+the physical (not virtual) host buffer address. Each DMA type is really an
+encoding of the burst size for the DMA. (See /usr/src/sys/dev/hea/eni.h for
+more on the DMA types.) HARP was originally developed using burst sizes of
+8_WORD, 4_WORD, and 1_WORD sizes. Each DMA request would be built to first
+move as much data as possible using an 8_WORD burst. This should leave 0-7
+words left over. If there were more than 3 words remaining, a 4_WORD DMA burst
+would be scheduled. The remaining data must then be 0-3 words in length and
+would be moved with 1_WORD bursts. The use of large burst sizes makes more
+efficient use of DMA by performing the same amount of work in fewer cycles.
+
+Several users have reported problems with DMA which were characterized by error
+messages of the form:
+
+ "eni_output: Transmit drain queue is full. Resources will be lost."
+or
+ "eni_output: not enough room in DMA queue".
+
+It was determined that these systems do not support the use of four- or
+eight-word DMA bursts. To resolve this problem, HARP now #ifdef's around the
+8_WORD and 4_WORD DMA setup and #undef's both values by default. This results
+in the default operation of the Efficient driver to use only 1_WORD DMA bursts.
+
+If you wish to experiment with larger DMA bursts, you can edit the file
+/usr/src/sys/dev/hea/eni_transmit.c and change the #undef to a #define for
+DMA_USE_8WORD and/or DMA_USE_4WORD. You will need to rebuild and install your
+kernel for this change to take effect.
+
+We are exploring solutions which would allow HARP to determine which DMA bursts
+are supported by the system at run-time. This would allow the Efficient device
+driver to make use of larger, more efficient burst sizes where supported
+without halting on systems which can't support the larger sizes.
+
+
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/README b/share/examples/atm/README
new file mode 100644
index 000000000000..a2e23f28bbbf
--- /dev/null
+++ b/share/examples/atm/README
@@ -0,0 +1,140 @@
+
+ ===================================
+ HARP | Host ATM Research Platform
+ ===================================
+
+ HARP 3
+
+
+What is this stuff?
+-------------------
+The Advanced Networking Group (ANG) at the Minnesota Supercomputer Center,
+Inc. (MSCI), as part of its work on the MAGIC Gigabit Testbed, developed
+the Host ATM Research Platform (HARP) software, which allows IP hosts to
+communicate over ATM networks using standard protocols. It is intended to
+be a high-quality platform for IP/ATM research.
+
+HARP provides a way for IP hosts to connect to ATM networks. It supports
+standard methods of communication using IP over ATM. A host's standard IP
+software sends and receives datagrams via a HARP ATM interface. HARP provides
+functionality similar to (and typically replaces) vendor-provided ATM device
+driver software.
+
+HARP includes full source code, making it possible for researchers to
+experiment with different approaches to running IP over ATM. HARP is
+self-contained; it requires no other licenses or commercial software packages.
+
+HARP implements support for the IETF Classical IP model for using IP over ATM
+networks, including:
+
+ o IETF ATMARP address resolution client
+ o IETF ATMARP address resolution server
+ o IETF SCSP/ATMARP server
+ o UNI 3.1 and 3.0 signalling protocols
+ o Fore Systems's SPANS signalling protocol
+
+
+
+What's supported
+----------------
+The following are supported by HARP 3:
+
+ o ATM Host Interfaces
+ - FORE Systems, Inc. SBA-200 and SBA-200E ATM SBus Adapters
+ - FORE Systems, Inc. PCA-200E ATM PCI Adapters
+ - Efficient Networks, Inc. ENI-155p ATM PCI Adapters
+
+ o ATM Signalling Protocols
+ - The ATM Forum UNI 3.1 signalling protocol
+ - The ATM Forum UNI 3.0 signalling protocol
+ - The ATM Forum ILMI address registration
+ - FORE Systems's proprietary SPANS signalling protocol
+ - Permanent Virtual Channels (PVCs)
+
+ o IETF "Classical IP and ARP over ATM" model
+ - RFC 1483, "Multiprotocol Encapsulation over ATM Adaptation Layer 5"
+ - RFC 1577, "Classical IP and ARP over ATM"
+ - RFC 1626, "Default IP MTU for use over ATM AAL5"
+ - RFC 1755, "ATM Signaling Support for IP over ATM"
+ - RFC 2225, "Classical IP and ARP over ATM"
+ - RFC 2334, "Server Cache Synchronization Protocol (SCSP)"
+ - Internet Draft draft-ietf-ion-scsp-atmarp-00.txt,
+ "A Distributed ATMARP Service Using SCSP"
+
+ o ATM Sockets interface
+ - The file atm-sockets.txt contains further information
+
+
+What's not supported
+--------------------
+The following major features of the above list are not currently supported:
+
+ o UNI point-to-multipoint support
+ o Driver support for Traffic Control/Quality of Service
+ o SPANS multicast and MPP support
+ o SPANS signalling using Efficient adapters
+
+
+For further information
+-----------------------
+For additional information about HARP, please see:
+
+ http://www.msci.magic.net
+
+
+Suggestions and Problem Reports
+-------------------------------
+While HARP is made available "as is" and is not supported, ANG is continuing
+development of HARP. We welcome suggestions for new or enhanced features,
+summaries of your experience with HARP, as well as reports of problems which
+you may experience. Feel free to contact us at harp-bugs@magic.net.
+
+ANG is maintaining a mail list of those who wish to share their experiences
+with HARP, learn of others' experiences, or receive information about future
+releases of HARP. The HARP mailing list is at harp@magic.net. To be added
+to the list, send email to harp-request@magic.net.
+
+
+Acknowledgments
+---------------
+This software was developed under the sponsorship of the Defense Advanced
+Research Projects Agency (DARPA).
+
+
+Citing HARP
+-----------
+When citing HARP in published works, please use the following citation:
+
+Host ATM Research Platform (HARP), Network Computing Services, Inc.
+This software was developed with the support of the Defense Advanced
+Research Projects Agency (DARPA).
+
+
+Copyright and Permitted Use
+---------------------------
+The Host ATM Research Platform ("HARP") software (the "Software") is
+made available by Network Computing Services, Inc. ("NetworkCS")
+"AS IS". NetworkCS does not provide maintenance, improvements or
+support of any kind.
+
+NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
+SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
+In no event shall NetworkCS be responsible for any damages, including
+but not limited to consequential damages, arising from or relating to
+any use of the Software or related support.
+
+Copyright 1994-1998 Network Computing Services, Inc.
+
+Copies of this Software may be made, however, the above copyright
+notice must be reproduced on all copies.
+
+Portions of this Software include materials copyrighted by the Regents of
+the University of California and by Sun Microsystems, Inc. The applicable
+copyright notices are reproduced in the files where the material appears.
+
+--------------------------------------------------------------------------------
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/Startup b/share/examples/atm/Startup
new file mode 100644
index 000000000000..8898e45c8821
--- /dev/null
+++ b/share/examples/atm/Startup
@@ -0,0 +1,127 @@
+HARP ATM Startup Configuration Instructions
+===========================================
+
+The following steps are required in order to use the HARP ATM software.
+See the file atm-config.sh for an example ATM startup script.
+
+1. Each ATM physical interface must be configured with one or more network
+ interfaces. The physical interfaces are named:
+
+ FORE Systems: hfa0, hfa1, ...
+ Efficient Networks: hea0, hea1, ...
+
+ The network interface names and the number of network interfaces for a
+ particular physical interface are specified via the atm command. The
+ network interface name prefix may be any alphabetic string, but the
+ generated network interface names must be unique amongst all network
+ interfaces, including non-ATM interfaces.
+
+ To configure the network interfaces, type:
+
+ atm set netif <interface_name> <netif_prefix> <netif_count>
+
+ For example, the command:
+
+ atm set netif hfa0 ni 3
+
+ will generate the network interfaces ni0, ni1 and ni2 on the physical
+ interface hfa0.
+
+ For further details, see the man page atm(8).
+
+
+2. Each ATM network interface (netif) must be configured with an IP network
+ address. Each network interface must be on a different IP subnet.
+
+ To configure the network interface, type:
+
+ ifconfig <netif_name> <IP_address> up
+
+
+3. Each ATM physical interface must have a signalling manager attached. The
+ interfaces may have the same or different signalling managers.
+
+ To attach a signalling manager, type:
+
+ atm attach <interface_name> <signalling_manager_name>
+
+ where <signalling_manager_name> may be:
+
+ sigpvc - to only support PVCs on the interface;
+ spans - to run FORE Systems SPANS signalling protocol across
+ the interface, plus support of PVCs;
+ uni30 - to run ATM Forum UNI 3.0 signalling protocol across
+ the interface, plus support of PVCs;
+ uni31 - to run ATM Forum UNI 3.1 signalling protocol across
+ the interface, plus support of PVCs;
+
+ For further details, see the man page atm(8).
+
+
+4. Each of the host's PVCs (if any) must be defined.
+
+ To define a PVC, type:
+
+ atm add pvc <interface_name> <vpi> <vci> <aal> <encaps> <owner> ....
+
+ where <interface_name> is the name of the ATM physical interface
+ over which the PVC is being defined;
+ <vpi> is the VPI value for the PVC;
+ <vci> is the VCI value for the PVC;
+ <aal> is the AAL type which the PVC endpoints will use;
+ <encaps> is the encapsulation which the PVC endpoints will use;
+ <owner> specifies the the owner of the PVC, which may be:
+ ip - the PVC is used for IP traffic;
+
+ additional parameters may be required, depending on the PVC owner:
+
+ for owner=ip,
+ <netif_name> is the name of the PVC's network interface;
+ <dst> specifies the IP address at the remote end of this PVC;
+
+ For further details, see the man page atm(8).
+
+
+5. HARP includes an ILMI daemon, which will perform host address registration
+ with the ATM switch for ATM Forum UNI interfaces. If ILMI support is
+ available and activated in the ATM switch and the ILMI daemon is running
+ (see ilmid(8)), no further registration procedures are required.
+ The 'atm set prefix' command is not needed in this case.
+
+ If ILMI address registration support is not available or activated, then
+ the host must be manually registered with its switch. There should be
+ a user command available on the switch in order to do the registration.
+
+ For example, if you are using a FORE Systems switch, you should enter
+ the following AMI command:
+
+ > conf nsap route new <host_nsap> 152 <switch_port> 0
+
+ If you are using a Cisco LightStream 1010 switch, you would use the
+ following configuration command:
+
+ > atm route <host_nsap> atm <atm_interface_#> internal
+
+ For ATM Forum UNI interfaces, the 'atm set prefix' command must also
+ be issued when not using ILMI address registration.
+
+
+6. HARP includes support for the Server Cache Synchronization Protocol (SCSP),
+ which can synchronize the ATMARP caches of multiple ATMARP servers.
+ Obviously, this is only useful on hosts which are ATMARP servers.
+
+ To run SCSP between servers, two daemons, scspd and atmarpd, must be
+ started. Scspd implements the SCSP protocol and atmarpd provides an
+ interface between scspd and the ATMARP server in the kernel. Scspd
+ requires a configuration file. It will look for a configuration
+ file at /etc/scspd.conf unless told otherwise.
+
+ An example of commands to start the two daemons is:
+
+ # scspd
+ # atmarpd <netif>
+
+ See the man pages scspd(8) and atmarpd(8) for further information.
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/atm-config.sh b/share/examples/atm/atm-config.sh
new file mode 100755
index 000000000000..b15060e83714
--- /dev/null
+++ b/share/examples/atm/atm-config.sh
@@ -0,0 +1,88 @@
+#! /bin/sh
+#
+#
+# ===================================
+# HARP | Host ATM Research Platform
+# ===================================
+#
+#
+# This Host ATM Research Platform ("HARP") file (the "Software") is
+# made available by Network Computing Services, Inc. ("NetworkCS")
+# "AS IS". NetworkCS does not provide maintenance, improvements or
+# support of any kind.
+#
+# NETWORKCS MAKES NO WARRANTIES OR REPRESENTATIONS, EXPRESS OR IMPLIED,
+# INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS FOR A PARTICULAR PURPOSE, AS TO ANY ELEMENT OF THE
+# SOFTWARE OR ANY SUPPORT PROVIDED IN CONNECTION WITH THIS SOFTWARE.
+# In no event shall NetworkCS be responsible for any damages, including
+# but not limited to consequential damages, arising from or relating to
+# any use of the Software or related support.
+#
+# Copyright 1994-1998 Network Computing Services, Inc.
+#
+# Copies of this Software may be made, however, the above copyright
+# notice must be reproduced on all copies.
+#
+# @(#) $FreeBSD$
+#
+#
+
+#
+# Sample script to load and configure ATM software
+#
+
+#
+# Download FORE microcode into adapter(s)
+#
+# This step is only required if you are using FORE ATM adapters.
+# This assumes that the FORE microcode file pca200e.bin is in /etc.
+# See the file fore-microcode.txt for further details.
+#
+/sbin/fore_dnld -d /etc
+
+#
+# Define network interfaces
+#
+/sbin/atm set netif hfa0 <netif_prefix> 1
+
+#
+# Configure physical interfaces
+#
+/sbin/atm attach hfa0 uni31
+
+#
+# Start ILMI daemon (optional)
+#
+/sbin/ilmid
+
+#
+# Set ATM address prefix
+#
+# Only need to set prefix if using UNI and not using ILMI daemon
+#
+#/sbin/atm set prefix hfa0 <nsap_prefix>
+
+#
+# Configure network interfaces
+#
+/sbin/ifconfig <netif> <ip_addr> netmask + up
+/sbin/atm set arpserver <netif> <atm_address>
+
+#
+# Configure PVCs (optional)
+#
+#/sbin/atm add pvc hfa0 <vpi> <vci> aal5 null ip <netif> <ip_addr>
+
+#
+# Start SCSP daemons (optional)
+#
+# This step is only required if your host is configured as an ATMARP server
+# and you wish to synchronize its cache with the cache(s) of some other
+# server(s). Scspd will look for its configuration file at /etc/scspd.conf.
+#
+#/usr/sbin/scspd
+#/usr/sbin/atmarpd <netif> ...
+
+exit 0
+
diff --git a/share/examples/atm/atm-sockets.txt b/share/examples/atm/atm-sockets.txt
new file mode 100644
index 000000000000..b4cc8e9d00d1
--- /dev/null
+++ b/share/examples/atm/atm-sockets.txt
@@ -0,0 +1,572 @@
+
+ HARP Native ATM Sockets API
+ ===========================
+
+ATM sockets are an extension to the traditional BSD sockets API to allow
+direct user-level access to native ATM protocol services. The ATM sockets
+extensions are implemented via the addition of a new protocol family (PF_ATM)
+and a new socket address structure (struct sockaddr_atm).
+
+The HARP implementation of native ATM sockets capabilities is intended to be
+conformant with The Open Group specifications (with known differences listed
+below) as defined in the following document:
+
+ The Open Group: Networking Services (XNS) Issue 5
+ ISBN 1-85912-165-9
+ http://www.rdg.opengroup.org/public/pubs/catalog/c523.htm
+
+And in particular, it is based on the following ATM-specific sections in the
+above document:
+
+ ATM Transport Protocol Information for Sockets
+ ATM Transport Protocol Information for XTI
+ ATM Transport Headers
+
+The ATM sockets API is an implementation based on the definitions and
+descriptions set forth in the following document:
+
+ The ATM Forum: Native ATM Services: Semantic Description, Version 1.0
+ af-saa-0048.000
+ http://www.atmforum.com/atmforum/specs/approved.html
+
+
+Using the HARP Implementation
+-----------------------------
+This document only provides the HARP-specific information necessary for using
+the ATM sockets API. Please refer to the XNS document described above for
+all of the general interface specifications. There is also sample source
+code for an ATM sockets application included at the end of this document.
+
+All user definitions for the HARP ATM sockets implementation are contained
+in the file /usr/include/netatm/atm.h. This file must be included in the
+user's C program source file. In this file, all HARP extensions to the base
+XNS specifications are denoted with a comment string of "XNS_EXT".
+
+
+HARP Extensions to XNS Issue 5
+------------------------------
+o Socket address structure for ATM addresses
+
+ An ATM socket address structure was not specifically defined by XNS,
+ although the t_atm_sap structure was defined to be used as an ATM protocol
+ address. Thus, HARP has defined an ATM socket address (using address
+ family AF_ATM) as a 'struct sockaddr_atm', which contains 'struct t_atm_sap'
+ as the protocol address. This structure (properly cast) must be used on
+ all ATM socket system calls requiring a 'struct sockaddr' parameter.
+
+o Network Interface Selection socket option (T_ATM_NET_INTF)
+
+ This option is used to specify the name of the network interface to be
+ used to route an outgoing ATM call using a socket connection. This option
+ is only needed when there are multiple ATM network interfaces defined on a
+ system. If this option is not set, then the first network interface on
+ the first physical ATM interface defined will be used.
+
+ See the sample application below for an example of the use of this option.
+
+o LLC Multiplexing socket option (T_ATM_LLC)
+
+ For LLC encapsulated VCCs (BLLI Layer 2 Protocol == T_ATM_BLLI2_I8802),
+ HARP has implemented an LLC multiplexing facility. In order to use this
+ multiplexing facility, a user must issue a setsockopt() call specifying the
+ T_ATM_LLC option before the connect() or listen() system call is invoked.
+
+ If using the LLC multiplexor, the user will only receive PDUs which match
+ the LLC header information specified in the socket option. The kernel
+ multiplexing software will strip the LLC header from all inbound PDUs and
+ add the specified LLC header to all outgoing PDUs - the user will never see
+ the LLC header.
+
+ For listening sockets, the listener will be notified for all incoming LLC
+ calls (which also meet the other incoming call distribution selection
+ criteria), since the LLC header information is only carried in the data
+ PDUs, not in the signalling protocol.
+
+ The T_ATM_LLC_SHARING flag is used to denote whether this user wishes to
+ share the VCC with other LLC users requesting similar connection attributes
+ to the same destination.
+
+o Application Name socket option (T_ATM_APP_NAME)
+
+ This option is used to associate an identifier string (typically, the
+ application's name) with an open ATM socket. Currently, it is only used
+ for the "Owner" field in the output of the 'atm show vcc' command. If this
+ option is not set, then the "Owner" field will default to "(AAL5)".
+
+ See the sample application below for an example of the use of this option.
+
+o PVC support
+
+ The XNS document specifically does not provide support for ATM PVCs.
+ However, due in part to internal HARP requirements (the ILMI daemon), PVC
+ sockets are supported under the HARP implementation.
+
+ To support PVC sockets, there is a new address format (T_ATM_PVC_ADDR) and
+ address definition (Atm_addr_pvc). Since there is no actual signalling
+ involved in setting up a PVC, a PVC socket connection only defines the
+ local socket-to-pvc connection - the remainder of the virtual circuit through
+ the ATM network to the remote endpoint must be defined independent of the
+ local socket creation. PVC socket connections are only allowed via the
+ connect() system call - listen()/accept() sockets cannot be supported.
+ Also, since there are no circuit parameters signalled, most of the
+ setsockopt() options are silently ignored.
+
+o SPANS support
+
+ HARP has added ATM socket support for the FORE-proprietary SPANS address
+ format (T_ATM_SPANS_ADDR). A SPANS socket can only be established over
+ an ATM physical interface which is using the SPANS signalling manager.
+ There is limited ATM socket option support - the socket options can be set,
+ but most are silently ignored, since they are not applicable to the SPANS
+ protocols. The SPANS socket address support has not been thoroughly tested.
+
+o Miscellaneous user convenience typedefs, macros and defines
+
+
+XNS Issue 5 Features Not Supported in HARP
+------------------------------------------
+o ATM_PROTO_SSCOP
+
+ The socket protocol for reliable data transport (ATM_PROTO_SSCOP) is not
+ supported in this HARP release. There is some initial skeleton code for
+ SSCOP support, but it was not completed.
+
+o Multipoint connections
+
+ The core HARP code does not provide support for multipoint connections, so,
+ obviously, multipoint socket connections are also not supported.
+
+ The non-supported socket options are:
+ o T_ATM_ADD_LEAF
+ o T_ATM_DROP_LEAF
+ o T_ATM_LEAF_IND
+
+ The non-supported socket option values are:
+ o For the T_ATM_BEARER_CAP socket option:
+ o connection_configuration == T_ATM_1_TO_MANY
+
+
+Example ATM Socket Application
+------------------------------
+The following are simple example client and server applications using the ATM
+socket API.
+
+/*
+ * ATM API sample client application
+ *
+ * This application will open an ATM socket to a server, send a text string
+ * in a PDU and then read one PDU from the socket and print its contents.
+ *
+ */
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netatm/atm.h>
+
+#define MAX_LEN 4096 /* Maximum PDU length */
+#define MY_ID 11 /* BLLI Layer 2 protocol */
+#define MY_APPL "Client"
+
+Atm_addr_nsap dst_addr = {
+ 0x47,
+#error FIX ME: Replace the 2 lines below with your nsap prefix and esi address
+ {0x00,0x05,0x80,0xff,0xdc,0x00,0x00,0x00,0x00,0x02,0xff,0xff},
+ {0x11,0x22,0x33,0x44,0x55,0x66},
+ 0x00
+};
+
+static char message[] = "A message from the client";
+
+void
+print_cause(int s)
+{
+ struct t_atm_cause cause;
+ int optlen;
+
+ optlen = sizeof(cause);
+ if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) {
+ perror("getsockopt(cause)");
+ return;
+ }
+
+ fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n",
+ cause.coding_standard, cause.location, cause.cause_value,
+ cause.diagnostics[0], cause.diagnostics[1],
+ cause.diagnostics[2], cause.diagnostics[3]);
+}
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ struct sockaddr_atm satm;
+ struct t_atm_aal5 aal5;
+ struct t_atm_traffic traffic;
+ struct t_atm_bearer bearer;
+ struct t_atm_qos qos;
+ struct t_atm_net_intf netintf;
+ struct t_atm_app_name appname;
+ char buffer[MAX_LEN+1];
+ int s, n, optlen;
+
+ /*
+ * Create socket
+ */
+ s = socket(AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5);
+ if (s < 0) {
+ perror("socket");
+ exit(1);
+ }
+
+ /*
+ * Set up destination SAP
+ */
+ bzero((caddr_t) &satm, sizeof(satm));
+ satm.satm_family = AF_ATM;
+#if (defined(BSD) && (BSD >= 199103))
+ satm.satm_len = sizeof(satm);
+#endif
+ /* Destination ATM address */
+ satm.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_PRESENT;
+ satm.satm_addr.t_atm_sap_addr.SVE_tag_selector = T_ATM_PRESENT;
+ satm.satm_addr.t_atm_sap_addr.address_format = T_ATM_ENDSYS_ADDR;
+ satm.satm_addr.t_atm_sap_addr.address_length = sizeof(Atm_addr_nsap);
+ bcopy((caddr_t)&dst_addr,
+ (caddr_t)satm.satm_addr.t_atm_sap_addr.address,
+ sizeof(dst_addr));
+
+ /* BLLI Layer-2 protocol */
+ satm.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT;
+ satm.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_USER_ID;
+ satm.satm_addr.t_atm_sap_layer2.ID.user_defined_ID = MY_ID;
+
+ /* BLLI Layer-3 protocol */
+ satm.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT;
+
+ /* BHLI protocol */
+ satm.satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT;
+
+ /*
+ * Set up connection parameters
+ */
+ aal5.forward_max_SDU_size = MAX_LEN;
+ aal5.backward_max_SDU_size = MAX_LEN;
+ aal5.SSCS_type = T_ATM_NULL;
+ optlen = sizeof(aal5);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5,
+ optlen) < 0) {
+ perror("setsockopt(aal5)");
+ exit(1);
+ }
+
+ traffic.forward.PCR_high_priority = T_ATM_ABSENT;
+ traffic.forward.PCR_all_traffic = 100000;
+ traffic.forward.SCR_high_priority = T_ATM_ABSENT;
+ traffic.forward.SCR_all_traffic = T_ATM_ABSENT;
+ traffic.forward.MBS_high_priority = T_ATM_ABSENT;
+ traffic.forward.MBS_all_traffic = T_ATM_ABSENT;
+ traffic.forward.tagging = T_NO;
+ traffic.backward.PCR_high_priority = T_ATM_ABSENT;
+ traffic.backward.PCR_all_traffic = 100000;
+ traffic.backward.SCR_high_priority = T_ATM_ABSENT;
+ traffic.backward.SCR_all_traffic = T_ATM_ABSENT;
+ traffic.backward.MBS_high_priority = T_ATM_ABSENT;
+ traffic.backward.MBS_all_traffic = T_ATM_ABSENT;
+ traffic.backward.tagging = T_NO;
+ traffic.best_effort = T_YES;
+ optlen = sizeof(traffic);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_TRAFFIC, (caddr_t)&traffic,
+ optlen) < 0) {
+ perror("setsockopt(traffic)");
+ exit(1);
+ }
+
+ bearer.bearer_class = T_ATM_CLASS_X;
+ bearer.traffic_type = T_ATM_NULL;
+ bearer.timing_requirements = T_ATM_NULL;
+ bearer.clipping_susceptibility = T_NO;
+ bearer.connection_configuration = T_ATM_1_TO_1;
+ optlen = sizeof(bearer);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_BEARER_CAP, (caddr_t)&bearer,
+ optlen) < 0) {
+ perror("setsockopt(bearer)");
+ exit(1);
+ }
+
+ qos.coding_standard = T_ATM_NETWORK_CODING;
+ qos.forward.qos_class = T_ATM_QOS_CLASS_0;
+ qos.backward.qos_class = T_ATM_QOS_CLASS_0;
+ optlen = sizeof(qos);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos,
+ optlen) < 0) {
+ perror("setsockopt(qos)");
+ exit(1);
+ }
+
+#ifdef REMOVE_TO_USE_NET_INTF
+#error FIX ME: Replace the ni0 below with the local atm network interface name
+ strncpy(netintf.net_intf, "ni0", IFNAMSIZ);
+ optlen = sizeof(netintf);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_NET_INTF, (caddr_t)&netintf,
+ optlen) < 0) {
+ perror("setsockopt(net_intf)");
+ exit(1);
+ }
+#endif
+
+ strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN);
+ optlen = sizeof(appname);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_APP_NAME, (caddr_t)&appname,
+ optlen) < 0) {
+ perror("setsockopt(app_name)");
+ exit(1);
+ }
+
+ /*
+ * Now try to connect to destination
+ */
+ if (connect(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) {
+ perror("connect");
+ print_cause(s);
+ exit(1);
+ }
+
+ /*
+ * Exchange message with peer
+ */
+ if (write(s, message, sizeof(message)) != sizeof(message)) {
+ perror("write");
+ exit(1);
+ }
+
+ if ((n = read(s, buffer, MAX_LEN)) < 0) {
+ perror("read");
+ exit(1);
+ }
+
+ buffer[n] = '\0';
+ printf("received %d bytes: <%s>\n", n, buffer);
+
+ /*
+ * Finish up
+ */
+ if (close(s) < 0) {
+ perror("close");
+ exit(1);
+ }
+
+ exit(0);
+}
+
+
+
+/*
+ * ATM API sample server application
+ *
+ * This application will loop forever listening for connections on an ATM
+ * socket. When a new connection arrives, it will send a string in a PDU,
+ * read one PDU from the socket and print its contents.
+ *
+ */
+#include <stdio.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netatm/atm.h>
+
+#define MAX_LEN 4096 /* Maximum PDU length */
+#define MY_ID 11 /* BLLI Layer 2 protocol */
+#define MY_APPL "Server"
+
+static char message[] = "A message from the server";
+
+void
+print_cause(int s)
+{
+ struct t_atm_cause cause;
+ int optlen;
+
+ optlen = sizeof(cause);
+ if (getsockopt(s, T_ATM_SIGNALING, T_ATM_CAUSE, &cause, &optlen) < 0) {
+ perror("getsockopt(cause)");
+ return;
+ }
+
+ fprintf(stderr, "Cause: coding=%d loc=%d cause=%d diag=(%d,%d,%d,%d)\n",
+ cause.coding_standard, cause.location, cause.cause_value,
+ cause.diagnostics[0], cause.diagnostics[1],
+ cause.diagnostics[2], cause.diagnostics[3]);
+}
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ struct sockaddr_atm satm;
+ struct t_atm_aal5 aal5;
+ struct t_atm_traffic traffic;
+ struct t_atm_bearer bearer;
+ struct t_atm_qos qos;
+ struct t_atm_net_intf netintf;
+ struct t_atm_app_name appname;
+ char buffer[MAX_LEN+1];
+ int s, n, optlen;
+
+ /*
+ * Create socket
+ */
+ s = socket(AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5);
+ if (s < 0) {
+ perror("socket");
+ exit(1);
+ }
+
+ /*
+ * Set up destination SAP
+ */
+ bzero((caddr_t) &satm, sizeof(satm));
+ satm.satm_family = AF_ATM;
+#if (defined(BSD) && (BSD >= 199103))
+ satm.satm_len = sizeof(satm);
+#endif
+ /* Destination ATM address */
+ satm.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_ANY;
+ satm.satm_addr.t_atm_sap_addr.SVE_tag_selector = T_ATM_ANY;
+
+ /* BLLI Layer-2 protocol */
+ satm.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT;
+ satm.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_USER_ID;
+ satm.satm_addr.t_atm_sap_layer2.ID.user_defined_ID = MY_ID;
+
+ /* BLLI Layer-3 protocol */
+ satm.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT;
+
+ /* BHLI protocol */
+ satm.satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT;
+
+ /*
+ * Set up connection parameters
+ */
+ aal5.forward_max_SDU_size = MAX_LEN;
+ aal5.backward_max_SDU_size = MAX_LEN;
+ aal5.SSCS_type = T_ATM_NULL;
+ optlen = sizeof(aal5);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5,
+ optlen) < 0) {
+ perror("setsockopt(aal5)");
+ exit(1);
+ }
+
+ traffic.forward.PCR_high_priority = T_ATM_ABSENT;
+ traffic.forward.PCR_all_traffic = 100000;
+ traffic.forward.SCR_high_priority = T_ATM_ABSENT;
+ traffic.forward.SCR_all_traffic = T_ATM_ABSENT;
+ traffic.forward.MBS_high_priority = T_ATM_ABSENT;
+ traffic.forward.MBS_all_traffic = T_ATM_ABSENT;
+ traffic.forward.tagging = T_NO;
+ traffic.backward.PCR_high_priority = T_ATM_ABSENT;
+ traffic.backward.PCR_all_traffic = 100000;
+ traffic.backward.SCR_high_priority = T_ATM_ABSENT;
+ traffic.backward.SCR_all_traffic = T_ATM_ABSENT;
+ traffic.backward.MBS_high_priority = T_ATM_ABSENT;
+ traffic.backward.MBS_all_traffic = T_ATM_ABSENT;
+ traffic.backward.tagging = T_NO;
+ traffic.best_effort = T_YES;
+ optlen = sizeof(traffic);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_TRAFFIC, (caddr_t)&traffic,
+ optlen) < 0) {
+ perror("setsockopt(traffic)");
+ exit(1);
+ }
+
+ bearer.bearer_class = T_ATM_CLASS_X;
+ bearer.traffic_type = T_ATM_NULL;
+ bearer.timing_requirements = T_ATM_NULL;
+ bearer.clipping_susceptibility = T_NO;
+ bearer.connection_configuration = T_ATM_1_TO_1;
+ optlen = sizeof(bearer);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_BEARER_CAP, (caddr_t)&bearer,
+ optlen) < 0) {
+ perror("setsockopt(bearer)");
+ exit(1);
+ }
+
+ qos.coding_standard = T_ATM_NETWORK_CODING;
+ qos.forward.qos_class = T_ATM_QOS_CLASS_0;
+ qos.backward.qos_class = T_ATM_QOS_CLASS_0;
+ optlen = sizeof(qos);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos,
+ optlen) < 0) {
+ perror("setsockopt(qos)");
+ exit(1);
+ }
+
+ strncpy(appname.app_name, MY_APPL, T_ATM_APP_NAME_LEN);
+ optlen = sizeof(appname);
+ if (setsockopt(s, T_ATM_SIGNALING, T_ATM_APP_NAME, (caddr_t)&appname,
+ optlen) < 0) {
+ perror("setsockopt(app_name)");
+ exit(1);
+ }
+
+ /*
+ * Now try to bind/listen
+ */
+ if (bind(s, (struct sockaddr *) &satm, sizeof(satm)) < 0) {
+ perror("bind");
+ exit(1);
+ }
+ if (listen(s, 4) < 0) {
+ perror("listen");
+ exit(1);
+ }
+
+ for (; ; ) {
+ struct sockaddr_atm claddr;
+ int clsock, cllen;
+
+ /* Wait for incoming call */
+ cllen = sizeof(claddr);
+ clsock = accept(s, (struct sockaddr *) &claddr, &cllen);
+ if (clsock < 0) {
+ perror("accept");
+ exit(1);
+ }
+ printf("Server: new connection\n");
+
+ /*
+ * Exchange message with peer
+ */
+ if (write(clsock, message, sizeof(message)) != sizeof(message)) {
+ perror("write");
+ exit(1);
+ }
+
+ if ((n = read(clsock, buffer, MAX_LEN)) < 0) {
+ perror("read");
+ exit(1);
+ }
+
+ buffer[n] = '\0';
+ printf("received %d bytes: <%s>\n", n, buffer);
+
+ sleep(1);
+
+ /*
+ * Finish up
+ */
+ if (close(clsock) < 0) {
+ perror("close");
+ exit(1);
+ }
+ }
+
+ close(s);
+ exit(0);
+}
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/cpcs-design.txt b/share/examples/atm/cpcs-design.txt
new file mode 100644
index 000000000000..94901f23998e
--- /dev/null
+++ b/share/examples/atm/cpcs-design.txt
@@ -0,0 +1,84 @@
+
+ CPCS Design
+ ===========
+
+SAP_CPCS Interface
+------------------
+This is the stack SAP interface between an AAL CPCS provider and an AAL CPCS
+user. The stack commands defined for this interface are modeled after the
+AAL3/4 and AAL5 protocol specification primitives CPCS-xxx. See the protocol
+specification documents referenced below for full descriptions of the CPCS
+interface.
+
+
+o The following stack commands are sent from a CPCS user to the CPCS provider:
+
+Stack Command: CPCS_INIT
+Description: Initialize a SAP instance. This should be the first stack
+ command issued across the SAP instance after the service stack
+ has been successfully instantiated.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: CPCS_TERM
+Description: Terminate a SAP instance. This must be the last stack command
+ issued across the SAP instance. The stack instance will be
+ deleted upon completion of this command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: CPCS_UNITDATA_INV
+Description: Request that an SDU be sent to the remote AAL user.
+Argument 1: Pointer to an mbuf chain containing the user SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: CPCS_UABORT_INV
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+o The following stack commands are sent from the CPCS provider to a CPCS user:
+
+Stack Command: CPCS_UNITDATA_SIG
+Description: Indication that an SDU has been received from the remote AAL
+ user.
+Argument 1: Pointer to an mbuf chain containing the peer's SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: CPCS_UABORT_SIG
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+Stack Command: CPCS_PABORT_SIG
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+
+Protocol Specifications
+-----------------------
+See I.363.
+
+
+
+Implementation Limitations
+--------------------------
+o The CPCS-LP, CPCS-CI and CPCS-UU parameters are not supported.
+
+o The Streaming Mode service is not supported.
+
+o The Abort service is not supported.
+
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/fore-microcode.txt b/share/examples/atm/fore-microcode.txt
new file mode 100644
index 000000000000..ab1e16db3a0b
--- /dev/null
+++ b/share/examples/atm/fore-microcode.txt
@@ -0,0 +1,92 @@
+
+HARP and FORE Systems Microcode
+===============================
+
+ATM adapters from FORE Systems use Intel i960 embedded processors and
+require that application software (herein called "microcode") be downloaded
+and executed on the adapter. The interface between the microcode and the host
+device driver is specified in the FORE ATM Adaptation Layer Interface (AALI)
+(available from ftp.fore.com:/pub/docs/port). HARP uses microcode supplied
+by FORE Systems. The HARP device driver for the FORE adapter (hfa) conforms
+to the AALI specification.
+
+As part of the HARP ATM initialization procedure, the HARP 'fore_dnld' utility
+must be invoked in order to load the microcode file into each FORE adapter.
+However, the microcode file is NOT included in the FreeBSD distribution. It is
+the user's responsibilty to obtain and install the FORE microcode file. Below
+are notes to assist users in finding and installing microcode known to work
+with HARP.
+
+FORE microcode files can be obtained from either FORE's web site
+(http://www.fore.com) or the CD distributed with new FORE adapters.
+When using FORE's web site, you must have a valid login to access the
+TACtics Online section of the site. The software download section is
+available via the 'Services & Support'->'TACtics Online'->Software links.
+
+If you are currently using HARP and already have a working microcode file,
+that microcode will continue to work with this release of HARP.
+
+
+PCA200E
+-------
+
+From the FORE web pages, the following PCA200E adapter distributions
+are known to have microcode which will work with HARP:
+
+ pc_adapter->OS/2->archive->os2_4.0.2_1.20.200.zip
+ unzip the file and execute the command:
+
+ cp -p <unzip_directory>/Drivers/PCA200E.BIN /etc/pca200e.bin
+
+ pc_adapter->'Windows NT'->archive->pca2e_12.zip
+ unzip the file and execute the command:
+
+ cp -p <unzip_directory>/NT/I386/PCA200E.BIN /etc/pca200e.bin
+
+
+The following distributions from the FORE web pages are known to have
+microcode which will NOT work with HARP:
+
+ pc_adapter:
+ OS/2:
+ release:
+ os2_4.1.0_1.74.zip
+ Windows95:
+ archive:
+ pc-w95_5.0.0.16432.zip
+ win95_4.0.3_1.04.200.zip
+ win95_4.1.6_1.16.zip
+ release:
+ pc-w95_4.1.6_27.zip
+ Windows NT:
+ archive:
+ pc-nt_5.0.0_16342.zip
+ winnt_4.0.3_1.05.200.zip
+ winnt_4.1.2_1.27.zip
+ winnt_4.1.6_1.16.zip
+ release:
+ pc-nt_4.1.6_27.zip
+ pc-nt_i386_5.0.0_25096.zip
+
+
+From the "ForeRunner 200E for PC/Mac" distribution CD-ROM, the following
+PCA200E adapter distributions are known to have microcode which will work
+with HARP (assuming the CD-ROM is mounted on /cdrom):
+
+ /cdrom/rel4.0/os2/
+ execute the command:
+
+ cp -p /cdrom/rel4.0/os2/drivers/pca200e.bin /etc/pca200e.bin
+
+
+Note: Windows-based files are supplied in a compressed form. If the
+'fore_dnld' command complains about an unrecognized header format, you should
+try to uncompress the microcode file. To do so, move the file in binary mode
+to a DOS/Windows machine and use the DOS command 'expand' to uncompress the
+file. The command syntax is:
+
+ expand <in-file> <out-file>
+
+Move the resulting <out-file> in binary mode back to the HARP machine as
+/etc/pca200e.bin and try to initialize the ATM system again.
+
diff --git a/share/examples/atm/sscf-design.txt b/share/examples/atm/sscf-design.txt
new file mode 100644
index 000000000000..5334d74bdbac
--- /dev/null
+++ b/share/examples/atm/sscf-design.txt
@@ -0,0 +1,129 @@
+
+ SSCF UNI Design
+ ===============
+
+SAP_SSCF_UNI Interface
+----------------------
+This is the stack SAP interface between the UNI signalling layer (eg. Q.2931)
+and the SSCF module. The stack commands defined for this interface are modeled
+after the SSCF protocol specification primitives AAL-xxx. See the protocol
+specification documents referenced below for full descriptions of the SSCF UNI
+interface presented to the signalling user.
+
+
+o The following stack commands are sent from the signalling module to SSCF:
+
+Stack Command: SSCF_UNI_INIT
+Description: Initialize a SAP instance. This should be the first stack
+ command issued across the SAP instance after the service stack
+ has been successfully instantiated.
+Argument 1: Specifies the UNI version to be used for this stack instance.
+ (enum uni_vers)
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_TERM
+Description: Terminate a SAP instance. This must be the last stack command
+ issued across the SAP instance. The stack instance will be
+ deleted upon completion of this command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_ESTABLISH_REQ
+Description: Request the establishment of an assured SAAL connection to the
+ SAAL peer entity.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_RELEASE_REQ
+Description: Request the termination of an assured SAAL connection to the
+ SAAL peer entity.
+Argument 1: Specifies whether future session establishment indications from
+ the SAAL peer should be processed. Valid values are
+ SSCF_UNI_ESTIND_YES or SSCF_UNI_ESTIND_NO. (int)
+ Note that this is a local implementation parameter only.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_DATA_REQ
+Description: Request that an assured SDU be sent to the SAAL peer.
+Argument 1: Pointer to an mbuf chain containing the user SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_UNITDATA_REQ
+Description: Request that an unacknowledged SDU be sent to the SAAL peer.
+Argument 1: Pointer to an mbuf chain containing the user SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+o The following stack commands are sent from SSCF to the signalling module:
+
+Stack Command: SSCF_UNI_ESTABLISH_IND
+Description: Indication that an assured SAAL connection has been established
+ by the SAAL peer entity.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_ESTABLISH_CNF
+Description: Confirmation of an assured SAAL connection establishment,
+ previously requested via an SSCF_UNI_ESTABLISH_REQ command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_RELEASE_IND
+Description: Indication that an assured SAAL connection has been terminated
+ by the SAAL peer entity.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_RELEASE_CNF
+Description: Confirmation of an assured SAAL connection termination,
+ previously requested via an SSCF_UNI_RELEASE_REQ command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_DATA_IND
+Description: Indication that an assured SDU has been received from the
+ SAAL peer.
+Argument 1: Pointer to an mbuf chain containing the peer's SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCF_UNI_UNITDATA_IND
+Description: Indication that an unacknowledged SDU has been received from
+ the SAAL peer.
+Argument 1: Pointer to an mbuf chain containing the peer's SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+
+Protocol Specifications
+-----------------------
+For UNI_VERS_3_0, see Q.SAAL2.
+For UNI_VERS_3_1, see Q.2130.
+
+
+
+Implementation Limitations
+--------------------------
+o The Parameter Data parameter is not supported for the following primitives:
+ AAL-ESTABLISH request
+ AAL-ESTABLISH indication
+ AAL-ESTABLISH confirm
+ AAL-RELEASE request
+ AAL-RELEASE indication
+
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/atm/sscop-design.txt b/share/examples/atm/sscop-design.txt
new file mode 100644
index 000000000000..2b546bd6aeac
--- /dev/null
+++ b/share/examples/atm/sscop-design.txt
@@ -0,0 +1,220 @@
+
+ SSCOP Design
+ ============
+
+SAP_SSCOP Interface
+-------------------
+This is the stack SAP interface between the SSCOP module and an SSCOP user
+module (eg. SSCF). The stack commands defined for this interface are modeled
+after the SSCOP protocol specification primitives AA-xxx. See the protocol
+specification documents referenced below for full descriptions of the SSCOP
+interface presented to an SSCF.
+
+
+o The following stack commands are sent from an SSCF to SSCOP:
+
+Stack Command: SSCOP_INIT
+Description: Initialize a SAP instance. This should be the first stack
+ command issued across the SAP instance after the service stack
+ has been successfully instantiated.
+Argument 1: Specifies the SSCOP version to be used for this stack instance.
+ (enum sscop_vers)
+Argument 2: Pointer to a structure containing the SSCOP protocol parameter
+ values to be used for this instance. (struct sscop_parms *)
+
+
+Stack Command: SSCOP_TERM
+Description: Terminate a SAP instance. This must be the last stack command
+ issued across the SAP instance. The stack instance will be
+ deleted upon completion of this command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_ESTABLISH_REQ
+Description: Request the establishment of an SSCOP connection for assured
+ information transfer to the remote peer entity.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data to be sent to the peer.
+ Must be coded as SSCOP_UU_NULL. (struct mbuf *)
+Argument 2: Buffer Release (BR) parameter. Must be coded as SSCOP_BR_YES.
+ (int)
+
+
+Stack Command: SSCOP_ESTABLISH_RSP
+Description: Response indicating that an SSCOP connection establishment
+ request from the remote peer is acceptable.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data to be sent to the peer.
+ Must be coded as SSCOP_UU_NULL. (struct mbuf *)
+Argument 2: Buffer Release (BR) parameter. Must be coded as SSCOP_BR_YES.
+ (int)
+
+
+Stack Command: SSCOP_RELEASE_REQ
+Description: Request the termination of an SSCOP connection with the
+ remote peer entity.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data to be sent to the peer.
+ Must be coded as SSCOP_UU_NULL. (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_DATA_REQ
+Description: Request that an assured SDU be sent to the remote peer.
+Argument 1: Pointer to an mbuf chain containing the user SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RESYNC_REQ
+Description: Request the resynchronization of an SSCOP connection.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data to be sent to the peer.
+ Must be coded as SSCOP_UU_NULL. (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RESYNC_RSP
+Description: Acknowledge the remote peer's resynchronization of an SSCOP
+ connection.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RECOVER_RSP (Q.2110 only)
+Description: Acknowledge the indication that the SSCOP connection has
+ recovered from SSCOP protocol errors.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_UNITDATA_REQ
+Description: Request that an unacknowledged SDU be sent to the remote peer.
+Argument 1: Pointer to an mbuf chain containing the user SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RETRIEVE_REQ
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+o The following stack commands are sent from SSCOP to an SSCF:
+
+Stack Command: SSCOP_ESTABLISH_IND
+Description: Indication that a request to establish an SSCOP connection has
+ been received from the remote peer entity.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data received from the peer.
+ (struct mbuf *)
+Argument 2: Source of establish request (Q.SAAL1 only). Valid values are
+ SSCOP_SOURCE_SSCOP or SSCOP_SOURCE_USER. (int)
+
+
+Stack Command: SSCOP_ESTABLISH_CNF
+Description: Confirmation from the remote peer of an SSCOP connection
+ establishment, previously requested via an SSCOP_ESTABLISH_REQ
+ command.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data received from the peer.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RELEASE_IND
+Description: Indication that an SSCOP connection has been terminated by
+ the remote peer entity.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data received from the peer.
+ (struct mbuf *)
+Argument 2: Source of release request. Valid values are SSCOP_SOURCE_SSCOP
+ or SSCOP_SOURCE_USER. (int)
+
+
+Stack Command: SSCOP_RELEASE_CNF
+Description: Confirmation from the remote peer of an SSCOP connection
+ termination, previously requested via an SSCOP_RELEASE_REQ
+ command.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_DATA_IND
+Description: Indication that an assured SDU has been received from the
+ remote peer.
+Argument 1: Pointer to an mbuf chain containing the peer's SDU.
+ (struct mbuf *)
+Argument 2: Sequence number of the received SDU. (sscop_seq)
+
+
+Stack Command: SSCOP_RESYNC_IND
+Description: Indication that the remote peer has requested the
+ resynchronization of the SSCOP connection.
+Argument 1: Pointer to an mbuf chain containing any SSCOP User-to-User
+ Information (SSCOP-UU / UUI) data received from the peer.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RESYNC_CNF
+Description: Confirmation from the remote peer that an SSCOP connection
+ has been resynchronized.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RECOVER_IND (Q.2110 only)
+Description: Indication that an SSCOP connection has recovered from SSCOP
+ protocol errors.
+Argument 1: Not used.
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_UNITDATA_IND
+Description: Indication that an unacknowledged SDU has been received from
+ the remote peer.
+Argument 1: Pointer to an mbuf chain containing the peer's SDU.
+ (struct mbuf *)
+Argument 2: Not used.
+
+
+Stack Command: SSCOP_RETRIEVE_IND
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+Stack Command: SSCOP_RETRIEVECMP_IND
+Description: Not supported.
+Argument 1: N/A
+Argument 2: N/A
+
+
+
+Protocol Specifications
+-----------------------
+For SSCOP_VERS_QSAAL, see Q.SAAL1.
+For SSCOP_VERS_Q2110, see Q.2110.
+
+
+
+Implementation Limitations
+--------------------------
+o The following signals are not supported:
+ AA-RETRIEVE
+ AA-RETRIEVE COMPLETE
+ AA-RELEASEBUF (Q.SAAL1 only)
+ MAA-UNITDATA
+
+o Does not support sending the SSCOP-UU/UUI parameter, must be set to NULL
+
+o For the AA-ESTABLISH request and response signals, only BR=YES is supported
+
+o For the AA-DATA request signal, only PR=NO is supported (Q.SAAL1 only)
+
+
+ @(#) $FreeBSD$
+
diff --git a/share/examples/bootforth/README b/share/examples/bootforth/README
new file mode 100644
index 000000000000..b8eb8a0f3a16
--- /dev/null
+++ b/share/examples/bootforth/README
@@ -0,0 +1,35 @@
+Here you can find some simple examples how to use BootFORTH (part of the
+new bootloader) together with terminal emulation code (available when
+compiling /sys/boot/i386/libi386 with -DTERM_EMU).
+
+Normally, you can place the files in /boot as they are here, and they will be
+automatically loaded by /boot/loader. You must choose between boot.4th or
+loader.rc, though. Copy one or the other, but not both. Also, menu.4th is
+only used by boot.4th, and menuconf.4th is only used by loader.rc, so you
+don't need to copy both files.
+
+The files are:
+
+boot.4th example of file which is always loaded by /boot/loader, if
+ present in /boot/
+loader.rc example of file which is always loader by /boot/loader, if
+ present in /boot/
+screen.4th helpful words for screen manipulation.
+frames.4th basic frame drawing primitives. Requires screen.4th.
+menu.4th example of simple startup menu.
+menuconf.4th another example of simples startup menu.
+
+You're encouraged to add more features to these files - I'm not a Forth
+hacker, unfortunately...
+
+Andrzej Bialecki
+<abial@freebsd.org>
+
+If you use loader.rc/menuconf.4th, be sure to create /boot/stable.conf and
+/boot/current.conf, like described in loader.conf(5), with appropriate
+configuration to distinguish one from the other.
+
+Daniel C. Sobral
+<dcs@freebsd.org>
+
+$FreeBSD$
diff --git a/share/examples/bootforth/boot.4th b/share/examples/bootforth/boot.4th
new file mode 100644
index 000000000000..631775b304f7
--- /dev/null
+++ b/share/examples/bootforth/boot.4th
@@ -0,0 +1,22 @@
+\ Example of the file which is automatically loaded by /boot/loader
+\ on startup.
+\ $FreeBSD$
+
+\ Load the screen manipulation words
+
+cr .( Loading Forth extensions:)
+
+cr .( - screen.4th...)
+s" /boot/screen.4th" fopen dup fload fclose
+
+\ Load frame support
+cr .( - frames.4th...)
+s" /boot/frames.4th" fopen dup fload fclose
+
+\ Load our little menu
+cr .( - menu.4th...)
+s" /boot/menu.4th" fopen dup fload fclose
+
+\ Show it
+cr
+main_menu
diff --git a/share/examples/bootforth/frames.4th b/share/examples/bootforth/frames.4th
new file mode 100644
index 000000000000..ff91c5b7ec87
--- /dev/null
+++ b/share/examples/bootforth/frames.4th
@@ -0,0 +1,90 @@
+\ Words implementing frame drawing
+\ XXX Filled boxes are left as an exercise for the reader... ;-/
+\ $FreeBSD$
+
+marker task-frames.4th
+
+variable h_el
+variable v_el
+variable lt_el
+variable lb_el
+variable rt_el
+variable rb_el
+variable fill
+
+\ Single frames
+196 constant sh_el
+179 constant sv_el
+218 constant slt_el
+192 constant slb_el
+191 constant srt_el
+217 constant srb_el
+\ Double frames
+205 constant dh_el
+186 constant dv_el
+201 constant dlt_el
+200 constant dlb_el
+187 constant drt_el
+188 constant drb_el
+\ Fillings
+0 constant fill_none
+32 constant fill_blank
+176 constant fill_dark
+177 constant fill_med
+178 constant fill_bright
+
+
+: hline ( len x y -- ) \ Draw horizontal single line
+ at-xy \ move cursor
+ 0 do
+ h_el @ emit
+ loop
+;
+
+: f_single ( -- ) \ set frames to single
+ sh_el h_el !
+ sv_el v_el !
+ slt_el lt_el !
+ slb_el lb_el !
+ srt_el rt_el !
+ srb_el rb_el !
+;
+
+: f_double ( -- ) \ set frames to double
+ dh_el h_el !
+ dv_el v_el !
+ dlt_el lt_el !
+ dlb_el lb_el !
+ drt_el rt_el !
+ drb_el rb_el !
+;
+
+: vline ( len x y -- ) \ Draw vertical single line
+ 2dup 4 pick
+ 0 do
+ at-xy
+ v_el @ emit
+ 1+
+ 2dup
+ loop
+ 2drop 2drop drop
+;
+
+: box ( w h x y -- ) \ Draw a box
+ 2dup 1+ 4 pick 1- -rot
+ vline \ Draw left vert line
+ 2dup 1+ swap 5 pick + swap 4 pick 1- -rot
+ vline \ Draw right vert line
+ 2dup swap 1+ swap 5 pick 1- -rot
+ hline \ Draw top horiz line
+ 2dup swap 1+ swap 4 pick + 5 pick 1- -rot
+ hline \ Draw bottom horiz line
+ 2dup at-xy lt_el @ emit \ Draw left-top corner
+ 2dup 4 pick + at-xy lb_el @ emit \ Draw left bottom corner
+ 2dup swap 5 pick + swap at-xy rt_el @ emit \ Draw right top corner
+ 2 pick + swap 3 pick + swap at-xy rb_el @ emit
+ 2drop
+;
+
+f_single
+fill_none fill !
diff --git a/share/examples/bootforth/loader.rc b/share/examples/bootforth/loader.rc
new file mode 100644
index 000000000000..d216a460416f
--- /dev/null
+++ b/share/examples/bootforth/loader.rc
@@ -0,0 +1,34 @@
+\ Example of the file which is automatically loaded by /boot/loader
+\ on startup.
+\ $FreeBSD$
+
+cr .( Loading Forth extensions:)
+
+\ Load configuration file words
+
+cr .( - loader.4th...)
+
+include /boot/loader.4th
+
+\ Load the screen manipulation words
+
+cr .( - screen.4th...)
+s" /boot/screen.4th" fopen dup fload fclose
+
+\ Load frame support
+cr .( - frames.4th...)
+s" /boot/frames.4th" fopen dup fload fclose
+
+\ Load our little menu
+cr .( - menuconf.4th...)
+s" /boot/menuconf.4th" fopen dup fload fclose
+
+\ Initialize loader.4th stuff
+
+cr cr .( Initializing loader.4th...)
+initialize drop
+
+\ Show the menu
+cr
+main_menu
+
diff --git a/share/examples/bootforth/menu.4th b/share/examples/bootforth/menu.4th
new file mode 100644
index 000000000000..5c5c3e98c74e
--- /dev/null
+++ b/share/examples/bootforth/menu.4th
@@ -0,0 +1,99 @@
+\ Simple greeting screen, presenting basic options.
+\ XXX This is far too trivial - I don't have time now to think
+\ XXX about something more fancy... :-/
+\ $FreeBSD$
+
+: title
+ f_single
+ 60 11 10 4 box
+ 29 4 at-xy 15 fg 7 bg
+ ." Welcome to BootFORTH!"
+ me
+;
+
+: menu
+ 2 fg
+ 20 7 at-xy
+ ." 1. Start FreeBSD /kernel."
+ 20 8 at-xy
+ ." 2. Interact with BootFORTH."
+ 20 9 at-xy
+ ." 3. Reboot."
+ me
+;
+
+: tkey ( d -- flag | char )
+ seconds +
+ begin 1 while
+ dup seconds u< if
+ drop
+ -1
+ exit
+ then
+ key? if
+ drop
+ key
+ exit
+ then
+ repeat
+;
+
+: prompt
+ 14 fg
+ 20 11 at-xy
+ ." Enter your option (1,2,3): "
+ 10 tkey
+ dup 32 = if
+ drop key
+ then
+ dup 0< if
+ drop 49
+ then
+ dup emit
+ me
+;
+
+: help_text
+ 10 18 at-xy ." * Choose 1 if you just want to run FreeBSD."
+ 10 19 at-xy ." * Choose 2 if you want to use bootloader facilities."
+ 12 20 at-xy ." See '?' for available commands, and 'words' for"
+ 12 21 at-xy ." complete list of Forth words."
+ 10 22 at-xy ." * Choose 3 in order to warm boot your machine."
+;
+
+: (boot) 0 boot ;
+: (reboot) 0 reboot ;
+
+: main_menu
+ begin 1 while
+ clear
+ f_double
+ 79 23 1 1 box
+ title
+ menu
+ help_text
+ prompt
+ cr cr cr
+ dup 49 = if
+ drop
+ 1 25 at-xy cr
+ ." Loading kernel. Please wait..." cr
+ ['] (boot) catch abort" Error booting"
+ then
+ dup 50 = if
+ drop
+ 1 25 at-xy cr
+ exit
+ then
+ dup 51 = if
+ drop
+ 1 25 at-xy cr
+ ['] (reboot) catch abort" Error rebooting"
+ then
+ 20 12 at-xy
+ ." Key " emit ." is not a valid option!"
+ 20 13 at-xy
+ ." Press any key to continue..."
+ key drop
+ repeat
+;
diff --git a/share/examples/bootforth/menuconf.4th b/share/examples/bootforth/menuconf.4th
new file mode 100644
index 000000000000..a769f77e3543
--- /dev/null
+++ b/share/examples/bootforth/menuconf.4th
@@ -0,0 +1,110 @@
+\ Simple greeting screen, presenting basic options.
+\ XXX This is far too trivial - I don't have time now to think
+\ XXX about something more fancy... :-/
+\ $FreeBSD$
+
+: title
+ f_single
+ 60 11 10 4 box
+ 29 4 at-xy 15 fg 7 bg
+ ." Welcome to BootFORTH!"
+ me
+;
+
+: menu
+ 2 fg
+ 20 7 at-xy
+ ." 1. Start FreeBSD with /boot/stable.conf."
+ 20 8 at-xy
+ ." 2. Start FreeBSD with /boot/current.conf."
+ 20 9 at-xy
+ ." 3. Start FreeBSD with standard configuration. "
+ 20 10 at-xy
+ ." 4. Reboot."
+ me
+;
+
+: tkey ( d -- flag | char )
+ seconds +
+ begin 1 while
+ dup seconds u< if
+ drop
+ -1
+ exit
+ then
+ key? if
+ drop
+ key
+ exit
+ then
+ repeat
+;
+
+: prompt
+ 14 fg
+ 20 12 at-xy
+ ." Enter your option (1,2,3,4): "
+ 10 tkey
+ dup 32 = if
+ drop key
+ then
+ dup 0< if
+ drop 51
+ then
+ dup emit
+ me
+;
+
+: help_text
+ 10 18 at-xy ." * Choose 1 or 2 to run special configuration file."
+ 10 19 at-xy ." * Choose 3 to proceed with standard bootstrapping."
+ 12 20 at-xy ." See '?' for available commands, and 'words' for"
+ 12 21 at-xy ." complete list of Forth words."
+ 10 22 at-xy ." * Choose 4 in order to warm boot your machine."
+;
+
+: (reboot) 0 reboot ;
+
+: main_menu
+ begin 1 while
+ clear
+ f_double
+ 79 23 1 1 box
+ title
+ menu
+ help_text
+ prompt
+ cr cr cr
+ dup 49 = if
+ drop
+ 1 25 at-xy cr
+ ." Loading /boot/stable.conf. Please wait..." cr
+ s" /boot/stable.conf" read-conf
+ 0 boot-conf exit
+ then
+ dup 50 = if
+ drop
+ 1 25 at-xy cr
+ ." Loading /boot/current.conf. Please wait..." cr
+ s" /boot/current.conf" read-conf
+ 0 boot-conf exit
+ then
+ dup 51 = if
+ drop
+ 1 25 at-xy cr
+ ." Proceeding with standard boot. Please wait..." cr
+ 0 boot-conf exit
+ then
+ dup 52 = if
+ drop
+ 1 25 at-xy cr
+ ['] (reboot) catch abort" Error rebooting"
+ then
+ 20 12 at-xy
+ ." Key " emit ." is not a valid option!"
+ 20 13 at-xy
+ ." Press any key to continue..."
+ key drop
+ repeat
+;
+
diff --git a/share/examples/bootforth/screen.4th b/share/examples/bootforth/screen.4th
new file mode 100644
index 000000000000..3ea79e453d80
--- /dev/null
+++ b/share/examples/bootforth/screen.4th
@@ -0,0 +1,36 @@
+\ Screen manipulation related words.
+\ $FreeBSD$
+
+marker task-screen.4th
+
+: escc ( -- ) \ emit Esc-[
+ 91 27 emit emit
+;
+
+: ho ( -- ) \ Home cursor
+ escc 72 emit \ Esc-[H
+;
+
+: cld ( -- ) \ Clear from current position to end of display
+ escc 74 emit \ Esc-[J
+;
+
+: clear ( -- ) \ clear screen
+ ho cld
+;
+
+: at-xy ( x y -- ) \ move cursor to x rows, y cols (1-based coords)
+ escc .# 59 emit .# 72 emit \ Esc-[%d;%dH
+;
+
+: fg ( x -- ) \ Set foreground color
+ escc 3 .# .# 109 emit \ Esc-[3%dm
+;
+
+: bg ( x -- ) \ Set background color
+ escc 4 .# .# 109 emit \ Esc-[4%dm
+;
+
+: me ( -- ) \ Mode end (clear attributes)
+ escc 109 emit
+;
diff --git a/share/examples/cvsup/README b/share/examples/cvsup/README
new file mode 100644
index 000000000000..2d1f12b06e3a
--- /dev/null
+++ b/share/examples/cvsup/README
@@ -0,0 +1,37 @@
+# $FreeBSD$
+
+This directory contains sample "supfiles" for obtaining and updating
+the FreeBSD sources via the Internet. These supfiles will work
+with CVSup version 14.0 or later. For general information on CVSup
+itself, please see http://www.freebsd.org/handbook/cvsup.html
+
+To maintain the sources for the FreeBSD-current release, use:
+
+ standard-supfile Main source tree
+
+ ports-supfile Ports collection
+
+To maintain the sources for the FreeBSD-stable release, use:
+
+ stable-supfile Main source tree
+
+To maintain a copy of the CVS repository containing all versions of
+FreeBSD, use:
+
+ cvs-supfile Main source tree and ports collection
+
+To maintain a copy of the FreeBSD bug database, use the file:
+
+ gnats-supfile FreeBSD bug database
+
+IMPORTANT: Before you use any of the supfiles in this directory,
+you will need to edit in an appropriate "host" setting. See:
+
+ http://www.freebsd.org/handbook/mirrors.html
+
+for an up-to-date list of public CVSup mirror sites.
+
+To prevent CVSup from updating particular directories and files, use
+this file:
+
+ refuse
diff --git a/share/examples/cvsup/cvs-supfile b/share/examples/cvsup/cvs-supfile
new file mode 100644
index 000000000000..dd309ce79a6c
--- /dev/null
+++ b/share/examples/cvsup/cvs-supfile
@@ -0,0 +1,163 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# CVS development tree of the FreeBSD system.
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup cvs-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 cvs-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/home/ncvs
+# This specifies where to place the requested files. A
+# setting of "/home/ncvs" will place all of the files
+# requested in /home/ncvs (e.g., "/home/ncvs/src/bin",
+# "/home/ncvs/ports/archivers"). The prefix directory
+# must exist in order to run CVSup.
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/home/ncvs
+*default release=cvs
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+## Main Source Tree.
+#
+# The easiest way to get the main source tree is to use the "src-all"
+# mega-collection. It includes all of the individual "src-*" collections,
+# except the export-restricted collections.
+src-all
+
+# These are the individual collections that make up "src-all". If you
+# use these, be sure to comment out "src-all" above.
+#src-base
+#src-bin
+#src-contrib
+#src-etc
+#src-games
+#src-gnu
+#src-include
+#src-kerberos5
+#src-kerberosIV
+#src-lib
+#src-libexec
+#src-release
+#src-sbin
+#src-share
+#src-sys
+#src-tools
+#src-usrbin
+#src-usrsbin
+# These are the individual collections that make up FreeBSD's crypto
+# collection. They are no longer export-restricted and are a part of
+# src-all
+#src-crypto
+#src-eBones
+#src-secure
+#src-sys-crypto
+
+## Ports Collection.
+#
+# The easiest way to get the ports tree is to use the "ports-all"
+# mega-collection. It includes all of the individual "ports-*"
+# collections,
+ports-all
+
+# These are the individual collections that make up "ports-all". If you
+# use these, be sure to comment out "ports-all" above.
+#ports-archivers
+#ports-astro
+#ports-audio
+#ports-base
+#ports-benchmarks
+#ports-biology
+#ports-cad
+#ports-chinese
+#ports-comms
+#ports-converters
+#ports-databases
+#ports-deskutils
+#ports-devel
+#ports-editors
+#ports-emulators
+#ports-french
+#ports-ftp
+#ports-games
+#ports-german
+#ports-graphics
+#ports-hebrew
+#ports-irc
+#ports-japanese
+#ports-java
+#ports-korean
+#ports-lang
+#ports-mail
+#ports-math
+#ports-mbone
+#ports-misc
+#ports-net
+#ports-news
+#ports-palm
+#ports-picobsd
+#ports-print
+#ports-russian
+#ports-science
+#ports-security
+#ports-shells
+#ports-sysutils
+#ports-textproc
+#ports-ukrainian
+#ports-vietnamese
+#ports-www
+#ports-x11
+#ports-x11-clocks
+#ports-x11-fm
+#ports-x11-fonts
+#ports-x11-servers
+#ports-x11-toolkits
+#ports-x11-wm
+
+## Documentation
+#
+# The easiest way to get the doc tree is to use the "doc-all"
+# mega-collection. It includes all of the individual "doc-*"
+# collections,
+doc-all
+
diff --git a/share/examples/cvsup/doc-supfile b/share/examples/cvsup/doc-supfile
new file mode 100644
index 000000000000..d81e0576b65b
--- /dev/null
+++ b/share/examples/cvsup/doc-supfile
@@ -0,0 +1,62 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# source of the FreeBSD doc tree
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup doc-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 doc-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/usr
+# This specifies where to place the requested files. A
+# setting of "/usr" will place all of the files requested
+# in "/usr/doc" (e.g., "/usr/doc/en_US.ISO_8859-1").
+# The prefix directory must exist in order to run CVSup.
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/usr
+*default release=cvs tag=.
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+# This will retrieve the entire doc branch of the FreeBSD repository.
+# This includes the handbook, FAQ, and translations thereof.
+doc-all
diff --git a/share/examples/cvsup/gnats-supfile b/share/examples/cvsup/gnats-supfile
new file mode 100644
index 000000000000..640915fbe3d4
--- /dev/null
+++ b/share/examples/cvsup/gnats-supfile
@@ -0,0 +1,63 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# FreeBSD GNATS bug report database.
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup gnats-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 gnats-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/usr
+# This specifies where to place the requested files. A
+# setting of "/usr" will place all of the files requested
+# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
+# The prefix directory must exist in order to run CVSup.
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/usr
+*default release=current
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+## GNATS database
+#
+gnats
+
diff --git a/share/examples/cvsup/ports-supfile b/share/examples/cvsup/ports-supfile
new file mode 100644
index 000000000000..a91787a60fbb
--- /dev/null
+++ b/share/examples/cvsup/ports-supfile
@@ -0,0 +1,124 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# FreeBSD-current ports collection.
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup ports-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 ports-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/usr
+# This specifies where to place the requested files. A
+# setting of "/usr" will place all of the files requested
+# in "/usr/ports" (e.g., "/usr/ports/devel", "/usr/ports/lang").
+# The prefix directory must exist in order to run CVSup.
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/usr
+*default release=cvs tag=.
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+## Ports Collection.
+#
+# The easiest way to get the ports tree is to use the "ports-all"
+# mega-collection. It includes all of the individual "ports-*"
+# collections,
+ports-all
+
+# These are the individual collections that make up "ports-all". If you
+# use these, be sure to comment out "ports-all" above.
+#
+# Be sure to ALWAYS cvsup the ports-base collection if you use any of the
+# other individual collections below. ports-base is a mandatory collection
+# for the ports collection, and your ports may not build correctly if it
+# is not kept up to date.
+#ports-base
+#ports-archivers
+#ports-astro
+#ports-audio
+#ports-benchmarks
+#ports-biology
+#ports-cad
+#ports-chinese
+#ports-comms
+#ports-converters
+#ports-databases
+#ports-deskutils
+#ports-devel
+#ports-editors
+#ports-emulators
+#ports-french
+#ports-ftp
+#ports-games
+#ports-german
+#ports-graphics
+#ports-hebrew
+#ports-irc
+#ports-japanese
+#ports-java
+#ports-korean
+#ports-lang
+#ports-mail
+#ports-math
+#ports-mbone
+#ports-misc
+#ports-net
+#ports-news
+#ports-palm
+#ports-picobsd
+#ports-print
+#ports-russian
+#ports-science
+#ports-security
+#ports-shells
+#ports-sysutils
+#ports-textproc
+#ports-ukrainian
+#ports-vietnamese
+#ports-www
+#ports-x11
+#ports-x11-clocks
+#ports-x11-fm
+#ports-x11-fonts
+#ports-x11-servers
+#ports-x11-toolkits
+#ports-x11-wm
diff --git a/share/examples/cvsup/refuse b/share/examples/cvsup/refuse
new file mode 100644
index 000000000000..eb4c202f84a5
--- /dev/null
+++ b/share/examples/cvsup/refuse
@@ -0,0 +1,10 @@
+src/etc/sendmail/freebsd.mc*
+ports/chinese
+ports/french
+ports/german
+ports/hebrew
+ports/japanese
+ports/korean
+ports/russian
+ports/ukrainian
+ports/vietnamese
diff --git a/share/examples/cvsup/refuse.README b/share/examples/cvsup/refuse.README
new file mode 100644
index 000000000000..6a04b21f87df
--- /dev/null
+++ b/share/examples/cvsup/refuse.README
@@ -0,0 +1,57 @@
+$FreeBSD$
+
+This describes the "refuse" file found in this directory. The
+explanation cannot be put inside the file itself because:
+
+ COMMENTS ARE NOT ALLOWED IN refuse FILES!
+
+Each line of the refuse file contains one or more filename patterns
+separated by white space. Everything matched by a pattern will be
+left untouched by CVSup. If a pattern matches a directory, then
+everything beneath that directory will be left alone.
+
+You can copy "refuse" to your sup directory and add or remove
+whatever you like. The example supfiles in this directory set
+CVSup's base directory to "/usr". The sup directory is in the base
+directory; i.e., it is "/usr/sup". If you have changed your base
+directory, your sup directory is /path/to/base/sup.
+
+Use the following pattern if you have modified
+/usr/src/etc/sendmail/freebsd.mc to reflect your local configuration,
+and you do not want CVSup to overwrite it:
+
+ src/etc/sendmail/freebsd.mc*
+
+If you are an English speaker and don't wish to receive the
+foreign-language documentation or ports, use the following patterns:
+
+ doc/de
+ doc/de_*
+ doc/es
+ doc/es_*
+ doc/fr
+ doc/fr_*
+ doc/ja
+ doc/ja_*
+ doc/nl
+ doc/nl_*
+ doc/ru
+ doc/ru_*
+ doc/sr
+ doc/sr_*
+ doc/zh
+ doc/zh_*
+ ports/chinese
+ ports/german
+ ports/hebrew
+ ports/japanese
+ ports/korean
+ ports/russian
+ ports/vietnamese
+
+Use refuse files with care. Some parts of the src distribution
+depend on files in completely different parts.
+
+For more information about refuse files see cvsup(1), which is
+installed by the "cvsup" and "cvsup-bin" ports. See also the CVSup
+FAQ at <http://www.polstra.com/projects/freeware/CVSup/>.
diff --git a/share/examples/cvsup/stable-supfile b/share/examples/cvsup/stable-supfile
new file mode 100644
index 000000000000..3c8e92ab9e56
--- /dev/null
+++ b/share/examples/cvsup/stable-supfile
@@ -0,0 +1,110 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# FreeBSD-stable source tree.
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup stable-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 stable-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/usr
+# This specifies where to place the requested files. A
+# setting of "/usr" will place all of the files requested
+# in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib").
+# The prefix directory must exist in order to run CVSup.
+#
+###############################################################################
+#
+# DANGER! WARNING! LOOK OUT! VORSICHT!
+#
+# If you add any of the ports collections to this file, be sure to
+# specify them like this:
+#
+# ports-all tag=.
+#
+# If you leave out the "tag=." portion, CVSup will delete all of
+# the files in your ports tree. That is because the ports collections
+# do not use the same tags as the main part of the FreeBSD source tree.
+#
+###############################################################################
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/usr
+# The following line is for 4-stable. If you want 3-stable or 2.2-stable,
+# change "RELENG_4" to "RELENG_3" or "RELENG_2_2" respectively.
+*default release=cvs tag=RELENG_4
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+## Main Source Tree.
+#
+# The easiest way to get the main source tree is to use the "src-all"
+# mega-collection. It includes all of the individual "src-*" collections.
+# Please note: If you want to track -STABLE, leave this uncommented.
+src-all
+
+# These are the individual collections that make up "src-all". If you
+# use these, be sure to comment out "src-all" above.
+#src-base
+#src-bin
+#src-contrib
+#src-etc
+#src-games
+#src-gnu
+#src-include
+#src-kerberos5
+#src-kerberosIV
+#src-lib
+#src-libexec
+#src-release
+#src-sbin
+#src-share
+#src-sys
+#src-tools
+#src-usrbin
+#src-usrsbin
+# These are the individual collections that make up FreeBSD's crypto
+# collection. They are no longer export-restricted and are a part of
+# src-all
+#src-crypto
+#src-eBones
+#src-secure
+#src-sys-crypto
diff --git a/share/examples/cvsup/www-supfile b/share/examples/cvsup/www-supfile
new file mode 100644
index 000000000000..8116f5ecfe94
--- /dev/null
+++ b/share/examples/cvsup/www-supfile
@@ -0,0 +1,61 @@
+# $FreeBSD$
+#
+# This file contains all of the "CVSup collections" that make up the
+# source of the FreeBSD www tree
+#
+# CVSup (CVS Update Protocol) allows you to download the latest CVS
+# tree (or any branch of development therefrom) to your system easily
+# and efficiently (far more so than with sup, which CVSup is aimed
+# at replacing). If you're running CVSup interactively, and are
+# currently using an X display server, you should run CVSup as follows
+# to keep your CVS tree up-to-date:
+#
+# cvsup www-supfile
+#
+# If not running X, or invoking cvsup from a non-interactive script, then
+# run it as follows:
+#
+# cvsup -g -L 2 www-supfile
+#
+# You may wish to change some of the settings in this file to better
+# suit your system:
+#
+# host=CHANGE_THIS.FreeBSD.org
+# This specifies the server host which will supply the
+# file updates. You must change it to one of the CVSup
+# mirror sites listed in the FreeBSD Handbook at
+# http://www.freebsd.org/handbook/mirrors.html.
+# You can override this setting on the command line
+# with cvsup's "-h host" option.
+#
+# base=/usr
+# This specifies the root where CVSup will store information
+# about the collections you have transferred to your system.
+# A setting of "/usr" will generate this information in
+# /usr/sup. Even if you are CVSupping a large number of
+# collections, you will be hard pressed to generate more than
+# ~1MB of data in this directory. You can override the
+# "base" setting on the command line with cvsup's "-b base"
+# option. This directory must exist in order to run CVSup.
+#
+# prefix=/usr
+# This specifies where to place the requested files. A
+# setting of "/usr" will place all of the files requested
+# in "/usr/www" (e.g., "/usr/www/en", "/usr/www/ja").
+# The prefix directory must exist in order to run CVSup.
+
+# Defaults that apply to all the collections
+#
+# IMPORTANT: Change the next line to use one of the CVSup mirror sites
+# listed at http://www.freebsd.org/handbook/mirrors.html.
+*default host=CHANGE_THIS.FreeBSD.org
+*default base=/usr
+*default prefix=/usr
+*default release=cvs tag=.
+*default delete use-rel-suffix
+
+# If your network link is a T1 or faster, comment out the following line.
+*default compress
+
+# This collection retrieves the www/ tree of the FreeBSD repository
+www
diff --git a/share/examples/diskless/209.157.86.12/README b/share/examples/diskless/209.157.86.12/README
new file mode 100644
index 000000000000..0b52492979f2
--- /dev/null
+++ b/share/examples/diskless/209.157.86.12/README
@@ -0,0 +1,27 @@
+
+ kernel, rc.local, and xdm-config are typically softlinks. Plus other
+ files, of course, depending on how you setup your system.
+
+ rc.local and xdm-config might be softlinks into HT.DISKLESS, allowing
+ you to ease system administration when managing many diskless
+ workstations. You can also play other tricks, such as I play in
+ rc.conf.local by having it source ../HT.DISKLESS/rc.conf.local to get
+ class-based defaults.
+
+ Note: the ttys file below contains an example of how to have X startup
+ on boot.
+
+apollo:/conf/209.157.86.12# ls -la
+total 7
+drwxr-xr-x 2 root wheel 512 Feb 9 00:27 .
+drwxr-xr-x 8 root wheel 512 Feb 8 22:48 ..
+lrwxr-xr-x 1 root wheel 20 Feb 8 22:04 fstab -> ../HT.DISKLESS/fstab
+lrwxr-xr-x 1 root wheel 17 Jan 24 23:33 kernel -> /kernel.diskless2
+-rw-r--r-- 1 root wheel 133 Feb 8 22:04 rc.conf.local
+lrwxr-xr-x 1 root wheel 23 Jan 25 00:41 rc.local -> ../HT.DISKLESS/rc.local
+-rw------- 1 root wheel 539 Jan 17 15:29 ssh_host_key
+-rw-r--r-- 1 root wheel 343 Jan 17 15:29 ssh_host_key.pub
+lrwxr-xr-x 1 root wheel 26 Feb 9 00:27 syslog.conf -> ../HT.DISKLESS/syslog.conf
+-rw-r--r-- 1 root wheel 1408 Feb 8 19:54 ttys
+lrwxr-xr-x 1 root wheel 25 Jan 25 00:38 xdm-config -> ../HT.DISKLESS/xdm-config
+
diff --git a/share/examples/diskless/209.157.86.12/rc.conf.local b/share/examples/diskless/209.157.86.12/rc.conf.local
new file mode 100644
index 000000000000..181c6723708f
--- /dev/null
+++ b/share/examples/diskless/209.157.86.12/rc.conf.local
@@ -0,0 +1,9 @@
+# DISKLESS RC.CONF.LOCAL
+#
+# Override system standard /etc/rc.conf
+
+. /conf/HT.DISKLESS/rc.conf.local
+
+hostname=test2.backplane.com
+start_xdm=NO
+
diff --git a/share/examples/diskless/HT.DISKLESS/fstab b/share/examples/diskless/HT.DISKLESS/fstab
new file mode 100644
index 000000000000..f1ee38f2c2bd
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/fstab
@@ -0,0 +1,5 @@
+# fstab for diskless machine. Root is already mounted, as is swap.
+#
+209.157.86.2:/usr /usr nfs ro 0 0
+209.157.86.2:/var /var nfs ro 0 0
+proc /proc procfs rw 0 0
diff --git a/share/examples/diskless/HT.DISKLESS/rc.conf.local b/share/examples/diskless/HT.DISKLESS/rc.conf.local
new file mode 100644
index 000000000000..16ddd1d7f18e
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/rc.conf.local
@@ -0,0 +1,34 @@
+# DISKLESS RC.CONF.LOCAL
+#
+# Override system standard /etc/rc.conf
+
+ldconfig_paths="$ldconfig_paths /usr/krb5/lib"
+ldconfig_paths_aout="$ldconfig_paths_aout /usr/krb5/lib/aout"
+
+# Must do NFS mounts early
+# Must not attempt to mount root rw
+#
+early_nfs_mounts="YES"
+root_rw_mount="NO"
+
+inetd_enable="NO"
+portmap_enable="NO"
+router_enable="NO"
+cron_enable="NO"
+sendmail_enable="NO"
+
+# Enable additional services
+#
+
+nfs_client_enable="YES"
+lpd_enable="YES"
+ntpdate_enable="YES"
+ntpdate_flags="apollo.backplane.com"
+xntpd_enable="YES"
+
+if [ -f /etc/ipfw.conf ]; then
+ firewall_enable="YES"
+ firewall_type="/etc/ipfw.conf"
+ firewall_quiet="NO"
+fi
+
diff --git a/share/examples/diskless/HT.DISKLESS/rc.local b/share/examples/diskless/HT.DISKLESS/rc.local
new file mode 100755
index 000000000000..f473d4152168
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/rc.local
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+if [ -f /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+# Firewall helper - if we configure the firewall to let through
+# ports > 4000, we need to configure the machines as such.
+#
+
+sysctl -w net.inet.ip.portrange.first=4000
+
+# Setup spool
+#
+
+cat >> /var/spool/lpd/ljet4.ps << EOF
+#!/bin/sh
+#
+
+gs -q -dSAFER -dNOPAUSE -sDEVICE=ljet4 -r600x600 -dBitsPerPixel=1 \
+ -sOutputFile=- -
+EOF
+
+chmod 755 /var/spool/lpd/ljet4.ps
+
+mkdir /var/spool/ljet4
+chown daemon /var/spool/ljet4
+
+# Setup remote source
+#
+
+mount_mfs -s 600000 -T qp120at dummy /src
+mount apollo:/FreeBSD /FreeBSD
+mkdir /src/u3
+mkdir /src/u3/usr.obj
+
+# Copy of ssh_host_key* files to where sshd
+# expects them, assuming you add to /usr/local/etc/sshd_config:
+#
+# HostKey /var/db/ssh_host_key
+#
+# Then restart sshd ( the /usr/local/etc/rc.d script installed by
+# the port probably failed due to the lack of host keys )
+
+if [ -f /conf/ME/ssh_host_key ]; then
+ cp /conf/ME/ssh_host_key* /var/db
+else
+ (cd /var/db; ssh-keygen -f ssh_host_key -P "")
+fi
+chmod 400 /var/db/ssh_host_key
+chmod 644 /var/db/ssh_host_key.pub
+/usr/local/sbin/sshd
+
+# Copy home directory so you can login
+#
+#
+
+mount_mfs -s 65536 -T qp120at dummy /home
+
+if [ -d /home.diskless ]; then
+ cd /home.diskless
+ for i in *; do
+ if [ -f $i/home.tgz ]; then
+ mkdir /home/$i
+ chown $i /home/$i
+ chmod 700 /home/$i
+ (cd /home/$i; tar xzpf /home.diskless/$i/home.tgz)
+ homeok=1
+ fi
+ done
+fi
+
+if [ "${homeok:=0}" = "0" ]; then
+ echo "ERROR, NO /home.diskless DIRECTORY TO COPY TO /HOME"
+ sleep 10
+fi
+
diff --git a/share/examples/diskless/HT.DISKLESS/syslog.conf b/share/examples/diskless/HT.DISKLESS/syslog.conf
new file mode 100644
index 000000000000..a7df1e96deea
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/syslog.conf
@@ -0,0 +1,3 @@
+*.err;kern.debug;auth.notice;mail.crit;lpr.info /dev/console
+*.err;kern.debug;auth.notice;mail.crit root
+*.emerg *
diff --git a/share/examples/diskless/HT.DISKLESS/ttys b/share/examples/diskless/HT.DISKLESS/ttys
new file mode 100644
index 000000000000..2c357d4b3b3b
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/ttys
@@ -0,0 +1,52 @@
+#
+# @(#)ttys 5.1 (Berkeley) 4/17/89
+#
+# name getty type status comments
+#
+# This entry needed for asking password when init goes to single-user mode
+# If you want to be asked for password, change "secure" to "insecure" here
+console none unknown off secure
+#
+ttyv0 "/usr/X11R6/bin/xdm -nodaemon -config /conf/209.157.86.6/xdm-config" cons25 on secure
+# Virtual terminals
+ttyv1 "/usr/libexec/getty Pc" cons25 on secure
+ttyv2 "/usr/libexec/getty Pc" cons25 on secure
+ttyv3 "/usr/libexec/getty Pc" cons25 on secure
+# Serial terminals
+ttyd0 "/usr/libexec/getty std.9600" unknown off secure
+ttyd1 "/usr/libexec/getty std.9600" unknown off secure
+ttyd2 "/usr/libexec/getty std.9600" unknown off secure
+ttyd3 "/usr/libexec/getty std.9600" unknown off secure
+# Pseudo terminals
+ttyp0 none network
+ttyp1 none network
+ttyp2 none network
+ttyp3 none network
+ttyp4 none network
+ttyp5 none network
+ttyp6 none network
+ttyp7 none network
+ttyp8 none network
+ttyp9 none network
+ttypa none network
+ttypb none network
+ttypc none network
+ttypd none network
+ttype none network
+ttypf none network
+ttypg none network
+ttyph none network
+ttypi none network
+ttypj none network
+ttypk none network
+ttypl none network
+ttypm none network
+ttypn none network
+ttypo none network
+ttypp none network
+ttypq none network
+ttypr none network
+ttyps none network
+ttypt none network
+ttypu none network
+ttypv none network
diff --git a/share/examples/diskless/HT.DISKLESS/xdm-config b/share/examples/diskless/HT.DISKLESS/xdm-config
new file mode 100644
index 000000000000..88ad35fbeea7
--- /dev/null
+++ b/share/examples/diskless/HT.DISKLESS/xdm-config
@@ -0,0 +1,15 @@
+! $XConsortium: xdm-conf.cpp,v 1.2 93/09/28 14:30:32 gildea Exp $
+DisplayManager.errorLogFile: /var/run/xdm-errors
+DisplayManager.pidFile: /var/run/xdm-pid
+DisplayManager.servers: /usr/X11R6/lib/X11/xdm/Xservers-1
+DisplayManager.keyFile: /usr/X11R6/lib/X11/xdm/xdm-keys
+DisplayManager.servers: /usr/X11R6/lib/X11/xdm/Xservers
+DisplayManager.accessFile: /usr/X11R6/lib/X11/xdm/Xaccess
+DisplayManager._0.authorize: true
+DisplayManager._0.setup: /usr/X11R6/lib/X11/xdm/Xsetup_0
+DisplayManager._0.startup: /usr/X11R6/lib/X11/xdm/GiveConsole
+DisplayManager._0.reset: /usr/X11R6/lib/X11/xdm/TakeConsole
+DisplayManager*resources: /usr/X11R6/lib/X11/xdm/Xresources
+DisplayManager*session: /usr/X11R6/lib/X11/xdm/Xsession
+DisplayManager*authComplain: false
+
diff --git a/share/examples/diskless/HT.STD/aliases b/share/examples/diskless/HT.STD/aliases
new file mode 100644
index 000000000000..5988f793f814
--- /dev/null
+++ b/share/examples/diskless/HT.STD/aliases
@@ -0,0 +1,30 @@
+#
+# @(#)aliases 5.3 (Berkeley) 5/24/90
+#
+# Aliases in this file will NOT be expanded in the header from
+# Mail, but WILL be visible over networks or from /bin/mail.
+#
+# >>>>>>>>>> The program "newaliases" must be run after
+# >> NOTE >> this file is updated for any changes to
+# >>>>>>>>>> show through to sendmail.
+#
+
+# Basic system aliases -- these MUST be present
+MAILER-DAEMON: postmaster
+postmaster: root
+
+# General redirections for pseudo accounts
+bin: root
+daemon: root
+games: root
+ingres: root
+nobody: root
+system: root
+toor: root
+uucp: root
+usenet: root
+root: root@backplane.com
+
+diablo: dillon
+diablo-bugs: dillon
+
diff --git a/share/examples/diskless/HT.STD/forward.map b/share/examples/diskless/HT.STD/forward.map
new file mode 100644
index 000000000000..d4253f8734c6
--- /dev/null
+++ b/share/examples/diskless/HT.STD/forward.map
@@ -0,0 +1,6 @@
+# @(#)forward.map 1.1 1/17/95
+#
+# Put addresses to be forwarded here. Example:
+#
+# garyw@mojosoft.com charliex@best.com
+#
diff --git a/share/examples/diskless/HT.STD/ndomain.map b/share/examples/diskless/HT.STD/ndomain.map
new file mode 100644
index 000000000000..63011d08ca91
--- /dev/null
+++ b/share/examples/diskless/HT.STD/ndomain.map
@@ -0,0 +1,11 @@
+#
+# example:
+# fofs.com markl@shellx.best.com
+#
+# NOTE: FORWARD.MAP can be used to override NDOMAIN.MAP for specific
+# users. NDOMAIN.MAP would then act as a catch-all
+#
+# NOTE: NDOMAIN.MAP only works to two levels. I.E. if you have an
+# entry for fubar.com, then user@fubar.com will work and
+# user@host.fubar.com will work, but NOT user@host.dom.fubar.com
+#
diff --git a/share/examples/diskless/HT.STD/syslog.conf b/share/examples/diskless/HT.STD/syslog.conf
new file mode 100644
index 000000000000..cb92c6e6db07
--- /dev/null
+++ b/share/examples/diskless/HT.STD/syslog.conf
@@ -0,0 +1,11 @@
+*.err;kern.debug;auth.notice;mail.crit /dev/console
+# *.notice;kern.debug;lpr,auth.info;mail.crit /var/log/messages
+*.debug;kern.debug;lpr,auth.info;mail.crit;news.crit /var/log/messages
+mail.info /var/log/maillog
+news.info /var/log/news
+lpr.info /var/log/lpd-errs
+cron.* /var/log/cron
+#*.err root
+#*.notice;auth.debug root
+#*.alert root
+*.emerg *
diff --git a/share/examples/diskless/HT.STD/ttys b/share/examples/diskless/HT.STD/ttys
new file mode 100644
index 000000000000..bcd059bd9091
--- /dev/null
+++ b/share/examples/diskless/HT.STD/ttys
@@ -0,0 +1,52 @@
+#
+# @(#)ttys 5.1 (Berkeley) 4/17/89
+#
+# name getty type status comments
+#
+# This entry needed for asking password when init goes to single-user mode
+# If you want to be asked for password, change "secure" to "insecure" here
+console none unknown off secure
+#
+ttyv0 "/usr/libexec/getty Pc" cons25 on secure
+# Virtual terminals
+ttyv1 "/usr/libexec/getty Pc" cons25 on secure
+ttyv2 "/usr/libexec/getty Pc" cons25 on secure
+ttyv3 "/usr/libexec/getty Pc" cons25 on secure
+# Serial terminals
+ttyd0 "/usr/libexec/getty std.9600" unknown off secure
+ttyd1 "/usr/libexec/getty std.9600" unknown off secure
+ttyd2 "/usr/libexec/getty std.9600" unknown off secure
+ttyd3 "/usr/libexec/getty std.9600" unknown off secure
+# Pseudo terminals
+ttyp0 none network
+ttyp1 none network
+ttyp2 none network
+ttyp3 none network
+ttyp4 none network
+ttyp5 none network
+ttyp6 none network
+ttyp7 none network
+ttyp8 none network
+ttyp9 none network
+ttypa none network
+ttypb none network
+ttypc none network
+ttypd none network
+ttype none network
+ttypf none network
+ttypg none network
+ttyph none network
+ttypi none network
+ttypj none network
+ttypk none network
+ttypl none network
+ttypm none network
+ttypn none network
+ttypo none network
+ttypp none network
+ttypq none network
+ttypr none network
+ttyps none network
+ttypt none network
+ttypu none network
+ttypv none network
diff --git a/share/examples/diskless/ME b/share/examples/diskless/ME
new file mode 100644
index 000000000000..85178e088a54
--- /dev/null
+++ b/share/examples/diskless/ME
@@ -0,0 +1,37 @@
+
+When templating, /conf/ME is typically a softlink to
+/conf/<appropriate-machine>. When doing a diskless boot, /conf/ME is
+retargeted by /etc/rc.diskless1 from pointing to the server to pointing
+to the client's directory, /conf/<ip-address-of-client>. The retargeting
+is accomplished through an MFS -o union mount.
+
+When templating, this softlink should be different for each machine.
+When doing a diskless boot, this softlink is typically part of the / NFS
+mount from the server and points to the server's conf directory, but gets
+retargeted during the /etc/rc.diskless1 phase.
+
+System-wide configuration files must generally be targeted through /conf/ME.
+For example, your /etc/rc.conf.local should become a softlink to
+/conf/ME/rc.conf.local and your real rc.conf.local should go into the
+appropriate /conf/<appropriate-machine> directory. This is also true of
+/etc/rc.local, /etc/fstab, /etc/syslog.conf, /etc/ccd.conf, /etc/ipfw.conf,
+/etc/motd, /etc/resolv.conf, and possibly even /etc/ttys ( if you want
+to start an X session up on boot on certain of your machines ).
+
+When templating, you duplicate your / and /usr partitions on each machine's
+local disk from a single master ( assuming /var and /home reside elsewhere ),
+EXCEPT for the /conf/ME softlink. The /conf/ME softlink is the only thing
+on / that should be different for each machine.
+
+There are often categories of configuration files. For example, all of your
+shell machines may use one resolv.conf while all of your mail proxies may
+use another. Configuration files can be categorized fairly easily through
+/conf/HT.<category> directories. You put the actual configuration file in
+/conf/HT.<category> and make a softlink from
+/conf/ME/<appropriate-machines>/config-file to "../HT.<category/config-file".
+This means that access to these files tends to run through more then one
+softlink. The advantage is that for all the complexity of your /conf
+directory hierarchy, most of your common config files exist in only one place
+in reality.
+
+
diff --git a/share/examples/diskless/README.BOOTP b/share/examples/diskless/README.BOOTP
new file mode 100644
index 000000000000..0032e80230e7
--- /dev/null
+++ b/share/examples/diskless/README.BOOTP
@@ -0,0 +1,157 @@
+
+ BOOTP configuration mechanism
+
+ Matthew Dillon
+ dillon@backplane.com
+
+ BOOTP kernels automatically configure the machine's IP address, netmask,
+ optional NFS based swap, and NFS based root mount. The NFS server will
+ typically export a shared read-only /, /usr, and /var to any number of
+ workstations. The shared read-only root is typically either the server's
+ own root or, if you are more security concious, a contrived root.
+
+ The key issue with starting up a BOOTP kernel is that you typically want
+ to export read-only NFS partitions from the server, yet still be able to
+ customize each workstation ( or not ).
+
+ /etc/rc.diskless1 is responsible for doing core mounts and for retargeting
+ /conf/ME ( part of the read-only root NFS mount ) to /conf/$IP_OF_CLIENT.
+ /etc/rc.conf.local and /etc/rc.local, along with other machine-specific
+ configuration files, are typically softlinks to /conf/ME/<filename>.
+
+ In the BOOTP workstation /conf/$IP/rc.conf.local, you must typically
+ turn *OFF* most of the system option defaults in /etc/rc.conf as well
+ as do additional custom configuration of your environment
+
+ The /usr/src/share/examples/diskless directory contains a typical
+ X session / sshd based workstation configuration. The directories
+ involved are HT.DISKLESS/ and 192.157.86.12/.
+
+ Essentially, the $IP/ directory ( which rc.diskless looks for in
+ /conf/$IP/ ) contains all the junk. The HT.DISKLESS directory exists
+ to hold common elements of your custom configuration so you do not have
+ to repeat those elements for each workstation. The example /conf
+ structure included here shows how to create a working sshd setup ( so
+ you can sshd into the diskless workstation ), retarget xdm's pid and error
+ files to R+W directories if /usr is mounted read-only, and retarget
+ syslogd and other programs. This example is not designed to run out of
+ the box and some modifications are required.
+
+ >> NOTE << HT.DISKLESS/ttys contains the typical configuration required
+ to bring X up at boot time. Essentially, it runs xdm in the foreground
+ with the appropriate arguments rather then a getty on ttyv0. You must
+ run xdm on ttyv0 in order to prevent xdm racing with getty on a virtual
+ terminal. Such a race can cause your keyboard to be directed away from
+ the X session, essentially making the session unusable.
+
+ Typically you should start with a clean slate by tar-copying this example
+ directory to /conf and then hack on it in /conf rather then in
+ /usr/share/examples/diskless.
+
+ BOOTP CLIENT SETUP
+
+ Here is a typical kernel configuration. If you have only one ethernet
+ interface you do not need to wire BOOTP to a specific interface name.
+ BOOTP requires NFS and NFS_ROOT, and our boot scripts require MFS. If
+ your /tmp is *not* a softlink to /var/tmp, the scripts also require NULLFS
+
+# BootP
+#
+options BOOTP # Use BOOTP to obtain IP address/hostname
+options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info
+options "BOOTP_NFSV3" # Use NFS v3 to NFS mount rootoptions
+options BOOTP_COMPAT # Workaround for broken bootp daemons.
+#options "BOOTP_WIRED_TO=de0"
+
+options MFS # Memory File System
+options NFS # Network Filesystem
+options NFS_ROOT # Nfs can be root
+options NULLFS # nullfs to map /var/tmp to /tmp
+
+ BOOTP SERVER SETUP
+
+ The BOOTP server must be running on the same logical LAN as the the
+ BOOTP client(s). You need to setup two things:
+
+ (1) You need to NFS-export /, /usr, and /var.
+
+ (2) You need to run a BOOTP server. DHCPD can do this.
+
+
+ NFS Export:
+
+ Here is an example "/etc/exports" file.
+
+/ -ro -maproot=root: -network 192.157.86.0 -mask 255.255.255.192
+/usr -ro -maproot=root: -network 192.157.86.0 -mask 255.255.255.192
+/var -ro -maproot=root: -network 192.157.86.0 -mask 255.255.255.192
+
+ In order to be an NFS server, the server must run portmap, mountd,
+ nfsd, and rpc.statd. The standard NFS server options in /etc/rc.conf
+ will work ( you should put your overrides in /etc/rc.conf.local on the
+ server and not edit the distribution /etc/rc.conf, though ).
+
+ BOOTP Server:
+
+ This configuration file "/etc/dhcpd.conf" example is for
+ the '/usr/ports/net/isc-dhcp' dhcpd port.
+
+ subnet 192.157.86.0 netmask 255.255.255.192 {
+ # range if you want to run the core dhcpd service of
+ # dynamic IP assignment, but it is not used with BOOTP
+ # workstations
+ range 192.157.86.32 192.157.86.62;
+
+ # misc configuration.
+ #
+ option routers 192.157.86.2;
+ option domain-name-servers 192.157.86.2;
+
+ server-name "apollo.fubar.com";
+ option subnet-mask 255.255.255.192;
+ option domain-name-servers 192.157.86.2;
+ option domain-name "fubar.com";
+ option broadcast-address 192.157.86.63;
+ option routers 192.157.86.2;
+ }
+
+ host test1 {
+ hardware ethernet 00:a0:c9:d3:38:25;
+ fixed-address 192.157.86.11;
+ option root-path "192.157.86.2:/";
+ option option-128 "192.157.86.2:/images/swap";
+ }
+
+ host test2 {
+ # hardware ethernet 00:e0:29:1d:16:09;
+ hardware ethernet 00:10:5a:a8:94:0e;
+ fixed-address 192.157.86.12;
+ option root-path "192.157.86.2:/";
+ option option-128 "192.157.86.2:/images/swap";
+ }
+
+ SWAP. This example includes options to automatically BOOTP configure
+ NFS swap on each workstation. In order to use this capabilities you
+ need to NFS-export a swap directory READ+WRITE to the workstations.
+
+ You must then create a swap directory for each workstation you wish to
+ assign swap to. In this example I created a dummy user 'lander' and
+ did an NFS export of /images/swap enforcing a UID of 'lander' for
+ all accesses.
+
+ apollo:/usr/ports/net# ls -la /images/swap
+ total 491786
+ drwxr-xr-x 2 root wheel 512 Dec 28 07:00 .
+ drwxr-xr-x 8 root wheel 512 Jan 20 10:54 ..
+ -rw-r--r-- 1 lander wheel 33554432 Dec 23 14:35 swap.192.157.86.11
+ -rw-r--r-- 1 lander wheel 335544320 Jan 24 16:55 swap.192.157.86.12
+ -rw-r--r-- 1 lander wheel 134217728 Jan 21 17:19 swap.192.157.86.6
+
+ A swap file is best created with dd:
+
+ # create a 32MB swap file for a BOOTP workstation
+ dd if=/dev/zero of=swap.IPADDRESS bs=1m count=32
+
+ It is generally a good idea to give your workstations some swap space,
+ but not a requirement if they have a lot of memory.
+
diff --git a/share/examples/diskless/README.TEMPLATING b/share/examples/diskless/README.TEMPLATING
new file mode 100644
index 000000000000..babf670c1eee
--- /dev/null
+++ b/share/examples/diskless/README.TEMPLATING
@@ -0,0 +1,286 @@
+
+ TEMPLATING machine configurations
+
+ Matthew Dillon
+ dillon@backplane.com
+
+ This document describes a general mechanism by which you can template
+ / and /usr. That is, to keep a 'master template' of / and /usr on a
+ separate machine which is then used to update the rest of your machines.
+
+ Generally speaking, you can't simply mirror /. You might be able to
+ get away with mirroring /usr. There are two main problems involved with
+ templating:
+
+ (1) Avoiding overwriting run-time generated files
+
+ By default, the system maintains a number of files in the root
+ partition. For example, sendmail will dbm /etc/aliases into
+ /etc/aliases.db. vipw or chpass or other password related routines
+ will regenerate the password dbm's /etc/spwd.db, /etc/pwd.db, and
+ passwd. /etc/namedb/s might contain generated secondaries. And
+ so forth.
+
+ The templating mechanism must avoid copying over such files.
+
+ (2) Customizing machines.
+
+ Customizing machines is actually considerably simpler. You create
+ a configuration hierarchy and convert the configuration files that
+ have to be customized into softlinks that run through a special
+ softlink in the configuration directory. This will work for every
+ configuration file except possibly /etc/master.passwd
+
+ For example, /etc/resolv.conf would be turned into a softlink to
+ /conf/ME/resolv.conf, and /conf/ME itself would be a softlink to
+ /conf/<HOSTNAME>. The actual resolv.conf configuration file
+ would reside in /conf/<HOSTNAME>.
+
+ If you have a lot of hosts, some configuration files may be commonly
+ classified. For example, all your shell machines might have the
+ same /etc/resolv.conf. The solution is to make
+ /conf/<HOSTNAME>/resolv.conf a softlink to a common directory, say
+ /conf/HT.SHELL/resolv.conf. It may sound a little messy, but this
+ sort of categorization actually makes the sysadmins job much, much
+ easier.
+
+ The /conf/ directory hierarchy is stored on the template and
+ distributed to all the machines along with the rest of the root
+ partition.
+
+ This type of customization is taken from my direct experience
+ instituting such a system at BEST. At the time, BEST had over 45
+ machines managed from a single template.
+
+ RUN-TIME GENERATED OR MODIFIED FILES IN / or /USR
+
+ /etc/aliases.db
+ /etc/master.passwd
+ /etc/spwd.db
+ /etc/pwd.db
+ /etc/passwd
+ /etc/namedb/s
+ /root/.history
+ /root/.ssh/identity
+ /root/.ssh/identity.pub
+ /root/.ssh/random_seed
+ /root/.ssh/known_hosts
+ /conf/ME
+ /kernel* ( note 2 )
+ /dev ( note 3 )
+ /var ( note 4 )
+ /home ( note 4 )
+ /lost+found
+
+ /usr/lost+found
+ /usr/home ( note 4 )
+ /usr/crash ( note 5 )
+ /usr/obj ( note 5 )
+ /usr/ports ( note 5 )
+ /usr/src ( note 5 )
+ /usr/local/crack ( note 5 )
+ /usr/X11R6/lib/X11/xdm/xdm-errors ( note 6 )
+ /usr/X11R6/lib/X11/xdm/xdm-pid ( note 6 )
+ /usr/local/etc/ssh_host_key ( note 6 )
+ /usr/local/etc/ssh_host_key.pub ( note 6 )
+ /usr/local/etc/ssh_random_seed ( note 6 )
+
+ /conf/ME ( note 7 )
+
+ note 2: You typically want to update kernels manually and *NOT*
+ template them as a safety measure. This also allows you to run
+ different kernels on different machines or.
+
+ note 3: /dev must be updated manually. Some devices, such as tty's and
+ pty's, use the access and/or modify time and/or user/group
+ operationally and regenerating the devices on the fly would be
+ bad.
+
+ note 4: /var and /home are usually separately mounted partitions and
+ thus would not fall under the template, but as a safety measure
+ the template copier refuse to copy directories named 'home'.
+
+ note 5: These are directories that are as often created directly on
+ /usr as they are separately-mounted partitions. You typically
+ do not want to template such directories.
+
+ note 6: Note that you can solve the problem of xdm and sshd creating
+ files in /usr. With xdm, edit /usr/X11R6/lib/xdm/xdm-config
+ and change the errorLogFile and pidFile config lines.
+
+ With sshd, add 'HostKey' and 'RandomSeed' directives to specify
+ /var/db for the location of the host key and run-time sshd
+ random seed:
+
+ HostKey /var/db/ssh_host_key
+ RandomSeed /var/db/ssh_random_seed
+
+ note 7: In this example, /conf/ME is the machine customizer and must
+ be pointed to the /conf/<full-host-name>/ directory, which is
+ different for each machine. Thus, the /conf/ME softlink
+ should never be overwritten by the templating copy.
+
+
+ TYPICAL CUSTOMIZED CONFIGRATION SOFTLINKS
+
+ The following files typically need to be turned into softlinks
+ to /conf/ME/<filename>:
+
+ /etc/ccd.conf -> /conf/ME/ccd.conf
+ /etc/ipfw.conf ...
+ /etc/fstab
+ /etc/motd
+ /etc/resolv.conf
+ /etc/aliases
+ /etc/sendmail.cw
+ /etc/organization
+ /etc/named.conf
+ /etc/rc.conf.local
+ /etc/printcap
+ /etc/inetd.conf
+ /etc/login.conf
+ /etc/gettytab
+ /etc/ntp.conf
+ /etc/exports
+ /root/.k5login -> /conf/ME/root/.k5login
+
+ And, of course, /conf/ME is usually a softlink to the appropriate
+ /conf/<full-host-name>/. Depending on your system configuration,
+ there may be other files not listed above that you have to worry about.
+
+ In many cases, /conf/ME/filename is itself a softlink to
+ "../HT.xxxx/filename", where HT.xxxx is something like HT.STD ... this
+ added complexity actually makes it easier to manage multiple
+ classifications of machines.
+
+ DELETION OF FILES
+
+ Any file found on the template destination that does not exist in the
+ source and is not listed as an exception by the source should be deleted.
+ However, deletion can be dangerous and cpdup will ask for confirmation
+ by default. Once you know you aren't going to blow things up, you can
+ turn this feature off and update your systems automatically from cron.
+
+ By formalizing the delete operation, you can be 100% sure that it is
+ possible to recreate / and /usr on any machine with only the original
+ template and a backup of the ( relatively few ) explicitly-excepted
+ files. The most common mistake a sysop makes is to make a change to a
+ file in / or /usr on a target machine instead of the template machine.
+ If the target machine is updated once a night from cron, the sysop
+ quickly learns not to do this ( because his changes get overwritten
+ overnight ). With a manual update, these sorts of mistakes can propogate
+ for weeks or months before they are caught.
+
+ TEMPLATE COPYING AND SAFETY
+ THE CPDUP PROGRAM
+
+ The 'cpdup' program is a program which efficiently duplicates a directory
+ tree. The program copies source to destination, duplicating devices,
+ softlinks, hardlinks, files, modification times, uid, gid, flags, perms,
+ and so forth. The program incorporates several major features:
+
+ * The program refuses, absolutely, to cross partition boundries.
+ i.e. if you were copying the template /usr from an NFS mount to
+ your /usr, and you had a mount point called /usr/home, the
+ template copying program would *NOT* descend into /usr/home on
+ the destination.
+
+ This is a safety.
+
+ * The program accesses a file called .cpignore in each directory
+ it descending into on the source to obtain a list of exceptions
+ for that directory -- that is, files not to copy or mess with.
+
+ This is a templating function.
+
+ * The program refuses to delete a directory on the destination
+ being replaced by a softlink or file on the source.
+
+ This is a safety mechanism
+
+ * The program is capable of maintaing MD5 check cache files and
+ doing an MD5 check between source and destination during the
+ scan.
+
+ * The program is capable of deleting files/directories on the
+ destination that do not exist on the source, but asks for
+ confirmation by default.
+
+ This is a templating and a safety mechanism.
+
+ * The program uses a copy-to-tmp-and-rename methodology allowing
+ it to be used to update live filesystems.
+
+ This is a templating mechanism.
+
+ * The program, by default, tries to determine if a copy is required
+ by checking modify times, file size, perms, and other stat
+ elements. If the elements match, it does not bother to copy
+ ( unless an MD5 check is being made, in which case it must read
+ the destination file ).
+
+ You typically run cpdup on the target machine. The target machine
+ temporarily mounts the template machine's / and /usr via NFS, read-only,
+ and runs cpdup to update / and /usr. If you use this methodology note
+ that THERE ARE SECURITY CONSIDERATIONS! See 'SECURITY CONSIDERATIONS WITH
+ NFS' below.
+
+ Whatever script you use that does the NFS mounts should ensure that the
+ mount succeeded before continuing with the cpdup.
+
+ You should create .cpignore files in the appropriate directories on the
+ template machine's / and /usr partitions so as not to overwrite active
+ files on the target. The most critical .cpignore files should be
+ protected with 'chflags schg .cpignore'. Specifically, the ones in /
+ and /etc, but possibly others as well. For example, the .cpignore
+ hierarchy for protect /root is:
+
+ # /root/.cpignore contains
+ .history
+
+ # /root/.ssh/.cpignore contains
+ random_seed
+ known_hosts
+ authorized_keys
+ identity
+ identity.pub
+
+ WHEN INITIALLY CONVERTING A TARGET MACHINE TO USE TEMPLATING, ALWAYS
+ MAKE A FULL BACKUP OF THE TARGET MACHINE FIRST! You may accidently delete
+ files on the target during the conversion due to forgetting to enter
+ items into appropriate .cpignore files on the source.
+
+ SECURITY CONSIDERATIONS WITH NFS ROOT EXPORT FROM TEMPLATE MACHINE
+ SECURITY CONSIDERATIONS WITH NFS USR EXPORT FROM TEMPLATE MACHINE
+
+ There are some serious security considerations that must be taken into
+ account when exporting / and /usr on the template machine.
+
+ * only export read-only
+
+ * the password file ( aka vipw ) may not contain any crypted passwords
+ at all. You MUST use ssh or kerberos to access the template machine.
+
+ You can get away with giving only root a crypted password, but only
+ if you disallow network root logins and only allow direct root
+ logins on the console.
+
+ * The machine's private ssh_host_key usually resides in /usr/local/etc.
+ You must move this key to /var/db. You can softlink link so no
+ modification of sshd_config is required.
+
+ * The machine's private ~root/.ssh/identity file is also exposed by
+ the NFS export, you should move this file to /var/db as well and
+ put a softlink in ~root/.ssh.
+
+ * DON'T EXPORT /var ! Either that, or don't put the private keys
+ in /var/db ... put them somewhere else.
+
+ * You may want to redirect the location of the random_seed file, which
+ can be done by editing ~root/.ssh/sshd_config and
+ /usr/local/etc/sshd_config so it is not exposed either.
+
+ -Matt
+ Matthew Dillon
+ dillon@backplane.com
+
diff --git a/share/examples/diskless/archive.backplane.com/README b/share/examples/diskless/archive.backplane.com/README
new file mode 100644
index 000000000000..4b111e3bb739
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/README
@@ -0,0 +1,21 @@
+
+ aliases, forward.map, and ndomain.map are typically softlinks to some
+ other common directory such as HT.STD. Also syslog.conf and ttys.
+
+ You can create machine classifications, which I call 'HT.XXX' directories,
+ to hold common files for a particular functional machine class.
+
+total 8
+drwxr-xr-x 3 root wheel 512 Jan 26 10:56 .
+drwxr-xr-x 7 root wheel 512 Jan 26 10:58 ..
+drwxr-xr-x 2 root wheel 512 Jan 26 10:56 CVS
+lrwxr-xr-x 1 root wheel 17 Jan 25 10:27 aliases -> ../HT.STD/aliases
+lrwxr-xr-x 1 root wheel 21 Jan 25 10:27 forward.map -> ../HT.STD/forward.map
+-rw-r--r-- 1 root wheel 263 Jan 24 18:27 fstab
+-rw-r--r-- 1 root wheel 750 Jan 24 18:29 ipfw.conf
+-rw-r--r-- 1 root wheel 100 Jan 24 18:35 motd
+lrwxr-xr-x 1 root wheel 21 Jan 25 10:27 ndomain.map -> ../HT.STD/ndomain.map
+-rw------- 1 root wheel 464 Jan 25 13:53 rc.conf.local
+-rw-r--r-- 1 root wheel 283 Jan 24 18:33 resolv.conf
+lrwxr-xr-x 1 root wheel 21 Feb 9 01:09 syslog.conf -> ../HT.STD/syslog.conf
+lrwxr-xr-x 1 root wheel 14 Feb 9 01:08 ttys -> ../HT.STD/ttys
diff --git a/share/examples/diskless/archive.backplane.com/fstab b/share/examples/diskless/archive.backplane.com/fstab
new file mode 100644
index 000000000000..12a97eacab91
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/fstab
@@ -0,0 +1,8 @@
+# Device Mountpoint FStype Options Dump Pass#
+/dev/sd0a / ufs rw 1 1
+/dev/sd0b none swap sw 0 0
+/dev/sd0d /var ufs rw 1 1
+/dev/sd0e /usr ufs rw 1 1
+/dev/wd0d /cvs ufs rw 2 2
+209.157.86.2:/FreeBSD /FreeBSD nfs ro 0 3
+proc /proc procfs rw 0 0
diff --git a/share/examples/diskless/archive.backplane.com/ipfw.conf b/share/examples/diskless/archive.backplane.com/ipfw.conf
new file mode 100644
index 000000000000..9d7b30e977db
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/ipfw.conf
@@ -0,0 +1,31 @@
+# /etc/ipfw.conf
+#
+# allow local nets, dialup specials
+#
+add 00010 allow all from 127.0.0.1 to 127.0.0.1 via lo0
+add 00020 allow ip from 209.157.86.0/26 to 209.157.86.0/26
+#add 00030 allow ip from any to any via sl0
+
+# Allow all outgoing
+#
+add 00040 allow all from 209.157.86.0/26 to any
+
+# incoming TCP
+#
+add 01000 allow tcp from any to any established
+add 01010 allow tcp from any to any ssh,smtp,domain,finger,ntalk,http,auth,kerberos
+add 01020 reset log tcp from any to any
+
+# incoming UDP
+#
+add 02000 allow udp from any to any 4000-65535,domain,ntp,kerberos,ntalk
+add 02010 unreach filter-prohib log udp from any to any
+
+# incoming ICMP
+#
+add 03000 allow icmp from any to any
+
+# Deny the rest and log
+#
+add 65534 deny log all from any to any
+
diff --git a/share/examples/diskless/archive.backplane.com/motd b/share/examples/diskless/archive.backplane.com/motd
new file mode 100644
index 000000000000..9b3b873d638e
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/motd
@@ -0,0 +1,4 @@
+FreeBSD 3.0-CURRENT (ARCHIVE) #54: Sat Jan 2 12:18:57 PST 1999
+
+Welcome to archive.backplane.com!
+
diff --git a/share/examples/diskless/archive.backplane.com/rc.conf.local b/share/examples/diskless/archive.backplane.com/rc.conf.local
new file mode 100644
index 000000000000..731931b426ed
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/rc.conf.local
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+
+network_interfaces="lo0 ed1"
+ifconfig_ed1="inet 192.157.86.7 netmask 255.255.255.192"
+
+# use external resolver
+#
+named_enable="NO"
+portmap_enable="NO"
+
+##############################################################
+### Miscellaneous administrative options ###################
+##############################################################
+
+sendmail_enable="YES"
+sendmail_flags="-q5m"
+dumpdev="/dev/sd0b" # Device name to crashdump to (if enabled).
+
diff --git a/share/examples/diskless/archive.backplane.com/resolv.conf b/share/examples/diskless/archive.backplane.com/resolv.conf
new file mode 100644
index 000000000000..f714ed548bd1
--- /dev/null
+++ b/share/examples/diskless/archive.backplane.com/resolv.conf
@@ -0,0 +1,9 @@
+search backplane.com best.com best.net
+#search best.com. best.net. backplane.com.
+# workstations use this file too, and do not run named themselves
+#
+# so lander can use this file too
+nameserver 209.157.86.2
+#nameserver 127.0.0.1
+#nameserver 204.156.128.1
+#nameserver 204.156.128.20
diff --git a/share/examples/diskless/clone_root b/share/examples/diskless/clone_root
new file mode 100755
index 000000000000..100128beb760
--- /dev/null
+++ b/share/examples/diskless/clone_root
@@ -0,0 +1,144 @@
+#!/bin/sh
+#
+# (C) 2001 Luigi Rizzo, Gabriele Cecchetti
+# <Standard BSD copyright>
+# Revised 2001.04.16
+#
+# $FreeBSD$
+#
+# clone root filesystem for diskless root stuff
+#
+# usage
+# clone_root all to do a full copy (e.g. bin, sbin...)
+# clone_root update to recreate /var (including devices)
+# clone_root to copy /conf and password-related files
+#
+# This script assumes that you use a shared readonly root and /usr
+# partition. The script creates a partial clone of the root partition,
+# and puts it into ${DEST} (defaults to /diskless_root ) on the server,
+# where it is read.
+#
+# To run a diskless install you need to do the following:
+#
+# create /conf/default/etc/fstab
+# this will replace the standard /etc/fstab and should contain
+# as a minimum the following lines
+# ${SERVER}:${DEST} / nfs ro 0 0
+# ${SERVER}:/usr /usr nfs ro 0 0
+# proc /proc procfs rw 0 0
+#
+# create /conf/default/etc/rc.conf
+# this will replace the standard rc.conf and should contain
+# the startup options for the diskless client. Most likely
+# you will not need to set hostname and ifconfig_* because these
+# will be already set by the startup code. You will also
+# probably need to set local_startup="" so that the server's
+# local startup files will not be used.
+#
+# create a kernel config file in /sys/i386/conf/DISKLESS with
+# options MFS
+# options BOOTP
+# options BOOTP_NFSROOT
+# options BOOTP_COMPAT
+# and do a full build of the kernel.
+# If you use the firewall, remember to default to open or your kernel
+# will not be able to send/receive the bootp packets.
+#
+# On the server:
+# enable NFS server and set /etc/exports as
+# ${DEST} -maproot=0 -alldirs <list of diskless clients>
+# /usr -alldirs
+#
+# enable bootpd by uncommenting the bootps line in /etc/inetd.conf
+# and putting at least the following entries in /etc/bootptab:
+# .default:\
+# hn:ht=1:vm=rfc1048:\
+# :sm=255.255.255.0:\
+# :sa=${SERVER}:\
+# :gw=${GATEWAY}:\
+# :rp="${SERVER}:${DEST}":
+#
+# client1:ha=0123456789ab:tc=.default
+#
+# and make sure that client1 is listed in /etc/hosts
+
+# VARIABLES:
+# some manual init is needed here.
+# DEST the diskless_root dir (goes into /etc/bootptab and /etc/exports
+# on the server)
+# DEVICES device entries to create in /dev
+DEST=/diskless_root
+DEVICES="all snd1 bktr0"
+
+# you should not touch these vars:
+# SYSDIRS system directories and mountpoints
+# DIRS mountpoints (empty dirs)
+# PWFILES files related to passwords
+# TOCOPY files and dirs to copy from root partition
+
+SYSDIRS="dev proc root usr var"
+DIRS="cdrom home mnt"
+PWFILES="master.passwd passwd spwd.db pwd.db"
+TOCOPY="bin boot compat etc modules sbin stand sys"
+
+init_diskless_root() {
+ echo "Cleaning old diskless root ($DEST)"
+ cd /
+ rm -rf ${DEST} && echo "Old diskless root removed."
+ echo "Creating $DEST..."
+ mkdir -p $DEST && echo "New diskless root created."
+ echo "+++ Now copy original tree from / ..."
+ ex=""
+ (cd / ; tar -clf - ${TOCOPY} ) | (cd $DEST; tar xvf - )
+ #(cd / ; find -x dev | cpio -o -H newc ) | \
+ # (cd $DEST; cpio -i -H newc -d )
+ echo "+++ Fixing permissions on some objects"
+ chmod 555 $DEST/sbin/init
+}
+
+update_conf_and_pw() {
+ echo "+++ Copying files in /conf and password files"
+ (cd ${DEST} ; rm -rf conf )
+ (cd / ; tar clf - conf ) | (cd ${DEST}; tar xvf - )
+ mkdir -p ${DEST}/conf/etc # used to mount things
+ (cd /etc ; tar cvf - ${PWFILES} ) | (cd ${DEST}/etc ; tar xf - )
+}
+
+update() {
+ echo "+++ update: create mountpoints and device entries, kernel"
+ for i in ${SYSDIRS} ${DIRS}
+ do
+ rm -r -f ${DEST}/$i
+ mkdir -p ${DEST}/$i && chown root:wheel ${DEST}/$i && echo -n "$i "
+ done
+ echo "."
+ ln -s /var/tmp ${DEST}/tmp
+ echo "+++ Now use MAKEDEV to create devices ${DEVICES}"
+ (cd $DEST/dev ; cp /dev/MAKEDEV . )
+ (cd $DEST/dev ; /dev/MAKEDEV ${DEVICES} )
+ (cd $DEST/dev ; ln -s /dev/sysmouse mouse )
+ echo "+++ Copying kernel from /sys/compile/DISKLESS"
+ cp /sys/compile/DISKLESS/kernel $DEST/kernel
+ echo "."
+}
+
+
+# Main entry point
+case $1 in
+ all) # clean and reinstall the whole diskless_root
+ init_diskless_root
+ update
+ update_conf_and_pw
+ ;;
+
+ update) # clean and rebuild mountpoints and device entries
+ update
+ update_conf_and_pw
+ ;;
+
+ *) # copy /conf and password files
+ update_conf_and_pw
+ ;;
+esac
+exit 0
+### end of file ###
diff --git a/share/examples/drivers/README b/share/examples/drivers/README
new file mode 100644
index 000000000000..426dfd7c87b7
--- /dev/null
+++ b/share/examples/drivers/README
@@ -0,0 +1,45 @@
+Sat Feb 1 23:30:12 PST 1997 <Julian Elischer>
+
+These files are shell scripts.
+
+They will, when run, create an example skeleton driver
+for you. You can use this driver as a starting point for
+writing drivers for your own devices. They have all the hooks needed
+for intiialisation, probing, attaching, as well as DEVFS
+node creation. They also create sample ioctl commands and a sample
+ioctl definition .h file in /sys/sys. In other words they are fully
+functional in a 'skeleton' sort of a way. They support multiple devices
+so that you may have several of your 'foobar' devices probed and atached
+at once.
+
+I expect that these scripts will improve with time.
+
+At present these scripts also link the newly created driver into
+the kernel sources in /sys. Possibly a better way would be
+to make them interactive. (and ask what kernel tree to use as well as
+a name for the driver.).
+
+There are presently two scripts.
+One for making a real device driver for ISA devices, and
+one for making a device driver for pseudo devices (e.g. /dev/null).
+Hopefully they will be joined by similar scripts for creating
+skeletons for PCI and EISA devices as well.
+
+Give them a single argument: the name of the driver.
+They will use this given name in many places within the driver,
+both in lower and upper case form. (conforming to normal usage).
+
+The skeleton driver should already link with the kernel
+and in fact the shell script will compile a kernel with the new
+drive linked in.. The new kernel should still be
+runnable and the new driver should be
+fully callable (once you get your device to probe).
+You should simply edit the driver and continue to use
+'make' (as done in the script) until your driver does what you want.
+
+The driver will end up in /sys/i386/isa for the device driver script,
+and in /sys/dev for the pseudo driver script.
+
+
+
+
diff --git a/share/examples/drivers/make_device_driver.sh b/share/examples/drivers/make_device_driver.sh
new file mode 100755
index 000000000000..4f47824c1e7e
--- /dev/null
+++ b/share/examples/drivers/make_device_driver.sh
@@ -0,0 +1,491 @@
+#!/bin/sh
+# This writes a skeleton driver and puts it into the kernel tree for you
+#arg1 is lowercase "foo"
+#
+# It also creates a directory under /usr/src/lkm to help you create
+#loadable kernel modules, though without much use except for development.
+#
+# Trust me, RUN THIS SCRIPT :)
+#
+#-------cut here------------------
+cd /sys/i386/conf
+
+if [ "${1}X" = "X" ]
+then
+ echo "Hey , how about some help here.. give me a device name!"
+ exit 1
+fi
+
+if [ -d /usr/src/lkm ]
+then
+ mkdir /usr/src/lkm/${1}
+fi
+
+UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"`
+cat >files.${UPPER} <<DONE
+i386/isa/${1}.c optional ${1} device-driver
+DONE
+
+cat >${UPPER} <<DONE
+# Configuration file for kernel type: ${UPPER}
+ident ${UPPER}
+# \$FreeBSD$"
+DONE
+
+grep -v GENERIC < GENERIC >>${UPPER}
+
+cat >>${UPPER} <<DONE
+# trust me, you'll need this
+options DDB
+device ${1}0 at isa? port 0x234 bio irq 5
+DONE
+
+cat >../isa/${1}.c <<DONE
+/*
+ * Copyright ME
+ *
+ * ${1} driver
+ * \$FreeBSD$
+ */
+
+
+#include "${1}.h" /* generated file.. defines N${UPPER} */
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h> /* SYSINIT stuff */
+#include <sys/conf.h> /* cdevsw stuff */
+#include <sys/malloc.h> /* malloc region definitions */
+#include <machine/clock.h> /* DELAY() */
+#include <i386/isa/isa.h> /* ISA bus port definitions etc. */
+#include <i386/isa/isa_device.h>/* ISA bus configuration structures */
+#include <sys/${1}io.h> /* ${1} IOCTL definitions */
+
+
+
+/* Function prototypes (these should all be static) */
+static d_open_t ${1}open;
+static d_close_t ${1}close;
+static d_read_t ${1}read;
+static d_write_t ${1}write;
+static d_ioctl_t ${1}ioctl;
+static d_mmap_t ${1}mmap;
+static d_poll_t ${1}poll;
+static int ${1}probe (struct isa_device *);
+static int ${1}attach (struct isa_device *);
+#ifdef ${UPPER}_MODULE
+static ointhand2_t ${1}intr; /* should actually have type inthand2_t */
+#endif
+
+#define CDEV_MAJOR 20
+static struct cdevsw ${1}_cdevsw = {
+ ${1}open,
+ ${1}close,
+ ${1}read,
+ ${1}write,
+ ${1}ioctl,
+ nullstop,
+ nullreset,
+ nodevtotty,
+ ${1}poll,
+ ${1}mmap,
+ NULL,
+ "${1}",
+ NULL,
+ -1 };
+
+struct isa_driver ${1}driver = {
+ ${1}probe,
+ ${1}attach,
+ "${1}" };
+
+/*
+ * device specific Misc defines
+ */
+#define BUFFERSIZE 1024
+#define NUMPORTS 4
+#define UNIT(dev) minor(dev) /* assume one minor number per unit */
+
+/*
+ * One of these per allocated device
+ */
+struct ${1}_softc {
+ struct isa_device *dev;
+ char buffer[BUFFERSIZE];
+} ;
+
+typedef struct ${1}_softc *sc_p;
+
+static sc_p sca[N${UPPER}];
+
+/* add your own test to see if it exists */
+/* should return the number of ports needed */
+static int
+${1}probe (struct isa_device *dev)
+{
+ char val;
+ int unit = dev->id_unit;
+ sc_p scp = sca[unit];
+
+ /*
+ * Check the unit makes sense.
+ */
+ if (unit > N${UPPER}) {
+ printf("bad unit (%d)\n", unit);
+ return (0);
+ }
+ if (scp) {
+ printf("unit %d already attached\n", unit);
+ return (0);
+ }
+
+ /*
+ * try see if the device is there.
+ */
+ val = inb (dev->id_iobase);
+ if ( val != 42 ) {
+ return (0);
+ }
+
+ /*
+ * ok, we got one we think
+ * do some further (this time possibly destructive) tests.
+ */
+ outb (dev->id_iobase, 0xff);
+ DELAY (10000); /* 10 ms delay */
+ val = inb (dev->id_iobase) & 0x0f;
+ return ((val & 0x0f) == 0x0f)? NUMPORTS : 0 ;
+}
+
+/*
+ * Called if the probe succeeded.
+ * We can be destructive here as we know we have the device.
+ * we can also trust the unit number.
+ */
+static int
+${1}attach (struct isa_device *dev)
+{
+ int unit = dev->id_unit;
+ sc_p scp = sca[unit];
+
+ /*
+ * Attach our interrupt handler to the device struct. Our caller
+ * will attach it to the hardware soon after we return.
+ */
+ dev->id_ointr = ${1}intr;
+
+ /*
+ * Allocate storage for this instance .
+ */
+ scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT);
+ if( scp == NULL) {
+ printf("${1}%d failed to allocage driver strorage\n", unit);
+ return (0);
+ }
+ bzero(scp, sizeof(*scp));
+ sca[unit] = scp;
+
+ /*
+ * Store whatever seems wise.
+ */
+ scp->dev = dev;
+ return 1;
+}
+
+/*
+ * Macro to check that the unit number is valid
+ * Often this isn't needed as once the open() is performed,
+ * the unit number is pretty much safe.. The exception would be if we
+ * implemented devices that could "go away". in which case all these routines
+ * would be wise to check the number, DIAGNOSTIC or not.
+ */
+#define CHECKUNIT(RETVAL) \
+do { /* the do-while is a safe way to do this grouping */ \
+ if (unit > N${UPPER}) { \
+ printf(__FUNCTION__ ":bad unit %d\n", unit); \
+ return (RETVAL); \
+ } \
+ if (scp == NULL) { \
+ printf( __FUNCTION__ ": unit %d not attached\n", unit);\
+ return (RETVAL); \
+ } \
+} while (0)
+#ifdef DIAGNOSTIC
+#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL)
+#else /* DIAGNOSTIC */
+#define CHECKUNIT_DIAG(RETVAL)
+#endif /* DIAGNOSTIC */
+
+static void
+${1}intr(int unit)
+{
+ sc_p scp = sca[unit];
+
+ /*
+ * well we got an interupt, now what?
+ * Theoretically we don't need to check the unit.
+ */
+ return;
+}
+
+int ${1}ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ switch (cmd) {
+ case DHIOCRESET:
+ /* whatever resets it */
+ outb(scp->dev->id_iobase, 0xff);
+ break;
+ default:
+ return ENXIO;
+ }
+ return (0);
+}
+/*
+ * You also need read, write, open, close routines.
+ * This should get you started
+ */
+static int
+${1}open(dev_t dev, int oflags, int devtype, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0);
+}
+
+static int
+${1}close(dev_t dev, int fflag, int devtype, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0);
+}
+
+static int
+${1}read(dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+ int toread;
+
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ * read from buffer
+ */
+ toread = (min(uio->uio_resid, sizeof(scp->buffer)));
+ return(uiomove(scp->buffer, toread, uio));
+}
+
+static int
+${1}write(dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+ int towrite;
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ * write to buffer
+ */
+ towrite = (min(uio->uio_resid, sizeof(scp->buffer)));
+ return(uiomove(scp->buffer, towrite, uio));
+}
+
+static int
+${1}mmap(dev_t dev, int offset, int nprot)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(-1);
+
+ /*
+ * Do processing
+ */
+#if 0 /* if we had a frame buffer or whatever.. do this */
+ if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) {
+ return (-1);
+ }
+ return i386_btop((FRAMEBASE + offset));
+#else
+ return (-1);
+#endif
+}
+
+static int
+${1}poll(dev_t dev, int which, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0); /* this is the wrong value I'm sure */
+}
+
+#ifndef ${UPPER}_MODULE
+
+/*
+ * Now for some driver initialisation.
+ * Occurs ONCE during boot (very early).
+ * This is if we are NOT a loadable module.
+ */
+static void
+${1}_drvinit(void *unused)
+{
+ dev_t dev;
+
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev, &${1}_cdevsw, NULL);
+}
+
+SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
+ ${1}_drvinit, NULL)
+
+#else /* ${UPPER}_MODULE */
+/* Here is the support for if we ARE a loadable kernel module */
+
+#include <sys/exec.h>
+#include <sys/sysent.h>
+#include <sys/lkm.h>
+
+MOD_DEV (${1}, LM_DT_CHAR, CDEV_MAJOR, &${1}_cdevsw);
+
+static struct isa_device dev = {0, &${1}driver, BASE_IO, IRQ, DMA, (caddr_t) PHYS_IO, PHYS_IO_SIZE, INT_INT, 0, FLAGS, 0, 0, 0, 0, 1, 0, 0};
+
+static int
+${1}_load (struct lkm_table *lkmtp, int cmd)
+{
+ if (${1}probe (&dev)) {
+ ${1}attach (&dev);
+ uprintf ("${1} driver loaded\n");
+ uprintf ("${1}: interrupts not hooked\n");
+ return 0;
+ } else {
+ uprintf ("${1} driver: probe failed\n");
+ return 1;
+ }
+}
+
+static int
+${1}_unload (struct lkm_table *lkmtp, int cmd)
+{
+ uprintf ("${1} driver unloaded\n");
+ return 0;
+}
+
+static int
+${1}_stat (struct lkm_table *lkmtp, int cmd)
+{
+ return 0;
+}
+
+int
+${1}_mod (struct lkm_table *lkmtp, int cmd, int ver)
+{
+ MOD_DISPATCH(${1}, lkmtp, cmd, ver,
+ ${1}_load, ${1}_unload, ${1}_stat);
+}
+
+#endif /* ${UPPER}_MODULE */
+
+DONE
+
+cat >../../sys/${1}io.h <<DONE
+/*
+ * Definitions needed to access the ${1} device (ioctls etc)
+ * see mtio.h , ioctl.h as examples
+ */
+#ifndef SYS_DHIO_H
+#define SYS_DHIO_H
+
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
+/*
+ * define an ioctl here
+ */
+#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */
+#endif
+DONE
+
+if [ -d /usr/src/lkm/${1} ]
+then
+ cat >/usr/src/lkm/${1}/Makefile <<DONE
+# ${UPPER} Loadable Kernel Module
+#
+# This happens not to work, actually. It's written for
+# a character ISA device driver, but they cannot be
+# be made into lkm's, because you have to hard code
+# everything you'll otherwise enter into the kernel
+# configuration file.
+
+.PATH: \${.CURDIR}/../../sys/i386/isa
+KMOD = ${1}_mod
+SRCS = ${1}.c ${1}.h
+
+CFLAGS += -I. -D${UPPER}_MODULE
+CLEANFILES += ${1}.h
+
+BASE_IO=0 # Base IO address
+IRQ=0 # IRQ number
+DMA=-1 # DMA channel
+PHYS_IO=0 # Physical IO Memory base address
+PHYS_IO_SIZE=0 # Physical IO Memory size
+INT_INT=0 # Interrupt interface
+FLAGS=0 # Flags
+
+CFLAGS+= -DBASE_IO=\${BASE_IO} -DIRQ=\${IRQ} -DDMA=\${DMA} -DPHYS_IO=\${PHYS_IO} -DPHYS_IO_SIZE=\${PHYS_IO_SIZE} -DINT_INT=\${INT_INT} -DFLAGS=\${FLAGS}
+
+${1}.h:
+ echo "#define N${UPPER} 1" > ${1}.h
+
+afterinstall:
+ \${INSTALL} -c -o \${BINOWN} -g \${BINGRP} -m \${BINMODE} \
+ \${.CURDIR}/${1} \${DESTDIR}/usr/bin
+
+.include <bsd.kmod.mk>
+DONE
+fi
+
+config ${UPPER}
+cd ../../compile/${UPPER}
+make depend
+make ${1}.o
+make
+exit
+
+#--------------end of script---------------
+#
+#edit to your taste..
+#
+#
+
+
+
+
diff --git a/share/examples/drivers/make_pseudo_driver.sh b/share/examples/drivers/make_pseudo_driver.sh
new file mode 100644
index 000000000000..c13b3e7ff711
--- /dev/null
+++ b/share/examples/drivers/make_pseudo_driver.sh
@@ -0,0 +1,311 @@
+#!/bin/sh
+# This writes a skeleton driver and puts it into the kernel tree for you
+#arg1 is lowercase "foo"
+#
+# Trust me, RUN THIS SCRIPT :)
+#
+#-------cut here------------------
+cd /sys/i386/conf
+
+if [ "${1}X" = "X" ]
+then
+ echo "Hey , how about some help here.. give me a device name!"
+ exit 1
+fi
+
+UPPER=`echo ${1} |tr "[:lower:]" "[:upper:]"`
+cat >files.${UPPER} <<DONE
+dev/${1}.c optional ${1} device-driver
+DONE
+
+cat >${UPPER} <<DONE
+# Configuration file for kernel type: ${UPPER}
+ident ${UPPER}
+# \$FreeBSD$"
+DONE
+
+grep -v GENERIC < GENERIC >>${UPPER}
+
+cat >>${UPPER} <<DONE
+# trust me, you'll need this
+options DDB
+pseudo-device ${1} 4 # might as well allow 4 of them
+DONE
+
+cat >../../dev/${1}.c <<DONE
+/*
+ * Copyright ME
+ *
+ * ${1} driver
+ * \$FreeBSD$
+ */
+
+
+#include "${1}.h" /* generated file.. defines N${UPPER} */
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h> /* SYSINIT stuff */
+#include <sys/conf.h> /* cdevsw stuff */
+#include <sys/malloc.h> /* malloc region definitions */
+#include <machine/clock.h> /* DELAY() */
+#include <sys/${1}io.h> /* ${1} IOCTL definitions */
+
+
+
+/* Function prototypes (these should all be static) */
+static d_open_t ${1}open;
+static d_close_t ${1}close;
+static d_read_t ${1}read;
+static d_write_t ${1}write;
+static d_ioctl_t ${1}ioctl;
+static d_mmap_t ${1}mmap;
+static d_poll_t ${1}poll;
+
+#define CDEV_MAJOR 20
+static struct cdevsw ${1}_cdevsw = {
+ ${1}open,
+ ${1}close,
+ ${1}read,
+ ${1}write,
+ ${1}ioctl,
+ nullstop,
+ nullreset,
+ nodevtotty,
+ ${1}poll,
+ ${1}mmap,
+ NULL,
+ "${1}",
+ NULL,
+ -1 };
+
+/*
+ * device specific Misc defines
+ */
+#define BUFFERSIZE 1024
+#define UNIT(dev) minor(dev) /* assume one minor number per unit */
+
+/*
+ * One of these per allocated device
+ */
+struct ${1}_softc {
+ struct isa_device *dev;
+ char buffer[BUFFERSIZE];
+} ;
+
+typedef struct ${1}_softc *sc_p;
+
+static sc_p sca[N${UPPER}];
+
+/*
+ * Macro to check that the unit number is valid
+ * Often this isn't needed as once the open() is performed,
+ * the unit number is pretty much safe.. The exception would be if we
+ * implemented devices that could "go away". in which case all these routines
+ * would be wise to check the number, DIAGNOSTIC or not.
+ */
+#define CHECKUNIT(RETVAL) \
+do { /* the do-while is a safe way to do this grouping */ \
+ if (unit > N${UPPER}) { \
+ printf(__FUNCTION__ ":bad unit %d\n", unit); \
+ return (RETVAL); \
+ } \
+ if (scp == NULL) { \
+ printf( __FUNCTION__ ": unit %d not attached\n", unit);\
+ return (RETVAL); \
+ } \
+} while (0)
+#ifdef DIAGNOSTIC
+#define CHECKUNIT_DIAG(RETVAL) CHECKUNIT(RETVAL)
+#else /* DIAGNOSTIC */
+#define CHECKUNIT_DIAG(RETVAL)
+#endif /* DIAGNOSTIC */
+
+int ${1}ioctl (dev_t dev, int cmd, caddr_t data, int flag, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ switch (cmd) {
+ case DHIOCRESET:
+ /* whatever resets it */
+ outb(scp->dev->id_iobase, 0xff);
+ break;
+ default:
+ return ENXIO;
+ }
+ return (0);
+}
+/*
+ * You also need read, write, open, close routines.
+ * This should get you started
+ */
+static int
+${1}open(dev_t dev, int oflags, int devtype, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0);
+}
+
+static int
+${1}close(dev_t dev, int fflag, int devtype, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0);
+}
+
+static int
+${1}read(dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+ int toread;
+
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ * read from buffer
+ */
+ toread = (min(uio->uio_resid, sizeof(scp->buffer)));
+ return(uiomove(scp->buffer, toread, uio));
+}
+
+static int
+${1}write(dev_t dev, struct uio *uio, int ioflag)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+ int towrite;
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ * write to buffer
+ */
+ towrite = (min(uio->uio_resid, sizeof(scp->buffer)));
+ return(uiomove(scp->buffer, towrite, uio));
+}
+
+static int
+${1}mmap(dev_t dev, int offset, int nprot)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(-1);
+
+ /*
+ * Do processing
+ */
+#if 0 /* if we had a frame buffer or whatever.. do this */
+ if (offset > FRAMEBUFFERSIZE - PAGE_SIZE) {
+ return (-1);
+ }
+ return i386_btop((FRAMEBASE + offset));
+#else
+ return (-1);
+#endif
+}
+
+static int
+${1}poll(dev_t dev, int which, struct proc *p)
+{
+ int unit = UNIT (dev);
+ sc_p scp = sca[unit];
+
+ CHECKUNIT_DIAG(ENXIO);
+
+ /*
+ * Do processing
+ */
+ return (0); /* this is the wrong value I'm sure */
+}
+
+/*
+ * Now for some driver initialisation.
+ * Occurs ONCE during boot (very early).
+ */
+static void
+${1}_drvinit(void *unused)
+{
+ dev_t dev;
+ int unit;
+ sc_p scp = sca[unit];
+
+ dev = makedev(CDEV_MAJOR, 0);
+ cdevsw_add(&dev, &${1}_cdevsw, NULL);
+ for (unit = 0; unit < N${UPPER}; unit++) {
+ /*
+ * Allocate storage for this instance .
+ */
+ scp = malloc(sizeof(*scp), M_DEVBUF, M_NOWAIT);
+ if( scp == NULL) {
+ printf("${1}%d failed to allocate strorage\n", unit);
+ return ;
+ }
+ bzero(scp, sizeof(*scp));
+ sca[unit] = scp;
+ }
+}
+
+SYSINIT(${1}dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE+CDEV_MAJOR,
+ ${1}_drvinit, NULL)
+
+
+DONE
+
+cat >../../sys/${1}io.h <<DONE
+/*
+ * Definitions needed to access the ${1} device (ioctls etc)
+ * see mtio.h , ioctl.h as examples
+ */
+#ifndef SYS_DHIO_H
+#define SYS_DHIO_H
+
+#ifndef KERNEL
+#include <sys/types.h>
+#endif
+#include <sys/ioccom.h>
+
+/*
+ * define an ioctl here
+ */
+#define DHIOCRESET _IO('D', 0) /* reset the ${1} device */
+#endif
+DONE
+
+config ${UPPER}
+cd ../../compile/${UPPER}
+make depend
+make ${1}.o
+make
+exit
+
+#--------------end of script---------------
+#
+#you also need to add an entry into the cdevsw[]
+#array in conf.c, but it's too hard to do in a script..
+#
+#edit to your taste..
+#
+#
+
+
diff --git a/share/examples/etc/README.examples b/share/examples/etc/README.examples
new file mode 100644
index 000000000000..fbdb4dfd8f2f
--- /dev/null
+++ b/share/examples/etc/README.examples
@@ -0,0 +1,66 @@
+$FreeBSD$
+
+The /usr/share/examples/etc directory contains the original
+distribution versions of the files which are shipped in /etc. This is
+intended to make it easy to recover when the /etc versions are
+accidentally deleted or broken beyond repair.
+
+This directory contains the following files:
+
+aliases - sendmail aliases file (see aliases(5))
+amd.map - filesystem automounter lookup resolution map (see amd(8))
+auth.conf - authentication capability database (see auth.conf(5))
+crontab - system scheduled command table (see crontab(5))
+csh.cshrc - sample .cshrc (see csh(1))
+csh.login - sample .login
+csh.logout - sample .logout
+disktab - disk description file (see disktab(5))
+dm.conf - configuration file for games (see dm(6))
+fbtab - configuration file for login(1)
+ftpusers - user restriction file for ftpd(8)
+gettytab - defines port configuration for getty(8)
+group - group permissions file (see group(5))
+host.conf - defines name resolution order for gethostbyname(3)
+hosts - see hosts(5)
+hosts.equiv - defines system-wide trusted hosts (see ruserok(3))
+hosts.lpd - defines trusted hosts for lpd(8)
+inetd.conf - configuration file for inetd(8)
+locate.rc - confiuration file for locate(1)
+login.access - configuration file for login(8) (see login.access(5))
+login.conf - login class capabilities database (see login.conf(5))
+mail.rc - systemwide initialization files for mail(1)
+make.conf - defines configuration variables for system builds
+manpath.config - configuration file for man(1)
+modems - modem configuration database (see modems(5))
+motd - sample Message of the Day
+netstart - network startup script run from /etc/rc
+networks - see networks(5)
+newsyslog.conf - configuration for system log file rotator newsyslog(8)
+pam.conf - configuration file for pam(8)
+pccard_ether - confiuration script for ethernet pccards (see pccardd(8))
+phones - phone number database for tip(1)
+printcap - configuration file for lpr(1)
+protocols - see protocols(5)
+profile - system-wide .profile for sh(1)
+rc - system startup script (see init(8))
+rc.atm - networking startup script for atm(8)
+rc.diskless1 - general BOOTP startup script
+rc.diskless2 -
+rc.firewall - setup system for ipfw(8)
+rc.i386 - startup script for i386-specific processing
+rc.alpha - startup script for axp-specific processing
+rc.isdn - startup script for isdnd(8)
+rc.network - network startup script
+rc.pccard - startup script for PC-cards
+rc.serial - sample local startup script fragments
+rc.shutdown - system shutdown script (see init(8))
+remote - configuration file for tip(1)
+rpc - see rpc(5)
+security - script run from crontab to do nightly security checks
+services - see services(5)
+shells - list of configurable shells (see shells(5))
+skey.access - configuration file for S/Key (see skey.access(5))
+syslog.conf - configuration file for syslogd(8)
+ttys - defines port configuration for init(8)
+defaults/rc.conf - default system configuration info (see rc.conf(5))
+defaults/pccard.conf - default configuration file for pccardd(8)
diff --git a/share/examples/etc/bsd-style-copyright b/share/examples/etc/bsd-style-copyright
new file mode 100644
index 000000000000..e0225417d6db
--- /dev/null
+++ b/share/examples/etc/bsd-style-copyright
@@ -0,0 +1,27 @@
+/*-
+ * Copyright (c) [year] [your name]
+ * 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.
+ *
+ * [id for your version control system, if any]
+ */
diff --git a/share/examples/etc/skey.access b/share/examples/etc/skey.access
new file mode 100644
index 000000000000..ad0245f6edb9
--- /dev/null
+++ b/share/examples/etc/skey.access
@@ -0,0 +1,30 @@
+# This file controls whether UNIX passwords are to be permitted. Rules
+# are matched in order, and the search terminates when the first matching
+# rule has been found.
+#
+# Each rule has the form:
+#
+# permit condition condition...
+# deny condition condition...
+#
+# Where "permit" or "deny" may be followed by zero or more conditions.
+#
+# A rule is matched when all conditions are satisfied. A rule without
+# conditions is always satisfied.
+#
+# Examples of conditions are:
+#
+# hostname wzv.win.tue.nl
+# internet 131.155.210.0 255.255.255.0
+# port ttya
+# user root
+# group wheel
+#
+# The old S/Key form (permit/deny netnumber netmask) is still supported.
+#
+#permit user uugiga # uucp login via modem or internet
+#permit port ttyb # local
+#permit port console # local
+#deny # anything else
+
+permit # permit plaintext passwords all the time
diff --git a/share/examples/find_interface/Makefile b/share/examples/find_interface/Makefile
new file mode 100644
index 000000000000..184c6417702b
--- /dev/null
+++ b/share/examples/find_interface/Makefile
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+PROG= find_interface
+NOMAN=
+
+.include <bsd.prog.mk>
diff --git a/share/examples/find_interface/README b/share/examples/find_interface/README
new file mode 100644
index 000000000000..4df4399cdbc7
--- /dev/null
+++ b/share/examples/find_interface/README
@@ -0,0 +1,9 @@
+This is a simple program which demonstrates how to query the kernel
+routing mechanism using only a UDP socket. Pass it a hostname on
+the command line (sorry, it doesn't parse dotted decimal) and it will
+print out an IP address which names the interface over which UDP
+packets intended for that destination would be sent.
+A more sophisticated program might use the list obtained from SIOCGIFCONF
+to match the address with an interface name, but applications programmers
+much more often need to know the address of the interface rather than
+the name.
diff --git a/share/examples/find_interface/find_interface.c b/share/examples/find_interface/find_interface.c
new file mode 100644
index 000000000000..73a7fe839d79
--- /dev/null
+++ b/share/examples/find_interface/find_interface.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright 1994, 1995 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. 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$
+ */
+
+/*
+ * This is a simple program which demonstrates how to query the kernel
+ * routing mechanism using only a UDP socket. Pass it a hostname on
+ * the command line (sorry, it doesn't parse dotted decimal) and it will
+ * print out an IP address which names the interface over which UDP
+ * packets intended for that destination would be sent.
+ * A more sophisticated program might use the list obtained from SIOCGIFCONF
+ * to match the address with an interface name, but applications programmers
+ * much more often need to know the address of the interface rather than
+ * the name.
+ */
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <netdb.h>
+#include <err.h>
+#include <errno.h>
+#include <string.h>
+#include <sysexits.h>
+
+int
+main(int argc, char **argv)
+{
+ struct sockaddr_in local, remote;
+ struct hostent *hp;
+ int s, rv, namelen;
+
+ argc--, argv++;
+
+ if (!*argv) {
+ errx(EX_USAGE, "must supply a hostname");
+ }
+
+ hp = gethostbyname(*argv);
+ if (!hp) {
+ errx(EX_NOHOST, "cannot resolve hostname: %s", *argv);
+ }
+
+ memcpy(&remote.sin_addr, hp->h_addr_list[0], sizeof remote.sin_addr);
+ remote.sin_port = htons(60000);
+ remote.sin_family = AF_INET;
+ remote.sin_len = sizeof remote;
+
+ local.sin_addr.s_addr = htonl(INADDR_ANY);
+ local.sin_port = htons(60000);
+ local.sin_family = AF_INET;
+ local.sin_len = sizeof local;
+
+ s = socket(PF_INET, SOCK_DGRAM, 0);
+ if (s < 0)
+ err(EX_OSERR, "socket");
+
+ do {
+ rv = bind(s, (struct sockaddr *)&local, sizeof local);
+ local.sin_port = htons(ntohs(local.sin_port) + 1);
+ } while(rv < 0 && errno == EADDRINUSE);
+
+ if (rv < 0)
+ err(EX_OSERR, "bind");
+
+ do {
+ rv = connect(s, (struct sockaddr *)&remote, sizeof remote);
+ remote.sin_port = htons(ntohs(remote.sin_port) + 1);
+ } while(rv < 0 && errno == EADDRINUSE);
+
+ if (rv < 0)
+ err(EX_OSERR, "connect");
+
+ namelen = sizeof local;
+ rv = getsockname(s, (struct sockaddr *)&local, &namelen);
+ if (rv < 0)
+ err(EX_OSERR, "getsockname");
+
+ printf("Route to %s is out %s\n", *argv, inet_ntoa(local.sin_addr));
+ return 0;
+}
diff --git a/share/examples/ibcs2/README b/share/examples/ibcs2/README
new file mode 100644
index 000000000000..73e9281946a4
--- /dev/null
+++ b/share/examples/ibcs2/README
@@ -0,0 +1,3 @@
+Here is a small hello world type program in iBCS2 coff format.
+You must uudecode it first to run it under the FreeBSD iBCS support.
+
diff --git a/share/examples/ibcs2/hello.uu b/share/examples/ibcs2/hello.uu
new file mode 100644
index 000000000000..a4b091af83b4
--- /dev/null
+++ b/share/examples/ibcs2/hello.uu
@@ -0,0 +1,677 @@
+begin 755 hello_world
+M3`$$`'.D"RXT2@``9@(``!P``P$+`0``/#0``)P4```H#```U````-`````,
+M!4``+G1E>'0```#0````T````#PT``#0````````````````````(````"YD
+M871A````#`5```P%0`"<%```##4``````````````````$`````N8G-S````
+M`*@90`"H&4``*`P```````````````````````"`````+F-O;6UE;G0`````
+M`````(P```"H20````````````````````(``,.0D)"#[`B+[(M%"(U4A1")
+M%0T%0`!2C54,4E#HW____V@,!4``:@'H/P@``(/$",<%"!E```````#H&0``
+M`(/$#%#H0#,``&H`N`$```":``````<`],-5B^R![`````!35U9H%`5``&AP
+M%$``Z"T-``"#Q`AH*`5``&A@%$``Z!L-``"#Q`A>7UO)PY"0D%6+[(/L"%=6
+M:BIJ`/]U#.@P,@``@\0,,_;K59"#_PY](XM%#&O.#@/!BTT(_T4(B@F(##A'
+MBT4(#[8`]H"U$$``!W78BT4(@#@`=0@SP%Y?R<.0D(O&"\!T"H/X`70UZR20
+MD)"+10C_10B`.%]U#4:#_@-]+S/_Z[R0D)"+10B`>/\N=`NX`0```%Y?R<.0
+MD$;KW)"+10C_10B`."YTT.ODD)"07E_)PU6+[(/L!%=6,_;K)6O&#HOXBT4(
+M@#PX`'46:@Z+10P#QU"+10@#QU#H'PT``(/$#$:#_@-\UEY?R<.0D%6+[&H1
+M:.0'0`!J`NCC,0``@\0,_W4,Z,`Q``"#Q`10_W4,:@+HRC$``(/$#&H":/@'
+M0`!J`NBY,0``@\0,BT4(@^@!@_@'#X>_````+O\DA5P#``"0D)#'10S\!T``
+M_W4,Z'4Q``"#Q`10_W4,:@+H?S$``(/$#&HB:`0(0`!J`NAN,0``@\0,Z:H`
+M``"0D&H/:"@(0`!J`NA6,0``@\0,:A%H/`5``.O5D)!J`V@X"$``:@+H.C$`
+M`(/$#&H%:%`%0`!J`N@I,0``@\0,:@EH/`A``.O`D&H%:%`%0`!J`N@.,0``
+M@\0,:A%H2`A``.NED)!J%VA<"$``ZX*0D)!J$VAT"$``Z7/___]J#6B("$``
+MZ6?___^C`@``G`(``-0"``#P`@``'`,``#@#``!$`P``1`,``&H!:)8(0`!J
+M`NBN,```R<-5B^R#[#1HF`A``/]U".A5"P``@\0("\!U!\=%"%`'0`#_=1#_
+M=0CHJ/W__X/$"`O`=`FX`0```,G#D)"+11"`.`!T$(!X#@!T"H!X'``/A3X"
+M``#_=0SHJ`L``(/$!(E%_`O`=#&-1=!0_W7\Z&+]__^#Q`@+P'0/_W4,:@'H
+M-?[__^L/D)"0C4704/]U$.CH_?__@\0(BT40@#@`=!"`>`X`=`J`>!P`#X7C
+M`0``:)P(0`#H2PL``(/$!(E%_`O`=#"-1=!0_W7\Z`7]__^#Q`@+P'0._W4,
+M:@+HV/W__^L.D)"-1=!0_W40Z(S]__^#Q`B+11"`.`!T$(!X#@!T"H!X'``/
+MA8<!``!H/`5``.B#`0``@\0$"\!T)(M%$(`X`'40@'@.`'4*@'@<``^$__[_
+M__]U#&H#Z1@!``"0D,=%S`````!H4`5``.B+`0``@\0$B47\"\`/A.(```"-
+M1=!0_W7\Z&G\__^#Q`@+P'02_W4,:@7H//W__X/$".FS````@'W0`'3H@'W>
+M`'3B@'WL`'3<BT40@#@`=!J-1=!0_W40Z+X)``"#Q`B#^`$;P/?8ZP>0D+@!
+M````"\!T=HM%$(!X#@!T'HU%WE"+11"#P`Y0Z(X)``"#Q`B#^`$;P/?8ZP>0
+MD+@!````"\!T1HM%$(!X'`!T'HU%[%"+11"#P!Q0Z%X)``"#Q`B#^`$;P/?8
+MZP>0D+@!````"\!T%HU%T%#_=1#H3_S__X/$",=%S`$```"#?<P`#X0&____
+M:@#H4````(/$!(-]S`!U#?]U#&H$Z%W\__^#Q`B+11"`.`!T#(!X#@!T!H!X
+M'`!U((U%T%!H4`=``.A4^___@\0(C4704/]U$.CM^___@\0(,\#)PY"058OL
+M@SUD!T```'P._S5D!T``Z'4I``"#Q`2#?0@`="!J`/]U".C6"@``@\0(HV0'
+M0``+P'T*N`$```#)PY"0D#/`R<-5B^R#[!1J`6H`_S5D!T``Z),*``"#Q`R)
+M1?C_=0CHE2T``(/$!(E%[&@``0``:*@90`#_-60'0`#HD@H``(/$#(E%]`O`
+M?C/'1?"H&4``BT7PB47\ZP^0BT7\@#@*=`S_1?S_3?2#??0`=>R#??0`=3*!
+M??"H&4``=04SP,G#D&H`_W7X_S5D!T``Z!@*``"#Q`R#??0`=)"+1>P#1?#)
+MPY"0D(M%_,8``(M%_"M%\$`!1?C_=>S_=?#_=0CHE@D``(/$#`O`=+?_3?2+
+M1?Q`B47PZ7?___]5B^R![(0```!6C46(4&M%"$C_L%P%0`#_=0SH+/S__X/$
+M#`O`=`4SP%[)PVBD"$``C46T4.@""@``@\0(QT6``````.LMD)!HL@A``(U%
+MM%#HM@D``(/$"&H.:T6`#HU$!8A0C46T4.A7"```@\0,_T6`@WV``WS/:+0(
+M0`"-1;10Z(4)``"#Q`AK10A(_["<!4``C46T4.AO"0``@\0(:@"-1;10Z#D)
+M``"#Q`B)A7S___]`=2F#?1``=!MK10A(_[!<!4``:@;H-OK__X/$".E1____
+MD)"XM@A``%[)PVH!C46'4/^U?/___^@'"0``@\0,@_@!?`]K10A(BDV'.(B8
+M!4``="AK10A(_[!<!4``:@?HZ_G__X/$"/^U?/___^A))P``@\0$Z?C^__^0
+M_[5\____:T4(2/^0D`5``(/$!(E%@/^U?/___^@?)P``@\0$@WV``'02:T4(
+M2/^P7`5``&H(Z5[___^0:T4(2(OP@<9@!4``Q@8`:@Z-18A05N@]!P``@\0,
+M:+@(0`!K10A(!6`%0`!0Z&X(``"#Q`AJ#HU%EE!K10A(!6`%0`!0Z`X'``"#
+MQ`QHN@A``&M%"$@%8`5``%#H/P@``(/$"&H.C46D4&M%"$@%8`5``%#HWP8`
+M`(/$#+E(````BT4(]^D%8`5``%[)PY"058OL@^P45U;'1>P`````QT7X`0``
+M`,8%J!I```"#?0P`#X7%````@WT(`0^%AP```#/VZV>0D)"XJ!I``%Y?R<.0
+MD)!HO`A``&BH&D``Z+T'``"#Q`AKQD@%8`5``%!HJ!I``.BG!P``@\0(:\9(
+MB_B#OZ0%0```="$%J`5``%"+QP5@!4``4.@K!0``@\0("\!T!\=%^`````!&
+M:\9(@[A<!4```'6<@WWX`'2*N&`%0`!>7\G#D#/VZQUKQDB+^(M%"#F'6`5`
+M`'4,B\<%8`5``%Y?R<.01FO&2(.X7`5```!UUS/`7E_)PY"#?0@!#X66````
+M:`X!``#_=0QHJ!I``.@0!0``@\0,Q@6V&T```(`]J!I``"]U$<=%^`````#'
+M1?"I&D``ZPB0QT7\J!I``#/VZQ>0:@#_=?Q6Z,'\__^#Q`R)1>P+P'281H-]
+M^`!U)(-]\`!T*HM%\(E%_&HO4.@8!```@\0(B47P"\!T!O]%\,8``&O&2(.X
+M7`5```!UM(M%#%Y?R<.0,_;K`49KQDB#N%P%0```#X1$____:\9(BTT(.8A8
+M!4``=>%J`?]U#%;H2OS__X/$#%Y?R<.0D)!5B^Q6@7T(Z`,``'PKBT4(N>@#
+M``"9]_F+\(/^!W\9BT4(F??Y4FO&2/^03`5``(/$!%[)PY"0D+B^"$``7LG#
+M58OL@WT(`'4'N/_____)P_]U"&H!Z.+]__^#Q`@+P'3H,\#)PY"0D%6+[+B_
+M"$``R<.0D%6+[('LQ`,``&C$`P``C84\_/__4/]U".BG!0``@\0,/<0#``!]
+M";@!````R<.0D`^_A3S\___1X`^_C3[\__^-!(B#P$0]Q`,``'_::,0#``"-
+MA3S\__]0:,`(0`#HJ2<``(/$##/`R<.0D%6+[(/L$&H0C47P4/]U".A$!0``
+M@\0,@_@0?0BX`0```,G#D&H0C47P4&B$#$``Z&PG``"#Q`PSP,G#D%6+[(M%
+M"`O`=`Z#^`%T$;B4#$``R<.0D+B$#$``R<.0N(P,0`#)PY!5B^R#[`AJ"(U%
+M^%#_=0CHX`0``(/$#(/X"'T(N`$```#)PY!J"(U%^%!HF`Q``.@()P``@\0,
+M,\#)PY!5B^R+10@+P'0*N*`,0`#)PY"0D+B8#$``R<.058OL@>Q8`@``5U9H
+M5@(``(V%J/W__U#_=0CH?00``(/$##U6`@``?0NX`0```%Y?R<.0D+^D#$``
+MC;6H_?__N94```#RI6:E,\!>7\G#D)!5B^R+10B#^"IW62[_)(58#0``D`^_
+M!:0,0``%^@Q``,G#D)`/OP6F#$``Z^Z0D)`/OP6J#$``Z^*0D)`/OP6H#$``
+MZ]:0D)`/OP6L#$``Z\J0D)"+10@/OP1%I`Q``.NZD)"0N/P.0`#)PY``#0``
+M$`T``!P-```H#0``-`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`
+M#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-
+M``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``0`T`
+M`$`-``!`#0``0`T``$`-``!`#0``0`T``$`-``!`#0``R<.0D%6+[(/L!&H"
+MC47^4/]U".@<`P``@\0,@_@"?0BX`0```,G#D&:+1?YFHPP90``SP,G#D)!5
+MB^R+10@+P'0.@_@!=!W&!0`/0```ZPJ@#!E``*(`#T``N``/0`#)PY"0D*`-
+M&4``Z^J058OL@^P(5HU%$(E%_(M%"/9`#`)U"O9`#(!T((!(#`+_=0C_=?S_
+M=0SHP@,``(/$#(OPBT4(]D`,('0(N/____]>R<.+QE[)PY"0D%:+="0(BE0D
+M#*PZPG0CA,!T&ZPZPG0:A,!T$JPZPG01A,!T":PZPG0(A,!UW#/`7L.+QDA>
+MPY"05U:+="0,BWPD$#O^=$"LKG5!A,!T.*RN=3F$P'0PK*YU,83`="BLKG4I
+MA,!T(*RN=2&$P'08K*YU&83`=!"LKG41A,!T"*RN=0F$P'7`,\!>7\,/ML`/
+MME?_*\)>7\.05U:+?"00BTPD%#/`\JZ+T8O/BW0D$"O.BWPD#(O!P>D"\Z6+
+MR('A`P```/.DB\HSP/.JBT0D#%Y?PY"058OL@^P(4U=6BW4(BQT-!4``"]MU
+M"C/`7E];R<.0D)"#.P!T\8/#!/]S_%;H#P```(/$"(OX"_]TYEY?6\G#D%6+
+M[%=6BW4(BWT,1XH&.$?_=0U&@'[_/77QB\=>7\G#@#X`=0:`?_\]=.\SP%Y?
+MR<.0D)"+UU:+?"0(,\"Y______*N3XOWBWPD#(M,)!#RKN,!3XO/B_Z+="0,
+M*\[SI(@/BT0D"%Z+^L.0D%6+[('L"`(``&@!`0``C87\_O__4/]U".C?````
+M@\0,/0$!``!\'F@!`0``C87X_?__4/]U".C!````@\0,/0$!``!]![@!````
+MR<-H`0$``(V%_/[__U!HM!!``.CB(@``@\0,:`$!``"-A?C]__]0:`0/0`#H
+MR2(``(/$##/`R<.0D%=6BW0D#(M\)!`[_G0QBTPD%$%)="FLKG4JA,!T(4ET
+M'JRN=1^$P'062703K*YU%(3`=`M)=`BLKG4)A,!UU#/`7E_##[;`#[97_RO"
+M7E_#N!,```":``````<`#X(J(P``PY"X!0```)H`````!P`/@A8C``##D+@#
+M````F@`````'``^"`B,``,.0B]=6BWPD"#/`N?_____RKD^+]XM\)`RY____
+M__*N]]&+_HMT)`SSI(M$)`A>B_K#5XO6BWPD##/`N?_____RKO?1BW0D#(M\
+M)`B+P<'I`O.EB\B!X0,```#SI(M$)`B+\E_#D%6+[(/L"(M%"(L`)0$```")
+M1?R+10B+`-'X)?___W^)1?BY!0```)GW^8M-"(D!BT7XN04```"9]_F*1?R-
+M!%`$,`^^P,G#D%6+[%-75HMU"(M]#(M=$(![#3QT-XM%%(L`*T,$*0.+112+
+M`(E#!%/H4QT``(/$!%-7:@%6Z/H7``"#Q!"+112+2P2)"%Y?6\G#D)!75HM%
+M%/\PZ#`A``"#Q`P#QXM-%(D!7E];R<.058OL@>P$`@``4U=6BW4(BWT0QT6@
+M`````,=%B`````#'1<0`````QT6X``````^^1PV)A0S^__^+1P2)1="#O0S^
+M__\\=0D-____?^L/D)"+A0S^__^+!(44&$``B47@B@:(1><*P'1B/"5T7HO>
+M1HH&B$7G"L!T!#PE=?*+QBO#B84,_O__`46@`T70B84(_O__.T7@=AB-1=!0
+M5_^U#/[__U/H[_[__X/$$.L=D)#_M0S^__]3_W70Z&$@``"#Q`R+A0C^__^)
+M1="`?><`=7.+1=`K1P2)A03^__\I!XM%T(E'!(M%T`,'.T7@=@^`?PT\=`E7
+MZ!T<``"#Q`3V1PQ$="?V1PP$=1C_=:!J"HM%T"M%H%#HZ1\``(/$#`O`=`E7
+MZ"P:``"#Q`3V1PP@=`NX_____UY?6\G#D(M%H%Y?6\G#,\")1:2)1;2)1<B)
+M1?2)1?!&K(A%YP^VP(/H((/X6`^'.PH``"[_)(4,'@``D)"0@$VT`NO<D)"`
+M3;0$Z]20D(!-M`CKS)"0@$VT$.O$D)"`3;1`QT64`````.NUD)"0]D6T0'4:
+M@T4,!(M%#(M`_(E%\`O`?9OW7?"`=;0$ZY*#10P$BT4,BT#\B464"\!]@>O!
+MD/9%M$1U!(!-M"`/MD7G@^@PB84$_O__ZQJ0D)`/MD7G@^@P:XT$_O__"@/!
+MB84$_O__1HH&B$7G#[9%Y_:`M1!```1UU_9%M$!T$8N%!/[__XE%E.DE____
+MD)"0BX4$_O__B47PZ13___^0D(!-M`'I"?___Y"0D/9%M`&#10P$BT4,BT#\
+MB474C9T?_O__B5WL"\!](L>%$/[__W@00`#'1?0!````/0```(`/A/L```#W
+M7=3K+)#V1;0"=`['A1#^__]Z$$``ZQ*0D/9%M`AT$<>%$/[__WP00`#'1?0!
+M````BT74B84$_O__@_@)?P\+P'54]D6T0'59ZTR0D)"+A03^__^)A0S^__^X
+M"@```(F%"/[__XN%!/[__YGWO0C^__^)A03^__^P"O:M!/[__XJ-#/[__RK(
+M@,$P2X@+@[T$_O__"7^W2XJ%!/[__P0PB`/V1;1`#X3:"0``BT64BTWL*\LK
+MP8F%!/[__PO`#X[""0``B46,B47(@$VU`NFS"0``D)"0]D6T`8-%#`2+10R+
+M0/R)1=2-G1_^__^)7>RI````@`^$-O___XU%U%#HPOO__X/$!$N(`^DB____
+MD)"0QT7`!P```,=%S`(```#K#L=%P`\```#'1<P#````]D6T`8-%#`2+10R+
+M0/R)1=2`?>=8=0>X.!!``.L%N$P00`")1;"-G1_^__^)7>R+1=2)A03^__\+
+MP'4:]D6T0'5!N`$```")18R)1<B`3;4"ZS"0D)!+BX4$_O__(T7``T6PB@"(
+M`XN%!/[__]'X)?___W^*3<S3^(F%!/[__PO`==/V1;1`=!Z+192+3>PKRRO!
+MB84$_O__"\!^"HE%C(E%R(!-M0+V1;00#X2E"```@WW4``^$FP@```^V1>>#
+M^%AT0H/X;W0-@_AX="#I@P@``)"0D&;W1;0``@^%=`@``+@!````Z:C^__^0
+MD,>%$/[__X`00`#'1?0"````Z5((``"0D,>%$/[__X000`#KYO9%M$!U!\=%
+ME`8```"#10P(BT4,5E>-?:B-</BEI5]>BT6L)0``\'\]``#P?P^%H0```/=%
+MK/__#P!U/(M%K"4```"`/0```(!U!\=%N`$```#'18@!````@'WG174)N'00
+M0`#K!Y"0N'`00`"+V(U#`^DQ!@``D(M%K"4```"`/0```(!U$<>%$/[__X@0
+M0`#'1?0!````BT6LP>`,B474QT7$!0```,=%P`\```#'1<P#````@'WG10^$
+MQ`0``,=%_&`00`#'1;!,$$``Z4'^__^0C47H4(U%^%"+191`@_@1?`6X$0``
+M`%#_=:S_=:CH@@L``(/$%(O8@WWH`'0/QX40_O__BA!``.LGD)"0]D6T`G0.
+MQX40_O__C!!``.L2D)#V1;0(=!''A1#^__^.$$``QT7T`0```(V%%/[__XE%
+M[(`[`'0'B@-#ZP20D+`PBTWL_T7LB`&#?90`=0;V1;00=`Z+1>S_1>R*#0P9
+M0`"("(M%E(F%!/[__^L7D(`[`'0:BT7L_T7LB@M#B`C_C03^__^#O03^__\`
+M?^&#O03^__\`?A"+A03^__^)1=R)1<B`3;4!B]V!Z^P!``"-19V)1;S&``#=
+M1:C<':P00`#?X)N>='F+1?A(B84$_O__"\!]*/>=!/[__^L@D)"X"@```(F%
+M"/[__XN%!/[__YGWO0C^__^)A03^__^#O03^__\)?AV+A03^__^Y"@```)GW
+M^8#",/]-O(M%O(@0Z[Z0D/]-O(M%O(J-!/[__X#!,(@(ZPJ0_TV\BT6\Q@`P
+MC46;.46\=^^#??@`?P_=1:C<':P00`#?X)N>=0:P*^L$D)"P+?]-O(M-O(@!
+M#[9%Y_:`M1!```%T!;!%ZP.0L&7_3;R+3;R(`8O%*T6\@^ACB46D`47(@$VT
+M@.F3!0``D)"0]D6T0'4'QT64!@```(-%#`B+10Q65XU]J(UP^*6E7UZ+1:PE
+M``#P?ST``/!_#X6%````]T6L__\/`'4HBT6L)0```(`]````@'4'QT6X`0``
+M`,=%B`$```"[<!!``.E8_?__D(M%K"4```"`/0```(!U$<>%$/[__Y`00`#'
+M1?0!````BT6LP>`,B474QT7$!0```,=%P`\```#'1<P#````QT6P3!!``,=%
+M_&`00`#IJ_O__Y"0D(U%Z%"-1?A0BT64@_@\?`6X/````%#_=:S_=:CH!PD`
+M`(/$%(O8@WWH`'0<BT64]]@[1?A]$H`[,'0-QX40_O__DA!``.LED/9%M`)T
+M#L>%$/[__Y000`#K$I"0]D6T"'01QX40_O__EA!``,=%]`$```"-A13^__^)
+M1>R+1?B)A03^___'19``````@[T$_O__`'X+@#L`=`:#?9`1?`2P,.L&_T60
+MB@-#BTWL_T7LB`'_C03^__^#O03^__\`?\OV1;00=0:#?90`?@Z+1>S_1>R*
+M#0P90`"("(M%E(/X/'P%N#P```")A03^__\Y191^.X!-M0&+190KA03^__^)
+M1=R)1<CK)O]%^(-]^`!^"X`[`'0&@WV0$7P$L##K!O]%D(H#0XM-[/]%[(@!
+M_XT$_O__>=*+W8'K[`$``.F5`P``D/9%M$!U"L=%E`8```#K#I"#?90`=0?'
+M190!````@T4,"(M%#%97C7VHC7#XI:5?7HM%K"4``/!_/0``\'\/A:4```#W
+M1:S__P\`=4"+1:PE````@#T```"`=0?'1;@!````@'WG1W4(N'000`#K!I"X
+M<!!``(O8C4,#B47LQT6(`0```.D+`P``D)"0BT6L)0```(`]````@'41QX40
+M_O__F!!``,=%]`$```"+1:S!X`R)1=3'1<0%````QT7`#P```,=%S`,```"`
+M?>='#X4\^___QT7\:!!``,=%L#@00`#I??G__Y"-1>A0C47X4(M%E(/X$7P%
+MN!$```!0_W6L_W6HZ+\&``"#Q!2+V-U%J-P=K!!``-_@FYYU!\=%^`$```"+
+M192)A03^___V1;00=4E3Z`L7``"#Q`2)A0S^__^+A03^__\YA0S^__]](XN%
+M#/[__XF%!/[__^L5D)"+A03^__^`?`/_,'4/_XT$_O__@[T$_O__`7WD@WWX
+M_7P(BT64.47X?A*+A03^__](B464Z;+Z__^0D)"+A03^__\K1?B)193I-?W_
+M_Y"0D(I%Y^L-D)"0@T4,!(M%#(I`_(B%%/[__XV=%/[__XO#0.LED(-%#`2+
+M10R+6/P+VW4%NYP00`#V1;1`=1-3Z%$6``"#Q`0#PXE%[.F4`0``B9T$_O__
+MBX4$_O___X4$_O__@#@`=`7_391YZHN%!/[__TCKTY"0D$[IMO3__Y"0Y!,`
+M``0>```$'@``[!,```0>``",'0``!!X```0>```$'@``!!X```04``#4$P``
+M!!X``-P3``#T$P``!!X``#@4``!"%```0A0``$(4``!"%```0A0``$(4``!"
+M%```0A0``$(4```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X```0>
+M```$'@``!!X``"P7```$'@``W!L```0>```$'@``!!X```0>```$'@``!!X`
+M``0>```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X```0>```,%@``
+M!!X```0>```$'@``!!X```0>```$'@``!!X```0>```$'@``!!X``)0=``"P
+M%```+!<``.`9``#<&P``MA,``+`4```$'@``!!X``*04```$'@``!!X``/P5
+M```$'@``!!X```0>``"P'0``!!X``,`5```$'@``!!X```P6``"#?8@`=%2#
+M?;@`=!S'A1#^__^D$$``QT7T`0```,=%N`````#K+9"0]D6T`G0.QX40_O__
+MIA!``.L2D)#V1;0(=!''A1#^__^H$$``QT7T`0```,=%B`````"+1>PKPXF%
+M#/[__P-%]`-%R`-%Q(E%D#E%\'\*`46@Z<4```"0D(M%\`%%H/9%M"!T+&;W
+M1;0``G4,@$VU`BM%D(E%C.L)BT7P*T60`46,BT7PB460Z8\```"0D)"0]D6T
+M!`^%@0```(M%\"M%D(F%!/[__^L;C4704%=J%&@($$``Z*?Q__^#Q!"#K03^
+M__\4@[T$_O__%'_<BX4$_O__`T70B84(_O__.T7@=AR-1=!05_^U!/[__V@(
+M$$``Z&OQ__^#Q!#K(9"0_[4$_O__:`@00`#_==#HV1(``(/$#(N%"/[__XE%
+MT(-]]`!T2(M%]`-%T(F%`/[__SM%X'8:C4704%?_=?3_M1#^___H&_'__X/$
+M$.L?D)#_=?3_M1#^____==#HBQ(``(/$#(N%`/[__XE%T(-]Q`!T18M%T(/`
+M!8F%!/[__SM%X'84C4704%=J!?]U_.C1\/__@\00ZQEJ!?]U_/]UT.A'$@``
+M@\0,BX4$_O__B470QT7$`````&;W1;0``G1_BT6,B84`_O__ZQR0C4704%=J
+M%&@@$$``Z(?P__^#Q!"#K0#^__\4@[T`_O__%'_<BX4`_O__`T70B84(_O__
+M.T7@=AR-1=!05_^U`/[__V@@$$``Z$OP__^#Q!#K(9"0_[4`_O__:"`00`#_
+M==#HN1$``(/$#(N%"/[__XE%T(.]#/[__P!^1XN%#/[__P-%T(F%!/[__SM%
+MX'88C4704%?_M0S^__]3Z/?O__^#Q!#K'9"0_[4,_O__4_]UT.AI$0``@\0,
+MBX4$_O__B4709O=%M(0!#X21\/__9O=%M``!#X2`````BT7<B84`_O__ZQV0
+MD(U%T%!7:A1H(!!``.B?[___@\00@ZT`_O__%(.]`/[__Q1_W(N%`/[__P-%
+MT(F%"/[__SM%X'8<C4704%?_M0#^__]H(!!``.AC[___@\00ZR&0D/^U`/[_
+M_V@@$$``_W70Z-$0``"#Q`R+A0C^__^)1=#V1;2`=$&+1:0#1=")A?S]__\[
+M1>!V%HU%T%!7_W6D_W6\Z!;O__^#Q!#K&Y#_=:3_=;S_==#HBA```(/$#(N%
+M_/W__XE%T/9%M`0/A+3O__^+19`Y1?`/CJCO__^+1?`K19")A0#^___K'9"0
+MC4704%=J%&@($$``Z+_N__^#Q!"#K0#^__\4@[T`_O__%'_<BX4`_O__`T70
+MB84(_O__.T7@=B"-1=!05_^U`/[__V@($$``Z(/N__^#Q!#I0^___Y"0D/^U
+M`/[__V@($$``_W70Z.T/``"#Q`R+A0C^__^)1=#I'.___U6+[&H`_W48_W44
+M_W40_W4,_W4(Z!\```#)PY!5B^QJ`?]U&/]U%/]U$/]U#/]U".@#````R<.0
+M58OL@^PH4U=6BW40BT4,B47TBT4(B47L"\!U3(-]]`!T"8%]]````(!U/8M%
+M&,<``````(M%%,<``0```(/^$7X%OA$```!6:C!HN!M``.AT#P``@\0,QH:X
+M&T```+BX&T``7E];R<.+10S!^!0E_P<``"W^`P``/0+\__]U)8U%\%#_=0S_
+M=0CH=@4``(/$#-T=N!%``+GEEP0`BT7PZQN0D)"+10S!^!0E_P<``"W^`P``
+MB47@N>67!`#WZ04;S<@=N4!"#P"9]_DM\P$``(E%\(-]'`!T`@/P"_9]`C/V
+MC5X!B\.#Z`F)1=P+P'X-NPD```"#^`E^`XE=W(O#*T7PB478_W48C47X4/]U
+MW/]UV(U%"%#HU0```(/$%(E%_(O[@<>\&T``5U#H#`L``(/$"(E%Z"O']]B)
+M1=@I7=B#?=@`?@Z+1=@!1?"#?1P`=`(#\(-]W`!^)(M%W`/'4/]U^.C4"@``
+M@\0(B478ZPG_3=B+1=C&`#`Y?=AW\HM%Z(E%W(/^$7X%OA$```"+1=P#QHOX
+MB]^`.S5_%8`[-74[BD/_L0)FF/;Y#[[$"\!T*\8#,#E=W'4;_TW<BT7<Q@`Q
+M_T7P@WT<`'0%@_X1=0Q/ZPF02_X#@#LY?]7&!P"+112+3?")"(M%W%Y?6\G#
+MD%6+[(/L.%-75HM%"(E%X(M%&(M-X(MQ!(O.P?D?@>$!````B0B+QL'X%"7_
+M!P``+?X#``")1?P]`OS__W4:C47\4(M%X/]P!/\PZ,4#``"#Q`R+1>#=&)N_
+M_S\``(M%X(LPB\;!X`,CQXE%[,'^"XO>(]_!_@Z!YG\```"+1>"+0`3!X`<#
+M\"/^P?X.@>;_'P``@<X`(```N!`````K10S!^`4+P`^$Y0```+A0`0``*T4,
+MP?@%:\`,!<010`")1>`/OT`&B47<BT7@#[]`!(E%V(M%X`^_0`*)1=2+1>`/
+MOT`(]^Z+3=0/KTWL`\&+3=@/K\L#P8M-W`^OSP/!P?@.BTW@#[\)#Z]-[`/!
+MBTW4#Z_+`\&+3=@/K\\#P8M-W`^OS@/!B47LBT7@#[\`B470BT7@#[]``HE%
+MS(M%X`^_0`3W[HM-S`^OSP/!BTW0#Z_+`\&+3>S!^0X#P8O8BT7,]^Z+3=`/
+MK\\#P8O+P?D.`\&+^(M%T/?NB\_!^0X#P8OPBT7@#[]`"@%%_.L3D)#!Y@X#
+M]XO[BUWLQT7L`````/9%#!\/A!\!``#'1<S_/P``BT7L)?\_``")1>B+PR7_
+M/P``B47LN_\_```CW[__/P``(_[!_@ZX$````"M%#"4?````:\`,!<P20`")
+M1<P/OT`&B470BT7,#[]`!(E%U(M%S`^_`(E%V(M%S`^_0`*)1=R+1<P/OT`(
+M]^Z+3=P/KTWL`\&+3=@/KTWH`\&+3=0/K\L#P8M-T`^OSP/!P?@.BTW8#Z]-
+M[`/!BTW<#Z_+`\&+3=0/K\\#P8M-T`^OS@/!B47LBT7,#[\`B47@BT7,#[]`
+M`HE%R(M%S`^_0`3W[HM-R`^OSP/!BTW@#Z_+`\&+3>S!^0X#P8O8BT7(]^Z+
+M3>`/K\\#P8O+P?D.`\&+^(M%X/?NB\_!^0X#P8OPBT7,#[]`"@%%_,=%R/\_
+M``"!Y_\_``"!X_\_``"!9>S_/P``BT7\@^@<B47("\!_'_?8B$7,B\:*3<S3
+M^(E%Y+@!````T^!((_"#1<@.ZR&+QXI-R-/@P?@.B];3X@/"B47DOO\_``#3
+M_B/WB_N+7>R#?1``?PF+1>1>7UO)PY"*3<C3YM/GT^/39>R+Q\'X#@/PB\/!
+M^`X#^(M%[,'X#@/8QT7(_S\``('F_S\``('G_S\``('C_S\``+@0````*T40
+M:\`,!<P20`")1<@/OP")1<R+1<@/OT`"B470]^^+3<P/K\L#P<'X#HM-T`^O
+MS@/!BTW,#Z_/`\&+^(M%S/?NB\_!^0X#P8OPBT7(#[]`"HE%[(/H'(E%R`O`
+M?Q6+112+UHM-R/?9T_J)$.E%____D)"+QR7_/P``BDW(T^#!^`Z+UM/B`\*+
+M312)`>DD____D%6+[-U%"-GEW^">=0N+11#'``````!=PV8E`$5T!F8]`$1U
+M%-GTV>C<P=[IV?39R=["V?W9R=W8BT40V?39R=L8V#5,%$``_P!=PY!5B^R#
+M[!!35U:+=12#?0P`=#R#?1``=#:*1@PD$CP"=1F#?@@`=!.+1@@Y1@1U&8,^
+M`'44]D8,1'4.5NC,`P``@\0$ZP60D)`SP`O`=`HSP%Y?6\G#D)"0#[Y&#8L$
+MA1080`")1?R+11#W;0R+^#E]$'?;.7T,=]:+1@0Y1@AR9_9&#`1U"('_``0`
+M`')95_]U"`^^1@U0Z'`)``"#Q`R+V#O?=`R`3@P@"\!_`C/`B]B+PRO2]W4,
+M7E];R<.0D)!6Z,("``"#Q`1`=1N+10P#QT@KTO=U#(O(BT40*\%>7UO)PY`!
+M70B+1?R+3@2)3?@KP8O8"]M^R(O'.\-R`HO#B]A3_W4(_W7XZ$8(``"#Q`PI
+M'@%>!`^^1@V+!(44&$``*T8$BPX+R7\",\D[P7T)5N@6!```@\0$*_MUI_9&
+M#$1T)_9&#`1U&(M&!"M&"%!J"O]V".C>!P``@\0,"\!T"5;H(0(``(/$!(M%
+M$%Y?6\G#D)!5B^R#[`16OE`40``Y-1`80`!W!%[)PY!6Z!(```"#Q`2#QA`Y
+M-1`80`!W[%[)PY!5B^R#[`175HMU"+______"_9T8_9&#(-T-?9&#`1T!#/`
+MZPE6Z%8```"#Q`2+^`^^1@U0Z*<#``"#Q`0+P'T/O______'!0@90``"````
+M]D8,"'02_W8(Z&L&``"#Q`3'1@@`````QD8,`,<&`````(M&"(E&!(O'7E_)
+MPY"0D%6+[%:+=0CV1@P"=2C'!@````#K-Y"0D/9&#`)T'8-^"`!T%XM&"#E&
+M!'8/5N@R`0``@\0$]D8,!'3=]D8,('0+N/____]>R<.0D)`SP%[)PY"0D%6+
+M[(/L!%:+=0R*1@PD4CQ"=3T/OD8-BTX$.0R%%!A```^&I0```(O!_T8$BDT(
+MB`B`^0H/A<X```!6Z-````"#Q`1`#X6^````Z:X```"0BD8,)!8\!G4SBD4(
+MB$7_QP8`````:@&-1?]0#[Y&#5#H'P<``(/$#(/X`0^$AP```(!.#"#K=I"0
+MD)"0BD8,)!(\`G49@WX(`'03BT8(.48$=1F#/@!U%/9&#$1U#E;HX````(/$
+M!.L%D)"0,\`+P'4[]D8,1`^%/O___U;H/@```(/$!/\.>1-6#[9%"%#H'/__
+M_X/$".L.D)"0BD4(BTX$_T8$B`'V1@P@=`NX_____U[)PY"0D`^V10A>R<.0
+M58OL@^P(4U=6BW4(BUX$BWX(B\<KV(E^!/9&#$1T!3/`ZP^0#[Y&#8L$A108
+M0``K1@B)!@^^1@V+!(44&$``*T8$BPX+R7\",\D[P7T)5NAP`0``@\0$"]M^
+M(5-7#[Y&#5#H'08``(/$##O#=`Z`3@P@N/____]>7UO)PS/`7E];R<.058OL
+M5HMU"(I&#"02/`)T&O9&#()U"KC_____7LG#D)"*1@PD[PP"B$8,@WX(`'4)
+M5NA*````@\0$BT8(.48$=3GV1@Q$=3,/OD8-BP2%%!A``"M&"(D&#[Y&#8L$
+MA1080``K1@2+#@O)?P(SR3O!?0E6Z,D```"#Q`0SP%[)PY!5B^R#[`135U:+
+M=0@/OEX-B_OV1@P$=!B-!/W@(T``B48(@\`(B02=%!A``.MND)"#_P)])PO_
+M=0>XV!]``.L%N-`;0`")1@@%``0```^^3@V)!(T4&$``ZT*0D&@(!```Z#(!
+M``"#Q`2)1@@+P'04@$X,"`^^1@V+3@B!P0`$``#K$I`/OD8-C0S]X"-``(E.
+M"(/!"(D,A1080`"+1@B)1@17Z&@```"#Q`0+P'0*]D8,!'4$@$X,0%Y?6\G#
+MD)!5B^R#[`135U:+=0@/OD8-BQR%%!A``(O#*T8$B_@+_WT*B5X$7E];R<.0
+MD#D^?@*)/EY?6\G#D+@&````F@`````'``^"B@0``#/`PY"0D%6+[(/L&*$(
+M&4``B47HC47L4&@!5```_W4(Z!T```"#Q`P+P'T.BT7HHP@90``SP,G#D)"X
+M`0```,G#D+@V````F@`````'``^"-@0``,.058OL@^P$4U=6BW4(BWT,B\:Y
+M"@```)GW^8O8L0KVZ8O.*L'VV`0P3X@'B_,+]G7?B\=>7UO)PY!5B^R#[!Q3
+M5U;'1>P`````@WT(`'0)@7T(^/O__W8),\!>7UO)PY"0@SW()4```'4VN,PE
+M0``,`:/()4``N,@E0``,`:/,)4``QP44&4``S"5``,<%$!E``,@E0`#'!1P9
+M0`#,)4``BT4(@\`'P>@"B]B+-1`90`#'1?``````]@8!=37K&I"0B340&4``
+MBP>)!CD]'!E``'4&B34<&4``BS[V!P%TX8T$GHE%Y#O'=P@[Q@^#3P$``(O^
+MBP8D_HOP._=WNCD]%!E```^%3O___X'^R"5```^%0O____]%\(-]\`%VF8LU
+M'!E``&H`Z)D"``"#Q`2+^*$4&4``@\`$.\=T/(V#_P```+D``0``F??YB47P
+MP67P"HO'N00```"9]_F)5>0+TG0ZB\$KPHE%[`/'B_B+1>P!1?#K)Y"0D*$4
+M&4``*P4<&4``P?@"*\/WV(E%\`4``0``P>@(B47PP67P"HM%\`/'.\</@J[^
+M__^+1?")1>@]`/S_?W8;:`#\_W_H!`(``(/$!$`/A(W^__^!;?``_/]__W7P
+MZ.L!``"#Q`1`=16+QRM%[%#H_P$``(/$!.EE_O__D)")/1P90`"A%!E``(DX
+MBT7H*T7LC40'_(D'H1090`"#P`0[QW0.H1090`"+R(L)@,D!B0B+!Z,4&4``
+MN<@E0`"`R0&)"(O^Z7'^__^0C02>HQ`90``[QW,0BP"C&!E``*$0&4``BPZ)
+M"*$0&4``#`&)!CDU'!E``'4*H1`90`"C'!E``(U&!%Y?6\G#D%6+[(/L!%:+
+M=0B#[@2)-1`90`"+!B3^B0:A%!E``#D&=0:)-1P90`!>R<.058OL@^P84U=6
+MBWT(]D?\`70)5^B\____@\0$@WT,`'4',\!>7UO)PXM'_"O'P?@"B47P_W4,
+MZ%']__^#Q`2+\`OV=`4Y=0AU!XO&7E];R<.+10R#P`/!Z`*)1>R+1?`Y1>QS
+M!HM%[(E%\(M%\,'@`E#_=0A6Z$(```"#Q`R+V#O?<\:+1>R-!(.)1>@[QW*Y
+M*\?!^`*+#1@90`")#(/KJ5>+3"00XQ&+?"0(BD0D#/*N=06+QTA?PS/`7\-7
+M5HM\)`R+="00BTPD%(O'B]'!Z0+SI8O*@>$#````\Z1>7\-7BWPD"(I$)`R+
+M3"00@_D4?ATE_P```(K@B]#!XA`+PHO1P>D"\ZN+RH'A`P```/.JBT0D"%_#
+MD(M4)`2%TG03`Q4@&4``4N@1````@\0$A<!U":$@&4``*T0D!,.X$0```)H`
+M````!P`/@CD```"+5"0$B14@&4``,\##5XM\)`@SP+G_____\JY!B\'WT%_#
+MD)"0N`0```":``````<`#X("````PY"C"!E``+C_____PY#HBP```.@^]___
+MBU0D!+@!````F@`````'``^"U/___\.0D)!5B^S_=0CH,0```(/$!$!U![C_
+M____R<,SP,G#58OL_W4(Z!4```"#Q`1`=0<SP,G#D)"0BT4(R<.0D)!5B^R#
+M/:090``@=0BX_____\G#D*&D&4``BTT(B0R%)!E``/\%I!E``#/`R<.0D)!5
+MB^R#[`16BS6D&4``3GD$7LG#D/\4M2090`!.>?9>R<.0D)```````````$AE
+M;&QO(%=O<FQD(2AE<G(I"@``2&5L;&\@5V]R;&0A*&]U="D*```O971C+V1E
+M9F%U;'0O;&%N9P```$Q!3D<]`````@```&@'0`!E;F=L:7-H7W5S+F%S8VEI
+M```````````````````````````````````````````\$```:`L```$```!T
+M!T```P```'P'0`!E;F=L:7-H7W5S+F%S8VEI````````````````````````
+M```````````````````(#@``/`X```(```"(!T``!````)`'0`!E;F=L:7-H
+M7W5S+F%S8VEI``````````````````````````````````````````"<#```
+M[`P```,```"8!T``!0```*`'0`!E;F=L:7-H7W5S+F%S8VEI````````````
+M``````````````````````````````!T"P``:`L```0```"L!T``!@```+0'
+M0`!E;F=L:7-H7W5S+F%S8VEI````````````````````````````````````
+M``````#@"P``'`P```4```#`!T``!P```,P'0`!E;F=L:7-H7W5S+F%S8VEI
+M``````````````````````````````````````````!$#```@`P```8```#8
+M!T``````````````````````````````````````````````````````````
+M````````````````````````````````````````96YG;&ES:%]U<RYA<V-I
+M:0````#_____3$-?0U194$4`````8W1Y<&4```!,0U].54U%4DE#``!N=6UE
+M<FEC`$Q#7U1)344`=&EM90````!,0U]#3TQ,051%``!C;VQL871E`$Q#7TU%
+M4U-!1T53`&UE<W-A9V5S`````$Q#7TU/3D5405)9`&-U<G)E;F-Y`````&QI
+M8F,Z('-E=&QO8V%L93H@````.B```$Q!3D<`````(&5N=FER;VYM96YT('9A
+M<FEA8FQE('-Y;G1A>"!E<G)O<@``=6YA8FQE('1O(&]P96X@`&YO(``@;&EN
+M92!I;B`````@<WEN=&%X(&5R<F]R(&EN(````&-A;FYO="!O<&5N(&QO8V%L
+M92!F:6QE`&-O<G)U<'0@;&]C86QE(&9I;&4`=6YK;F]W;B!E<G)O<@`*`$,`
+M``!,04Y'`````"]U<W(O;&EB+VQA;F<`+P`O````7P`N`"\``````0``````
+M````````````````````````````````````````````````````````````
+M```````````````````````!`0$"`0,!!`$%`08!!P$(`0D!"@$+`0P!#0$.
+M`0\!$`$1`1(!$P$4`14!%@$7`1@!&0$:`1L!'`$=`1X!'P$@`2$!(@$C`20!
+M)0$F`2<!*`$I`2H!*P$L`2T!+@$O`3`!,0$R`3,!-`$U`38!-P$X`3D!.@$[
+M`3P!/0$^`3\!0`%!`4(!0P%$`44!1@%'`4@!20%*`4L!3`%-`4X!3P%0`5$!
+M4@%3`50!50%6`5<!6`%9`5H!6P%<`5T!7@%?`6`!80%B`6,!9`%E`68!9P%H
+M`6D!:@%K`6P!;0%N`6\!<`%Q`7(!<P%T`74!=@%W`7@!>0%Z`7L!?`%]`7X!
+M?P&``8$!@@&#`80!A0&&`8<!B`&)`8H!BP&,`8T!C@&/`9`!D0&2`9,!E`&5
+M`98!EP&8`9D!F@&;`9P!G0&>`9\!H`&A`:(!HP&D`:4!I@&G`:@!J0&J`:L!
+MK`&M`:X!KP&P`;$!L@&S`;0!M0&V`;<!N`&Y`;H!NP&\`;T!O@&_`<`!P0'"
+M`<,!Q`'%`<8!QP'(`<D!R@'+`<P!S0'.`<\!T`'1`=(!TP'4`=4!U@'7`=@!
+MV0':`=L!W`'=`=X!WP'@`>$!X@'C`>0!Y0'F`><!Z`'I`>H!ZP'L`>T![@'O
+M`?`!\0'R`?,!]`'U`?8!]P'X`?D!^@'[`?P!_0'^`?\!````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````>0````````!N```````````````M)``````````````!
+M``H`$P`6`!D`*P`R`#D`00!+`%0`6P!D`&@`;`!P`'0`>`!\`(``B`"1`)<`
+MG0"A`*8`JP"R`+P`Q`#-`-8`V@#>`.(`Y@#J`.X`\@#V`/H`_@`"`0`E;2\E
+M9"\E>0`E2#HE33HE4P!!30!030`E82`E8B`E9"`E6"`E6B`E60!3=6YD87D`
+M36]N9&%Y`%1U97-D87D`5V5D;F5S9&%Y`%1H=7)S9&%Y`$9R:61A>0!3871U
+M<F1A>0!3=6X`36]N`%1U90!7960`5&AU`$9R:0!3870`2F%N=6%R>0!&96)R
+M=6%R>0!-87)C:`!!<')I;`!-87D`2G5N90!*=6QY`$%U9W5S=`!397!T96UB
+M97(`3V-T;V)E<@!.;W9E;6)E<@!$96-E;6)E<@!*86X`1F5B`$UA<@!!<'(`
+M36%Y`$IU;@!*=6P`075G`%-E<`!/8W0`3F]V`$1E8P``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````0(#!`4&!P@)"@L,#0X/$!$2$Q05
+M%A<8&1H;'!T>'R`A(B,D)28G*"DJ*RPM+B\P,3(S-#4V-S@Y.CL\/3X_0&%B
+M8V1E9F=H:6IK;&UN;W!Q<G-T=79W>'EZ6UQ=7E]@04)#1$5&1TA)2DM,34Y/
+M4%%24U155E=865I[?'U^?X"!@H.$A8:'B(F*BXR-CH^0D9*3E)66EYB9FIN<
+MG9Z?H*&BHZ2EIJ>HJ:JKK*VNK["QLK.TM;:WN+FZN[R]OK_`P<+#Q,7&Q\C)
+MRLO,S<[/T-'2T]35UM?8V=K;W-W>W^#AXN/DY>;GZ.GJZ^SM[N_P\?+S]/7V
+M]_CY^OO\_?[_````("`@("`@("`@("`@("`@("`@("``````,#`P,#`P,#`P
+M,#`P,#`P,#`P,#``````,#$R,S0U-C<X.4%"0T1%1@`````P,3(S-#4V-S@Y
+M86)C9&5F`````&YA;C!X````3D%.,%@```!I;F8`24Y&`"T`*P`@````,'@`
+M`#!8```M`"T`*P`@`"T`+0`K`"``+0```"AN=6QL*0``+0`K`"``````````
+M```````@("`@("`@("`H*"@H*"`@("`@("`@("`@("`@("`@($@0$!`0$!`0
+M$!`0$!`0$!"$A(2$A(2$A(2$$!`0$!`0$(&!@8&!@0$!`0$!`0$!`0$!`0$!
+M`0$!`0$!$!`0$!`0@H*"@H*"`@("`@("`@("`@("`@("`@("`@(0$!`0(```
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````PD#E!98/QAGU.B<$$VF#'^,*7Q0[!KP#/U5_'>\<O3/P!E(#*47?
+M$AD_DCG#%^@".'#Q'LDIJ@Y$-7T""ULE%/\;+PPM%1,"W4GY"`<,&1/E+ZD!
+MV7=B-2PV*39D$3X!/&'I`_X/31^@*M0`XDZU-5L!:R'Z#FH``$``````````
+M````V&?5(RDJ*3,U'97_/U1$/2D]TS.A$BO_6D1>`.L_IRJ*#<'^Z&[/""4C
+MR3E8$%;^^ED2'-L>02>N">S]_TAN,*$ZF`<_`X+]<G:=)U$BG2+4'A?]&&!D
+M*!LK,C3_'*W\]DW,&1L4BA6I.T/\@'X2%SPZ<01&*-C[H68B%#<:GB:"/F[[
+M#4<W.2`X`````#4`KW$F-0`-`````#$`\UH>!``D`````"X`PDCE'``0````
+M`"L`:G2B%````````"<`(5WH-@```````"0`@4H@'P```````"$`-7<`)0``
+M`````!T`7E\`!````````!H`2TP`$````````!<`$GH``````````!,`J&$`
+M`````````!``($X```````````T``'T```````````D``&0```````````8`
+M`%````````````,``$``````````````9F:9&68FF1EH)OS_ZU%'(84KK@<@
+M!?G_B4'2#6H\OA^T'?;_VVCK(A`'RC+K%?+_XE.(-=HX"`^)$>__&T.@-WLM
+MTQC5&NS_7VN:,BLOA30@'NC_YE7B#B,,G0.`/N7_N$3H"[4)2RF:"^+_\VW9
+M'^\UJQM<'][_]5?A/UD>50E]/]O_7D:!&7H+$2'^)=C_EW!H`ET2'"B6"=3_
+M$EJ&&THHL#FK!]'_#DB>+]4Y62&)+,[_````0`````````````````$`````
+M```````````````"`0```````/`C0`#P(T``!@(`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````````!`8
+M0````````````/@C0```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````"XL````````````````````````
+MT"5`````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`$`H(RD@8W)T,2YS(#$N."`X.2\P-2\S,"``0"@C*2!S>7,N:3,X-B`Q+C@@
+M.#DO,#$O,38@````0"@C*2!L:6UI=',N:"`R+C,@.3`O,#$O,3<@`$`H(RD@
+M8W)T;BYS(#$N-2`X."\Q,2\Q-"``0"@C*2!S>7,N:3,X-B`Q+C@@.#DO,#$O
+M,38@````+F9I;&4````.````_O\``&<!8W)T,2YS````````````````+G1E
+M>'0```#4`````0````,!5`````<`````````````````+F1A=&$````,!4``
+M`@````,!"```````````````````````+F)S<P````"H&4```P````,!````
+M````````````````````+F-O;6UE;G0`````!`````,!.```````````````
+M````````+FEN:70```#0`````0````,!````````````````````````7VES
+M=&%R=`#0`````0````,`;G5L;'-T<@`,!4```@````,`+F9I;&4````9````
+M_O\``&<!:&5L+F,`````````````````+G1E>'0````H`0```0````,!.```
+M``8`````````````````+F1A=&$````4!4```@````,!````````````````
+M````````+F1A=&$````4!4```@````,!)P``````````````````````+F)S
+M<P````"H&4```P````,!````````````````````````1$=23U50```4!4``
+M`@````,`+F9I;&4````L````_O\``&<!<V5T;&]C86QE+F,`````````+G1E
+M>'0```!@`0```0````,!%`H``)@`````````````````+F1A=&$````\!4``
+M`@````,!+`(``!@`````````````````+F1A=&$```!H!T```@````,!6`$`
+M````````````````````+F)S<P````"H&4```P````,!#P(`````````````
+M````````1$=23U50```\!4```@````,```````0```",`P```0````,`8V]M
+M<&QA:6Y$`@```0````,```````\```!H"P```0````,`<&%R<V4```!@`0``
+M`0````,``````!H```!`!P```0````,`9&5F<F4```!H!@```0````,`9&5F
+M;W`````D!@```0````,`97AP86YD```(`@```0````,`+F9I;&4````W````
+M_O\``&<!8V]L;&%T92YC````````````+G1E>'0```!T"P```0````,!;```
+M``,`````````````````+F1A=&$```#`"$```@````,!Q`,`````````````
+M````````+F1A=&$```"$#$```@````,!````````````````````````+F)S
+M<P````"X&T```P````,!````````````````````````1$=23U50``#`"$``
+M`@````,`+F9I;&4```!"````_O\``&<!;65S<V%G92YC````````````+G1E
+M>'0```#@"P```0````,!9`````8`````````````````+F1A=&$```"$#$``
+M`@````,!$```````````````````````+F1A=&$```"4#$```@````,!`0``
+M````````````````````+F)S<P````"X&T```P````,!````````````````
+M````````1$=23U50``"$#$```@````,`+F9I;&4```!-````_O\``&<!8W5R
+M<F5N8WDN8P``````````+G1E>'0```!$#````0````,!6`````4`````````
+M````````+F1A=&$```"8#$```@````,!"```````````````````````+F1A
+M=&$```"@#$```@````,!`0``````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````1$=23U50``"8#$```@````,`+F9I
+M;&4```!8````_O\``&<!=&EM95\N8P``````````````+G1E>'0```"<#```
+M`0````,!;`$``#8`````````````````+F1A=&$```"D#$```@````,!5@(`
+M````````````````````+F1A=&$```#\#D```@````,!`0``````````````
+M````````+F)S<P````"X&T```P````,!````````````````````````1$=2
+M3U50``"D#$```@````,`+F9I;&4```!C````_O\``&<!;G5M97)I8RYC````
+M````````+G1E>'0````(#@```0````,!:`````<`````````````````+F1A
+M=&$`````#T```@````,!`@``````````````````````+F1A=&$````$#T``
+M`@````,!````````````````````````+F)S<P````"X&T```P````,!````
+M````````````````````1$=23U50````#T```@````,`+F9I;&4```!N````
+M_O\``&<!9G!R:6YT9BYC````````````+G1E>'0```!P#@```0````,!3```
+M``$`````````````````+F1A=&$````$#T```@````,!````````````````
+M````````+F1A=&$````$#T```@````,!````````````````````````+F)S
+M<P````"X&T```P````,!````````````````````````1$=23U50```$#T``
+M`@````,`+F9I;&4```!X````_O\``&<!<W1R8VAR+G,`````````````+G1E
+M>'0```"\#@```0````,!.```````````````````````+F1A=&$````$#T``
+M`@````,!````````````````````````+F)S<P````"X&T```P````,!````
+M````````````````````+F-O;6UE;G2X&T```P````,!'```````````````
+M````````+F9I;&4```""````_O\``&<!<W1R8VUP+G,`````````````+G1E
+M>'0```#T#@```0````,!8```````````````````````+F1A=&$````$#T``
+M`@````,!````````````````````````+F)S<P````"X&T```P````,!````
+M````````````````````+F-O;6UE;G2X&T```P````,!'```````````````
+M````````+F9I;&4```",````_O\``&<!<W1R;F-P>2YS````````````+G1E
+M>'0```!4#P```0````,!/```````````````````````+F1A=&$````$#T``
+M`@````,!````````````````````````+F)S<P````"X&T```P````,!````
+M````````````````````+F-O;6UE;G2X&T```P````,!(```````````````
+M````````+F9I;&4```"8````_O\``&<!9V5T96YV+F,`````````````+G1E
+M>'0```"0#P```0````,!=`````(`````````````````+F1A=&$````$#T``
+M`@````,!````````````````````````+F1A=&$````$#T```@````,!````
+M````````````````````+F)S<P````"X&T```P````,!````````````````
+M````````1$=23U50```$#T```@````,`;G9M871C:`#0#P```0````,`+F9I
+M;&4```"B````_O\``&<!<W1R;F-A="YS````````````+G1E>'0````$$```
+M`0````,!.```````````````````````+F1A=&$````$#T```@````,!````
+M````````````````````+F)S<P````"X&T```P````,!````````````````
+M````````+F-O;6UE;G2X&T```P````,!(```````````````````````+F9I
+M;&4```"M````_O\``&<!;&-?8W1Y<&4N8P``````````+G1E>'0````\$```
+M`0````,!A`````8`````````````````+F1A=&$````$#T```@````,!`0$`
+M````````````````````+F1A=&$````($$```@````,!````````````````
+M````````+F)S<P````"X&T```P````,!````````````````````````1$=2
+M3U50```$#T```@````,`+F9I;&4```"W````_O\``&<!<W1R;F-M<"YS````
+M````````+G1E>'0```#`$````0````,!4```````````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!(```
+M````````````````````+F9I;&4```#!````_O\``&<!;'-E96LN<P``````
+M````````+G1E>'0````0$0```0````,!%`````$`````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!.```
+M````````````````````+F9I;&4```#+````_O\``&<!;W!E;BYS````````
+M````````+G1E>'0````D$0```0````,!%`````$`````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!.```
+M````````````````````+F9I;&4```#5````_O\``&<!<F5A9"YS````````
+M````````+G1E>'0````X$0```0````,!%`````$`````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!.```
+M````````````````````+F9I;&4```#?````_O\``&<!<W1R8V%T+G,`````
+M````````+G1E>'0```!,$0```0````,!,```````````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!'```
+M````````````````````+F9I;&4```#I````_O\``&<!<W1R8W!Y+G,`````
+M````````+G1E>'0```!\$0```0````,!-```````````````````````+F1A
+M=&$````($$```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````+F-O;6UE;G2X&T```P````,!'```
+M````````````````````+F9I;&4```#V````_O\``&<!9&]P<FYT+F,`````
+M````````+G1E>'0```"P$0```0````,!]!$``*\`````````````````+F1A
+M=&$````($$```@````,!<```````````````````````+F1A=&$```!X$$``
+M`@````,!/```````````````````````+F)S<P````"X&T```P````,!````
+M````````````````````1$=23U50```($$```@````,``````"8```"P$0``
+M`0````,`7V1O=W)I=&7X$0```0````,`+F9I;&4````!`0``_O\``&<!8W1Y
+M<&4N8P``````````````+G1E>'0```"D(P```0````,!````````````````
+M````````+F1A=&$```"T$$```@````,!`0$`````````````````````+F1A
+M=&$```"X$4```@````,!````````````````````````+F)S<P````"X&T``
+M`P````,!````````````````````````1$=23U50``"T$$```@````,`+F9I
+M;&4````-`0``_O\``&<!96-V="YC````````````````+G1E>'0```"D(P``
+M`0````,!*`(```P`````````````````+F1A=&$```"X$4```@````,!````
+M````````````````````+F1A=&$```"X$4```@````,!````````````````
+M````````+F)S<P````"X&T```P````,!&```````````````````````1$=2
+M3U50``"X$4```@````,`8W9T``````#<(P```0````,`+F9I;&4````8`0``
+M_O\``&<!7V9A8RYC````````````````+G1E>'0```#,)0```0````,!````
+M````````````````````+F1A=&$```"X$4```@````,!"```````````````
+M````````+F1A=&$```#`$4```@````,!````````````````````````+F)S
+M<P````#0&T```P````,!````````````````````````1$=23U50``"X$4``
+M`@````,`+F9I;&4````C`0``_O\``&<!9'1O<"YC````````````````+G1E
+M>'0```#,)0```0````,!%`0```0`````````````````+F1A=&$```#`$4``
+M`@````,!````````````````````````+F1A=&$```#`$4```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````1$=23U50``#`$4```@````,`+F9I;&4````M`0``_O\``&<!9G!R
+M96%L+G,`````````````+G1E>'0```#@*0```0````,!````````````````
+M````````+F1A=&$```#`$4```@````,!!```````````````````````+F)S
+M<P````#0&T```P````,!````````````````````````+F-O;6UE;G30&T``
+M`P````,!(```````````````````````+F9I;&4```!``0``_O\``&<!8FEG
+M;&ET<&]W+G,`````````+G1E>'0```#@*0```0````,!````````````````
+M````````+F1A=&$```#$$4```@````,!B`(`````````````````````+F)S
+M<P````#0&T```P````,!````````````````````````+F-O;6UE;G30&T``
+M`P````,!(```````````````````````+G1E>'0```#@*0```0````,!3```
+M``$`````````````````+F1A=&$```!,%$```@````,!!```````````````
+M````````+F)S<P````#0&T```P````,!````````````````````````+F-O
+M;6UE;G30&T```P````,!'```````````````````````8V]N='=O``!,%$``
+M`@````,`+F9I;&4```!+`0``_O\``&<!9G=R:71E+F,`````````````+G1E
+M>'0````L*@```0````,!=`$```D`````````````````+F1A=&$```!0%$``
+M`@````,!````````````````````````+F1A=&$```!0%$```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````1$=23U50``!0%$```@````,`+F9I;&4```!6`0``_O\``&<!9FQS
+M8G5F+F,`````````````+G1E>'0```"@*P```0````,!$`0``"$`````````
+M````````+F1A=&$```!0%$```@````,!````````````````````````+F1A
+M=&$```!0%$```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````1$=23U50``!0%$```@````,`+F9I
+M;&4```!@`0``_O\``&<!8VQO<V4N<P``````````````+G1E>'0```"P+P``
+M`0````,!&`````$`````````````````+F1A=&$```!0%$```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````+F-O;6UE;G30&T```P````,!.```````````````````````+F9I
+M;&4```!K`0``_O\``&<!9&%T82YC````````````````+G1E>'0```#(+P``
+M`0````,!````````````````````````+F1A=&$```!0%$```@````,!N`0`
+M``0`````````````````+F1A=&$````(&4```@````,!````````````````
+M````````+F)S<P````#0&T```P````,!````````````````````````1$=2
+M3U50``!0%$```@````,`+F9I;&4```!V`0``_O\``&<!:7-A='1Y+F,`````
+M````````+G1E>'0```#(+P```0````,!/`````,`````````````````+F1A
+M=&$````(&4```@````,!````````````````````````+F1A=&$````(&4``
+M`@````,!````````````````````````+F)S<P````#0&T```P````,!````
+M````````````````````1$=23U50```(&4```@````,`+F9I;&4```"``0``
+M_O\``&<!:3,X-E]D871A+G,`````````+G1E>'0````$,````0````,!````
+M````````````````````+F1A=&$````(&4```@````,!!```````````````
+M````````+F)S<P````#0&T```P````,!````````````````````````+F-O
+M;6UE;G30&T```P````,!(```````````````````````+F9I;&4```"*`0``
+M_O\``&<!:6]C=&PN<P``````````````+G1E>'0````$,````0````,!%```
+M``$`````````````````+F1A=&$````,&4```@````,!````````````````
+M````````+F)S<P````#0&T```P````,!````````````````````````+F-O
+M;6UE;G30&T```P````,!.```````````````````````+F9I;&4```"5`0``
+M_O\``&<!;&-T7VYU;2YC````````````+G1E>'0````8,````0````,!````
+M````````````````````+F1A=&$````,&4```@````,!`@``````````````
+M````````+F1A=&$````0&4```@````,!````````````````````````+F)S
+M<P````#0&T```P````,!````````````````````````1$=23U50```,&4``
+M`@````,`+F9I;&4```"@`0``_O\``&<!;'1O<W1R+F,`````````````+G1E
+M>'0````8,````0````,!.```````````````````````+F1A=&$````0&4``
+M`@````,!````````````````````````+F1A=&$````0&4```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````1$=23U50```0&4```@````,`+F9I;&4```"K`0``_O\``&<!;6%L
+M;&]C+F,`````````````+G1E>'0```!0,````0````,!%`,``"T`````````
+M````````+F1A=&$````0&4```@````,!$```````````````````````+F1A
+M=&$````@&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````1$=23U50```0&4```@````,`+F9I
+M;&4```"U`0``_O\``&<!;65M8VAR+G,`````````````+G1E>'0```!D,P``
+M`0````,!'```````````````````````+F1A=&$````@&4```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````+F-O;6UE;G30&T```P````,!'```````````````````````+F9I
+M;&4```"_`0``_O\``&<!;65M8W!Y+G,`````````````+G1E>'0```"`,P``
+M`0````,!)```````````````````````+F1A=&$````@&4```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````+F-O;6UE;G30&T```P````,!'```````````````````````+F9I
+M;&4```#)`0``_O\``&<!;65M<V5T+G,`````````````+G1E>'0```"D,P``
+M`0````,!.```````````````````````+F1A=&$````@&4```@````,!````
+M````````````````````+F)S<P````#0&T```P````,!````````````````
+M````````+F-O;6UE;G30&T```P````,!'```````````````````````+F9I
+M;&4```#4`0``_O\``&<!<V)R:RYS````````````````+G1E>'0```#<,P``
+M`0````,!1`````4`````````````````+F1A=&$````@&4```@````,!!```
+M``$`````````````````+F)S<P````#0&T```P````,!````````````````
+M````````+F-O;6UE;G30&T```P````,!.```````````````````````;F0`
+M```````@&4```@````,`+F9I;&4```#>`0``_O\``&<!<W1R;&5N+G,`````
+M````````+G1E>'0````@-````0````,!&```````````````````````+F1A
+M=&$````D&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````+F-O;6UE;G30&T```P````,!'```
+M````````````````````+F9I;&4```#H`0``_O\``&<!=W)I=&4N<P``````
+M````````+G1E>'0````X-````0````,!%`````$`````````````````+F1A
+M=&$````D&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````+F-O;6UE;G30&T```P````,!.```
+M````````````````````+F9I;&4```#R`0``_O\``&<!8V5R<F]R+G,`````
+M````````+G1E>'0```!,-````0````,!#`````$`````````````````+F1A
+M=&$````D&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````+F-O;6UE;G30&T```P````,!'```
+M````````````````````+F9I;&4```#\`0``_O\``&<!8W5E>&ET+G,`````
+M````````+G1E>'0```!8-````0````,!)`````,`````````````````+F1A
+M=&$````D&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````+F-O;6UE;G30&T```P````,!.```
+M````````````````````+F9I;&4````2`@``_O\``&<!871E>&ET+F,`````
+M````````+G1E>'0```!\-````0````,!D`````@`````````````````+F1A
+M=&$````D&4```@````,!A```````````````````````+F1A=&$```"H&4``
+M`@````,!````````````````````````+F)S<P````#0&T```P````,!````
+M````````````````````1$=23U50```D&4```@````,`97AC;6X```"X-```
+M`0````,`+G1E>'0````,-0```0````,!````````````````````````+F1A
+M=&$```"H&4```@````,!````````````````````````+F)S<P````#0&T``
+M`P````,!````````````````````````+F-O;6UE;G14````!`````,!.```
+M````````````````````+FEN:70```#0`````0````,!!```````````````
+M````````7W-T87)T``#4`````0````(`7VUC;W5N=``G`0```0````(`96YV
+M:7)O;@`-!4```@````(``````#`````\"0```0````(`97)R;F\````(&4``
+M`@````(`;6%I;@`````H`0```0````(`97AI=`````!8-````0````(`9G!R
+M:6YT9@!P#@```0````(`7VEO8@````!0%$```@````(`<W1R;F-M<`#`$```
+M`0````(`;FQ?:6YI=`!`"P```0````(`<W1R;&5N```@-````0````(`;65M
+M<V5T``"D,P```0````(`<W1R;F-P>0!4#P```0````(``````#H````\#@``
+M`0````(``````$<````(#@```0````(``````%,```!T"P```0````(`````
+M`%\```"`#````0````(``````&T```#L#````0````(`;'-E96L````0$0``
+M`0````(``````'<```!$#````0````(``````(0`````"P```0````(`````
+M`)`````<#````0````(`7V-T>7!E``"T$$```@````(``````)X```#@"P``
+M`0````(`7VQC7W1I;66<#````0````(`9V5T96YV``"0#P```0````(`8VQO
+M<V4```"P+P```0````(`<W1R8V%T``!,$0```0````(`<F5A9``````X$0``
+M`0````(`<W1R8VAR``"\#@```0````(`<W1R8VUP``#T#@```0````(`=W)I
+M=&4````X-````0````(`<W1R;F-A=``$$````0````(`;W!E;@`````D$0``
+M`0````(``````*L````\$````0````(`<W1R8W!Y``!\$0```0````(`````
+M`+4```#`"$```@````(`;65M8W!Y``"`,P```0````(``````,(```"$#$``
+M`@````(``````-````"8#$```@````(``````-X```"D#$```@````(`````
+M`.@````,&4```@````(`7V1O<')N=`!@$@```0````(`7V-U8VQC```$#T``
+M`@````(`7V-E<G)O<@!,-````0````(`7V)U9G-Y;F-X+P```0````(`7WAF
+M;'-B=6:T+0```0````(`9G=R:71E```L*@```0````(`96-V=`````"D(P``
+M`0````(`;65M8VAR``!D,P```0````(`9F-V=`````#`(P```0````(`````
+M`/4````4&$```@````(`7V9L='5S963`$4```@````(`9G)E>'````#@*0``
+M`0````(`7V1T;W````#,)0```0````(`7V9A8P````"X$4```@````(`7VQT
+M;W-T<@`8,````0````(`7V)I9W!O=P#$$4```@````(`7VQI='!O=P#,$D``
+M`@````(`7W=R=&-H:P`X+@```0````(`7W-O8G5F``#0&T```P````(`9F-L
+M;W-E``#0*P```0````(`7V-L96%N=7"@*P```0````(`7V9L<V)U9@"D+```
+M`0````(`;6%L;&]C``!0,````0````(`7W-I8G5F``#8'T```P````(`7V9I
+M;F1B=6:X+@```0````(`9F9L=7-H``!0+````0````(`:7-A='1Y``#(+P``
+M`0````(`7W-M8G5F``#@(T```P````(`9G)E90````"8,@```0````(`7VQA
+M<W1B=680&$```@````(`:6]C=&P````$,````0````(`7V%L;&]C<P#()4``
+M`P````(`<V)R:P````#<,P```0````(`8G)K```````!-````0````(`<F5A
+M;&QO8P#$,@```0````(`96YD``````#0)4``__\```(````````!``#H-```
+M`0````(`;VYE>&ET``"8-````0````(`871E>&ET``!\-````0````(`971E
+M>'0````,-0``__\```(`961A=&$```"H&4``__\```(`#P$``&UA:V5L;V-A
+M;&4`7VQC<5]D=6UM>0!S971C871E9V]R>0!?;&]W9&EG:70`<V5T;&]C86QE
+M`%]L8W%?;G5M97)I8P!?;&-?;G5M97)I8P!?;&-?8V]L;&%T90!?;&-Q7V-U
+M<G)E;F-Y`%]L8W%?=&EM90!?;&-?8W5R<F5N8WD`;FQ?;&%N9VEN9F\`7VQC
+M<5]M97-S86=E<P!?;&-?;65S<V%G97,`7VQC7V-T>7!E`%]L8W1?8V]L;&%T
+M90!?;&-T7VUE<W-A9V5S`%]L8W1?8W5R<F5N8WD`7VQC=%]T:6UE`%]L8W1?
+B;G5M97)I8P!?8G5F96YD=&%B`%]D;U]E>&ET7V9U;F-S`%]T
+`
+end
diff --git a/share/examples/ipfw/change_rules.sh b/share/examples/ipfw/change_rules.sh
new file mode 100755
index 000000000000..ee6f0c85914f
--- /dev/null
+++ b/share/examples/ipfw/change_rules.sh
@@ -0,0 +1,123 @@
+#!/bin/sh
+#
+# Copyright (c) 2000 Alexandre Peixoto
+# 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$
+
+# Change ipfw(8) rules with safety guarantees for remote operation
+#
+# Invoke this script to edit ${firewall_script}. It will call ${EDITOR},
+# or vi(1) if the environment variable is not set, for you to edit
+# ${firewall_script}, asks for confirmation and then run
+# ${firewall_script}. You can then examine the output of ipfw list and
+# confirm whether you want the new version or not.
+#
+# If no answer is received in 30 seconds, the previous
+# ${firewall_script} is run, restoring the old rules (this assumes ipfw
+# flush is present in it).
+#
+# If the new rules are confirmed, they'll replace ${firewall_script} and
+# the previous ones will be copied to ${firewall_script}.{date}. A mail
+# will also be sent to root with the unified diffs of the rule change.
+#
+# Non-approved rules are kept in ${firewall_script}.new, and you are
+# offered the option of changing them instead of the present rules when
+# you call this script.
+#
+# It is suggested improving this script by using some version control
+# software.
+
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
+fi
+
+EDITOR=${EDITOR:-/usr/bin/vi}
+
+get_yes_no() {
+ while true
+ do
+ echo -n "$1 (Y/N) ? "
+ read -t 30 a
+ if [ $? != 0 ]; then
+ a="No";
+ return;
+ fi
+ case $a in
+ [Yy]) a="Yes";
+ return;;
+ [Nn]) a="No";
+ return;;
+ *);;
+ esac
+ done
+}
+
+restore_rules() {
+ nohup sh ${firewall_script} >/dev/null 2>&1
+ exit
+}
+
+if [ -f /etc/${firewall_script}.new ]; then
+ get_yes_no "A new rules file already exists, do you want to use it"
+ [ $a = 'No' ] && cp ${firewall_script} /etc/${firewall_script}.new
+else
+ cp ${firewall_script} /etc/${firewall_script}.new
+fi
+
+trap restore_rules SIGHUP
+
+${EDITOR} /etc/${firewall_script}.new
+
+get_yes_no "Do you want to install the new rules"
+
+[ $a = 'No' ] && exit
+
+cat <<!
+The rules will be changed now. If the message 'Type y to keep the new
+rules' do not appear on the screen or the y key is not pressed in 30
+seconds, the former rules will be restored.
+The TCP/IP connections might be broken during the change. If so, restore
+the ssh/telnet connection being used.
+!
+
+nohup sh /etc/${firewall_script}.new > /tmp/${firewall_script}.out 2>&1;
+sleep 2;
+get_yes_no "Would you like to see the resulting new rules"
+[ $a = 'Yes' ] && ${EDITOR} /tmp/${firewall_script}.out
+get_yes_no "Type y to keep the new rules"
+[ $a != 'Yes' ] && restore_rules
+
+DATE=`date "+%Y%m%d%H%M"`
+cp ${firewall_script} /etc/${firewall_script}.$DATE
+mv /etc/${firewall_script}.new ${firewall_script}
+cat <<!
+The new rules are now default. The previous rules have been preserved in
+the file /etc/${firewall_script}.$DATE
+!
+diff -F "^# .*[A-Za-z]" -u /etc/${firewall_script}.$DATE ${firewall_script} | mail -s "`hostname` Firewall rule change" root
+
diff --git a/share/examples/isdn/FAQ b/share/examples/isdn/FAQ
new file mode 100644
index 000000000000..dcc6e67d2c40
--- /dev/null
+++ b/share/examples/isdn/FAQ
@@ -0,0 +1,1079 @@
+-------------------------------------------------------------------------------
+
+ ISDN4BSD Frequently Asked Questions
+ ===================================
+
+ last edit-date: [Wed Nov 1 15:08:03 2000]
+
+ $FreeBSD$
+
+--------------------------------------------------------------------------------
+
+Contents:
+=========
+
+ 1. How do I get started with synchronous PPP (sPPP) ?
+ 2. does anyone know a software that can receive/send fax over ISDN ?
+ 3. does i4b callback only work with setups where the remote end
+ returns a busy ?
+ 4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
+ 5. I want to use -r with isdnd but it does not work
+ 6. How do I configure and run the answering machine ?
+ 7. Teles S0/16.3 ... unknown ?
+ 8. How do i integrate a new lowlevel driver into i4b ?
+ 9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
+ 10. Incoming alert - what does it mean ?
+ 11. How do i change irq's on my teles 16.3 card ?
+ 12. NL: i'm getting CAUSE 100 or CAUSE 101 when dialling out
+ 14. I'm using sPPP. I can connect to my ISP but no TCP/IP services work. HELP!
+ 15. i4b 0.80.00: problems with AVM Fritz PCI
+ 16. How do i setup logfile rotation for isdnd ?
+ 17. How do i setup dialin from Windows NT RAS to i4b ?
+ 18. How can I convert my old .g711a files to the new format?
+ 19. I have lots of old .g711a files to convert what can I do?
+ 20. How can I convert the .al files to Sun/NeXT .au/.snd/.vox files?
+ 21. Help, isdn4bsd 0.82 fails to probe my Elsa PCC-16!
+ 22. How do i enable and configure userland PPP with i4b ?
+ 23. What is the procedure to install a new i4b on FreeBSD 3.x ?
+ 24. Why do i get "ifconfig: ioctl (SIOCAIFADDR): file exists" ?
+ 25. How to properly operate isdnd's fullscreen output in a 132x60 vty
+ 26. NetBSD: i see isic0 while booting but I cannot access my Fritz!Card
+ 27. i4b_pci_attach: pci_map_port 1 failed! What does this mean ?
+ 28. What is: i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
+ 29. Why does isdnd take up 95% CPU time ?
+
+
+1. How do I get started with synchronous PPP (sPPP) ?
+================================================================================
+
+ Of course you first have to have sPPP interfaces in your kernel. If
+ you installed everything using FreeBSD/install.sh then the correct
+ entries should have been automatically made in /sys/conf/files for you.
+ For NetBSD it isn't quite as simple since NetBSD/install-netbsd.sh does
+ not do it for you.
+
+ Then all you need to do is put an entry like this:
+
+ device "i4bisppp" 4
+
+ into your kernel configuration file (if it's not already there) and
+ generate and boot the new kernel. The above line will give you 4
+ sPPP interfaces - isp0 to isp3.
+
+ Then just modify /etc/isdn/isdnd.rc (see the example in etc-isdn/isdnd.rc)
+ to suit your needs (telephone numbers, etc).
+
+ The next step is to read the ispppcontrol man page and then to look at
+ etc/rc.isdn-PPP. ispppcontrol is a very important component in getting
+ sPPP working correctly and the ispppcontrol lines in your /etc/rc.isdn
+ must be correct.
+
+ In my experience there are two things which can cause problems:
+
+ 1) the authproto line has to agree with what your ISP desires. In
+ general I've found that it's best to have something like this -
+
+ ispppcontrol <interface> myauthproto={pap,chap} myauthname=<AuthName>
+ myauthsecret=<AuthSecret> hisauthproto=none callin
+
+ The "hisauthproto=none" is usually needed because the ISP does not want
+ to authorise himself to you; he expects you to authorize yourself to him !
+ I once forgot to set hisauthproto and it took me quite a while to figure
+ out why I couldn't connect.
+
+ 2) the IP address at your ISP's end must be correct.
+
+ How can I find out (1) whether my ISP wants pap or chap and (2) what his
+ IP address is ? you might ask. Generally, your ISP should have provide
+ this information to you. But, if he didn't, or you've mislayed the
+ documentation (as I did), there's still hope.
+
+ Fortunately, J"org Wunsch implemented the sPPP kernel code so that it
+ provides all the information required if the interface is configured
+ with the debug flag set (e.g. ``ifconfig isp0 debug''). It's just a
+ little cryptic.
+
+ By the way, I suggest turning the debug flag on until you have things
+ working and then turning it off. The debug output is rather voluminous
+ and could fill up your /var partition, otherwise.
+
+ The debug output will appear on the console and also be logged to
+ /var/log/messages (under FreeBSD) unless you changed /etc/syslog.conf.
+
+ A. How to figure out the authproto
+ ----------------------------------
+
+ Here is an example where I configured isp0 with myauthproto=pap, my
+ ISP wanted chap, but was willing to accept pap:
+
+ /kernel: isp0: lcp up(starting)
+ /kernel: isp0: lcp output <conf-req id=0x7 len=10 5-6-34-e4-30-5a>
+ /kernel: isp0: lcp input(req-sent): <conf-req id=0x1 len=30 0-4-0-0-1-4-5-
+ f4-3-5-c2-23-5-11-4-5-f4-13-9-3-0-c0-7b-6e-fe-b5>
+ ^^^^^
+ |___ c223 is chap, it's what the ISP wants to use
+
+ /kernel: isp0: lcp parse opts: 0x0 [rej] mru auth-proto 0x11 [rej]
+ x13 [rej] send conf-rej (I didn't agree)
+ /kernel: isp0: lcp output <conf-rej id=0x1 len=21 0-4-0-0-11-4-5-f4-13-9-3-
+ 0-c0-7b-6e-fe-b5>
+ /kernel: isp0: lcp input(req-sent): <conf-ack id=0x7 len=10 5-6-34-e4-30-5a>
+ /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x2 len=13 1-4-5-f4-3-5-
+ c2-23-5>
+ /kernel: isp0: lcp parse opts: mru auth-proto
+ /kernel: isp0: lcp parse opt values: mru 1524 auth-proto [mine 0x0 !=
+ his chap] send conf-nak (we want to use pap, not chap)
+ /kernel: isp0: lcp output <conf-nak id=0x2 len=9 3-5-c0-23-5>
+ ^^^^^
+ |___ c023 is pap
+
+ /kernel: isp0: lcp input(ack-rcvd): <conf-req id=0x3 len=12 1-4-5-f4-3-4-
+ c0-23> (he agrees to use pap)
+ /kernel: isp0: lcp parse opts: mru auth-proto
+ /kernel: isp0: lcp parse opt values: mru 1524 auth-proto send conf-ack
+ /kernel: isp0: lcp output <conf-ack id=0x3 len=12 1-4-5-f4-3-4-c0-23>
+ he agrees to use pap ___|^^^^^
+
+ so, if you have problems in the lcp phase, check which authentication method
+ your ISP wants to use. Usually chap is prefered, but pap will be accepted.
+
+ B. How to figure out the ISP's IP address
+ -----------------------------------------
+
+ ======================================================================
+
+ UPDATE NOTE (February 8, 1999):
+
+ Jan Riedinger writes:
+ ---------------------
+ >I further think Gary should mention
+ >in the FAQ in the section "B. How to figure out the ISP's IP address
+ >that it isn't normaly necessary to do it because of the auto
+ >address negotiation.
+
+ Gary answers:
+ -------------
+ I think you're right. I wrote that stuff before the support for
+ negotiation of the IPS's address was added to if_spppsubr.c.
+
+ ======================================================================
+
+
+ I also intentionally configured the interface with the wrong address for
+ my ISP, like this:
+
+ ifconfig isp0 0.0.0.0 10.0.0.1 debug link1
+
+ this means that I want the ISP to assign me an address (the 0.0.0.0) and
+ that I expect him to use 10.0.0.1 (which is wrong). Here's the result:
+ (note that these addresses have been changed by me)
+
+ /kernel: isp0: phase network
+ /kernel: isp0: ipcp open(initial)
+ /kernel: isp0: ipcp up(starting)
+ /kernel: isp0: ipcp output <conf-req id=0x9 len=10 3-6-0-0-0-0>
+ /kernel: isp0: ipcp input(req-sent): <conf-req id=0x1 len=16 2-6-0-2d-f-1-
+ 3-6-c-22-38-4e>
+ /kernel: isp0: ipcp parse opts: compression [rej] address send conf-rej
+ /kernel: isp0: ipcp output <conf-rej id=0x1 len=10 2-6-0-2d-f-1>
+ /kernel: isp0: ipcp input(req-sent): <conf-nak id=0x9 len=10 3-6-c-22-38-4e>
+ /kernel: isp0: ipcp nak opts: address [wantaddr 12.34.56.78] [agree]
+ ^^^^^
+ |___ he assigns me this
+
+ /kernel: isp0: ipcp output <conf-req id=0xa len=10 3-6-c3-b4-eb-63>
+ /kernel: isp0: ipcp input(req-sent): <conf-req id=0x2 len=10 3-6-62-4c-36-20>
+ /kernel: isp0: ipcp parse opts: address
+ /kernel: isp0: ipcp parse opt values: address 98.76.54.32 [not agreed]
+ ^^^^^
+ |_this is *his* address
+ send conf-nak
+ /kernel: isp0: ipcp output <conf-nak id=0x2 len=10 3-6-a-0-0-1>
+ I expect a different address and (incorrectly) reject what he wants.
+ I tell him that I expect 10.0.0.1. After this the connection fails.
+
+ Anyway, I now know that his address is really 98.76.54.32 and can use
+ it to correctly configure the interface.
+
+ With the correct IP address I shoulkd now be able to connect with no
+ problems. As stated above, the authorization protocol is normally not
+ so important since most ISPs are willing to use pap, although chap is
+ more secure. Generally, I'd try chap first and only switch to pap if
+ the ISP doesn't accept it.
+
+ (by Gary Jennejohn, Home - garyj@muc.de, Work - garyj@fkr.dec.com)
+
+
+
+2. does anyone know a software that can receive/send fax over ISDN ?
+================================================================================
+
+ > Hi,
+ >
+ > does anyone know a software that can receive/send fax over ISDN? I am
+ > using a Fritz!Card, which can handle group 3 (analogous) fax, but I
+ > can't find any hint in the i4b software that this is supported in any
+ > way.
+
+This is probably not implemented.
+
+Implementing G3 fax in ISDN would mean simulating an analog modem
+on the digital link. This means having to generate the right waveforms
+for the modulated data, and receive analog data from the other end
+which you had to run FFT analysis on and then interpret.
+
+In addition you have to do this in realtime, to be able to deal with
+the timing involved in the fax protocol, something neither
+FreeBSD or Linux is good at in their native form..
+
+A third point is that a software simulated faxmodem usually does not
+work well. I tested Teles software faxmodem in Win-95 towards an Ericsson V34
+HE modem, and was able to send faxes from the ISDN card at 4800 baud
+only, and receive faxes ad 9600 baud only(!) (And it is not the
+Ericsson modems fault, it works flawlessly towards other fax machines.)
+
+My point is that the best thing to do is to use an ordinary faxmodem
+to handle faxes with Hylafax of mgetty+sendfax or efax, or you may use
+a combined ISDN card with an analog part.
+
+Of course, if you are crazy enough, you may try to implement a
+software simulated modem in e.g. RT-linux, or a similar realtime
+extension for FreeBSD.
+
+Best regards,
+Nils Ulltveit-Moe (etonumo@eto.ericsson.se)
+
+
+
+3. does i4b callback only work with setups where the remote end returns a busy ?
+================================================================================
+
+> Is my assumption correct, does i4b callback only work with setups where
+> the remote end returns a busy on the dialin?
+
+Yes - otherwise you'll pay for the connection, at least here in Germany.
+
+Most routers support two kind of callbacks - the one that i4b supports
+means: the called system rejects (so no charge for this connection), waits
+a configurable time and the calls back. Information on who has called and
+who is to be called back relies on the ISDN calling party number information
+and stuff statically configured in the routers (or isnd's) configuration.
+
+The other type of callback (not supported by i4b right now) means: the
+called system accepts the connection and starts ppp negotiation. During this
+the ppp's aggree to do a callback. Information on who called in and who is
+going to be called back is subject to the authentication/negotiation already
+done by the two ppp's. Then ppp closes down, the connection is disconnected
+and the called system calls back.
+
+I've never seen someone actually use the second type due to its obvious
+disadvantages. It may be usefull if you travel, call in from an unknown
+number and want to be called back at that number.
+
+Martin Husemann <martin@rumolt.teuto.de>
+
+
+4. trouble with kernel options IPFIREWALL and IPDIVERT and natd
+================================================================================
+
+ NOTICE: section obsolete since IP address changes are handled properly now!
+ ===========================================================================
+
+This section
+> Trying to build a router/gateway between my privat Ethernet and
+> the Internet (via my ISP), I have problems with I4B or NAT (I think:).
+>
+> The 2.2.5-R kernel with options IPFIREWALL and IPDIVERT works fine
+> with ISDN4BSD 0.50-alpha and firewall rule 'pass all from any to any'.
+> However, when I add 'divert natd all from any to any via isp0'
+> and start natd, name server lookups to the ISP's NS don't work.
+>
+> Also, ping and nslookup fails from any other internal host.
+
+I had exactly the same problems. natd doesn't seem to get a message if
+the IP address of the interface changes (after successful dialout).
+I have to manually send a HUP signal to natd. I do this via the following
+(ugly?!) hack:
+
+I added the following two lines to the system section of isdnd.rc:
+regexpr = "call active" # look for matches in log messages
+regprog = hup_natd # execute program whan match is found
+
+The small script "hup_natd", located in /etc/isdn, looks like:
+#!/bin/sh
+pid=`cat /var/run/natd.pid`
+kill -HUP $pid
+sleep 3
+kill -HUP $pid
+sleep 5
+kill -HUP $pid
+
+It looks ugly, but at least for me it works. The two sleeps are necessary
+since I have to wait for ppp negotiation to complete (I don't get a message
+from isdnd for that). If I'm lucky I have my connection after 3 seconds,
+but 8 seconds should suffice for worst case (the first HUP without a sleep
+sometimes even succeeded on an slow 486/33 with 8MB RAM, more HUPs don't hurt).
+
+I'm really interested in some more elegant method.
+
+Daniel (rock@cs.uni-sb.de)
+
+
+Arve Ronning replied:
+=====================
+
+> I had exactly the same problems. natd doesn't seem to get a message if
+> the IP address of the interface changes (after successful dialout).
+
+Well, it (natd) _does_ pick up the dynamic address supplied for isp0.
+Try 'natd -verbose ...' and you'll see it. Otherwise I agree, there is
+certainly something missing in natd's functionality, or maybe sppp
+does'nt
+supply what it's supposed to ??
+
+> I have to manually send a HUP signal to natd. I do this via the following
+> (ugly?!) hack:
+
+YES...super; strange but correct. It works when I send natd a -HUP after
+sppp is up. Thanx for the tip. However, natd must be -HUPed _every_ time
+sppp has been down (idle timeout) and comes back up!
+
+> I'm really interested in some more elegant method.
+
+So am I, let's see what may come out of the discussion on the list.
+
+
+
+5. I want to use -r with isdnd but it does not work
+================================================================================
+
+> > Use isdnd in fullscreen mode.
+>
+> I tried that already, but got an error when I start isdnd that way:
+>
+> /usr/local/bin/isdnd -d 0xf9 -f -r /dev/ttyv1 -t cons25
+>
+> root is logged in on device /dev/ttyv1, the message in /var/log/messages looks like:
+>
+> "May 22 11:52:28 asterix isdnd[4160]: ERR ERROR, cannot setup tty as controlling terminal: Operation not permitted"
+>
+> How can I give this device permission ?
+
+
+In case you want to use switch "-r" noone else _must_ use the tty you redirect
+to, you have to remove the getty from the virtual terminal in /etc/ttys and
+restart the init process.
+
+
+6. How do I configure and run the answering machine (under FreeBSD 2.2.x) ?
+================================================================================
+
+The answering machine will be activated, when isdnd executes the program
+that has been named in "/etc/isdn/isdnd.rc" in the section "telephone
+answering" at entry "answerprog = ". If the program is executed
+without a pathname, the answer program is expected in "/etc/isdn".
+Examples of such programs can be found in "/etc/isdn/samples". They
+are named:
+
+ "answer" answers only, no recording
+ "record" answers, and records messages
+ "tell" the number of the calling person is told,
+ no recording.
+ "tell-record" calling number as answer, message is recorded
+ "isdntel.sh" answers and records messages; by using the
+ program "isdntel", one has the control over
+ the recorded messages in the directory
+ "/var/isdn". Look at "man isdntel" and
+ "man isdntelctl".
+
+These programs have to be altered to suit your needs. Unfortunately there
+is no program with which you can record your answer message. This is not
+really bad, because you only have to alter the above mentioned program
+"record" a bit (comment out the "if ... fi" statements for the beep
+and msg messages). You have to create the directory "/var/isdn" first in
+order to record messages. They will be stored in this location then.
+
+Stefan Herrmann <stefan@asterix.webaffairs.net>
+
+
+7. Teles S0/16.3 ... unknown ?
+================================================================================
+Hi,
+
+I have just purchased a Teles S0/16.3 card.
+But it's not what i4b is looking for .... I mean, it's a different card.
+
+The docs (and sources)of i4b talks about a Telws S0/16.3 card with 3
+address: d80 etc.
+
+This one (is not PnP) has jumpers for 0x180 0x280 0x380.
+
+It has the SIemens Chips numbered PSB 21525 N (HSCX TE V2.1) and PSB
+2186N V1.1 (ISAC-S TE).
+
+I undestand that the 16.3c is not supported, but over this board is
+written "TELES.S0/16.3 Revision 1.3"
+
+Can anybody tell me what is this card ???
+
+answer:
+-------
+
+It's not a different card. The jumpers are documented to select
+IO-address 0x180, 0x280 or 0x380 in some TELES manuals.
+But in fact they select the addresses 0xd80, 0xe80 or 0xf80.
+
+Wolfgang
+
+
+And an additional note from Poul-Henning Kamp:
+----------------------------------------------
+There is an intricate story behind this, in short some ISA cards
+only decode the first 10 address bits (0x3ff), which over the years
+has resulted in a mutation the "de-facto-spec" such that addressbits
+10-15 can be used by the card for selecting various stuff. This
+is extensively used on obscure cards with massive IO needs, sound,
+IEEE488 and ISDN cards often belong in this category.
+
+
+
+8. How do i integrate a new lowlevel driver into i4b ?
+================================================================================
+
+1) Request a flag value from me
+2) add an entry for the card into FreeBSD/CONFIG
+3) add driver filename to FreeBSD/files.i386.cat
+4) add entry for the card to FreeBSD/options.i386.cat
+5) add support to print type of card to diehl/diehlctl/main.c
+6) add support to print type of card to isdnd/support.c, name_of_controller()
+7) place your file as named in 3) into directory layer1
+8) add the flag value and function prototypes to layer1/i4b_l1.h
+9) add support for NetBSD to layer1/isa_isic.c
+10) add support for attach/probe to layer1/i4b_isic.c
+11) add card type to machine/i4b_ioctl.h and update CARD_TYPEP_MAX
+12) add an entry to the man page man/isic.4
+
+Produce diffs (please use context diffs, flag "-c" for diff) and send them in.
+
+
+9. Why it always says "no Space in TX FIFO - State F4 awaiting" ?
+================================================================================
+
+as I wrote about two weeks ago I had massive problems concerning this
+"no space in TX FIFO"-thing,
+
+/kernel: i4b-L1-ph_data_req: No Space in TX FIFO, state = F4 Awaiting Signal
+
+Even though I used a correctly recognized Teles S0/16.3 nonpnp isdncard,
+nothing worked, errormsgs were flooding the console until I rebooted the box.
+
+I decided to play around in the BIOS-settings, I first just set them all
+to default, which didn't work, and then changed lots of things - unfortunately
+I can't remember them. After about hundreds of trial 'n errors I gave up.
+
+A few days ago I just made another attempt, booted the box and to my surprise
+it all worked without the smallest problem, great data rates :)
+
+I tried hard to found what the something special was I changed in the BIOS
+settings, but I just couldnt get isdnd back to its stupid behaviour it
+showed all the time before, but I would recommend everybody who has this
+kind of problem to look into his BIOS.
+
+ (from Meike Aulbach, strange@stoned.rhein-main.de)
+
+
+i4b now works for me, I had a USB-device interfering on IRQ 9,
+which was supposed to be only for my Creatix Card.
+(NetBSD 1.3, Creatix)
+
+Strange enough, my DOS s0-test worked, are they just polling the card?
+
+Even when the testsoftware under DOS is working, don't be shure, that
+your hw-setup is correct for xxx(x)BSD. Triplecheck all your IRQ and
+enable and disable PNP to triple-verify. Even unconfigured devices can
+block your card. .....
+
+And that took me more than 2 months to discover :-((((
+
+ (from Andreas Lohrum, andreas.lohrum@consol.de)
+
+
+when i changed the mainboard of a box that ran i4b alright, i forgot to
+set 'used by isa' in the pnp-bios-settings for the irq of my teles
+isdn-card. because of that some pci-card got the interrupt that the
+isdn-card should have gotten.
+i then also got this error: 'No space in TX FIFO'.
+
+The reason occurred to my rather quick, but i would think, that this would
+be a nice hint in a FAQ :)
+
+ (from Heiko Schaefer, hschaefer@fto.de)
+
+
+after my huge amount of problems, Meike's hint (changing the
+ISA/PNP-settings in the BIOS) finally fixed things.
+I have only tried out this stuff with my Creatix-card, I'll check
+out the PNP-stuff with my Sedlbauer-card soon too though.
+
+ (from Harold Gutch, logix@foobar.franken.de)
+
+
+10. Incoming alert - what does it mean ?
+================================================================================
+
+In the log on vty6 (isdnd full screen log) I'm seeing
+
+16.07.98 11:42:35 CHD 00001 rwth rate 90 sec/unit (rate)
+16.07.98 11:42:35 CHD 00001 rwth dialing from 4191236 to 441291234
+16.07.98 11:42:35 CHD 00001 rwth outgoing call proceeding (ctl 0, ch 0)
+16.07.98 11:42:35 CHD 00001 rwth incoming alert <<<<<<<<<<<<<<<
+16.07.98 11:42:35 CHD 00001 rwth outgoing call active (ctl 0, ch 0)
+
+What does this 'incoming alert' mean?
+
+
+It means that it is "ringing" at the remote end.
+
+
+11. How do i change irq's on my teles 16.3 card ?
+================================================================================
+
+Question:
+
+So how do you change irq's on your teles 16.3 card (under FBSD or DOS,
+I don't have and don't want to have Windows running on that computer) ?
+
+Answer:
+
+The irq is configured into the card each time the driver under whatever
+OS you currently boot initializes the card. Thus, change the irq for the
+isic driver in your kernel config file to one of the supported (!) irqs
+for this card (hint: read "man isic") which is currently unused in your
+machine and generate a new kernel.
+
+
+12. NL: i'm getting CAUSE 100 or CAUSE 101 when dialling out
+================================================================================
+
+This one seems to be specific for the Netherlands. (-hm)
+
+Question:
+
+I'm trying to get i4b running on my new FreeBSD 2.2.8 system. The kernel
+compiles smootly and everything is looking fine until it's time to dial.
+I get the following error:
+
+Feb 10 20:31:00 goofy isdnd[498]: CHD 00018 I4BPPP outgoing call disconnected (remote)
+Feb 10 20:31:00 goofy isdnd[498]: CHD 00018 I4BPPP cause 101: Message not compatible with call state (Q.850)
+Feb 10 20:31:00 goofy isdnd[498]: ERR set_channel_idle: controller [0], invalid channel [-1]!
+Feb 10 20:31:00 goofy isdnd[498]: ERR msg_disconnect_ind: set_channel_idle failed!
+
+The remote site is a Cisco 4000 type router. I used debug to take a view at
+the ISDN events on the router but according to that the call doesn't arrive
+over there.
+
+Same hardware has worked fine with FreeBSD 2.2.6/i4b 0.63.
+
+Who knows what's wrong?
+
+
+Answer:
+
+This sounds very much like your local phone number or remote phone number
+is configured wrongly... in the Netherlands you need to specify the number
+EXCLUDING the city code... so if you live in Utrecht and your number is
+0301234567 you specify 1234567.
+
+I have seen this in several locations in the Netherlands for years, not
+just with i4b, but also with differentt isdn equipment.. why? guess it
+simply depends on which operator defines your line or what exchange it
+is connected to... :P
+What I found is that what solved this with other isdn hardware/software,
+also solves it for i4b.. ie.. make sure the local phone number is
+specified, and is specified without the city code.
+The numbering plan should be 'unknown'
+
+Anyway, it would be nice if the Dutch ptt (they are called KPN btw)
+would tell us why this happens... they havent been able to tell me in the
+past so I guess I give up on that, but if everyone finds out whats exactly
+happening here I'd be interested to know... :)
+
+List of number configurations that I have found to almost always work in
+the Netherlands:
+
+1. Local phone number:
+ usually your prefered msn without city code works here.
+ (ie, 1234567 if you would like to use 0201234567 for outgoing calls)
+ on some locations leaving it blank or defining it with the city code,
+ but without the leading 0 works as well here.
+
+2. remote phone number:
+ When this is a 'local' call, don't specify city code.
+ For calling parties in other cities you of cource have to use the city
+ code... in general you can say that KPN only accepts the shortest
+ possible notation where it would still be clear who you want to call.
+
+3. numbers for incomming call recognition:
+ KPN always specifies incoming caller ids with city code, but without
+ leading 0. so 0201234567 will be displayed as 201234567
+
+
+Hope this helps.
+Bart
+
+ (from Bart van Leeuwen bart@ixori.demon.nl)
+
+
+14. I'm using sPPP. I can connect to my ISP but no TCP/IP services work. HELP!
+==============================================================================
+
+This is probably because you have the RFC1323 - TCP Extensions for High
+Performance - support turned on and your ISP (or some router in the loop)
+is discarding the extensions.
+
+This can easily be checked by doing ``sysctl net.inet.tcp.rfc1323''. If the
+result is 1, then the RFC1323 support is turned on.
+
+Turn this off by doing ``sysctl -w net.inet.tcp.rfc1323=0'' (This is
+called "net.inet.tcp.do_rfc1323" under BSD/OS).
+
+For FreeBSD make sure that tcp_extension="NO" is in your /etc/rc.conf
+(/etc/defaults/rc.conf with more recent versions of FreeBSD) and
+/etc/rc.conf.local (in -STABLE and upcoming 3.2)
+
+This may be different for NetBSD, OpenBSD and BSD/OS.
+
+Martin Husemann writes:
+-----------------------
+This does apply for NetBSD too (and probably OpenBSD, since it's been
+in NetBSD for a long time). The sysctl name is even compatible ;-) We don't
+have a coresponding rc.conf entry, I do it in /etc/netstart.local.
+
+I would suggest to set this to 0 on all machines routed over ISDN (not only
+the router), as this "high speed options" in fact do slow down an ISDN link
+by making VJ "compression" impossible - as far as I understood it. So there
+should be a more general advice in the FAQ, not only "turn it off if it
+doesn't work for you".
+
+I've only seen the problems against old linux kernels (about two years ago),
+are there still machines out there that have such a broken TCP/IP stack? We
+should start to blame the vendors...
+
+ (by Gary Jennejohn, garyj@muc.de, with additions from
+ Harold Gutch <logix@foobar.franken.de> and
+ Martin Husemann <martin@rumolt.teuto.de>).
+
+
+15. i4b 0.80.00: problems with AVM Fritz PCI
+==============================================================================
+
+Question:
+=========
+
+The system is FreeBSD 3.1-RELEASE with i4b-00.80.00-beta-070599 [...]
+
+I'm trying to compile a Kernel with support for my AVM Fritz!PCI card,
+however, when compiling, it fails with the following error
+
+sh ../../conf/newvers.sh GENERIC -DAVM_A1_PCI
+cc -c -O -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit -Wnested-
+externs
+-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -
+Wuninitializ
+ed -Wformat -Wunused -fformat-extensions -ansi -nostdinc -I- -I. -I../..
+-I/us
+r/include -DAVM_A1_PCI -DKERNEL -DVM_STACK -include opt_global.h -elf
+vers.c
+loading kernel
+i4b_isic_pci.o: In function `i4b_pci_attach':
+i4b_isic_pci.o(.text+0x141): undefined reference to `avma1pp_map_int'
+i4b_isic_pci.o: In function `isic_pciattach':
+i4b_isic_pci.o(.text+0x196): undefined reference to `isic_attach_avma1pp'
+*** Error code 1
+
+
+Solution:
+=========
+
+> I have added
+>
+> i4b/layer1/i4b_avm_fritz_pci.c optional isic device-driver
+>
+> and am recomiling at the moment, but given that it's a 486, it could take
+> some time :-)
+
+The problem appears to be that overinstall.sh does not update files.i386
+and options.i386, and that AVM_A1_PCI was added after 3.1-RELEASE and
+hence is not defined.
+
+Manually editing these files (using install.sh as a guide) allows the
+kernel to compile cleanly.
+
+
+(from Rich Wood, rich@dynamite.org)
+
+
+16. How do i setup logfile rotation for isdnd ?
+==============================================================================
+
+For syslog-based logging:
+-------------------------
+
+man newsyslog (on FreeBSD)
+
+You just add a line to /etc/newsyslog.conf:
+/var/log/isdnd.log 664 7 100 * Z
+and you are all done...
+
+(From: Andreas Haakh <ah@alvman.RoBIN.de>)
+
+
+For logfile-based logging:
+--------------------------
+
+I suggest using newsyslog(8). Adding a line like:
+
+/var/log/isdn.log 664 100 * 168 Z /var/run/isdnd.pid
+
+to /etc/newsyslog.conf will do the job (here: once a week, for the next
+100 weeks) with compression of the old log.
+
+This is the standard method for other daemons (apache, etc.).
+
+(From: Udo Schweigert <ust@cert.siemens.de>)
+
+
+17. How do i setup dialin from Windows NT RAS to i4b ?
+==============================================================================
+
+> > I need to be able to dial in from a WNT box, equipped with TELES h/w and
+> > s/w, to a FreeBSD machine. I don't have a clue what RAS is using.
+> > I've tried
+> > ipr and isp. The latter seems to work but is hanging on authentication. Is
+> > there somebody who has done this before and is able to give me some hints?
+>
+> RAS is using PPP, so you should be able to get the isp interface working. I
+> haven't done it so I can't give you concrete hints, but setting the isp
+> interface to debug mode and posting the log (with passwords cut out or with
+> test passwords) could help us to debug your setup.
+
+I have several customers using sPPP do dial in from their W95/W98/WNT.
+
+If You use FreeBSD_3.2-BETA with i4b-071 or older then you have to apply
+the attached patch to /sys/net/if_spppsubr.c (patch -p0 <patchfile).
+
+You need to configure isp0. See the manpages or the supplied templates in
+the i4b-distribution. I would suggest to supply an ip-number for the
+isp0-interface and force the clients to accept this value.
+Don't forget to supply the relevant parameters to sppconfig_isp0 in
+/etc/rc.conf...
+
+On WNT you have to install the CAPI-2.0-drivers and Dialin-network.
+
+Create a new entry and check the following box:
+* Connection to internet
+select the appropriate ISDN-device for dialout, insert a phone-number
+and that's it.
+You are asked for username & password. Supply the values You did define in
+spppconfig_isp0 and dial...
+
+Patch for i4b version 0.71 or older:
+------------------------------------
+
+*** /sys/net/if_spppsubr.c Sun Dec 27 22:30:44 1998
+--- /sys/net/if_spppsubr.c.orig Sat May 8 10:54:14 1999
+***************
+*** 2056,2062 ****
+ if (debug)
+ addlog("[non-empty] ");
+ /* suggest a zero one */
+! p[2] = p[3] = p[4] = p[5] = 0;
+ break;
+
+ case LCP_OPT_MRU:
+--- 2056,2062 ----
+ if (debug)
+ addlog("[non-empty] ");
+ /* suggest a zero one */
+! /* p[2] = p[3] = p[4] = p[5] = 0; */
+ break;
+
+ case LCP_OPT_MRU:
+***************
+*** 2668,2678 ****
+ addlog("%s [not agreed] ",
+ sppp_dotted_quad(desiredaddr));
+
+- p[2] = hisaddr >> 24;
+- p[3] = hisaddr >> 16;
+- p[4] = hisaddr >> 8;
+- p[5] = hisaddr;
+ }
+ break;
+ }
+ /* Add the option to nak'ed list. */
+--- 2668,2678 ----
+ addlog("%s [not agreed] ",
+ sppp_dotted_quad(desiredaddr));
+
+ }
++ p[2] = hisaddr >> 24;
++ p[3] = hisaddr >> 16;
++ p[4] = hisaddr >> 8;
++ p[5] = hisaddr;
+ break;
+ }
+ /* Add the option to nak'ed list. */
+
+(From: Andreas Haakh <ah@alvman.RoBIN.de>)
+
+
+18. How can I convert my old .g711a files to the new format?
+================================================================================
+I got the best results with:
+cat /some/path/dwhello.g711a | alaw2ulaw | g711conv -u > /tmp/newhello.al
+
+(From: David Wetzel <dave@turbocat.de>)
+
+
+19. I have lots of old .g711a files to convert what can I do?
+================================================================================
+
+Create a shell script (/tmp/csnd.sh) with this contents:
+#!/bin/sh
+
+OLDFILES=`ls *.g711a`
+#echo $OLDFILES
+
+for THEFILE in $OLDFILES
+do
+(
+ echo -n "converting $THEFILE..."
+ BASENAME=`basename $THEFILE .g711a`
+
+ /bin/cat $THEFILE | alaw2ulaw | g711conv -u > $BASENAME.al
+ echo "done"
+)
+
+done
+###### END
+
+then type "chmod a+x /tmp/csnd.sh" in you shell.
+cd /usr/local/lib/isdn (or where your old sounds live)
+/tmp/csnd.sh
+Optional:
+rm *.g711a (you should know what you do here :-)
+
+(From: David Wetzel <dave@turbocat.de>)
+
+
+20. How can I convert the .al files to Sun/NeXT .au/.snd/.vox files?
+================================================================================
+
+/bin/cat /some/path/old.al | sox -t raw -A -b -r 8000 - -t .au /some/path/new.snd
+
+
+(From: David Wetzel <dave@turbocat.de>)
+
+
+21. Help, isdn4bsd 0.82 fails to probe my Elsa PCC-16!
+================================================================================
+
+>Isdn4bsd 0.82 fails to probe my Elsa PCC-16. It just can't find isic0.
+
+flags have changed from 19 to 20.
+
+
+(From: "Frank J. Beckmann" <frank@vogon.agala.harz.de>)
+
+
+22. How do i enable and configure userland PPP with i4b ?
+================================================================================
+
+NOTE: this is the procedure used as of end of July 1999, it may change in
+ the near future!
+
+Get the current ppp sources from
+
+ http://www.freebsd.org/~brian
+
+unpack them and apply the patch
+
+ ftp://ftp6.uk.freebsd.org/pub/PPPoISDN/pppcommit.patch
+
+to the ppp directory (where you just unpacked the above mentioned ppp source).
+Make and install the result.
+
+Have a look at the user-ppp directory and the end of etc-isdn/isdnd.rc.sample
+for ppp and i4b sample configurations to get things up and running.
+
+More information to ppp setup can be found at
+
+ http://www.Awfulhak.org/ppp.html
+ http://www.freebsd.org/handbook/ppp-and-slip.html
+ http://www.freebsd.org/FAQ/userppp.html
+
+and in the directory "user-ppp" of the isdn4bsd distribution.
+
+
+23. What is the procedure to install a new i4b on FreeBSD 3.x ?
+================================================================================
+
+cd /usr/src
+mkdir i4b
+cd i4b
+tar xvzf i4b-00.82.00-beta-140799.tar.gz
+cd FreeBSD
+sh overuninstall.sh
+sh overinstall.sh
+cd ..
+make cleandir
+make depend
+make
+make install
+cd /sys/i386/conf
+config <YOURKERNEL>
+cd ../../compile/<YOURKERNEL>
+make clean
+make depend
+make
+make install
+shutdown -r now
+
+
+(From: Luke Roberts <luke@roberts.nl>)
+
+
+24. Why do i get "ifconfig: ioctl (SIOCAIFADDR): file exists" ?
+================================================================================
+
+Ich ?berlege gerade, aber ich glaube, ich bekomme sie auch. Das
+Problem existiert schon seit geraumer Zeit immer beim Konfigurieren
+eines point-to-point Interfaces (SLIP, PPP).
+
+Das `file exists' ist ein Misnomer, es r?hrt daher, da? der
+Routingcode die errno's in einer leicht ver?nderten Weise benutzt, so
+da? nicht neue errno's daf?r erfunden werden mu?ten. Lies es als
+`route exists'. (Und falls Du im Zusammenhang mit Routing mal ein `no
+such process' siehst, lies es als `no such route'.)
+
+Die Meldung ist harmlos. Sonst h?tte ich mir schon l?ngst mal die
+M?he gemacht, mich durch den ganzen Routing-Code zu hangeln und zu
+sehen, warum das passiert.
+
+(From Joerg Wunsch <j@uriah.heep.sax.de>)
+
+
+25. How to properly operate isdnd's fullscreen output in a 132x60 vty
+================================================================================
+
+Q: I'm using allscreens_flags="132x60" in /etc/rc.conf but the vty gets
+ switched after isdnd is started, so isdnd didn't know about the new
+ dimensions of the screen.
+
+A: This one's easy:
+ In /etc/rc.isdn change
+ isdn_ttype=cons25
+ to
+ isdn_ttype=cons60l1wide
+ /usr/sbin/vidcontrol VESA_132x60 < ${isdn_fsdev}
+
+ The new VESA modes don't have termcap entries yet, so you'll
+ have to add one yourself to define 132x60:
+
+ cons60l1wide|cons60-iso8859-1:\
+ :co#132:tc=cons60l1:
+
+
+(From: "H. Eckert" <ripley@nostromo.in-berlin.de>)
+
+
+26. NetBSD: i see isic0 while booting but I cannot access my Fritz!Card
+================================================================================
+
+I got his:
+isic0 at pci0 dev 8 function 0: Fritz!Card
+isic0: ISAC 2085 Version A1/A2 or 2086/2186 Version 1.1 (IOM-2)
+isic0: interrupting at irq 11
+(...)
+i4b: ISDN call control device attached
+i4btrc: 2 ISDN trace device(s) attached
+i4bctl: ISDN system control port attached
+i4brbch: 4 raw B channel access device(s) attached
+i4btel: 2 ISDN telephony interface device(s) attached
+i4bipr: 2 IP over raw HDLC ISDN device(s) attached (VJ header compression)
+i4bisppp: 2 ISDN SyncPPP device(s) attached
+
+But I could not use the card, because I forgot
+"options __I4B_IS_INTEGRATED" in the kernal config file.
+[Jan Sparud helped me to find that]
+
+(From: David Wetzel <dave@turbocat.de>)
+
+
+27. i4b_pci_attach: pci_map_port 1 failed! What does this mean ?
+================================================================================
+
+Q: Hi,
+
+ I am trying to set up a ELSA QuickStep 1000pro PCI ISDN adaptor in a FreeBSD
+ 3.3 box. I configured the kernel according to the i4b.ps documentation. At
+ boottime, these messages are displayed:
+
+ isic0: <ELSA QuickStep 1000pro PCI ISDN adaptor> rev 0x01 int a irq 11 on
+ pci0.1 7.0
+ i4b_pci_attach: pci_map_port 1 failed!
+
+ What does this mean ?, should I be worried ?, will the device function
+ properly ?
+
+A: Problem is solved.
+
+ In the BIOS, the PCI slot containing the ISDN card was set to IRQ 14 (having
+ no IDE devices). The isic driver finds the card using irq 11 and then says
+ "pci_port_map_port failed". The slot is set to IRQ 11 (which was free also)
+ and everything works fine here ..
+
+From: Joost Mulders <dhcp@j-mulders.demon.nl>
+
+
+28. What is: i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
+================================================================================
+
+> Some time I get follow message at console:
+>
+> i4b-L2 i4b_rxd_ack: ((N(R)-1)=35) != (UA=36) !!!
+
+A layer 2 error occured. These types of errors are automatically
+corrected by the layer 2 protocol.
+
+
+29. Why does isdnd take up 95% CPU time ?
+================================================================================
+
+Q: i just set up my isdn w/ user ppp, it works nice, but my isdn daemon takes
+ up 95% of my CPU time.
+
+ output of "top":
+ --snip--
+ Mem: 42M Active, 4616K Inact, 11M Wired, 2896K Cache, 14M Buf, 408K Free
+ Swap: 132M Total, 5128K Used, 127M Free, 3% Inuse
+
+ PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
+ 63 root 58 0 1372K 752K RUN 38:05 93.75% 93.75% isdnd
+ 207 gboehm 2 0 25196K 22044K select 1:15 2.20% 2.20% XF86_Mach64
+ --/snip--
+
+A: i just found out what i did wrong ...
+ i forgot to set these both lines in my /etc/rc.conf:
+
+ isdn_fsdev="NO"
+ isdn_flags=""
+
+ had to do that if i want to run isdnd as an daemon service, 'cause the
+ defaults in /etc/defaults/rc.conf are:
+
+ isdn_fsdev="/dev/ttyv4" # Output device for fullscreen mode (or NO for daemon mode).
+ isdn_flags="-dn -d0x1f9" # Flags for isdnd
+
+From: Guido Boehm <g.boehm@web.de>
diff --git a/share/examples/isdn/KERNEL b/share/examples/isdn/KERNEL
new file mode 100644
index 000000000000..86c8d8de709e
--- /dev/null
+++ b/share/examples/isdn/KERNEL
@@ -0,0 +1,80 @@
+#---------------------------------------------------------------------------
+#
+# Example fragment of a FreeBSD 4.x kernel config
+# file which includes all parts of isdn4bsd.
+#
+# This file can be appended to your kernel config
+# file and then edited (stripped down) to match your
+# hardware configuration.
+#
+# last edit-date: [Mon Aug 13 14:24:02 2001]
+#
+# $FreeBSD$
+#
+#---------------------------------------------------------------------------
+
+# Siemens/Infineon chipsets
+device isic0
+
+# Winbond chipset
+device iwic0
+
+# AVM Fritz PCI
+device ifpi0
+
+# Teles 16.3c
+device ihfc0
+
+# NETjet-S / Teles PCI-TJ
+device itjc0
+
+# AVM Fritz PnP
+device ifpnp0
+
+# AVM B1/T1
+device "i4bcapi"
+device iavc0
+
+# enable some ISA cards within the "isic" driver
+options TEL_S0_8
+options TEL_S0_16
+options TEL_S0_16_3
+options AVM_A1
+options USR_STI
+options ELSA_PCC16
+
+# enable some ISA PnP cards within the "isic" driver
+options TEL_S0_16_3_P
+options CRTX_S0_P
+options DRN_NGO
+options SEDLBAUER
+options ELSA_QS1ISA
+options SIEMENS_ISURF2
+options ASUSCOM_IPAC
+options EICON_DIVA
+
+# enable ELSA Microlink PCI card within the "isic" driver
+options ELSA_QS1PCI
+
+# protocol stack
+pseudo-device "i4bq921"
+pseudo-device "i4bq931"
+pseudo-device "i4b"
+
+# control devices
+pseudo-device "i4btrc" 4
+pseudo-device "i4bctl"
+pseudo-device "i4brbch" 4
+pseudo-device "i4btel" 2
+
+# IP over raw HDLC
+options IPR_VJ
+pseudo-device "i4bipr" 4
+
+# kernel sppp/isppp
+pseudo-device "i4bisppp" 4
+
+# Netgraph interface
+options NETGRAPH
+pseudo-device "i4bing" 4
+
diff --git a/share/examples/isdn/Overview b/share/examples/isdn/Overview
new file mode 100644
index 000000000000..e8e09e2c3cd5
--- /dev/null
+++ b/share/examples/isdn/Overview
@@ -0,0 +1,307 @@
+
+ Short technical overview of isdn4bsd
+ ====================================
+
+ Copyright (c) 1998 Hellmuth Michaelis. All rights reserved.
+
+ $FreeBSD$
+
+ Last edit-date: [Tue Oct 27 11:26:03 1998]
+
+ -hm starting an overview ...
+
+
+Contents:
+---------
+ Functional block diagram
+ Layer 1
+ Layer 2
+ Layer 3
+ Debugging control
+ Layer 4
+ ISDN protocol trace
+
+
+Functional block diagram
+========================
+
+ isdndebug isdnd isdntrace
+ +-------+ +----------------------------------------------------+ +--------+
+ | | | | | |
+ | | | | | |
+ +-------+ +----------------------------------------------------+ +--------+
+ | | |
+ | | |
+ | /dev/i4bctl Userland | /dev/i4b /dev/i4btrc<n> |
+===============================================================================
+ | Kernel | |
+ | | |
+ +-------+ +----------------------------------------------------+ +--------+
+ | | | | | |
+ |i4bctl | | i4b | | i4btrc |
+ | (6) | | (7) | | (8) |
+ | debug | | Layer 4 - common call control interface | | ISDN |
+ |control| | | | trace |
+ +:-:-:--+ +----------------------------------------------------+ +--------+
+ : : : ^ ^ ^
+ : : : Call | various ptr arrays | Call %
+ . . . Control | in i4b_l3l4.h | Control %
+ V V %
+ +----------------------+ +----------------------+ %
+ | | | | %
+ | i4bq931 | ISDN | active card | %
+ | (5) | ##### | %
+ | Layer 3 (Q.931) | # | driver | %
+ | | # | | %
+ +----------------------+ # +----------------------+ %
+ ^ # B + %
+ | i4b_l2l3_func function # | + +------------+ %
+ | ptr array in i4b_l2l3.h # C +++++ isp |----> %
+ V # h + +------------+ IP %
+ +----------------------+ # a + Subsys %
+ | | # n + +------------+ %
+ | i4bq921 | # n +++++ ipr |----> %
+ | (4) | # e + +------------+ IP %
+ | Layer 2 (Q.921) | # l + Subsys %
+ | | # + +------------+ %
+ +----------------------+ # D +++++ tel/rbch |----> %
+ ^ # a + +------------+ to %
+ | i4b_l1l2_func function # t + /dev/i4btel<n> %
+ | ptr array in i4b_l1l2.h # a + or /dev/i4brbch<n>%
+ V # + %
+ +----------------------+ # +---------------------+ %
+ | | # | | %
+ | isic (ISAC part) | D-ch trace # | isic (HSCX part) |B-ch%
+ | (2) |%%%%%%%%%%%% # | (3) |%%%%%
+ | Layer 1 (I.430) | % # | non-HDLC / HDLC |trc %
+ | | % # | | %
+ +----------------------+ % # +---------------------+ %
+ ^ % # ^ %
+ D-channel | % # B-channels | %
+ +-----------------------------------------------+ %
+ | function ptr in % # %
+ | in isic_softc in %%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ V i4b_l1.h #
+ +----------------------+ #
+ | | #
+ | isic | #
+ | (1) | #
+ | Card hardware driver | #
+ | for Teles, AVM, USR | #
+ | | #
+ +----------#-----------+ #
+ # #
+ # #
+ # #
+ # #
+ |=========#===============================#============================|
+ ISDN S0 bus
+
+
+Layer 1
+=======
+
+(1) A driver for a special card hardware consists of a
+ - probe routine
+ - attach routine
+ - FIFO read
+ - FIFO write
+ - register read
+ - register write
+ routines. These routines handle the card/manufacturer specific stuff
+ required to talk to a particular card.
+
+ This addresses of the read/write routines are put into a arrays found
+ in struct isic_softc and they are later called by the macros:
+
+ ISAC_READ(r), ISAC_WRITE(r,v), ISAC_RDFIFO(b,s), ISAC_WRFIFO(b,s),
+ HSCX_READ(n,r), HSCX_WRITE(n,r,v), HSCX_RDFIFO(n,b,s), HSCX_WRFIFO(n,b,s)
+
+ (see file layer1/i4b_l1.h)
+
+ Files currently used for this purpose are
+ - i4b_avm_a1.c AVM A1 and AVM Fritz!Card drivers
+ - i4b_ctx_s0P.c Creatix S0 PnP (experimental!)
+ - i4b_tel_s016.c Teles S0/16 and clones
+ - i4b_tel_s0163.c Teles S0/16.3
+ - i4b_tel_s08.c Teles S0/8 and clones
+ - i4b_tel_s0P.c Teles S0/16 PnP (experimental!)
+ - i4b_usr_sti.c 3Com USRobotics Sportster
+
+
+(2) The files i4b_isac.c and i4b_isac.h contain the code to control the
+ ISAC chip by using the above mentioned macros.
+
+ Files i4b_l1.c and i4b_l1.h handle stuff used to access layer 1
+ functions from layer 2.
+
+ Layer 1 and layer 2 access functionality of each other by using
+ a well known function pointer array, which contains addresses of
+ "primitives" functions which are defined in I.430 and Q.921. The
+ function pointer array for layer 1/2 communication is defined in
+ file include/i4b_l1l2.h and is initialized i4b_l1.c at the very
+ beginning.
+
+ File i4b_isic.c contains the main code for the "isic" device driver.
+
+ i4b_l1fsm.c is the heart of layer 1 containing the state machine which
+ implements the protocol described in I.430 and the ISAC data book.
+
+
+(3) All above code is used for handling of the D channel, the files
+ i4b_bchan.c, i4b_hscx.c and i4b_hscx.h contain the code for handling
+ the B-channel, the HSCX is used to interface the userland drivers
+ isp, ipr, tel and rbch to one of the B-channels and i4b_hscx.c and
+ i4b_hscx.h contain the code to handle it (also by using the above
+ mentioned macros). i4b_bchan.c contains various maintenance code for
+ interfacing to the upper layers.
+
+
+Layer 2
+=======
+
+(4) Layer 2 implements the LAPD protocol described in Q.920/Q.921. Layer 2
+ interfaces to layer 1 by the above described function pointer array,
+ where layer 1 calls layer 2 functions to provide input to layer 2 and
+ layer 2 calls layer 1 functions to feed data to layer 1.
+
+ The same mechanism is used for layer 2 / layer 3 communication, the
+ pointer array interface is defined in include/i4b_l2l3.h ad the array
+ is initialized at the very beginning of i4b_l2.c which also contains
+ some layer 1 and some layer 3 interface routines. As with l1/l2, the
+ l2/l3 array also contains addresses for "primitives" functions which
+ are specified in Q.920/Q.921 and Q.931.
+
+ i4b_l2.h contains the definition of l2_softc_t, which describes the
+ complete state of a layer 2 link between the exchange and the local
+ terminal equipment.
+
+ i4b_l2.c contains the entrance of data from layer 1 into the system,
+ which is split up in i4b_ph_data_ind() into the 3 classes of layer 2
+ frames called S-frame, I-frame and U-frame. They are handled in files
+ i4b_sframe.c, i4b_iframe.c and i4b_uframe.c together with the respective
+ routines to send data with each ones frame type.
+
+ i4b_l2timer.c implements the timers required by Q.921.
+
+ i4b_tei.c contains the TEI handling routines.
+
+ i4b_lme.c implements a rudimentary layer management entity.
+
+ i4b_util.c implements the many utility functions specified
+ in Q.921 together wit some misc routines required for overall
+ functionality.
+
+ i4b_mbuf.c handles all (!) requests for mbufs and frees all mbufs used
+ by the whole isdn4bsd kernel part. It should probably be moved else-
+ where.
+
+ i4b_l2fsm.c and i4b_l2fsm.h contain the heart of layer 2, the state-
+ machine implementing the protocol as specified in Q.921.
+
+Layer 3
+=======
+
+(5) i4b_l2if.c and i4b_l4if.c contain the interface routines to communicate
+ to layer 2 and layer 4 respectively.
+
+ i4b_l3timer.c implements the timers required by layer 3.
+
+ i4b_q931.c and i4b_q931.h implement the message and information element
+ decoding of the Q.931 protocol.
+
+ i4b_q932fac.c and i4b_q932fac.h implement a partial decoding of facility
+ messages and/or information elements; the only decoding done here is
+ the decoding of AOCD and AOCE, advice of charge during and at end of
+ call.
+
+ As usual, i4b_l3fsm.c and i4b_l3fsm.h contain the state machine required
+ to handle the protocol as specified in Q.931.
+
+ Layer 3 uses a structure defined in include/i4b_l3l4.h to store and
+ request information about one particular isdncontroller, it is called
+ ctrl_desc_t (controller descriptor). It contains information on the
+ state of a controller (controller ready/down and which B channels are
+ used or idle) as well as a pointer array used for communication of
+ layer 4 with layer 3: layer 3 "knows" the routines to call within
+ layer 4 by name, but in case layer 4 has to call layer 3, several
+ possibilities exist (i.e. active / passive cards) so it has to call
+ the routines which the ISDN controller had put into the the function
+ pointer array (N_CONNECT_REQUEST, N_CONNECT_RESPONSE etc) at init time.
+
+ Layer 3 shares a structure called call_desc_t (call descriptor) with
+ layer 4. This structure is used to describe the state of one call. The
+ reference to layer 3 is the Q.931 call reference value, the reference to
+ layer 4 (and the isdn daemon, isdnd) is the cdid, an unique integer
+ value uniquely describing one call, the call descriptor id.
+ This structure is used to build an array of this structures
+ (call_desc[N_CALL_DESC]), which must be large enough to hold as many
+ calls as there are B channels in the system PLUS a reserve to be able
+ to handle incoming SETUP messages although all channels are in use.
+
+ More, this structure contains the so called "link table pointers"
+ (isdn_link_t *ilt and drvr_link_t *dlt) which contain function pointers
+ to "link" a B-channel (better the addresses of functions each participant
+ needs to access each others functionality) after a successful call setup
+ to a userland driver (such as isp, ipr, rbch or tel) to exchange user
+ data in the desired protocol and format.
+
+Debugging control
+=================
+
+(6) the device driver for /dev/i4bctl in conjunction with the userland
+ program isdndebug(8) is used to set the debug level for each of the
+ layers and several other parts of the system, information how to use
+ this is contained in machine/i4b_debug.h and all parts of the kernel
+ sources. It is only usable for passive cards.
+
+
+Layer 4
+=======
+
+(7) Layer 4 is "just" an abstraction layer used to shield the differences
+ of the various possible Layer 3 interfaces (passive cards based on
+ Siemens chip-sets, passive cards based on other chip-sets, active cards
+ from different manufacturers using manufacturer-specific interfaces)
+ and to provide a uniform interface to the isdnd userland daemon, which
+ is used to handle all the required actions to setup and close calls
+ and to the necessary retry handling and management functionality.
+
+ Layer 4 communicates with the userland by using a well defined protocol
+ consisting of "messages" sent to userland and which are read(2) by the
+ isdnd. The isdnd in turn sends "messages" to the kernel by using the
+ ioctl(2) call. This protocol and the required messages for both
+ directions are documented in the machine/i4b_ioctl.h file and are
+ implemented in files i4b_i4bdrv.c and i4b_l4.c, the latter also
+ containing much of the Layer 4 interface to the lower layers.
+
+ i4b_l4mgmt.c contains all the required routines to manage the above
+ mentioned call descriptor id (cdid) in conjunction with the call
+ descriptor (array) and the call reference seen from layer 3.
+
+ i4b_l4timer.c implements a timeout timer for Layer 4.
+
+
+ISDN protocol trace
+===================
+
+(8) ISDN D-channel protocol trace for layers 2 and 3 is possible by using
+ hooks in the ISAC handling routines.
+
+ In case D-channel trace is enabled, every frame is prepended with a
+ header containing further data such as a time stamp and sent via the
+ i4btrc driver found in driver/i4b_trace.c to one of the /dev/i4btrc<n>
+ devices, where <n> corresponds to a passive controller unit number.
+
+ If desired, B-channel data can be made available using the same
+ mechanism - hooks in the HSCX handler send data up to the i4btrc
+ device.
+
+ The raw data is then read by the isdntrace userland program which
+ decodes the layer 2 and/or layer 3 protocol and formats it to be
+ easily readable by the user.
+
+ B-channel data is not interpreted but dumped as a hex-dump.
+
+
+/* EOF */
diff --git a/share/examples/isdn/README b/share/examples/isdn/README
new file mode 100644
index 000000000000..61a3e9cd7584
--- /dev/null
+++ b/share/examples/isdn/README
@@ -0,0 +1,342 @@
+
+$FreeBSD$
+
+--------------------------------------------------------------------------------
+
+ isdn4bsd
+ ========
+
+ Version 1.00.00 / May 2001
+
+ written by:
+
+ Hellmuth Michaelis
+ Hallstrasse 20
+ D-25462 Rellingen
+
+ voice: +49 4101 473574
+ fax: +49 4101 473575
+ email: hm@freebsd.org
+
+ -----
+
+ The isdn4bsd package is:
+
+ Copyright (c) 1997, 2001 by Hellmuth Michaelis. All rights reserved.
+
+ The standard FreeBSD license applies, for details see the file
+ /usr/share/examples/etc/bsd-style-copyright
+
+ -----
+
+ isdn4bsd would not be what it is without
+ the help and support of many people,
+ see file ThankYou !
+
+ -----
+
+ Vote with your wallet: in case you want to buy new ISDN hardware,
+ buy it from manufacturers who support the development of i4b,
+ for a list of supporters have a look at file ThankYou!
+
+ -----
+
+ This package is postcard-ware:
+ ==============================
+
+ The (for laywer infected places: optional) license fee for using
+ isdn4bsd is sending a picture postcard of your home town.
+ My address can be found at the top of this file.
+
+
+--------------------------------------------------------------------------------
+
+Contents:
+---------
+ 1. Disclaimer
+ 2. What is isdn4bsd ?
+ 3. Which BSD's are supported ?
+ 4. Which ISDN cards are supported ?
+ 5. Where do i find documentation for isdn4bsd ?
+ 6. How do i install isdn4bsd ?
+ 7. Where do i get support for isdn4bsd ?
+ 8. Where do i get commercial support for isdn4bsd ?
+ 9. How can i help and/or support isdn4bsd ?
+ 10. How do i report bugs ?
+ 11. Is there a mailing-list available for isdn4bsd ?
+ 12. Where can i get isdn4bsd ?
+ 13. What is the reward for reading everything in this file ?
+
+
+1. Disclaimer:
+--------------
+
+ It may be illegal in your country to connect an isdn4bsd based machine
+ using a passive ISDN card to the ISDN at your site because the protocol
+ stack of isdn4bsd, which is necessary to run passive cards, has not been
+ approved by the telecommunication certification authority of your country.
+ If in doubt, please contact your local ISDN provider !
+
+
+ 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.
+
+
+2. What is isdn4bsd ?
+---------------------
+
+Isdn4bsd (or in short i4b) is a package for interfacing a computer running
+FreeBSD, NetBSD, OpenBSD or BSD/OS to the ISDN.
+
+The only ISDN protocol currently supported by the drivers for passive cards
+is the BRI protocol specified in I.430, Q.921 and Q.931; better known as
+DSS1 or Euro-ISDN.
+
+Other ISDN Protocols may be / are supported by the microcode of the supported
+active ISDN cards.
+
+Isdn4bsd allows you to make IP network connections by using either IP packets
+sent in raw HDLC frames on the B channel or by using built-in synchronous PPP
+(or using userland ppp, this is experimental and only available for FreeBSD).
+
+For telephony, isdn4bsd can answer incoming phone calls like an answering
+machine and now has preliminary dialout capabilities for voice and data calls.
+
+
+3. Which BSD's are supported ?
+------------------------------
+
+FreeBSD:
+--------
+
+ FreeBSD-STABLE and FreeBSD-CURRENT is supported
+ by this version of isdn4bsd.
+
+ I4b was integrated into FreeBSD in January 1999, so it is part
+ of the base FreeBSD system since FreeBSD 3.x.
+
+ Please take the time to read the available documentation carefully.
+
+
+NetBSD/i386:
+------------
+ The NetBSD specific support and the Diehl driver was written by
+ Martin Husemann, (martin@netbsd.org). Isdn4bsd was integrated
+ into the NetBSD tree in January 2001, please have a look at
+ http://www.de.netbsd.org/Documentation/network/isdn/ for more
+ information.
+
+NetBSD/Amiga:
+-------------
+ The NetBSD/Amiga specific support was done by Ignatios Souvatzis,
+ (is@netbsd.org).
+
+NetBSD/Atari:
+-------------
+ The NetBSD/Atari specific support was done by Leo Weppelman,
+ (leo@netbsd.org).
+
+NetBSD/Alpha:
+-------------
+ This port is still experimental!
+
+ The NetBSD/Alpha specific support was done by Jan-Hinrich Fessel,
+ (oskar@zippo.unna.ping.de)
+
+OpenBSD/i386:
+-------------
+ Nikolay Sturm (sturm@physik.rwth-aachen.de) sent in patches to
+ support OpenBSD/i386 2.6, they are still experimental and since
+ i don't run OpenBSD i have no idea on the state of affairs.
+
+BSD/OS:
+-------
+ The BSD/OS 4.0 specific support was done by Bert Driehuis. The
+ support is not yet complete. Please contact Bert directly in case
+ of questions regarding this at driehuis@playbeing.org.
+
+
+4. Which ISDN cards are supported ?
+-----------------------------------
+
+ For a list of supported ISDN cards, please have a look at
+ the file "SupportedCards".
+
+ Please have a look at the ReleaseNotes file !
+
+
+5. Where do i find documentation for isdn4bsd ?
+-----------------------------------------------
+
+- in case you are upgrading from previous versions of isdn4bsd, have a
+ look at the ReleaseNotes file in the top level directory for major
+ changes and improvements.
+
+- For installation instructions have a look at the isdn4bsd handbook
+ available online at http://people.freebsd.org/~hm/
+
+- isdn4bsd has a homepage at http://www.freebsd-support.de/i4b/ where i
+ will try to maintain links to docs, updates and errata.
+
+- Every program and every driver has a man page.
+ Hint: try "apropos isdn4bsd", it displays all available manual pages.
+
+- The file Overview contains a short technical overview of the inner
+ workings of isdn4bsd.
+
+- The file Resources contains URL's and ISBN's to more interesting ISDN
+ related stuff.
+
+
+6. How do i install isdn4bsd ?
+------------------------------
+
+Read the installation instructions in the isdn4bsd handbook which is
+available online at http://people.freebsd.org/~hm/
+
+In case they are incomplete, unclear, wrong or outdated, please send me an
+update for inclusion into a future distribution!
+
+
+7. Where do i get support for isdn4bsd ?
+----------------------------------------
+
+Please send all questions regarding the installation, configuration
+and setup of isdn4bsd to the isdn4bsd mailing list (see below).
+
+Please do not send me private mail asking for help with the installation,
+configuration and setup of isdn4bsd: due to the amount of mail of this
+type i'm no longer able to reply to those mails.
+
+Before sending mail asking for help, PLEASE (!) read the supplied
+documentation, the examples, the handbook, the manual pages and the FAQ !
+
+I will support and help with isdn4bsd as my time permits it. Please
+keep in mind that in this case support is given on a voluntary basis
+and your questions might not be answered immediately.
+
+Also, i strongly recommend subscribing to the mailing list mentioned below.
+
+Due to the experience gained supporting the predecessor of isdn4bsd, let
+me please clearly state that there is no guarantee that your bug will be
+fixed within some specific amount of time, in fact there is no guarantee
+that your bug will be fixed at all; i'll do my best but there might be
+more important things going on in my life than giving free support for
+isdn4bsd.
+
+Some bugs seem to occur only in certain environments and are not
+reproduceable here without access to the equipment you are connected
+to or other equipment like ISDN simulators (which i don't get access to
+for free): in this case you are the only person being able to trace down
+the bug and fix it.
+
+There is a web page for i4b at http://www.freebsd-support.de/i4b available
+where i will put bugfixes, updates and contributions. In particular it has
+an "errata" page, where you should look in case you have problems with i4b.
+
+
+8. Where do i get commercial support for isdn4bsd ?
+----------------------------------------------------
+
+In case you want to pay for support, maintenance, enhancements, extensions
+to isdn4bsd or whatever else you may need, it is possible to hire me for
+reasonable rates through my employer HCS GmbH; in this case please contact
+me for details at hm@hcs.de and/or look at http://www.freebsd-support.de
+
+
+9. How can i help and/or support isdn4bsd ?
+-------------------------------------------
+
+Send a postcard! :-)
+
+I'm open for constructive suggestions, bugreports, fixes, patches,
+enhancements and comments to improve isdn4bsd.
+
+Please send all questions regarding the installation, configuration
+and setup of isdn4bsd to the isdn4bsd mailing list.
+
+Please send flames to /dev/null and/or start writing your own ISDN package.
+
+Isdn4bsd is a project on a voluntary basis and writing and supporting
+communication systems like isdn4bsd costs much money and much time.
+
+Any contribution in terms of equipment, cards, documentation, cash
+and/or daytime payed work on isdn4bsd will be highly appreciated!
+
+You can help by not only reporting bugs, but by sending in a patch for
+the problem together with a bugreport.
+
+In case you cannot fix something yourself, please describe your problem
+as detailed as possible, include information which version of an operating
+system you are running, which ISDN board you are using, to which kind
+of ISDN equipment (like the brand of PBX) you are connected etc. etc.
+
+In case you want to get a currently unsupported card supported, write a
+low level driver for it yourself and submit it. In case you can't write
+it yourself there is a good chance to get it supported if you can donate
+one of those cards and - if at all possible - docs for it.
+
+
+10. How do i report bugs ?
+--------------------------
+
+Please submit patches ONLY as context diffs (diff -c)!
+
+I vastly prefer receiving bug fixes and enhancements that are clearly
+differentiated. I don't always know what to do with large patches that
+contain many bugs and enhances folded into the same context diffs.
+
+Please keep it to one fix or enhancement per patch!
+
+If your change modifies the external interface of an isdn4bsd program,
+i.e. more config options, command-line switches, new programs, etc.,
+then please also include patches for the manual pages and documentation.
+
+Thank you!
+
+
+11. Is there a mailing-list available for isdn4bsd ?
+---------------------------------------------------
+
+There is a mailing list available at
+
+ freebsd-isdn@freebsd.org
+
+The list is maintained by majordomo, so i.e. to subscribe,
+send a mail with the text
+
+ subscribe freebsd-isdn
+
+in the message body sent to
+
+ majordomo@freebsd.org
+
+This mailing list is NOT (!) FreeBSD specific, everyone is welcome there!
+
+
+12. Where can i get isdn4bsd ?
+------------------------------
+
+The isdn4bsd package is part of FreeBSD since FreeBSD 3.0-RELEASE so you
+get isdn4bsd where you can get FreeBSD: http://www.freebsd.org
+
+Isdn4bsd has its own homepage at
+
+ http://www.freebsd-support.de/i4b
+
+
+
+13. What is the reward for reading everything in this file ?
+------------------------------------------------------------
+
+Have fun!
+hellmuth
diff --git a/share/examples/isdn/ROADMAP b/share/examples/isdn/ROADMAP
new file mode 100644
index 000000000000..ad813833d574
--- /dev/null
+++ b/share/examples/isdn/ROADMAP
@@ -0,0 +1,86 @@
+
+ Roadmap of isdn4bsd as integrated into FreeBSD
+ ==============================================
+
+ $FreeBSD$
+
+ last edit-date: [Sat Jun 2 13:46:20 2001]
+
+
+1. Documentation
+---------------------
+
+ The i4b handbook which describes the setup and configuration of
+ isdn4bsd under FreeBSD in detail can be found at
+ http://people.freebsd.org/~hm/
+
+ The i4b homepage is http://www.freebsd-support.de/i4b/
+
+ The command "apropos isdn" will list all manpages available for
+ isdn4bsd. Two more manual pages of interest to syncronous PPP
+ over ISDN users are the pages for sppp and ispppcontrol.
+
+ Under directory /usr/share/examples/isdn, you will find:
+
+ FAQ - isdn4bsd Frequently Asked Questions
+ KERNEL - kernel config(8) file fragment to add ISDN support
+ Overview - short technical overview (outdated)
+ README - the original isdn4bsd README file
+ ROADMAP - this file
+ ReleaseNotes - list of major changes
+ Resources - where to get more information about ISDN
+ SupportedCards - list of supported ISDN cards
+ ThankYou - contributors to isdn4bsd
+
+ contrib - contributed examples and code
+ v21 - V.21 (300Bd) soft modem emulator
+
+
+2. Configuration
+---------------------
+
+ Configuration of the isdn4bsd package consists of:
+
+ - configuring a kernel suitable for running isdn4bsd. All
+ kernel configuration statements for isdn4bsd can be found
+ in the file /usr/src/sys/i386/conf/NOTES - another way to
+ get started is taking the GENERIC configuration file and
+ appending the KERNEL file mentioned above.
+
+ - configuring the network interfaces iprX and/or ispX; the
+ former are used for "IP over raw HDLC" and the latter are
+ used for "sync PPP over ISDN". To configure the ipr-
+ interfaces, read the output of "man i4bipr", to configure
+ the isp-interfaces, read the output of "man i4bisppp",
+ "man sppp" and "man ispppcontrol" carefully.
+
+ - writing a configuration file /etc/isdn/isdnd.rc for the
+ isdn daemon isdnd(8) which is responsible for the ISDN
+ call control mechanisms such as: dial on demand, dial
+ retry, dial recovery, timeout and short hold operation.
+ A sample (!) file can be found in /etc/isdn. Please read
+ the output of "man isdnd" and "man isdnd.rc" carefully.
+
+
+2. Userland programs
+-------------------------
+
+ The userland programs can be found in the sourcetree under
+ /usr/src/usr.sbin/i4b and get installed under /usr/sbin.
+
+ Isdntest will not be installed by default.
+ Isdnphone is experimental and may not run with your soundcard.
+
+
+3. Kernel part
+-------------------
+
+ The kernel part of isdn4bsd can be found at /usr/src/sys/i4b.
+
+
+4. Answering machine messages
+----------------------------------
+
+ Messages to be used by the answering machine can be found in
+ /usr/share/isdn, you'll find the numbers 0 to 9, a beep and
+ a short announcement message here.
diff --git a/share/examples/isdn/ReleaseNotes b/share/examples/isdn/ReleaseNotes
new file mode 100644
index 000000000000..7f4a7c61124b
--- /dev/null
+++ b/share/examples/isdn/ReleaseNotes
@@ -0,0 +1,154 @@
+$FreeBSD$
+
+ReleaseNotes for isdn4bsd last edit-date: [Sat Jul 21 12:27:43 2001]
+================================================================================
+
+ - add keyword "maxconnecttime" to isdnd to prevent a potential telco bill
+ desaster. Caution: use only in conjunction with budgets to limit the number
+ of dials per timeunit otherwise you will get endless redials and reconnects!
+
+release 1.00
+--------------------------------------------------------------------------------
+
+ - CAPI interface driver and AVM B1/T1 driver added. Both were written and
+ contributed by Juha-Matti Liukkonen <jml@cubical.fi> of Cubical Solutions
+ Ltd, Finnland. To support this, two new keywords were added to isdnd.rc:
+ "firmware" to be used in the controller section and "clone" to be used
+ in the entry section.
+
+
+beta release 0.96
+--------------------------------------------------------------------------------
+
+ - it is now possible to mark an entry as valid for a specified day of week
+ and a specific time range only to take advantage of some new tariff models.
+ Please see the new keywords "valid" and "holidayfile" in isdnd.rc(5).
+ This feature is considered experimental, use at your own risk!
+
+ - keywords budget-callbacksfile and budget-calloutsfile added to isdnd's
+ entry section to write statistics information to a file
+
+ - a driver for the Dynalink IS64PH is now available for FreeBSD 4.x and up
+
+
+beta release 0.95
+--------------------------------------------------------------------------------
+
+ - ITK ix1 micro ISA non-PnP card should now work for FreeBSD >= 4.0
+
+ - setting "dialretries = -1" in isdnd.rc gives an unlimited number
+ of dial retries for that entry.
+
+ - the ELSA PCFpro ISDN card should now work for FreeBSD >= 4.0
+
+ - added new keywords (patch from Stefan Esser) to configure isppp
+ from within isdnd.rc. Documented in isdnd.rc(5), grep for "ppp-"
+
+ - isppp VJ compression negotiation now run-time configurable using
+ keywords "enable-vj" / "disable-vj" with ispppcontrol
+
+ - added new keywords to specify "budgets" for outbound calls in isdnd
+ to limit the number of possible calls within a given time period.
+ Runtime budget information and statistics are available in the isdnd
+ fullscreen menu display.
+
+ - added new "ifpnp" AVM Fritz!Card PnP driver for FreeBSD >= 4.0
+ contributed by Udo Schweigert.
+
+ - added experimental hardware driver from Hans Petter Selasky for the
+ Teles 16.3c card based on the Cologne Chip Designs HFC-S 2BDS0 chip
+ called "ihfc".
+ notes for Teles 16.3c PnP and AcerISDN P10: For optimal performance:
+ -> please connect the card to the S0-bus before booting the computer.
+ -> do not change the cable you're using when first booted.
+ Other notes if the card does not work at all:
+ -> disconnect other isdn equipment on your S0-bus and
+ reboot your computer.
+ -> try changing the CLKDEL/stdel value for your card:
+ ../i4b/layer1-nb/ihfc/i4b_ihfc_pnp.c or
+ ../i4b/layer1/ihfc/i4b_ihfc_pnp.c
+ around line 100. The value can be in the range 0x0-0xf.
+
+ - the FreeBSD >= 4.0 AVM Fritz PCI driver was moved to a separate layer 1
+ driver called "ifpi".
+
+ - the sppp subsystem was integrated into the i4bisppp/isp driver. There
+ is no need to include something like "option sppp" into your kernel
+ config file anymore. The spppcontrol utility is no longer usable to
+ configure the i4bisppp/isp driver, instead use the new ispppcontrol
+ utility!
+
+ - FreeBSD >= 4.0: "iwic" driver for Winbond PCI ISDN chipset (W6692)
+ added, used i.e. in ASUSCOM P-IN100-ST-D and Dynalink IS64PPH.
+
+ - added more protocol decoding to isdntrace
+
+ - isntrace now adds a time/datestamp to the trace filename, signal USR1
+ behaviour has changed, see manpage.
+
+ - ispppcontrol now has a new option of setting the LCP timeout value
+
+ - add directory mpd which contains docs and files on howto interface
+ i4b by using the netgraph subsystem to the multilink ppp daemon, mpd.
+
+ - add i4bing, a raw HDLC B-channel interface to the NetGraph subsystem
+
+ - add a V.21 modem emulator written by Poul-Henning Kamp
+
+ - a new system configuration keyword "extcallattr" was added to isdnd
+ which allows to configure the display of the extended caller
+ attributes "screening indicator" and "presentation indicator" in
+ isdnd's log file.
+
+
+beta release 0.90
+--------------------------------------------------------------------------------
+
+ - the following cards are no longer supported for FreeBSD 4.0 and up:
+
+ AVM Fritz!Card PnP
+ AVM Fritz!Card PCMCIA
+ Dynalink IS64PH
+ ITK ix1 Micro
+ USRobotics Sportster ISDN TA intern
+
+ The AVM cards, the USR card and perhaps one of the ITK cards are likely
+ to be resurrected in the future, we just ran out of time, docs and/or
+ into programming problems for this release.
+
+ - the rbch driver was enhanced to support the generation of accounting
+ information in HDLC mode. The bytecount and bps fields in isdnd
+ fullscreen mode now show meaningful information.
+
+ - most of the layer1 drivers have been rewritten to support the new bus
+ and driver architecture for FreeBSD 4.0.
+
+ - the ipr interfaces now support logging of some of the first ip packets
+ of a new connection and displaying them in the isdnd logs. To enable
+ this, add a line like: "options IPR_LOG=32" to your kernel config
+ file. The parameter to IPR_LOG specifies the number of packets to be
+ logged.
+
+ - support for FreeBSD 2.x and FreeBSD 3.0-RELEASE has been removed.
+ The last beta release which supports this OS versions is i4b-0.83.
+
+ - isdnd now recognizes two new keywords in the system section, mailto
+ and mailer. mailer is used to configure a mail program and is typically
+ set to /usr/bin/mail and mailto is set to the address of the isdnd
+ administrator. If both are set and a fatal error inside isdnd
+ happenes, mail is sent to the address in mailto with the error
+ message before isdnd terminates.
+
+ - isdnd.rc now has an optional new "controller" section. This will be
+ used to specify different D-channel protocols in the future. It looks
+ like this:
+
+ controller
+ protocol = dss1 # dss1 (default) or d64s (leased line)
+
+ Please note that leased line support (d64s) is NOT yet functional!
+
+ - isdnmonitor is now able to be used like isdnd in fullscreen mode from
+ a remote machine.
+
+EOF
diff --git a/share/examples/isdn/Resources b/share/examples/isdn/Resources
new file mode 100644
index 000000000000..b52decfb03dd
--- /dev/null
+++ b/share/examples/isdn/Resources
@@ -0,0 +1,113 @@
+$FreeBSD$
+
+Download sites for isdn4bsd
+===========================
+
+ ftp://i4b.consol.de/pub/
+
+
+Bugfixes, improvements and patches for i4b
+==========================================
+
+ http://www.freebsd-support.de/i4b/ (in the "errata" section)
+
+
+Bob's ISDN BRI/PRI Signaling Guide
+==================================
+
+ http://veda-home.com/Blackshaw/
+
+
+Anwahl von T-Offline mittels i4b und FreeBSD (german)
+=====================================================
+
+ http://www.de.freebsd.org/de/i4b-t-error.html
+
+
+ISDN Information:
+=================
+
+ http://www.alumni.caltech.edu/~dank/isdn/
+
+
+Standards:
+==========
+
+ ETSI
+ ----
+ http://www.etsi.org/
+
+ ITU
+ ---
+ http://www.itu.ch/
+
+ ftp://ftp.leo.org/pub/comp/doc/standards/itu/
+
+ CAPI
+ ----
+ http://www.capi.org/
+
+
+ISDN Chips
+==========
+
+ Infineon (formerly Siemens)
+ ---------------------------
+ http://www.infineon.com/
+
+ Cologne Chip Design
+ -------------------
+ http://www.colognechip.de/
+
+ Winbond
+ -------
+ http://www.winbond.com/
+
+ Motorola
+ --------
+ http://mot-sps.com/solutions/isdn/index.html
+
+
+SunShine Project - Implementation of the ISDN recommendations Q.921 & Q.931
+===========================================================================
+
+ http://www.tcm.hut.fi/~bos/ISDN/sunshine/SunShine.html
+
+Books:
+======
+
+ "ISDN: concepts, facilities and services",
+ Gary C. Kessler, McGraw-Hill 1993,
+ ISBN 0-07-034247-4
+
+ "Integrated services digital networks: architectures, protocols, standards",
+ Herman J. Helgert, Addison-Wesley 1991,
+ ISBN 0-201-52501-1
+
+ "ISDN and Broadband ISDN with Frame Relay and ATM",
+ William Stallings, Prentice Hall 1995,
+ ISBN 0-02-415513-6
+
+ "Technik der Netze",
+ Gerd Siegmund, R. v. Decker's Verlag 1996,
+ ISBN 3-7685-2495-7
+
+ "Euro-ISDN fuer Anwender und Techniker"
+ Reinhard Heermeyer und Maria Spath, Festo DIDACTIC 1996,
+ ISBN 3-8127-4334-5
+
+ "ISDN implementors guide: standards, protocols & services",
+ Charles K. Summers, McGraw-Hill 1995,
+ ISBN 0-07-069416-8
+
+ "PPP Design and Debugging",
+ James Carlson, Addison-Wesley 1998,
+ ISBN 0-0201-18539-3
+
+ "ISDN - Die Technik",
+ Andreas Kanbach, Andreas Koerber, Huethig Verlag 1999,
+ ISBN 3-7785-2288-4
+
+
+$FreeBSD$
+
diff --git a/share/examples/isdn/SupportedCards b/share/examples/isdn/SupportedCards
new file mode 100644
index 000000000000..28f8bd867cd5
--- /dev/null
+++ b/share/examples/isdn/SupportedCards
@@ -0,0 +1,192 @@
+--------------------------------------------------------------------------------
+
+ ISDN cards supported by isdn4bsd in FreeBSD
+ ===========================================
+
+ last edit-date: [Sat Jun 2 14:03:57 2001]
+
+ $FreeBSD$
+
+--------------------------------------------------------------------------------
+
+ YES - card is generally supported for this OS
+ NO - card is NOT supported for this OS
+ EXP - card is in an experimental status for this OS
+ DEV - card driver is under development
+ ??? - card status is unknown for this OS
+
+
+1. Passive non-PnP ISA bus ISDN cards
+=====================================
+
+ Type FreeBSD Notes
+ --------------------- ------- -----------------------
+ AVM A1 YES
+ AVM Fritz!CardClassic YES
+ Creatix ISDN-S0/8 YES (= Teles S0/8 )
+ Creatix ISDN-S0/16 YES ( = Teles S0/16 )
+ Dr.Neuhaus Niccy 1008 YES ( = Teles S0/8 )
+ Dr.Neuhaus Niccy 1016 YES ( = Teles S0/16 )
+ ELSA PCC-16 YES
+ ELSA PCFpro YES
+ ITK ix1 micro YES (Note 13)
+ Stollmann Tina-pp YES
+ Teles S0/8 YES
+ Teles S0/16 YES
+ Teles S0/16.3 YES
+ 3Com/USR SportsterInt YES ( = Stollmann Tina-pp )
+ TELEINT ISDN SPEED EXP (Note 4)
+
+
+2. Passive PnP ISA bus ISDN cards
+=================================
+
+ Type FreeBSD Notes
+ --------------------- ------- -----------------------
+ AVM Fritz!Card PnP YES (Note 1)
+ Asuscom I-IN100-ST-DV ??? ( = Dynalink IS64PH )
+ Asuscom ISDNlink 128K YES (Note 16)
+ Creatix ISDN-S0 PnP YES (Note 2)
+ Dr.Neuhaus Niccy GO@ YES (Note 2)
+ Dynalink IS64PH YES (Note 11)
+ ELSA 1000pro ISA YES (Note 3)
+ ITK ix1 micro V.3 YES (Note 13)
+ Sagem Cybermod YES (= Niccy GO@ )
+ Sedlbauer Win Speed YES (Note 9)
+ Siemens I-Surf 2.0 YES (Note 15)
+ Teles S0 PnP YES (Note 5)
+ Teles 16.3c EXP (Note 4)
+ AcerISDN P10 EXP (Note 4)
+
+3. Passive PCI bus ISDN cards
+=============================
+
+ Type FreeBSD Notes
+ --------------------- ------- -----------------------
+ ASUSCOM P-IN100-ST-D YES
+ AVM Fritz!Card PCI YES (Note 14)
+ Dynalink IS64PPH YES
+ ELSA 1000pro PCI YES ( = ELSA Microlink PCI )
+ Teles PCI-TJ YES
+ NETJet-S YES
+ Winbond W6692-based YES
+
+
+4. Passive PCMCIA bus ISDN cards
+================================
+
+ Type FreeBSD Notes
+ --------------------- ------- -----------------------
+ AVM Fritz!Card PCMCIA NO (Note 10)
+ ELSA ISDN/MC NO
+ ELSA MC/ALL NO
+
+
+5. Passive Zorro2 ISDN cards for the Amiga
+==========================================
+
+ Type FreeBSD Notes
+ --------------------- ------- -----------------------
+ ISDN Blaster NO (Note 12, Amiga/NetBSD)
+ ISDN Master NO (Note 12, Amiga/NetBSD)
+ ISDN Master II NO (Note 12, Amiga/NetBSD)
+
+
+6. Active ISDN cards
+====================
+
+ Type (active, ISA) FreeBSD Notes
+ --------------------- ------- -----------------------
+ AVM B1 YES (Note 17)
+ AVM T1 YES (Note 18)
+ DiehlS,SX,SCOM,QUATRO NO (Note 7)
+ Miro P1 DEV ( = Tina-dd )
+ Stollmann Tina-dd DEV (Note 8)
+
+
+7. Notes
+========
+
+
+Note 1: The driver for the Fritz!Card PnP was developed by Udo Schweigert
+ (ust@cert.siemens.de) who develops under FreeBSD only.
+ Please contact Udo in case of trouble.
+
+Note 2: The NetBSD version has not been verified to work yet.
+
+Note 3: Due to its design, this card produces 128 IRQs/sec. This can be
+ reportedly stopped by disconnecting pin 12 of the 7474 and wiring
+ it to pin 15 of the 74175. Be careful! This procedure has not been
+ verified and doing this will immediately terminate your warranty !!
+ The card will not function anymore with drivers for other OSes and
+ you may not get any further support from the manufacturer! YMMV!
+
+Note 4: This driver was developed by Hans Petter Selasky, hselasky@c2i.net
+ The code is still somewhat experimental.
+
+Note 5: The card has only been verified to work under FreeBSD 4.0 and up.
+
+Note 6: This driver is currently under development by Gary Jennejohn who
+ develops under FreeBSD only.
+
+Note 7: This driver is currently under construction by Martin Husemann who
+ develops under NetBSD only.
+
+Note 8: This driver is currently under development by Hellmuth Michaelis who
+ develops under FreeBSD only.
+
+Note 9: This driver was developed by German Tischler, tanis@gaspode.franken.de.
+ Please contact him in case of trouble. The "Teledat 100" sold by the
+ german Telekom is identical with this card.
+
+Note 10: This driver is developed by Matthias Apitz, matthias.apitz@sisis.de.
+ Please contact him in case of trouble. Please read the file
+ misc/README.PCCARD in the i4b distribution for additional installation
+ instructions.
+
+Note 11: This driver was developed by Martijn Plak (martijn@be3.com)
+ This driver might also work for Asuscom cards. (Andrew Gordon
+ wrote: Just to let you know that I've now tried the i4b "dynalink"
+ driver with the ASUSCOM I-IN100-ST-DV card, and it appears to work
+ fine.)
+
+ Note: This driver is now unsupported as Martijn is no longer able
+ to maintain this driver.
+
+ The BSD/OS support for this card was written by Bert Driehuis.
+
+ Ported to FreeBSD newbus by Kazunori Fujiwara <fujiwara@rcac.tdi.co.jp>
+
+Note 12: This driver was developed by Ignatios Souvatzis (is@netbsd.org)
+ Please contact him in case of trouble.
+ This driver is supposed to work on the ISDN Master versions and
+ lookalikes, like the ISDN Blaster, and on the ISDN Master II.
+ Note that the ISDN Master II does not AutoConfig(tm)ure in the
+ DraCo Zorro bus and thus only works in real Amigas. This is no
+ i4b problem, but general.
+
+Note 13: This driver was developed by Martin Husemann, please contact him
+ in case of trouble. The FreeBSD PnP support for version 3 of the
+ card was done by Philippe Guezou <Philippe.Guezou@wanadoo.fr>.
+
+Note 14: This driver was developed by Gary Jennejohn who develops under
+ FreeBSD only. In case of problems with this driver, please contact
+ him directly at garyj@muc.de.
+
+Note 15: The driver for the Siemens I-Surf 2.0 was developed by Udo Schweigert
+ (ust@cert.siemens.de) who develops under FreeBSD only.
+ Please contact Udo in case of trouble.
+
+Note 16: The driver for the Asuscom ISDNlink 128K PnP was developed by
+ Ari Suutari (ari@suutari.iki.fi). Please contact Ari directly
+ in case of trouble with this driver.
+
+Note 17: The driver was written by Juha-Matti Liukkonen <jml@cubical.fi>,
+ Cubical Solutions Ltd. I have tested it with an AVM B1 PCI card
+ V.4.0 and an AVM B1 ISA card V.2.0.
+
+Note 18: The driver was written by Juha-Matti Liukkonen <jml@cubical.fi>,
+ Cubical Solutions Ltd. I have no access to any PRI equipment at
+ all so i have not tested the driver, feedback welcome!
+
+EOF
diff --git a/share/examples/isdn/ThankYou b/share/examples/isdn/ThankYou
new file mode 100644
index 000000000000..8d9c7831e12b
--- /dev/null
+++ b/share/examples/isdn/ThankYou
@@ -0,0 +1,273 @@
+$FreeBSD$
+
+Thanks a lot for postcards from:
+--------------------------------
+
+ Aachen
+ Arnhem
+ Arolsen
+ Bad Rothenfelde
+ Berlin
+ Birenbach
+ Bochum
+ Bohnsdorf
+ Bonn
+ Bornheim
+ Braunschweig
+ Darmstadt
+ Delft
+ Dresden
+ Flekkefjord
+ Habichtswald
+ Hamburg (2)
+ Ihlow
+ Jena
+ Kassel
+ Koengen
+ Kymgbuk, Korea
+ Landsberg
+ Leiden
+ Magdeburg
+ Mauerbach
+ Mersch
+ Middelburg
+ Mosi-Oa-Tunya
+ Muenchen (4)
+ Netherlands (Leo)
+ Netherlands (Peter)
+ Rio de Janeiro
+ Saint-Gilles-Croix-de-Vie
+ Scheessel
+ Siena, Italy
+ St. Jacob
+ Travemuende
+ Vedskoelle, Danmark
+ Windach
+ Wuerzburg
+
+
+I would like to thank the following people and organisations:
+-------------------------------------------------------------
+
+Gary Jennejohn for his constant kind support while writing isdn4bsd
+ during that year. Gary always runs the latest and
+ greatest FreeBSD-current and makes isdn4bsd run
+ there, if his root fs is intact, of course! :-).
+ In February 1999, Gary contributed the AVM Fritz!
+ Card PCI driver to isdn4bsd.
+
+Martin Husemann is a major contributor to isdn4bsd. He wrote almost
+ all of the NetBSD support for isdn4bsd, the monitor
+ network code and the Diehl driver. He constantly
+ tries put strange macros into i4b ... ;-)
+
+Serge Vakulenko for writing the sppp driver and making it freely
+ available.
+
+Joerg Wunsch for adapting the synchronous PPP stuff to i4b.
+ Gary finished this and integrated the PPP stuff into
+ current isdn4bsd.
+
+Wolfgang Helbig for many patches, polishing isdn4bsd and layer 1
+ debugging.
+
+Thomas Halenbeck and
+Stephan Forth of FORTH EDV in Mainz donated two AVM A1 card and
+ one AVM B1 card to support the development and
+ maintenance of drivers for this cards. Thomas donated
+ three more AVM A1 cards in the meantime - Thank you!
+
+Arne Helme for the initial work on how to support IOM-2 based
+ boards.
+
+Andrew Gordon for disassembling an old AVM A1 and documenting it.
+ Andrew added VJ header compression to the ipr interface
+ and is a constant source of various hints and
+ suggestions :-)
+ Andrew sent in a Teles S0/16 PnP for FreeBSD newbus
+ conversion, thanks a lot!
+
+Juergen Krause and someone who does not want to be mentioned anymore
+ for the work on the first ISDN package for FreeBSD.
+
+Michael Elbel for supporting the development with ftp/www/mail
+ resources.
+
+Leo Weppelman for the port to the NetBSD/Atari platform.
+
+Bas Oude Nijeweme for the port to OpenBSD/i386 2.2.
+
+German Tischler for the driver for the Sedlbauer WinSpeed card,
+ for the PnP support for FreeBSD and for constant
+ testing and contributions. German did the initial
+ mostly complete conversion of the layer1 code
+ to the FreeBSD 4.0 new-bus driver architecture!
+
+Matthias Apitz for the driver for the AVM PCMCIA Fritz!Card.
+
+Martijn Plak for the Dynalink driver.
+
+Ignatios Souvatzis for the NetBSD/Amiga port and associated driver(s).
+
+Christoph Weber-Fahr donated an AVM B1 card to support development of a
+ driver. Thanks a lot, Christoph!
+
+Eivind Eklund for the PnP support for FreeBSD, for __FreeBSD_version
+ and more.
+
+Karsten Keil author of the hisax isdn4linux driver for some details
+ about the one or the other piece of hardware.
+
+Bert Driehuis for the support of the BSDI BSD/OS 4.0 operating system
+
+Barry Scott for fixed charging units shorthold mode support (as
+ used in the UK by British Telecom).
+
+Poul-Henning Kamp for the work on DTMF decoding and many hints, fixes
+ and suggestions.
+
+Stefan Bethke for the work on the audio format conversion stuff in
+ the telephony paths.
+
+Udo Schweigert for PCMCIA support and work on FreeBSD 2.2x
+ compatibility. Udo contributed the AVM Fritz PnP
+ and the Siemens I-Surf V2.0 driver.
+
+Ernst Winter donated a Fritz!Card PCI which was used to develop
+ and test the driver.
+
+Harald Frank long-term loan of an ISDN Blaster board.
+
+Klaus Burkert for a loan of an ISDN Master II.
+
+Ari Suutari for a driver for the Asuscom ISDNlink ISA PnP card
+
+Brian Somers for working on making userland ppp work with i4b
+
+Rune Knapstad for good help with the port to OpenBSD/i386 2.5
+
+Uwe Laverenz for the donation of an ELSA PCC-16 card
+
+Luke Roberts for the long time loan a Dynalink ISDN intern PCI card
+
+Marc van Kempen for the donation of a Dynalink ISDN intern PCI card
+
+Christoph Kukulies for the donation of an ITK ix1 card
+
+Nikolay Sturm sent in patches to get OpenBSD 2.6 supported.
+
+Dave Boyce wrote a driver for the Winbond W6692 PCI ISDN
+ chip which eventually lead to a layer 1 reorg.
+
+Hans Petter Selasky for his contribution of a driver for the
+ Teles 16.3c card (and the complete ihfc driver).
+
+Sergio de Souza Prallon for the contribution of the itjc driver which
+ supports the NETJet-S and the Teles PCI-TJ cards
+
+
+ ------------------------------------------
+
+
+Liebscher & Partner Martin Welk and Holm Tiffe sent in a motivating
+ BSD daemon plushie :-)
+
+Abaid Andreas Mutschlechner of Abaid, Alte Strasse 2, in
+ I-39017 Schenna (BZ) donated money to support i4b
+ development, which was used to upgrade my main test
+ machine for isdn4bsd from an 486 to a Pentium II.
+ Thank you very, very much, Andreas !
+
+3Com USRobotics Christian Weissgerber of 3Com USRobotics in Munich
+ donated a passive "Sportster ISDN TA intern" ISDN
+ card and complete hardware documentation for the card.
+
+ Florian Uhl of 3Com in Munich donated two MC68SC302
+ "3Com U.S.Robotics ISDN Card PnP internal" cards and
+ documentation to support writing a driver for this
+ card.
+
+Dr. Neuhaus Klaus Muehle of Dr. Neuhaus Telekommunikation in
+ Hamburg sent documentation for the NICCY GO@ and
+ NICCY EASY@ ISDN cards to support development of
+ a driver for this cards.
+
+Stollmann Many thanks to Christian Luehrs and Manfred Jung
+ for giving out docs and sources to support the
+ driver development for the tina-dd active card.
+
+ELSA Axel Riemer of ELSA AG in Aachen donated several
+ ISA, PCI and PC-Card ISDN boards to three developers
+ and provided support and documentation to help with
+ adding support to i4b for this hardware. Werner Fehr
+ of ELSA answered our technical questions and gave
+ valuable hints. Thanks also to Andreas Klemm for
+ making the contact ;-)
+
+Cologne Chip Design Harald Schaefer of Cologne Chip Design send in a
+ HFC-S-PCI developer card, complete docs and
+ layer 1 example code to support the development
+ of a driver for that chipset! Thanks a lot!
+
+ASUSCOM Network Inc. Mr. Ben Chen of Asuscom sent a Winbond based PCI
+ card and a Cologne Chip Design based PCI card to
+ support the development of device drivers.
+
+Cubical Solutions Ltd. Juha-Matti Liukkonen <jml@cubical.fi> of Cubical
+ contributed the CAPI layer and the AVM B1/T1 device
+ driver to isdn4bsd.
+
+AVM GmbH Mr. A. Ziessnitz of AVM donated an AVM B1 PCI cards
+ to support development and maintenance of a driver
+ for this card.
+
+
+
+The following people contributed in one or the other way to isdn4bsd:
+---------------------------------------------------------------------
+
+ Alexander Langer
+ Andreas Haakh
+ Andreas Lohrum
+ Arve Ronning
+ Aurelien Bargy
+ Bart van Leeuwen
+ Caspar Schlegel
+ Christian Wolf
+ Christoph Kukulies
+ Daniel Rock
+ David Wetzel
+ Dirk Meyer
+ Doobee R. Tzeck
+ Dominik Brettnacher
+ Gabor Dolla
+ H. Eckert
+ Hans Huebner
+ Harald Hanche-Olsen
+ Harold Gutch
+ Heiko Schaefer
+ Jan Sparud
+ Joachim Kuebart
+ Joakim Hernberg
+ Juha-Matti Liukkonen
+ Julian H. Stacey
+ Kazunori Fujiwara
+ Lars Koeller
+ Malte Lance
+ Marcel Moolenaar
+ Martin Recktenwald
+ Meike Aulbach
+ Michael Hohmuth
+ Michael Ranner
+ Michael Reifenberg
+ Nils Ulltveit-Moe
+ Paul Herman
+ Paul Sijben
+ Philippe Guezou
+ Rob Pickering
+ Stefan Esser
+ Stefan Herrmann
+ Steven Looman
+ Wolfgang Solfrank
+
+(In case i forgot someone, please tell me!)
diff --git a/share/examples/isdn/contrib/README b/share/examples/isdn/contrib/README
new file mode 100644
index 000000000000..ae5969f09e84
--- /dev/null
+++ b/share/examples/isdn/contrib/README
@@ -0,0 +1,42 @@
+$FreeBSD$
+
+This directory contains various unsupported contributions to isdn4bsd
+---------------------------------------------------------------------
+
+anleitung.ppp Anleitung für syncPPP Internet-Zugang und
+ Anrufbeantworter / FreeBSD 2.2.x / Teles.S0/16.3-Karte
+ (stefan@asterix.webaffairs.net)
+
+answer.c answering machine in C by David Wetzel
+ (dave@turbocat.de)
+
+answer.sh a much better replacement for answer, tell and record
+ from Stefan Esser (se@freebsd.org)
+
+convert.sh convert recorded message to WAV format, optionally
+ send it via mail. from Stefan Herrmann
+ (stefan@asterix.webaffairs.net)
+
+hplay.c isdn4bsd telephony output driver for the "rsynth"
+ package to play synthetic speech to a telephone
+ connection
+
+i4b-ppp-newbie.txt setup PPP for isdn4bsd for newbies text from
+ Dominik Brettnacher <domi@saargate.de> (german)
+
+isdnctl This script can control the state of your ISDN line.
+ It counts how many scripts/users currently use the
+ ISDN line and uses "ifconfig down" if noone uses it
+ any more. Alexander Langer <alex@big.endian.de>
+
+isdnd_acct the barebones isdnd accounting script
+
+isdnd_acct.pl enhanced accounting from Joachim Kuebart
+ (joki@kuebart.stuttgart.netsurf.de)
+
+isdntelmux.c a "record while play" program contributed by
+ Michael Reifenberger (Michael@Reifenberger.com)
+
+mrtg-isp0.sh shell script and mrtg config entry to display
+ callout and callback statistics with mrtg
+ (www.mrtg.org) using the budget file statistics
diff --git a/share/examples/isdn/contrib/anleitung.ppp b/share/examples/isdn/contrib/anleitung.ppp
new file mode 100644
index 000000000000..01466e2f4880
--- /dev/null
+++ b/share/examples/isdn/contrib/anleitung.ppp
@@ -0,0 +1,142 @@
+$FreeBSD$
+
+i4b Anleitung für syncPPP Internet-Zugang und Anrufbeantworter
+unter FreeBSD 2.2.x mit Teles.S0/16.3-Karte
+===============================================================
+
+by Stefan Herrmann <stefan@asterix.webaffairs.net>
+
+
+Installation
+------------
+1) Neues Verzeichnis "/usr/src/i4b" anlegen.
+
+2) Ins Verzeichnis "/usr/src/i4b" wechseln und Sourcen entpacken.
+
+3) Ins Verzeichnis "FreeBSD" wechseln und den Befehl "sh install.sh ausführen:
+ z.B. "root@asterix[0]/usr/src/i4b/FreeBSD # sh install.sh"
+
+ Wenn auf eine neuere Version von i4b gewechselt wird, zuerst
+ "sh uninstall.sh" ausführen, dann erst "sh install.sh"
+
+4) Dann ins Verzeichnis "/usr/src/i4b" (zurück-)wechseln und die Befehle
+ "make depend", "make" und "make install" ausführen.
+
+5) Nun muß der kernel mit neuen Optionen versehen werden. Dazu wird an die
+ Kernel-Konfigurationsdatei im Verzeichnis "/sys/i386/conf" folgendes ans
+ Ende hinzugefügt:
+
+# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver)
+# note that the ``options'' and ``device'' lines must BOTH be defined !
+
+# Teles S0/16.3
+options "TEL_S0_16_3"
+device isic0 at isa? port 0xd80 net irq 5 flags 0x04 vector isicintr
+
+# i4b passive cards D channel handling
+# Q.921
+pseudo-device "i4bq921"
+# Q.931
+pseudo-device "i4bq931"
+
+# common passive and active layer 4
+# layer 4
+pseudo-device "i4b"
+
+# userland driver to do ISDN tracing (for passive cards oly)
+pseudo-device "i4btrc" 4
+# userland driver to control the whole thing
+pseudo-device "i4bctl"
+# userland driver for access to raw B channel
+pseudo-device "i4brbch" 4
+# userland driver for telephony
+pseudo-device "i4btel" 2
+# network driver for IP over raw HDLC ISDN
+pseudo-device "i4bipr" 4
+# enable VJ header compression detection for ipr i/f
+options IPR_VJ
+# network driver for sync PPP over ISDN
+pseudo-device "i4bisppp" 4
+pseudo-device sppp 4
+
+6) Danach wird der kernel durch Eingabe der Befehle "make depend", "make" und
+ "make install" im Verzeichniss "/usr/src/sys/compile/<CONFIG>" neu
+ übersetzt und installiert.
+
+7) Nach dem Booten kann man dann mit dem Befehl "dmesg" überprüfen, ob die
+ Karte korrekt erkannt wurde und alle erforderlichen Treiber installiert
+ sind.
+
+
+Konfiguration
+-------------
+8) Die Konfiguration von i4b wird hauptsächlich im Verzeichnis "/etc/isdn"
+ druchgeführt, dort sucht der isdnd beim Start auch seine Konfigurations-
+ datei "isdnd.rc". Da vorgenanntes Verzeichnis nach der Installation aber
+ noch leer ist, kopiert man zuerst die Beispieldateien aus dem Verzeichnis
+ "/etc/isdn/samples" nach "/etc/isdn".
+
+9) Die Datei "isdnd.rc" enthält schon recht aussagekräftige Kommentare zu den
+ einzelnen Optionen, weitere Informationen erhält man mit "man isdnd.rc" und
+ "man isdnd".
+
+10) Für syncPPP und Anrufbeantworter sind nur die Sektionen "SYSTEM",
+ "telephone answering" und "example for sPPP" notwendig, die Sektion
+ "IP over ISDN example" kann dafür also entfernt werden.
+
+11) Für den automatisierten Start des isp0 Interfaces und des isdnd erstellt
+ man nun ein Start-Skript. Dazu kopiert man die Datei
+ "/usr/src/i4b/etc/rc.isdn-PPP" nach "/etc/rc.isdn" und paßt sie
+ entsprechend an. Man beachte hierbei auch die FAQ "/usr/src/i4b/FAQ", die
+ Tips für die richtige Eintragung der IP-Adressen bereithält.
+
+12) Der Anrufbeantworter wird dadurch aktiviert, daß das entsprechende
+ Programm, das in "/etc/isdn/isdnd.rc" hinter dem Eintrag "answerprog = "
+ steht, aufgerufen wird. Wird dort kein Pfad angegeben, wird das Programm
+ im Verzeichniss "/etc/isdn" erwartet. Beispiele solcher Programme findet
+ man wiederum im Verzeichnis "/etc/isdn/samples". Sie nennen sich
+
+ "answer" Nur Ansagetext abspielen, keine Aufzeichnungsmöglichkeit.
+ "record" Ansage wird abgespielt, nach Piep-Ton kann gesprochen
+ werden.
+ "tell" Als Ansagetext wird die anrufende Nummer gesprochen, keine
+ Aufzeichnung.
+ "tell-record" Anrufende Nummer als Ansagetext, nach Piep-Ton kann ge-
+ sprochen werden.
+ "isdntel.sh" Ansagetext und Aufzeichnung; mittels dem Programm "isdntel"
+ hat man die Kontrolle übe die Aufzeichnungen im Ver-
+ zeichniss "/var/isdn". Siehe auch "man isdntel" und
+ "man isdntelctl".
+
+ Diese Programme müssen an die eigenen Wünsche angepaßt werden. Leider gibt es
+ kein mitgeliefertes Programm, mit dem man so auch den Ansagetext aufsprechen
+ kann. Das ist aber nicht allzuschlimm, da man nur das Programm "record" dafür
+ etwas anpassen muß (Ansagetexte beep und msg auskommentieren). Damit die Anrufe
+ aufgezeichnet werden können, muß zuerst noch das Verzeichnis "/var/isdn"
+ angelegt werden. Dort werden dann alle Aufzeichnungen obiger Programme gespeichert.
+
+13) Man sollte sich auch noch die man-Pages der Programme "isdnd", "isdnctl",
+ "isdnd_acct", "isdndebug" und "isdntrace" zu Gemüte führen.
+
+
+Betrieb
+-------
+14) Der syncPPP Zugang zum Provider wird einfach mit dem Aufruf von
+ "/etc/rc.isdn" initialisiert. Jegliche Aktivitäten ins Internet (also z.B.
+ ein "ping 141.1.1.1") starten die Verbindung. Wenn in "/etc/isdn/isdnd.rc"
+ beim Eintrag "unitlengthsrc = " "rate" angegeben wurde, wird die Verbindung
+ kurz bevor die nächste Einheit begonnen wird, beendet. Informationen über
+ die Einheiten werden aus der Datei "/etc/isdn/isdnd.rates" ausgelesen
+ (Beispiele sind in "/etc/isdn/samples").
+
+ Mit "/etc/rc.isdn [restart|stop]" kann i4b entweder neu gestartet (z.B. zum
+ Einlesen der geänderten Konfiguration aus "isdnd.rc") oder beendet werden.
+
+15) Für den Anrufbeantworter muß nur der "isdnd" gestartet sein. Ein
+ ankommender Anruf wird dann automatisch angenommen (je nach den Einträgen
+ in "/etc/isdn/isdnd.rc").
+
+16) Informationen über die Verbindung erhält man sowohl in "/var/log/messages",
+ also auch in "/var/log/isdnd.log" (so der isdnd mit der Option "-l"
+ gestartet wird) bzw. auf dem aktuellen tty (wenn der isdnd mit der Option
+ "-f" gestartet wird).
diff --git a/share/examples/isdn/contrib/answer.c b/share/examples/isdn/contrib/answer.c
new file mode 100644
index 000000000000..da19aa946fd7
--- /dev/null
+++ b/share/examples/isdn/contrib/answer.c
@@ -0,0 +1,178 @@
+// $FreeBSD$
+// changed ".g711a" to ".al" (-hm)
+// Tue Mar 3 02:42:14 MET 1998 dave@turbocat.de
+// started
+
+#define BLK_SIZE 2048
+#define SOX "/usr/local/bin/sox"
+#define ALAWULAW "/usr/local/bin/alaw2ulaw"
+
+#include <stdio.h>
+#include <time.h>
+
+ FILE *device;
+ FILE *logfile;
+ char srcNum[30];
+ char destNum[30];
+ char argbuf[255];
+ char tmpBuf[1024] = "";
+
+
+void writeToPhone (char *path)
+{
+ char buf[BLK_SIZE];
+ FILE *srcfile;
+ int i = 0;
+ int readcount = 0;
+
+ srcfile = fopen(path,"r");
+ if (srcfile) {
+ for (i=0;i<BLK_SIZE;i++) {
+ buf[i] = '\0';
+ }
+ readcount = BLK_SIZE;
+ i = 0;
+ do {
+ readcount = fread(buf,1, BLK_SIZE, srcfile);
+ fwrite(buf, 1, readcount, device);
+ i = readcount + i;
+// fprintf(logfile,"%d read (%d)\n",i,readcount);
+ } while (readcount == BLK_SIZE);
+
+ fclose(srcfile);
+ } else {
+ fprintf(logfile,"Can't open file '%s'\n",path);
+ }
+}
+
+void readFromPhone (char *path)
+{
+ char buf[BLK_SIZE];
+ FILE *destfile;
+ int i = 0;
+ int readcount = 0;
+
+ destfile = fopen(path,"a");
+ if (destfile) {
+ for (i=0;i<BLK_SIZE;i++) {
+ buf[i] = '\0';
+ }
+ readcount = BLK_SIZE;
+ i = 0;
+ do {
+ readcount = fread(buf,1, BLK_SIZE, device);
+ fwrite(buf, 1, readcount, destfile);
+ i = readcount + i;
+// fprintf(logfile,"%d read (%d)\n",i,readcount);
+ } while (readcount == BLK_SIZE);
+
+ fclose(destfile);
+ } else {
+ fprintf(logfile,"Can't open file '%s'\n",path);
+ }
+}
+
+void usage (void)
+{
+ fprintf(stderr,"Usage: answer -D device -d destination -s source\n");
+ exit(1);
+}
+
+const char * argWithName (const char* aName)
+{
+ // '-D /dev/null -d 82834 -s 3305682834'
+ int i = 0;
+ int optionSeen = 0;
+ int startpos = 0;
+
+ for (i = 0; i < sizeof(tmpBuf);i++) {
+ tmpBuf[i] = '\0';
+ }
+
+ for (i = 0; i<strlen(argbuf);i++) {
+ if (optionSeen) {
+ for (;(i<strlen(argbuf) && (argbuf[i] != ' '));i++) {
+ }
+ i++;
+ startpos = i;
+
+ for (;(i<strlen(argbuf) && (argbuf[i] != ' '));i++) {
+ }
+ strncpy(tmpBuf,&argbuf[startpos], i-startpos);
+
+ return tmpBuf;
+ }
+ if (0 == strncmp(aName,&argbuf[i], strlen(aName))) {
+ optionSeen = 1;
+ }
+ }
+
+ usage();
+ return NULL;
+}
+
+int main (int argc, const char *argv[]) {
+
+ int i,pos = 0;
+ extern char *optarg;
+ extern int optind;
+ int bflag, ch;
+ char timeStr[50];
+ char outfileName[1024] = "";
+ char cmdStr[2048] = "";
+ time_t now;
+
+ now=time(NULL);
+
+ strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
+
+ logfile = fopen("/var/log/answer.log","a");
+
+ fprintf(logfile,"%s Started\n",timeStr);
+
+ pos=0;
+ for (i=1;i<argc;i++) {
+ sprintf(&argbuf[strlen(argbuf)],"%s ",argv[i]);
+ }
+ if (strlen(argbuf) > 2) {
+ argbuf[strlen(argbuf)-1] = '\0';
+ }
+
+
+ device = fopen(argWithName("-D"),"r+");
+ strcpy(destNum, argWithName("-d"));
+ strcpy(srcNum, argWithName("-s"));
+
+ fprintf(logfile,"device '%s'\n", argWithName("-D"));
+ fprintf(logfile,"srcNum '%s'\n", srcNum);
+ fprintf(logfile,"destNum '%s'\n", destNum);
+
+
+ if (device) {
+
+ strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
+
+ sprintf(outfileName,"/var/isdn/%s_%s_%s", timeStr, srcNum, destNum);
+
+ writeToPhone ("/usr/local/lib/isdn/msg.al");
+ readFromPhone (outfileName);
+
+ sprintf(cmdStr,"/bin/cat %s | %s | %s -t raw -U -b -r 8000 - -t .au %s.snd", outfileName, ALAWULAW, SOX, outfileName);
+ fprintf(logfile,"%s\n",cmdStr);
+ system(cmdStr);
+ unlink(outfileName);
+
+ fclose(device);
+ } else {
+ fprintf(logfile,"Can't open file '%s'\n",argWithName("-D"));
+ }
+
+ now=time(NULL);
+
+ strftime(timeStr,40,I4B_TIME_FORMAT,localtime(&now));
+
+ fprintf(logfile,"%s Done\n",timeStr);
+ fclose(logfile);
+ exit(0); // insure the process exit status is 0
+ return 0; // ...and make main fit the ANSI spec.
+}
diff --git a/share/examples/isdn/contrib/answer.sh b/share/examples/isdn/contrib/answer.sh
new file mode 100644
index 000000000000..34073d359923
--- /dev/null
+++ b/share/examples/isdn/contrib/answer.sh
@@ -0,0 +1,111 @@
+#!/bin/sh
+#---------------------------------------------------------------------------
+#
+# answer script for i4b isdnd
+# ---------------------------
+#
+# last edit-date: [Fri May 25 15:21:05 2001]
+#
+# $FreeBSD$
+#
+#---------------------------------------------------------------------------
+VARDIR=/var/isdn
+LIBDIR=/usr/local/lib/isdn
+LOGFILE=/tmp/answer.log
+
+NCALLFILE=$VARDIR/ncall
+DATE=`date +%d%H`
+
+progname=${0##*/}
+set -- $@ # have to split argument string !!!
+
+# ----------------------------------------------------------------------
+
+usage ()
+{
+ echo "usage: $progname -D device -d dest -s src"
+ exit 1
+}
+
+ncall ()
+{
+ nfile=$1
+ [ -f $nfile ] && read n < $nfile || n=0
+ echo $(($n + 1)) > $nfile
+ printf "%.4d" $n
+}
+
+# ----------------------------------------------------------------------
+
+while getopts "D:d:s:" opt
+do
+ case $opt
+ in
+D) DEVICE=$OPTARG ;;
+d) DEST=$OPTARG ;;
+s) SRC=$OPTARG ;;
+ esac
+done
+
+[ -c "$DEVICE" -a -n "$DEST" -a -n "$SRC" ] || usage;
+
+shift $(($OPTIND - 1))
+
+# ----------------------------------------------------------------------
+
+NCALL=`ncall $NCALLFILE`
+
+echo "$progname: device $DEVICE destination $DEST source $SRC " >>$LOGFILE
+
+{
+ echo "Date: "`date`
+ echo "From: \"$SRC\""
+ echo "To: \"$DEST\""
+ echo
+} >> $VARDIR/I.$NCALL.$DATE
+
+# ----------------------------------------------------------------------
+
+tellnumber ()
+{
+ number=$1
+ digits=`echo $number | sed -e 's/\(.\)/\1 /g'`
+
+ files=""
+ for digit in $digits
+ do
+ files="$files $LIBDIR/$digit.al"
+ done
+ cat $files
+}
+
+# ----------------------------------------------------------------------
+
+do_answer ()
+{
+ [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
+ [ -f $LIBDIR/msg.al ] && cat $LIBDIR/msg.al
+ [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
+} > $DEVICE
+
+do_record ()
+{
+ cat $DEVICE > $VARDIR/R.$NCALL.$DATE
+}
+
+do_tell ()
+{
+ [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
+ [ -f $LIBDIR/msg.al ] && cat $LIBDIR/msg.al
+ tellnumber $SRC
+ [ -f $LIBDIR/beep.al ] && cat $LIBDIR/beep.al
+} > $DEVICE
+
+# ----------------------------------------------------------------------
+
+case $progname
+in
+answer) do_answer ;;
+record) do_answer; do_record ;;
+tell) do_tell ;;
+esac
diff --git a/share/examples/isdn/contrib/convert.sh b/share/examples/isdn/contrib/convert.sh
new file mode 100644
index 000000000000..b4a6e7d8d852
--- /dev/null
+++ b/share/examples/isdn/contrib/convert.sh
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# convert recorded message to WAV format, optionally send it via mail
+#
+# by: Stefan Herrmann <stefan@asterix.webaffairs.net>
+# Date: Fr 22 Mai 1998 14:18:40 CEST
+#
+# $FreeBSD$
+
+CAT=/bin/cat
+RM=/bin/rm
+SOX=/usr/local/bin/sox
+ALAW2ULAW=/usr/local/bin/alaw2ulaw
+MAIL=/usr/bin/mail
+GZIP=/usr/bin/gzip
+ZIP=/usr/local/bin/zip
+UUENCODE=/usr/bin/uuencode
+
+inputfile=""
+outfilename=""
+mailto=""
+iF=0
+oF=0
+mF=0
+
+set -- `getopt i:o:m: $*`
+
+if test $? != 0
+then
+ echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
+ exit 1
+fi
+
+for i
+do
+ case "$i"
+ in
+ -i)
+ inputfile=$2
+ iF=1
+ shift
+ shift
+ ;;
+ -o)
+ outfilename=$2
+ oF=1
+ shift
+ shift
+ ;;
+ -m)
+ mailto=$2
+ mF=1
+ shift
+ shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ esac
+done
+
+if [ $iF -eq 0 -o $oF -eq 0 ]
+then
+ echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
+ exit 1
+fi
+
+if [ $iF -eq 1 -a $oF -eq 1 ]
+then
+ echo
+ echo "converting $inputfile to $outfilename.wav ..."
+
+ $CAT $inputfile | $ALAW2ULAW | $SOX -t raw -U -b -r 8000 - -t .wav $outfilename.wav
+fi
+
+if [ $iF -eq 1 -a $oF -eq 1 -a $mF -eq 1 ]
+then
+ echo "... and sending it via email to $mailto ..."
+ $UUENCODE $outfilename.wav message.wav | $MAIL -s"new message $outfilename" $mailto && $RM $outfilename.wav
+ # only usefull when sending over the internet
+ #$GZIP -c $outfilename.wav | $UUENCODE message.zip | $MAIL -s"Nachricht vom ISDN Anrufbeantworter" $mailto && $RM $outfilename.wav
+fi
+
+echo "done."
+echo
diff --git a/share/examples/isdn/contrib/hplay.c b/share/examples/isdn/contrib/hplay.c
new file mode 100644
index 000000000000..10660ac7b7b1
--- /dev/null
+++ b/share/examples/isdn/contrib/hplay.c
@@ -0,0 +1,241 @@
+/*---------------------------------------------------------------------------*
+ *
+ * rsynth driver to output to
+ * - an open isdn4bsd telephone connection or
+ * - an output file or
+ * - the /dev/audio device
+ * ----------------------------------------------------------------
+ *
+ * tested with rsynth-2.0
+ *
+ * written by Hellmuth Michaelis (hm@kts.org)
+ *
+ * last edit-date: [Fri May 25 15:21:33 2001]
+ *
+ * $FreeBSD$
+ *
+ *---------------------------------------------------------------------------*/
+
+#include <config.h>
+#include <useconfig.h>
+#include <stdio.h>
+#include <math.h>
+#include <errno.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <sys/signal.h>
+#include <sys/ioctl.h>
+
+#include <machine/i4b_tel_ioctl.h>
+
+#include "proto.h"
+#include "getargs.h"
+#include "hplay.h"
+#include "l2u.h"
+
+#define SAMP_RATE 8000
+long samp_rate = SAMP_RATE;
+
+char *prog = "hplay";
+
+static int use_audio = 1;
+static int use_isdn = 0;
+static int unit_no = 0;
+
+static int audio_fd = -1;
+static int isdn_fd = -1;
+static int file_fd = -1;
+
+char *audio_dev = "/dev/dsp";
+char *isdn_dev = "/dev/i4btel";
+static char *ulaw_file = NULL;
+
+int
+audio_init(int argc, char *argv[])
+{
+ char dev[64];
+ int format = CVT_ALAW2ULAW;
+
+ prog = argv[0];
+
+ argc = getargs("FreeBSD audio/i4b/file output driver",argc, argv,
+ "a", NULL, &use_audio, "use /dev/audio (default)",
+ "i", NULL, &use_isdn, "use /dev/i4btel",
+ "u", "%d", &unit_no, "/dev/i4btel unit number (def = 0)",
+ "f", "", &ulaw_file, "u-law output to file",
+ NULL);
+
+ if(help_only)
+ return argc;
+
+ if(ulaw_file)
+ {
+ if(strcmp(ulaw_file, "-") == 0)
+ {
+ file_fd = 1; /* stdout */
+ }
+ else
+ {
+ file_fd = open(ulaw_file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
+ if(file_fd < 0)
+ fprintf(stderr, "ERROR: cannot open %s, error = %s\n", ulaw_file, strerror(errno));
+ }
+ }
+
+ if(use_isdn)
+ {
+ sprintf(dev, "%s%d", isdn_dev, unit_no);
+
+ if((isdn_fd = open(dev, O_WRONLY)) < 0)
+ {
+ fprintf(stderr, "ERROR: cannot open %s, error = %s\n", dev, strerror(errno));
+ }
+
+ if((ioctl(isdn_fd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
+ {
+ fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
+ }
+ }
+
+ if(use_audio)
+ {
+ audio_fd = open(audio_dev, O_WRONLY | O_NDELAY);
+ if(audio_fd < 0)
+ {
+ fprintf(stderr, "ERROR: cannot open %s, error = %s\n", audio_dev, strerror(errno));
+ }
+ }
+
+ return argc;
+}
+
+void
+audio_term()
+{
+ int format = CVT_NONE;
+
+ if(isdn_fd >= 0)
+ {
+ if((ioctl(isdn_fd, I4B_TEL_SETAUDIOFMT, &format)) < 0)
+ {
+ fprintf(stderr, "ioctl I4B_TEL_SETAUDIOFMT failed: %s", strerror(errno));
+ }
+ close(isdn_fd);
+ isdn_fd = -1;
+ }
+
+ if(audio_fd >= 0)
+ {
+#if 0
+ ioctl(audio_fd, SNDCTL_DSP_SYNC, &dummy);
+#endif
+ close(audio_fd);
+ audio_fd = -1;
+ }
+
+ if(file_fd >= 0)
+ {
+ close(file_fd);
+ file_fd = -1;
+ }
+}
+
+void
+audio_play(int n, short *data)
+{
+ int ret;
+ unsigned char *p;
+
+ if (n > 0)
+ {
+ unsigned char *converted = (unsigned char *) malloc(n);
+ int i;
+
+ if(converted == NULL)
+ {
+ fprintf(stderr, "Could not allocate memory for conversion\n");
+ exit(3);
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ converted[i] = short2ulaw(data[i]);
+ }
+
+ if (isdn_fd >= 0)
+ {
+ p = converted;
+ errno = 0;
+
+ while((ret = write(isdn_fd, p, n)) != n)
+ {
+ if(!errno)
+ {
+ p += ret;
+ if(p > (converted + n))
+ break;
+ }
+ else
+ {
+ fprintf(stderr, "write /dev/i4btel ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
+ break;
+ }
+ }
+ }
+
+ for (i = 0; i < n; i++)
+ converted[i] = (data[i] - 32768) / 256;
+
+ if(audio_fd >= 0)
+ {
+ p = converted;
+
+ errno = 0;
+
+ while((ret = write(audio_fd, p, n)) != n)
+ {
+ if(!errno)
+ {
+ p += ret;
+ if(p > (converted + n))
+ break;
+ }
+ else
+ {
+ fprintf(stderr, "write /dev/dsp ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
+ break;
+ }
+ }
+ }
+
+ if(file_fd >= 0)
+ {
+ int ret;
+ p = converted;
+
+ errno = 0;
+
+ while((ret = write(file_fd, p, n)) != n)
+ {
+ if(!errno)
+ {
+ p += ret;
+ if(p > (converted + n))
+ break;
+ }
+ else
+ {
+ fprintf(stderr, "write file ERROR: ret (%d) != n (%d), error = %s\n", ret, n, strerror(errno));
+ break;
+ }
+ }
+ }
+
+ free(converted);
+ }
+}
+
+/* EOF */
diff --git a/share/examples/isdn/contrib/i4b-ppp-newbie.txt b/share/examples/isdn/contrib/i4b-ppp-newbie.txt
new file mode 100644
index 000000000000..7d6c4b0870ae
--- /dev/null
+++ b/share/examples/isdn/contrib/i4b-ppp-newbie.txt
@@ -0,0 +1,237 @@
+$FreeBSD$
+
+ PPP mit isdn4bsd
+ _________________________________________________________________
+
+ Version 1.01
+ Datum: 22.02.1999
+ Autor: [1]Dominik Brettnacher <domi@saargate.de>
+
+ - Anmerkungen und Verbesserungsvorschläge sind willkommen -
+
+ 1. vorab
+ Dieser Text soll Neulingen helfen, sich mittels isdn4bsd und BSD
+ per PPP z.B. bei ihrem Provider einwählen zu können.
+ isdn4bsd bringt einiges an Dokumentation und
+ Konfigurationsbeispielen mit, jedoch ist es nicht immer leicht,
+ die entsprechenden Hinweise gut miteinander zu kombinieren, so daß
+ am Schluß das dabei herauskommt, was man haben möchte.
+ 2. Wo bekomme ich isdn4bsd?
+ hier solle es keine allzu großen Probleme geben: isdn4bsd ist auf
+ dem FTP-Server [2]ftp.consol.de erhältlich. Man beachte dabei, daß
+ man sich nicht, wie üblich, als anonymous, sondern als isdn4bsd
+ einloggen muß. Benutzer von Browsern geben als Adresse
+ [3]ftp://isdn4bsd@ftp.consol.de und als Passwort ihre
+ eMail-Adresse an.
+ Wertvolle Informationen findet man in der Datei README.
+ 3. Welche ISDN-Karten werden unterstützt?
+ Informationen darüber findet man in der README-Datei.
+ 4. Ich benutze einen externen ISDN-Adapter - was nun?
+ Externe Adapter benötigen keine direkte Unterstützung, weil sie
+ über die serielle Schnittstelle angesteuert werden. Man kann also
+ das normale PPP benutzen. man ppp hilft hier sicher weiter.
+ 5. isdn4bsd installieren
+ Wie man isdn4bsd installiert, steht in der Datei
+ FreeBSD/INSTALLATION (für NetBSD und OpenBSD analog). Eine
+ Beispielkonfiguration des Kernel sieht so aus:
+[...]
+#
+# i4b passive ISDN cards support (isic - I4b Siemens Isdn Chipset driver)
+# note that the ``options'' and ``device'' lines must BOTH be defined !
+#
+# Non-PnP Cards:
+# --------------
+#
+# AVM A1 or AVM Fritz!Card
+options "AVM_A1"
+device isic0 at isa? port 0x300 net irq 15 flags 4 vector isicintr
+#
+# ISDN Protocol Stack
+# -------------------
+#
+# Q.921 / layer 2 - i4b passive cards D channel handling
+pseudo-device "i4bq921"
+#
+# Q.931 / layer 3 - i4b passive cards D channel handling
+pseudo-device "i4bq931"
+#
+# layer 4 - i4b common passive and active card handling
+pseudo-device "i4b"
+#
+# ISDN devices
+# ------------
+#
+# userland driver to do ISDN tracing (for passive cards only)
+pseudo-device "i4btrc" 4
+#
+# userland driver to control the whole thing
+pseudo-device "i4bctl"
+#
+# userland driver for access to raw B channel
+#pseudo-device "i4brbch" 4
+#
+# userland driver for telephony
+#pseudo-device "i4btel" 2
+#
+# network driver for IP over raw HDLC ISDN
+#pseudo-device "i4bipr" 4
+# enable VJ header compression detection for ipr i/f
+#options IPR_VJ
+#
+# network driver for sync PPP over ISDN
+pseudo-device "i4bisppp" 1
+pseudo-device sppp 1
+#
+#---------------------------------------------------------------------------
+[...]
+ Nachdem ein neuer Kernel kompiliert und das System neugestartet
+ wurde, kann es weiter gehen.
+ 6. Konfiguration isdnd.rc
+ Die für ISDN wichtigste Konfigurationsdatei ist
+ /etc/isdn/isdnd.rc. Mit man isdnd.rc erhält man Informationen über
+ die Einstellungen, die man dort vornehmen kann. Im Folgenden ein
+ Beispiel:
+
+
+#==============================================================================
+# SYSTEM section: isdnd global configuration parameters
+#==============================================================================
+system
+
+# accounting
+# ----------
+
+acctall = on # generate info for everything
+acctfile = /var/log/isdnd.acct # name & location of accounting file
+useacctfile = yes # generate accouting info to file
+
+# monitor
+# -------
+
+monitor-allowed = no # global switch: monitor on/off
+monitor-port = 451 # default monitor TCP port
+
+# Monitor rights are granted due to the most specific host/net spec, i.e. in
+# the example below host 192.168.1.2 will have the rights specified on that
+# line, even so it belongs to net 192.168.1.0/24 as well.
+#
+# A monitor specification may either be:
+#
+# - the name of a local (UNIX-domain) socket; this MUST start with a "/"
+monitor = "/var/run/isdn-monitor"
+monitor-access = fullcmd
+monitor-access = channelstate, logevents
+monitor-access = callin, callout
+
+# ratesfile
+# ---------
+
+ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
+
+# regular expression pattern matching
+# -----------------------------------
+
+#regexpr = "connected.*KTS" # look for matches in log messages
+#regprog = connectKTS # execute program when match is found
+
+# realtime priority section
+# -------------------------
+
+rtprio = 25 # modify isdnd's process priority
+
+###############################################################################
+entry
+name = lf
+usrdevicename = isp
+usrdeviceunit = 0
+isdncontroller = 0
+isdnchannel = -1
+local-phone-incoming = 012345678
+remote-phone-incoming = 876543210
+local-phone-dialout = 012345678
+remote-phone-dialout = 876543210
+remdial-handling = first
+dialin-reaction = accept
+dialout-type = normal
+b1protocol = hdlc
+idletime-incoming = 240
+idletime-outgoing = 30
+earlyhangup = 5
+ratetype = 0
+unitlength = 90
+unitlengthsrc = rate
+dialretries = 3
+dialrandincr = on
+recoverytime = 25
+
+connectprog = is-up
+disconnectprog = is-down
+
+ Wichtig sind hier für den Neuling die vier *-phone-* Einträge, die
+ jeweils die lokale Rufnummer und die der Gegenstelle für ein- und
+ ausgehende Verbindungen angeben.
+
+ 7. ISDN-Verbindungen aufbauen
+ um ISDN-Verbindungen aufzubauen, bedarf es einiger Befehle, die
+ beim Systemstart aufgerufen werden. Man kann sie zum Beispiel am
+ Ende von /etc/rc.local unterbringen. Hier gibt es aber durchaus
+ noch andere Lösungen:
+ [...]
+ # start ISDN
+ echo -n 'ppp / ISDN...'
+ echo -n 'isdnd...'
+ /usr/local/bin/isdnd
+ echo -n 'ifconfig...'
+ ifconfig isp0 link1 0.0.0.0 1.1.1.1 netmask 0xffffff00
+ ifconfig isp0 down
+ echo -n 'sppp...'
+ spppcontrol isp0 myauthproto=pap myauthname="xxx"
+ myauthsecret="xxx" hisauthproto=none
+ echo -n 'ifconfig...'
+ ifconfig isp0 up
+ echo -n 'setting routes...'
+ route add default -interface isp0
+ echo '.'
+ Ändern muß man hier eventuell die Zieladresse des Providers (im
+ Beispiel 1.1.1.1). Man bekommt diese entweder vom Provider, oder
+ aber man muß einen Versuch daransetzen, sie selbst herauszufinden.
+ Wie das funktioniert, steht in der Datei FAQ des isdn4bsd-Paketes.
+ Auch am Aufruf von spppcontrol (Vorsicht: spppcontrol bis
+ hisauthproto=none ist eine Zeile!) muß noch etwas umgestellt
+ werden:
+ + myauthproto steht für das Authentifizierungsprotokoll.
+ Möglich sind pap oder chap.
+ + myauthname ist der PPP-Benutzername.
+ + myauthsecret ist das PPP-Kennwort.
+ Wenn man nun die Befehle in /etc/rc.local ausführt, kann man mit
+ einem ping auf eine beliebige Adresse außerhalb des lokalen Netzes
+ eine Verbindung öffnen. Sie wird automatisch nach einiger
+ Inaktivität (siehe isdnd.rc) wieder geschlossen.
+
+ 8. Es funktioniert nicht - was kann ich tun?
+ Es gibt einige Möglichkeiten zur Fehlerdiagnose:
+ + dmesg gibt Aufschluß darüber, ob die Karte richtig erkannt
+ wurde.
+ + ifconfig (siehe rc.local) kann mit dem Parameter debug
+ aufgerufen werden und gibt dann einiges an Informationen aus.
+ + die Nachrichten in /var/log/messages können außerdem
+ hilfreich sein
+
+ 9. wer kann mir helfen?
+ + die erste Adresse für ISDN-Probleme ist die Mailingliste
+ [4]freebsd-isdn@freebsd.org - man bestellt sie, indem man
+ eine Mail mit dem Text subscribe freebsd-isdn an
+ [5]majordomo@freebsd.org schickt.
+ + auch die deutschsprachige Mailingliste kann hilfreich sein.
+ Mit einer Mail an [6]majordomo@de.freebsd.org, die im Text
+ subscribe de-bsd-questions enthält bestellt man sie.
+ _________________________________________________________________
+
+References
+
+ 1. mailto:domi@saargate.de
+ 2. ftp://isdn4bsd@ftp.consol.de/
+ 3. ftp://isdn4bsd@ftp.consol.de/
+ 4. mailto:freebsd-isdn@freebsd.org
+ 5. mailto:majordomo@freebsd.org
+ 6. mailto:majordomo@de.freebsd.org
diff --git a/share/examples/isdn/contrib/isdnctl b/share/examples/isdn/contrib/isdnctl
new file mode 100644
index 000000000000..f9de44fbb834
--- /dev/null
+++ b/share/examples/isdn/contrib/isdnctl
@@ -0,0 +1,111 @@
+#!/bin/sh
+
+# isdnctl
+# Control the ISDN line based on usage
+#
+# This script can control the state of your ISDN line. It counts
+# how many scripts/users currently use the ISDN line and uses
+# "ifconfig down" if noone uses it any more.
+# I use this script for cronjobs that fetch mail and news and run cvsup.
+# If I'm still using the line, the script won't close the connection,
+# but if not, it saves a lot of phone costs.
+#
+# ----------------------------------------------------------------------------
+# "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp):
+# Alexander Langer <alex@big.endian.de> wrote this file. As long as you retain
+# this notice you can do whatever you want with this stuff. If we meet some
+# day, and you think this stuff is worth it, you can buy me a beer in return.
+#
+# Alexander Langer
+# ----------------------------------------------------------------------------
+#
+# $FreeBSD$
+#
+
+
+usage () {
+ echo "Usage: $0 [-i interface] [-f /path/to/users.file] [up|down|show]"
+}
+
+# Defaults
+INTERFACE=isp0
+USERSFILE=
+
+# Getopt stuff
+args=`getopt i:f: $*`
+if [ $? != 0 ]; then
+ usage
+ exit 2
+ fi
+set -- $args
+for i; do
+ case "$i" in
+ -i)
+ INTERFACE="$2"
+ shift; shift
+ ;;
+ -f)
+ USERSFILE="$2"
+ shift; shift
+ ;;
+ --)
+ shift
+ break
+ ;;
+ esac
+done
+
+if [ -z $USERSFILE ]; then
+ USERSFILE=/var/run/isdn.users.$INTERFACE
+fi
+
+if [ -z $1 ]; then
+ usage
+ exit 2
+fi
+
+# Does Usersfile exist?
+if [ ! -f $USERSFILE ]; then
+ # Try to create it
+ if ! /sbin/ifconfig $INTERFACE | grep "^$INTERFACE.*<UP," > /dev/null; then
+ echo "0" > $USERSFILE || exit 1
+ else
+ echo "1" > $USERSFILE || exit 1
+ fi
+elif [ ! -w $USERSFILE ]; then
+ echo "Error: $USERSFILE not writeable!"
+ exit 1
+fi
+
+if ! /sbin/ifconfig $INTERFACE | grep "^$INTERFACE.*<UP," > /dev/null; then
+ if ! cat $USERSFILE | grep '^0$' > /dev/null ; then
+ echo "Interface down, removing number from file";
+ echo "0" > $USERSFILE
+ fi;
+fi;
+
+case "$1" in
+ show)
+ echo "`cat $USERSFILE` users online"
+ ;;
+ up)
+ expr `cat $USERSFILE` + 1 > $USERSFILE
+ /sbin/ifconfig $INTERFACE up
+ echo "`cat $USERSFILE` users online"
+ ;;
+ down)
+ if cat $USERSFILE | grep '^0$' > /dev/null ; then
+ echo "Already down"
+ exit 0
+ fi
+ expr `cat $USERSFILE` - 1 > $USERSFILE
+ if cat $USERSFILE | grep '^0$' > /dev/null ; then
+ echo "`cat $USERSFILE` users online, interface down"
+ /sbin/ifconfig $INTERFACE down
+ exit 0
+ fi
+ echo "`cat $USERSFILE` users online"
+ ;;
+esac
+
+exit 0
diff --git a/share/examples/isdn/contrib/isdnd_acct b/share/examples/isdn/contrib/isdnd_acct
new file mode 100644
index 000000000000..21223b7cd0f4
--- /dev/null
+++ b/share/examples/isdn/contrib/isdnd_acct
@@ -0,0 +1,137 @@
+#!/usr/bin/perl
+#---------------------------------------------------------------------------
+#
+# Copyright (c) 1996, 1998 Hellmuth Michaelis. 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.
+#
+#---------------------------------------------------------------------------
+#
+# accounting report script for the isdnd daemon accounting info
+# -------------------------------------------------------------
+#
+# last edit-date: [Fri May 25 15:28:20 2001]
+#
+# $FreeBSD$
+#
+#---------------------------------------------------------------------------
+
+# where the isdnd accounting file resides
+$ACCT_FILE = "/var/log/isdnd.acct";
+
+# the charge for a unit, currently 0,12 DM
+$UNIT_PRICE = 0.12;
+
+# open accounting file
+open(IN, $ACCT_FILE) ||
+ die "ERROR, cannot open $ACCT_FILE !\n";
+
+# set first thru flag
+$first = 1;
+
+# process file line by line
+while (<IN>)
+{
+ # remove ( and ) from length and bytecounts
+ tr/()//d;
+
+ # split line into pieces
+ ($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
+ = split(/ /, $_);
+
+ # get starting date
+ if($first)
+ {
+ $from = "$from_d $from_h";
+ $first = 0;
+ }
+
+ # split bytecount
+ ($inb, $outb) = split(/\//, $byte);
+
+ # process fields
+ $a_secs{$name} += $secs;
+ $a_calls{$name}++;
+ $a_units{$name} += $units;
+ $a_charge{$name} += $units * $UNIT_PRICE;
+ $a_inbytes{$name} += $inb;
+ $a_outbytes{$name} += $outb;
+ $a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
+}
+
+# close accouting file
+close(IN);
+
+# write header
+print "\n";
+print " ISDN Accounting Report ($from -> $to_d $to_h)\n";
+print " =====================================================================\n";
+
+#write the sum for each interface/name
+foreach $name (sort(keys %a_secs))
+{
+ $o_secs = $a_secs{$name};
+ $gt_secs += $o_secs;
+ $o_calls = $a_calls{$name};
+ $gt_calls += $o_calls;
+ $o_units = $a_units{$name};
+ $gt_units += $o_units;
+ $o_charge = $a_charge{$name};
+ $gt_charge += $o_charge;
+ $o_inbytes = $a_inbytes{$name};
+ $gt_inbytes += $o_inbytes;
+ $o_outbytes = $a_outbytes{$name};
+ $gt_outbytes += $o_outbytes;
+ $o_bytes = $a_bytes{$name};
+ $gt_bytes += $o_bytes;
+ write;
+}
+
+$o_secs = $gt_secs;
+$o_calls = $gt_calls;
+$o_units = $gt_units;
+$o_charge = $gt_charge;
+$o_inbytes = $gt_inbytes;
+$o_outbytes = $gt_outbytes;
+$o_bytes = $gt_bytes;
+$name = "Total";
+
+print "======= ====== ===== ===== ======== ============ ============ ============\n";
+write;
+
+print "\n\n";
+exit;
+
+# top of page header
+format top =
+
+Name charge units calls secs inbytes outbytes bytes
+------- ------ ----- ----- -------- ------------ ------------ ------------
+.
+
+# record template
+format STDOUT =
+@<<<<<< @##.## @#### @#### @####### @########### @########### @###########
+$name, $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
+.
+
+# EOF
diff --git a/share/examples/isdn/contrib/isdnd_acct.pl b/share/examples/isdn/contrib/isdnd_acct.pl
new file mode 100644
index 000000000000..03062160104d
--- /dev/null
+++ b/share/examples/isdn/contrib/isdnd_acct.pl
@@ -0,0 +1,258 @@
+#!/usr/bin/perl
+#
+#ich habe zwei vielleicht n?tzliche Erweiterungen an isdn_pacct
+#gemacht:
+#
+# 1) Man kann den Namen der Accounting-Datei angeben. Ich
+# habe Accounting-Files nach Telekom-Rechnung aufgeteilt
+# und kann diese so sehr sch?n nachvollziehen.
+#
+# 2) Die Abrechnung wird nach Einheitenl?ngen aufgelistet.
+# Leider wird zur Zeit immer Nahzone verwendet (isdnd.rates
+# wird ausgelesen), und Feiertage stehen als erstes auf
+# der TODO-Liste. Wenn man dieses Feature durch einen
+# Switch anschaltet, kann man es sogar unauff?llig in die
+# Distribution aufnehmen.
+#
+# Mir hilft diese Abrechnung, an mir zu arbeite und mehr
+# Tests und Zug?nge nachts durchzuf?hren... Aber die meisten
+# Einheiten werden immer noch im 90s-Takt verbraucht :-(
+#
+# $FreeBSD$
+#
+#---------------------------------------------------------------------------
+#
+# Copyright (c) 1994, 1996 Hellmuth Michaelis. 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Hellmuth Michaelis
+# 4. Neither the name of the author nor the names of any co-contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# 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.
+#
+#---------------------------------------------------------------------------
+#
+# accounting script for the isdn daemon accounting info
+# -----------------------------------------------------
+#
+# last edit-date: [Fri May 25 15:22:26 2001]
+#
+# -hm my first perl program :-)
+# -hm sorting the output
+# -hm adding grand total
+#
+#---------------------------------------------------------------------------
+
+sub wday {
+ local ($y, $m, $d) = @_;
+ local ($nday, @mon);
+
+ @mon = (0, 31, 61, 92, 122, 153, 184, 214, 245, 275, 306, 337);
+# M A M J J A S O N D J F
+
+ if ($m > 2) {
+ $m -= 3;
+ } else {
+ $m += 9;
+ $y--;
+ }
+ if ($y < 1600) {
+ return -1;
+ }
+ $y -= 1600;
+ $nday = $y * 365 + $mon[$m] + $d +
+ int($y / 4) - int($y / 100) + int($y / 400);
+ ($nday + 2) % 7;
+}
+
+# where the isdnd accounting file resides
+if ($#ARGV == 0) {
+ $ACCT_FILE = $ARGV[0];
+} else {
+ $ACCT_FILE = "/var/log/isdnd.acct";
+}
+
+# $PERIOD_FILE = "/usr/local/etc/isdnd.periods";
+# # read periods that need to be separately listed
+# if (open(IN, $PERIOD_FILE)) {
+# while (<IN>) {
+# chop;
+# ($start, $end) = split(/ /);
+# push(@p_start, $start);
+# push(@p_end, $end);
+# }
+# close(IN);
+# }
+
+$RATES_FILE = "/etc/isdn/isdnd.rates";
+if (open(IN, $RATES_FILE)) {
+ while(<IN>) {
+ chop;
+ if (! /^ra0/) {
+ next;
+ }
+ ($ra0, $day, $rest) = split(/[ \t]+/, $_, 3);
+ @periods = split(/[ \t]+/, $rest);
+ foreach $period (@periods) {
+ ($h_start, $m_start, $h_end, $m_end, $secs) =
+ $period =~ /(.+)\.(.+)-(.+)\.(.+):(.+)/;
+ for ($h = int($h_start); $h < $h_end; $h++) {
+ $secs{$day, $h} = $secs;
+ }
+ }
+ }
+ close(IN);
+}
+
+# the charge for a unit, currently 0,12 DM
+$UNIT_PRICE = 0.12;
+
+# open accounting file
+open(IN, $ACCT_FILE) ||
+ die "ERROR, cannot open $ACCT_FILE !\n";
+
+# set first thru flag
+$first = 1;
+
+# process file line by line
+while (<IN>)
+{
+ # remove ( and ) from length and bytecounts
+ tr/()//d;
+
+ # split line into pieces
+ ($from_d, $from_h, $dash, $to_d, $to_h, $name, $units, $secs, $byte)
+ = split(/ /, $_);
+
+ # get starting date
+ if($first)
+ {
+ $from = "$from_d $from_h";
+ $first = 0;
+ }
+
+ # split bytecount
+ ($inb, $outb) = split(/\//, $byte);
+
+ # if user wants to account time periods, put this to the right
+ # slot(s)
+ ($hour, $minute, $second) = split(/:/, $from_h);
+ ($day, $mon, $year) = split(/\./, $from_d);
+ $day = &wday('19' . $year, $mon, $day);
+ if ($secs{$day, int($hour)}) {
+ $secs = $secs{$day, int($hour)};
+ # process fields
+ $p_secs{$name, $secs} += $secs;
+ $p_calls{$name, $secs}++;
+ $p_units{$name, $secs} += $units;
+ $p_charge{$name, $secs} += $units * $UNIT_PRICE;
+ $p_inbytes{$name, $secs} += $inb;
+ $p_outbytes{$name, $secs} += $outb;
+ $p_bytes{$name, $secs} = $p_bytes{$name, $secs} + $inb + $outb;
+ }
+
+ # process fields
+ $a_secs{$name} += $secs;
+ $a_calls{$name}++;
+ $a_units{$name} += $units;
+ $a_charge{$name} += $units * $UNIT_PRICE;
+ $a_inbytes{$name} += $inb;
+ $a_outbytes{$name} += $outb;
+ $a_bytes{$name} = $a_bytes{$name} + $inb + $outb;
+}
+
+# close accouting file
+close(IN);
+
+# write header
+print "\n";
+print " ISDN Accounting Report ($from -> $to_d $to_h)\n";
+print " =================================================================\n";
+
+#write the sum for each interface/name
+foreach $n (sort(keys %a_secs))
+{
+ $o_secs = $a_secs{$n};
+ $gt_secs += $o_secs;
+ $o_calls = $a_calls{$n};
+ $gt_calls += $o_calls;
+ $o_units = $a_units{$n};
+ $gt_units += $o_units;
+ $o_charge = $a_charge{$n};
+ $gt_charge += $o_charge;
+ $o_inbytes = $a_inbytes{$n};
+ $gt_inbytes += $o_inbytes;
+ $o_outbytes = $a_outbytes{$n};
+ $gt_outbytes += $o_outbytes;
+ $o_bytes = $a_bytes{$n};
+ $gt_bytes = $o_bytes;
+ $name = $n;
+ write;
+
+ foreach $i (keys %p_secs) {
+ ($nam, $secs) = split(/$;/, $i);
+ if ($nam ne $n) {
+ next;
+ }
+ $o_secs = $p_secs{$i};
+ $o_calls = $p_calls{$i};
+ $o_units = $p_units{$i};
+ $o_charge = $p_charge{$i};
+ $o_inbytes = $p_inbytes{$i};
+ $o_outbytes = $p_outbytes{$i};
+ $o_bytes = $p_bytes{$i};
+ $name = sprintf(' %5.1fs', $secs / 10);
+ write;
+ }
+}
+
+$o_secs = $gt_secs;
+$o_calls = $gt_calls;
+$o_units = $gt_units;
+$o_charge = $gt_charge;
+$o_inbytes = $gt_inbytes;
+$o_outbytes = $gt_outbytes;
+$o_bytes = $gt_bytes;
+$name = "Total";
+
+print "======= ====== ===== ===== ======== ============ ============ ============\n";
+write;
+
+print "\n\n";
+exit;
+
+# top of page header
+format top =
+
+Name charge units calls secs inbytes outbytes bytes
+------- ------ ----- ----- -------- ------------ ------------ ------------
+.
+
+# record template
+format STDOUT =
+@<<<<<< @##.## @#### @#### @####### @########### @########### @###########
+$name, $o_charge, $o_units, $o_calls, $o_secs, $o_inbytes, $o_outbytes, $o_bytes
+.
+
+# EOF
diff --git a/share/examples/isdn/contrib/isdntelmux.c b/share/examples/isdn/contrib/isdntelmux.c
new file mode 100644
index 000000000000..318ebfcb937e
--- /dev/null
+++ b/share/examples/isdn/contrib/isdntelmux.c
@@ -0,0 +1,197 @@
+/*
+ * Copyright (c) 1999 Michael Reifenberger (Michael@Reifenberger.com).
+ * 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.
+ *
+ *---------------------------------------------------------------------------
+ *
+ * i4btemux - record while playing
+ * ===============================
+ *
+ * $FreeBSD$
+ *
+ *----------------------------------------------------------------------------*/
+
+#include<stdio.h>
+#include<stdarg.h>
+#include<signal.h>
+#include<errno.h>
+#include<string.h>
+#include<stdlib.h>
+#include<unistd.h>
+#include<fcntl.h>
+#include<ctype.h>
+#include<sys/stat.h>
+#include<sys/wait.h>
+#include<sys/ioctl.h>
+#include<sys/types.h>
+#include<sys/time.h>
+#include<sys/param.h>
+#include<machine/i4b_tel_ioctl.h>
+
+// DECL DEFS
+#define BUFLEN 2048
+#define MAXBLOCKS_DEFAULT 23
+
+// DECL VARS
+int ibytes = 0;
+int obytes = 0;
+int maxbytes = (BUFLEN * MAXBLOCKS_DEFAULT);
+
+int xfd = -1, xact = 0;
+int ifd = -1, iact = 0;
+int ofd = -1;
+FILE *dfp = NULL;
+int opt_dbg = 0;
+int maxfd = 0;
+fd_set set;
+struct timeval timeout;
+char nambuf[PATH_MAX];
+int ch;
+
+// DECL FUNC
+void ifd_hdlr( void);
+void xfd_hdlr( void);
+void usage( void);
+void dbg( char *fmt, ... );
+
+// DEF FUNC
+int main (int argc, char **argv) {
+ int dummy;
+ int x = -1;
+
+ dfp = stderr;
+ while( ( ch = getopt( argc, argv, "x:i:o:b:D:")) != -1 ){
+ switch(ch){
+ case 'b':
+ x = atoi(optarg);
+ maxbytes = x * BUFLEN;
+ break;
+ case 'i':
+ ifd = open( optarg, O_RDONLY );
+ iact = 1;
+ break;
+ case 'o':
+ ofd = open( optarg, O_WRONLY|O_TRUNC|O_CREAT );
+ break;
+ case 'x':
+ xfd = open( optarg, O_RDWR );
+ xact = 1;
+ break;
+ case 'D':
+ opt_dbg = 1;
+ if( (dfp = fopen( optarg, "w" )) < 0) {
+ dfp = stderr;
+ dbg("Err for opening %s\n", optarg);
+ exit(1);
+ }
+ break;
+ case '?':
+ default:
+ usage();
+ break;
+ }
+ }
+ if( ( xfd < 0 ) || ( ifd < 0 ) || ( ofd < 0 ) ) {
+ dbg("Err opening one ore more Files.\n");
+ dbg("xfd: %d, ifd: %d, ofd: %d\n", xfd, ifd, ofd );
+ usage();
+ }
+
+ if((x = ioctl(xfd, I4B_TEL_EMPTYINPUTQUEUE, &dummy)) < 0){
+ dbg("Err I4B_TEL_EMPTYINPUTQUEUE\n");
+ }
+
+ while( (iact == 1) || ( (obytes < maxbytes) && (xact == 1) ) ){
+ FD_ZERO( &set);
+ if( iact == 1){
+ FD_SET( ifd, &set);
+ if( ifd > maxfd)
+ maxfd = ifd;
+ dbg("FSET ifd\n");
+ }
+ if( xact == 1){
+ FD_SET( xfd, &set);
+ if( xfd > maxfd)
+ maxfd = xfd;
+ dbg("FSET xfd\n");
+ }
+ x=select( maxfd+1, &set, NULL, NULL, NULL);
+ if( x > 0){
+ if( (iact == 1) && FD_ISSET( ifd, &set) ){
+ ifd_hdlr();
+ }
+ if( (xact == 1) && FD_ISSET( xfd, &set) ){
+ xfd_hdlr();
+ }
+ }
+ }
+ dbg("exit0\n");
+ return(0);
+}
+
+void ifd_hdlr( void) {
+ int x;
+ unsigned char buf[BUFLEN];
+
+ x = read( ifd, buf, BUFLEN);
+ dbg("ifd read %d bytes\n", x);
+ if( x > 0 ){
+ write( xfd, buf, x);
+ ibytes += x;
+ dbg("xfd %d bytes written to %d\n", x, ibytes);
+ } else {
+ iact = 0;
+ }
+}
+
+void xfd_hdlr( void) {
+ int x;
+ unsigned char buf[BUFLEN];
+
+ x = read( xfd, buf, BUFLEN);
+ dbg("xfd read %d bytes\n", x);
+ if( x > 0){
+ write( ofd, buf, x);
+ obytes += x;
+ dbg("ofd %d bytes written to %d\n", x, obytes);
+ } else {
+ xact = 0;
+ }
+}
+
+void usage( void) {
+ fprintf(dfp, "isdntelmux V.1\n");
+ fprintf(dfp, "usage: isdntelmux -x device -i ifile -o ofile [-b blocks]\n");
+ exit(1);
+}
+
+void dbg( char *fmt, ... ) {
+ va_list ap;
+
+ if( opt_dbg == 0 )
+ return;
+ va_start( ap, fmt );
+ vfprintf( dfp, fmt, ap);
+ va_end(ap);
+}
diff --git a/share/examples/isdn/contrib/mrtg-isp0.sh b/share/examples/isdn/contrib/mrtg-isp0.sh
new file mode 100644
index 000000000000..bdc9671883ac
--- /dev/null
+++ b/share/examples/isdn/contrib/mrtg-isp0.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+#---------------------------------------------------------------------------
+#
+# collect callout and callback statistics for the isp0 i/f
+#
+# enable budget callout and callback restrictions and file
+# rotation in the isdnd.rc file.
+#
+# last edit-date: [Fri May 25 15:22:45 2001]
+#
+# $FreeBSD$
+#
+#---------------------------------------------------------------------------
+#
+#---------------------------------------------------------------------------
+# this is the entry for mrtg in mrtg.cfg
+#---------------------------------------------------------------------------
+# Target[ernie.cstat.isp0]: `/usr/local/etc/mrtg/util/mrtg-isp0.sh`
+# MaxBytes[ernie.cstat.isp0]: 10
+# AbsMax[ernie.cstat.isp0]: 200
+# Title[ernie.cstat.isp0]: isp0: callouts / callbacks
+# PageTop[ernie.cstat.isp0]: <H1> isp0: callouts /callbacks </H1>
+# Options[ernie.cstat.isp0]: gauge, nopercent, integer
+# YLegend[ernie.cstat.isp0]: co / cb
+# ShortLegend[ernie.cstat.isp0]: n
+# Legend1[ernie.cstat.isp0]: callouts
+# Legend2[ernie.cstat.isp0]: callbacks
+# LegendI[ernie.cstat.isp0]: callouts:
+# LegendO[ernie.cstat.isp0]: callbacks:
+# WithPeak[ernie.cstat.isp0]: ymwd
+#
+#---------------------------------------------------------------------------
+# this is the shell script run by mrtg
+#---------------------------------------------------------------------------
+if [ -r /var/log/isdn/callouts.isp0 ]
+then
+ cat /var/log/isdn/callouts.isp0 | awk '{print $3}'
+else
+ echo 0
+fi
+
+if [ -r /var/log/isdn/callbacks.isp0 ]
+then
+ cat /var/log/isdn/callbacks.isp0 | awk '{print $3}'
+else
+ echo 0
+fi
+
+uptime | cut -c 12-18
+uname -nsr
+
+exit 0
+
diff --git a/share/examples/isdn/i4brunppp/Makefile b/share/examples/isdn/i4brunppp/Makefile
new file mode 100644
index 000000000000..80cde94d31e2
--- /dev/null
+++ b/share/examples/isdn/i4brunppp/Makefile
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+PROG = i4brunppp
+SRCS = i4brunppp.c
+MAN8 = i4brunppp.8
+
+RUNPPPDEST= /etc/isdn
+
+INSTALL ?= install
+
+install:
+ @echo i4brunppp is not installed automatically. In case you want to run
+ @echo user-ppp in dial-in server under i4b, please copy it into /etc/isdn.
+
+installetc: i4brunppp
+ ${INSTALL} -c -m ${BINMODE} -o ${BINOWN} -g ${BINGRP} \
+ ${.CURDIR}/i4brunppp ${RUNPPPDEST}
+
+.include <bsd.prog.mk>
diff --git a/share/examples/isdn/i4brunppp/README b/share/examples/isdn/i4brunppp/README
new file mode 100644
index 000000000000..ea0ba9a857bd
--- /dev/null
+++ b/share/examples/isdn/i4brunppp/README
@@ -0,0 +1,19 @@
+$FreeBSD$
+
+BEWARE: HIGHLY EXPERIMENTAL!
+---------------------------
+
+This program is used in conjunction with a isdnd.rc entry similar to
+
+ regexpr = "ULPPP.*call active" # look for matches in log messages
+ regprog = i4brunppp # execute program when match is found
+
+this one (see also i4brunppp-isdnd.rc).
+
+i4brunppp _must_ be put into /etc/isdn!
+
+When an active call is detected, isdnd fires off i4brunppp, which attaches
+the rbch device used to stdin/stdout and then runs ppp which is given the
+"-direct" command and the string "inc_rbchX" (where X is the i4brbch unit
+number) as arguments.
+
diff --git a/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc b/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc
new file mode 100644
index 000000000000..962022045cae
--- /dev/null
+++ b/share/examples/isdn/i4brunppp/i4brunppp-isdnd.rc
@@ -0,0 +1,65 @@
+#------------------------------------------------------------------------------
+#
+# sample isdnd.rc for taking incoming calls with userland ppp
+# -----------------------------------------------------------
+#
+# $FreeBSD$
+#
+# last edit-date: [Sat Jul 21 13:40:50 2001]
+#
+#------------------------------------------------------------------------------
+#==============================================================================
+# SYSTEM section: global configuration parameters
+#==============================================================================
+system
+
+ratesfile = /etc/isdn/isdnd.rates # name & location of rates file
+
+useacctfile = yes # generate accouting info to file
+acctall = on # generate info for everything
+acctfile = /var/log/isdnd.acct # name & location of accounting file
+
+rtprio = 25 # modify isdnd's priority
+
+regexpr = "ULPPP.*call active" # look for matches in log messages
+regprog = i4brunppp # execute program when match is found
+
+#==============================================================================
+# ENTRY: Userland PPP over ISDN
+#==============================================================================
+entry
+
+name = ULPPP # name for reference
+
+usrdevicename = rbch # ipr, tel, rbch
+usrdeviceunit = 0 # unit number
+
+isdncontroller = 0 # contoller to use or -1 to use any
+isdnchannel = -1 # channel (1/2) to use or 0 or -1 for any
+
+ # numbers used to verify at DIAL IN
+local-phone-incoming = 567 # this is my number
+remote-phone-incoming = 123 # this one can call in
+
+ # numbers used to DIAL OUT
+local-phone-dialout = 567 # this is my number
+remote-phone-dialout = 123 # i call this number
+
+remdial-handling = first # first, last or next
+
+dialin-reaction = accept # accept, reject, ignore, answer
+
+dialout-type = normal # normal / calledback
+
+b1protocol = hdlc # hdlc, raw
+
+idletime-incoming = 30 # 3 seconds idle timeout
+idletime-outgoing = 30 # 3 seconds idle timeout
+
+ratetype = 0 # ratesfile entry to use
+unitlength = 60 # unitlength to assume
+
+dialretries = 2 # # of dial retries
+recoverytime = 5 # time to wait between 2 dial tries
+
+# EOF #########################################################################
diff --git a/share/examples/isdn/i4brunppp/i4brunppp.8 b/share/examples/isdn/i4brunppp/i4brunppp.8
new file mode 100644
index 000000000000..c55a0e4cc07e
--- /dev/null
+++ b/share/examples/isdn/i4brunppp/i4brunppp.8
@@ -0,0 +1,48 @@
+.\"
+.\" Copyright (c) 1999, 2001 Hellmuth Michaelis. 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$
+.\"
+.\" last edit-date: [Sat Jul 21 13:37:00 2001]
+.\"
+.Dd July 28, 1999
+.Dt I4BRUNPPP 8
+.Sh NAME
+.Nm i4brunppp
+.Nd interface i4b to userland ppp in server mode
+.Sh DESCRIPTION
+.Nm i4brunppp
+is part of the isdn4bsd package and is used to interface i4b to the so-called
+userland
+.Xr ppp 8
+when dialling into an i4b machine.
+.Sh FILES
+.Bl -tag -width ".Pa /dev/i4brbchX"
+.It Pa /dev/i4brbchX
+.El
+.Sh AUTHORS
+The
+.Nm
+utility and this manpage were written by
+.An Hellmuth Michaelis Aq hm@FreeBSD.org .
diff --git a/share/examples/isdn/i4brunppp/i4brunppp.c b/share/examples/isdn/i4brunppp/i4brunppp.c
new file mode 100644
index 000000000000..cb239d8e32c1
--- /dev/null
+++ b/share/examples/isdn/i4brunppp/i4brunppp.c
@@ -0,0 +1,224 @@
+/*
+ * Copyright (c) 1999, 2001 Hellmuth Michaelis. 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.
+ *
+ *---------------------------------------------------------------------------
+ *
+ * i4brunppp - run userland ppp for incoming call from rbch i/f
+ * ------------------------------------------------------------
+ *
+ * $FreeBSD$
+ *
+ * last edit-date: [Sat Jul 21 13:38:10 2001]
+ *
+ *---------------------------------------------------------------------------
+ *
+ * BEWARE: HIGHLY EXPERIMENTAL!
+ * ---------------------------
+ *
+ * This program is used in conjunction with a isdnd.rc entry similar to
+ *
+ * regexpr = "ULPPP.*call active" # look for matches in log messages
+ * regprog = i4brunppp # execute program when match is found
+ *
+ * this one. It _must_ be put into /etc/isdn!
+ * When an active call is detected, isdnd fires off i4brunppp, which attaches
+ * the rbch device used to stdin/stdout and then runs ppp which is given the
+ * "-direct" command and the string "inc_rbchX" (where X is the i4brbch unit
+ * number) as arguments.
+ *
+ *---------------------------------------------------------------------------*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <syslog.h>
+#include <errno.h>
+#include <string.h>
+#include <time.h>
+#include <ctype.h>
+
+#include <machine/i4b_ioctl.h>
+#include <machine/i4b_rbch_ioctl.h>
+
+#define I4BDEVICE "/dev/i4b"
+
+#define PPPPROG "/usr/sbin/ppp"
+#define PPPNAME "ppp"
+#define PPPARG1 "-direct"
+#define PPPLABEL "inc_"
+
+#define VERIFYSTRING "call active"
+#define DEVSTRING "rbch"
+
+#define PPPDEBUG
+
+/*---------------------------------------------------------------------------*
+ * program entry
+ *---------------------------------------------------------------------------*/
+int
+main(int argc, char **argv)
+{
+ char buffer[256];
+ int rbch_fd;
+ char *p = "DeadPointer";
+ int found;
+ int i;
+
+#ifdef PPPDEBUG
+ FILE *dfp;
+ time_t tim;
+ register struct tm *tp;
+#endif
+
+ /* open syslog */
+
+ (void)openlog("i4brunppp", LOG_PID|LOG_CONS|LOG_NDELAY, LOG_USER);
+
+#ifdef PPPDEBUG
+
+ /* open debug log */
+
+ if((dfp = fopen("/tmp/i4brunppp-debug.log", "a")) == NULL)
+ {
+ syslog(LOG_INFO, "cannot open logfile: %s", strerror(errno));
+ exit(1);
+ }
+
+ tim = time(NULL);
+ tp = localtime(&tim);
+ strftime(buffer, 40, I4B_TIME_FORMAT, tp);
+ fprintf(dfp, "\n=================== %s ===================\n", buffer);
+
+ for(i=0; i < argc; i++)
+ fprintf(dfp, "\t%s\n", argv[i]);
+#endif
+
+ /* check if this is the right message */
+
+ found = 0;
+
+ for(i=0; i < argc; i++)
+ {
+ if((strstr(argv[i], VERIFYSTRING)) != NULL)
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ if(found == 0)
+ {
+#ifdef PPPDEBUG
+ fprintf(dfp, "did not found [%s], exit\n", VERIFYSTRING);
+#endif
+ exit(0);
+ }
+
+ found = 0;
+
+ /* check if we got a good device name */
+
+ for(; i < argc; i++)
+ {
+ if((p = strstr(argv[i], DEVSTRING)) != NULL)
+ {
+ found = 1;
+ break;
+ }
+ }
+
+ if(found == 0)
+ {
+#ifdef PPPDEBUG
+ fprintf(dfp, "did not found [%s], exit\n", DEVSTRING);
+#endif
+ exit(0);
+ }
+
+ /* everything ok, now prepare for running ppp */
+
+ /* close all file descriptors */
+
+ i = getdtablesize();
+
+ for(;i >= 0; i--)
+ if (i != 2)
+ close(i);
+
+ /* fiddle a terminating zero after the rbch unit number */
+
+ p += strlen(DEVSTRING);
+
+ if(isdigit(*p) && isdigit(*(p+1)))
+ *(p+2) = '\0';
+ else
+ *(p+1) = '\0';
+
+ /* construct /dev/i4brbchX device name */
+
+ sprintf(buffer, "%s%s%s", I4BDEVICE, DEVSTRING, p);
+
+ /* open the rbch device as fd 0 = stdin */
+
+ rbch_fd = open(buffer, O_RDWR);
+
+ if(rbch_fd != 0)
+ {
+ if(rbch_fd < 0)
+ syslog(LOG_INFO, "cannot open %s: %s", buffer, strerror(errno));
+ else
+ syslog(LOG_INFO, "cannot open %s as fd 0 (is %d): %s", buffer, rbch_fd, strerror(errno));
+ exit(1);
+ }
+
+ /* dup rbch device fd as fd 1 = stdout */
+
+ if((i = dup(rbch_fd)) != 1)
+ {
+ if(i < 0)
+ syslog(LOG_INFO, "cannot dup rbch_fd: %s", strerror(errno));
+ else
+ syslog(LOG_INFO, "cannot dup rbch as fd 1 (is %d): %s", i, strerror(errno));
+ exit(1);
+ }
+
+ /* construct the label for ppp's ppp.conf file */
+
+ sprintf(buffer, "%s%s%s", PPPLABEL, DEVSTRING, p);
+
+ syslog(LOG_INFO, "executing: %s %s %s %s", PPPPROG, PPPNAME, PPPARG1, buffer);
+
+ /* execute ppp */
+
+ if((execl(PPPPROG, PPPNAME, PPPARG1, buffer, NULL)) == -1)
+ {
+ syslog(LOG_INFO, "cannot exec: %s", strerror(errno));
+ exit(1);
+ }
+ syslog(LOG_INFO, "finished: %s %s %s %s", PPPPROG, PPPNAME, PPPARG1, buffer);
+ return(0);
+}
+
+/* EOF */
diff --git a/share/examples/isdn/v21/Makefile b/share/examples/isdn/v21/Makefile
new file mode 100644
index 000000000000..3c499966276b
--- /dev/null
+++ b/share/examples/isdn/v21/Makefile
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+PROG= v21modem
+NOMAN= 1
+LDADD= -lutil -lm
+CFLAGS+= -g -Wall
+
+.if !defined(BSDTYPE)
+BSDTYPE!=uname
+.endif
+
+.include <bsd.prog.mk>
diff --git a/share/examples/isdn/v21/README b/share/examples/isdn/v21/README
new file mode 100644
index 000000000000..52f553c31307
--- /dev/null
+++ b/share/examples/isdn/v21/README
@@ -0,0 +1,50 @@
+
+ V.21 Modem for ISDN4BSD.
+
+INTRODUCTION:
+
+The modem is implemented in software and is rather simple minded.
+
+It works with my Telebit TB2500 and Zyxel 2864I modems.
+
+There are plenty of knobs and handles which can be adjusted and I have
+no real idea what to set them to for best all-round performance.
+
+The carrier detect timer may be a bit short tempered, and this is
+probably why the dialing modem needs to be told to talk V.21 up
+front. If this code were mode tolerant of loss of carrier auto
+negotiation might work.
+
+When you get carrier ("CONNECT 300"), you must press a key before the
+login banner gets printed. See the comments in "input_byte" why this
+is.
+
+THE KERNEL PART:
+
+Implementes a crude "send these tones" facility, but it is enough to
+take most of the real-time worries out of doing FSK modulation in
+software. If suitably extended, the code could also be used to
+send DTMF tones and other similar signals.
+
+INSTALLATION:
+
+The program is started from /etc/isdn/isdnd.rc:
+
+entry
+ name = I4BTEL
+ usrdevicename = tel
+ usrdeviceunit = 0
+ isdncontroller = 0
+ isdnchannel = -1
+ local-phone-incoming = 2934812934
+ remote-phone-incoming = *
+ dialin-reaction = answer
+ answerprog = v21modem
+ b1protocol = raw
+ idletime-incoming = 5
+
+
+Poul-Henning (phk@freebsd.org)
+19991212
+
+$FreeBSD$
diff --git a/share/examples/isdn/v21/v21modem.c b/share/examples/isdn/v21/v21modem.c
new file mode 100644
index 000000000000..f49eb06bf6f7
--- /dev/null
+++ b/share/examples/isdn/v21/v21modem.c
@@ -0,0 +1,394 @@
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * This is a V.21 modem for ISDN4BSD.
+ *
+ * $FreeBSD$
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <err.h>
+#include <sys/ioccom.h>
+#include <errno.h>
+#include <syslog.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <termios.h>
+#include <libutil.h>
+
+#include <machine/i4b_tel_ioctl.h>
+
+static void create_session(void);
+static void input_byte(int byte, int stopbit);
+static void sample(int vol, int* tones);
+static void tonedetect(unsigned char *ptr, int count);
+static void uart(int bit);
+
+static int dcd; /* Carrier on ? */
+static int ptyfd = -1; /* PTY filedescriptor */
+static int telfd = -1; /* I4BTEL filedescriptor */
+
+/*
+ * Alaw to Linear [-32767..32767] conversion
+ */
+
+static int a2l[256] = { -5504, -5248, -6016, -5760, -4480, -4224,
+-4992, -4736, -7552, -7296, -8064, -7808, -6528, -6272, -7040,
+-6784, -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368,
+-3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392, -22016,
+-20992, -24064, -23040, -17920, -16896, -19968, -18944, -30208,
+-29184, -32256, -31232, -26112, -25088, -28160, -27136, -11008,
+-10496, -12032, -11520, -8960, -8448, -9984, -9472, -15104, -14592,
+-16128, -15616, -13056, -12544, -14080, -13568, -344, -328, -376,
+-360, -280, -264, -312, -296, -472, -456, -504, -488, -408, -392,
+-440, -424, -88, -72, -120, -104, -24, -8, -56, -40, -216, -200,
+-248, -232, -152, -136, -184, -168, -1376, -1312, -1504, -1440,
+-1120, -1056, -1248, -1184, -1888, -1824, -2016, -1952, -1632,
+-1568, -1760, -1696, -688, -656, -752, -720, -560, -528, -624,
+-592, -944, -912, -1008, -976, -816, -784, -880, -848, 5504, 5248,
+6016, 5760, 4480, 4224, 4992, 4736, 7552, 7296, 8064, 7808, 6528,
+6272, 7040, 6784, 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368,
+3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, 22016, 20992, 24064,
+23040, 17920, 16896, 19968, 18944, 30208, 29184, 32256, 31232,
+26112, 25088, 28160, 27136, 11008, 10496, 12032, 11520, 8960, 8448,
+9984, 9472, 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568,
+344, 328, 376, 360, 280, 264, 312, 296, 472, 456, 504, 488, 408,
+392, 440, 424, 88, 72, 120, 104, 24, 8, 56, 40, 216, 200, 248, 232,
+152, 136, 184, 168, 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184,
+1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, 688, 656, 752, 720,
+560, 528, 624, 592, 944, 912, 1008, 976, 816, 784, 880, 848 };
+
+/*
+ * A High Q Tone detector
+ */
+
+#define NTONES 2 /* Number of tones to detect */
+#define SCALE 4096 /* Scaling factor */
+#define EXPAVG 14 /* Exponential Average factor */
+#define POLERAD 3885 /* pole_radius ^ 2 * SCALE */
+
+/* Table of "-cos(2 * PI * frequency / sample_rate) * SCALE" */
+static int p[NTONES] = {
+ -2941, /* 980 Hz */
+ -2460 /* 1180 Hz */
+};
+
+static void
+tonedetect(unsigned char *ptr, int count)
+{
+ int i, j;
+ int y;
+ int c, d, f, n;
+ static int k[NTONES], h[NTONES];
+ static int tones[NTONES];
+ static int amplitude;
+
+
+ for (i = 0; i < count; i++) {
+ y = a2l[*ptr++];
+ if (y > 0)
+ amplitude += (y - amplitude) / EXPAVG;
+ else
+ amplitude += (-y - amplitude) / EXPAVG;
+
+ for(j = 0; j < NTONES; j++) {
+ c = (POLERAD * (y - k[j])) / SCALE;
+ d = y + c;
+ f = (p[j] * (d - h[j])) / SCALE;
+ n = y - k[j] - c;
+ if (n < 0)
+ n = -n;
+ k[j] = h[j] + f;
+ h[j] = f + d;
+ tones[j] += (n - tones[j]) / EXPAVG;
+ }
+ sample(amplitude, tones);
+ }
+}
+
+/*
+ * Taste each sample, detect (loss off) carrier, and feed uart
+ */
+
+#define NCARRIER 1000 /* Samples of carrier for detection */
+
+static void
+sample(int vol, int* tones)
+{
+ static int carrier;
+
+ if ((tones[0] + tones[1]) > vol * 3/2) { /* XXX */
+ if (carrier < NCARRIER)
+ carrier ++;
+ } else {
+ if (carrier > 0)
+ carrier --;
+ }
+
+ if (!dcd && carrier > NCARRIER / 2) {
+ syslog(LOG_ERR, "CARRIER ON");
+ dcd = 1;
+ } else if (dcd && carrier < NCARRIER / 2) {
+ syslog(LOG_ERR, "CARRIER OFF");
+ dcd = 0;
+ }
+
+ if (!dcd)
+ return;
+
+ if (tones[0] > tones[1]) {
+ uart(1);
+ } else {
+ uart(0);
+ }
+}
+
+/*
+ * A UART in software
+ */
+
+#define BITCENTER 13 /* Middle of a bit: 8000/300/2 */
+static int bitsample[] = { /* table of sampling points */
+ BITCENTER,
+ BITCENTER + 27,
+ BITCENTER + 54,
+ BITCENTER + 80,
+ BITCENTER + 107,
+ BITCENTER + 134,
+ BITCENTER + 160,
+ BITCENTER + 187,
+ BITCENTER + 214,
+ BITCENTER + 240
+};
+
+static void
+uart(int bit)
+{
+ static int n, v, j;
+
+ if (n == 0 && bit == 1)
+ return; /* Waiting for start bit */
+ if (n == 0) {
+ j = 0; /* Begin start bit */
+ v = 0;
+ n++;
+ } else if (j == 0 && bit && n > bitsample[j]) {
+ n = 0; /* Gone by middle of start bit */
+ } else if (n > bitsample[j]) {
+ j++; /* Sample point */
+ if (j == 10) {
+ n = 0;
+ input_byte(v, bit);
+ } else {
+ v = v / 2 + 128 * bit;
+ n++;
+ }
+ } else {
+ n++;
+ }
+}
+
+/*
+ * Send a byte using kenrnel tone generation support
+ */
+
+static void
+output_byte(int val)
+{
+ struct i4b_tel_tones tt;
+ int i;
+
+ i = 0;
+ tt.frequency[i] = 1850; tt.duration[i++] = 27;
+
+ tt.frequency[i] = val & 1 ? 1650 : 1850; tt.duration[i++] = 27;
+ tt.frequency[i] = val & 2 ? 1650 : 1850; tt.duration[i++] = 26;
+ tt.frequency[i] = val & 4 ? 1650 : 1850; tt.duration[i++] = 27;
+ tt.frequency[i] = val & 8 ? 1650 : 1850; tt.duration[i++] = 27;
+ tt.frequency[i] = val & 16 ? 1650 : 1850; tt.duration[i++] = 26;
+ tt.frequency[i] = val & 32 ? 1650 : 1850; tt.duration[i++] = 27;
+ tt.frequency[i] = val & 64 ? 1650 : 1850; tt.duration[i++] = 27;
+ tt.frequency[i] = val & 128 ? 1650 : 1850; tt.duration[i++] = 26;
+
+ tt.frequency[i] = 1650; tt.duration[i++] = 27;
+ tt.frequency[i] = 1650; tt.duration[i++] = 0;
+
+ i = ioctl(telfd, I4B_TEL_TONES, &tt);
+ if (i != 0 && errno != EAGAIN) {
+ syslog(LOG_ERR, "%d: *** %d/%d ***", __LINE__, i, errno);
+ exit(0);
+ }
+}
+
+/*
+ * Create Session
+ */
+
+static void
+create_session(void)
+{
+ int i;
+ char buf[100];
+
+ i = forkpty(&ptyfd, buf, 0, 0);
+ if (i == 0) {
+ execl("/usr/libexec/getty", "getty", "std.300", "-",
+ (char *)NULL);
+ syslog(LOG_ERR, "exec getty %d", errno);
+ exit(2);
+ } else if (i < 0) {
+ syslog(LOG_ERR, "forkpty failed %d", errno);
+ exit(2);
+ }
+ syslog(LOG_ERR, "pty %s", buf);
+}
+
+static void
+input_byte(int byte, int stopbit)
+{
+ u_char c;
+ int i;
+ static int first;
+ static u_char buf[80];
+
+ if (!stopbit)
+ return;
+ c = byte;
+ /*
+ * I have no idea why, but my TB2500 modem sends a sequence of
+ * 28 bytes after carrier is established at the link level, but
+ * before it is acceptted at the logical level.
+ *
+ * [16100214010201060100000000ff0201020301080402400010034510]
+ *
+ * Unfortunately this contains a ^D which kills getty.
+ * The following code swallows this sequence, assuming that it
+ * is always the same length and always start with 0x16.
+ *
+ */
+ if (first == 0 && c == 0x16) {
+ sprintf(buf, "%02x", c);
+ first = 27;
+ return;
+ } else if (first == 0) {
+ first = -1;
+ dcd = 2;
+ return;
+ }
+ if (first > 0) {
+ sprintf(buf + strlen(buf), "%02x", c);
+ first--;
+ if (!first) {
+ syslog(LOG_NOTICE, "Got magic [%s]", buf);
+ *buf = 0;
+ }
+ return;
+ }
+ if (ptyfd != -1 && dcd) {
+ i = write(ptyfd, &c, 1);
+ if (i != 1 && errno != EAGAIN) {
+ syslog(LOG_ERR, "%d: *** %d/%d ***", __LINE__, i, errno);
+ exit(0);
+ }
+ }
+}
+
+int
+main(int argc, char **argv)
+{
+ char *device = "/dev/tel0";
+ u_char ibuf[2048];
+ int ii, io;
+ int i, maxfd;
+ struct i4b_tel_tones tt;
+ fd_set rfd, wfd, efd;
+
+ openlog("v21modem", LOG_PID, LOG_DAEMON);
+ /* Find our device name */
+ for (i = 0; i < argc; i++)
+ if (!strcmp(argv[i], "-D"))
+ device = argv[i + 1];
+ telfd = open(device, O_RDWR, 0);
+ if (telfd < 0) {
+ syslog(LOG_ERR, "open %s: %m", device);
+ exit (0);
+ }
+ syslog(LOG_NOTICE, "Running on %s", device);
+
+ /* Output V.25 tone and carrier */
+ i = 0;
+ tt.frequency[i] = 0; tt.duration[i++] = 1000;
+ tt.frequency[i] = 2100; tt.duration[i++] = 2*8000;
+ tt.frequency[i] = 0; tt.duration[i++] = 400;
+ tt.frequency[i] = 1650; tt.duration[i++] = 1;
+ tt.frequency[i] = 1650; tt.duration[i++] = 0;
+ tt.frequency[i] = 0; tt.duration[i++] = 0;
+ i = ioctl(telfd, I4B_TEL_TONES, &tt);
+ if (i < 0) {
+ syslog(LOG_ERR, "hangup");
+ exit(0);
+ }
+
+ create_session();
+
+ /* Wait for carrier */
+ do {
+ ii = read(telfd, ibuf, sizeof ibuf);
+ tonedetect(ibuf, ii);
+ } while (ii > 0 && dcd != 2);
+ if (ii < 0) {
+ syslog(LOG_ERR, "hangup");
+ exit(0);
+ }
+
+ maxfd = ptyfd;
+ if (telfd > maxfd)
+ maxfd = telfd;
+ maxfd += 1;
+ do {
+ FD_ZERO(&rfd);
+ FD_SET(telfd, &rfd);
+ FD_SET(ptyfd, &rfd);
+ FD_ZERO(&wfd);
+ FD_ZERO(&efd);
+ FD_SET(telfd, &efd);
+ FD_SET(ptyfd, &efd);
+ i = select(maxfd, &rfd, &wfd, &efd, NULL);
+ if (FD_ISSET(telfd, &rfd)) {
+ ii = read(telfd, ibuf, sizeof ibuf);
+ if (ii > 0)
+ tonedetect(ibuf, ii);
+ else
+ syslog(LOG_ERR, "hangup");
+ }
+ if (FD_ISSET(ptyfd, &rfd)) {
+ io = read(ptyfd, ibuf, 1);
+ if (io == 1)
+ output_byte(*ibuf);
+ else if (io == 0) {
+ syslog(LOG_ERR, "Session EOF");
+ exit(0);
+ }
+
+ }
+ if (FD_ISSET(telfd, &efd)) {
+ syslog(LOG_ERR, "Exception TELFD");
+ exit (0);
+ }
+ if (FD_ISSET(ptyfd, &efd)) {
+ syslog(LOG_ERR, "Exception PTYFD");
+ exit (0);
+ }
+ } while (dcd);
+ syslog(LOG_ERR, "Carrier Lost");
+ exit(0);
+}
diff --git a/share/examples/kld/Makefile b/share/examples/kld/Makefile
new file mode 100644
index 000000000000..6c539bd50ac4
--- /dev/null
+++ b/share/examples/kld/Makefile
@@ -0,0 +1,72 @@
+# 08 Nov 1998
+#
+# Makefile for sample programs for kld modules package
+#
+# 08 Nov 1998 Rajesh Vaidheeswarran - adapted from lkm Makefile
+#
+# Copyright (c) 1998 Rajesh Vaidheeswarran
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Rajesh Vaidheeswarran.
+# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+#
+# Copyright (c) 1993 Terrence R. Lambert.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Terrence R. Lambert.
+# 4. The name Terrence R. Lambert may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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$
+#
+
+SUBDIR= cdev syscall dyn_sysctl
+
+.include <bsd.subdir.mk>
diff --git a/share/examples/kld/cdev/Makefile b/share/examples/kld/cdev/Makefile
new file mode 100644
index 000000000000..8acbdf991fea
--- /dev/null
+++ b/share/examples/kld/cdev/Makefile
@@ -0,0 +1,74 @@
+# 08 Nov 1998
+#
+# Makefile for sample kld device driver..
+#
+# May 93 Rajesh Vaidheeswarran
+#
+# Copyright (c) 1998 Rajesh Vaidheeswarran
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Rajesh Vaidheeswarran.
+# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+#
+# Copyright (c) 1993 Terrence R. Lambert.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Terrence R. Lambert.
+# 4. The name Terrence R. Lambert may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
+#
+
+SUBDIR= module test
+
+load: _SUBDIRUSE
+
+unload: _SUBDIRUSE
+
+.include <bsd.subdir.mk>
diff --git a/share/examples/kld/cdev/README b/share/examples/kld/cdev/README
new file mode 100644
index 000000000000..dc650f111358
--- /dev/null
+++ b/share/examples/kld/cdev/README
@@ -0,0 +1,131 @@
+# Copyright (c) 1998 Rajesh Vaidheeswarran
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Rajesh Vaidheeswarran
+# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+#
+# Copyright (c) 1993 Terrence R. Lambert.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Terrence R. Lambert.
+# 4. The name Terrence R. Lambert may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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$
+#
+
+1.0 Overview
+
+ This is the README file for the sample kld module
+ that mimics a character device driver.
+
+ A kld module may be used to load any data or
+ program into the kernel that can be made available by
+ modifying a table, pointer, or other kernel data to inform
+ the kernel that the module should be used instead of the
+ previous code/data path.
+
+ Generally, it is assumed that a loadable module is one of
+ a set of similar modules (such as a file system or console
+ terminal emulation), and that the reference is through a
+ table (such as vfssw[]), and that a "special" value is
+ assigned to the slots which are allowed to be replaced.
+ This is not enforced, so you may use the kld module
+ any way you see fit.
+
+ As with the loadable system calls, it may be desirable to
+ allow the module loader to replace an *existing* entry to
+ try out changes to kernel code without rebuilding and
+ booting from the new kernel.
+
+ The idea behind this example is to show some interaction
+ with the device driver. Therefore the flow of the code that
+ this driver is aimed at is as follows:
+
+ open(2) -> ioctl(2) -> write(2) -> read(2) -> close(2).
+
+ We will first open the device in the /dev/ directory; then
+ we will send an ioctl message to it using ioctl(2) call;
+ then write a small string via the write(2) call. This string
+ we write to the device will be stored in a static buffer,
+ and later will be accessible via the read(2) call. Finally,
+ we will close(2) our open()'d device so that we may no
+ longer make read or write calls on it.
+
+2.0 Directions
+
+ To test the module, do the following:
+
+ cd module
+ make load
+
+ A load message (the copyright) will be printed on the console.
+
+ cd ../test
+ make load
+
+ The system call prints a message on the console when called.
+ This message will be printed when running "make load" in
+ the "test" subdirectory.
+
+
+3.0 Recovering resources
+
+ The module consumes memory when loaded; it can be freed up by
+ unloading it. To unload it, type the following from the directory
+ this file is in:
+
+ cd module
+ make unload
+
+ The miscellaneous module will be unloaded by name.
+
+
+4.0 END OF DOCUMENT
diff --git a/share/examples/kld/cdev/module/Makefile b/share/examples/kld/cdev/module/Makefile
new file mode 100644
index 000000000000..50047cc13f04
--- /dev/null
+++ b/share/examples/kld/cdev/module/Makefile
@@ -0,0 +1,91 @@
+# 08 Nov 1998
+#
+# Makefile for kld char device driver.
+#
+# 08 Nov 1998 Rajesh Vaidheeswarran
+#
+# Copyright (c) 1998 Rajesh Vaidheeswarran
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Rajesh Vaidheeswarran.
+# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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$
+#
+# Copyright (c) 1993 Terrence R. Lambert.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Terrence R. Lambert.
+# 4. The name Terrence R. Lambert may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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.
+#
+
+BINDIR = /tmp
+SRCS = cdev.c cdevmod.c
+KMOD = cdev
+NOMAN = t
+KLDMOD = t
+
+KLDLOAD = /sbin/kldload
+KLDUNLOAD = /sbin/kldunload
+
+CLEANFILES+= ${KMOD}
+
+load: /dev/cdev ${KMOD}.ko
+ ${KLDLOAD} -v ./${KMOD}.ko
+
+unload:
+ rm -f /dev/cdev
+ ${KLDUNLOAD} -v -n ${KMOD}
+
+/dev/cdev:
+ mknod /dev/cdev c 32 0
+
+.include <bsd.kmod.mk>
diff --git a/share/examples/kld/cdev/module/cdev.c b/share/examples/kld/cdev/module/cdev.c
new file mode 100644
index 000000000000..ba6fa544fd5a
--- /dev/null
+++ b/share/examples/kld/cdev/module/cdev.c
@@ -0,0 +1,177 @@
+/* 08 Nov 1998*/
+/*
+ * cdev.c
+ *
+ * 08 Nov 1998 Rajesh Vaidheeswarran
+ *
+ * Copyright (c) 1998 Rajesh Vaidheeswarran
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Rajesh Vaidheeswarran.
+ * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+ *
+ * Copyright (c) 1993 Terrence R. Lambert.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Terrence R. Lambert.
+ * 4. The name Terrence R. Lambert may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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/types.h>
+#include <sys/uio.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/ioccom.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+
+#include "cdev.h"
+
+/*
+ * This is the actual code for the system call... it can't be static because
+ * it is exported to another part of the module... the only place it needs
+ * to be referenced is the sysent we are interested in.
+ *
+ * To write your own system call using this as a template, you could strip
+ * out this code and use the rest as a prototype module, changing only the
+ * function names and the number of arguments to the call in the module
+ * specific "sysent".
+ *
+ * You would have to use the "-R" option of "ld" to ensure a linkable file
+ * if you were to do this, since you would need to combine multiple ".o"
+ * files into a single ".o" file for use by "modload".
+ */
+
+#define CDEV_IOCTL1 _IOR('C', 1, u_int)
+
+/* Stores string recv'd by _write() */
+static char buf[512+1];
+static int len;
+
+int
+mydev_open(dev_t dev, int flag, int otyp, struct proc *procp)
+{
+ printf("mydev_open: dev_t=%d, flag=%x, otyp=%x, procp=%p\n",
+ dev2udev(dev), flag, otyp, procp);
+ memset(&buf, '\0', 513);
+ len = 0;
+ return (0);
+}
+
+int
+mydev_close(dev_t dev, int flag, int otyp, struct proc *procp)
+{
+ printf("mydev_close: dev_t=%d, flag=%x, otyp=%x, procp=%p\n",
+ dev2udev(dev), flag, otyp, procp);
+ return (0);
+}
+
+int
+mydev_ioctl(dev_t dev, u_long cmd, caddr_t arg, int mode, struct proc *procp)
+{
+ int error = 0;
+
+ printf("mydev_ioctl: dev_t=%d, cmd=%lx, arg=%p, mode=%x procp=%p\n",
+ dev2udev(dev), cmd, arg, mode, procp);
+
+ switch(cmd) {
+ case CDEV_IOCTL1:
+ printf("you called mydev_ioctl CDEV_IOCTL1\n");
+ break;
+ default:
+ printf("No such ioctl for me!\n");
+ error = EINVAL;
+ break;
+ }
+ return error;
+}
+
+/*
+ * mydev_write takes in a character string and saves it
+ * to buf for later accessing.
+ */
+int
+mydev_write(dev_t dev, struct uio *uio, int ioflag)
+{
+ int err = 0;
+
+ printf("mydev_write: dev_t=%d, uio=%p, ioflag=%d\n",
+ dev2udev(dev), uio, ioflag);
+
+ err = copyinstr(uio->uio_iov->iov_base, &buf, 512, &len);
+ if (err != 0) {
+ printf("Write to \"cdev\" failed.\n");
+ }
+ return(err);
+}
+
+/*
+ * The mydev_read function just takes the buf that was saved
+ * via mydev_write() and returns it to userland for
+ * accessing.
+ */
+int
+mydev_read(dev_t dev, struct uio *uio, int ioflag)
+{
+ int err = 0;
+
+ printf("mydev_read: dev_t=%d, uio=%p, ioflag=%d\n",
+ dev2udev(dev), uio, ioflag);
+
+ if (len <= 0) {
+ err = -1;
+ } else { /* copy buf to userland */
+ copystr(&buf, uio->uio_iov->iov_base, 513, &len);
+ }
+ return(err);
+}
diff --git a/share/examples/kld/cdev/module/cdev.h b/share/examples/kld/cdev/module/cdev.h
new file mode 100644
index 000000000000..b09e53ae3dba
--- /dev/null
+++ b/share/examples/kld/cdev/module/cdev.h
@@ -0,0 +1,81 @@
+/* 08 Nov 1998*/
+/*
+ * cdev.h - header for sample kld module implementing a character device
+ * driver.
+ *
+ * 08 Nov 1998 Rajesh Vaidheeswarran
+ *
+ * Copyright (c) 1998 Rajesh Vaidheeswarran
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Rajesh Vaidheeswarran.
+ * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+ *
+ * Copyright (c) 1993 Terrence R. Lambert.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Terrence R. Lambert.
+ * 4. The name Terrence R. Lambert may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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$
+ */
+
+#ifndef __CDEV_H_
+#define __CDEV_H_
+
+d_open_t mydev_open;
+d_close_t mydev_close;
+d_ioctl_t mydev_ioctl;
+d_read_t mydev_read;
+d_write_t mydev_write;
+
+#endif
diff --git a/share/examples/kld/cdev/module/cdevmod.c b/share/examples/kld/cdev/module/cdevmod.c
new file mode 100644
index 000000000000..cb80a72277c0
--- /dev/null
+++ b/share/examples/kld/cdev/module/cdevmod.c
@@ -0,0 +1,148 @@
+/* 08 Nov 1998*/
+/*
+ * cdevmod.c - a sample kld module implementing a character device driver.
+ *
+ * 08 Nov 1998 Rajesh Vaidheeswarran
+ *
+ * Copyright (c) 1998 Rajesh Vaidheeswarran
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Rajesh Vaidheeswarran.
+ * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+ *
+ * Copyright (c) 1993 Terrence R. Lambert.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Terrence R. Lambert.
+ * 4. The name Terrence R. Lambert may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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/conf.h>
+
+#include "cdev.h"
+
+#define CDEV_MAJOR 32
+
+static struct cdevsw my_devsw = {
+ /* open */ mydev_open,
+ /* close */ mydev_close,
+ /* read */ mydev_read,
+ /* write */ mydev_write,
+ /* ioctl */ mydev_ioctl,
+ /* poll */ nopoll,
+ /* mmap */ nommap,
+ /* strategy */ nostrategy,
+ /* name */ "cdev",
+ /* maj */ CDEV_MAJOR,
+ /* dump */ nodump,
+ /* psize */ nopsize,
+ /* flags */ D_TTY,
+ /* bmaj */ -1
+};
+
+/*
+ * Used as the variable that is the reference to our device
+ * in devfs... we must keep this variable sane until we
+ * call kldunload.
+ */
+static dev_t sdev;
+
+/*
+ * This function is called each time the module is loaded or unloaded.
+ * Since we are a miscellaneous module, we have to provide whatever
+ * code is necessary to patch ourselves into the area we are being
+ * loaded to change.
+ *
+ * The stat information is basically common to all modules, so there
+ * is no real issue involved with stat; we will leave it lkm_nullcmd(),
+ * since we don't have to do anything about it.
+ */
+
+static int
+cdev_load(module_t mod, int cmd, void *arg)
+{
+ int err = 0;
+
+ switch (cmd) {
+ case MOD_LOAD:
+
+ /* Do any initialization that you should do with the kernel */
+
+ /* if we make it to here, print copyright on console*/
+ printf("\nSample Loaded kld character device driver\n");
+ printf("Copyright (c) 1998\n");
+ printf("Rajesh Vaidheeswarran\n");
+ printf("All rights reserved\n");
+ sdev = make_dev(&my_devsw, 0, UID_ROOT, GID_WHEEL, 0600, "cdev");
+ break; /* Success*/
+
+ case MOD_UNLOAD:
+ printf("Unloaded kld character device driver\n");
+ destroy_dev(sdev);
+ break; /* Success*/
+
+ default: /* we only understand load/unload*/
+ err = EINVAL;
+ break;
+ }
+
+ return(err);
+}
+
+/* Now declare the module to the system */
+
+DEV_MODULE(cdev, cdev_load, NULL);
diff --git a/share/examples/kld/cdev/test/Makefile b/share/examples/kld/cdev/test/Makefile
new file mode 100644
index 000000000000..2ca3d2188da7
--- /dev/null
+++ b/share/examples/kld/cdev/test/Makefile
@@ -0,0 +1,92 @@
+# 05 Jun 93
+#
+# Makefile for testmisc
+#
+# 05 Jun 93 Rajesh Vaidheeswarran Original
+#
+# Copyright (c) 1993 Rajesh Vaidheeswarran.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Rajesh Vaidheeswarran.
+# 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+#
+# Copyright (c) 1993 Terrence R. Lambert.
+# 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.
+# 3. All advertising materials mentioning features or use of this software
+# must display the following acknowledgement:
+# This product includes software developed by Terrence R. Lambert.
+# 4. The name Terrence R. Lambert may not be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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$
+#
+PROG= testcdev
+NOMAN=
+
+MODSTAT= /sbin/kldstat
+
+load:
+ @echo "This test program will call the sample kld characer device ";
+ @echo "driver."
+ @echo
+ @echo "The sample driver will display a message on the"
+ @echo "system console each time an ioctl is sent to it."
+ @echo
+ @echo
+ @echo
+ @./testcdev
+
+unload:
+ @echo "This test program will cause an error if the driver"
+ @echo "has been successfully unloaded by building 'unload' in"
+ @echo "the 'module' subdirectory."
+ @echo
+ ${MODSTAT} -n cdev
+
+.include <bsd.prog.mk>
diff --git a/share/examples/kld/cdev/test/testcdev.c b/share/examples/kld/cdev/test/testcdev.c
new file mode 100644
index 000000000000..d69c3f5b090f
--- /dev/null
+++ b/share/examples/kld/cdev/test/testcdev.c
@@ -0,0 +1,122 @@
+/* 08 Nov 1998*/
+/*
+ * testmisc.c
+ *
+ * Test program to call the sample loaded kld device driver.
+ *
+ * 05 Jun 93 Rajesh Vaidheeswarran Original
+ *
+ *
+ * Copyright (c) 1993 Rajesh Vaidheeswarran.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Rajesh Vaidheeswarran.
+ * 4. The name Rajesh Vaidheeswarran may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY RAJESH VAIDHEESWARRAN ``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 RAJESH VAIDHEESWARRAN 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.
+ *
+ * Copyright (c) 1993 Terrence R. Lambert.
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Terrence R. Lambert.
+ * 4. The name Terrence R. Lambert may not be used to endorse or promote
+ * products derived from this software without specific prior written
+ * permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY TERRENCE R. LAMBERT ``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 TERRENCE R. LAMBERT 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 <stdio.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <string.h>
+#include <sys/ioccom.h>
+
+#define CDEV_IOCTL1 _IOR('C', 1, u_int)
+#define CDEV_DEVICE "cdev"
+
+static char writestr[] = "Hello kernel!";
+static char buf[512+1];
+
+int
+main(int argc, char *argv[])
+{
+ int kernel_fd;
+ int one;
+ int len;
+
+ if ((kernel_fd = open("/dev/" CDEV_DEVICE, O_RDWR)) == -1) {
+ perror("/dev/" CDEV_DEVICE);
+ exit(1);
+ }
+
+ /* Send ioctl */
+ if (ioctl(kernel_fd, CDEV_IOCTL1, &one) == -1) {
+ perror("CDEV_IOCTL1");
+ } else {
+ printf( "Sent ioctl CDEV_IOCTL1 to device %s%s\n", _PATH_DEV, CDEV_DEVICE);
+ }
+
+ len = strlen(writestr) + 1;
+
+ /* Write operation */
+ if (write(kernel_fd, writestr, len) == -1) {
+ perror("write()");
+ } else {
+ printf("Written \"%s\" string to device /dev/" CDEV_DEVICE "\n", writestr);
+ }
+
+ /* Read operation */
+ if (read(kernel_fd, buf, len) == -1) {
+ perror("read()");
+ } else {
+ printf("Read \"%s\" string from device /dev/" CDEV_DEVICE "\n", buf);
+ }
+
+ exit(0);
+}
diff --git a/share/examples/kld/dyn_sysctl/Makefile b/share/examples/kld/dyn_sysctl/Makefile
new file mode 100644
index 000000000000..3c63a8a5f6ad
--- /dev/null
+++ b/share/examples/kld/dyn_sysctl/Makefile
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+SRCS = dyn_sysctl.c
+CFLAGS = -I/sys
+KMOD = dyn_sysctl
+KO = ${KMOD}.ko
+KLDMOD = t
+
+KLDLOAD = /sbin/kldload
+KLDUNLOAD = /sbin/kldunload
+
+load: ${KO}
+ ${KLDLOAD} -v ./${KO}
+
+unload: ${KO}
+ ${KLDUNLOAD} -v -n ${KO}
+
+.include <bsd.kmod.mk>
diff --git a/share/examples/kld/dyn_sysctl/README b/share/examples/kld/dyn_sysctl/README
new file mode 100644
index 000000000000..4dfa3c6bdfbd
--- /dev/null
+++ b/share/examples/kld/dyn_sysctl/README
@@ -0,0 +1,8 @@
+This example module creates partially overlapping subtrees to demonstrate
+reference counting. It also contains example of attaching a subtree to the
+wrong place, i.e. to a dynamic oid that could belong to someone else.
+The framework should deal with this case gracefully.
+
+Andrzej Bialecki <abial@freebsd.org>
+
+$FreeBSD$
diff --git a/share/examples/kld/dyn_sysctl/dyn_sysctl.c b/share/examples/kld/dyn_sysctl/dyn_sysctl.c
new file mode 100644
index 000000000000..e066b56be316
--- /dev/null
+++ b/share/examples/kld/dyn_sysctl/dyn_sysctl.c
@@ -0,0 +1,168 @@
+/*-
+ * Copyright (c) 2000 Andrzej Bialecki <abial@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 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$
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/module.h>
+#include <sys/sysctl.h>
+#include <sys/kernel.h>
+
+
+/* Some example data */
+static long a = 100;
+static int b = 200;
+static char *c = "hi there from dyn_sysctl";
+static struct sysctl_oid *a_root, *a_root1, *b_root;
+static struct sysctl_ctx_list clist, clist1, clist2;
+
+static int
+sysctl_dyn_sysctl_test (SYSCTL_HANDLER_ARGS)
+{
+ char *buf = "let's produce some text...";
+
+ return (sysctl_handle_string(oidp, buf, strlen(buf), req));
+}
+
+/*
+ * The function called at load/unload.
+ */
+static int
+load (module_t mod, int cmd, void *arg)
+{
+ int error;
+
+ error = 0;
+ switch (cmd) {
+ case MOD_LOAD :
+ /* Initialize the contexts */
+ printf("Initializing contexts and creating subtrees.\n\n");
+ sysctl_ctx_init(&clist);
+ sysctl_ctx_init(&clist1);
+ sysctl_ctx_init(&clist2);
+ /*
+ * Create two partially overlapping subtrees, belonging
+ * to different contexts.
+ */
+ printf("TREE ROOT NAME\n");
+ a_root = SYSCTL_ADD_NODE(&clist,
+ SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+ OID_AUTO, dyn_sysctl, CTLFLAG_RW, 0,
+ "dyn_sysctl root node");
+ a_root = SYSCTL_ADD_NODE(&clist1,
+ SYSCTL_STATIC_CHILDREN(/* top of sysctl tree */),
+ OID_AUTO, dyn_sysctl, CTLFLAG_RW, 0,
+ "dyn_sysctl root node");
+ if(a_root == NULL) {
+ printf("SYSCTL_ADD_NODE failed!\n");
+ return (EINVAL);
+ }
+ SYSCTL_ADD_LONG(&clist, SYSCTL_CHILDREN(a_root),
+ OID_AUTO, long_a, CTLFLAG_RW, &a, "just to try");
+ SYSCTL_ADD_INT(&clist, SYSCTL_CHILDREN(a_root),
+ OID_AUTO, int_b, CTLFLAG_RW, &b, 0, "just to try 1");
+ a_root1=SYSCTL_ADD_NODE(&clist, SYSCTL_CHILDREN(a_root),
+ OID_AUTO, nextlevel, CTLFLAG_RD, 0, "one level down");
+ SYSCTL_ADD_STRING(&clist, SYSCTL_CHILDREN(a_root1),
+ OID_AUTO, string_c, CTLFLAG_RD, c, 0, "just to try 2");
+ printf("1. (%p) / dyn_sysctl\n", &clist);
+
+ /* Add a subtree under already existing category */
+ a_root1 = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(_kern),
+ OID_AUTO, dyn_sysctl, CTLFLAG_RW, 0, "dyn_sysctl root node");
+ if(a_root1 == NULL) {
+ printf("SYSCTL_ADD_NODE failed!\n");
+ return (EINVAL);
+ }
+ SYSCTL_ADD_PROC(&clist, SYSCTL_CHILDREN(a_root1),
+ OID_AUTO, procedure, CTLFLAG_RD, 0, 0,
+ sysctl_dyn_sysctl_test, "A", "I can be here, too");
+ printf(" (%p) /kern dyn_sysctl\n", &clist);
+
+ /* Overlap second tree with the first. */
+ b_root = SYSCTL_ADD_NODE(&clist1, SYSCTL_CHILDREN(a_root),
+ OID_AUTO, nextlevel, CTLFLAG_RD, 0, "one level down");
+ SYSCTL_ADD_STRING(&clist1, SYSCTL_CHILDREN(b_root),
+ OID_AUTO, string_c1, CTLFLAG_RD, c, 0, "just to try 2");
+ printf("2. (%p) / dyn_sysctl (overlapping #1)\n", &clist1);
+
+ /*
+ * And now do something stupid. Connect another subtree to
+ * dynamic oid.
+ * WARNING: this is an example of WRONG use of dynamic sysctls.
+ */
+ b_root=SYSCTL_ADD_NODE(&clist2, SYSCTL_CHILDREN(a_root1),
+ OID_AUTO, bad, CTLFLAG_RW, 0, "dependent node");
+ SYSCTL_ADD_STRING(&clist2, SYSCTL_CHILDREN(b_root),
+ OID_AUTO, string_c, CTLFLAG_RD, c, 0, "shouldn't panic");
+ printf("3. (%p) /kern/dyn_sysctl bad (WRONG!)\n", &clist2);
+ break;
+ case MOD_UNLOAD :
+ printf("1. Try to free ctx1 (%p): ", &clist);
+ if(sysctl_ctx_free(&clist))
+ printf("failed: expected. Need to remove ctx3 first.\n");
+ else
+ printf("HELP! sysctl_ctx_free(%p) succeeded. EXPECT PANIC!!!\n", &clist);
+ printf("2. Try to free ctx3 (%p): ", &clist2);
+ if(sysctl_ctx_free(&clist2)) {
+ printf("sysctl_ctx_free(%p) failed!\n", &clist2);
+ /* Remove subtree forcefully... */
+ sysctl_remove_oid(b_root, 1, 1);
+ printf("sysctl_remove_oid(%p) succeeded\n", b_root);
+ } else
+ printf("Ok\n");
+ printf("3. Try to free ctx1 (%p) again: ", &clist);
+ if(sysctl_ctx_free(&clist)) {
+ printf("sysctl_ctx_free(%p) failed!\n", &clist);
+ /* Remove subtree forcefully... */
+ sysctl_remove_oid(a_root1, 1, 1);
+ printf("sysctl_remove_oid(%p) succeeded\n", a_root1);
+ } else
+ printf("Ok\n");
+ printf("4. Try to free ctx2 (%p): ", &clist1);
+ if(sysctl_ctx_free(&clist1)) {
+ printf("sysctl_ctx_free(%p) failed!\n", &clist1);
+ /* Remove subtree forcefully... */
+ sysctl_remove_oid(a_root, 1, 1);
+ } else
+ printf("Ok\n");
+ break;
+ default :
+ error = EINVAL;
+ break;
+ }
+ return error;
+}
+
+static moduledata_t mod_data= {
+ "dyn_sysctl",
+ load,
+ 0
+};
+
+DECLARE_MODULE(dyn_sysctl, mod_data, SI_SUB_EXEC, SI_ORDER_ANY);
diff --git a/share/examples/kld/syscall/Makefile b/share/examples/kld/syscall/Makefile
new file mode 100644
index 000000000000..7ea17df27638
--- /dev/null
+++ b/share/examples/kld/syscall/Makefile
@@ -0,0 +1,9 @@
+# Makefile for sample syscall module
+
+SUBDIR= module test
+
+load: _SUBDIRUSE
+
+unload: _SUBDIRUSE
+
+.include <bsd.subdir.mk>
diff --git a/share/examples/kld/syscall/module/Makefile b/share/examples/kld/syscall/module/Makefile
new file mode 100644
index 000000000000..44406f429f3c
--- /dev/null
+++ b/share/examples/kld/syscall/module/Makefile
@@ -0,0 +1,17 @@
+# Makefile for building the sample syscall module
+
+SRCS = syscall.c
+KMOD = syscall
+KO = ${KMOD}.ko
+KLDMOD = t
+
+KLDLOAD = /sbin/kldload
+KLDUNLOAD = /sbin/kldunload
+
+load: ${KO}
+ ${KLDLOAD} -v ./${KO}
+
+unload: ${KO}
+ ${KLDUNLOAD} -v -n ${KO}
+
+.include <bsd.kmod.mk>
diff --git a/share/examples/kld/syscall/module/syscall.c b/share/examples/kld/syscall/module/syscall.c
new file mode 100644
index 000000000000..2376725ed93e
--- /dev/null
+++ b/share/examples/kld/syscall/module/syscall.c
@@ -0,0 +1,86 @@
+/*-
+ * Copyright (c) 1999 Assar Westerlund
+ * 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$
+ */
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/module.h>
+#include <sys/sysent.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
+
+/*
+ * The function for implementing the syscall.
+ */
+
+static int
+hello (struct proc *p, void *arg)
+{
+ printf ("hello kernel\n");
+ return 0;
+}
+
+/*
+ * The `sysent' for the new syscall
+ */
+
+static struct sysent hello_sysent = {
+ 0, /* sy_narg */
+ hello /* sy_call */
+};
+
+/*
+ * The offset in sysent where the syscall is allocated.
+ */
+
+static int offset = NO_SYSCALL;
+
+/*
+ * The function called at load/unload.
+ */
+
+static int
+load (struct module *module, int cmd, void *arg)
+{
+ int error = 0;
+
+ switch (cmd) {
+ case MOD_LOAD :
+ printf ("syscall loaded at %d\n", offset);
+ break;
+ case MOD_UNLOAD :
+ printf ("syscall unloaded from %d\n", offset);
+ break;
+ default :
+ error = EINVAL;
+ break;
+ }
+ return error;
+}
+
+SYSCALL_MODULE(syscall, &offset, &hello_sysent, load, NULL);
diff --git a/share/examples/kld/syscall/test/Makefile b/share/examples/kld/syscall/test/Makefile
new file mode 100644
index 000000000000..5968689e31de
--- /dev/null
+++ b/share/examples/kld/syscall/test/Makefile
@@ -0,0 +1,6 @@
+# Makefile for simple caller of syscall
+
+PROG = call
+NOMAN = noman
+
+.include <bsd.prog.mk>
diff --git a/share/examples/kld/syscall/test/call.c b/share/examples/kld/syscall/test/call.c
new file mode 100644
index 000000000000..9183997821cd
--- /dev/null
+++ b/share/examples/kld/syscall/test/call.c
@@ -0,0 +1,54 @@
+/*-
+ * Copyright (c) 1999 Assar Westerlund
+ * 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$
+ */
+
+#include <stdio.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <sys/module.h>
+
+static void usage (void);
+
+static void
+usage (void)
+{
+ fprintf (stderr, "call syscall-number\n");
+ exit (1);
+}
+
+int
+main(int argc, char **argv)
+{
+ char *endptr;
+ int syscall_num;
+ struct module_stat stat;
+
+ stat.version = sizeof(stat);
+ modstat(modfind("syscall"), &stat);
+ syscall_num = stat.data.intval;
+ return syscall (syscall_num);
+}
diff --git a/share/examples/libvgl/Makefile b/share/examples/libvgl/Makefile
new file mode 100644
index 000000000000..4cc0325a2cfc
--- /dev/null
+++ b/share/examples/libvgl/Makefile
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+PROG= demo
+NOMAN= yes
+LDADD= -lvgl
+
+.include <bsd.prog.mk>
diff --git a/share/examples/libvgl/demo.c b/share/examples/libvgl/demo.c
new file mode 100644
index 000000000000..ace1b9429b48
--- /dev/null
+++ b/share/examples/libvgl/demo.c
@@ -0,0 +1,121 @@
+/*-
+ * Copyright (c) 1991-1997 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.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software withough 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/types.h>
+#include <machine/console.h>
+#include <vgl.h>
+
+int
+main(int argc, char **argv)
+{
+ int y, xsize, ysize, i,j;
+ VGLBitmap *tmp;
+
+ // set graphics mode, here 320x240 256 colors
+ // supported modes are (from <machine/console.h>):
+ // SW_VGA_CG320: std VGA 320x200 256 colors
+ // SW_VGA_MODEX: Modex VGA 320x240 256 colors
+ // SW_VGA_VG640: std VGA 640x480 16 colors
+ VGLInit(SW_VGA_MODEX);
+
+ // initialize mouse and show pointer
+ VGLMouseInit(VGL_MOUSESHOW);
+
+ // VGLDisplay is a ptr to a struct Bitmap defined and initialized by
+ // libvgl. The Bitmap points directly to screen memory etc.
+ xsize=VGLDisplay->Xsize;
+ ysize=VGLDisplay->Ysize;
+
+ // alloc a new bitmap
+ tmp = VGLBitmapCreate(MEMBUF, 256, 256, NULL);
+ VGLBitmapAllocateBits(tmp);
+ VGLClear(tmp, 0);
+
+ // fill the screen with colored lines
+ for (y=0; y<ysize; y++)
+ VGLLine(VGLDisplay, 0, y, xsize-1, y, y/2 % 256);
+
+ // draw some lines and circles just to show off
+ VGLLine(VGLDisplay, 0, 0, xsize-1, ysize-1, 63);
+ VGLLine(VGLDisplay, 0, ysize-1, xsize-1, 0, 63);
+ VGLLine(VGLDisplay, 0, 0, 0, ysize-1, 63);
+ VGLLine(VGLDisplay, xsize-1, 0, xsize-1, ysize-1, 63);
+ VGLEllipse(VGLDisplay, 256, 0, 256, 256, 63);
+ VGLEllipse(VGLDisplay, 0, 256, 256, 256, 0);
+
+ // some text is also usefull
+ VGLBitmapString(VGLDisplay, 100,100,
+ "This is text", 63, 0, 0, VGL_DIR_RIGHT);
+ sleep(2);
+ VGLBitmapString(VGLDisplay, 100,100,
+ "This is text", 63, 0, 0, VGL_DIR_UP);
+ sleep(2);
+ VGLBitmapString(VGLDisplay, 100,100,
+ "This is text", 63, 0, 0, VGL_DIR_LEFT);
+ sleep(2);
+ VGLBitmapString(VGLDisplay, 100,100,
+ "This is text", 63, 0, 0, VGL_DIR_DOWN);
+ sleep(2);
+
+ // now show some simple bitblit
+ for (i=0; i<256; i++)
+ for (j=0; j<256; j++)
+ tmp->Bitmap[i+256*j] = i%16;
+ VGLBitmapCopy(tmp, 0, 0, VGLDisplay, 0, 0, 128, 128);
+ for (i=0; i<256; i++)
+ for (j=0; j<256; j++)
+ tmp->Bitmap[i+256*j] = j%16;
+ VGLBitmapCopy(tmp, 0, 0, VGLDisplay, 3, 128, 128, 128);
+ sleep(2);
+ VGLBitmapCopy(VGLDisplay, 237, 311, tmp, 64, 64, 128, 128);
+ VGLBitmapCopy(tmp, 32, 32, VGLDisplay, 400, 128, 128, 128);
+ sleep(2);
+ VGLBitmapCopy(VGLDisplay, 300, 300, VGLDisplay, 500, 128, 128, 128);
+ sleep(5);
+ i=0;
+
+ // loop around drawing and copying
+ while (++i) {
+ VGLBitmapCopy(VGLDisplay, rand()%xsize, rand()%ysize,
+ VGLDisplay, rand()%xsize, rand()%ysize,
+ rand()%xsize, rand()%ysize);
+ VGLLine(VGLDisplay, rand()%xsize, rand()%ysize,
+ rand()%xsize, rand()%ysize, rand()%256);
+ VGLEllipse(VGLDisplay, rand()%xsize, rand()%ysize,
+ rand()%xsize/2, rand()%ysize/2, rand()%256);
+ rand();
+ if (i > 1000) break;
+ }
+
+ // restore screen to its original mode
+ VGLEnd();
+ return 0;
+}
+
diff --git a/share/examples/mdoc/example.1 b/share/examples/mdoc/example.1
new file mode 100644
index 000000000000..736d2fe7bb9b
--- /dev/null
+++ b/share/examples/mdoc/example.1
@@ -0,0 +1,153 @@
+.\" Copyright (c) [year] [your name]
+.\" 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$
+.\"
+.\" Note: The date here should be updated whenever a non-trivial
+.\" change is made to the manual page.
+.Dd December 8, 1999
+.Dt EXAMPLE 1
+.Os
+.Sh NAME
+.Nm example
+.Nd "example command manual page"
+.Sh SYNOPSIS
+.Nm
+.Op Fl abc
+.Op Fl d Ar argument
+.Ar file
+.Sh DESCRIPTION
+This is an example manual page for the
+.Nm
+command.
+It is intended that this example can be used as a template
+when writing a new manual page.
+.Pp
+The options are as follows:
+.Bl -tag -width ".Fl d Ar argument"
+.It Fl a
+Example optional
+.Fl a
+option.
+.It Fl b
+Example optional
+.Fl b
+option.
+.It Fl c
+Example optional
+.Fl c
+option.
+.It Fl d Ar argument
+Example optional
+.Fl d
+option with required argument
+.Ar argument .
+.It Ar file
+Required argument
+.Ar file .
+.El
+.Sh ENVIRONMENT
+The
+.Nm
+command ignores the
+.Ev EXAMPLE
+environment variable.
+.Sh FILES
+.Bl -tag -width ".Pa /dev/null" -compact
+.It Pa /dev/null
+Example of a file in the
+.Sx FILES
+section.
+.El
+.Sh EXAMPLES
+The following is an example of a typical usage
+of the
+.Nm
+command:
+.Pp
+.Dl "example -abc -d xyzzy /dev/null"
+.Sh DIAGNOSTICS
+Exit status is 0 on success, and 1 if the command
+fails for one of the following reasons:
+.Bl -diag
+.It "example error message"
+An example of an error message.
+.It "another example error message."
+Self explanatory.
+.El
+.Sh COMPATIBILITY
+The
+.Nm
+command has no known compatibility issues.
+.Sh SEE ALSO
+.Xr example 3 ,
+.Xr example 4 ,
+.Xr mdoc 7
+.Rs
+.%A "A. B. Author"
+.%T "Example RFC Title"
+.%O RFC0000
+.Re
+.Rs
+.%A "A. B. Author"
+.%B "Example Book Title"
+.%O ISBN-0-000-00000-0
+.Re
+.Rs
+.%A "A. B. Author"
+.%D "January 1997"
+.%J "Example Journal Name"
+.%T "Example Article Title"
+.Re
+.Sh STANDARDS
+If the command conforms to some standard, such as
+.St -p1003.2
+or
+.St -isoC ,
+it should be noted here.
+.Sh HISTORY
+The
+.Nm
+manual page example first appeared in
+.Fx 2.2 .
+.Pp
+Some other common
+.Sx HISTORY
+section examples are:
+.Pp
+The
+.Nm
+manual page example first appeared in
+.Bx 4.4 .
+.Pp
+The
+.Nm
+manual page example first appeared in
+.At v6 .
+.Sh AUTHORS
+This
+manual page was written by
+.An Mike Pritchard Aq mpp@FreeBSD.org .
+.Sh BUGS
+The actual code for this command is vaporware.
diff --git a/share/examples/mdoc/example.3 b/share/examples/mdoc/example.3
new file mode 100644
index 000000000000..2c5c22e385c9
--- /dev/null
+++ b/share/examples/mdoc/example.3
@@ -0,0 +1,319 @@
+.\" Copyright (c) [year] [your name]
+.\" 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$
+.\"
+.\" Note: The date here should be updated whenever a non-trivial
+.\" change is made to the manual page.
+.Dd December 8, 1999
+.Dt EXAMPLE 3
+.Os
+.Sh NAME
+.Nm example
+.Nd "example library function manual page"
+.Sh LIBRARY
+.\" Note: list of available libraries is available in mdoc(7)
+.Lb libc
+.Sh SYNOPSIS
+.In example.h
+.Ft int
+.Fn example "char *ptr" "int mode"
+.Sh DESCRIPTION
+This is an example library function manual page for the
+.Fn example
+function.
+It is intended that this example can be used as a template
+when writing a new manual page.
+.Pp
+The
+.Fn example
+function takes two arguments:
+.Fa ptr
+and
+.Fa mode .
+The argument
+.Fa mode
+may have one of the following values:
+.Bl -tag -width ".Dv EXAMPLE_ONE"
+.It Dv EXAMPLE_ONE
+First example of a defined variable.
+.Dv EXAMPLE_ONE
+is described below.
+.It Dv EXAMPLE_TWO
+Second example.
+.El
+.Pp
+The above values are defined in
+.Aq Pa example.h
+as follows:
+.Bd -literal
+#define EXAMPLE_ONE 1
+#define EXAMPLE_TWO 2
+.Ed
+.Sh IMPLEMENTATION NOTES
+The
+.Fn example
+function is not actually implemented.
+.Sh RETURN VALUES
+.Rv -std example
+.Sh ENVIRONMENT
+The
+.Fn example
+library function ignores the
+.Ev EXAMPLE
+environment variable.
+.Sh FILES
+.Bl -tag -width ".Pa /dev/null" -compact
+.It Pa /dev/null
+Example of a file in the
+.Sx FILES
+section.
+.El
+.Sh DIAGNOSTICS
+None.
+.Sh COMPATIBILITY
+The
+.Fn example
+function has no known compatibility issues.
+.Sh ERRORS
+.\" Delete any errno's that are not returned by your
+.\" function or system call and then tailor the
+.\" remaining text as needed.
+.Fn Example
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EPERM
+Operation not permitted.
+.It Bq Er ENOENT
+No such file or directory.
+.It Bq Er ESRCH
+No such process.
+.It Bq Er EINTR
+Interrupted system call.
+.It Bq Er EIO
+Input/output error.
+.It Bq Er ENXIO
+Device not configured.
+.It Bq Er E2BIG
+Argument list too long.
+.It Bq Er ENOEXEC
+Exec format error.
+.It Bq Er EBADF
+Bad file descriptor.
+.It Bq Er ECHILD
+No child processes.
+.It Bq Er EDEADLK
+Resource deadlock avoided.
+.It Bq Er ENOMEM
+Cannot allocate memory.
+.It Bq Er EACCES
+Permission denied.
+.It Bq Er EFAULT
+Bad address.
+.It Bq Er ENOTBLK
+Block device required.
+.It Bq Er EBUSY
+Device busy.
+.It Bq Er EEXIST
+File exists.
+.It Bq Er EXDEV
+Cross-device link.
+.It Bq Er ENODEV
+Operation not supported by device.
+.It Bq Er ENOTDIR
+Not a directory.
+.It Bq Er EISDIR
+Is a directory.
+.It Bq Er EINVAL
+Invalid argument.
+.It Bq Er ENFILE
+Too many open files in system.
+.It Bq Er EMFILE
+Too many open files.
+.It Bq Er ENOTTY
+Inappropriate ioctl for device.
+.It Bq Er ETXTBSY
+Text file busy.
+.It Bq Er EFBIG
+File too large.
+.It Bq Er ENOSPC
+No space left on device.
+.It Bq Er ESPIPE
+Illegal seek.
+.It Bq Er EROFS
+Read-only file system.
+.It Bq Er EMLINK
+Too many links.
+.It Bq Er EPIPE
+Broken pipe.
+.It Bq Er EDOM
+Numerical argument out of domain.
+.It Bq Er ERANGE
+Result too large.
+.It Bq Er EAGAIN
+Resource temporarily unavailable.
+.It Bq Er EWOULDBLOCK
+Operation would block.
+.It Bq Er EINPROGRESS
+Operation now in progress.
+.It Bq Er EALREADY
+Operation already in progress.
+.It Bq Er ENOTSOCK
+Socket operation on non-socket.
+.It Bq Er EDESTADDRREQ
+Destination address required.
+.It Bq Er EMSGSIZE
+Message too long.
+.It Bq Er EPROTOTYPE
+Protocol wrong type for socket.
+.It Bq Er ENOPROTOOPT
+Protocol not available.
+.It Bq Er EPROTONOSUPPORT
+Protocol not supported.
+.It Bq Er ESOCKTNOSUPPORT
+Socket type not supported.
+.It Bq Er EOPNOTSUPP
+Operation not supported.
+.It Bq Er EPFNOSUPPORT
+Protocol family not supported.
+.It Bq Er EAFNOSUPPORT
+Address family not supported by protocol family.
+.It Bq Er EADDRINUSE
+Address already in use.
+.It Bq Er EADDRNOTAVAIL
+Cannot assign requested address.
+.It Bq Er ENETDOWN
+Network is down.
+.It Bq Er ENETUNREACH
+Network is unreachable.
+.It Bq Er ENETRESET
+Network dropped connection on reset.
+.It Bq Er ECONNABORTED
+Software causes connection abort.
+.It Bq Er ENOBUFS
+No buffer space available.
+.It Bq Er EISCONN
+Socket is already connected.
+.It Bq Er ENOTCONN
+Socket is not connected.
+.It Bq Er ESHUTDOWN
+Cannot send after socket shutdown.
+.It Bq Er ETOOMANYREFS
+Too many references: cannot splice.
+.It Bq Er ETIMEDOUT
+Operation timed out.
+.It Bq Er ECONNREFUSED
+Connection refused.
+.It Bq Er ELOOP
+Too many levels of symbolic links.
+.It Bq Er ENAMETOOLONG
+File name too long.
+.It Bq Er EHOSTDOWN
+Host is down.
+.It Bq Er EHOSTUNREACH
+No route to host.
+.It Bq Er ENOTEMPTY
+Directory not empty.
+.It Bq Er EPROCLIM
+Too many processes.
+.It Bq Er EUSERS
+Too many users.
+.It Bq Er EDQUOT
+Disc quota exceeded.
+.It Bq Er ESTALE
+Stale NFS file handle.
+.It Bq Er EREMOTE
+Too many levels of remote in path.
+.It Bq Er EBADRPC
+RPC struct is bad.
+.It Bq Er ERPCMISMATCH
+RPC version wrong.
+.It Bq Er EPROGUNAVAIL
+RPC program not available.
+.It Bq Er EPROGMISMATCH
+Program version wrong.
+.It Bq Er EPROCUNAVAIL
+Bad procedure for program.
+.It Bq Er ENOLCK
+No locks available.
+.It Bq Er ENOSYS
+Function not implemented.
+.It Bq Er EFTYPE
+Inappropriate file type or format.
+.It Bq Er EAUTH
+Authentication error.
+.It Bq Er ENEEDAUTH
+Need authenticator.
+.El
+.Sh SEE ALSO
+.Xr example 1 ,
+.Xr example 4 ,
+.Xr mdoc 7
+.Rs
+.%A "A. B. Author"
+.%T "Example RFC Title"
+.%O RFC0000
+.Re
+.Rs
+.%A "A. B. Author"
+.%B "Example Book Title"
+.%O ISBN-0-000-00000-0
+.Re
+.Rs
+.%A "A. B. Author"
+.%D "January 1997"
+.%J "Example Journal Name"
+.%T "Example Article Title"
+.Re
+.Sh STANDARDS
+If the command conforms to some standard, such as
+.St -p1003.2
+or
+.St -isoC ,
+it should be noted here.
+.Sh HISTORY
+The
+.Nm
+manual page example first appeared in
+.Fx 2.2 .
+.Pp
+Some other common
+.Sx HISTORY
+section examples are:
+.Pp
+The
+.Nm
+manual page example first appeared in
+.Bx 4.4 .
+.Pp
+The
+.Nm
+manual page example first appeared in
+.At v6 .
+.Sh AUTHORS
+This
+manual page was written by
+.An Mike Pritchard Aq mpp@FreeBSD.org .
+.Sh BUGS
+The actual code for this function is vaporware.
diff --git a/share/examples/mdoc/example.4 b/share/examples/mdoc/example.4
new file mode 100644
index 000000000000..cb3f9b10481f
--- /dev/null
+++ b/share/examples/mdoc/example.4
@@ -0,0 +1,100 @@
+.\" Copyright (c) [year] [your name]
+.\" 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$
+.\"
+.\" Note: The date here should be updated whenever a non-trivial
+.\" change is made to the manual page.
+.Dd December 8, 1999
+.Dt EXAMPLE 4 i386
+.Os
+.Sh NAME
+.Nm example
+.Nd "example device driver manual page"
+.Sh SYNOPSIS
+.Cd "pseudo-device example"
+.Cd "options EXAMPLE_DEBUG"
+.Sh DESCRIPTION
+This is an example device driver manual page for the
+.Nm
+driver.
+It is intended that this example can be used as a template
+when writing a new manual page.
+.Pp
+The
+.Nm
+driver supports the following ioctls:
+.Bl -tag -width ".Dv EIOCNULL"
+.It Dv EIOCEX
+Example ioctl.
+.It Dv EIOCNULL
+Example ioctl.
+.El
+.Pp
+If the kernel is compiled with the
+.Dv EXAMPLE_DEBUG
+option, then additional debugging messages will be displayed.
+.Sh FILES
+.Bl -tag -width ".Pa /dev/null" -compact
+.It Pa /dev/null
+Example of a file in the
+.Sx FILES
+section.
+.El
+.Sh DIAGNOSTICS
+.Bl -diag
+.It "example%d: example diagnostic message."
+An example of a diagnostic message.
+.It "example%d: another example diagnostic message."
+Self explanatory.
+.El
+.Sh SEE ALSO
+.Xr example 1 ,
+.Xr example 3 ,
+.Xr mdoc 7
+.Sh HISTORY
+The
+.Nm
+manual page example first appeared in
+.Fx 2.2 .
+.Pp
+Some other common
+.Sx HISTORY
+section examples are:
+.Pp
+The
+.Nm
+manual page example first appeared in
+.Bx 4.4 .
+.Pp
+The
+.Nm
+manual page example first appeared in
+.At v6 .
+.Sh AUTHORS
+This
+manual page was written by
+.An Mike Pritchard Aq mpp@FreeBSD.org .
+.Sh BUGS
+The actual code for this device driver is vaporware.
diff --git a/share/examples/meteor/README b/share/examples/meteor/README
new file mode 100644
index 000000000000..c242145d83b9
--- /dev/null
+++ b/share/examples/meteor/README
@@ -0,0 +1 @@
+Example programs for the Matrox Meteor Video Capture Driver.
diff --git a/share/examples/meteor/rgb16.c b/share/examples/meteor/rgb16.c
new file mode 100644
index 000000000000..4c7ee0703c69
--- /dev/null
+++ b/share/examples/meteor/rgb16.c
@@ -0,0 +1,106 @@
+/* capture a PPM image using RGB16 and single capture mode */
+
+/* Copyright (c) 1995 Mark Tinguely and Jim Lowe
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mark Tinguely and Jim Lowe
+ * 4. 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.
+ */
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+/*#include <machine/ioctl_meteor.h>*/
+#include "/sys/i386/include/ioctl_meteor.h"
+
+extern int errno;
+#define ROWS 480
+#define COLS 640
+#define SIZE (ROWS * COLS * 2)
+main()
+{
+ struct meteor_geomet geo;
+ short *rgb16;
+ char b[4];
+ char header[16];
+ int i,o,c;
+
+ if ((i = open("/dev/meteor", O_RDONLY)) < 0) {
+ printf("open failed: %d\n", errno);
+ exit(1);
+ }
+ /* set up the capture type and size */
+ geo.rows = ROWS;
+ geo.columns = COLS;
+ geo.frames = 1;
+
+ geo.oformat = METEOR_GEO_RGB16;
+
+ if (ioctl(i, METEORSETGEO, &geo) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_FMT_NTSC;
+
+ if (ioctl(i, METEORSFMT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_INPUT_DEV0;
+
+ if (ioctl(i, METEORSINPUT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ rgb16 = (short *)mmap((caddr_t)0,SIZE,PROT_READ,MAP_SHARED, i, (off_t)0);
+
+ if (rgb16 == (short *) MAP_FAILED) return (0);
+
+ c = METEOR_CAP_SINGLE ;
+ ioctl(i, METEORCAPTUR, &c);
+
+ if ((o = open("rgb16.ppm", O_WRONLY | O_CREAT, 0644)) < 0) {
+ printf("ppm open failed: %d\n", errno);
+ exit(1);
+ }
+
+ /* make PPM header and save to file */
+ strcpy(&header[0], "P6 640 480 255 ");
+ header[2] = header[6] = header[10] = header[14] = '\n';
+ write (o, &header[0], 15);
+
+ for (c = 0 ; c < ROWS*COLS; c++) {
+ b[0]= ((*rgb16 >> 7) & 0xf8); /* r */
+ b[1]= ((*rgb16 >> 2) & 0xf8); /* g */
+ b[2]= ((*rgb16++ << 3) & 0xf8); /* b */
+ write(o, &b[0], 3);
+ }
+ close(o);
+ close(i);
+ exit(0);
+}
diff --git a/share/examples/meteor/rgb24.c b/share/examples/meteor/rgb24.c
new file mode 100644
index 000000000000..f2969022bb87
--- /dev/null
+++ b/share/examples/meteor/rgb24.c
@@ -0,0 +1,101 @@
+ /* capture a PPM file using 24 bit RGB image and read() */
+/* Copyright (c) 1995 Mark Tinguely and Jim Lowe
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mark Tinguely and Jim Lowe
+ * 4. 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.
+ */
+
+#include <sys/fcntl.h>
+/*#include <machine/ioctl_meteor.h>*/
+#include "/sys/i386/include/ioctl_meteor.h"
+
+extern int errno;
+#define ROWS 300
+#define COLS 400
+#define SIZE (ROWS * COLS * 4)
+main()
+{
+ struct meteor_geomet geo;
+ char buf[SIZE],b[4],header[16],*p;
+ int i,o,c;
+
+ if ((i = open("/dev/meteor", O_RDONLY)) < 0) {
+ printf("open failed: %d\n", errno);
+ exit(1);
+ }
+ /* set up the capture type and size */
+ geo.rows = ROWS;
+ geo.columns = COLS;
+ geo.frames = 1;
+ geo.oformat = METEOR_GEO_RGB24 ;
+
+ if (ioctl(i, METEORSETGEO, &geo) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_FMT_NTSC;
+
+ if (ioctl(i, METEORSFMT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_INPUT_DEV0;
+
+ if (ioctl(i, METEORSINPUT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ if ((c=read(i, &buf[0], SIZE)) < SIZE) {
+ printf("read failed %d %d %d\n", c, i, errno);
+ close(i);
+ exit(1);
+ }
+ close(i);
+
+ if ((o = open("rgb24.ppm", O_WRONLY | O_CREAT, 0644)) < 0) {
+ printf("ppm open failed: %d\n", errno);
+ exit(1);
+ }
+
+ /* make PPM header and save to file */
+ strcpy(&header[0], "P6 400 300 255 ");
+ header[2] = header[6] = header[10] = header[14] = '\n';
+ write (o, &header[0], 15);
+ /* save the RGB data to PPM file */
+ for (p = &buf[0]; p < &buf[SIZE]; ) {
+ b[2] = *p++; /* blue */
+ b[1] = *p++; /* green */
+ b[0] = *p++; /* red */
+ *p++; /* NULL byte */
+ write(o,&b[0], 3); /* not very efficient */
+ }
+ close(o);
+ exit(0);
+}
diff --git a/share/examples/meteor/test-n.c b/share/examples/meteor/test-n.c
new file mode 100644
index 000000000000..4651654c96d3
--- /dev/null
+++ b/share/examples/meteor/test-n.c
@@ -0,0 +1,162 @@
+/* A simple program to test the communication between the matrox meteor
+ * driver and an user application in the continous sync capture mode.
+ *
+ * First the driver clears the mask and decrements the counter like it
+ * would in a normal application. Then it purpose does not handle these
+ * responsibilities to simulate an application falling behind. I use
+ * the HUP signal to work as if the some of the buffers were removed
+ * (the second couter is used to cleared the correct bits.
+ *
+ * build kernel with at least:
+ *
+ * options "METEOR_ALLOC_PAGES=301"
+ *
+ */
+/* Copyright (c) 1995 Mark Tinguely and Jim Lowe
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mark Tinguely and Jim Lowe
+ * 4. 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.
+ */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+/*#include <machine/ioctl_meteor.h> */
+#include "/sys/i386/include/ioctl_meteor.h"
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+int i;
+static uint8 *y;
+extern int errno;
+struct meteor_mem *common_mem;
+int sig_cnt;
+int sig_cnt2;
+
+void
+hup_catcher()
+{
+ /* clear 4 oldest active bits */
+ common_mem->active &= ~(1 << (sig_cnt2++ % 32));
+ common_mem->active &= ~(1 << (sig_cnt2++ % 32));
+ common_mem->active &= ~(1 << (sig_cnt2++ % 32));
+ common_mem->active &= ~(1 << (sig_cnt2++ % 32));
+ /* lowat is low enough that I will need 2 hups to start saving again */
+ common_mem->num_active_bufs -= 4;
+ puts("hup caught");
+}
+
+void
+usr2_catcher()
+{
+ int j;
+ struct meteor_capframe capframe;
+
+ printf("active %3d = %08x ", sig_cnt,common_mem->active);
+ printf("# act %3d = %d\n", sig_cnt, common_mem->num_active_bufs);
+
+ if (sig_cnt < 80) {
+ common_mem->active &= ~(1 << (sig_cnt % 32));
+ common_mem->num_active_bufs--;
+ sig_cnt2++;
+ }
+
+ printf("data %08x\n", *((u_long *) (y + (sig_cnt % 32) *
+ common_mem->frame_size)));
+ if (++sig_cnt >= 200) {
+ capframe.command=METEOR_CAP_STOP_FRAMES;
+
+ if (ioctl(i, METEORCAPFRM, &capframe) < 0) {
+ printf("METEORCAPFRM failed %d\n", errno);
+ exit(1);
+ }
+ exit (0);
+ }
+}
+
+main()
+{
+ struct meteor_geomet geo;
+ int height, width, depth, frames, size;
+ struct meteor_capframe capframe;
+
+ if ((i = open("/dev/meteor", O_RDONLY)) < 0) {
+ printf("open failed\n");
+ exit(1);
+ }
+ printf("test %d %d\n", errno, i);
+
+ height = geo.rows = 120;
+ width= geo.columns = 160;
+ frames = geo.frames = 32;
+ depth = 2; /* 2 bytes per pixel */
+
+ printf("ioctl %d %d\n", errno, i);
+
+ geo.oformat = METEOR_GEO_RGB16;
+
+ if (ioctl(i, METEORSETGEO, &geo) < 0) {
+ printf("METEORSETGEO failed %d\n", errno);
+ exit(1);
+ }
+
+ printf("mmap %d %d\n", errno, i);
+ size = ((width*height*depth*frames+4095)/4096)*4096;
+ y=(uint8 *) mmap((caddr_t)0, size + 4096, PROT_READ |PROT_WRITE,MAP_SHARED, i, (off_t)0);
+
+ if (y == (uint8 *) MAP_FAILED) return (0);
+
+ common_mem = (struct meteor_mem *) (y + size);
+
+ signal(1, hup_catcher);
+ signal(31, usr2_catcher);
+
+ capframe.command=METEOR_CAP_N_FRAMES;
+ capframe.signal=31;
+ capframe.lowat=25;
+ capframe.hiwat=30;
+
+ printf("ioctl %d %d\n", errno, i);
+ if (ioctl(i, METEORCAPFRM, &capframe) < 0) {
+ printf("METEORCAPFRM failed %d\n", errno);
+ exit(1);
+ }
+
+ printf("signal = %d\n", common_mem->signal);
+ printf("frame size = %d\n", common_mem->frame_size);
+ printf("buffers = %d\n", common_mem->num_bufs);
+ printf("hiwater = %d\n", common_mem->hiwat);
+ printf("lowater = %d\n", common_mem->lowat);
+ printf("active = %08x\n", common_mem->active);
+ printf("# active = %d\n", common_mem->num_active_bufs);
+
+ printf("sleep loop\n", errno, i);
+ while (1) {
+ sleep (60);
+ }
+}
diff --git a/share/examples/meteor/yuvpk.c b/share/examples/meteor/yuvpk.c
new file mode 100644
index 000000000000..6ebd2e46206e
--- /dev/null
+++ b/share/examples/meteor/yuvpk.c
@@ -0,0 +1,118 @@
+/* capture a PPM image using YUV packed format and single capture mode */
+/* Copyright (c) 1995 Mark Tinguely and Jim Lowe
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mark Tinguely and Jim Lowe
+ * 4. 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.
+ */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+/*#include <machine/ioctl_meteor.h>*/
+#include "/sys/i386/include/ioctl_meteor.h"
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+static int8 *yuv_data;
+extern int errno;
+#define ROWS 480
+#define COLS 640
+#define SIZE (ROWS * COLS * 2)
+main()
+{
+ struct meteor_geomet geo;
+ char b[4],header[16],*p;
+ int i,o,c,r;
+ int y1,y2,u,v;
+
+ if ((i = open("/dev/meteor", O_RDONLY)) < 0) {
+ printf("open failed: %d\n", errno);
+ exit(1);
+ }
+ /* set up the capture type and size */
+ geo.rows = ROWS;
+ geo.columns = COLS;
+ geo.frames = 1;
+
+
+ geo.oformat = METEOR_GEO_YUV_PACKED;
+
+ if (ioctl(i, METEORSETGEO, &geo) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_FMT_NTSC;
+
+ if (ioctl(i, METEORSFMT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_INPUT_DEV0;
+
+ if (ioctl(i, METEORSINPUT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ yuv_data = (uint8 *)mmap((caddr_t)0,SIZE,PROT_READ,MAP_SHARED, i, (off_t)0);
+
+ if (yuv_data == (int8 *) MAP_FAILED) return (0);
+
+ c = METEOR_CAP_SINGLE ;
+ ioctl(i, METEORCAPTUR, &c);
+
+ if ((o = open("yuvpk.ppm", O_WRONLY | O_CREAT, 0644)) < 0) {
+ printf("ppm open failed: %d\n", errno);
+ exit(1);
+ }
+
+ /* make PPM header and save to file */
+ strcpy(&header[0], "P6 640 480 255 ");
+ header[2] = header[6] = header[10] = header[14] = '\n';
+ write (o, &header[0], 15);
+
+ for (c = 0 ; c < ROWS*COLS; c+=2) {
+ u = *yuv_data++;
+ if ((y1 = *yuv_data++) < 0) y1 += 256;
+ v = *yuv_data++;
+ if ((y2 = *yuv_data++) < 0) y2 += 256;
+
+ b[0]= (double)y1 + 1.375 * (double)v ; /*r*/
+ b[1]= (double)y1 - 0.703125 * (double)v -0.34375 * (double)u ; /* g */
+ b[2]= (double)y1 + 1.734375 * (double)u ; /* b */
+ b[3]= (double)y2 + 1.375 * (double)v ; /*r*/
+ b[4]= (double)y2 - 0.703125 * (double)v -0.34375 * (double)u ; /* g */
+ b[5]= (double)y2 + 1.734375 * (double)u ; /* b */
+ write(o,&b[0], 6);
+ }
+ close(o);
+ close(i);
+ exit(0);
+}
diff --git a/share/examples/meteor/yuvpl.c b/share/examples/meteor/yuvpl.c
new file mode 100644
index 000000000000..704dfce331d3
--- /dev/null
+++ b/share/examples/meteor/yuvpl.c
@@ -0,0 +1,138 @@
+/* capture a PPM image using YUV planer format and single capture mode */
+/* Copyright (c) 1995 Mark Tinguely and Jim Lowe
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by Mark Tinguely and Jim Lowe
+ * 4. 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.
+ */
+
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <sys/fcntl.h>
+/*#include <machine/ioctl_meteor.h>*/
+#include "/sys/i386/include/ioctl_meteor.h"
+
+
+typedef unsigned char uint8;
+typedef signed char int8;
+
+static uint8 *yuv_data;
+static int8 *ue, *uo, *ve, *vo;
+extern int errno;
+#define ROWS 480
+#define COLS 640
+#define SIZE (ROWS * COLS * 2)
+main()
+{
+ struct meteor_geomet geo;
+ char b[4],header[16],*p;
+ int i,o,c,r;
+ int y1,y2,u,v;
+ int temp;
+
+ if ((i = open("/dev/meteor", O_RDONLY)) < 0) {
+ printf("open failed: %d\n", errno);
+ exit(1);
+ }
+ /* set up the capture type and size */
+ geo.rows = ROWS;
+ geo.columns = COLS;
+ geo.frames = 1;
+
+
+ geo.oformat = METEOR_GEO_YUV_PLANER;
+
+ if (ioctl(i, METEORSETGEO, &geo) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_FMT_NTSC;
+
+ if (ioctl(i, METEORSFMT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ c = METEOR_INPUT_DEV0;
+
+ if (ioctl(i, METEORSINPUT, &c) < 0) {
+ printf("ioctl failed: %d\n", errno);
+ exit(1);
+ }
+
+ yuv_data = (uint8 *)mmap((caddr_t)0,SIZE,PROT_READ,MAP_SHARED, i, (off_t)0);
+
+ if (yuv_data == (uint8 *) MAP_FAILED) return (0);
+
+ temp = ROWS * COLS;
+ ue = yuv_data + temp;
+ temp = temp / 4;
+ ve = ue + temp;
+ uo = ve + temp;
+ vo = uo + temp;
+
+printf("data locations = %08x %08x %08x %08x %08x \n", yuv_data,ue,ve,uo,vo);
+
+ c = METEOR_CAP_SINGLE ;
+ ioctl(i, METEORCAPTUR, &c);
+
+ printf("read done %d %d\n", errno, i);
+ if ((o = open("yuvpl.ppm", O_WRONLY | O_CREAT, 0644)) < 0) {
+ printf("ppm open failed: %d\n", errno);
+ exit(1);
+ }
+
+ /* make PPM header and save to file */
+ strcpy(&header[0], "P6 640 480 255 ");
+ header[2] = header[6] = header[10] = header[14] = '\n';
+ write (o, &header[0], 15);
+
+ for (r = 0 ; r < ROWS ; r++) {
+ for (c = 0 ; c < COLS / 2; c++) {
+ if ((y1 = *yuv_data++) < 0) y1 += 256;
+ if ((y2 = *yuv_data++) < 0) y2 += 256;
+ if (r & 1) { /* odd */
+ u = *uo++ ;
+ v = *vo++;
+ }
+ else { /* even */
+ u = *ue++;
+ v = *ve++;
+ }
+ b[0]= (double)y1 + 1.375 * (double)v ; /*r*/
+ b[1]= (double)y1 - 0.703125 * (double)v -0.34375 * (double)u ; /* g */
+ b[2]= (double)y1 + 1.734375 * (double)u ; /* b */
+ b[3]= (double)y2 + 1.375 * (double)v ; /*r*/
+ b[4]= (double)y2 - 0.703125 * (double)v -0.34375 * (double)u ; /* g */
+ b[5]= (double)y2 + 1.734375 * (double)u ; /* b */
+ write(o,&b[0], 6);
+ }
+ }
+ close(o);
+ close(i);
+ exit(0);
+}
diff --git a/share/examples/netgraph/ether.bridge b/share/examples/netgraph/ether.bridge
new file mode 100644
index 000000000000..f68d4cd49721
--- /dev/null
+++ b/share/examples/netgraph/ether.bridge
@@ -0,0 +1,167 @@
+#!/bin/sh
+# $FreeBSD$
+
+# This script sets up an Ethernet bridging network across multiple
+# Ethernet interfaces using the ng_bridge(4) and ng_ether(4) netgraph
+# node types.
+#
+# To use this script:
+#
+# 0. Make your own copy of this example script
+#
+# 1. Give your bridging network a name by editing the definition of
+# ${BRIDGE_NAME} below. It must be a valid netgraph node name.
+#
+# 2. Edit the definitions of ${BRIDGE_IFACES} and ${LOCAL_IFACE}
+# as described below to define your bridging interfaces.
+#
+# 3. Run this script with "start" as the command line argument.
+#
+# 4. Examine bridging statistics by running this script with "stats"
+# as the command line argument.
+#
+# 5. Stop bridging by running this script with "stop" as the
+# command line argument.
+#
+# To run multiple independent bridging networks, create multiple
+# copies of this script with different variable definitions.
+#
+
+# Give each bridging network a unique name here
+
+BRIDGE_NAME="bnet0"
+
+# List the names of the interfaces that you want to bridge across
+# here in ${BRIDGE_IFACES}. If you want to include the local host
+# machine as well then set ${LOCAL_IFACE} as well (it may also be
+# listed in ${BRIDGE_IFACES}). Of course, any ${LOCAL_IFACE} must
+# be ifconfig(8)ured separately. If you don't want a ${LOCAL_IFACE}
+# then leave it defined as the emtpy string.
+
+BRIDGE_IFACES="ed0 fxp0 fxp1"
+LOCAL_IFACE="fxp0"
+
+####################################################################
+#### Everything below this point should not need to be modified ####
+####################################################################
+
+# Routine to verify node's existence
+bridge_verify() {
+ ngctl info ${BRIDGE_NAME}: >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "${BRIDGE_NAME}: bridge network not found"
+ exit 1
+ fi
+}
+
+# Routine to get and display link stats
+bridge_linkstats() {
+ STATS=`ngctl msg ${BRIDGE_NAME}: getstats $1`
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ echo "${STATS}" | fmt 2 | awk '/=/ { fl=index($0, "="); \
+ printf "%20s = %s\n", substr($0, 0, fl - 1), substr($0, fl + 1); }'
+}
+
+# Start/restart routine
+bridge_start() {
+
+ # Load netgraph KLD's as necessary
+ for KLD in ng_ether ng_bridge; do
+ if kldstat -v | grep -qw ${KLD}; then
+ else
+ echo -n "Loading ${KLD}.ko... "
+ kldload ${KLD} || exit 1
+ echo "done"
+ fi
+ done
+
+ # Reset all interfaces
+ bridge_stop
+
+ # Verify all interfaces exist
+ for ETHER in ${BRIDGE_IFACES} ${LOCAL_IFACE}; do
+ if ngctl info ${ETHER}: >/dev/null 2>&1; then
+ else
+ echo "Error: interface ${ETHER} does not exist"
+ exit 1
+ fi
+ ifconfig ${ETHER} up || exit 1
+ done
+
+ # Create new ng_bridge(4) node, attached to the first interface
+ FIRSTIF=`echo ${BRIDGE_IFACES} | awk '{ print $1 }'`
+ ngctl mkpeer ${FIRSTIF}: bridge lower link0 || exit 1
+ ngctl name ${FIRSTIF}:lower ${BRIDGE_NAME} || exit 1
+
+ # Attach other interfaces as well
+ LINKNUM=0
+ for ETHER in ${BRIDGE_IFACES}; do
+ if [ ${LINKNUM} != 0 ]; then
+ ngctl connect ${ETHER}: ${BRIDGE_NAME}: \
+ lower link${LINKNUM} || exit 1
+ fi
+ LINKNUM=`expr ${LINKNUM} + 1`
+ done
+
+ # Hook up local interface, if any
+ if [ "${LOCAL_IFACE}" != "" ]; then
+ ngctl connect ${LOCAL_IFACE}: ${BRIDGE_NAME}: \
+ upper link${LINKNUM} || exit 1
+ fi
+
+ # Set all interfaces in promiscuous mode and don't overwrite src addr
+ for ETHER in ${BRIDGE_IFACES}; do
+ ngctl msg ${ETHER}: setpromisc 1 || exit 1
+ ngctl msg ${ETHER}: setautosrc 0 || exit 1
+ done
+}
+
+# Stop routine
+bridge_stop() {
+ ngctl kill ${BRIDGE_NAME}: >/dev/null 2>&1
+ for ETHER in ${BRIDGE_IFACES} ${LOCAL_IFACE}; do
+ ngctl kill ${ETHER}: >/dev/null 2>&1
+ done
+}
+
+# Stats routine
+bridge_stats() {
+
+ # Make sure node exists
+ bridge_verify
+
+ echo ""
+ echo "Statistics for bridging network ${BRIDGE_NAME}:"
+ echo ""
+ LINKNUM=0
+ for ETHER in ${BRIDGE_IFACES}; do
+ echo "Network interface ${ETHER}:"
+ bridge_linkstats ${LINKNUM}
+ LINKNUM=`expr ${LINKNUM} + 1`
+ done
+ if [ "${LOCAL_IFACE}" != "" ]; then
+ echo "Local host interface ${LOCAL_IFACE}:"
+ bridge_linkstats ${LINKNUM}
+ fi
+}
+
+# Main entry point
+case $1 in
+ start)
+ bridge_start
+ ;;
+ stats)
+ bridge_verify
+ bridge_stats
+ ;;
+ stop)
+ bridge_verify
+ bridge_stop
+ ;;
+ *)
+ echo "Usage: ether.bridge [ start | stop | stats ]"
+ exit 1
+esac
+
diff --git a/share/examples/netgraph/frame_relay b/share/examples/netgraph/frame_relay
new file mode 100644
index 000000000000..0becb471c810
--- /dev/null
+++ b/share/examples/netgraph/frame_relay
@@ -0,0 +1,46 @@
+#!/bin/sh
+# script to set up a frame relay link on the sr card.
+# The dlci used is selected below. The default is 16
+# $FreeBSD$
+
+CARD=sr0
+DLCI=16
+
+# create a frame_relay type node and attach it to the sync port.
+ngctl mkpeer ${CARD}: frame_relay rawdata downstream
+
+# Attach the dlci output of the (de)multiplexor to a new
+# Link management protocol node.
+ngctl mkpeer ${CARD}:rawdata lmi dlci0 auto0
+
+# Also attach dlci 1023, as it needs both to try autoconfiguring.
+# The Link management protocol is now alive and probing..
+ngctl connect ${CARD}:rawdata ${CARD}:rawdata.dlci0 dlci1023 auto1023
+
+# Attach the DLCI(channel) the Telco has assigned you to
+# a node to hadle whatever protocol encapsulation your peer
+# is using. In this case rfc1490 encapsulation.
+ngctl mkpeer ${CARD}:rawdata rfc1490 dlci${DLCI} downstream
+
+
+# Attach the ip (inet) protocol output of the protocol mux to the ip (inet)
+# input of a netgraph "interface" node (ifconfig should show it as "ng0").
+#if interface ng0 needs to be created use a mkpeer command.. e.g.
+ngctl mkpeer ${CARD}:rawdata.dlci${DLCI} iface inet inet
+
+# if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g.
+# ngctl connect ${CARD}:rawdata.dlci${DLCI} ng0: inet inet
+
+# Then use ifconfig on interface ng0 as usual
+
+# A variant on this whole set might use the 'name' command to make it more
+# readable. but it doesn't work if you have multiple lines or dlcis
+# e.g.
+# ngctl mkpeer ${CARD}: frame_relay rawdata downstream
+# ngctl name ${CARD}:rawdata mux
+# ngctl mkpeer mux: lmi dlci0 auto0
+# ngctl name mux:dlci0 lmi
+# ngctl connect mux: lmi: dlci1023 auto1023
+# ngctl mkpeer mux: rfc1490 dlci${DLCI} downstream
+# ngctl mux:dlci${DLCI} protomux
+# ngctl mkpeer protomux: iface inet inet
diff --git a/share/examples/netgraph/ngctl b/share/examples/netgraph/ngctl
new file mode 100644
index 000000000000..6f9507b95e4b
--- /dev/null
+++ b/share/examples/netgraph/ngctl
@@ -0,0 +1,173 @@
+# $FreeBSD$
+
+#
+# This is an example that shows how to send ASCII formatted control
+# messages to a node using ngctl(8).
+#
+# What we will do here create a divert(4) tap. This simply dumps
+# out all packets diverted by some ipfw(8) divert rule to the console.
+#
+# Lines that begin with ``$'' (shell prompt) or ``+'' (ngctl prompt)
+# indicate user input
+#
+
+# First, start up ngctl in interactive mode:
+
+ $ ngctl
+ Available commands:
+ connect Connects hook <peerhook> of the node at <relpath> to <hook>
+ debug Get/set debugging verbosity level
+ help Show command summary or get more help on a specific command
+ list Show information about all nodes
+ mkpeer Create and connect a new node to the node at "path"
+ msg Send a netgraph control message to the node at "path"
+ name Assign name <name> to the node at <path>
+ read Read and execute commands from a file
+ rmhook Disconnect hook "hook" of the node at "path"
+ show Show information about the node at <path>
+ shutdown Shutdown the node at <path>
+ status Get human readable status information from the node at <path>
+ types Show information about all installed node types
+ quit Exit program
+ +
+
+# Now let's create a ng_ksocket(8) node, in the family PF_INET,
+# of type SOCK_RAW, and protocol IPPROTO_DIVERT:
+
+ + mkpeer ksocket foo inet/raw/divert
+
+# Note that ``foo'' is the hook name on the socket node, which can be
+# anything. The ``inet/raw/divert'' is the hook name on the ksocket
+# node, which tells it what kind of socket to create.
+
+# Lets give our ksocket node a global name. How about ``fred'':
+
+ + name foo fred
+
+# Note that we used ngctl's ``name'' command to do this. However,
+# the following manually constructed netgraph message would have
+# acomplished the exact same thing:
+
+ + msg foo name { name="fred" }
+
+# Here we are using the ASCII <-> binary control message conversion
+# routines. ngctl does this for us automatically when we use the
+# ``msg'' command.
+
+# Now lets bind the socket associated with the ksocket node to a port
+# supplied by the system. We do this by sending the ksocket node a
+# ``bind'' control message. Again, ngctl does the conversion of the
+# control message from ASCII to binary behind the scenes.
+
+ + msg fred: bind inet/192.168.1.1
+
+# The ksocket accepts arbitrary sockaddr structures, but also has
+# special support for the PF_LOCAL and PF_INET protocol families.
+# That is why we can specify the struct sockaddr argument to the
+# ``bind'' command as ``inet/192.168.1.1'' (since we didn't specify
+# a port number, it's assumed to be zero). We could have also
+# relied on the generic sockaddr syntax and instead said this:
+
+ + msg fred: bind { family=2 len=16 data=[ 2=192 168 1 1 ] }
+
+# This is what you would have to do for protocol families other
+# that PF_INET and PF_LOCAL, at least until special handling for
+# new ones is added.
+
+# The reason for the ``2=192'' is to skip the two byte IP port number,
+# which causes it to be set to zero, the default value for integral
+# types when parsing. Now since we didn't ask for a specific port
+# number, we need to do a ``getname'' to see what port number we got:
+
+ + msg fred: getname
+ Rec'd response "getname" (5) from "fred:":
+ Args: inet/192.168.1.1:1029
+
+# As soon as we sent the message, we got back a response. Here
+# ngctl is telling us that it received a control message with the
+# NGF_RESP (response) flag set, the reponse was to a prior ``getname''
+# control message, that the originator was the node addressable
+# as ``fred:''. The message arguments field is then displayed to
+# us in its ASCII form. In this case, what we get back is a struct
+# sockaddr, and there we see that our port number is 1029.
+
+# So now let's add the ipfw divert rule for whatever packets we
+# want to see. How about anything from 192.168.1.129.
+
+ + ^Z
+ Suspended
+ $ ipfw add 100 divert 1029 ip from 192.168.1.129 to any
+ 00100 divert 1029 ip from 192.168.1.129 to any
+ $ fg
+
+# Now watch what happens when we try to ping from that machine:
+
+ +
+ Rec'd data packet on hook "foo":
+ 0000: 45 00 00 3c 57 00 00 00 20 01 bf ee c0 a8 01 81 E..<W... .......
+ 0010: c0 a8 01 01 08 00 49 5c 03 00 01 00 61 62 63 64 ......I\....abcd
+ 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
+ 0030: 75 76 77 61 62 63 64 65 66 67 68 69 uvwabcdefghi
+ +
+ Rec'd data packet on hook "foo":
+ 0000: 45 00 00 3c 58 00 00 00 20 01 be ee c0 a8 01 81 E..<X... .......
+ 0010: c0 a8 01 01 08 00 48 5c 03 00 02 00 61 62 63 64 ......H\....abcd
+ 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
+ 0030: 75 76 77 61 62 63 64 65 66 67 68 69 uvwabcdefghi
+ +
+ Rec'd data packet on hook "foo":
+ 0000: 45 00 00 3c 59 00 00 00 20 01 bd ee c0 a8 01 81 E..<Y... .......
+ 0010: c0 a8 01 01 08 00 47 5c 03 00 03 00 61 62 63 64 ......G\....abcd
+ 0020: 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 efghijklmnopqrst
+ 0030: 75 76 77 61 62 63 64 65 66 67 68 69 uvwabcdefghi
+ +
+
+# So we're seeing the output from the ksocket socket appear on the ``foo''
+# hook of ngctl's socket node. Since the packets are getting diverted,
+# the 192.168.1.129 machine doesn't see any response from us.
+
+# Of course, any type of socket can be used, even TCP:
+
+ + mkpeer ksocket bar inet/stream/tcp
+ + msg bar connect inet/192.168.1.33:13
+ ngctl: send msg: Operation now in progress
+ +
+ Rec'd data packet on hook "foo":
+ 0000: 4d 6f 6e 20 4e 6f 76 20 32 39 20 31 37 3a 34 38 Mon Nov 29 17:48
+ 0010: 3a 33 37 20 31 39 39 39 0d 0a :37 1999..
+ +
+
+# Or, UNIX domain:
+
+ + mkpeer ksocket bar local/stream/0
+ + msg bar bind local/"/tmp/bar.socket"
+ +
+
+# Here's an example of a more complicated ASCII control message argument.
+# If you look in /sys/netgraph/ng_message.h, you will see that a node
+# responds to a NGM_LISTHOOKS with a struct hooklist, which contains
+# an array of struct linkinfo:
+#
+# /* Structure used for NGM_LISTHOOKS */
+# struct linkinfo {
+# char ourhook[NG_HOOKLEN + 1]; /* hook name */
+# char peerhook[NG_HOOKLEN + 1]; /* peer hook */
+# struct nodeinfo nodeinfo;
+# };
+#
+# struct hooklist {
+# struct nodeinfo nodeinfo; /* node information */
+# struct linkinfo link[0]; /* info about each hook */
+# };
+#
+# By sending a node the ``listhooks'' command using ngctl, we can see
+# this structure in ASCII form (lines wrapped for readability):
+
+ + msg bar bind local/"/tmp/bar.socket"
+ + msg bar listhooks
+ Rec'd response "listhooks" (7) from "bar":
+ Args: { nodeinfo={ type="ksocket" id=9 hooks=1 }
+ linkinfo=[ { ourhook="local/stream/0" peerhook="bar"
+ nodeinfo={ name="ngctl1327" type="socket" id=8 hooks=1 } } ] }
+
+
diff --git a/share/examples/netgraph/raw b/share/examples/netgraph/raw
new file mode 100644
index 000000000000..e0970f3c0b33
--- /dev/null
+++ b/share/examples/netgraph/raw
@@ -0,0 +1,16 @@
+#!/bin/sh
+# script to connect a raw synchronous card to a system interface.
+# Assumes the file if_sr was compiled with options NETGRAPH.
+# $FreeBSD$
+
+CARD=sr0
+
+# create an interface "ng0" and attach it to the sync port.
+# The packets had jolly well better be ip because we are not discriminating.
+ngctl mkpeer ${CARD}: iface rawdata inet
+
+# if ng0 already exists, use a CONNECT command instead of a mkpeer. e.g.
+# ngctl connect ${CARD}: ng0: rawdata inet
+
+# Then use ifconfig on interface ng0 as usual
+
diff --git a/share/examples/netgraph/udp.tunnel b/share/examples/netgraph/udp.tunnel
new file mode 100644
index 000000000000..39ae2bc600b2
--- /dev/null
+++ b/share/examples/netgraph/udp.tunnel
@@ -0,0 +1,53 @@
+#!/bin/sh
+# $FreeBSD$
+
+# This script sets up a virtual point-to-point WAN link between
+# two subnets, using UDP packets as the ``WAN connection.''
+# The two subnets might be non-routable addresses behind a
+# firewall.
+#
+
+# Here define the local and remote inside networks as well
+# as the local and remote outside IP addresses and UDP port
+# number that will be used for the tunnel.
+#
+LOC_INTERIOR_IP=192.168.1.1
+LOC_EXTERIOR_IP=1.1.1.1
+REM_INTERIOR_IP=192.168.2.1
+REM_EXTERIOR_IP=2.2.2.2
+REM_INSIDE_NET=192.168.2.0
+UDP_TUNNEL_PORT=4028
+
+# Create the interface node ``ng0'' if it doesn't exist already,
+# otherwise just make sure it's not connected to anything.
+# In FreeBSD, interfaces cannot be removed so it might already
+# be there from before.
+#
+if ifconfig ng0 >/dev/null 2>&1; then
+ ifconfig ng0 inet down delete >/dev/null 2>&1
+ ngctl shutdown ng0:
+else
+ ngctl mkpeer iface dummy inet
+fi
+
+# Attach a UDP socket to the ``inet'' hook of the interface node
+# using the ng_ksocket(8) node type.
+#
+ngctl mkpeer ng0: ksocket inet inet/dgram/udp
+
+# Bind the UDP socket to the local external IP address and port
+#
+ngctl msg ng0:inet bind inet/${LOC_EXTERIOR_IP}:${UDP_TUNNEL_PORT}
+
+# Connect the UDP socket to the peer's external IP address and port
+#
+ngctl msg ng0:inet connect inet/${REM_EXTERIOR_IP}:${UDP_TUNNEL_PORT}
+
+# Configure the point-to-point interface
+#
+ifconfig ng0 ${LOC_INTERIOR_IP} ${REM_INTERIOR_IP}
+
+# Add a route to the peer's interior network via the tunnel
+#
+route add ${REM_INSIDE_NET} ${REM_INTERIOR_IP}
+
diff --git a/share/examples/nwclient/dot.nwfsrc b/share/examples/nwclient/dot.nwfsrc
new file mode 100644
index 000000000000..142ad11633fa
--- /dev/null
+++ b/share/examples/nwclient/dot.nwfsrc
@@ -0,0 +1,78 @@
+# $FreeBSD$
+#
+# Example for .nwfsrc file
+#
+# ncplib lookups configuration files in next order:
+# 1. ~/.nwfsrc
+# 2. /etc/nwserv.conf - if this file found it will
+# override values with same keys from user files.
+#
+#
+# This file consist of a set of sections. Each section started by section name
+# surrounded by square brackets:
+# [section_name]
+#
+# End of the section marked either by new section or by the end of file.
+# Each section can contain zero or more parameters:
+# [section_name]
+# key=value
+#
+# where 'key' is a represents parameter name and 'value' a value assigned
+# to this parameter.
+#
+# NetWare library uses next forms of section names:
+# [SERVER]
+# [SERVER:USER]
+# [SERVER:QUEUE]
+#
+# When user issues any ncp* command that requires create of new connection
+# to a NetWare server, library function lookups for parameters in the
+# corresponding section. First it looks in the [SERVER] section and then in
+# the [SERVER:USER] section. Please note that server and user names should be
+# in the upper case.
+#
+
+# Following parameters are valid for [SERVER] or [SERVER:USER] section:
+[BHOME:SUPERVISOR]
+# if you don't use password leave value empty
+password=I_DONT_TELL_YOU
+
+# how many retries before error, default 10
+retry_count=10
+
+# timeout for request to complete
+timeout=5
+
+# access mode to connection, default 0700
+access_mode=0700
+
+# signature level, default 0 - no signatures
+sig_level=0
+
+# force bindery login, default no
+bindery=no
+
+# default print queue for user, default is none
+# print_queue=QE_BJ
+
+
+[ANOTHERSERVER:PLAINUSER]
+# in this case user have an empty password
+password=
+
+# Defaults for printer queues defined as [SERVER:QUEUE]
+# communication parameters taken from [SERVER:USER] section
+# see man ncprint(1) for queue parameters description
+# note: if any banner related option is specified, banner will be printed.
+[BHOME:QE_BJ]
+#path_name=/etc
+#file_name=passwd
+#banner_name=My Job
+#job_desc=Printing from FreeBSD
+
+#lines=66
+#rows=80
+copies=1
+tab_size=8
+no_form_feed=yes
+#form_number=0
diff --git a/share/examples/nwclient/nwfs.sh.sample b/share/examples/nwclient/nwfs.sh.sample
new file mode 100644
index 000000000000..cb8b631f0b7d
--- /dev/null
+++ b/share/examples/nwclient/nwfs.sh.sample
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# Location: /usr/local/etc/rc.d/nwfs.sh
+#
+# Simple script to mount NetWare volumes at startup.
+# It assumes that all mount points described in fstab file and password
+# entries listed in /root/.nwfsrc file. See mount_nwfs(8) for details.
+#
+
+mount=/sbin/mount
+umount=/sbin/umount
+HOME=/root; export HOME
+vols="/nw/sys /nw/vol1"
+
+if [ "x$1" = "x" -o "x$1" = "xstart" ]; then
+ echo -n "Mounting NetWare volumes: "
+ for vol in ${vols}; do
+ $mount $vol
+ echo -n "$vol "
+ done
+ echo "Done"
+elif [ "x$1" = "xstop" ]; then
+ echo -n "Unmounting NetWare mount points: "
+ for vol in ${vols}; do
+ $umount $vol
+ echo -n "$vol "
+ done
+ echo "Done"
+else
+ echo "Unknown command $1"
+fi
+
diff --git a/share/examples/perfmon/Makefile b/share/examples/perfmon/Makefile
new file mode 100644
index 000000000000..e1e7e9faf090
--- /dev/null
+++ b/share/examples/perfmon/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+PROG= perfmon
+NOMAN=
+
+install:
+
+.include <bsd.prog.mk>
diff --git a/share/examples/perfmon/README b/share/examples/perfmon/README
new file mode 100644
index 000000000000..ffa2cafa92c8
--- /dev/null
+++ b/share/examples/perfmon/README
@@ -0,0 +1,25 @@
+`perfmon' is a sample program to access the performance-monitoring
+counters on Pentium and Pentium Pro CPUs. See perfmon(4) for a
+description of this facility.
+
+The program takes the following options:
+
+ -u count events in user mode
+ -o count events in kernel mode
+ (these two can be combined)
+
+ -e count events, not duration
+ -l n run `n' loops (default 50)
+ -s n sleep `n' seconds between loop iterations (default 0)
+
+The following options are not implemented on Pentium CPUs:
+
+ -m n use count mask `n'
+ -i invert sense of count mask comparison
+ -U n use unit mask `n'
+
+There is one mandatory argument, which is the event number to be
+monitored, defined in <machine/perfmon.h>. All numbers can be
+specified in any format acceptable to strtol(3).
+
+$FreeBSD$
diff --git a/share/examples/perfmon/perfmon.c b/share/examples/perfmon/perfmon.c
new file mode 100644
index 000000000000..34e38849b22b
--- /dev/null
+++ b/share/examples/perfmon/perfmon.c
@@ -0,0 +1,195 @@
+/*
+ * Copyright 1996 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby
+ * granted, provided that both the above copyright notice and this
+ * permission notice appear in all copies, that both the above
+ * copyright notice and this permission notice appear in all
+ * supporting documentation, and that the name of M.I.T. not be used
+ * in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. M.I.T. makes
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''. M.I.T. DISCLAIMS
+ * ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
+ * SHALL M.I.T. 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/types.h>
+#include <sys/ioctl.h>
+
+#include <machine/cpu.h>
+#include <machine/perfmon.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <err.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <errno.h>
+
+static int getnum(const char *, int, int);
+static void usage(const char *) __dead2;
+
+int
+main(int argc, char **argv)
+{
+ int c, fd, num;
+ int loops, i, sleeptime;
+ char *cmd;
+ struct pmc pmc;
+ struct pmc_tstamp then, now;
+ struct pmc_data value;
+ quad_t *buf;
+ double total;
+
+ pmc.pmc_num = 0;
+ pmc.pmc_event = 0;
+ pmc.pmc_unit = 0;
+ pmc.pmc_flags = 0;
+ pmc.pmc_mask = 0;
+ cmd = NULL;
+ loops = 50;
+ sleeptime = 0;
+
+ while ((c = getopt(argc, argv, "s:l:uoeiU:m:c:")) != -1) {
+ switch(c) {
+ case 'u':
+ pmc.pmc_flags |= PMCF_USR;
+ break;
+ case 'o':
+ pmc.pmc_flags |= PMCF_OS;
+ break;
+ case 'e':
+ pmc.pmc_flags |= PMCF_E;
+ break;
+ case 'i':
+ pmc.pmc_flags |= PMCF_INV;
+ break;
+ case 'U':
+ pmc.pmc_unit = getnum(optarg, 0, 256);
+ break;
+ case 'm':
+ pmc.pmc_mask = getnum(optarg, 0, 256);
+ break;
+ case 'l':
+ loops = getnum(optarg, 1, INT_MAX - 1);
+ break;
+ case 's':
+ sleeptime = getnum(optarg, 0, INT_MAX - 1);
+ break;
+ case 'c':
+ cmd = optarg;
+ break;
+ default:
+ usage(argv[0]);
+ }
+ }
+
+ if (argc - optind != 1)
+ usage(argv[0]);
+
+ pmc.pmc_event = getnum(argv[optind], 0, 255);
+
+ buf = malloc((loops + 1) * sizeof *buf);
+ if (!buf)
+ err(1, "malloc(%lu)", (unsigned long)(loops +1) * sizeof *buf);
+
+ fd = open(_PATH_PERFMON, O_RDWR, 0);
+ if (fd < 0)
+ err(1, "open: " _PATH_PERFMON);
+
+ if (ioctl(fd, PMIOSETUP, &pmc) < 0)
+ err(1, "ioctl(PMIOSETUP)");
+
+ if (ioctl(fd, PMIOTSTAMP, &then) < 0)
+ err(1, "ioctl(PMIOTSTAMP)");
+
+ num = 0;
+ if (ioctl(fd, PMIOSTART, &num) < 0)
+ err(1, "ioctl(PMIOSTART)");
+
+ value.pmcd_num = 0;
+ for (i = 0; i < loops; i++) {
+ if (ioctl(fd, PMIOSTOP, &num) < 0)
+ err(1, "ioctl(PMIOSTOP)");
+ if (ioctl(fd, PMIOREAD, &value) < 0)
+ err(1, "ioctl(PMIOREAD)");
+ buf[i] = value.pmcd_value;
+ if (ioctl(fd, PMIORESET, &value.pmcd_num) < 0)
+ err(1, "ioctl(PMIORESET)");
+ if (ioctl(fd, PMIOSTART, &num) < 0)
+ err(1, "ioctl(PMIOSTART)");
+ if (sleeptime)
+ sleep(sleeptime);
+ if (cmd)
+ system(cmd);
+ }
+
+ if (ioctl(fd, PMIOSTOP, &num) < 0)
+ err(1, "ioctl(PMIOSTOP)");
+ if (ioctl(fd, PMIOREAD, &value) < 0)
+ err(1, "ioctl(PMIOREAD)");
+ buf[i] = value.pmcd_value;
+ if (ioctl(fd, PMIOTSTAMP, &now) < 0)
+ err(1, "ioctl(PMIOTSTAMP)");
+
+ total = 0;
+ for (i = 1; i <= loops; i++) {
+ printf("%d: %qd\n", i, buf[i]);
+ total += buf[i];
+ }
+ printf("total: %f\nmean: %f\n", total, total / loops);
+
+ printf("clocks (at %d-MHz): %qd\n", now.pmct_rate,
+ now.pmct_value - then.pmct_value);
+
+ return 0;
+}
+
+static int
+getnum(const char *buf, int min, int max)
+{
+ char *ep;
+ long l;
+
+ errno = 0;
+ l = strtol(buf, &ep, 0);
+ if (*buf && !*ep && !errno) {
+ if (l < min || l > max) {
+ errx(1, "`%s': must be between %d and %d",
+ buf, min, max);
+ }
+ return (int)l;
+ } else if(errno) {
+ errx(1, "`%s': must be between %ld and %ld",
+ LONG_MIN, LONG_MAX);
+ }
+ errx(1, "`%s': parameter must be an integer");
+}
+
+static void
+usage(const char *pname)
+{
+ fprintf(stderr,
+ "usage: %s [-eiou] [-c command] [-l nloops] [-m mask] [-s sleeptime]\n"
+ " [-U unit] counter\n",
+ pname);
+ exit(1);
+}
diff --git a/share/examples/portal/README b/share/examples/portal/README
new file mode 100644
index 000000000000..f3a26909d3f6
--- /dev/null
+++ b/share/examples/portal/README
@@ -0,0 +1,64 @@
+
+This contains a couple of examples for using the portal filing system.
+
+The portal file system provides a way of obtaining a file descriptor
+to a filesystem object (i.e. something that is accessed by open(2),
+pipe(2), socket(2) or socketpair(2)) via the filesystem namespace.
+At present the only file descriptor supported are TCP sockets and
+files.
+
+NOTE!!!! The portal file system is experimental in nature and should
+not be considered secure, use with caution.
+
+First off mount the filesystem using something like:
+
+# mount_portal /usr/share/examples/portal/portal.conf /p
+
+Then you should be able to do things like
+# cat /p/tcp/localhost/daytime
+Sun Nov 22 17:50:09 1998
+(assuming inetd is running the daytime service, by default it is off)
+
+Welcome to FreeBSD!
+
+# mkdir -p /tmp/root
+# cd /tmp/root
+# mkdir bin p
+# cp /bin/sh /bin/cat bin
+# mount_portal /usr/share/examples/portal/portal.conf /tmp/root/p
+# chroot /tmp/root
+# pwd
+/
+# echo *
+bin p
+# cat /etc/motd
+cat: /etc/motd: No such file or directory
+# cat /p/fs/etc/motd
+FreeBSD 2.2.6-RELEASE (COMPUTER) #0: Sat Aug 22 17:11:37 BST 1998
+
+Welcome to FreeBSD!
+
+Finally, a very simple example of the listening server is available,
+fire up two xterms. In the first
+
+xterm-1$ cat /p/tcplisten/ANY/6666
+(the ANY is a wildcard just like using INADDR_ANY, any resolvable host
+can be used).
+
+In the second xterm
+xterm-2$ echo "hello there" >/p/tcp/localhost/6666
+
+You should see the "hello there" string appear on the first terminal.
+
+Unprivilged users can't create servers on privalged ports.
+xterm-1$ cat /p/tcplisten/ANY/666
+cat: /p/tcplisten/ANY/666: Operation not permitted
+
+but root can
+xterm-1# cat /p/tcplisten/ANY/666
+
+In the second
+xterm-2$ echo "hello there" >/p/tcp/localhost/666
+should produce the expected response.
+
+You can also swap the client/server read and write commands etc.
diff --git a/share/examples/portal/portal.conf b/share/examples/portal/portal.conf
new file mode 100644
index 000000000000..aa7e282d59ca
--- /dev/null
+++ b/share/examples/portal/portal.conf
@@ -0,0 +1,3 @@
+tcp/ tcp tcp/
+tcplisten/ tcplisten tcplisten/
+fs/ file fs/
diff --git a/share/examples/ppi/Makefile b/share/examples/ppi/Makefile
new file mode 100644
index 000000000000..1836d8abc17c
--- /dev/null
+++ b/share/examples/ppi/Makefile
@@ -0,0 +1,8 @@
+# Makefile to build LCD control software for ppi(4) interface.
+#
+# $FreeBSD$
+
+PROG= ppilcd
+NOMAN= YES
+
+.include <bsd.prog.mk>
diff --git a/share/examples/ppi/ppilcd.c b/share/examples/ppi/ppilcd.c
new file mode 100644
index 000000000000..91a3effcbec9
--- /dev/null
+++ b/share/examples/ppi/ppilcd.c
@@ -0,0 +1,439 @@
+/*
+ * Control LCD module hung off parallel port using the
+ * ppi 'geek port' interface.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <err.h>
+#include <sysexits.h>
+
+/* XXX should be in <machine/> */
+#include "ppbconf.h"
+#include "ppi.h"
+
+#define debug(lev, fmt, args...) if (debuglevel >= lev) fprintf(stderr, fmt "\n" , ## args);
+
+static void usage(void);
+static char *progname;
+
+#define DEFAULT_DEVICE "/dev/ppi0"
+
+/* Driver functions */
+static void hd44780_prepare(char *devname, char *options);
+static void hd44780_finish(void);
+static void hd44780_command(int cmd);
+static void hd44780_putc(int c);
+
+/*
+ * Commands
+ * Note that unrecognised command escapes are passed through with
+ * the command value set to the ASCII value of the escaped character.
+ */
+#define CMD_RESET 0
+#define CMD_BKSP 1
+#define CMD_CLR 2
+#define CMD_NL 3
+#define CMD_CR 4
+#define CMD_HOME 5
+
+#define MAX_DRVOPT 10 /* maximum driver-specific options */
+
+struct lcd_driver
+{
+ char *l_code;
+ char *l_name;
+ char *l_options[MAX_DRVOPT];
+ void (* l_prepare)(char *name, char *options);
+ void (* l_finish)(void);
+ void (* l_command)(int cmd);
+ void (* l_putc)(int c);
+};
+
+static struct lcd_driver lcd_drivertab[] = {
+ {
+ "hd44780",
+ "Hitachi HD44780 and compatibles",
+ {
+ "Reset options:",
+ " 1 1-line display (default 2)",
+ " B Cursor blink enable",
+ " C Cursor enable",
+ " F Large font select",
+ NULL
+ },
+ hd44780_prepare,
+ hd44780_finish,
+ hd44780_command,
+ hd44780_putc
+ },
+ {
+ NULL,
+ NULL,
+ {
+ NULL
+ },
+ NULL,
+ NULL
+ }
+};
+
+static void do_char(struct lcd_driver *driver, char ch);
+
+int debuglevel = 0;
+int vflag = 0;
+
+void
+main(int argc, char *argv[])
+{
+ extern char *optarg;
+ extern int optind;
+ struct lcd_driver *driver = &lcd_drivertab[0];
+ char *drivertype, *cp;
+ char *devname = DEFAULT_DEVICE;
+ char *drvopts = NULL;
+ int ch, i;
+
+ if ((progname = strrchr(argv[0], '/'))) {
+ progname++;
+ } else {
+ progname = argv[0];
+ }
+
+ drivertype = getenv("LCD_TYPE");
+
+ while ((ch = getopt(argc, argv, "Dd:f:o:v")) != EOF) {
+ switch(ch) {
+ case 'D':
+ debuglevel++;
+ break;
+ case 'd':
+ drivertype = optarg;
+ break;
+ case 'f':
+ devname = optarg;
+ break;
+ case 'o':
+ drvopts = optarg;
+ break;
+ case 'v':
+ vflag = 1;
+ break;
+ default:
+ usage();
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ /* If an LCD type was specified, look it up */
+ if (drivertype != NULL) {
+ driver = NULL;
+ for (i = 0; lcd_drivertab[i].l_code != NULL; i++) {
+ if (!strcmp(drivertype, lcd_drivertab[i].l_code)) {
+ driver = &lcd_drivertab[i];
+ break;
+ }
+ }
+ if (driver == NULL) {
+ warnx("LCD driver '%s' not known", drivertype);
+ usage();
+ }
+ }
+ debug(1, "Driver selected for %s", driver->l_name);
+ driver->l_prepare(devname, drvopts);
+ atexit(driver->l_finish);
+
+ if (argc > 0) {
+ debug(2, "reading input from %d argument%s", argc, (argc > 1) ? "s" : "");
+ for (i = 0; i < argc; i++)
+ for (cp = argv[i]; *cp; cp++)
+ do_char(driver, *cp);
+ } else {
+ debug(2, "reading input from stdin");
+ setvbuf(stdin, NULL, _IONBF, 0);
+ while ((ch = fgetc(stdin)) != EOF)
+ do_char(driver, (char)ch);
+ }
+ exit(EX_OK);
+}
+
+static void
+usage(void)
+{
+ int i, j;
+
+ fprintf(stderr, "usage: %s [-v] [-d drivername] [-f device] [-o options] [args...]\n", progname);
+ fprintf(stderr, " -D Increase debugging\n");
+ fprintf(stderr, " -f Specify device, default is '%s'\n", DEFAULT_DEVICE);
+ fprintf(stderr, " -d Specify driver, one of:\n");
+ for (i = 0; lcd_drivertab[i].l_code != NULL; i++) {
+ fprintf(stderr, " %-10s (%s)%s\n",
+ lcd_drivertab[i].l_code, lcd_drivertab[i].l_name, (i == 0) ? " *default*" : "");
+ if (lcd_drivertab[i].l_options[0] != NULL) {
+
+ for (j = 0; lcd_drivertab[i].l_options[j] != NULL; j++)
+ fprintf(stderr, " %s\n", lcd_drivertab[i].l_options[j]);
+ }
+ }
+ fprintf(stderr, " -o Specify driver option string\n");
+ fprintf(stderr, " args Message strings. Embedded escapes supported:\n");
+ fprintf(stderr, " \\b Backspace\n");
+ fprintf(stderr, " \\f Clear display, home cursor\n");
+ fprintf(stderr, " \\n Newline\n");
+ fprintf(stderr, " \\r Carriage return\n");
+ fprintf(stderr, " \\R Reset display\n");
+ fprintf(stderr, " \\v Home cursor\n");
+ fprintf(stderr, " \\\\ Literal \\\n");
+ fprintf(stderr, " If args not supplied, strings are read from standard input\n");
+ exit(EX_USAGE);
+}
+
+static void
+do_char(struct lcd_driver *driver, char ch)
+{
+ static int esc = 0;
+
+ if (esc) {
+ switch(ch) {
+ case 'b':
+ driver->l_command(CMD_BKSP);
+ break;
+ case 'f':
+ driver->l_command(CMD_CLR);
+ break;
+ case 'n':
+ driver->l_command(CMD_NL);
+ break;
+ case 'r':
+ driver->l_command(CMD_CR);
+ break;
+ case 'R':
+ driver->l_command(CMD_RESET);
+ break;
+ case 'v':
+ driver->l_command(CMD_HOME);
+ break;
+ case '\\':
+ driver->l_putc('\\');
+ break;
+ default:
+ driver->l_command(ch);
+ break;
+ }
+ esc = 0;
+ } else {
+ if (ch == '\\') {
+ esc = 1;
+ } else {
+ if (vflag || isprint(ch))
+ driver->l_putc(ch);
+ }
+ }
+}
+
+
+/******************************************************************************
+ * Driver for the Hitachi HD44780. This is probably *the* most common driver
+ * to be found on one- and two-line alphanumeric LCDs.
+ *
+ * This driver assumes the following connections :
+ *
+ * Parallel Port LCD Module
+ * --------------------------------
+ * Strobe (1) Enable (6)
+ * Data (2-9) Data (7-14)
+ * Select(13) RS (4)
+ * Auto Feed (14) R/W (5)
+ *
+ * In addition, power must be supplied to the module, normally with
+ * a circuit similar to this:
+ *
+ * VCC (+5V) O------o-------o--------O Module pin 2
+ * | | +
+ * / ---
+ * \ --- 1uF
+ * / | -
+ * \ <-----o--------O Module pin 3
+ * /
+ * \
+ * |
+ * GND O------o----------------O Module pin 1
+ *
+ * The ground line should also be connected to the parallel port, on
+ * one of the ground pins (eg. pin 25).
+ *
+ * Note that the pinning on some LCD modules has the odd and even pins
+ * arranged as though reversed; check carefully before conecting a module
+ * as it is possible to toast the HD44780 if the power is reversed.
+ */
+
+static int hd_fd;
+static u_int8_t hd_cbits;
+static int hd_lines = 2;
+static int hd_blink = 0;
+static int hd_cursor = 0;
+static int hd_font = 0;
+
+#define HD_COMMAND SELECTIN
+#define HD_DATA 0
+#define HD_READ 0
+#define HD_WRITE AUTOFEED
+
+#define HD_BF 0x80 /* internal busy flag */
+#define HD_ADDRMASK 0x7f /* DDRAM address mask */
+
+#define hd_sctrl(v) {u_int8_t _val; _val = hd_cbits | v; ioctl(hd_fd, PPISCTRL, &_val);}
+#define hd_sdata(v) {u_int8_t _val; _val = v; ioctl(hd_fd, PPISDATA, &_val);}
+#define hd_gdata(v) ioctl(hd_fd, PPIGDATA, &v)
+
+static void
+hd44780_output(int type, int data)
+{
+ debug(3, "%s -> 0x%02x", (type == HD_COMMAND) ? "cmd " : "data", data);
+ hd_sctrl(type | HD_WRITE | STROBE); /* set direction, address */
+ hd_sctrl(type | HD_WRITE); /* raise E */
+ hd_sdata((u_int8_t) data); /* drive data */
+ hd_sctrl(type | HD_WRITE | STROBE); /* lower E */
+}
+
+static int
+hd44780_input(int type)
+{
+ u_int8_t val;
+
+ hd_sctrl(type | HD_READ | STROBE); /* set direction, address */
+ hd_sctrl(type | HD_READ); /* raise E */
+ hd_gdata(val); /* read data */
+ hd_sctrl(type | HD_READ | STROBE); /* lower E */
+
+ debug(3, "0x%02x -> %s", val, (type == HD_COMMAND) ? "cmd " : "data");
+ return(val);
+}
+
+static void
+hd44780_prepare(char *devname, char *options)
+{
+ char *cp = options;
+
+ if ((hd_fd = open(devname, O_RDWR, 0)) == -1)
+ err(EX_OSFILE, "can't open '%s'", devname);
+
+ /* parse options */
+ while (cp && *cp) {
+ switch (*cp++) {
+ case '1':
+ hd_lines = 1;
+ break;
+ case 'B':
+ hd_blink = 1;
+ break;
+ case 'C':
+ hd_cursor = 1;
+ break;
+ case 'F':
+ hd_font = 1;
+ break;
+ default:
+ errx(EX_USAGE, "hd44780: unknown option code '%c'", *(cp-1));
+ }
+ }
+
+ /* Put LCD in idle state */
+ if (ioctl(hd_fd, PPIGCTRL, &hd_cbits)) /* save other control bits */
+ err(EX_IOERR, "ioctl PPIGCTRL failed (not a ppi device?)");
+ hd_cbits &= ~(STROBE | SELECTIN | AUTOFEED); /* set strobe, RS, R/W low */
+ debug(2, "static control bits 0x%x", hd_cbits);
+ hd_sctrl(STROBE);
+ hd_sdata(0);
+
+}
+
+static void
+hd44780_finish(void)
+{
+ close(hd_fd);
+}
+
+static void
+hd44780_command(int cmd)
+{
+ u_int8_t val;
+
+ switch (cmd) {
+ case CMD_RESET: /* full manual reset and reconfigure as per datasheet */
+ debug(1, "hd44780: reset to %d lines, %s font,%s%s cursor",
+ hd_lines, hd_font ? "5x10" : "5x7", hd_cursor ? "" : " no", hd_blink ? " blinking" : "");
+ val = 0x30;
+ if (hd_lines == 2)
+ val |= 0x08;
+ if (hd_font)
+ val |= 0x04;
+ hd44780_output(HD_COMMAND, val);
+ usleep(10000);
+ hd44780_output(HD_COMMAND, val);
+ usleep(1000);
+ hd44780_output(HD_COMMAND, val);
+ usleep(1000);
+ val = 0x08; /* display off */
+ hd44780_output(HD_COMMAND, val);
+ usleep(1000);
+ val |= 0x04; /* display on */
+ if (hd_cursor)
+ val |= 0x02;
+ if (hd_blink)
+ val |= 0x01;
+ hd44780_output(HD_COMMAND, val);
+ usleep(1000);
+ hd44780_output(HD_COMMAND, 0x06); /* shift cursor by increment */
+ usleep(1000);
+ /* FALLTHROUGH */
+
+ case CMD_CLR:
+ hd44780_output(HD_COMMAND, 0x01);
+ usleep(2000);
+ break;
+
+ case CMD_BKSP:
+ hd44780_output(HD_DATA, 0x10); /* shift cursor left one */
+ break;
+
+ case CMD_NL:
+ if (hd_lines == 2)
+ hd44780_output(HD_COMMAND, 0xc0); /* beginning of second line */
+ break;
+
+ case CMD_CR:
+ /* XXX will not work in 4-line mode, or where readback fails */
+ val = hd44780_input(HD_COMMAND) & 0x3f; /* mask character position, save line pos */
+ hd44780_output(HD_COMMAND, 0x80 | val);
+ break;
+
+ case CMD_HOME:
+ hd44780_output(HD_COMMAND, 0x02);
+ usleep(2000);
+ break;
+
+ default:
+ if (isprint(cmd)) {
+ warnx("unknown command %c", cmd);
+ } else {
+ warnx("unknown command 0x%x", cmd);
+ }
+ }
+ usleep(40);
+}
+
+static void
+hd44780_putc(int c)
+{
+ hd44780_output(HD_DATA, c);
+ usleep(40);
+}
+
diff --git a/share/examples/ppp/chap-auth b/share/examples/ppp/chap-auth
new file mode 100755
index 000000000000..1e56b07575c0
--- /dev/null
+++ b/share/examples/ppp/chap-auth
@@ -0,0 +1,97 @@
+#! /usr/local/bin/wish8.0 -f
+#
+# Copyright (c) 1999 Brian Somers <brian@Awfulhak.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 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$
+
+#
+# Display a window to request a users CHAP secret, accepting the relevant
+# values from ppp (``set authkey !thisprogram'') and passing the entered
+# ``authname'' and ``authkey'' back to ppp.
+#
+
+set pwidth 12; # Prompt field width
+set vwidth 20; # Value field width
+set fxpad 7; # Value field width
+set fypad 3; # Value field width
+
+wm title . "PPP Authentication";
+
+# We expect three lines of input from ppp
+set hostname [gets stdin];
+set challenge [gets stdin];
+set authname [gets stdin];
+
+proc mkhalfframe { n prompt } {
+ global pwidth;
+
+ frame .$n;
+ text .$n.prompt -width $pwidth -height 1 -relief flat;
+ .$n.prompt insert 1.0 $prompt;
+ pack .$n.prompt -side left;
+ .$n.prompt configure -state disabled;
+}
+
+proc mkframe { n prompt value entry } {
+ global vwidth fxpad fypad;
+
+ mkhalfframe $n $prompt;
+ text .$n.value -width $vwidth -height 1;
+ .$n.value insert 1.0 $value;
+ pack .$n.value -side right;
+ if ($entry) {
+ # Allow entry, but don't encourage it
+ .$n.value configure -state normal -takefocus 0;
+ bind .$n.value <Return> {done};
+ } else {
+ .$n.value configure -state disabled;
+ }
+ pack .$n -side top -padx $fxpad -pady $fypad;
+}
+
+# Dump our fields to stdout and exit
+proc done {} {
+ puts [.n.value get 1.0 {end - 1 char}];
+ puts [.k.value get];
+ exit 0;
+}
+
+mkframe h "Hostname:" $hostname 0;
+mkframe c "Challenge:" $challenge 0;
+mkframe n "Authname:" $authname 1;
+
+mkhalfframe k "Authkey:";
+entry .k.value -show "*" -width $vwidth;
+pack .k.value -side right;
+bind .k.value <Return> {done};
+focus .k.value;
+pack .k -side top -padx $fxpad -pady $fypad;
+
+frame .b;
+button .b.ok -default active -text "Ok" -command {done};
+pack .b.ok -side left;
+button .b.cancel -default normal -text "Cancel" -command {exit 1};
+pack .b.cancel -side right;
+pack .b -side top -padx $fxpad -pady $fypad;
diff --git a/share/examples/ppp/isdnd.rc b/share/examples/ppp/isdnd.rc
new file mode 100644
index 000000000000..0ceef6d2f836
--- /dev/null
+++ b/share/examples/ppp/isdnd.rc
@@ -0,0 +1,69 @@
+# example of a configuration file for the isdn daemon & user-ppp
+#
+# $FreeBSD$
+
+
+# SYSTEM section: isdnd global configuration parameters
+
+system
+
+# accounting
+
+acctall = on # generate info for everything
+acctfile = /var/log/isdnd.acct # name & location of accounting file
+useacctfile = yes # generate accouting info to file
+isdntime = on
+monitor-allowed = no # global switch: monitor on/off
+
+
+# User-ppp example
+
+entry
+name = userppp0
+usrdevicename = rbch
+usrdeviceunit = 0
+isdncontroller = 0
+isdnchannel = -1
+local-phone-incoming = 1234567
+remote-phone-incoming = *
+local-phone-dialout = 1234567 # This *MUST* be your local number
+remote-phone-dialout = 1234567 # ppp(8) will override this
+remdial-handling = first
+dialin-reaction = ignore
+dialout-type = normal
+b1protocol = hdlc
+idletime-incoming = 900 # Should be larger than ppp's timeout
+idletime-outgoing = 900 # Should be larger than ppp's timeout
+unitlength = 0
+unitlengthsrc = conf
+dialretries = 1
+dialrandincr = on
+recoverytime = 1 # Should be smaller than ppp's redial
+usedown = off
+downtries = 2
+downtime = 30
+
+entry
+name = userppp1
+usrdevicename = rbch
+usrdeviceunit = 1
+isdncontroller = 0
+isdnchannel = -1
+local-phone-incoming = 1234567
+remote-phone-incoming = *
+local-phone-dialout = 1234567 # This *MUST* be your local number
+remote-phone-dialout = 1234567 # ppp(8) will override this
+remdial-handling = first
+dialin-reaction = accept
+dialout-type = normal
+b1protocol = hdlc
+idletime-incoming = 900 # Should be larger than ppp's timeout
+idletime-outgoing = 900 # Should be larger than ppp's timeout
+unitlength = 0
+unitlengthsrc = conf
+dialretries = 1
+dialrandincr = on
+recoverytime = 1 # Should be smaller than ppp's redial
+usedown = off
+downtries = 2
+downtime = 30
diff --git a/share/examples/ppp/login-auth b/share/examples/ppp/login-auth
new file mode 100755
index 000000000000..e866e1d9c092
--- /dev/null
+++ b/share/examples/ppp/login-auth
@@ -0,0 +1,74 @@
+#! /usr/local/bin/wish8.0 -f
+#
+# Copyright (c) 1999 Brian Somers <brian@Awfulhak.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 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$
+
+#
+# Display a window to request a users password, expecting a login name
+# as an argument and outputting the password to stdout.
+#
+
+set pwidth 11; # Prompt field width
+set vwidth 20; # Value field width
+set fxpad 7; # Value field width
+set fypad 3; # Value field width
+
+wm title . "PPP Login";
+
+# Dump our password to stdout and exit
+proc done {} {
+ puts [.p.value get];
+ exit 0;
+}
+
+frame .l;
+text .l.prompt -width $pwidth -height 1 -relief flat;
+ .l.prompt insert 1.0 "Login:";
+pack .l.prompt -side left;
+ .l.prompt configure -state disabled;
+text .l.value -width $vwidth -height 1;
+ .l.value insert 1.0 $argv;
+pack .l.value -side right;
+ .l.value configure -state disabled;
+pack .l -side top -padx $fxpad -pady $fypad;
+
+frame .p;
+text .p.prompt -width $pwidth -height 1 -relief flat;
+ .p.prompt insert 1.0 "Password:";
+pack .p.prompt -side left;
+ .p.prompt configure -state disabled;
+entry .p.value -show "*" -width $vwidth;
+pack .p.value -side right;
+bind .p.value <Return> {done};
+focus .p.value;
+pack .p -side top -padx $fxpad -pady $fypad;
+
+frame .b;
+button .b.ok -default active -text "Ok" -takefocus 0 -command {done};
+pack .b.ok -side left;
+button .b.cancel -default normal -text "Cancel" -takefocus 0 -command {exit 1};
+pack .b.cancel -side right;
+pack .b -side top -padx $fxpad -pady $fypad;
diff --git a/share/examples/ppp/ppp.conf.isdn b/share/examples/ppp/ppp.conf.isdn
new file mode 100644
index 000000000000..16a276fb2888
--- /dev/null
+++ b/share/examples/ppp/ppp.conf.isdn
@@ -0,0 +1,98 @@
+#
+# Copyright (c) 1997 Brian Somers <brian@Awfulhak.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 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$
+
+# This is an example ppp profile for bringing up a multilink ppp connection
+# over ISDN. It needs at least version 0.83.0 of the i4b code. An example
+# isdnd configuration file is also supplied in this directory (isdnd.rc)
+#
+# NOTE: This is for use with i4b-supported ISDN cards. If you have an
+# external Terminal Adapter (TA) plugged into a serial port on your
+# machine, you should use the TA example in ppp.conf.sample.
+#
+isdn:
+ set phone 12345678 # Replace this with your ISPs phone number
+
+ set authname somename # Replace these with your login name & password.
+ set authkey somepasswd # This profile assumes you're using PAP or CHAP.
+
+ set enddisc mac # Assuming you have a LAN
+
+ enable lqr
+ set reconnect 3 5
+ set redial 3 10
+ set lqrperiod 45
+ disable pred1 deflate mppe
+ deny pred1 deflate mppe
+
+ set timeout 60 300 # The minimum charge period is 5 minutes, so don't
+ # hangup before then
+
+ # We have no chat scripts in the ISDN world (yet)
+ set dial
+ set login
+ set logout
+ set hangup
+
+ set device /dev/i4brbch0 /dev/i4brbch1 # Raw B-channel devices
+ set speed sync # ISDN is synchronous
+
+ enable dns # Ask the peer what to put in resolv.conf
+
+ # Take a wild guess at an IP number and let the other side decide
+ set ifaddr 172.16.0.1/0 212.0.0.0/0 0 0
+ add! default hisaddr
+
+ set mrru 1500 # Multilink mode please
+ set mru 1504 # Room for the MP header
+
+ clone 1,2 # Two new links
+ link deflink rm # And get rid of the original one
+
+ link * set mode auto # Automatically manage the second link
+ set autoload 10 80 30 # Down @10% usage, up at 80%, 30s sample
+
+ set server /tmp/ppp-isdn "" 0177 # The diagnostic port (-rw-------)
+
+#
+# When phone calls become free (say 0:00 Saturday morning), we may want
+# this in crontab (``crontab -l'', not /etc/crontab):
+#
+# 1 0 0 0 6 /usr/sbin/pppctl /tmp/ppp-isdn link \* set mode ddial
+#
+# and when we have to pay again (say 23:59 Sunday night), we may want
+# this:
+#
+# 54 23 0 0 0 /usr/sbin/pppctl /tmp/ppp-isdn link \* set mode auto
+#
+# And of course just in case of a weekend reboot, add
+# /usr/local/etc/rc.d/ppp.sh:
+#
+# #! /bin/sh
+# [ ."$1" != .start ] && exit 0
+# case `date +%w` in
+# 6|0) /usr/sbin/pppctl /tmp/ppp-isdn link \* set mode ddial;;
+# esac
diff --git a/share/examples/ppp/ppp.conf.sample b/share/examples/ppp/ppp.conf.sample
new file mode 100644
index 000000000000..d4f3a9ff4a8d
--- /dev/null
+++ b/share/examples/ppp/ppp.conf.sample
@@ -0,0 +1,753 @@
+#################################################################
+#
+# PPP Sample Configuration File
+#
+# Originally written by Toshiharu OHNO
+#
+# $FreeBSD$
+#
+#################################################################
+
+# This file is separated into sections. Each section is named with
+# a label starting in column 0 and followed directly by a ``:''. The
+# section continues until the next label. Blank lines and characters
+# after a ``#'' are ignored (a literal ``#'' must be escaped with a ``\''
+# or quoted with ""). All commands inside sections that do not begin
+# with ``!'' (e.g., ``!include'') *must* be indented by at least one
+# space or tab or they will not be recognized!
+#
+# Lines beginning with "!include" will ``include'' another file. You
+# may want to ``!include ~/.ppp.conf'' for backwards compatibility.
+#
+
+# Default setup. Always executed when PPP is invoked.
+# This section is *not* pre-loaded by the ``load'' or ``dial'' commands.
+#
+# This is the best place to specify your modem device, its DTR rate,
+# your dial script and any logging specification. Logging specs should
+# be done first so that the results of subsequent commands are logged.
+#
+default:
+ set log Phase Chat LCP IPCP CCP tun command
+ set device /dev/cuaa1
+ set speed 115200
+ set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" AT \
+ OK-AT-OK ATE1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
+
+# Client side PPP
+#
+# Although the PPP protocol is a peer to peer protocol, we normally
+# consider the side that initiates the connection as the client and
+# the side that receives the connection as the server. Authentication
+# is required by the server either using a unix-style login procedure
+# or by demanding PAP or CHAP authentication from the client.
+#
+
+# An on demand example where we have dynamic IP addresses and wish to
+# use a unix-style login script:
+#
+# If the peer assigns us an arbitrary IP (most ISPs do this) and we
+# can't predict what their IP will be either, take a wild guess at
+# some IPs that you can't currently route to. Ppp can change this
+# when the link comes up.
+#
+# The /0 bit in "set ifaddr" says that we insist on 0 bits of the
+# specified IP actually being correct, therefore, the other side can assign
+# any IP number.
+#
+# The fourth arg to "set ifaddr" makes us send "0.0.0.0" as our requested
+# IP number, forcing the peer to make the decision. This is necessary
+# when negotiating with some (broken) ppp implementations.
+#
+# This entry also works with static IP numbers or when not in -auto mode.
+# The ``add'' line adds a `sticky' default route that will be updated if
+# and when any of the IP numbers are changed in IPCP negotiations.
+# The "set ifaddr" is required in -auto mode only.
+# It's better to put the ``add'' line in ppp.linkup when not in -auto mode.
+#
+# Finally, the ``enable dns'' line tells ppp to ask the peer for the
+# nameserver addresses that should be used. This isn't always supported
+# by the other side, but if it is, ppp will update /etc/resolv.conf with
+# the correct nameserver values at connection time.
+#
+# The login script shown says that you're expecting ``ogin:''. If you
+# don't receive that, send a ``\n'' and expect ``ogin:'' again. When
+# it's received, send ``ppp'', expect ``word:'' then send ``ppp''.
+# You *MUST* customise this login script according to your local
+# requirements.
+#
+pmdemand:
+ set phone 1234567
+ set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: ppp word: ppp"
+ set timeout 120
+ set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
+ add default HISADDR
+ enable dns
+
+# If you want to use PAP or CHAP instead of using a unix-style login
+# procedure, do the following. Note, the peer suggests whether we
+# should send PAP or CHAP. By default, we send whatever we're asked for.
+#
+# You *MUST* customise ``MyName'' and ``MyKey'' below.
+#
+PAPorCHAPpmdemand:
+ set phone 1234567
+ set login
+ set authname MyName
+ set authkey MyKey
+ set timeout 120
+ set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
+ add default HISADDR
+ enable dns
+
+# On demand dialup example with static IP addresses:
+# Here, the local side uses 192.244.185.226 and the remote side
+# uses 192.244.176.44.
+#
+# # ppp -auto ondemand
+#
+# With static IP numbers, our setup is similar to dynamic:
+# Remember, ppp.linkup is searched for a "192.244.176.44" label, then
+# a "ondemand" label, and finally the "MYADDR" label.
+#
+ondemand:
+ set phone 1234567
+ set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: ppp word: ppp"
+ set timeout 120
+ set ifaddr 192.244.185.226 192.244.176.44
+ add default HISADDR
+ enable dns
+
+# An on-demand dialup example using an external Terminal Adapter (TA)
+# that supports multi-link ppp itself.
+#
+# This may be specific to the AETHRA TA.
+#
+TA:
+ set phone 12345678 # Replace this with your ISPs phone number
+
+ set authname somename # Replace these with your login name & password.
+ set authkey somepasswd # This profile assumes you're using PAP or CHAP.
+
+ enable lqr
+ set reconnect 3 5
+ set redial 3 10
+ set lqrperiod 45
+ disable pred1 deflate mppe
+ deny pred1 deflate mppe
+
+ set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATB41CL2048 \
+ OK-AT-OK ATB40&J3E1Q0 OK \\dATDT\\T TIMEOUT 40 CONNECT"
+ set login
+ set logout
+ set hangup
+
+ set timeout 60 300 # The minimum charge period is 5 minutes, so don't
+ # hangup before then
+
+ set device /dev/cuaa0 # Or whatever
+ set speed 115200 # Use as high a speed as possible
+
+ enable dns # Ask the peer what to put in resolv.conf
+
+ # Take a wild guess at an IP number and let the other side decide
+ set ifaddr 172.16.0.1/0 212.0.0.0/0 0 0
+ add! default hisaddr
+
+ set mru 1504 # Some extra room for the MP header
+
+ set server /tmp/ppp-TA "" 0177 # The diagnostic port (-rw-------)
+
+
+# Example segments
+#
+# The following lines may be included as part of your configuration
+# section and aren't themselves complete. They're provided as examples
+# of how to achieve different things.
+
+examples:
+# Multi-phone example. Numbers separated by a : are used sequentially.
+# Numbers separated by a | are used if the previous dial or login script
+# failed. Usually, you will prefer to use only one of | or :, but both
+# are allowed.
+#
+ set phone 12345678|12345679:12345670|12345671
+#
+# Some phone numbers may include # characters - don't forget to escape
+# (or quote) them:
+#
+ set phone "12345##678"
+#
+# Ppp can accept control instructions from the ``pppctl'' program.
+# First, you must set up your control socket. It's safest to use
+# a UNIX domain socket, and watch the permissions:
+#
+ set server /var/tmp/internet MySecretPassword 0177
+#
+# Although a TCP port may be used if you want to allow control
+# connections from other machines:
+#
+ set server 6670 MySecretpassword
+#
+# If you don't like ppp's builtin chat, use an external one:
+#
+ set login "\"!chat \\-f /etc/ppp/ppp.dev.chat\""
+#
+# If we have a ``strange'' modem that must be re-initialized when we
+# hangup:
+#
+ set hangup "\"\" AT OK-AT-OK ATZ OK"
+#
+# To adjust logging without blowing away the setting in default:
+#
+ set log -command +tcp/ip
+#
+# To see log messages on the screen in interactive mode:
+#
+ set log local LCP IPCP CCP
+#
+# If you're seeing a lot of magic number problems and failed connections,
+# try this (see the man page):
+#
+ set openmode active 5
+#
+# For noisy lines, we may want to reconnect (up to 20 times) after loss
+# of carrier, with 3 second delays between each attempt:
+#
+ set reconnect 3 20
+#
+# When playing server for M$ clients, tell them who our NetBIOS name
+# servers are:
+#
+ set nbns 10.0.0.1 10.0.0.2
+#
+# Inform the client if they ask for our DNS IP numbers:
+#
+ enable dns
+#
+# If you don't want to tell them what's in your /etc/resolv.conf file
+# with `enable dns', override the values:
+#
+ set dns 10.0.0.1 10.0.0.2
+#
+# Some people like to prioritize DNS packets:
+#
+ set urgent udp +53
+#
+# If we're using the -nat switch, redirect ftp and http to an internal
+# machine:
+#
+ nat port tcp 10.0.0.2:ftp ftp
+ nat port tcp 10.0.0.2:http http
+#
+# or don't trust the outside at all
+#
+ nat deny_incoming yes
+#
+# I trust user brian to run ppp, so this goes in the `default' section:
+#
+ allow user brian
+#
+# But label `internet' contains passwords that even brian can't have, so
+# I empty out the user access list in that section so that only root can
+# have access:
+#
+ allow users
+#
+# I also may wish to set up my ppp login script so that it asks the client
+# for the label they wish to use. I may only want user ``dodgy'' to access
+# their own label in direct mode:
+#
+dodgy:
+ allow user dodgy
+ allow mode direct
+#
+# We don't want certain packets to keep our connection alive
+#
+ set filter alive 0 deny udp src eq 520 # routed
+ set filter alive 1 deny udp dst eq 520 # routed
+ set filter alive 2 deny udp src eq 513 # rwhod
+ set filter alive 3 deny udp src eq 525 # timed
+ set filter alive 4 deny udp src eq 137 # NetBIOS name service
+ set filter alive 5 deny udp src eq 138 # NetBIOS datagram service
+ set filter alive 6 deny udp src eq 139 # NetBIOS session service
+ set filter alive 7 deny udp dst eq 137 # NetBIOS name service
+ set filter alive 8 deny udp dst eq 138 # NetBIOS datagram service
+ set filter alive 9 deny udp dst eq 139 # NetBIOS session service
+ set filter alive 10 deny 0/0 MYADDR icmp # Ping to us from outside
+ set filter alive 11 permit 0/0 0/0
+#
+# And in auto mode, we don't want certain packets to cause a dialup
+#
+ set filter dial 0 deny udp src eq 513 # rwhod
+ set filter dial 1 deny udp src eq 525 # timed
+ set filter dial 2 deny udp src eq 137 # NetBIOS name service
+ set filter dial 3 deny udp src eq 138 # NetBIOS datagram service
+ set filter dial 4 deny udp src eq 139 # NetBIOS session service
+ set filter dial 5 deny udp dst eq 137 # NetBIOS name service
+ set filter dial 6 deny udp dst eq 138 # NetBIOS datagram service
+ set filter dial 7 deny udp dst eq 139 # NetBIOS session service
+ set filter dial 8 deny tcp finrst # Badly closed TCP channels
+ set filter dial 9 permit 0 0
+#
+# Once the line's up, allow these connections
+#
+ set filter in 0 permit tcp dst eq 113 # ident
+ set filter out 0 permit tcp src eq 113 # ident
+ set filter in 1 permit tcp src eq 23 estab # telnet
+ set filter out 1 permit tcp dst eq 23 # telnet
+ set filter in 2 permit tcp src eq 21 estab # ftp
+ set filter out 2 permit tcp dst eq 21 # ftp
+ set filter in 3 permit tcp src eq 20 dst gt 1023 # ftp-data
+ set filter out 3 permit tcp dst eq 20 # ftp-data
+ set filter in 4 permit udp src eq 53 # DNS
+ set filter out 4 permit udp dst eq 53 # DNS
+ set filter in 5 permit 192.244.191.0/24 0/0 # Where I work
+ set filter out 5 permit 0/0 192.244.191.0/24 # Where I work
+ set filter in 6 permit icmp # pings
+ set filter out 6 permit icmp # pings
+ set filter in 7 permit udp dst gt 33433 # traceroute
+ set filter out 7 permit udp dst gt 33433 # traceroute
+
+#
+# ``dodgynet'' is an example intended for an autodial configuration which
+# is connecting a local network to a host on an untrusted network.
+dodgynet:
+ set log Phase # Log link uptime
+ allow mode auto # For autoconnect only
+ set device /dev/cuaa1 # Define modem device and speed
+ set speed 115200
+ deny lqr # Don't support LQR
+ set phone 0W1194 # Remote system phone number,
+ set authname pppLogin # login
+ set authkey MyPassword # and password
+ set dial "ABORT BUSY ABORT NO\\sCARRIER \ # Chat script to dial the peer
+ TIMEOUT 5 \"\" ATZ OK-ATZ-OK \
+ ATE1Q0M0 OK \\dATDT\\T \
+ TIMEOUT 40 CONNECT"
+ set login "TIMEOUT 10 \"\" \"\" \ # And to login to remote system
+ gin:--gin: \\U word: \\P"
+
+ # Drop the link after 15 minutes of inactivity
+ # Inactivity is defined by the `set filter alive' line below
+ set timeout 900
+
+ # Hard-code remote system to appear within local subnet and use proxy arp
+ # to make this system the gateway for the rest of the local network
+ set ifaddr 172.17.20.247 172.17.20.248 255.255.240.0
+ enable proxy
+
+ # Allow any TCP packet to keep the link alive
+ set filter alive 0 permit tcp
+
+ # Only allow dialup to be triggered by http, rlogin, rsh, telnet, ftp or
+ # private TCP ports 24 and 4000
+ set filter dial 0 7 0 0 tcp dst eq http
+ set filter dial 1 7 0 0 tcp dst eq login
+ set filter dial 2 7 0 0 tcp dst eq shell
+ set filter dial 3 7 0 0 tcp dst eq telnet
+ set filter dial 4 7 0 0 tcp dst eq ftp
+ set filter dial 5 7 0 0 tcp dst eq 24
+ set filter dial 6 deny ! 0 0 tcp dst eq 4000
+
+ # From hosts on a couple of local subnets to the remote peer
+ # If the remote host allowed IP forwarding and we wanted to use it, the
+ # following rules could be split into two groups to separately validate
+ # the source and destination addresses.
+ set filter dial 7 permit 172.17.16.0/20 172.17.20.248
+ set filter dial 8 permit 172.17.36.0/22 172.17.20.248
+ set filter dial 9 permit 172.17.118.0/26 172.17.20.248
+ set filter dial 10 permit 10.123.5.0/24 172.17.20.248
+
+ # Once the link's up, limit outgoing access to the specified hosts
+ set filter out 0 4 172.17.16.0/20 172.17.20.248
+ set filter out 1 4 172.17.36.0/22 172.17.20.248
+ set filter out 2 4 172.17.118.0/26 172.17.20.248
+ set filter out 3 deny ! 10.123.5.0/24 172.17.20.248
+
+ # Allow established TCP connections
+ set filter out 4 permit 0 0 tcp estab
+
+ # And new connections to http, rlogin, rsh, telnet, ftp and ports
+ # 24 and 4000
+ set filter out 5 permit 0 0 tcp dst eq http
+ set filter out 6 permit 0 0 tcp dst eq login
+ set filter out 7 permit 0 0 tcp dst eq shell
+ set filter out 8 permit 0 0 tcp dst eq telnet
+ set filter out 9 permit 0 0 tcp dst eq ftp
+ set filter out 10 permit 0 0 tcp dst eq 24
+ set filter out 11 permit 0 0 tcp dst eq 4000
+
+ # And outgoing icmp
+ set filter out 12 permit 0 0 icmp
+
+ # Once the link's up, limit incoming access to the specified hosts
+ set filter in 0 4 172.17.20.248 172.17.16.0/20
+ set filter in 1 4 172.17.20.248 172.17.36.0/22
+ set filter in 2 4 172.17.20.248 172.17.118.0/26
+ set filter in 3 deny ! 172.17.20.248 10.123.5.0/24
+
+ # Established TCP connections and non-PASV FTP
+ set filter in 4 permit 0/0 0/0 tcp estab
+ set filter in 5 permit 0/0 0/0 tcp src eq 20
+
+ # Useful ICMP messages
+ set filter in 6 permit 0/0 0/0 icmp src eq 3
+ set filter in 7 permit 0/0 0/0 icmp src eq 4
+ set filter in 8 permit 0/0 0/0 icmp src eq 11
+ set filter in 9 permit 0/0 0/0 icmp src eq 12
+
+ # Echo reply (local systems can ping the remote host)
+ set filter in 10 permit 0/0 0/0 icmp src eq 0
+
+ # And the remote host can ping the local gateway (only)
+ set filter in 11 permit 0/0 172.17.20.247 icmp src eq 8
+
+
+# Server side PPP
+#
+# If you want the remote system to authenticate itself, you must insist
+# that the peer uses CHAP or PAP with the "enable" keyword. Both CHAP and
+# PAP are disabled by default. You may enable either or both. If both
+# are enabled, CHAP is requested first. If the client doesn't agree, PAP
+# will then be requested.
+#
+# Note: If you use the getty/login process to authenticate users, you
+# don't need to enable CHAP or PAP, but the user that has logged
+# in *MUST* be a member of the ``network'' group (in /etc/group).
+#
+# Note: Chap80 and chap81 are Microsoft variations of standard chap (05).
+#
+# If you wish to allow any user in the passwd database ppp access, you
+# can ``enable passwdauth'', but this will only work with PAP.
+#
+# When the peer authenticates itself, we use ppp.secret for verification
+# (although refer to the ``set radius'' command below for an alternative).
+#
+# Note: We may supply a third field in ppp.secret specifying the IP
+# address for that user, a fourth field to specify the
+# ppp.link{up,down} label to use and a fifth field to specify
+# callback characteristics.
+#
+# The easiest way to allow transparent LAN access to your dialin users
+# is to assign them a number from your local LAN and tell ppp to make a
+# ``proxy'' arp entry for them. In this example, we have a local LAN
+# with IP numbers 10.0.0.1 - 10.0.0.99, and we assign numbers to our
+# ppp clients between 10.0.0.100 and 10.0.0.199. It is possible to
+# override the dynamic IP number with a static IP number specified in
+# ppp.secret.
+#
+# Ppp is launched with:
+# # ppp -direct server
+#
+server:
+ enable chap chap80 chap81 pap passwdauth
+ enable proxy
+ set ifaddr 10.0.0.1 10.0.0.100-10.0.0.199
+ accept dns
+
+# Example of a RADIUS configuration:
+# If there are one or more radius servers available, we can use them
+# instead of the ppp.secret file. Simply put then in a radius
+# configuration file (usually /etc/radius.conf) and give ppp the
+# file name.
+# Ppp will use the FRAMED characteristics supplied by the radius server
+# to configure the link.
+
+radius-server:
+ load server # load in the server config from above
+ set radius /etc/radius.conf
+
+
+# Example to connect using a null-modem cable:
+# The important thing here is to allow the lqr packets on both sides.
+# Without them enabled, we can't tell if the line's dropped - there
+# should always be carrier on a direct connection.
+# Here, the server sends lqr's every 10 seconds and quits if five in a
+# row fail.
+#
+# Make sure you don't have "deny lqr" in your default: on the client !
+# If the peer denies LQR, we still send ECHO LQR packets at the given
+# lqrperiod interval (ppp-style-pings).
+#
+direct-client:
+ set dial
+ set device /dev/cuaa0
+ set sp 115200
+ set timeout 900
+ set lqrperiod 10
+ set log Phase Chat LQM
+ set login "ABORT NO\\sCARRIER TIMEOUT 5 ogin:--ogin: ppp word: ppp HELLO"
+ set ifaddr 10.0.4.2 10.0.4.1
+ enable lqr
+ accept lqr
+
+direct-server:
+ set timeout 0
+ set lqrperiod 10
+ set log Phase LQM
+ set ifaddr 10.0.4.1 10.0.4.2
+ enable lqr
+ accept lqr
+
+
+# Example to connect via compuserve
+# Compuserve insists on 7 bits even parity during the chat phase. Modem
+# parity is always reset to ``none'' after the link has been established.
+#
+compuserve:
+ set phone 1234567
+ set parity even
+ set login "TIMEOUT 100 \"\" \"\" Name: CIS ID: 999999,9999/go:pppconnect \
+ word: XXXXXXXX PPP"
+ set timeout 300
+ set ifaddr 10.0.0.1/0 10.0.0.2/0 255.255.255.0 0.0.0.0
+ delete ALL
+ add default HISADDR
+
+
+# Example for PPP over TCP.
+# We assume that inetd on tcpsrv.mynet has been
+# configured to run "ppp -direct tcp-server" when it gets a connection on
+# port 1234 with an entry something like this in /etc/inetd.conf.:
+#
+# ppp stream tcp nowait root /usr/sbin/ppp ppp -direct tcp-server
+#
+# with this in /etc/services:
+#
+# ppp 6671/tcp
+#
+# Read the man page for further details.
+#
+# Note, we assume we're using a binary-clean connection. If something
+# such as `rlogin' is involved, you may need to ``set escape 0xff''
+#
+tcp-client:
+ set device tcpsrv.mynet:1234
+ set dial
+ set login
+ set ifaddr 10.0.5.1 10.0.4.1 255.255.255.0
+
+tcp-server:
+ set ifaddr 10.0.4.1 10.0.5.1 255.255.255.0
+
+
+# Using UDP is also possible with this in /etc/inetd.conf:
+#
+# ppp dgram udp wait root /usr/sbin/ppp ppp -direct udp-server
+#
+# and this in /etc/services:
+#
+# ppp 6671/tcp
+#
+udp-client:
+ set device udpsrv.mynet:1234/udp
+ set dial
+ set login
+ set ifaddr 10.0.5.1 10.0.4.1 255.255.255.0
+
+udp-server:
+ set ifaddr 10.0.4.1 10.0.5.1 255.255.255.0
+
+
+# Example for PPP testing.
+# If you want to test ppp, do it through the loopback interface:
+#
+# Requires a line in /etc/services:
+# ppploop 6671/tcp # loopback ppp daemon
+#
+# and a line in /etc/inetd.conf:
+# ppploop stream tcp nowait root /usr/sbin/ppp ppp -direct loop-in
+#
+loop:
+ set timeout 0
+ set log phase chat connect lcp ipcp command
+ set device localhost:ppploop
+ set dial
+ set login
+ set ifaddr 127.0.0.2 127.0.0.3
+ set server /var/tmp/loop "" 0177
+
+loop-in:
+ set timeout 0
+ set log phase lcp ipcp command
+ allow mode direct
+
+# Example of a VPN.
+# If you're going to create a tunnel through a public network, your VPN
+# should be set up something like this:
+#
+# You should already have set up ssh using ssh-agent & ssh-add.
+#
+sloop:
+ load loop
+ # Passive mode allows ssh plenty of time to establish the connection
+ set openmode passive
+ set device "!ssh whatevermachine /usr/sbin/ppp -direct loop-in"
+
+
+# or a better VPN solution (which doesn't run IP over a reliable
+# protocol like tcp) may be:
+#
+vpn-client:
+ set device udpsrv.mynet:1234/udp # PPP over UDP
+ set dial
+ set login
+ set ifaddr 10.0.5.1 10.0.4.1 255.255.255.0
+ disable deflate pred1
+ deny deflate pred1
+ enable MPPE # With encryption
+ accept MPPE
+
+vpn-server:
+ set ifaddr 10.0.4.1 10.0.5.1 255.255.255.0
+ disable deflate pred1
+ deny deflate pred1
+ enable MPPE
+ accept MPPE
+ enable chap81 # Required for MPPE
+
+# Example of non-PPP callback.
+# If you wish to connect to a server that will dial back *without* using
+# the ppp callback facility (rfc1570), take advantage of the fact that
+# ppp doesn't look for carrier 'till `set login' is complete:
+#
+# Here, we expect the server to say DIALBACK then disconnect after
+# we've authenticated ourselves. When this has happened, we wait
+# 60 seconds for a RING.
+#
+# Note, it's important that we tell ppp not to expect carrier, otherwise
+# we'll drop out at the ``NO CARRIER'' stage.
+#
+dialback:
+ set dial "ABORT BUSY ABORT NO\\sCARRIER TIMEOUT 5 \"\" ATZ OK-ATZ-OK \
+ ATDT\\T TIMEOUT 60 CONNECT"
+ set cd off
+ set login "TIMEOUT 5 ogin:--ogin: ppp word: ppp TIMEOUT 15 DIALBACK \
+ \"\" NO\\sCARRIER \"\" TIMEOUT 60 RING ATA CONNECT"
+
+# Example of PPP callback.
+# Alternatively, if the peer is using the PPP callback protocol, we're
+# happy either with ``auth'' style callback where the server dials us
+# back based on what we authenticate ourselves with, ``cbcp'' style
+# callback (invented by Microsoft but not agreed by the IETF) where
+# we negotiate callback *after* authentication or E.164 callback where
+# we specify only a phone number. I would recommend only ``auth'' and/or
+# ``cbcp'' callback methods.
+# For ``cbcp'', we insist that we choose ``1234567'' as the number that
+# the server must call back.
+#
+callback:
+ load pmdemand # load in the pmdemand config
+ set callback auth cbcp e.164 1234567
+ set cbcp 1234567
+
+# If we're running a ppp server that wants to only call back microsoft
+# clients on numbers configured in /etc/ppp/ppp.secret (the 5th field):
+#
+callback-server:
+ load server
+ set callback cbcp
+ set cbcp
+ set log +cbcp
+ set redial 3 1
+ set device /dev/cuaa0
+ set speed 115200
+ set dial "TIMEOUT 10 \"\" AT OK-AT-OK ATDT\\T CONNECT"
+
+# Or if we want to allow authenticated clients to specify their own
+# callback number:
+#
+callback-server-client-decides:
+ load callback-server
+ set cbcp *
+
+# Multilink mode is available (rfc1990).
+# To enable multi-link capabilities, you must specify a MRRU. 1500 is
+# a reasonable value. To create new links, use the ``clone'' command
+# to duplicate an existing link. If you already have more than one
+# link, you must specify which link you wish to run the command on via
+# the ``link'' command.
+#
+# It's worth increasing your MTU and MRU slightly in multi-link mode to
+# prevent full packets from being fragmented.
+#
+# See ppp.conf.isdn for an example of how to do multi-link isdn.
+#
+# You can now ``dial'' specific links, or even dial all links at the
+# same time. The `dial' command may also be prefixed with a specific
+# link that should do the dialing.
+#
+mloop:
+ load loop
+ set device /dev/cuaa0 /dev/cuaa1 /dev/cuaa2 # Use any of these devices
+ set mode interactive
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+ clone 1 2 3
+ link deflink remove
+ # dial
+ # link 2 dial
+ # link 3 dial
+
+mloop-in:
+ set timeout 0 # No idle timer
+ set log tun phase
+ allow mode direct
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+
+# User supplied authentication:
+# It's possible to run ppp in the background while specifying a
+# program to use to obtain authentication details on demand.
+# This program would usually be a simple GUI that presents a
+# prompt to a known user. The ``chap-auth'' program is supplied
+# as an example (and requires tcl version 8.0).
+#
+CHAPprompt:
+ load PAPorCHAPpmdemand
+ set authkey !/usr/share/examples/ppp/chap-auth
+
+# It's possible to do the same sort of thing at the login prompt.
+# Here, after sending ``brian'' in response to the ``name'' prompt,
+# we're prompted with ``code:''. A window is then displayed on the
+# ``keep:0.0'' display and the typed response is sent to the peer
+# as the password. We then expect to see ``MTU'' and ``.'' in the
+# servers response.
+#
+loginprompt:
+ load pmdemand
+ set authname brian
+ set login "ABORT NO\\sCARRIER TIMEOUT 15 \"\" \"\" name:--name: \\U \
+ code: \"!/usr/share/examples/ppp/login-auth -display keep:0.0 \
+ AUTHNAME\" MTU \\c ."
+
+# ppp supports ppp over ethernet (PPPoE). Beware, many PPP servers cache
+# the MAC address that connects to them, making it impossible to switch
+# your PPPoE connection between machines.
+#
+# The current implementation requires Netgraph, so it doesn't work with
+# OpenBSD or NetBSD.
+#
+# The client should be something like this:
+#
+pppoe:
+ set device PPPoE:de0:pppoe-in
+ enable lqr
+ set cd 5
+ set dial
+ set login
+ set redial 0 0
+
+# And the server should be running
+#
+# /usr/libexec/pppoed -p pppoe-in fxp0
+#
+# See rc.conf(5)
+#
+pppoe-in:
+ allow mode direct # Only for use on server-side
+ enable lqr proxy # Enable LQR and proxy-arp
+ enable chap pap passwdauth # Force client authentication
+ set ifaddr 10.0.0.1 10.0.0.100-10.0.0.199 # Hand out up to 100 IP numbers
+ accept dns # Allow DNS negotiation
diff --git a/share/examples/ppp/ppp.conf.span-isp b/share/examples/ppp/ppp.conf.span-isp
new file mode 100644
index 000000000000..b2b67414bade
--- /dev/null
+++ b/share/examples/ppp/ppp.conf.span-isp
@@ -0,0 +1,194 @@
+# $FreeBSD$
+
+# This advanced ppp configuration file explains how to implement
+# the following:
+#
+# ------------- ------------- -------------
+# | host1 | | host2 | | host3 |
+# ------------- ------------- -------------
+# | | |
+# |---------------------- LAN ----------------------|
+# |
+# -------------
+# | Gateway |
+# -------------
+# |
+# -----------------------------------
+# | | | |
+# isp1 isp2 isp3 ispN
+# | | | |
+# -----------------------------------
+# |
+# ------------
+# | Receiver |
+# ------------
+# |
+# Internet
+#
+# The connection is implemented so that any ISP connection can go down
+# without loss of connectivity between the LAN and the Internet. It is
+# of course also possible to shut down any link manually.
+#
+# There is a working example in ppp.*.span-isp.working that can be tested
+# on a single machine !
+#
+#
+# Prerequisites:
+#
+# o The Receiver machine must be in the outside world and must be willing
+# to accept a multilink ppp connection over UDP, assigning a routable IP
+# number to the Gateway machine. This probably means that it must be
+# a *BSD box as I know of no other ppp implementations that can use UDP
+# as a transport.
+#
+# o The Receiver machine must be multi-homed with at least N+1 addresses
+# where N is the maximun number of ISPs that you wish to use
+# simultaneously. We assume the IP numbers to be RIP1, RIP2 ... RIPN.
+# REAL-LOCAL-IP is the real IP number of the Receiver machine (and must
+# not be the same as any of the RIP* numbers).
+#
+# o Both the Gateway and the Receiver machines must have several tun
+# interfaces configured into the kernel (see below).
+#
+# o Both the Gateway and the Receiver machines must have the following
+# entry in /etc/services:
+#
+# ppp 6671/udp
+#
+# The port number isn't important, but it must be consistent across
+# machines.
+#
+# o The Receiver machine must have the following entry in
+# /etc/inetd.conf:
+#
+# ppp dgram udp wait root /usr/sbin/ppp ppp -direct vpn-in
+#
+# Note: Because inetd ``wait''s for ppp to finish, a single ppp
+# invocation receives all incoming packets. This creates
+# havoc with LQR magic number checks, so LQR *must not* be
+# enabled.
+# Also, -direct invocations of ppp do sendto()s using the
+# address that was last recvfrom()d. This means that the
+# returning traffic is a bit unbalanced. Perhaps ppp should
+# be smart enough to automatically clone an existing link
+# when it detects a new incoming address.... tricky !
+#
+# If you use ppp to connect to your ISPs, the isp* profiles shold be used,
+# resulting in the vpn* profiles being called from ppp.linkup.span-isp.
+# These invocations will bond together into a MP ppp invocation.
+#
+# If the link to your ISP is via another type of interface (cable modem
+# etc), simply configure the interface with a netmask of 0xffffffff and
+# add a route to RIPN via the interface address (no default). You can
+# then start ppp using the vpn-nic label.
+#
+# The Receiver machine should have N tun interfaces (where N is the maximum
+# number of ISPs that you wish to use simultaneously). The Gateway machine
+# requires N interfaces plus an additional N interfaces (total 2 * N) if
+# you're using ppp to talk to the ISPs.
+
+# Using ppp to connect to your ISPs (PPP over UDP over PPP):
+#
+# When we connect to our ISPs using ppp, we start the MP ppp invocation
+# from ppp.linkup (see ppp.linkup.span-isp) for each link. We also remove
+# the link from ppp.linkdown (see ppp.linkdown.span-isp). This is necessary
+# because relying on our LQR strategy (dropping the link after 5 missing
+# replies) is just too slow to be practical in this environment.
+#
+# This works because the MP invocations are smart enough to recognise that
+# another process is already running and to pass the link over to that
+# running version.
+#
+# Only the ISP links should be started manually. When they come up, they'll
+# start the MP invocation.
+
+default:
+ set speed 115200
+ set device /dev/cuaa0 /dev/cuaa1 /dev/cuaa2 /dev/cuaa3
+ set dial "ABORT BUSY ABORT NO\\sCARRIER ABORT NO\\sDIAL\\sTONE TIMEOUT 4 \
+ \"\" ATZ OK-ATZ-OK ATDT\\T TIMEOUT 60 CONNECT \\c \\n"
+ set login
+ set redial 3 5
+ set timeout 0
+ enable lqr
+ set lqrperiod 15
+
+isp1:
+ set phone "1234567"
+ set authname isp1name
+ set authkey isp1key
+ add! RIP1/32 HISADDR
+
+isp2:
+ set phone "2345678"
+ set authname isp2name
+ set authkey isp2key
+ add! RIP2/32 HISADDR
+
+ispN:
+ set phone "3456789"
+ set authname ispNname
+ set authkey ispNkey
+ add! RIPN/32 HISADDR
+
+
+# Our MP version of ppp. vpn is a generic label used by each of the
+# other vpn invocations by envoking ppp with both labels (see
+# ppp.linkup.span-isp).
+# Each ``set device'' command tells ppp to use UDP packets destined for
+# the given IP/port as the link (transport). The routing table will
+# ensure that these UDP packets use the correct ISP connection.
+
+vpn:
+ set enddisc LABEL
+ set speed sync
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+ nat enable yes
+ set authname vpnname
+ set authkey vpnkey
+ add! default HISADDR
+ disable deflate pred1 lqr
+ deny deflate pred1
+
+vpn1:
+ rename 1
+ set device RIP1:ppp/udp
+
+vpn2:
+ rename 2
+ set device RIP2:ppp/udp
+
+vpnN:
+ rename N
+ set device RIPN:ppp/udp
+
+vpn-nic:
+ load vpn
+ clone 1 2 N
+ link deflink rm
+ link 1 set device RIP1:ppp/udp
+ link 2 set device RIP2:ppp/udp
+ link N set device RIPN:ppp/udp
+
+# The Receiver profile is a bit more straight forward, as it doesn't need
+# to get bogged down with sublinks. Replace REAL-ASSIGNED-IP with the
+# IP number to be assigned to the Gateway machine. Replace REAL-LOCAL-IP
+# with the real IP number of the Receiver machine.
+#
+# No other entries are required on the Receiver machine, and this entry
+# is not required on the Gateway machine. The Receiver machine also
+# requires the contents of ppp.secret.span-isp.
+#
+# Of course it's simple to assign an IP block to the client with a simple
+# ``add'' command, and then have the client use those IP numbers on its
+# LAN rather than using ``nat enable yes''.
+
+vpn-in:
+ set enddisc label
+ set speed sync
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+ enable chap
+ disable lqr
+ set ifaddr REAL-LOCAL-IP REAL-ASSIGNED-IP
diff --git a/share/examples/ppp/ppp.conf.span-isp.working b/share/examples/ppp/ppp.conf.span-isp.working
new file mode 100644
index 000000000000..13fd31b7d0ed
--- /dev/null
+++ b/share/examples/ppp/ppp.conf.span-isp.working
@@ -0,0 +1,107 @@
+# $FreeBSD$
+
+# This is a working example of ppp.conf.span-isp that uses ppp connections
+# to the same machine through 3 null-modem serial cables.
+#
+# cuaD03 <-> cuaD04
+# cuaD01 <-> cuaD06
+# cuaD00 <-> cuaD07
+#
+# with gettys running on cuaD04, cuaD06 and cuaD07. The gettytab entry
+# for these devices has a pp= capability that references a script that
+# says:
+#
+# #! /bin/sh
+# tty=$(tty)
+# exec /usr/sbin/pppin -direct isp-in-${tty#${tty%?}}
+#
+# The whole thing is brought up with these commands:
+#
+# ppp -b isp1
+# ppp -b isp2
+# ppp -b isp3
+#
+# Something rather strange happens here.
+# If you connect to the vpn-in diagnostic socket with ``pppctl
+# /var/tmp/vpn-in'' and do a ``show links'', only a single link shows up.
+# If you connect to the vpn diagnostic socket (which is created in
+# ppp.linkup.span-isp.working, you see three links. This is because inetd
+# is told to ``wait'' for ppp to finish and the receiving ppp gets to
+# handle all incoming packets on the first descriptor.
+#
+# This is why enabling LQR won't work - VPN-IN has magic number problems,
+# fails to reply to LQRs and the VPN invocations end up shutting down.
+#
+# If anyone can come up with a better way of doing PPP over UDP I'd be
+# interrested to hear it. Currently, the server doesn't connect() or
+# bind().... but the client connect()s. Is there any other way ?
+#
+# Answers on a postcard please ! (to brian@Awfulhak.org)
+#
+
+default:
+ set speed 115200
+ set device /dev/cuaD00 /dev/cuaD01 /dev/cuaD03
+ set dial
+ set login
+ set redial 3 5
+ set timeout 0
+ enable lqr
+ set lqrperiod 15
+
+isp1:
+ set authname isp1name
+ set authkey isp1key
+
+isp2:
+ set authname isp2name
+ set authkey isp2key
+
+isp3:
+ set authname isp3name
+ set authkey isp3key
+
+
+vpn:
+ set enddisc LABEL
+ set speed sync
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+ set authname vpnname
+ set authkey vpnkey
+ add! default HISADDR
+ disable deflate pred1 lqr
+ deny deflate pred1
+
+vpn1:
+ rename 1
+ set device 127.0.2.7:ppp/udp
+
+vpn2:
+ rename 2
+ set device 127.0.2.6:ppp/udp
+
+vpn3:
+ rename 3
+ set device 127.0.2.4:ppp/udp
+
+
+vpn-in:
+ set enddisc label
+ set speed sync
+ set mrru 1500
+ set mru 1504 # Room for the MP header
+ enable chap
+ disable lqr
+ set ifaddr 127.0.0.2 127.0.0.3
+ set server /var/tmp/vpn-in "" 0177
+
+
+isp-in-7:
+ set ifaddr 127.0.2.7 127.0.3.7
+
+isp-in-6:
+ set ifaddr 127.0.2.6 127.0.3.6
+
+isp-in-4:
+ set ifaddr 127.0.2.4 127.0.3.4
diff --git a/share/examples/ppp/ppp.linkdown.sample b/share/examples/ppp/ppp.linkdown.sample
new file mode 100644
index 000000000000..c7da79ead8eb
--- /dev/null
+++ b/share/examples/ppp/ppp.linkdown.sample
@@ -0,0 +1,34 @@
+#########################################################################
+#
+# Example of ppp.linkdown file
+#
+# This file is checked when ppp closes a connection.
+# ppp searches the labels in this file as follows:
+#
+# 1) The label that matches the IP number assigned to our side.
+#
+# 2) The label specified on the command line to ppp.
+#
+# 3) If no label has been found, use MYADDR if it exists.
+#
+#
+# $FreeBSD$
+#
+#########################################################################
+
+# We don't really need to do much here. If we have notified a DNS
+# of our temporary IP number, we may want to ``un-notify'' them.
+#
+# If you're into sound effects when the link goes down, you can run
+# ``auplay'' (assuming NAS is installed and configured).
+#
+MYADDR:
+ !bg /usr/X11R6/bin/auplay /etc/ppp/linkdown.au
+
+# If you're running ``ppp -auto -nat dynamic-nat-auto'', and are
+# assigned a dynamic IP number by the peer, this may be worth while
+# to keep the interface aliases to a minimum (see ``enable iface-alias''
+# in the man page):
+#
+dynamic-nat-auto:
+ iface clear
diff --git a/share/examples/ppp/ppp.linkdown.span-isp b/share/examples/ppp/ppp.linkdown.span-isp
new file mode 100644
index 000000000000..ae00b57cdd3c
--- /dev/null
+++ b/share/examples/ppp/ppp.linkdown.span-isp
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+# Refer to ppp.conf.span-isp for a description of what this file is for.
+# This file is only required on the Gateway machine.
+
+# The ISP links start our MP version of ppp as they come up
+isp1:
+ !bg pppctl /var/tmp/vpn link 1 close
+
+isp2:
+ !bg pppctl /var/tmp/vpn link 2 close
+
+ispN:
+ !bg pppctl /var/tmp/vpn link N close
+
+vpn:
+ set server none
diff --git a/share/examples/ppp/ppp.linkdown.span-isp.working b/share/examples/ppp/ppp.linkdown.span-isp.working
new file mode 100644
index 000000000000..104e8c3b5b69
--- /dev/null
+++ b/share/examples/ppp/ppp.linkdown.span-isp.working
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+# This is a working example of ppp.linkdown.span-isp that uses ppp connections
+# to the same machine through 3 null-modem serial cables.
+
+# The ISP links start our MP version of ppp as they come up
+isp1:
+ !bg pppctl /var/tmp/vpn link 1 close
+
+isp2:
+ !bg pppctl /var/tmp/vpn link 2 close
+
+isp3:
+ !bg pppctl /var/tmp/vpn link 3 close
+
+vpn:
+ set server none
diff --git a/share/examples/ppp/ppp.linkup.sample b/share/examples/ppp/ppp.linkup.sample
new file mode 100644
index 000000000000..18073cf712e7
--- /dev/null
+++ b/share/examples/ppp/ppp.linkup.sample
@@ -0,0 +1,49 @@
+#########################################################################
+#
+# Example of ppp.linkup file
+#
+# This file is checked when ppp establishes a connection.
+# ppp searches the labels in this file as follows:
+#
+# 1) The label that matches the IP number assigned to our side.
+#
+# 2) The label specified on the command line to ppp.
+#
+# 3) If no label has been found, use MYADDR if it exists.
+#
+#
+# $FreeBSD$
+#
+#########################################################################
+
+# It is no longer necessary to re-add the default route here as our
+# ppp.conf route is `sticky' (see the man page).
+# If you're into sound effects when the link comes up, you can run
+# ``auplay'' (assuming NAS is installed and configured).
+#
+MYADDR:
+ !bg /usr/X11R6/bin/auplay /etc/ppp/linkup.au
+
+# If we've got 192.244.176.32 as our address, then regard peer as a gateway
+# to 192.244.176.0 network. This may also be done in ppp.conf instead.
+#
+192.244.176.32:
+ add 192.244.176.0 0 HISADDR
+
+#You may want to execute a script after connecting. This script can do
+# nice things such as kick off "sendmail -q", "popclient my.isp" and
+# "slurp -d news". It can be passed MYADDR, HISADDR and INTERFACE
+# as arguments too - useful for informing a DNS of your assigned IP.
+#
+# You may also want some sound effects....
+#
+pmdemand:
+ !bg /etc/ppp/ppp.etherup.pmdemand
+ ! sh -c "cat /etc/ppp/linkup.au >/dev/audio"
+
+# If your minimum call charge is 5 minutes, you may as well stay on
+# the line for that amount of time. If we want a 60 second subsequent
+# timeout, set your timeout to 300 in ppp.conf and then do this:
+#
+min5minutes:
+ !bg sh -c "sleep 240; pppctl -p mypassword 3000 set timeout 60"
diff --git a/share/examples/ppp/ppp.linkup.span-isp b/share/examples/ppp/ppp.linkup.span-isp
new file mode 100644
index 000000000000..1d0cc9b68143
--- /dev/null
+++ b/share/examples/ppp/ppp.linkup.span-isp
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+# Refer to ppp.conf.span-isp for a description of what this file is for.
+# This file is only required on the Gateway machine.
+
+# The ISP links start our MP version of ppp as they come up
+isp1:
+ !bg ppp -background vpn1 vpn
+
+isp2:
+ !bg ppp -background vpn2 vpn
+
+ispN:
+ !bg ppp -background vpnN vpn
+
+vpn:
+ set server /var/tmp/vpn "" 0177
diff --git a/share/examples/ppp/ppp.linkup.span-isp.working b/share/examples/ppp/ppp.linkup.span-isp.working
new file mode 100644
index 000000000000..9e7e5eb5bf66
--- /dev/null
+++ b/share/examples/ppp/ppp.linkup.span-isp.working
@@ -0,0 +1,17 @@
+# $FreeBSD$
+
+# This is a working example of ppp.linkup.span-isp that uses ppp connections
+# to the same machine through 3 null-modem serial cables.
+
+# The ISP links start our MP version of ppp as they come up
+isp1:
+ !bg ppp -background vpn1 vpn
+
+isp2:
+ !bg ppp -background vpn2 vpn
+
+isp3:
+ !bg ppp -background vpn3 vpn
+
+vpn:
+ set server /var/tmp/vpn "" 0177
diff --git a/share/examples/ppp/ppp.secret.sample b/share/examples/ppp/ppp.secret.sample
new file mode 100644
index 000000000000..57d2375fb6b0
--- /dev/null
+++ b/share/examples/ppp/ppp.secret.sample
@@ -0,0 +1,41 @@
+##################################################
+#
+# Example of ppp.secret file
+#
+# This file is used to authenticate incoming connections.
+# You must ``enable'' either PAP or CHAP in your ppp.conf file.
+# The peer may then use any of the Authname/Authkey pairs listed.
+# Additionally, if ``passwdauth'' is enabled and an entry isn't
+# found in this file, the passwd(5) database is used.
+#
+# If the password is specified as "*", look it up in passwd(5).
+# This doesn't work for CHAP connections as ppp must have access
+# to the unencrypted password for CHAP.
+#
+# If an IP address or address range is given as the third field, it
+# will be assigned to the peer. A ``*'' or an empty field may be
+# used as a placeholder if you do not wish to override the IP
+# address, but wish to specify further fields.
+#
+# If a label is given as the forth field, it is used when reading
+# the ppp.linkup and ppp.linkdown files. A ``*'' or an empty field
+# can be used as a placeholder if you do not wish to override the
+# label, but wish to specify further fields.
+#
+# If a phone number or list of phone numbers is given as the fifth
+# field, these numbers will be used to call back the client if
+# ``auth'' or ``cbcp'' callback is enabled (see ``set callback'').
+# A ``*'' specifies that the client must specify the number.
+#
+# $FreeBSD$
+#
+##################################################
+
+# Authname Authkey Peer's IP address Label Callback
+
+oscar OurSecretKey 192.2.18.34
+BigBird X4dWg9327 192.2.18.33/32
+fred * * fred
+subnet * 192.2.18.35-192.2.18.70 subnet
+admin * * * *
+homeworker * * * 1234567
diff --git a/share/examples/ppp/ppp.secret.span-isp b/share/examples/ppp/ppp.secret.span-isp
new file mode 100644
index 000000000000..8370f379717e
--- /dev/null
+++ b/share/examples/ppp/ppp.secret.span-isp
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+# Refer to ppp.conf.span-isp for a description of what this file is for.
+# This file is only required on the Receiver machine.
+
+vpnname vpnkey
diff --git a/share/examples/ppp/ppp.secret.span-isp.working b/share/examples/ppp/ppp.secret.span-isp.working
new file mode 100644
index 000000000000..cc8bc3d63dbe
--- /dev/null
+++ b/share/examples/ppp/ppp.secret.span-isp.working
@@ -0,0 +1,9 @@
+# $FreeBSD$
+
+# This is a working example of ppp.secret.span-isp that uses ppp connections
+# to the same machine through 3 null-modem serial cables.
+
+isp1name isp1key
+isp2name isp2key
+isp3name isp3key
+vpnname vpnkey
diff --git a/share/examples/printing/README b/share/examples/printing/README
new file mode 100644
index 000000000000..f83eaa9c236a
--- /dev/null
+++ b/share/examples/printing/README
@@ -0,0 +1,7 @@
+# $FreeBSD$
+#
+# The files in this directory are generated automatically
+# from doc/handbook/printing.sgml, do not edit it here!
+#
+# Please change doc/handbook/printing.sgml or maybe
+# src/tools/tools/epfe/epfe.pl instead.
diff --git a/share/examples/printing/diablo-if-net b/share/examples/printing/diablo-if-net
new file mode 100644
index 000000000000..b2ba028f2343
--- /dev/null
+++ b/share/examples/printing/diablo-if-net
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# diablo-if-net - Text filter for Diablo printer `scrivener' listening
+# on port 5100. Installed in /usr/local/libexec/diablo-if-net
+#
+
+exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100
diff --git a/share/examples/printing/hpdf b/share/examples/printing/hpdf
new file mode 100644
index 000000000000..d03c3ac70dfd
--- /dev/null
+++ b/share/examples/printing/hpdf
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# hpdf - Print DVI data on HP/PCL printer
+# Installed in /usr/local/libexec/hpdf
+
+PATH=/usr/local/bin:$PATH; export PATH
+
+#
+# Define a function to clean up our temporary files. These exist
+# in the current directory, which will be the spooling directory
+# for the printer.
+#
+cleanup() {
+ rm -f hpdf$$.dvi
+}
+
+#
+# Define a function to handle fatal errors: print the given message
+# and exit 2. Exiting with 2 tells LPD to do not try to reprint the
+# job.
+#
+fatal() {
+ echo "$@" 1>&2
+ cleanup
+ exit 2
+}
+
+#
+# If user removes the job, LPD will send SIGINT, so trap SIGINT
+# (and a few other signals) to clean up after ourselves.
+#
+trap cleanup 1 2 15
+
+#
+# Make sure we are not colliding with any existing files.
+#
+cleanup
+
+#
+# Link the DVI input file to standard input (the file to print).
+#
+ln -s /dev/fd/0 hpdf$$.dvi || fatal "Cannot symlink /dev/fd/0"
+
+#
+# Make LF = CR+LF
+#
+printf "\033&k2G" || fatal "Cannot initialize printer"
+
+#
+# Convert and print. Return value from dvilj2p does not seem to be
+# reliable, so we ignore it.
+#
+dvilj2p -M1 -q -e- dfhp$$.dvi
+
+#
+# Clean up and exit
+#
+cleanup
+exit 0
diff --git a/share/examples/printing/hpif b/share/examples/printing/hpif
new file mode 100644
index 000000000000..69f1f34c55fd
--- /dev/null
+++ b/share/examples/printing/hpif
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# hpif - Simple text input filter for lpd for HP-PCL based printers
+# Installed in /usr/local/libexec/hpif
+#
+# Simply copies stdin to stdout. Ignores all filter arguments.
+# Tells printer to treat LF as CR+LF. Writes a form feed character
+# after printing job.
+
+printf "\033&k2G" && cat && printf "\f" && exit 0
+exit 2
diff --git a/share/examples/printing/hpof b/share/examples/printing/hpof
new file mode 100644
index 000000000000..691b07f95d16
--- /dev/null
+++ b/share/examples/printing/hpof
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# hpof - Output filter for Hewlett Packard PCL-compatible printers
+# Installed in /usr/local/libexec/hpof
+
+
+printf "\033&k2G" || exit 2
+exec /usr/libexec/lpr/lpf
diff --git a/share/examples/printing/hprf b/share/examples/printing/hprf
new file mode 100644
index 000000000000..37ad583fd9e1
--- /dev/null
+++ b/share/examples/printing/hprf
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# hprf - FORTRAN text filter for LaserJet 3si:
+# Installed in /usr/local/libexec/hprf
+#
+
+printf "\033&k2G" && fpr && printf "\f" && exit 0
+exit 2
diff --git a/share/examples/printing/hpvf b/share/examples/printing/hpvf
new file mode 100644
index 000000000000..233de809745b
--- /dev/null
+++ b/share/examples/printing/hpvf
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# hpvf - Convert GIF files into HP/PCL, then print
+# Installed in /usr/local/libexec/hpvf
+
+PATH=/usr/X11R6/bin:$PATH; export PATH
+
+giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \
+ && exit 0 \
+ || exit 2
diff --git a/share/examples/printing/if-simple b/share/examples/printing/if-simple
new file mode 100644
index 000000000000..7a5bf97ab38f
--- /dev/null
+++ b/share/examples/printing/if-simple
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# if-simple - Simple text input filter for lpd
+# Installed in /usr/local/libexec/if-simple
+#
+# Simply copies stdin to stdout. Ignores all filter arguments.
+
+/bin/cat && exit 0
+exit 2
diff --git a/share/examples/printing/if-simpleX b/share/examples/printing/if-simpleX
new file mode 100644
index 000000000000..c14b4a25d12b
--- /dev/null
+++ b/share/examples/printing/if-simpleX
@@ -0,0 +1,10 @@
+#!/bin/sh
+#
+# if-simple - Simple text input filter for lpd
+# Installed in /usr/local/libexec/if-simple
+#
+# Simply copies stdin to stdout. Ignores all filter arguments.
+# Writes a form feed character (\f) after printing job.
+
+/bin/cat && printf "\f" && exit 0
+exit 2
diff --git a/share/examples/printing/ifhp b/share/examples/printing/ifhp
new file mode 100644
index 000000000000..ace0fab4214b
--- /dev/null
+++ b/share/examples/printing/ifhp
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# ifhp - Print Ghostscript-simulated PostScript on a DesJet 500
+# Installed in /usr/local/libexec/hpif
+
+#
+# Treat LF as CR+LF:
+#
+printf "\033&k2G" || exit 2
+
+#
+# Read first two characters of the file
+#
+read first_line
+first_two_chars=`expr "$first_line" : '\(..\)'`
+
+if [ "$first_two_chars" = "%!" ]; then
+ #
+ # It is PostScript; use Ghostscript to scan-convert and print it
+ #
+ /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=djet500 -sOutputFile=- - \
+ && exit 0
+
+else
+ #
+ # Plain text or HP/PCL, so just print it directly; print a form
+ # at the end to eject the last page.
+ #
+ echo "$first_line" && cat && printf "\f" && exit 0
+fi
+
+exit 2
diff --git a/share/examples/printing/make-ps-header b/share/examples/printing/make-ps-header
new file mode 100644
index 000000000000..19e38ab7c779
--- /dev/null
+++ b/share/examples/printing/make-ps-header
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# make-ps-header - make a PostScript header page on stdout
+# Installed in /usr/local/libexec/make-ps-header
+#
+
+#
+# These are PostScript units (72 to the inch). Modify for A4 or
+# whatever size paper you are using:
+#
+page_width=612
+page_height=792
+border=72
+
+#
+# Check arguments
+#
+if [ $# -ne 3 ]; then
+ echo "Usage: `basename $0` <user> <host> <job>" 1>&2
+ exit 1
+fi
+
+#
+# Save these, mostly for readability in the PostScript, below.
+#
+user=$1
+host=$2
+job=$3
+date=`date`
+
+#
+# Send the PostScript code to stdout.
+#
+exec cat <<EOF
+%!PS
+
+%
+% Make sure we do not interfere with user's job that will follow
+%
+save
+
+%
+% Make a thick, unpleasant border around the edge of the paper.
+%
+$border $border moveto
+$page_width $border 2 mul sub 0 rlineto
+0 $page_height $border 2 mul sub rlineto
+currentscreen 3 -1 roll pop 100 3 1 roll setscreen
+$border 2 mul $page_width sub 0 rlineto closepath
+0.8 setgray 10 setlinewidth stroke 0 setgray
+
+%
+% Display user's login name, nice and large and prominent
+%
+/Helvetica-Bold findfont 64 scalefont setfont
+$page_width ($user) stringwidth pop sub 2 div $page_height 200 sub moveto
+($user) show
+
+%
+% Now show the boring particulars
+%
+/Helvetica findfont 14 scalefont setfont
+/y 200 def
+[ (Job:) (Host:) (Date:) ] {
+ 200 y moveto show /y y 18 sub def
+} forall
+
+/Helvetica-Bold findfont 14 scalefont setfont
+/y 200 def
+[ ($job) ($host) ($date) ] {
+ 270 y moveto show /y y 18 sub def
+} forall
+
+%
+% That is it
+%
+restore
+showpage
+EOF
diff --git a/share/examples/printing/netprint b/share/examples/printing/netprint
new file mode 100644
index 000000000000..9b5010cc8cc5
--- /dev/null
+++ b/share/examples/printing/netprint
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+#
+# netprint - Text filter for printer attached to network
+# Installed in /usr/local/libexec/netprint
+#
+
+$#ARGV eq 1 || die "Usage: $0 <printer-hostname> <port-number>";
+
+$printer_host = $ARGV[0];
+$printer_port = $ARGV[1];
+
+require 'sys/socket.ph';
+
+($ignore, $ignore, $protocol) = getprotobyname('tcp');
+($ignore, $ignore, $ignore, $ignore, $address)
+ = gethostbyname($printer_host);
+
+$sockaddr = pack('S n a4 x8', &AF_INET, $printer_port, $address);
+
+socket(PRINTER, &PF_INET, &SOCK_STREAM, $protocol)
+ || die "Can't create TCP/IP stream socket: $!";
+connect(PRINTER, $sockaddr) || die "Can't contact $printer_host: $!";
+while (<STDIN>) { print PRINTER; }
+exit 0;
diff --git a/share/examples/printing/psdf b/share/examples/printing/psdf
new file mode 100644
index 000000000000..e0d429b953c2
--- /dev/null
+++ b/share/examples/printing/psdf
@@ -0,0 +1,8 @@
+#!bin/sh
+#
+# psdf - DVI to PostScript printer filter
+# Installed in /usr/local/libexec/psdf
+#
+# Invoked by lpd when user runs lpr -d
+#
+exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@"
diff --git a/share/examples/printing/psdfX b/share/examples/printing/psdfX
new file mode 100644
index 000000000000..43bdc4100bdb
--- /dev/null
+++ b/share/examples/printing/psdfX
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# psdf - DVI to PostScript printer filter
+# Installed in /usr/local/libexec/psdf
+#
+# Invoked by lpd when user runs lpr -d
+#
+
+orig_args="$@"
+
+fail() {
+ echo "$@" 1>&2
+ exit 2
+}
+
+while getopts "x:y:n:h:" option; do
+ case $option in
+ x|y) ;; # Ignore
+ n) login=$OPTARG ;;
+ h) host=$OPTARG ;;
+ *) echo "LPD started `basename $0` wrong." 1>&2
+ exit 2
+ ;;
+ esac
+done
+
+[ "$login" ] || fail "No login name"
+[ "$host" ] || fail "No host name"
+
+( /u/kelly/freebsd/printing/filters/make-ps-header $login $host "DVI File"
+ /usr/local/bin/dvips -f ) | eval /usr/local/libexec/lprps $orig_args
diff --git a/share/examples/printing/psif b/share/examples/printing/psif
new file mode 100644
index 000000000000..1a816f64888b
--- /dev/null
+++ b/share/examples/printing/psif
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# psif - Print PostScript or plain text on a PostScript printer
+# Script version; NOT the version that comes with lprps
+# Installed in /usr/local/libexec/psif
+#
+
+read first_line
+first_two_chars=`expr "$first_line" : '\(..\)'`
+
+if [ "$first_two_chars" = "%!" ]; then
+ #
+ # PostScript job, print it.
+ #
+ echo "$first_line" && cat && printf "\004" && exit 0
+ exit 2
+else
+ #
+ # Plain text, convert it, then print it.
+ #
+ ( echo "$first_line"; cat ) | /usr/local/bin/textps && printf "\004" && exit 0
+ exit 2
+fi
diff --git a/share/examples/printing/pstf b/share/examples/printing/pstf
new file mode 100644
index 000000000000..308adc19e2ab
--- /dev/null
+++ b/share/examples/printing/pstf
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# pstf - Convert groff's troff data into PS, then print.
+# Installed in /usr/local/libexec/pstf
+#
+exec grops | /usr/local/libexec/lprps "$@"
diff --git a/share/examples/printing/pstfX b/share/examples/printing/pstfX
new file mode 100644
index 000000000000..1af7134223c2
--- /dev/null
+++ b/share/examples/printing/pstfX
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# pstf - Convert groff's troff data into PS, then print.
+# Installed in /usr/local/libexec/pstf
+#
+exec grops
diff --git a/share/examples/scsi_target/Makefile b/share/examples/scsi_target/Makefile
new file mode 100644
index 000000000000..67f2a4ec24f0
--- /dev/null
+++ b/share/examples/scsi_target/Makefile
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+PROG= scsi_target
+SRCS= scsi_target.c
+
+NOMAN= noman
+
+.include <bsd.prog.mk>
diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c
new file mode 100644
index 000000000000..45776e57d8a5
--- /dev/null
+++ b/share/examples/scsi_target/scsi_target.c
@@ -0,0 +1,375 @@
+/*
+ * Sample program to attach to the "targ" processor target, target mode
+ * peripheral driver and push or receive data.
+ *
+ * Copyright (c) 1998 Justin T. Gibbs.
+ * 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. 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 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$
+ */
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <poll.h>
+#include <signal.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sysexits.h>
+#include <unistd.h>
+
+#include <cam/scsi/scsi_all.h>
+#include <cam/scsi/scsi_message.h>
+#include <cam/scsi/scsi_targetio.h>
+
+char *appname;
+int ifd;
+char *ifilename;
+int ofd;
+char *ofilename;
+size_t bufsize = 64 * 1024;
+void *buf;
+char targdevname[80];
+int targctlfd;
+int targfd;
+int quit;
+int debug = 0;
+struct ioc_alloc_unit alloc_unit = {
+ CAM_BUS_WILDCARD,
+ CAM_TARGET_WILDCARD,
+ CAM_LUN_WILDCARD
+};
+
+static void pump_events();
+static void cleanup();
+static void handle_exception();
+static void quit_handler();
+static void usage();
+
+int
+main(int argc, char *argv[])
+{
+ int ch;
+
+ appname = *argv;
+ while ((ch = getopt(argc, argv, "i:o:p:t:l:d")) != -1) {
+ switch(ch) {
+ case 'i':
+ if ((ifd = open(optarg, O_RDONLY)) == -1) {
+ perror(optarg);
+ exit(EX_NOINPUT);
+ }
+ ifilename = optarg;
+ break;
+ case 'o':
+ if ((ofd = open(optarg,
+ O_WRONLY|O_CREAT), 0600) == -1) {
+ perror(optarg);
+ exit(EX_CANTCREAT);
+ }
+ ofilename = optarg;
+ break;
+ case 'p':
+ alloc_unit.path_id = atoi(optarg);
+ break;
+ case 't':
+ alloc_unit.target_id = atoi(optarg);
+ break;
+ case 'l':
+ alloc_unit.lun_id = atoi(optarg);
+ break;
+ case 'd':
+ debug++;
+ break;
+ case '?':
+ default:
+ usage();
+ /* NOTREACHED */
+ }
+ }
+ argc -= optind;
+ argv += optind;
+
+ if (alloc_unit.path_id == CAM_BUS_WILDCARD
+ || alloc_unit.target_id == CAM_TARGET_WILDCARD
+ || alloc_unit.lun_id == CAM_LUN_WILDCARD) {
+ fprintf(stderr, "%s: Incomplete device path specifiled\n",
+ appname);
+ usage();
+ /* NOTREACHED */
+ }
+
+ if (argc != 0) {
+ fprintf(stderr, "%s: Too many arguments\n", appname);
+ usage();
+ /* NOTREACHED */
+ }
+
+ /* Allocate a new instance */
+ if ((targctlfd = open("/dev/targ.ctl", O_RDWR)) == -1) {
+ perror("/dev/targ.ctl");
+ exit(EX_UNAVAILABLE);
+ }
+
+ if (ioctl(targctlfd, TARGCTLIOALLOCUNIT, &alloc_unit) == -1) {
+ perror("TARGCTLIOALLOCUNIT");
+ exit(EX_SOFTWARE);
+ }
+
+ snprintf(targdevname, sizeof(targdevname), "%starg%d", _PATH_DEV,
+ alloc_unit.unit);
+
+ if ((targfd = open(targdevname, O_RDWR)) == -1) {
+ perror(targdevname);
+ ioctl(targctlfd, TARGCTLIOFREEUNIT, &alloc_unit);
+ exit(EX_NOINPUT);
+ }
+
+ if (ioctl(targfd, TARGIODEBUG, &debug) == -1) {
+ perror("TARGIODEBUG");
+ (void) ioctl(targctlfd, TARGCTLIOFREEUNIT, &alloc_unit);
+ exit(EX_SOFTWARE);
+ }
+
+ buf = malloc(bufsize);
+
+ if (buf == NULL) {
+ fprintf(stderr, "%s: Could not malloc I/O buffer", appname);
+ if (debug) {
+ debug = 0;
+ (void) ioctl(targfd, TARGIODEBUG, &debug);
+ }
+ (void) ioctl(targctlfd, TARGCTLIOFREEUNIT, &alloc_unit);
+ exit(EX_OSERR);
+ }
+
+ signal(SIGHUP, quit_handler);
+ signal(SIGINT, quit_handler);
+ signal(SIGTERM, quit_handler);
+
+ atexit(cleanup);
+
+ pump_events();
+
+ return (0);
+}
+
+static void
+cleanup()
+{
+ if (debug) {
+ debug = 0;
+ (void) ioctl(targfd, TARGIODEBUG, &debug);
+ }
+ close(targfd);
+ if (ioctl(targctlfd, TARGCTLIOFREEUNIT, &alloc_unit) == -1) {
+ perror("TARGCTLIOFREEUNIT");
+ }
+ close(targctlfd);
+}
+
+static void
+pump_events()
+{
+ struct pollfd targpoll;
+
+ targpoll.fd = targfd;
+ targpoll.events = POLLRDNORM|POLLWRNORM;
+
+ while (quit == 0) {
+ int retval;
+
+ retval = poll(&targpoll, 1, INFTIM);
+
+ if (retval == -1) {
+ if (errno == EINTR)
+ continue;
+ perror("Poll Failed");
+ exit(EX_SOFTWARE);
+ }
+
+ if (retval == 0) {
+ perror("Poll returned 0 although timeout infinite???");
+ exit(EX_SOFTWARE);
+ }
+
+ if (retval > 1) {
+ perror("Poll returned more fds ready than allocated");
+ exit(EX_SOFTWARE);
+ }
+
+ /* Process events */
+ if ((targpoll.revents & POLLERR) != 0) {
+ handle_exception();
+ }
+
+ if ((targpoll.revents & POLLRDNORM) != 0) {
+ retval = read(targfd, buf, bufsize);
+
+ if (retval == -1) {
+ perror("Read from targ failed");
+ /* Go look for exceptions */
+ continue;
+ } else {
+ retval = write(ofd, buf, retval);
+ if (retval == -1) {
+ perror("Write to file failed");
+ }
+ }
+ }
+
+ if ((targpoll.revents & POLLWRNORM) != 0) {
+ int amount_read;
+
+ retval = read(ifd, buf, bufsize);
+ if (retval == -1) {
+ perror("Read from file failed");
+ exit(EX_SOFTWARE);
+ }
+
+ amount_read = retval;
+ retval = write(targfd, buf, retval);
+ if (retval == -1) {
+ perror("Write to targ failed");
+ retval = 0;
+ }
+
+ /* Backup in our input stream on short writes */
+ if (retval != amount_read)
+ lseek(ifd, retval - amount_read, SEEK_CUR);
+ }
+ }
+}
+
+static void
+handle_exception()
+{
+ targ_exception exceptions;
+
+ if (ioctl(targfd, TARGIOCFETCHEXCEPTION, &exceptions) == -1) {
+ perror("TARGIOCFETCHEXCEPTION");
+ exit(EX_SOFTWARE);
+ }
+
+ printf("Saw exceptions %x\n", exceptions);
+ if ((exceptions & TARG_EXCEPT_DEVICE_INVALID) != 0) {
+ /* Device went away. Nothing more to do. */
+ printf("Device went away\n");
+ exit(0);
+ }
+
+ if ((exceptions & TARG_EXCEPT_UNKNOWN_ATIO) != 0) {
+ struct ccb_accept_tio atio;
+ struct ioc_initiator_state ioc_istate;
+ struct scsi_sense_data *sense;
+ union ccb ccb;
+
+ if (ioctl(targfd, TARGIOCFETCHATIO, &atio) == -1) {
+ perror("TARGIOCFETCHATIO");
+ exit(EX_SOFTWARE);
+ }
+
+ printf("Ignoring unhandled command 0x%x for Id %d\n",
+ atio.cdb_io.cdb_bytes[0], atio.init_id);
+
+ ioc_istate.initiator_id = atio.init_id;
+ if (ioctl(targfd, TARGIOCGETISTATE, &ioc_istate) == -1) {
+ perror("TARGIOCGETISTATE");
+ exit(EX_SOFTWARE);
+ }
+
+ /* Send back Illegal Command code status */
+ ioc_istate.istate.pending_ca |= CA_CMD_SENSE;
+ sense = &ioc_istate.istate.sense_data;
+ bzero(sense, sizeof(*sense));
+ sense->error_code = SSD_CURRENT_ERROR;
+ sense->flags = SSD_KEY_ILLEGAL_REQUEST;
+ sense->add_sense_code = 0x20;
+ sense->add_sense_code_qual = 0x00;
+ sense->extra_len = offsetof(struct scsi_sense_data, fru)
+ - offsetof(struct scsi_sense_data, extra_len);
+
+ if (ioctl(targfd, TARGIOCSETISTATE, &ioc_istate) == -1) {
+ perror("TARGIOCSETISTATE");
+ exit(EX_SOFTWARE);
+ }
+
+ /* Clear the exception so the kernel will take our response */
+ if (ioctl(targfd, TARGIOCCLEAREXCEPTION, &exceptions) == -1) {
+ perror("TARGIOCCLEAREXCEPTION");
+ exit(EX_SOFTWARE);
+ }
+
+ bzero(&ccb, sizeof(ccb));
+ cam_fill_ctio(&ccb.csio,
+ /*retries*/2,
+ /*cbfcnp*/NULL,
+ CAM_DIR_NONE | CAM_SEND_STATUS,
+ (atio.ccb_h.flags & CAM_TAG_ACTION_VALID)?
+ MSG_SIMPLE_Q_TAG : 0,
+ atio.tag_id,
+ atio.init_id,
+ SCSI_STATUS_CHECK_COND,
+ /*data_ptr*/NULL,
+ /*dxfer_len*/0,
+ /*timeout*/5 * 1000);
+ /*
+ * Make sure that periph_priv pointers are clean.
+ */
+ bzero(&ccb.ccb_h.periph_priv, sizeof ccb.ccb_h.periph_priv);
+
+ if (ioctl(targfd, TARGIOCCOMMAND, &ccb) == -1) {
+ perror("TARGIOCCOMMAND");
+ exit(EX_SOFTWARE);
+ }
+
+ } else {
+ if (ioctl(targfd, TARGIOCCLEAREXCEPTION, &exceptions) == -1) {
+ perror("TARGIOCCLEAREXCEPTION");
+ exit(EX_SOFTWARE);
+ }
+ }
+
+}
+
+static void
+quit_handler(int signum)
+{
+ quit = 1;
+}
+
+static void
+usage()
+{
+
+ (void)fprintf(stderr,
+"usage: %-16s [ -d ] [-o output_file] [-i input_file] -p path -t target -l lun\n",
+ appname);
+
+ exit(EX_USAGE);
+}
+
diff --git a/share/examples/ses/Makefile b/share/examples/ses/Makefile
new file mode 100644
index 000000000000..2a332d5b8716
--- /dev/null
+++ b/share/examples/ses/Makefile
@@ -0,0 +1,41 @@
+# $NetBSD: $
+# $OpenBSD: $
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+UNUSED = getobjmap getnobj getobjstat
+SUBDIR = getencstat setencstat setobjstat sesd
+
+.include <bsd.own.mk>
+.include <bsd.subdir.mk>
diff --git a/share/examples/ses/Makefile.inc b/share/examples/ses/Makefile.inc
new file mode 100644
index 000000000000..9e1e4cbb3b1a
--- /dev/null
+++ b/share/examples/ses/Makefile.inc
@@ -0,0 +1,48 @@
+# $NetBSD: $
+# $OpenBSD: $
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+SYS != uname -s
+
+.if ${SYS} == OpenBSD
+COPTS += -I/usr/include/scsi -DSESINC="<ses.h>"
+.elif ${SYS} == NetBSD
+COPTS += -I/usr/include/dev/scsipi -DSESINC="<ses.h>"
+.else
+COPTS += -I/usr/include/cam/scsi -DSESINC="<scsi_ses.h>"
+.endif
+BINDIR ?= ${DESTDIR}/usr/sbin
+
+.PATH: ../srcs
diff --git a/share/examples/ses/getencstat/Makefile b/share/examples/ses/getencstat/Makefile
new file mode 100644
index 000000000000..ac3fdad83ea3
--- /dev/null
+++ b/share/examples/ses/getencstat/Makefile
@@ -0,0 +1,39 @@
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+MAN8 = getencstat.0
+SRCS = getencstat.c eltsub.c
+PROG = getencstat
+
+.include <bsd.prog.mk>
diff --git a/share/examples/ses/getencstat/getencstat.0 b/share/examples/ses/getencstat/getencstat.0
new file mode 100644
index 000000000000..fa95be07cc73
--- /dev/null
+++ b/share/examples/ses/getencstat/getencstat.0
@@ -0,0 +1,78 @@
+.\" $FreeBSD$
+.\"
+.\" Copyright (c) 2000 Matthew Jacob
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" Alternatively, this software may be distributed under the terms of the
+.\" the GNU Public License ("GPL").
+.\"
+.\" 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.
+.\"
+.\" Matthew Jacob
+.\" Feral Software
+.\" mjacob@feral.com
+.Dd February 21, 2000
+.Dt GETENCSTAT 8
+.Os
+.Sh NAME
+.Nm getencstat
+.Nd get SCSI Environmental Services Device enclosure status
+.Sh SYNOPSIS
+.Nm
+.Op Fl v
+.Ar device
+.Op Ar device ...
+.Sh DESCRIPTION
+.Nm
+gets summary and detailed SCSI Environmental Services (or SAF-TE) device
+enclosure status. The overall status is printed out. If the overall status
+is considered okay, nothing else is printed out (unless the the
+.Fl v
+option is used).
+.Pp
+A SCSI Environmental Services device enclosure may be either in the state
+of being \fBOK\fR, or in one or more of the states of \fBINFORMATIONAL\fR,
+\fBNON-CRITICAL\fR, \fBCRITICAL\fB or \fBUNRECOVERABLE\fR states. These
+overall states reflect a summary of the states of each object within
+such a device (such as power supplies or disk drives).
+.Pp
+With the
+.Fl v
+option, the status of all objects within the device is printed, whether
+\fBOK\fR or not. Along with the status of each object is the object identifier.
+.Pp
+The user may then use
+.Xr setencstat 8
+to try and clear overall device status, or may use
+.Xr setobjstat 8
+to set specific object status.
+.Sh FILES
+.Bl -tag -width /dev/sesN -compact
+.It Pa /dev/ses\fIN\fR
+SCSI Environmental Services Devices
+.El
+.Sh SEE ALSO
+.Xr ses 4 ,
+.Xr sesd 8 ,
+.Xr setencstat 8 ,
+.Xr setobjstat 8
+.Sh BUGS
diff --git a/share/examples/ses/sesd/Makefile b/share/examples/ses/sesd/Makefile
new file mode 100644
index 000000000000..3f12cbfcde48
--- /dev/null
+++ b/share/examples/ses/sesd/Makefile
@@ -0,0 +1,39 @@
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+MAN8 = sesd.0
+SRCS = sesd.c eltsub.c
+PROG = sesd
+
+.include <bsd.prog.mk>
diff --git a/share/examples/ses/sesd/sesd.0 b/share/examples/ses/sesd/sesd.0
new file mode 100644
index 000000000000..dcad2273a759
--- /dev/null
+++ b/share/examples/ses/sesd/sesd.0
@@ -0,0 +1,84 @@
+.\" $FreeBSD$
+.\"
+.\" Copyright (c) 2000 Matthew Jacob
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" Alternatively, this software may be distributed under the terms of the
+.\" the GNU Public License ("GPL").
+.\"
+.\" 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.
+.\"
+.\" Matthew Jacob
+.\" Feral Software
+.\" mjacob@feral.com
+.Dd February 21, 2000
+.Dt SESD 8
+.Os
+.Sh NAME
+.Nm sesd
+.Nd monitor SCSI Environmental Services Devices
+.Sh SYNOPSIS
+.Nm
+.Op Fl d
+.Op Fl t Ar poll-interval
+.Ar device
+.Op Ar device ...
+.Sh DESCRIPTION
+.Nm
+monitors SCSI Environmental Services (or SAF-TE) devices for changes
+in state and logs such changes changes to the system error logger
+(see
+.Xr syslogd 8 ) .
+At least one device must be specified.
+When no other options are supplied,
+.Nm
+detached becomes a daemon, by default waking up every 30 seconds to
+poll each device for a change in state.
+.Pp
+The following options may be used:
+.Bl -tag -width Ds
+.It Fl p Ar poll-interval
+Change the interval of polling from the default 30 seconds to the number
+of seconds specified.
+.It Fl d
+Instead of detaching and becoming a daemon, stay attached to the
+controlling terminal and log changes there as well as via the system
+logger.
+.El
+.Pp
+The user may then use
+.Xr getencstat 8
+to get more detailed information about the state of the over enclosure device
+or objects within the enclosure device.
+.Sh FILES
+.Bl -tag -width /dev/sesN -compact
+.It Pa /dev/ses\fIN\fR
+SCSI Environmental Services Devices
+.El
+.Sh SEE ALSO
+.Xr ses 4 ,
+.Xr getencstat 8 ,
+.Xr setencstat 8 ,
+.Xr setobjstat 8 ,
+.Xr syslogd 8
+.Sh BUGS
+This is something of a toy, but it is better than nothing.
diff --git a/share/examples/ses/setencstat/Makefile b/share/examples/ses/setencstat/Makefile
new file mode 100644
index 000000000000..99609fb0bb9b
--- /dev/null
+++ b/share/examples/ses/setencstat/Makefile
@@ -0,0 +1,39 @@
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+MAN8 = setencstat.0
+SRCS = setencstat.c eltsub.c
+PROG = setencstat
+
+.include <bsd.prog.mk>
diff --git a/share/examples/ses/setencstat/setencstat.0 b/share/examples/ses/setencstat/setencstat.0
new file mode 100644
index 000000000000..6047185d9f7e
--- /dev/null
+++ b/share/examples/ses/setencstat/setencstat.0
@@ -0,0 +1,72 @@
+.\" $FreeBSD$
+.\"
+.\" Copyright (c) 2000 Matthew Jacob
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" Alternatively, this software may be distributed under the terms of the
+.\" the GNU Public License ("GPL").
+.\"
+.\" 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.
+.\"
+.\" Matthew Jacob
+.\" Feral Software
+.\" mjacob@feral.com
+.Dd February 21, 2000
+.Dt SETENCSTAT 8
+.Os
+.Sh NAME
+.Nm setencstat
+.Nd set SCSI Environmental Services Device enclosure status
+.Sh SYNOPSIS
+.Nm
+.Ar device enclosure_status
+.Sh DESCRIPTION
+.Nm
+sets summary status for a SCSI Environmental Services (or SAF-TE) device.
+The enclosure status argument may take on the values:
+.Bl -tag -width Ds
+.It 0
+Set the status to an \fBOK\fR state.
+.It 1
+Set the status to an \fBUNRECOVERABLE\fR state.
+.It 2
+Set the status to an \fBCRITICAL\fR state.
+.It 4
+Set the status to an \fBNON-CRITICAL\fR state.
+.It 8
+Set the status to an \fBINFORMATIONAL\fR state.
+.El
+.Pp
+All the non-zero options may be combined.
+.Pp
+Note that devices may simply and silently ignore the setting of these values.
+.Sh FILES
+.Bl -tag -width /dev/sesN -compact
+.It Pa /dev/ses\fIN\fR
+SCSI Environmental Services Devices
+.El
+.Sh SEE ALSO
+.Xr ses 4 ,
+.Xr getencstat 8 ,
+.Xr sesd 8 ,
+.Xr setobjstat 8
+.Sh BUGS
diff --git a/share/examples/ses/setobjstat/Makefile b/share/examples/ses/setobjstat/Makefile
new file mode 100644
index 000000000000..d2cbd697023a
--- /dev/null
+++ b/share/examples/ses/setobjstat/Makefile
@@ -0,0 +1,39 @@
+# $FreeBSD$
+#
+# Copyright (c) 2000 by Matthew Jacob
+# 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. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# Alternatively, this software may be distributed under the terms of the
+# the GNU Public License ("GPL").
+#
+# 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.
+#
+# Matthew Jacob
+# Feral Software
+# mjacob@feral.com
+#
+
+MAN8 = setobjstat.0
+SRCS = setobjstat.c eltsub.c
+PROG = setobjstat
+
+.include <bsd.prog.mk>
diff --git a/share/examples/ses/setobjstat/setobjstat.0 b/share/examples/ses/setobjstat/setobjstat.0
new file mode 100644
index 000000000000..8b298f5bd408
--- /dev/null
+++ b/share/examples/ses/setobjstat/setobjstat.0
@@ -0,0 +1,67 @@
+.\" $FreeBSD$
+.\"
+.\" Copyright (c) 2000 Matthew Jacob
+.\" 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. The name of the author may not be used to endorse or promote products
+.\" derived from this software without specific prior written permission.
+.\"
+.\" Alternatively, this software may be distributed under the terms of the
+.\" the GNU Public License ("GPL").
+.\"
+.\" 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.
+.\"
+.\" Matthew Jacob
+.\" Feral Software
+.\" mjacob@feral.com
+.Dd February 21, 2000
+.Dt SETOBJSTAT 8
+.Os
+.Sh NAME
+.Nm setobjstat
+.Nd set SCSI Environmental Services Device object status
+.Sh SYNOPSIS
+.Nm
+.Ar device objectid stat0 stat1 stat2 stat3
+.Sh DESCRIPTION
+.Nm
+sets the object status for a SCSI Environmental Services (or SAF-TE) device.
+The
+.Ar objectid
+argument may be determined by running
+.Xr getencstat 8 .
+.Pp
+The status fields are partially common (first byte only, which must
+have a value of 0x80 contained in it), but otherwise quite device
+specific. A complete discussion of the possible values is impractical
+here. Please refer to the ANSI SCSI specification (available on
+the FTP site ftp.t10.org).
+.Pp
+Note that devices may simply and silently ignore the setting of these values.
+.Sh FILES
+.Bl -tag -width /dev/sesN -compact
+.It Pa /dev/ses\fIN\fR
+SCSI Environmental Services Devices
+.El
+.Sh SEE ALSO
+.Xr ses 4 ,
+.Xr getencstat 8 ,
+.Xr sesd 8 ,
+.Xr setencstat 8
+.Sh BUGS
diff --git a/share/examples/ses/srcs/chpmon.c b/share/examples/ses/srcs/chpmon.c
new file mode 100644
index 000000000000..1b537c7ba11e
--- /dev/null
+++ b/share/examples/ses/srcs/chpmon.c
@@ -0,0 +1,128 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+#include "ses.h"
+
+/*
+ * Continuously monitor all named SES devices
+ * and turn all but INFO enclosure status
+ * values into CRITICAL enclosure status.
+ */
+#define BADSTAT \
+ (SES_ENCSTAT_UNRECOV|SES_ENCSTAT_CRITICAL|SES_ENCSTAT_NONCRITICAL)
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ int fd, delay, dev;
+ ses_encstat stat, *carray;
+
+ if (a < 3) {
+ fprintf(stderr, "usage: %s polling-interval device "
+ "[ device ... ]\n", *v);
+ return (1);
+ }
+ delay = atoi(v[1]);
+ carray = malloc(a);
+ if (carray == NULL) {
+ perror("malloc");
+ return (1);
+ }
+ bzero((void *)carray, a);
+
+ for (;;) {
+ for (dev = 2; dev < a; dev++) {
+ fd = open(v[dev], O_RDWR);
+ if (fd < 0) {
+ perror(v[dev]);
+ continue;
+ }
+ /*
+ * First clear any enclosure status, in case it is
+ * a latched status.
+ */
+ stat = 0;
+ if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
+ fprintf(stderr, "%s: SESIOC_SETENCSTAT1: %s\n",
+ v[dev], strerror(errno));
+ (void) close(fd);
+ continue;
+ }
+ /*
+ * Now get the actual current enclosure status.
+ */
+ if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
+ fprintf(stderr, "%s: SESIOC_GETENCSTAT: %s\n",
+ v[dev], strerror(errno));
+ (void) close(fd);
+ continue;
+ }
+
+ if ((stat & BADSTAT) == 0) {
+ if (carray[dev]) {
+ fprintf(stdout, "%s: Clearing CRITICAL "
+ "condition\n", v[dev]);
+ carray[dev] = 0;
+ }
+ (void) close(fd);
+ continue;
+ }
+ carray[dev] = 1;
+ fprintf(stdout, "%s: Setting CRITICAL from:", v[dev]);
+ if (stat & SES_ENCSTAT_UNRECOV)
+ fprintf(stdout, " UNRECOVERABLE");
+
+ if (stat & SES_ENCSTAT_CRITICAL)
+ fprintf(stdout, " CRITICAL");
+
+ if (stat & SES_ENCSTAT_NONCRITICAL)
+ fprintf(stdout, " NONCRITICAL");
+ putchar('\n');
+ stat = SES_ENCSTAT_CRITICAL;
+ if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
+ fprintf(stderr, "%s: SESIOC_SETENCSTAT 2: %s\n",
+ v[dev], strerror(errno));
+ }
+ (void) close(fd);
+ }
+ sleep(delay);
+ }
+ /* NOTREACHED */
+}
diff --git a/share/examples/ses/srcs/eltsub.c b/share/examples/ses/srcs/eltsub.c
new file mode 100644
index 000000000000..5fae6653d41f
--- /dev/null
+++ b/share/examples/ses/srcs/eltsub.c
@@ -0,0 +1,167 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+char *
+geteltnm(type)
+ int type;
+{
+ static char rbuf[132];
+
+ switch (type) {
+ case SESTYP_UNSPECIFIED:
+ sprintf(rbuf, "Unspecified");
+ break;
+ case SESTYP_DEVICE:
+ sprintf(rbuf, "Device");
+ break;
+ case SESTYP_POWER:
+ sprintf(rbuf, "Power supply");
+ break;
+ case SESTYP_FAN:
+ sprintf(rbuf, "Cooling element");
+ break;
+ case SESTYP_THERM:
+ sprintf(rbuf, "Temperature sensors");
+ break;
+ case SESTYP_DOORLOCK:
+ sprintf(rbuf, "Door Lock");
+ break;
+ case SESTYP_ALARM:
+ sprintf(rbuf, "Audible alarm");
+ break;
+ case SESTYP_ESCC:
+ sprintf(rbuf, "Enclosure services controller electronics");
+ break;
+ case SESTYP_SCC:
+ sprintf(rbuf, "SCC controller electronics");
+ break;
+ case SESTYP_NVRAM:
+ sprintf(rbuf, "Nonvolatile cache");
+ break;
+ case SESTYP_UPS:
+ sprintf(rbuf, "Uninterruptible power supply");
+ break;
+ case SESTYP_DISPLAY:
+ sprintf(rbuf, "Display");
+ break;
+ case SESTYP_KEYPAD:
+ sprintf(rbuf, "Key pad entry device");
+ break;
+ case SESTYP_SCSIXVR:
+ sprintf(rbuf, "SCSI port/transceiver");
+ break;
+ case SESTYP_LANGUAGE:
+ sprintf(rbuf, "Language");
+ break;
+ case SESTYP_COMPORT:
+ sprintf(rbuf, "Communication Port");
+ break;
+ case SESTYP_VOM:
+ sprintf(rbuf, "Voltage Sensor");
+ break;
+ case SESTYP_AMMETER:
+ sprintf(rbuf, "Current Sensor");
+ break;
+ case SESTYP_SCSI_TGT:
+ sprintf(rbuf, "SCSI target port");
+ break;
+ case SESTYP_SCSI_INI:
+ sprintf(rbuf, "SCSI initiator port");
+ break;
+ case SESTYP_SUBENC:
+ sprintf(rbuf, "Simple sub-enclosure");
+ break;
+ default:
+ (void) sprintf(rbuf, "<Type 0x%x>", type);
+ break;
+ }
+ return (rbuf);
+}
+
+static char *
+scode2ascii(code)
+ u_char code;
+{
+ static char rbuf[32];
+ switch (code & 0xf) {
+ case SES_OBJSTAT_UNSUPPORTED:
+ sprintf(rbuf, "status not supported");
+ break;
+ case SES_OBJSTAT_OK:
+ sprintf(rbuf, "ok");
+ break;
+ case SES_OBJSTAT_CRIT:
+ sprintf(rbuf, "critical");
+ break;
+ case SES_OBJSTAT_NONCRIT:
+ sprintf(rbuf, "non-critical");
+ break;
+ case SES_OBJSTAT_UNRECOV:
+ sprintf(rbuf, "unrecoverable");
+ break;
+ case SES_OBJSTAT_NOTINSTALLED:
+ sprintf(rbuf, "not installed");
+ break;
+ case SES_OBJSTAT_UNKNOWN:
+ sprintf(rbuf, "unknown status");
+ break;
+ case SES_OBJSTAT_NOTAVAIL:
+ sprintf(rbuf, "status not available");
+ break;
+ default:
+ sprintf(rbuf, "unknown status code %x", code & 0xf);
+ break;
+ }
+ return (rbuf);
+}
+
+
+char *
+stat2ascii(eletype, cstat)
+ int eletype;
+ u_char *cstat;
+{
+ static char ebuf[256], *scode;
+
+ scode = scode2ascii(cstat[0]);
+ sprintf(ebuf, "Status=%s (bytes=0x%02x 0x%02x 0x%02x 0x%02x)",
+ scode, cstat[0], cstat[1], cstat[2], cstat[3]);
+ return (ebuf);
+}
diff --git a/share/examples/ses/srcs/getencstat.c b/share/examples/ses/srcs/getencstat.c
new file mode 100644
index 000000000000..bf45e576fb72
--- /dev/null
+++ b/share/examples/ses/srcs/getencstat.c
@@ -0,0 +1,155 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include SESINC
+
+extern char *geteltnm __P((int));
+extern char *stat2ascii __P((int, u_char *));
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ ses_object *objp;
+ ses_objstat ob;
+ int fd, nobj, f, i, verbose, quiet, errors;
+ u_char estat;
+
+ if (a < 2) {
+ fprintf(stderr, "usage: %s [ -v ] device [ device ... ]\n", *v);
+ return (1);
+ }
+ errors = quiet = verbose = 0;
+ if (strcmp(v[1], "-V") == 0) {
+ verbose = 2;
+ v++;
+ } else if (strcmp(v[1], "-v") == 0) {
+ verbose = 1;
+ v++;
+ } else if (strcmp(v[1], "-q") == 0) {
+ quiet = 1;
+ verbose = 0;
+ v++;
+ }
+ while (*++v) {
+
+ fd = open(*v, O_RDONLY);
+ if (fd < 0) {
+ perror(*v);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
+ perror("SESIOC_GETNOBJ");
+ (void) close(fd);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) {
+ perror("SESIOC_GETENCSTAT");
+ (void) close(fd);
+ continue;
+ }
+ if ((verbose == 0 || quiet == 1) && estat == 0) {
+ if (quiet == 0)
+ fprintf(stdout, "%s: Enclosure OK\n", *v);
+ (void) close(fd);
+ continue;
+ }
+ fprintf(stdout, "%s: Enclosure Status ", *v);
+ if (estat == 0) {
+ fprintf(stdout, "<OK");
+ } else {
+ errors++;
+ f = '<';
+ if (estat & SES_ENCSTAT_INFO) {
+ fprintf(stdout, "%cINFO", f);
+ f = ',';
+ }
+ if (estat & SES_ENCSTAT_NONCRITICAL) {
+ fprintf(stdout, "%cNONCRITICAL", f);
+ f = ',';
+ }
+ if (estat & SES_ENCSTAT_CRITICAL) {
+ fprintf(stdout, "%cCRITICAL", f);
+ f = ',';
+ }
+ if (estat & SES_ENCSTAT_UNRECOV) {
+ fprintf(stdout, "%cUNRECOV", f);
+ f = ',';
+ }
+ }
+ fprintf(stdout, ">\n");
+ objp = calloc(nobj, sizeof (ses_object));
+ if (objp == NULL) {
+ perror("calloc");
+ (void) close(fd);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) {
+ perror("SESIOC_GETOBJMAP");
+ (void) close(fd);
+ continue;
+ }
+ for (i = 0; i < nobj; i++) {
+ ob.obj_id = objp[i].obj_id;
+ if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) {
+ perror("SESIOC_GETOBJSTAT");
+ (void) close(fd);
+ break;
+ }
+ if ((ob.cstat[0] & 0xf) == SES_OBJSTAT_OK) {
+ if (verbose) {
+ fprintf(stdout,
+ "Element 0x%x: %s OK (%s)\n",
+ ob.obj_id,
+ geteltnm(objp[i].object_type),
+ stat2ascii(objp[i].object_type,
+ ob.cstat));
+ }
+ continue;
+ }
+ fprintf(stdout, "Element 0x%x: %s, %s\n",
+ ob.obj_id, geteltnm(objp[i].object_type),
+ stat2ascii(objp[i].object_type, ob.cstat));
+ }
+ free(objp);
+ (void) close(fd);
+ }
+ return (errors);
+}
diff --git a/share/examples/ses/srcs/getnobj.c b/share/examples/ses/srcs/getnobj.c
new file mode 100644
index 000000000000..680a6cdbc173
--- /dev/null
+++ b/share/examples/ses/srcs/getnobj.c
@@ -0,0 +1,66 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ unsigned int nobj;
+ int fd;
+
+ while (*++argv != NULL) {
+ char *name = *argv;
+ fd = open(name, O_RDONLY);
+ if (fd < 0) {
+ perror(name);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
+ perror("SESIOC_GETNOBJ");
+ } else {
+ fprintf(stdout, "%s: %d objects\n", name, nobj);
+ }
+ close (fd);
+ }
+ return (0);
+}
diff --git a/share/examples/ses/srcs/getobjmap.c b/share/examples/ses/srcs/getobjmap.c
new file mode 100644
index 000000000000..7f4d1b783745
--- /dev/null
+++ b/share/examples/ses/srcs/getobjmap.c
@@ -0,0 +1,87 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+extern char *geteltnm __P((int));
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ ses_object *objp;
+ int nobj, fd, i;
+
+ while (*++v) {
+ fd = open(*v, O_RDONLY);
+ if (fd < 0) {
+ perror(*v);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) {
+ perror("SESIOC_GETNOBJ");
+ (void) close(fd);
+ continue;
+ }
+ fprintf(stdout, "%s: %d objects\n", *v, nobj);
+ if (nobj == 0) {
+ (void) close(fd);
+ continue;
+ }
+ objp = calloc(nobj, sizeof (ses_object));
+ if (objp == NULL) {
+ perror("calloc");
+ (void) close(fd);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) {
+ perror("SESIOC_GETOBJMAP");
+ (void) close(fd);
+ continue;
+ }
+ for (i = 0; i < nobj; i++) {
+ printf(" Object %d: ID 0x%x Type '%s'\n", i,
+ objp[i].obj_id, geteltnm((int)objp[i].object_type));
+ }
+ free(objp);
+ (void) close(fd);
+ }
+ return (0);
+}
diff --git a/share/examples/ses/srcs/getobjstat.c b/share/examples/ses/srcs/getobjstat.c
new file mode 100644
index 000000000000..bf703cf47ff4
--- /dev/null
+++ b/share/examples/ses/srcs/getobjstat.c
@@ -0,0 +1,76 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ int fd;
+ int i;
+ ses_objstat obj;
+ long cvt;
+ char *x;
+
+ if (a != 3) {
+usage:
+ fprintf(stderr, "usage: %s device objectid\n", *v);
+ return (1);
+ }
+ fd = open(v[1], O_RDONLY);
+ if (fd < 0) {
+ perror(v[1]);
+ return (1);
+ }
+ x = v[2];
+ cvt = strtol(v[2], &x, 0);
+ if (x == v[2]) {
+ goto usage;
+ }
+ obj.obj_id = cvt;
+ if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &obj) < 0) {
+ perror("SESIOC_GETOBJSTAT");
+ return (1);
+ }
+ fprintf(stdout, "Object 0x%x: 0x%x 0x%x 0x%x 0x%x\n", obj.obj_id,
+ obj.cstat[0], obj.cstat[1], obj.cstat[2], obj.cstat[3]);
+ (void) close(fd);
+ return (0);
+}
diff --git a/share/examples/ses/srcs/inienc.c b/share/examples/ses/srcs/inienc.c
new file mode 100644
index 000000000000..d6fb262ef7ee
--- /dev/null
+++ b/share/examples/ses/srcs/inienc.c
@@ -0,0 +1,61 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ int fd;
+
+ while (*++v) {
+ fd = open(*v, O_RDWR);
+ if (fd < 0) {
+ perror(*v);
+ continue;
+ }
+ if (ioctl(fd, SESIOC_INIT, NULL) < 0) {
+ perror("SESIOC_GETNOBJ");
+ }
+ (void) close(fd);
+ }
+ return (0);
+}
diff --git a/share/examples/ses/srcs/sesd.c b/share/examples/ses/srcs/sesd.c
new file mode 100644
index 000000000000..5262b639bfd4
--- /dev/null
+++ b/share/examples/ses/srcs/sesd.c
@@ -0,0 +1,165 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <syslog.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+#define ALLSTAT (SES_ENCSTAT_UNRECOV | SES_ENCSTAT_CRITICAL | \
+ SES_ENCSTAT_NONCRITICAL | SES_ENCSTAT_INFO)
+
+/*
+ * Monitor named SES devices and note (via syslog) any changes in status.
+ */
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ static char *usage =
+ "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n";
+ int fd, polltime, dev, devbase, nodaemon, bpri;
+ ses_encstat stat, *carray;
+
+ if (a < 2) {
+ fprintf(stderr, usage, *v);
+ return (1);
+ }
+
+ devbase = 1;
+
+ if (strcmp(v[1], "-d") == 0) {
+ nodaemon = 1;
+ devbase++;
+ } else {
+ nodaemon = 0;
+ }
+
+ if (a > 2 && strcmp(v[2], "-t") == 0) {
+ devbase += 2;
+ polltime = atoi(v[3]);
+ } else {
+ polltime = 30;
+ }
+
+ carray = malloc(a);
+ if (carray == NULL) {
+ perror("malloc");
+ return (1);
+ }
+ for (dev = devbase; dev < a; dev++)
+ carray[dev] = (ses_encstat) -1;
+
+ /*
+ * Check to make sure we can open all devices
+ */
+ for (dev = devbase; dev < a; dev++) {
+ fd = open(v[dev], O_RDWR);
+ if (fd < 0) {
+ perror(v[dev]);
+ return (1);
+ }
+ if (ioctl(fd, SESIOC_INIT, NULL) < 0) {
+ fprintf(stderr, "%s: SESIOC_INIT fails- %s\n",
+ v[dev], strerror(errno));
+ return (1);
+ }
+ (void) close(fd);
+ }
+ if (nodaemon == 0) {
+ if (daemon(0, 0) < 0) {
+ perror("daemon");
+ return (1);
+ }
+ openlog("sesd", LOG_CONS, LOG_USER);
+ } else {
+ openlog("sesd", LOG_CONS|LOG_PERROR, LOG_USER);
+ }
+
+ for (;;) {
+ for (dev = devbase; dev < a; dev++) {
+ char buf[128];
+ fd = open(v[dev], O_RDWR);
+ if (fd < 0) {
+ syslog(LOG_ERR, "%s: %m", v[dev]);
+ continue;
+ }
+
+ /*
+ * Get the actual current enclosure status.
+ */
+ if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) {
+ syslog(LOG_ERR,
+ "%s: SESIOC_GETENCSTAT- %m", v[dev]);
+ (void) close(fd);
+ continue;
+ }
+ (void) close(fd);
+
+ if (stat == carray[dev])
+ continue;
+
+ carray[dev] = stat;
+ if ((stat & ALLSTAT) == 0) {
+ syslog(LOG_NOTICE,
+ "%s: Enclosure Status OK", v[dev]);
+ }
+ if (stat & SES_ENCSTAT_INFO) {
+ syslog(LOG_INFO,
+ "%s: Enclosure Status Has Information",
+ v[dev]);
+ }
+ if (stat & SES_ENCSTAT_NONCRITICAL) {
+ syslog(LOG_WARNING,
+ "%s: Enclosure Non-Critical", v[dev]);
+ }
+ if (stat & SES_ENCSTAT_CRITICAL) {
+ syslog(LOG_CRIT,
+ "%s: Enclosure Critical", v[dev]);
+ }
+ if (stat & SES_ENCSTAT_UNRECOV) {
+ syslog(LOG_ALERT,
+ "%s: Enclosure Unrecoverable", v[dev]);
+ }
+ }
+ sleep(polltime);
+ }
+ /* NOTREACHED */
+}
diff --git a/share/examples/ses/srcs/setencstat.c b/share/examples/ses/srcs/setencstat.c
new file mode 100644
index 000000000000..58e0dafc1879
--- /dev/null
+++ b/share/examples/ses/srcs/setencstat.c
@@ -0,0 +1,68 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ int fd;
+ long val;
+ ses_encstat stat;
+
+ if (a != 3) {
+ fprintf(stderr, "usage: %s device enclosure_status\n", *v);
+ return (1);
+ }
+ fd = open(v[1], O_RDWR);
+ if (fd < 0) {
+ perror(v[1]);
+ return (1);
+ }
+
+ val = strtol(v[2], NULL, 0);
+ stat = (ses_encstat) val;
+ if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) {
+ perror("SESIOC_SETENCSTAT");
+ }
+ (void) close(fd);
+ return (0);
+}
diff --git a/share/examples/ses/srcs/setobjstat.c b/share/examples/ses/srcs/setobjstat.c
new file mode 100644
index 000000000000..34e8ea65d97a
--- /dev/null
+++ b/share/examples/ses/srcs/setobjstat.c
@@ -0,0 +1,83 @@
+/* $FreeBSD$ */
+/*
+ * Copyright (c) 2000 by Matthew Jacob
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * the GNU Public License ("GPL").
+ *
+ * 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.
+ *
+ * Matthew Jacob
+ * Feral Software
+ * mjacob@feral.com
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include SESINC
+
+int
+main(a, v)
+ int a;
+ char **v;
+{
+ int fd;
+ int i;
+ ses_objstat obj;
+ long cvt;
+ char *x;
+
+ if (a != 7) {
+usage:
+ fprintf(stderr,
+ "usage: %s device objectid stat0 stat1 stat2 stat3\n", *v);
+ return (1);
+ }
+ fd = open(v[1], O_RDWR);
+ if (fd < 0) {
+ perror(v[1]);
+ return (1);
+ }
+ x = v[2];
+ cvt = strtol(v[2], &x, 0);
+ if (x == v[2]) {
+ goto usage;
+ }
+ obj.obj_id = cvt;
+ for (i = 0; i < 4; i++) {
+ x = v[3 + i];
+ cvt = strtol(v[3 + i], &x, 0);
+ if (x == v[3 + i]) {
+ goto usage;
+ }
+ obj.cstat[i] = cvt;
+ }
+ if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) {
+ perror("SESIOC_SETOBJSTAT");
+ }
+ (void) close(fd);
+ return (0);
+}
diff --git a/share/examples/slattach/unit-command.sh b/share/examples/slattach/unit-command.sh
new file mode 100755
index 000000000000..9e97ffdcd696
--- /dev/null
+++ b/share/examples/slattach/unit-command.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+old_unit=$1
+new_unit=$2
+
+if [ $old_unit != -1 ]; then
+ ifconfig sl$old_unit delete down
+ if [ $new_unit == -1 ]; then
+ route delete default
+ fi
+fi
+
+if [ $new_unit != -1 ]; then
+ ifconfig sl$new_unit <address1> <address2>
+ if [ $old_unit == -1 ]; then
+ route add default <address2>
+ fi
+fi
diff --git a/share/examples/sliplogin/slip.hosts b/share/examples/sliplogin/slip.hosts
new file mode 100644
index 000000000000..b20d7c8b416f
--- /dev/null
+++ b/share/examples/sliplogin/slip.hosts
@@ -0,0 +1,16 @@
+# @(#)slip.hosts 8.1 (Berkeley) 6/6/93
+#
+# option(s) consist of the following: (see the sliplogin man page)
+# normal - no header compression
+# compress - compress headers
+# autocomp - compress headers if remote end allows it
+# noicmp - disable ICMP packets (such as 'ping' or 'traceroute' packets)
+#
+#login local-address remote-address netmask option(s)
+#------ ---------- ----------- ------- ---------
+Schez vangogh chez 0xffffff00 compress
+Sjun vangogh 128.32.130.36 0xffffff00 normal
+Sleconte vangogh leconte 0xffffff00 compress
+Sleeb vangogh leeb 0xffffff00 compress
+Smjk vangogh pissaro-sl 0xffffff00 noicmp
+Soxford vangogh oxford 0xffffff00 autocomp
diff --git a/share/examples/sliplogin/slip.login b/share/examples/sliplogin/slip.login
new file mode 100644
index 000000000000..81102280acba
--- /dev/null
+++ b/share/examples/sliplogin/slip.login
@@ -0,0 +1,18 @@
+#!/bin/sh -
+#
+# @(#)slip.login 8.1 (Berkeley) 6/6/93
+
+#
+# generic login file for a slip line. sliplogin invokes this with
+# the parameters:
+# 1 2 3 4 5 6 7-n
+# slipunit ttyspeed loginname local-addr remote-addr mask opt-args
+#
+# Delete any arp table entries for this site, just in case
+/usr/sbin/arp -d $5
+# Bringup the line
+/sbin/ifconfig sl$1 inet $4 $5 netmask $6
+# Answer ARP request for the SLIP client with our Ethernet addr
+# XXX - Must be filled in with the ethernet address of the local machine
+# /usr/sbin/arp -s $5 00:00:c0:50:b9:0a pub
+exit
diff --git a/share/examples/sliplogin/slip.logout b/share/examples/sliplogin/slip.logout
new file mode 100644
index 000000000000..b27fe09d0999
--- /dev/null
+++ b/share/examples/sliplogin/slip.logout
@@ -0,0 +1,14 @@
+#!/bin/sh -
+#
+# slip.logout
+
+#
+# logout file for a slip line. sliplogin invokes this with
+# the parameters:
+# 1 2 3 4 5 6 7-n
+# slipunit ttyspeed loginname local-addr remote-addr mask opt-args
+#
+/sbin/ifconfig sl$1 delete
+# Remove the ARP table entry for the host
+/usr/sbin/arp -d $5
+exit
diff --git a/share/examples/sliplogin/slip.slparms b/share/examples/sliplogin/slip.slparms
new file mode 100644
index 000000000000..a87c7c3cc7ba
--- /dev/null
+++ b/share/examples/sliplogin/slip.slparms
@@ -0,0 +1,12 @@
+#
+# Additional SLIP configuration (for all login names).
+# Use slip.slparms.<loginname> for particular login.
+#
+# Format:
+# keepalive [outfill [slunit]]
+# (seconds) (seconds) (number)
+#
+# Default values:
+# 0 0 <none>
+#
+600 300
diff --git a/share/examples/startslip/sldown.sh b/share/examples/startslip/sldown.sh
new file mode 100755
index 000000000000..1f342a47b0c9
--- /dev/null
+++ b/share/examples/startslip/sldown.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+/sbin/ifconfig $1 $2
+/sbin/route delete default
diff --git a/share/examples/startslip/slip.sh b/share/examples/startslip/slip.sh
new file mode 100755
index 000000000000..1a0c1ad7f831
--- /dev/null
+++ b/share/examples/startslip/slip.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+startslip -b 57600 -U ./slup.sh -D ./sldown.sh \
+ -s atd<phone1> -s atd<phone2> -s atd<phone3> \
+ -h -t 60 -w 2 -W 20 /dev/cuaa1 <login> <password>
diff --git a/share/examples/startslip/slup.sh b/share/examples/startslip/slup.sh
new file mode 100755
index 000000000000..79cded339558
--- /dev/null
+++ b/share/examples/startslip/slup.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+myname=<my.ip.address>
+gateway=<gateway.ip.address>
+netmask=255.255.255.248
+tune1="link0 -link2" # force headers compression
+tune2="mtu 296" # for FreeBSD 1.x host
+
+case $LINE in
+ 0) tune=$tune1;; # 1st phone connected
+ 1) tune=$tune2;; # 2nd phone connected
+ *) tune=;; # others
+esac
+
+/sbin/ifconfig $1 $2 $tune
+/sbin/ifconfig $1 inet $myname $gateway netmask $netmask
+/sbin/route add default $gateway
diff --git a/share/examples/sunrpc/Makefile b/share/examples/sunrpc/Makefile
new file mode 100644
index 000000000000..ff50a3b0af5e
--- /dev/null
+++ b/share/examples/sunrpc/Makefile
@@ -0,0 +1,25 @@
+#
+# @(#)Makefile 2.1 88/08/02 4.0 RPCSRC
+#
+#
+# Build all demo services
+#
+MAKE = make
+LIB=
+
+SUBDIR= dir msg sort
+
+all: ${SUBDIR}
+
+clean cleanup:
+ cd dir; $(MAKE) ${MFLAGS} cleanup
+ cd msg; $(MAKE) ${MFLAGS} cleanup
+ cd sort; $(MAKE) ${MFLAGS} cleanup
+
+install:
+ @echo "No installations done."
+
+${SUBDIR}: FRC
+ cd $@; $(MAKE) ${MFLAGS} LIB=$(LIB)
+
+FRC:
diff --git a/share/examples/sunrpc/dir/Makefile b/share/examples/sunrpc/dir/Makefile
new file mode 100644
index 000000000000..592c9d6861e9
--- /dev/null
+++ b/share/examples/sunrpc/dir/Makefile
@@ -0,0 +1,26 @@
+#
+# @(#)Makefile 2.1 88/08/02 4.0 RPCSRC
+#
+BIN = dir_svc rls
+GEN = dir_clnt.c dir_svc.c dir_xdr.c dir.h
+LIB = -lrpclib
+RPCCOM = rpcgen
+
+all: $(BIN)
+
+$(GEN): dir.x
+ $(RPCCOM) dir.x
+
+dir_svc: dir_proc.o dir_svc.o dir_xdr.o
+ $(CC) -o $@ dir_proc.o dir_svc.o dir_xdr.o $(LIB)
+
+rls: rls.o dir_clnt.o dir_xdr.o
+ $(CC) -o $@ rls.o dir_clnt.o dir_xdr.o $(LIB)
+
+rls.o: rls.c dir.h
+
+dir_proc.o: dir_proc.c dir.h
+
+clean cleanup:
+ rm -f $(GEN) *.o $(BIN)
+
diff --git a/share/examples/sunrpc/dir/dir.x b/share/examples/sunrpc/dir/dir.x
new file mode 100644
index 000000000000..db4283cbfe00
--- /dev/null
+++ b/share/examples/sunrpc/dir/dir.x
@@ -0,0 +1,37 @@
+/* @(#)dir.x 2.1 88/08/02 4.0 RPCSRC */
+/*
+ * dir.x: Remote directory listing protocol
+ */
+const MAXNAMELEN = 255; /* maximum length of a directory entry */
+
+typedef string nametype<MAXNAMELEN>; /* a directory entry */
+
+typedef struct namenode *namelist; /* a link in the listing */
+
+/*
+ * A node in the directory listing
+ */
+struct namenode {
+ nametype name; /* name of directory entry */
+ namelist next; /* next entry */
+};
+
+/*
+ * The result of a READDIR operation.
+ */
+union readdir_res switch (int errno) {
+case 0:
+ namelist list; /* no error: return directory listing */
+default:
+ void; /* error occurred: nothing else to return */
+};
+
+/*
+ * The directory program definition
+ */
+program DIRPROG {
+ version DIRVERS {
+ readdir_res
+ READDIR(nametype) = 1;
+ } = 1;
+} = 76;
diff --git a/share/examples/sunrpc/dir/dir_proc.c b/share/examples/sunrpc/dir/dir_proc.c
new file mode 100644
index 000000000000..46221a2163cd
--- /dev/null
+++ b/share/examples/sunrpc/dir/dir_proc.c
@@ -0,0 +1,55 @@
+/* @(#)dir_proc.c 2.1 88/08/02 4.0 RPCSRC */
+/*
+ * dir_proc.c: remote readdir implementation
+ */
+#include <rpc/rpc.h>
+#include <sys/dir.h>
+#include "dir.h"
+
+extern int errno;
+extern char *malloc();
+extern char *strcpy();
+
+readdir_res *
+readdir_1(dirname)
+ nametype *dirname;
+{
+ DIR *dirp;
+ struct direct *d;
+ namelist nl;
+ namelist *nlp;
+ static readdir_res res; /* must be static! */
+
+ /*
+ * Open directory
+ */
+ dirp = opendir(*dirname);
+ if (dirp == NULL) {
+ res.errno = errno;
+ return (&res);
+ }
+
+ /*
+ * Free previous result
+ */
+ xdr_free(xdr_readdir_res, &res);
+
+ /*
+ * Collect directory entries
+ */
+ nlp = &res.readdir_res_u.list;
+ while (d = readdir(dirp)) {
+ nl = *nlp = (namenode *) malloc(sizeof(namenode));
+ nl->name = malloc(strlen(d->d_name)+1);
+ strcpy(nl->name, d->d_name);
+ nlp = &nl->next;
+ }
+ *nlp = NULL;
+
+ /*
+ * Return the result
+ */
+ res.errno = 0;
+ closedir(dirp);
+ return (&res);
+}
diff --git a/share/examples/sunrpc/dir/rls.c b/share/examples/sunrpc/dir/rls.c
new file mode 100644
index 000000000000..aa7f79f91b57
--- /dev/null
+++ b/share/examples/sunrpc/dir/rls.c
@@ -0,0 +1,81 @@
+/* @(#)rls.c 2.2 88/08/12 4.0 RPCSRC */
+/*
+ * rls.c: Remote directory listing client
+ */
+#include <stdio.h>
+#include <rpc/rpc.h> /* always need this */
+#include "dir.h" /* need this too: will be generated by rpcgen*/
+
+extern int errno;
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ CLIENT *cl;
+ char *server;
+ char *dir;
+ readdir_res *result;
+ namelist nl;
+
+
+ if (argc != 3) {
+ fprintf(stderr, "usage: %s host directory\n", argv[0]);
+ exit(1);
+ }
+
+ /*
+ * Remember what our command line arguments refer to
+ */
+ server = argv[1];
+ dir = argv[2];
+
+ /*
+ * Create client "handle" used for calling DIRPROG on the
+ * server designated on the command line. We tell the rpc package
+ * to use the "tcp" protocol when contacting the server.
+ */
+ cl = clnt_create(server, DIRPROG, DIRVERS, "tcp");
+ if (cl == NULL) {
+ /*
+ * Couldn't establish connection with server.
+ * Print error message and die.
+ */
+ clnt_pcreateerror(server);
+ exit(1);
+ }
+
+ /*
+ * Call the remote procedure "readdir" on the server
+ */
+ result = readdir_1(&dir, cl);
+ if (result == NULL) {
+ /*
+ * An error occurred while calling the server.
+ * Print error message and die.
+ */
+ clnt_perror(cl, server);
+ exit(1);
+ }
+
+ /*
+ * Okay, we successfully called the remote procedure.
+ */
+ if (result->errno != 0) {
+ /*
+ * A remote system error occurred.
+ * Print error message and die.
+ */
+ errno = result->errno;
+ perror(dir);
+ exit(1);
+ }
+
+ /*
+ * Successfuly got a directory listing.
+ * Print it out.
+ */
+ for (nl = result->readdir_res_u.list; nl != NULL; nl = nl->next) {
+ printf("%s\n", nl->name);
+ }
+}
diff --git a/share/examples/sunrpc/msg/Makefile b/share/examples/sunrpc/msg/Makefile
new file mode 100644
index 000000000000..2f3f5ddf1655
--- /dev/null
+++ b/share/examples/sunrpc/msg/Makefile
@@ -0,0 +1,36 @@
+#
+# @(#)Makefile 2.1 88/08/11 4.0 RPCSRC
+#
+BIN = printmsg msg_svc rprintmsg
+GEN = msg_clnt.c msg_svc.c msg.h
+LIB = -lrpclib
+RPCCOM = rpcgen
+
+all: $(BIN)
+
+#
+# This is the non-networked version of the program
+#
+printmsg: printmsg.o
+ $(CC) -o $@ printmsg.o
+
+#
+# note: no xdr routines are generated here, due this service's
+# use of basic data types.
+#
+$(GEN): msg.x
+ $(RPCCOM) msg.x
+
+msg_svc: msg_proc.o msg_svc.o
+ $(CC) -o $@ msg_proc.o msg_svc.o $(LIB)
+
+rprintmsg: rprintmsg.o msg_clnt.o
+ $(CC) -o $@ rprintmsg.o msg_clnt.o $(LIB)
+
+rprintmsg.o: rprintmsg.c msg.h
+
+msg_proc.o: msg_proc.c msg.h
+
+clean cleanup:
+ rm -f $(GEN) *.o $(BIN)
+
diff --git a/share/examples/sunrpc/msg/msg.x b/share/examples/sunrpc/msg/msg.x
new file mode 100644
index 000000000000..d3113520d822
--- /dev/null
+++ b/share/examples/sunrpc/msg/msg.x
@@ -0,0 +1,9 @@
+/* @(#)msg.x 2.1 88/08/11 4.0 RPCSRC */
+/*
+ * msg.x: Remote message printing protocol
+ */
+program MESSAGEPROG {
+ version MESSAGEVERS {
+ int PRINTMESSAGE(string) = 1;
+ } = 1;
+} = 99;
diff --git a/share/examples/sunrpc/msg/msg_proc.c b/share/examples/sunrpc/msg/msg_proc.c
new file mode 100644
index 000000000000..ed088839e52a
--- /dev/null
+++ b/share/examples/sunrpc/msg/msg_proc.c
@@ -0,0 +1,30 @@
+/* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */
+/* $FreeBSD$ */
+/*
+ * msg_proc.c: implementation of the remote procedure "printmessage"
+ */
+#include <paths.h>
+#include <stdio.h>
+#include <rpc/rpc.h> /* always need this here */
+#include "msg.h" /* need this too: msg.h will be generated by rpcgen */
+
+/*
+ * Remote verson of "printmessage"
+ */
+int *
+printmessage_1(msg)
+ char **msg;
+{
+ static int result; /* must be static! */
+ FILE *f;
+
+ f = fopen(_PATH_CONSOLE, "w");
+ if (f == NULL) {
+ result = 0;
+ return (&result);
+ }
+ fprintf(f, "%s\n", *msg);
+ fclose(f);
+ result = 1;
+ return (&result);
+}
diff --git a/share/examples/sunrpc/msg/printmsg.c b/share/examples/sunrpc/msg/printmsg.c
new file mode 100644
index 000000000000..681007c4b1fe
--- /dev/null
+++ b/share/examples/sunrpc/msg/printmsg.c
@@ -0,0 +1,45 @@
+/* @(#)printmsg.c 2.1 88/08/11 4.0 RPCSRC */
+/* $FreeBSD$ */
+/*
+ * printmsg.c: print a message on the console
+ */
+#include <paths.h>
+#include <stdio.h>
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ char *message;
+
+ if (argc < 2) {
+ fprintf(stderr, "usage: %s <message>\n", argv[0]);
+ exit(1);
+ }
+ message = argv[1];
+
+ if (!printmessage(message)) {
+ fprintf(stderr, "%s: sorry, couldn't print your message\n",
+ argv[0]);
+ exit(1);
+ }
+ printf("Message delivered!\n");
+}
+
+/*
+ * Print a message to the console.
+ * Return a boolean indicating whether the message was actually printed.
+ */
+printmessage(msg)
+ char *msg;
+{
+ FILE *f;
+
+ f = fopen(_PATH_CONSOLE, "w");
+ if (f == NULL) {
+ return (0);
+ }
+ fprintf(f, "%s\n", msg);
+ fclose(f);
+ return(1);
+}
diff --git a/share/examples/sunrpc/msg/rprintmsg.c b/share/examples/sunrpc/msg/rprintmsg.c
new file mode 100644
index 000000000000..b9301de5e0d5
--- /dev/null
+++ b/share/examples/sunrpc/msg/rprintmsg.c
@@ -0,0 +1,74 @@
+/* @(#)rprintmsg.c 2.1 88/08/11 4.0 RPCSRC */
+/*
+ * rprintmsg.c: remote version of "printmsg.c"
+ */
+#include <stdio.h>
+#include <rpc/rpc.h> /* always need this */
+#include "msg.h" /* need this too: will be generated by rpcgen*/
+
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+ CLIENT *cl;
+ int *result;
+ char *server;
+ char *message;
+
+ if (argc < 3) {
+ fprintf(stderr, "usage: %s host message\n", argv[0]);
+ exit(1);
+ }
+
+ /*
+ * Remember what our command line arguments refer to
+ */
+ server = argv[1];
+ message = argv[2];
+
+ /*
+ * Create client "handle" used for calling MESSAGEPROG on the
+ * server designated on the command line. We tell the rpc package
+ * to use the "tcp" protocol when contacting the server.
+ */
+ cl = clnt_create(server, MESSAGEPROG, MESSAGEVERS, "tcp");
+ if (cl == NULL) {
+ /*
+ * Couldn't establish connection with server.
+ * Print error message and die.
+ */
+ clnt_pcreateerror(server);
+ exit(1);
+ }
+
+ /*
+ * Call the remote procedure "printmessage" on the server
+ */
+ result = printmessage_1(&message, cl);
+ if (result == NULL) {
+ /*
+ * An error occurred while calling the server.
+ * Print error message and die.
+ */
+ clnt_perror(cl, server);
+ exit(1);
+ }
+
+ /*
+ * Okay, we successfully called the remote procedure.
+ */
+ if (*result == 0) {
+ /*
+ * Server was unable to print our message.
+ * Print error message and die.
+ */
+ fprintf(stderr, "%s: sorry, %s couldn't print your message\n",
+ argv[0], server);
+ exit(1);
+ }
+
+ /*
+ * The message got printed on the server's console
+ */
+ printf("Message delivered to %s!\n", server);
+}
diff --git a/share/examples/sunrpc/sort/Makefile b/share/examples/sunrpc/sort/Makefile
new file mode 100644
index 000000000000..07627fafbe39
--- /dev/null
+++ b/share/examples/sunrpc/sort/Makefile
@@ -0,0 +1,36 @@
+#
+# @(#)Makefile 2.1 88/08/11 4.0 RPCSRC
+#
+
+BIN = rsort sort_svc
+GEN = sort_clnt.c sort_svc.c sort_xdr.c sort.h
+LIB = -lrpclib
+RPCCOM = rpcgen
+
+all: $(BIN)
+
+rsort: rsort.o sort_clnt.o sort_xdr.o
+ $(CC) $(LDFLAGS) -o $@ rsort.o sort_clnt.o sort_xdr.o $(LIB)
+
+rsort.o: rsort.c sort.h
+
+sort_clnt.c:
+ $(RPCCOM) -l sort.x >$@
+
+sort_svc: sort_proc.o sort_svc.o sort_xdr.o
+ $(CC) $(LDFLAGS) -o $@ sort_proc.o sort_svc.o sort_xdr.o $(LIB)
+
+sort_proc.o: sort_proc.c sort.h
+
+sort_svc.c:
+ $(RPCCOM) -s udp sort.x >$@
+
+sort_xdr.c:
+ $(RPCCOM) -c sort.x >$@
+
+sort.h:
+ $(RPCCOM) -h sort.x >$@
+
+clean cleanup:
+ rm -f $(GEN) *.o $(BIN)
+
diff --git a/share/examples/sunrpc/sort/rsort.c b/share/examples/sunrpc/sort/rsort.c
new file mode 100644
index 000000000000..5c05ad7f42cc
--- /dev/null
+++ b/share/examples/sunrpc/sort/rsort.c
@@ -0,0 +1,43 @@
+/* @(#)rsort.c 2.1 88/08/11 4.0 RPCSRC */
+/*
+ * rsort.c
+ * Client side application which sorts argc, argv.
+ */
+#include <stdio.h>
+#include <rpc/rpc.h>
+#include "sort.h"
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ char *machinename;
+ struct sortstrings args, res;
+ int i;
+
+ if (argc < 3) {
+ fprintf(stderr, "usage: %s machinename [s1 ...]\n", argv[0]);
+ exit(1);
+ }
+ machinename = argv[1];
+ args.ss.ss_len = argc - 2; /* substract off progname, machinename */
+ args.ss.ss_val = &argv[2];
+ res.ss.ss_val = (char **)NULL;
+
+ if ((i = callrpc(machinename, SORTPROG, SORTVERS, SORT,
+ xdr_sortstrings, &args, xdr_sortstrings, &res)))
+ {
+ fprintf(stderr, "%s: call to sort service failed. ", argv[0]);
+ clnt_perrno(i);
+ fprintf(stderr, "\n");
+ exit(1);
+ }
+
+ for (i = 0; i < res.ss.ss_len; i++) {
+ printf("%s\n", res.ss.ss_val[i]);
+ }
+
+ /* should free res here */
+ exit(0);
+}
+
diff --git a/share/examples/sunrpc/sort/sort.x b/share/examples/sunrpc/sort/sort.x
new file mode 100644
index 000000000000..629110cdf33a
--- /dev/null
+++ b/share/examples/sunrpc/sort/sort.x
@@ -0,0 +1,19 @@
+/* @(#)sort.x 2.1 88/08/11 4.0 RPCSRC */
+/*
+ * The sort procedure receives an array of strings and returns an array
+ * of strings. This toy service handles a maximum of 64 strings.
+ */
+const MAXSORTSIZE = 64;
+const MAXSTRINGLEN = 64;
+
+typedef string str<MAXSTRINGLEN>; /* the string itself */
+
+struct sortstrings {
+ str ss<MAXSORTSIZE>;
+};
+
+program SORTPROG {
+ version SORTVERS {
+ sortstrings SORT(sortstrings) = 1;
+ } = 1;
+} = 22855;
diff --git a/share/examples/sunrpc/sort/sort_proc.c b/share/examples/sunrpc/sort/sort_proc.c
new file mode 100644
index 000000000000..5538faf7ea03
--- /dev/null
+++ b/share/examples/sunrpc/sort/sort_proc.c
@@ -0,0 +1,27 @@
+/* @(#)sort_proc.c 2.1 88/08/11 4.0 RPCSRC */
+#include <rpc/rpc.h>
+#include "sort.h"
+
+static int
+comparestrings(sp1, sp2)
+ char **sp1, **sp2;
+{
+ return (strcmp(*sp1, *sp2));
+}
+
+struct sortstrings *
+sort_1(ssp)
+ struct sortstrings *ssp;
+{
+ static struct sortstrings ss_res;
+
+ if (ss_res.ss.ss_val != (str *)NULL)
+ free(ss_res.ss.ss_val);
+
+ qsort(ssp->ss.ss_val, ssp->ss.ss_len, sizeof (char *), comparestrings);
+ ss_res.ss.ss_len = ssp->ss.ss_len;
+ ss_res.ss.ss_val = (str *)malloc(ssp->ss.ss_len * sizeof(str *));
+ bcopy(ssp->ss.ss_val, ss_res.ss.ss_val,
+ ssp->ss.ss_len * sizeof(str *));
+ return(&ss_res);
+}
diff --git a/share/examples/worm/README b/share/examples/worm/README
new file mode 100644
index 000000000000..a6657b996af5
--- /dev/null
+++ b/share/examples/worm/README
@@ -0,0 +1,15 @@
+These two shell scripts are what the developers use to burn CDs,
+including the FreeBSD releases made for Walnut Creek CDROM.
+
+makecdfs.sh is used to turn an arbitrary tree of files into a single
+ISO9660 (with RockRidge extensions) filesystem image. See the top
+of the shell script for usage instructions.
+
+burncd.sh takes the filesystem image produced by makecdfs.sh and burns
+it onto a CDR drive. If you want to simply test your CDR without wasting
+a blank, you can also do:
+
+ burncd.sh mybigtestimage dummy
+
+And it will "write" the CD without the laser turned on, so that it's
+actually untouched.
diff --git a/share/examples/worm/makecdfs.sh b/share/examples/worm/makecdfs.sh
new file mode 100755
index 000000000000..95e53c5f4734
--- /dev/null
+++ b/share/examples/worm/makecdfs.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# usage: makecdfs "cd title" input-tree output-file "copyright string"
+#
+# For example:
+#
+# makecdfs FreeBSD-2.1.5 /a/cdrom-dist /a/cdimage.cd0 "Walnut Creek CDROM \
+# 1-510-674-0783 FAX 1-510-674-0821"
+
+if [ "$1" = "-b" ]; then
+ bootable="-b floppies/boot.flp -c floppies/boot.catalog"
+ shift
+else
+ bootable=""
+fi
+
+if [ $# -lt 4 ]; then
+ echo "usage: $0 \"cd-title\" input-tree output-file \"copyright\""
+elif [ ! -d $2 ]; then
+ echo "$0: $2 is not a directory tree."
+else
+ title="$1"; shift
+ tree=$1; shift
+ outfile=$1; shift
+ copyright="$*"
+ mkisofs $bootable -d -N -D -R -T -V "$title" -P "$copyright" -o $outfile $tree
+fi