Index: head/etc/mtree/BSD.include.dist =================================================================== --- head/etc/mtree/BSD.include.dist (revision 179307) +++ head/etc/mtree/BSD.include.dist (revision 179308) @@ -1,303 +1,292 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . altq .. arpa .. bsm .. bsnmp .. c++ 4.2 backward .. bits .. debug .. ext pb_ds detail basic_tree_policy .. bin_search_tree_ .. binary_heap_ .. binomial_heap_ .. binomial_heap_base_ .. cc_hash_table_map_ .. eq_fn .. gp_hash_table_map_ .. hash_fn .. left_child_next_sibling_heap_ .. list_update_map_ .. list_update_policy .. ov_tree_map_ .. pairing_heap_ .. pat_trie_ .. rb_tree_map_ .. rc_binomial_heap_ .. resize_policy .. splay_tree_ .. thin_heap_ .. tree_policy .. trie_policy .. unordered_iterator .. .. .. .. tr1 .. .. .. cam scsi .. .. crypto .. dev acpica .. an .. bktr .. firewire .. hwpmc .. ic .. ieee488 .. iicbus .. lmc .. mpt mpilib .. .. ofw .. pbio .. powermac_nvram .. ppbus .. smbus .. speaker .. usb .. utopia .. vkbd .. wi .. .. fs devfs .. fdescfs .. fifofs .. msdosfs .. ntfs .. nullfs .. nwfs .. portalfs .. procfs .. smbfs .. udf .. unionfs .. .. geom cache .. concat .. eli .. gate .. journal .. label .. mirror .. multipath .. nop .. raid3 .. shsec .. stripe .. virstor .. .. gnu posix .. .. gpib .. gssapi .. i4b .. isofs cd9660 .. .. kadm5 .. libmilter .. lwres .. machine pc .. .. net .. net80211 .. netatalk .. -# Disabled in 7.0 as netatm is not MPSAFE. -# netatm -# ipatm -# .. -# sigpvc -# .. -# spans -# .. -# uni -# .. -# .. netgraph atm .. bluetooth include .. .. netflow .. .. netinet .. netinet6 .. netipsec .. netipx .. netnatm api .. msg .. saal .. sig .. .. netncp .. netsmb .. nfs .. nfsclient .. nfsserver .. objc .. openssl .. pccard .. protocols .. readline .. rpc .. rpcsvc .. security audit .. mac_biba .. mac_bsdextended .. mac_lomac .. mac_mls .. mac_partition .. .. ssp .. sys .. ufs ffs .. ufs .. .. vm .. .. Index: head/etc/mtree/BSD.usr.dist =================================================================== --- head/etc/mtree/BSD.usr.dist (revision 179307) +++ head/etc/mtree/BSD.usr.dist (revision 179308) @@ -1,1237 +1,1234 @@ # $FreeBSD$ # # Please see the file src/etc/mtree/README before making changes to this file. # /set type=dir uname=root gname=wheel mode=0755 . bin .. games .. include .. lib aout .. compat aout .. .. dtrace .. engines .. .. libdata gcc .. ldscripts .. lint .. .. libexec lpr ru .. .. sendmail .. sm.bin .. .. local .. obj nochange .. sbin .. share calendar de_DE.ISO8859-1 .. fr_FR.ISO8859-1 .. hr_HR.ISO8859-2 .. hu_HU.ISO8859-2 .. ru_RU.KOI8-R .. uk_UA.KOI8-U .. .. dict .. doc IPv6 .. atm .. bind9 arm .. misc .. .. legal intel_ipw .. intel_iwi .. intel_wpi .. .. ncurses .. ntp .. papers .. psd 01.cacm .. 02.implement .. 03.iosys .. 04.uprog .. 05.sysman .. 06.Clang .. 12.make .. 13.rcs .. 15.yacc .. 16.lex .. 17.m4 .. 18.gprof .. 20.ipctut .. 21.ipc .. 22.rpcgen .. 23.rpc .. 24.xdr .. 25.xdrrfc .. 26.rpcrfc .. 27.nfsrfc .. 28.cvs .. .. smm 01.setup .. 02.config .. 03.fsck .. 04.quotas .. 05.fastfs .. 06.nfs .. 07.lpd .. 08.sendmailop .. 11.timedop .. 12.timed .. 18.net .. .. usd 04.csh .. 07.mail .. 10.exref .. 11.edit .. 12.vi .. 13.viref .. 18.msdiffs .. 19.memacros .. 20.meref .. 21.troff .. 22.trofftut .. .. .. examples BSD_daemon .. FreeBSD_version .. IPv6 .. -# Disabled in 7.0 as netatm is not MPSAFE. -# atm -# .. bc .. bootforth .. cvs contrib .. .. cvsup .. dialog .. diskless .. drivers .. etc defaults .. .. find_interface .. hostapd .. ibcs2 .. ipfilter .. ipfw .. iscsi .. isdn contrib .. i4brunppp .. v21 .. .. kld cdev module .. test .. .. dyn_sysctl .. syscall module .. test .. .. .. libdialog .. libvgl .. mdoc .. netgraph bluetooth .. .. nwclient .. perfmon .. pf .. portal .. ppi .. ppp .. pppd .. printing .. scsi_target .. ses getencstat .. sesd .. setencstat .. setobjstat .. srcs .. .. slattach .. sliplogin .. smbfs print .. .. startslip .. sunrpc dir .. msg .. sort .. .. tcsh .. wpa_supplicant .. .. games fortune .. .. groff_font devX100 .. devX100-12 .. devX75 .. devX75-12 .. devascii .. devcp1047 .. devdvi .. devhtml .. devkoi8-r .. devlatin1 .. devlbp .. devlj4 .. devps .. devutf8 .. .. info .. isdn .. locale UTF-8 .. af_ZA.ISO8859-1 .. af_ZA.ISO8859-15 .. af_ZA.UTF-8 .. am_ET.UTF-8 .. be_BY.CP1131 .. be_BY.CP1251 .. be_BY.ISO8859-5 .. be_BY.UTF-8 .. bg_BG.CP1251 .. bg_BG.UTF-8 .. ca_ES.ISO8859-1 .. ca_ES.ISO8859-15 .. ca_ES.UTF-8 .. cs_CZ.ISO8859-2 .. cs_CZ.UTF-8 .. da_DK.ISO8859-1 .. da_DK.ISO8859-15 .. da_DK.UTF-8 .. de_AT.ISO8859-1 .. de_AT.ISO8859-15 .. de_AT.UTF-8 .. de_CH.ISO8859-1 .. de_CH.ISO8859-15 .. de_CH.UTF-8 .. de_DE.ISO8859-1 .. de_DE.ISO8859-15 .. de_DE.UTF-8 .. el_GR.ISO8859-7 .. el_GR.UTF-8 .. en_AU.ISO8859-1 .. en_AU.ISO8859-15 .. en_AU.US-ASCII .. en_AU.UTF-8 .. en_CA.ISO8859-1 .. en_CA.ISO8859-15 .. en_CA.US-ASCII .. en_CA.UTF-8 .. en_GB.ISO8859-1 .. en_GB.ISO8859-15 .. en_GB.US-ASCII .. en_GB.UTF-8 .. en_IE.UTF-8 .. en_NZ.ISO8859-1 .. en_NZ.ISO8859-15 .. en_NZ.US-ASCII .. en_NZ.UTF-8 .. en_US.ISO8859-1 .. en_US.ISO8859-15 .. en_US.US-ASCII .. en_US.UTF-8 .. es_ES.ISO8859-1 .. es_ES.ISO8859-15 .. es_ES.UTF-8 .. et_EE.ISO8859-15 .. et_EE.UTF-8 .. eu_ES.ISO8859-1 .. eu_ES.ISO8859-15 .. eu_ES.UTF-8 .. fi_FI.ISO8859-1 .. fi_FI.ISO8859-15 .. fi_FI.UTF-8 .. fr_BE.ISO8859-1 .. fr_BE.ISO8859-15 .. fr_BE.UTF-8 .. fr_CA.ISO8859-1 .. fr_CA.ISO8859-15 .. fr_CA.UTF-8 .. fr_CH.ISO8859-1 .. fr_CH.ISO8859-15 .. fr_CH.UTF-8 .. fr_FR.ISO8859-1 .. fr_FR.ISO8859-15 .. fr_FR.UTF-8 .. he_IL.UTF-8 .. hi_IN.ISCII-DEV .. hr_HR.ISO8859-2 .. hr_HR.UTF-8 .. hu_HU.ISO8859-2 .. hu_HU.UTF-8 .. hy_AM.ARMSCII-8 .. hy_AM.UTF-8 .. is_IS.ISO8859-1 .. is_IS.ISO8859-15 .. is_IS.UTF-8 .. it_CH.ISO8859-1 .. it_CH.ISO8859-15 .. it_CH.UTF-8 .. it_IT.ISO8859-1 .. it_IT.ISO8859-15 .. it_IT.UTF-8 .. ja_JP.SJIS .. ja_JP.UTF-8 .. ja_JP.eucJP .. kk_KZ.PT154 .. kk_KZ.UTF-8 .. ko_KR.CP949 .. ko_KR.UTF-8 .. ko_KR.eucKR .. la_LN.ISO8859-1 .. la_LN.ISO8859-15 .. la_LN.ISO8859-2 .. la_LN.ISO8859-4 .. la_LN.US-ASCII .. lt_LT.ISO8859-13 .. lt_LT.ISO8859-4 .. lt_LT.UTF-8 .. mn_MN.UTF-8 .. nb_NO.ISO8859-1 .. nb_NO.ISO8859-15 .. nb_NO.UTF-8 .. nl_BE.ISO8859-1 .. nl_BE.ISO8859-15 .. nl_BE.UTF-8 .. nl_NL.ISO8859-1 .. nl_NL.ISO8859-15 .. nl_NL.UTF-8 .. nn_NO.ISO8859-1 .. nn_NO.ISO8859-15 .. nn_NO.UTF-8 .. no_NO.ISO8859-1 .. no_NO.ISO8859-15 .. no_NO.UTF-8 .. pl_PL.ISO8859-2 .. pl_PL.UTF-8 .. pt_BR.ISO8859-1 .. pt_BR.UTF-8 .. pt_PT.ISO8859-1 .. pt_PT.ISO8859-15 .. pt_PT.UTF-8 .. ro_RO.ISO8859-2 .. ro_RO.UTF-8 .. ru_RU.CP1251 .. ru_RU.CP866 .. ru_RU.ISO8859-5 .. ru_RU.KOI8-R .. ru_RU.UTF-8 .. sk_SK.ISO8859-2 .. sk_SK.UTF-8 .. sl_SI.ISO8859-2 .. sl_SI.UTF-8 .. sr_YU.ISO8859-2 .. sr_YU.ISO8859-5 .. sr_YU.UTF-8 .. sv_SE.ISO8859-1 .. sv_SE.ISO8859-15 .. sv_SE.UTF-8 .. tr_TR.ISO8859-9 .. tr_TR.UTF-8 .. uk_UA.CP1251 .. uk_UA.ISO8859-5 .. uk_UA.KOI8-U .. uk_UA.UTF-8 .. zh_CN.GB18030 .. zh_CN.GB2312 .. zh_CN.GBK .. zh_CN.UTF-8 .. zh_CN.eucCN .. zh_HK.Big5HKSCS .. zh_HK.UTF-8 .. zh_TW.Big5 .. zh_TW.UTF-8 .. .. man /set uname=man cat1 .. cat1aout .. cat2 .. cat3 .. cat4 amd64 .. arm .. i386 .. powerpc .. sparc64 .. .. cat5 .. cat6 .. cat7 .. cat8 amd64 .. i386 .. powerpc .. sparc64 .. .. cat9 .. en.ISO8859-1 uname=root cat1 .. cat1aout .. cat2 .. cat3 .. cat4 amd64 .. arm .. i386 .. powerpc .. sparc64 .. .. cat5 .. cat6 .. cat7 .. cat8 amd64 .. i386 .. powerpc .. sparc64 .. .. cat9 .. .. ja uname=root cat1 .. cat2 .. cat3 .. cat4 .. cat5 .. cat6 .. cat7 .. cat8 .. cat9 .. /set uname=root man1 .. man2 .. man3 .. man4 .. man5 .. man6 .. man7 .. man8 .. man9 .. .. man1 .. man1aout .. man2 .. man3 .. man4 amd64 .. arm .. i386 .. powerpc .. sparc64 .. .. man5 .. man6 .. man7 .. man8 amd64 .. i386 .. powerpc .. sparc64 .. .. man9 .. .. me .. misc fonts .. .. mk .. nls C .. af_ZA.ISO8859-1 .. af_ZA.ISO8859-15 .. af_ZA.UTF-8 .. am_ET.UTF-8 .. be_BY.CP1131 .. be_BY.CP1251 .. be_BY.ISO8859-5 .. be_BY.UTF-8 .. bg_BG.CP1251 .. bg_BG.UTF-8 .. ca_ES.ISO8859-1 .. ca_ES.ISO8859-15 .. ca_ES.UTF-8 .. cs_CZ.ISO8859-2 .. cs_CZ.UTF-8 .. da_DK.ISO8859-1 .. da_DK.ISO8859-15 .. da_DK.UTF-8 .. de_AT.ISO8859-1 .. de_AT.ISO8859-15 .. de_AT.UTF-8 .. de_CH.ISO8859-1 .. de_CH.ISO8859-15 .. de_CH.UTF-8 .. de_DE.ISO8859-1 .. de_DE.ISO8859-15 .. de_DE.UTF-8 .. el_GR.ISO8859-7 .. el_GR.UTF-8 .. en_AU.ISO8859-1 .. en_AU.ISO8859-15 .. en_AU.US-ASCII .. en_AU.UTF-8 .. en_CA.ISO8859-1 .. en_CA.ISO8859-15 .. en_CA.US-ASCII .. en_CA.UTF-8 .. en_GB.ISO8859-1 .. en_GB.ISO8859-15 .. en_GB.US-ASCII .. en_GB.UTF-8 .. en_IE.UTF-8 .. en_NZ.ISO8859-1 .. en_NZ.ISO8859-15 .. en_NZ.US-ASCII .. en_NZ.UTF-8 .. en_US.ISO8859-1 .. en_US.ISO8859-15 .. en_US.UTF-8 .. es_ES.ISO8859-1 .. es_ES.ISO8859-15 .. es_ES.UTF-8 .. et_EE.ISO8859-15 .. et_EE.UTF-8 .. fi_FI.ISO8859-1 .. fi_FI.ISO8859-15 .. fi_FI.UTF-8 .. fr_BE.ISO8859-1 .. fr_BE.ISO8859-15 .. fr_BE.UTF-8 .. fr_CA.ISO8859-1 .. fr_CA.ISO8859-15 .. fr_CA.UTF-8 .. fr_CH.ISO8859-1 .. fr_CH.ISO8859-15 .. fr_CH.UTF-8 .. fr_FR.ISO8859-1 .. fr_FR.ISO8859-15 .. fr_FR.UTF-8 .. he_IL.UTF-8 .. hi_IN.ISCII-DEV .. hr_HR.ISO8859-2 .. hr_HR.UTF-8 .. hu_HU.ISO8859-2 .. hu_HU.UTF-8 .. hy_AM.ARMSCII-8 .. hy_AM.UTF-8 .. is_IS.ISO8859-1 .. is_IS.ISO8859-15 .. is_IS.UTF-8 .. it_CH.ISO8859-1 .. it_CH.ISO8859-15 .. it_CH.UTF-8 .. it_IT.ISO8859-1 .. it_IT.ISO8859-15 .. it_IT.UTF-8 .. ja_JP.SJIS .. ja_JP.UTF-8 .. ja_JP.eucJP .. kk_KZ.PT154 .. kk_KZ.UTF-8 .. ko_KR.CP949 .. ko_KR.UTF-8 .. ko_KR.eucKR .. la_LN.ISO8859-1 .. la_LN.ISO8859-15 .. la_LN.ISO8859-2 .. la_LN.ISO8859-4 .. la_LN.US-ASCII .. lt_LT.ISO8859-13 .. lt_LT.ISO8859-4 .. lt_LT.UTF-8 .. mn_MN.UTF-8 .. nl_BE.ISO8859-1 .. nl_BE.ISO8859-15 .. nl_BE.UTF-8 .. nl_NL.ISO8859-1 .. nl_NL.ISO8859-15 .. nl_NL.UTF-8 .. no_NO.ISO8859-1 .. no_NO.ISO8859-15 .. no_NO.UTF-8 .. pl_PL.ISO8859-2 .. pl_PL.UTF-8 .. pt_BR.ISO8859-1 .. pt_BR.UTF-8 .. pt_PT.ISO8859-1 .. pt_PT.ISO8859-15 .. pt_PT.UTF-8 .. ro_RO.ISO8859-2 .. ro_RO.UTF-8 .. ru_RU.CP1251 .. ru_RU.CP866 .. ru_RU.ISO8859-5 .. ru_RU.KOI8-R .. ru_RU.UTF-8 .. sk_SK.ISO8859-2 .. sk_SK.UTF-8 .. sl_SI.ISO8859-2 .. sl_SI.UTF-8 .. sr_YU.ISO8859-2 .. sr_YU.ISO8859-5 .. sr_YU.UTF-8 .. sv_SE.ISO8859-1 .. sv_SE.ISO8859-15 .. sv_SE.UTF-8 .. tr_TR.ISO8859-9 .. tr_TR.UTF-8 .. uk_UA.ISO8859-5 .. uk_UA.KOI8-U .. uk_UA.UTF-8 .. zh_CN.GB18030 .. zh_CN.GB2312 .. zh_CN.GBK .. zh_CN.UTF-8 .. zh_CN.eucCN .. zh_HK.Big5HKSCS .. zh_HK.UTF-8 .. zh_TW.Big5 .. zh_TW.UTF-8 .. .. openssl man /set uname=man cat1 .. cat3 .. en.ISO8859-1 uname=root cat1 .. cat3 .. .. /set uname=root man1 .. man3 .. .. .. security .. sendmail .. skel .. snmp defs .. mibs .. .. syscons fonts .. keymaps .. scrnmaps .. .. tabset .. tmac mdoc .. mm .. .. vi catalog .. .. zoneinfo Africa .. America Argentina .. Indiana .. Kentucky .. North_Dakota .. .. Antarctica .. Arctic .. Asia .. Atlantic .. Australia .. Etc .. Europe .. Indian .. Pacific .. SystemV .. .. .. src nochange .. .. Index: head/include/Makefile =================================================================== --- head/include/Makefile (revision 179307) +++ head/include/Makefile (revision 179308) @@ -1,323 +1,321 @@ # @(#)Makefile 8.2 (Berkeley) 1/4/94 # $FreeBSD$ # # Doing a "make install" builds /usr/include. .include CLEANFILES= osreldate.h version vers.c SUBDIR= arpa gssapi protocols rpcsvc rpc INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \ db.h \ dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \ fts.h ftw.h getopt.h glob.h grp.h gssapi.h \ histedit.h ieeefp.h ifaddrs.h \ inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \ locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \ ndbm.h netconfig.h \ netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \ printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ res_update.h resolv.h runetype.h search.h setjmp.h sgtty.h \ signal.h stab.h \ stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h tgmath.h \ time.h timeconv.h timers.h ttyent.h \ ulimit.h unistd.h utime.h utmp.h uuid.h varargs.h vis.h wchar.h \ wctype.h wordexp.h I4BHDRS=i4b_cause.h i4b_debug.h i4b_ioctl.h i4b_rbch_ioctl.h \ i4b_tel_ioctl.h i4b_trace.h MHDRS= float.h floatingpoint.h stdarg.h PHDRS= sched.h semaphore.h _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ termios.h ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ netipsec ${_netipx} netnatm ${_netncp} netsmb \ nfs nfsclient nfsserver \ pccard sys vm -#LDIRS+= netatm LSUBDIRS= cam/scsi \ dev/acpica dev/an dev/bktr dev/firewire dev/hwpmc \ dev/ic dev/iicbus ${_dev_ieee488} dev/lmc dev/ofw \ dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/fifofs fs/msdosfs fs/ntfs fs/nullfs \ ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/multipath geom/nop \ geom/raid3 geom/shsec geom/stripe geom/virstor \ netgraph/atm netgraph/netflow \ security/audit \ security/mac_biba security/mac_bsdextended security/mac_lomac \ security/mac_mls security/mac_partition \ ufs/ffs ufs/ufs -#LSUBDIRS+= netatm/ipatm netatm/sigpvc netatm/spans netatm/uni LSUBSUBDIRS= dev/mpt/mpilib .if ${MACHINE_ARCH} == "powerpc" _dev_powermac_nvram= dev/powermac_nvram .endif .if ${MK_GPIB} != "no" _dev_ieee488= dev/ieee488 .endif .if ${MK_HESIOD} != "no" INCS+= hesiod.h .endif .if ${MK_BLUETOOTH} != "no" LSUBSUBDIRS+= netgraph/bluetooth/include .endif # XXX unconditionally needed by #.if ${MK_IPX} != "no" _netipx= netipx #.endif .if ${MK_NCP} != "no" _netncp= netncp _fs_nwfs= fs/nwfs .endif # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''). ``symlinks'' is # probably only useful for developers and should be avoided if you do not # wish to tie your /usr/include and /usr/src together. #SHARED= symlinks SHARED?= copies INCS+= osreldate.h osreldate.h: ${.CURDIR}/../sys/conf/newvers.sh ${.CURDIR}/../sys/sys/param.h \ ${.CURDIR}/Makefile @${ECHO} creating osreldate.h from newvers.sh @MAKE=${MAKE}; \ PARAMFILE=${.CURDIR}/../sys/sys/param.h; \ . ${.CURDIR}/../sys/conf/newvers.sh; \ echo "$$COPYRIGHT" > osreldate.h; \ echo "#ifdef _KERNEL" >> osreldate.h; \ echo "#error \" cannot be used in the kernel, use \"" >> osreldate.h; \ echo "#else" >> osreldate.h; \ echo "#undef __FreeBSD_version" >> osreldate.h; \ echo "#define __FreeBSD_version $$RELDATE" >> osreldate.h; \ echo "#endif" >> osreldate.h .for i in ${LHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor .for i in ${MHDRS} INCSLINKS+= machine/$i ${INCLUDEDIR}/$i .endfor .for i in ${PHDRS} INCSLINKS+= sys/$i ${INCLUDEDIR}/$i .endfor .if ${MACHINE} != ${MACHINE_ARCH} _MARCH=${MACHINE_ARCH} .endif .include installincludes: ${SHARED} ${SHARED}: compat # Take care of stale directory-level symlinks. compat: .for i in ${LDIRS} ${LSUBDIRS} machine ${_MARCH} crypto if [ -L ${DESTDIR}${INCLUDEDIR}/$i ]; then \ rm -f ${DESTDIR}${INCLUDEDIR}/$i; \ fi .endfor mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../etc/mtree/BSD.include.dist \ -p ${DESTDIR}${INCLUDEDIR} .if ${MK_BIND_LIBS} != "no" mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../etc/mtree/BIND.include.dist \ -p ${DESTDIR}${INCLUDEDIR} .endif copies: .for i in ${LDIRS} ${LSUBDIRS} ${LSUBSUBDIRS} altq crypto machine machine/pc \ ${_MARCH} .if exists(${DESTDIR}${INCLUDEDIR}/$i) cd ${DESTDIR}${INCLUDEDIR}/$i; \ for h in *.h; do \ if [ -L $$h ]; then rm -f $$h; fi; \ done .endif .endfor .for i in ${LDIRS} ${LSUBDIRS:Ndev/acpica:Ndev/bktr} ${LSUBSUBDIRS} cd ${.CURDIR}/../sys; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \ ${DESTDIR}${INCLUDEDIR}/$i .endfor cd ${.CURDIR}/../sys/dev/acpica; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 acpiio.h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica cd ${.CURDIR}/../sys/dev/bktr; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ioctl_*.h \ ${DESTDIR}${INCLUDEDIR}/dev/bktr cd ${.CURDIR}/../sys/contrib/altq/altq; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/altq cd ${.CURDIR}/../sys/fs/cd9660/; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/isofs/cd9660 .if ${MK_IPFILTER} != "no" cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/netinet .endif cd ${.CURDIR}/../sys/contrib/pf/net; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/net cd ${.CURDIR}/../sys/crypto; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 rijndael/rijndael.h \ ${DESTDIR}${INCLUDEDIR}/crypto .if ${MACHINE_ARCH} == "i386" .if ${MK_I4B} != "no" cd ${.CURDIR}/../sys/i4b/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${I4BHDRS} \ ${DESTDIR}${INCLUDEDIR}/i4b .endif .endif cd ${.CURDIR}/../sys/opencrypto; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/crypto cd ${.CURDIR}/../sys/${MACHINE}/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/machine .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/machine/pc .endif .if defined(_MARCH) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH} .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc .endif .endif cd ${.CURDIR}/../sys/rpc; \ ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 types.h \ ${DESTDIR}${INCLUDEDIR}/rpc symlinks: @${ECHO} "Setting up symlinks to kernel source tree..." .for i in ${LDIRS} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor .for i in ${LSUBDIRS:Ndev/acpica:Ndev/bktr} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor cd ${.CURDIR}/../sys/dev/acpica; \ for h in acpiio.h; do \ ln -fs ../../../../sys/dev/acpica/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/acpica; \ done cd ${.CURDIR}/../sys/dev/bktr; \ for h in ioctl_*.h; do \ ln -fs ../../../../sys/dev/bktr/$$h \ ${DESTDIR}${INCLUDEDIR}/dev/bktr; \ done .for i in ${LSUBSUBDIRS} cd ${.CURDIR}/../sys/$i; \ for h in *.h; do \ ln -fs ../../../../../sys/$i/$$h ${DESTDIR}${INCLUDEDIR}/$i; \ done .endfor cd ${.CURDIR}/../sys/contrib/altq/altq; \ for h in *.h; do \ ln -fs ../../../sys/contrib/altq/altq/$$h \ ${DESTDIR}${INCLUDEDIR}/altq; \ done .if ${MK_IPFILTER} != "no" cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \ for h in *.h; do \ ln -fs ../../../sys/contrib/ipfilter/netinet/$$h \ ${DESTDIR}${INCLUDEDIR}/netinet; \ done .endif cd ${.CURDIR}/../sys/contrib/pf/net; \ for h in *.h; do \ ln -fs ../../../sys/contrib/pf/net/$$h \ ${DESTDIR}${INCLUDEDIR}/net; \ done cd ${.CURDIR}/../sys/crypto; \ for h in rijndael/rijndael.h; do \ ln -fs ../../../sys/crypto/$$h \ ${DESTDIR}${INCLUDEDIR}/crypto; \ done cd ${.CURDIR}/../sys/i4b/include; \ for h in ${I4BHDRS}; do \ ln -fs ../../../sys/i4b/include/$$h \ ${DESTDIR}${INCLUDEDIR}/i4b; \ done cd ${.CURDIR}/../sys/opencrypto; \ for h in *.h; do \ ln -fs ../../../sys/opencrypto/$$h \ ${DESTDIR}${INCLUDEDIR}/crypto; \ done cd ${.CURDIR}/../sys/${MACHINE}/include; \ for h in *.h; do \ ln -fs ../../../sys/${MACHINE}/include/$$h \ ${DESTDIR}${INCLUDEDIR}/machine; \ done .if exists(${.CURDIR}/../sys/${MACHINE}/include/pc) cd ${.CURDIR}/../sys/${MACHINE}/include/pc; \ for h in *.h; do \ ln -fs ../../../../sys/${MACHINE}/include/pc/$$h \ ${DESTDIR}${INCLUDEDIR}/machine/pc; \ done .endif .if defined(_MARCH) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ cd ${.CURDIR}/../sys/${_MARCH}/include; \ for h in *.h; do \ ln -fs ../../../sys/${_MARCH}/include/$$h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}; \ done .if exists(${.CURDIR}/../sys/${_MARCH}/include/pc) ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ cd ${.CURDIR}/../sys/${_MARCH}/include/pc; \ for h in *.h; do \ ln -fs ../../../../sys/${_MARCH}/include/pc/$$h \ ${DESTDIR}${INCLUDEDIR}/${_MARCH}/pc; \ done .endif .endif cd ${.CURDIR}/../sys/fs/cd9660; \ for h in *.h; do \ ln -fs ../../../../sys/fs/cd9660/$$h \ ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \ done cd ${.CURDIR}/../sys/rpc; \ for h in types.h; do \ ln -fs ../../../sys/rpc/$$h \ ${DESTDIR}${INCLUDEDIR}/rpc; \ done Index: head/lib/libatm/cache_key.c =================================================================== --- head/lib/libatm/cache_key.c (revision 179307) +++ head/lib/libatm/cache_key.c (nonexistent) @@ -1,105 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * SCSP cache key computation - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "libatm.h" - -/* - * Compute an SCSP cache key - * - * Arguments: - * ap pointer to an Atm_addr with the ATM address - * ip pointer to a struct in_addr with the IP address - * ol the required length of the cache key - * op pointer to receive cache key - * - * Returns: - * none - * - */ -void -scsp_cache_key(const Atm_addr *ap, const struct in_addr *ip, int ol, char *op) -{ - int i, len; - char buff[32]; - unsigned char digest[16]; - MD5_CTX context; - - /* - * Initialize - */ - bzero(buff, sizeof(buff)); - - /* - * Copy the addresses into a buffer for MD5 computation - */ - len = sizeof(struct in_addr) + ap->address_length; - if (len > (int)sizeof(buff)) - len = sizeof(buff); - bcopy(ip, buff, sizeof(struct in_addr)); - bcopy(ap->address, &buff[sizeof(struct in_addr)], - len - sizeof(struct in_addr)); - - /* - * Compute the MD5 digest of the combined IP and ATM addresses - */ - MD5Init(&context); - MD5Update(&context, buff, len); - MD5Final(digest, &context); - - /* - * Fold the 16-byte digest to the required length - */ - bzero((caddr_t)op, ol); - for (i = 0; i < 16; i++) { - op[i % ol] = op[i % ol] ^ digest[i]; - } -} Property changes on: head/lib/libatm/cache_key.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/ioctl_subr.c =================================================================== --- head/lib/libatm/ioctl_subr.c (revision 179307) +++ head/lib/libatm/ioctl_subr.c (nonexistent) @@ -1,461 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * IOCTL subroutines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "libatm.h" - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -extern char *prog; - - -/* - * Issue an informational IOCTL - * - * The user fills out the opcode and any subtype information. This - * routine will allocate a buffer and issue the IOCTL. If the request - * fails because the buffer wasn't big enough, this routine will double - * the buffer size and retry the request repeatedly. The buffer must - * be freed by the caller. - * - * Arguments: - * req pointer to an ATM information request IOCTL structure - * buf_len length of buffer to be allocated - * - * Returns: - * -1 error encountered (reason in errno) - * int length of the returned VCC information - * - */ -ssize_t -do_info_ioctl(struct atminfreq *req, size_t buf_len) -{ - int rc, s; - caddr_t buf; - - /* - * Open a socket for the IOCTL - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - return(-1); - } - - /* - * Get memory for returned information - */ -mem_retry: - buf = malloc(buf_len); - if (buf == NULL) { - errno = ENOMEM; - return(-1); - } - bzero(buf, buf_len); - - /* - * Set the buffer address and length in the request - */ - req->air_buf_addr = buf; - req->air_buf_len = buf_len; - - /* - * Issue the IOCTL - */ - rc = ioctl(s, AIOCINFO, (caddr_t)req); - if (rc) { - free(buf); - if (errno == ENOSPC) { - buf_len = buf_len * 2; - goto mem_retry; - } - return(-1); - } - (void)close(s); - /* - * Set a pointer to the returned info in the request - * and return its length - */ - req->air_buf_addr = buf; - return(req->air_buf_len); -} - - -/* - * Get VCC information - * - * Arguments: - * intf pointer to interface name (or null string) - * vccp pointer to a pointer to a struct air_vcc_rsp for the - * address of the returned VCC information - * - * Returns: - * int length of the retuned VCC information - * - */ -ssize_t -get_vcc_info(const char *intf, struct air_vcc_rsp **vccp) -{ - size_t buf_len = sizeof(struct air_vcc_rsp) * 100; - struct atminfreq air; - - /* - * Initialize IOCTL request - */ - air.air_opcode = AIOCS_INF_VCC; - bzero(air.air_vcc_intf, sizeof(air.air_vcc_intf)); - if (intf != NULL && strlen(intf) != 0) - strncpy(air.air_vcc_intf, intf, IFNAMSIZ - 1); - - buf_len = do_info_ioctl(&air, buf_len); - - /* - * Return a pointer to the VCC info and its length - */ - *vccp = (struct air_vcc_rsp *)(void *)air.air_buf_addr; - return(buf_len); -} - - -/* - * Get subnet mask - * - * Arguments: - * intf pointer to an interface name - * mask pointer to a struct sockaddr_in to receive the mask - * - * Returns: - * 0 good completion - * -1 error - * - */ -int -get_subnet_mask(const char *intf, struct sockaddr_in *mask) -{ - int rc, s; - struct ifreq req; - struct sockaddr_in *ip_mask; - - /* - * Check parameters - */ - if (!intf || !mask || - strlen(intf) == 0 || - strlen(intf) > IFNAMSIZ-1) - return(-1); - - /* - * Open a socket for the IOCTL - */ - s = socket(AF_INET, SOCK_DGRAM, 0); - if (s < 0) - return(-1); - - /* - * Set up and issue the IOCTL - */ - bzero(&req, sizeof(req)); - strcpy(req.ifr_name, intf); - rc = ioctl(s, SIOCGIFNETMASK, (caddr_t)&req); - (void)close(s); - if (rc) - return(-1); - - /* - * Give the answer back to the caller - */ - ip_mask = (struct sockaddr_in *)(void *)&req.ifr_addr; - *mask = *ip_mask; - mask->sin_family = AF_INET; - - return(0); -} - - -/* - * Get an interface's MTU - * - * Arguments: - * intf pointer to an interface name - * mtu pointer to an int to receive the MTU - * - * Returns: - * >= 0 interface MTU - * -1 error - * - */ -int -get_mtu(const char *intf) -{ - int rc, s; - struct ifreq req; - - /* - * Check parameters - */ - if (!intf || strlen(intf) == 0 || - strlen(intf) > IFNAMSIZ-1) - return(-1); - - /* - * Open a socket for the IOCTL - */ - s = socket(AF_INET, SOCK_DGRAM, 0); - if (s < 0) - return(-1); - - /* - * Set up and issue the IOCTL - */ - bzero(&req, sizeof(req)); - strcpy(req.ifr_name, intf); - rc = ioctl(s, SIOCGIFMTU, (caddr_t)&req); - (void)close(s); - - /* - * Set the appropriate return value - */ - if (rc) - return(-1); - else - return(req.ifr_mtu); -} - - -/* - * Verify netif name - * - * This routine issues an IOCTL to check whether the passed string is - * a valid network interface name. - * - * Arguments: - * req pointer to an ATM information request IOCTL structure - * - * Returns: - * -1 error encountered - * FALSE (0) the string is not a NIF name - * TRUE (> 0) the string is a valid NIF name - * - */ -int -verify_nif_name(const char *name) -{ - int rc, s; - struct atminfreq air; - struct air_netif_rsp *nif_info; - - /* - * Check whether name is of a valid length - */ - if (strlen(name) > IFNAMSIZ - 1 || - strlen(name) < 1) { - return(FALSE); - } - - /* - * Open a socket for the IOCTL - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - return(-1); - } - - /* - * Get memory for returned information - */ - nif_info = malloc(sizeof(struct air_netif_rsp)); - if (nif_info == NULL) { - errno = ENOMEM; - return(-1); - } - bzero(nif_info, sizeof(struct air_netif_rsp)); - - /* - * Set up the request - */ - air.air_opcode = AIOCS_INF_NIF; - air.air_buf_addr = (caddr_t)nif_info; - air.air_buf_len = sizeof(struct air_netif_rsp); - bzero(air.air_netif_intf, sizeof(air.air_netif_intf)); - strcpy(air.air_netif_intf, name); - - /* - * Issue the IOCTL - */ - rc = ioctl(s, AIOCINFO, (caddr_t)&air); - free(nif_info); - (void)close(s); - - /* - * Base return value on IOCTL return code - */ - if (rc) - return(FALSE); - else - return(TRUE); -} - -/* - * Get Config information - * - * Arguments: - * intf pointer to interface name (or null string) - * cfgp pointer to a pointer to a struct air_cfg_rsp for the - * address of the returned Config information - * - * Returns: - * int length of returned Config information - * - */ -ssize_t -get_cfg_info(const char *intf, struct air_cfg_rsp **cfgp) -{ - size_t buf_len = sizeof(struct air_cfg_rsp) * 4; - struct atminfreq air; - - /* - * Initialize IOCTL request - */ - air.air_opcode = AIOCS_INF_CFG; - bzero ( air.air_cfg_intf, sizeof(air.air_cfg_intf)); - if ( intf != NULL && strlen(intf) != 0 ) - strncpy(air.air_cfg_intf, intf, IFNAMSIZ - 1); - - buf_len = do_info_ioctl ( &air, buf_len ); - - /* - * Return a pointer to the Config info and its length - */ - *cfgp = (struct air_cfg_rsp *)(void *)air.air_buf_addr; - return ( buf_len ); - -} - -/* - * Get Physical Interface information - * - * Arguments: - * intf pointer to interface name (or null string) - * intp pointer to a pointer to a struct air_cfg_rsp for the - * address of the returned Config information - * - * Returns: - * int length of returned Config information - * - */ -ssize_t -get_intf_info(const char *intf, struct air_int_rsp **intp) -{ - size_t buf_len = sizeof(struct air_int_rsp) * 4; - struct atminfreq air; - - /* - * Initialize IOCTL request - */ - air.air_opcode = AIOCS_INF_INT; - bzero ( air.air_int_intf, sizeof(air.air_int_intf)); - if ( intf != NULL && strlen(intf) != 0 ) - strncpy(air.air_int_intf, intf, IFNAMSIZ - 1); - - buf_len = do_info_ioctl ( &air, buf_len ); - - /* - * Return a pointer to the Physical Interface info and its length - */ - *intp = (struct air_int_rsp *)(void *)air.air_buf_addr; - return ( buf_len ); - -} - - -/* - * Get Netif information - * - * Arguments: - * intf pointer to interface name (or null string) - * netp pointer to a pointer to a struct air_netif_rsp for the - * address of the returned Netif information - * - * Returns: - * int length of returned Netif information - * - */ -ssize_t -get_netif_info(const char *intf, struct air_netif_rsp **netp) -{ - size_t buf_len = sizeof(struct air_netif_rsp) * 10; - struct atminfreq air; - - /* - * Initialize IOCTL request - */ - air.air_opcode = AIOCS_INF_NIF; - bzero ( air.air_int_intf, sizeof(air.air_int_intf) ); - if ( intf != NULL && strlen(intf) != 0 ) - strncpy(air.air_int_intf, intf, IFNAMSIZ - 1); - - buf_len = do_info_ioctl ( &air, buf_len ); - - /* - * Return a pointer to the Netif info and its length - */ - *netp = (struct air_netif_rsp *) air.air_buf_addr; - return ( buf_len ); - -} Property changes on: head/lib/libatm/ioctl_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/ip_addr.c =================================================================== --- head/lib/libatm/ip_addr.c (revision 179307) +++ head/lib/libatm/ip_addr.c (nonexistent) @@ -1,160 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * IP address utilities - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "libatm.h" - -/* - * Get IP address - * - * Return an IP address in a socket address structure, given a character - * string with a domain name or a dotted decimal number. - * - * Arguments: - * p pointer to a host name or IP address - * - * Returns: - * null error was encountered - * struct sockaddr_in * a pointer to a socket address with the - * requested IP address - * - */ -struct sockaddr_in * -get_ip_addr(const char *p) -{ - struct hostent *ip_host; - static struct sockaddr_in s; - - /* - * Get IP address of specified host name - */ - bzero(&s, sizeof(s)); - s.sin_family = AF_INET; - if (p[0] >= '0' && p[0] <= '9') { - /* - * IP address is in dotted decimal format - */ - if ((s.sin_addr.s_addr = inet_addr(p)) == INADDR_NONE) { - return((struct sockaddr_in *)0); - } - } else { - /* - * Host name is in domain name system format - */ - ip_host = gethostbyname(p); - if (!ip_host || - ip_host->h_addrtype != AF_INET) { - return((struct sockaddr_in *)0); - } - memcpy(&s.sin_addr.s_addr, ip_host->h_addr_list[0], - sizeof(s.sin_addr.s_addr)); - } - return(&s); -} - - -/* - * Format an IP address - * - * Return a text-formatted string with an IP address and domain name - * given a sockaddr_in with an IP address. - * - * Arguments: - * addr pointer to sockaddr_in with an IP address - * - * Returns: - * char * pointer to a text-formatted string - * - */ -const char * -format_ip_addr(const struct in_addr *addr) -{ - static char host_name[MAXHOSTNAMELEN + 18]; - char *ip_num; - struct hostent *ip_host; - - /* - * Initialize - */ - bzero(host_name, sizeof(host_name)); - - /* - * Check for a zero address - */ - if (!addr || addr->s_addr == 0) { - return("-"); - } - - /* - * Get address in dotted decimal format - */ - ip_num = inet_ntoa(*addr); - - /* - * Look up name in DNS - */ - ip_host = gethostbyaddr((const char *)addr, sizeof(addr), AF_INET); - if (ip_host && ip_host->h_name && strlen(ip_host->h_name)) { - /* - * Return host name followed by dotted decimal address - */ - snprintf(host_name, sizeof(host_name), "%s (%s)", - ip_host->h_name, ip_num); - return (host_name); - } else { - /* - * No host name -- just return dotted decimal address - */ - return(ip_num); - } -} Property changes on: head/lib/libatm/ip_addr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/libatm.h =================================================================== --- head/lib/libatm/libatm.h (revision 179307) +++ head/lib/libatm/libatm.h (nonexistent) @@ -1,117 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * User Space Library Functions - * ---------------------------- - * - * Library functions - * - */ - -#ifndef _HARP_LIBHARP_H -#define _HARP_LIBHARP_H - -/* - * Start a HARP user-space timer - * - * tp pointer to timer control block - * time number of seconds for timer to run - * fp pointer to function to call at expiration - */ -#define HARP_TIMER(tp, time, fp) \ -{ \ - (tp)->ht_ticks = (time); \ - (tp)->ht_mark = 0; \ - (tp)->ht_func = (fp); \ - LINK2HEAD((tp), Harp_timer, harp_timer_head, ht_next); \ -} - -/* - * Cancel a HARP user-space timer - * - * tp pointer to timer control block - */ -#define HARP_CANCEL(tp) \ -{ \ - UNLINK((tp), Harp_timer, harp_timer_head, ht_next); \ -} - - -/* - * HARP user-space timer control block - */ -struct harp_timer { - struct harp_timer *ht_next; /* Timer chain */ - int ht_ticks; /* Seconds till exp */ - int ht_mark; /* Processing flag */ - void (*ht_func)(struct harp_timer *); /* Function to call */ -}; -typedef struct harp_timer Harp_timer; - - -/* - * Externally-visible variables and functions - */ - -/* atm_addr.c */ -extern int get_hex_atm_addr(const char *, u_char *, int); -extern char *format_atm_addr(const Atm_addr *); - -/* cache_key.c */ -extern void scsp_cache_key(const Atm_addr *, - const struct in_addr *, int, char *); - -/* ioctl_subr.c */ -extern ssize_t do_info_ioctl(struct atminfreq *, size_t); -extern ssize_t get_vcc_info(const char *, struct air_vcc_rsp **); -extern int get_subnet_mask(const char *, struct sockaddr_in *); -extern int get_mtu(const char *); -extern int verify_nif_name(const char *); -extern ssize_t get_cfg_info(const char *, struct air_cfg_rsp **); -extern ssize_t get_intf_info(const char *, struct air_int_rsp **); -extern ssize_t get_netif_info(const char *, struct air_netif_rsp **); - -/* ip_addr.c */ -extern struct sockaddr_in *get_ip_addr(const char *); -extern const char *format_ip_addr(const struct in_addr *); - -/* ip_checksum.c */ -extern short ip_checksum(const char *, int); - -/* timer.c */ -extern Harp_timer *harp_timer_head; -extern int harp_timer_exec; -extern void timer_proc(void); -extern int init_timer(void); -extern int block_timer(void); -extern void enable_timer(int); - - -#endif /* _HARP_LIBHARP_H */ Property changes on: head/lib/libatm/libatm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/atm_addr.c =================================================================== --- head/lib/libatm/atm_addr.c (revision 179307) +++ head/lib/libatm/atm_addr.c (nonexistent) @@ -1,328 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#ifndef lint -#if 0 /* original (broken) import id */ -static char *RCSid = "@(#) $Id: atm_addr.c,v 1.1 1998/07/09 21:45:18 johnc Exp $"; -#endif -#endif -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * ATM address utility functions - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "libatm.h" - -extern char *prog; - -/* - * Get NSAP, NSAP prefix or MAC address - * - * Arguments: - * in pointer to an address in ASCII - * out pointer to a buffer for the converted address - * len the length of the output buffer - * - * Returns: - * 0 error in format - * len the length of the data in the output buffer - * - */ -int -get_hex_atm_addr(const char *in, u_char *out, int len) -{ - int c_type, c_value, i, out_len, state, val = 0; - - /* - * Character table - */ - static struct { - char c; - int type; - int value; - } char_table[] = { - {'.', 0, 0}, /* Type 0 -- period */ - {':', 0, 0}, /* Type 0 -- colon */ - {'0', 1, 0}, /* Type 1 -- hex digit */ - {'1', 1, 1}, - {'2', 1, 2}, - {'3', 1, 3}, - {'4', 1, 4}, - {'5', 1, 5}, - {'6', 1, 6}, - {'7', 1, 7}, - {'8', 1, 8}, - {'9', 1, 9}, - {'a', 1, 10}, - {'b', 1, 11}, - {'c', 1, 12}, - {'d', 1, 13}, - {'e', 1, 14}, - {'f', 1, 15}, - {'A', 1, 10}, - {'B', 1, 11}, - {'C', 1, 12}, - {'D', 1, 13}, - {'E', 1, 14}, - {'F', 1, 15}, - {'\0', 2, 0}, /* Type 2 -- end of input */ - }; - - /* - * State table - */ - static struct { - int action; - int state; - } state_table[3][3] = { - /* Period Hex End */ - { { 0, 0 }, { 1, 1 }, { 2, 0} }, /* Init */ - { { 4, 0 }, { 3, 2 }, { 4, 0} }, /* C1 */ - { { 0, 2 }, { 1, 1 }, { 2, 0} }, /* C2 */ - }; - - /* - * Initialize - */ - state = 0; - out_len = 0; - if (!strncasecmp(in, "0x", 2)) { - in += 2; - } - - /* - * Loop through input until state table says to return - */ - while (1) { - /* - * Get the character type and value - */ - for (i=0; char_table[i].c; i++) - if (char_table[i].c == *in) - break; - if (char_table[i].c != *in) - return(0); - c_type = char_table[i].type; - c_value = char_table[i].value; - - /* - * Process next character based on state and type - */ - switch(state_table[state][c_type].action) { - case 0: - /* - * Ignore the character - */ - break; - - case 1: - /* - * Save the character's value - */ - val = c_value; - break; - - case 2: - /* - * Return the assembled NSAP - */ - return(out_len); - - case 3: - /* - * Assemble and save the output byte - */ - val = val << 4; - val += c_value; - out[out_len] = (u_char) val; - out_len++; - if (out_len > len) - (void)fprintf(stderr, "%s() out_len > len (%d > %d)\n", - __func__, out_len, len); - - break; - - case 4: - /* - * Invalid input sequence - */ - return(0); - - default: - return(0); - } - - /* - * Set the next state and go on to the next character - */ - state = state_table[state][c_type].state; - in++; - } -} - - -/* - * Format an ATM address into a string - * - * Arguments: - * addr pointer to an atm address - * - * Returns: - * none - * - */ -char * -format_atm_addr(const Atm_addr *addr) -{ - int i; - const char *nsap_format; - const Atm_addr_nsap *atm_nsap; - const Atm_addr_e164 *atm_e164; - const Atm_addr_spans *atm_spans; - const Atm_addr_pvc *atm_pvc; - static char str[256]; - union { - int w; - char c[4]; - } u1, u2; - - static const char nsap_format_DCC[] = "0x%02x.%02x%02x.%02x.%02x%02x%02x.%02x%02x.%02x%02x.%02x%02x.%02x%02x%02x%02x%02x%02x.%02x"; - static const char nsap_format_ICD[] = "0x%02x.%02x%02x.%02x.%02x%02x%02x.%02x%02x.%02x%02x.%02x%02x.%02x%02x%02x%02x%02x%02x.%02x"; - static const char nsap_format_E164[] = "0x%02x.%02x%02x%02x%02x%02x%02x%02x%02x.%02x%02x.%02x%02x.%02x%02x%02x%02x%02x%02x.%02x"; - - /* - * Clear the returned string - */ - bzero(str, sizeof(str)); - strcpy(str, "-"); - - /* - * Print format is determined by address type - */ - switch (addr->address_format) { - case T_ATM_ENDSYS_ADDR: - atm_nsap = (const Atm_addr_nsap *)addr->address; - switch(atm_nsap->aan_afi) { - default: - case AFI_DCC: - nsap_format = nsap_format_DCC; - break; - case AFI_ICD: - nsap_format = nsap_format_ICD; - break; - case AFI_E164: - nsap_format = nsap_format_E164; - break; - } - sprintf(str, nsap_format, - atm_nsap->aan_afi, - atm_nsap->aan_afspec[0], - atm_nsap->aan_afspec[1], - atm_nsap->aan_afspec[2], - atm_nsap->aan_afspec[3], - atm_nsap->aan_afspec[4], - atm_nsap->aan_afspec[5], - atm_nsap->aan_afspec[6], - atm_nsap->aan_afspec[7], - atm_nsap->aan_afspec[8], - atm_nsap->aan_afspec[9], - atm_nsap->aan_afspec[10], - atm_nsap->aan_afspec[11], - atm_nsap->aan_esi[0], - atm_nsap->aan_esi[1], - atm_nsap->aan_esi[2], - atm_nsap->aan_esi[3], - atm_nsap->aan_esi[4], - atm_nsap->aan_esi[5], - atm_nsap->aan_sel); - break; - - case T_ATM_E164_ADDR: - atm_e164 = (const Atm_addr_e164 *)addr->address; - for(i=0; iaddress_length; i++) { - sprintf(&str[strlen(str)], "%c", - atm_e164->aae_addr[i]); - } - break; - - case T_ATM_SPANS_ADDR: - /* - * Print SPANS address as two words, xxxx.yyyy - */ - atm_spans = (const Atm_addr_spans *)addr->address; - u1.c[0] = atm_spans->aas_addr[0]; - u1.c[1] = atm_spans->aas_addr[1]; - u1.c[2] = atm_spans->aas_addr[2]; - u1.c[3] = atm_spans->aas_addr[3]; - - u2.c[0] = atm_spans->aas_addr[4]; - u2.c[1] = atm_spans->aas_addr[5]; - u2.c[2] = atm_spans->aas_addr[6]; - u2.c[3] = atm_spans->aas_addr[7]; - - if (!(u1.w == 0 && u2.w == 0)) - sprintf(str, "0x%08lx.%08lx", - (u_long)ntohl(u1.w), (u_long)ntohl(u2.w)); - break; - - case T_ATM_PVC_ADDR: - /* - * Print PVC as VPI, VCI - */ - atm_pvc = (const Atm_addr_pvc *)addr->address; - sprintf(str, "%d, %d", - ATM_PVC_GET_VPI(atm_pvc), - ATM_PVC_GET_VCI(atm_pvc)); - break; - - case T_ATM_ABSENT: - default: - break; - } - - return(str); -} Property changes on: head/lib/libatm/atm_addr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/ip_checksum.c =================================================================== --- head/lib/libatm/ip_checksum.c (revision 179307) +++ head/lib/libatm/ip_checksum.c (nonexistent) @@ -1,92 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * IP checksum computation - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "libatm.h" - -/* - * Compute an IP checksum - * - * This code was taken from RFC 1071. - * - * "The following "C" code algorithm computes the checksum with an inner - * loop that sums 16 bits at a time in a 32-bit accumulator." - * - * Arguments: - * addr pointer to the buffer whose checksum is to be computed - * count number of bytes to include in the checksum - * - * Returns: - * the computed checksum - * - */ -short -ip_checksum(const char *addr, int count) -{ - /* Compute Internet Checksum for "count" bytes - * beginning at location "addr". - */ - long sum = 0; - - while( count > 1 ) { - /* This is the inner loop */ - sum += ntohs(* (const unsigned short *)(const void *)addr); - addr += sizeof(unsigned short); - count -= sizeof(unsigned short); - } - - /* Add left-over byte, if any */ - if( count > 0 ) - sum += * (const unsigned char *) addr; - - /* Fold 32-bit sum to 16 bits */ - while (sum>>16) - sum = (sum & 0xffff) + (sum >> 16); - - return((short)~sum); -} Property changes on: head/lib/libatm/ip_checksum.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/timer.c =================================================================== --- head/lib/libatm/timer.c (revision 179307) +++ head/lib/libatm/timer.c (nonexistent) @@ -1,258 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * User Space Library Functions - * ---------------------------- - * - * Timer functions - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "libatm.h" - -Harp_timer *harp_timer_head; -int harp_timer_exec; - - -/* - * Process a HARP timer tick - * - * This function is called via the SIGALRM signal. It increments - * harp_timer_exec. The user should check this flag frequently and - * call timer_proc when it is set. - * - * Arguments: - * None - * - * Returns: - * None - * - */ -static void -timer_tick(void) -{ - /* - * Bump the timer flag - */ - harp_timer_exec++; -} - - -/* - * Process HARP timers - * - * This function is called after a SIGALRM signal is posted. It runs - * down the list of timer entries, calling the specified functions - * for any timers that have expired. - * - * Arguments: - * None - * - * Returns: - * None - * - */ -void -timer_proc(void) -{ - Harp_timer *htp; - void (*f)(Harp_timer *); - - /* - * Reset marks in all timers on the queue - */ - for (htp = harp_timer_head; htp; htp = htp->ht_next) { - htp->ht_mark = -1; - } - - /* - * Run through timer chain decrementing each timer. - * If an expired timer is found, take the timer block - * off the chain and call the specified function. A - * timer's action can result in other timers being - * cancelled (taken off the queue), so every time we - * call a user function, we start over from the top of - * the list. - */ -timer_cont: - for (htp = harp_timer_head; htp; htp = htp->ht_next) { - /* - * Make sure we only process each entry once and - * don't process entries that are put on the queue - * by user functions we call for this tick - */ - if (htp->ht_mark == -1) { - /* - * Decrement the timer and mark that we've - * processed the entry - */ - htp->ht_ticks -= harp_timer_exec; - htp->ht_mark = 1; - - /* - * Check whether the timer is expired - */ - if (htp->ht_ticks <= 0) { - /* - * Unlink the timer block and call - * the user function - */ - f = htp->ht_func; - UNLINK(htp, Harp_timer, harp_timer_head, - ht_next); - f(htp); - - /* - * Start over - */ - goto timer_cont; - } - } - } - - /* - * Reset the timer exec flag - */ - harp_timer_exec = 0; -} - - -/* - * Start the timer - * - * Set up the SIGALRM signal handler and set up the real-time - * timer to tick once per second. - * - * Arguments: - * None - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -init_timer() -{ - int rc = 0; - struct itimerval timeval; - - /* - * Clear the timer flag - */ - harp_timer_exec = 0; - - /* - * Set up signal handler - */ - if (signal(SIGALRM, (sig_t)timer_tick) == SIG_ERR) { - return(errno); - } - - /* - * Start timer - */ - timeval.it_value.tv_sec = 1; - timeval.it_value.tv_usec = 0; - timeval.it_interval.tv_sec = 1; - timeval.it_interval.tv_usec = 0; - - if (setitimer(ITIMER_REAL, &timeval, - (struct itimerval *)0) == -1) { - rc = errno; - (void)signal(SIGALRM, SIG_DFL); - } - - return(rc); -} - - -/* - * Block timers from firing - * - * Block the SIGALRM signal. - * - * Arguments: - * None - * - * Returns: - * mask the previous blocked signal mask - * - */ -int -block_timer() -{ - /* - * Block the SIGALRM signal - */ - return(sigblock(sigmask(SIGALRM))); -} - - -/* - * Re-enable timers - * - * Restore the signal mask (presumably one that was returned by - * block_timer). - * - * Arguments: - * mask the signal mask to be restored - * - * Returns: - * mask the previous blocked signal mask - * - */ -void -enable_timer(mask) - int mask; -{ - /* - * Set the signal mask - */ - sigsetmask(mask); - - return; -} Property changes on: head/lib/libatm/timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libatm/Makefile =================================================================== --- head/lib/libatm/Makefile (revision 179307) +++ head/lib/libatm/Makefile (nonexistent) @@ -1,41 +0,0 @@ -# =================================== -# 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. -# -# @(#) $Id: Makefile,v 1.5 1998/07/10 16:01:58 jpt Exp $ -# $FreeBSD$ - -LIB= atm -SHLIB_MAJOR= 5 -SHLIBDIR?= /lib -SRCS= atm_addr.c cache_key.c ioctl_subr.c ip_addr.c ip_checksum.c timer.c -INCS= libatm.h - -DPADD= ${LIBMD} -LDADD= -lmd - -.if ${MACHINE_ARCH} == "arm" -WARNS?= 3 -.else -WARNS?= 6 -.endif - -.include Property changes on: head/lib/libatm/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/Makefile =================================================================== --- head/lib/Makefile (revision 179307) +++ head/lib/Makefile (revision 179308) @@ -1,123 +1,121 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ .include # To satisfy shared library or ELF linkage when only the libraries being # built are visible: # # csu must be built before all shared libaries for ELF. # libc must be built before all other shared libraries. # libcom_err must be built before libkrb5 and libpam. # libcrypt must be built before libkrb5 and libpam. # libkvm must be built before libdevstat. # msun must be built before libg++ and libstdc++. # libmd must be built before libatm, libopie, libradius, and libtacplus. # ncurses must be built before libdialog, libedit and libreadline. # libnetgraph must be built before libbsnmp/modules/snmp_netgraph. # libopie must be built before libpam. # libradius must be built before libpam. # librpcsvc must be built before libpam. # libsbuf must be built before libcam. # libtacplus must be built before libpam. # libutil must be built before libpam. # libypclnt must be built before libpam. # # Otherwise, the SUBDIR list should be in alphabetical order. SUBDIR= ${_csu} libc libbsm libcom_err libcrypt libelf libkvm msun libmd \ ncurses libnetgraph libradius librpcsvc libsbuf libtacplus libutil \ ${_libypclnt} libalias libarchive ${_libatm} \ libbegemot ${_libbluetooth} libbsnmp libbz2 \ libcalendar libcam libcompat libdevinfo libdevstat libdisk \ libdwarf libedit libexpat libfetch libftpio libgeom ${_libgpib} \ ${_libgssapi} libipsec \ ${_libipx} libkiconv libmagic libmemstat ${_libmilter} ${_libmp} \ ${_libncp} ${_libngatm} libopie libpam libpcap \ libpmc libproc librt ${_libsdp} ${_libsm} ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} libstand libtelnet ${_libthr} libthread_db libufs \ libugidfw ${_libusbhid} ${_libvgl} libwrap liby libz ${_bind} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf .elif exists(${.CURDIR}/csu/${MACHINE_ARCH}/Makefile) _csu=csu/${MACHINE_ARCH} .else _csu=csu .endif .if ${MK_ATM} != "no" -# Disabled in 7.0 as netatm is not MPSAFE. -#_libatm= libatm _libngatm= libngatm .endif .if ${MK_BIND} != "no" _bind= bind .endif .if ${MK_BLUETOOTH} != "no" _libbluetooth= libbluetooth _libsdp= libsdp .endif .if ${MK_GSSAPI} != "no" _libgssapi= libgssapi .endif .if ${MK_IPX} != "no" _libipx= libipx .endif .if ${MACHINE_ARCH} == "i386" .if ${MK_NCP} != "no" _libncp= libncp .endif _libsmb= libsmb _libvgl= libvgl .endif .if ${MACHINE_ARCH} == "ia64" _libsmb= libsmb .endif .if ${MK_SENDMAIL} != "no" _libmilter= libmilter _libsm= libsm _libsmdb= libsmdb _libsmutil= libsmutil .endif .if ${MK_OPENSSL} != "no" _libmp= libmp .endif .if ${MACHINE_ARCH} == "amd64" .if ${MK_NCP} != "no" _libncp= libncp .endif _libsmb= libsmb .endif .if ${MACHINE_ARCH} == "powerpc" _libsmb= libsmb .endif .if ${MK_LIBTHR} != "no" _libthr= libthr .endif .if ${MK_USB} != "no" _libusbhid= libusbhid .endif .if ${MK_NIS} != "no" _libypclnt= libypclnt .endif .if ${MK_GPIB} != "no" _libgpib= libgpib .endif .include Index: head/rescue/rescue/Makefile =================================================================== --- head/rescue/rescue/Makefile (revision 179307) +++ head/rescue/rescue/Makefile (revision 179308) @@ -1,355 +1,352 @@ #$FreeBSD$ # @(#)Makefile 8.1 (Berkeley) 6/2/93 NO_MAN= .include PROG= rescue BINDIR?=/rescue # Shell scripts need #! line to be edited from /bin/sh to /rescue/sh SCRIPTS= nextboot_FIXED SCRIPTSNAME_nextboot_FIXED= nextboot nextboot_FIXED: ../../sbin/reboot/nextboot.sh sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET} CLEANFILES+= nextboot_FIXED SCRIPTS+= dhclient_FIXED SCRIPTSNAME_dhclient_FIXED= dhclient-script dhclient_FIXED: ../../sbin/dhclient/dhclient-script sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET} CLEANFILES+= dhclient_FIXED ################################################################# # # General notes: # # A number of Make variables are used to generate the crunchgen config file. # # CRUNCH_SRCDIRS: lists directories to search for included programs # CRUNCH_PROGS: lists programs to be included # CRUNCH_LIBS: libraries to link with # CRUNCH_BUILDOPTS: generic build options to be added to every program # # Special options can be specified for individual programs # CRUNCH_SRCDIR_$(P): base source directory for program $(P) # CRUNCH_BUILDOPTS_$(P): additional build options for $(P) # CRUNCH_ALIAS_$(P): additional names to be used for $(P) # # By default, any name appearing in CRUNCH_PROGS or CRUNCH_ALIAS_${P} # will be used to generate a hard link to the resulting binary. # Specific links can be suppressed by setting # CRUNCH_SUPPRESS_LINK_$(NAME) to 1. # # Define Makefile variable RESCUE CRUNCH_BUILDOPTS+= -DRESCUE # Define compile-time RESCUE symbol when compiling components CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE # An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk # rather than incorporating rescue-specific logic into standard files. #MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS} # Hackery: 'librescue' exists merely as a tool for appropriately # recompiling specific library entries. We _know_ they're needed, and # regular archive searching creates ugly library ordering problems. # Easiest fix: tell the linker to include them into the executable # first, so they are guaranteed to override the regular lib entries. # Note that if 'librescue' hasn't been compiled, we'll just get the # regular lib entries from libc and friends. CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o ################################################################### # Programs from stock /bin # # WARNING: Changing this list may require adjusting # /usr/include/paths.h as well! You were warned! # CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv pax ps pwd \ realpath rm rmdir setfacl sh stty sync test CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -lm -ltermcap -lutil .if ${MK_OPENSSL} != "no" CRUNCH_LIBS+= -lcrypto .endif # Additional options for specific programs CRUNCH_ALIAS_test= [ CRUNCH_ALIAS_sh= -sh # The -sh alias shouldn't appear in /rescue as a hard link CRUNCH_SUPPRESS_LINK_-sh= 1 CRUNCH_ALIAS_ln= link CRUNCH_ALIAS_rm= unlink CRUNCH_ALIAS_ed= red CRUNCH_PROGS_bin+= pkill CRUNCH_SRCDIR_pkill= ${.CURDIR}/../../usr.bin/pkill CRUNCH_ALIAS_pkill= pgrep .if ${MK_RCMDS} != "no" CRUNCH_PROGS_bin+= rcp .endif .if ${MK_TCSH} != "no" CRUNCH_PROGS_bin+= csh CRUNCH_ALIAS_csh= -csh tcsh -tcsh CRUNCH_SUPPRESS_LINK_-csh= 1 CRUNCH_SUPPRESS_LINK_-tcsh= 1 .endif ################################################################### # Programs from standard /sbin # # WARNING: Changing this list may require adjusting # /usr/include/paths.h as well! You were warned! # # Note that mdmfs have their own private 'pathnames.h' # headers in addition to the standard 'paths.h' header. # CRUNCH_SRCDIRS+= sbin CRUNCH_PROGS_sbin= atacontrol badsect \ camcontrol ccdconfig clri devfs dmesg dump \ dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb \ fsirand gbde geom ifconfig init \ kldconfig kldload kldstat kldunload ldconfig \ md5 mdconfig mdmfs mknod mount mount_cd9660 \ mount_msdosfs mount_nfs mount_ntfs mount_nullfs \ mount_udf mount_unionfs newfs \ newfs_msdos nos-tun ping reboot \ restore rcorder route routed rtquery rtsol savecore \ slattach spppcontrol startslip swapon sysctl tunefs umount .if ${MK_ATM} != "no" CRUNCH_PROGS_sbin+= atmconfig -# Disabled in 7.0 as netatm is not MPSAFE. -#CRUNCH_PROGS_sbin+= atm fore_dnld ilmid -#CRUNCH_LIBS+= -latm .endif .if ${MK_INET6_SUPPORT} != "no" CRUNCH_PROGS_sbin+= ping6 .endif .if ${MK_IPFILTER} != "no" CRUNCH_PROGS_sbin+= ipf .endif # crunchgen does not like C++ programs; this should be fixed someday # CRUNCH_PROGS+= devd CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec .if ${MK_IPX} != "no" CRUNCH_LIBS+= -lipx .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lreadline -lsbuf -lufs -lz .if ${MACHINE_ARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk CRUNCH_ALIAS_bsdlabel= disklabel #.if ${MK_NCP} != "no" #CRUNCH_PROGS+= mount_nwfs #CRUNCH_LIBS+= -lncp #.endif #CRUNCH_PROGS+= mount_smbfs #CRUNCH_LIBS+= -lsmb .endif .if ${MACHINE} == "pc98" CRUNCH_PROGS_sbin+= bsdlabel CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 .endif .if ${MACHINE_ARCH} == "ia64" CRUNCH_PROGS_sbin+= mca .endif .if ${MACHINE_ARCH} == "sparc64" CRUNCH_PROGS_sbin+= bsdlabel sunlabel .endif .if ${MACHINE_ARCH} == "amd64" CRUNCH_PROGS_sbin+= bsdlabel fdisk CRUNCH_ALIAS_bsdlabel= disklabel .endif CRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm CRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf CRUNCH_ALIAS_reboot= fastboot halt fasthalt CRUNCH_ALIAS_restore= rrestore CRUNCH_ALIAS_dump= rdump CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs CRUNCH_ALIAS_geom= glabel gpart # dhclient has historically been troublesome... CRUNCH_PROGS_sbin+= dhclient CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint ################################################################## # Programs from stock /usr/bin # CRUNCH_SRCDIRS+= usr.bin CRUNCH_PROGS_usr.bin= head mt sed tail tee CRUNCH_PROGS_usr.bin+= gzip CRUNCH_ALIAS_gzip= gunzip gzcat zcat CRUNCH_PROGS_usr.bin+= bzip2 CRUNCH_ALIAS_bzip2= bunzip2 bzcat CRUNCH_LIBS+= -lbz2 CRUNCH_PROGS_usr.bin+= tar CRUNCH_LIBS+= -larchive CRUNCH_PROGS_usr.bin+= vi CRUNCH_ALIAS_vi= ex CRUNCH_PROGS_usr.bin+= id CRUNCH_ALIAS_id= groups whoami ################################################################## # Programs from stock /usr/sbin # CRUNCH_SRCDIRS+= usr.sbin CRUNCH_PROGS_usr.sbin= chroot CRUNCH_PROGS_usr.sbin+= chown CRUNCH_ALIAS_chown= chgrp ################################################################## # The following is pretty nearly a generic crunchgen-handling makefile # CONF= $(PROG).conf OUTMK= $(PROG).mk OUTC= $(PROG).c OUTPUTS=$(OUTMK) $(OUTC) $(PROG).cache CRUNCHOBJS= ${.OBJDIR} .if defined(MAKEOBJDIRPREFIX) CANONICALOBJDIR:= ${MAKEOBJDIRPREFIX}${.CURDIR} .else CANONICALOBJDIR:= /usr/obj${.CURDIR} .endif CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} $(OUTPUTS): $(CRUNCH_SRCDIR_${P})/Makefile .else $(OUTPUTS): $(.CURDIR)/../../$(D)/$(P)/Makefile .endif .ifndef CRUNCH_SUPPRESS_LINK_${P} LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(P) .endif .for A in $(CRUNCH_ALIAS_$(P)) .ifndef CRUNCH_SUPPRESS_LINK_${A} LINKS+= $(BINDIR)/$(PROG) $(BINDIR)/$(A) .endif .endfor .endfor .endfor all: $(PROG) exe: $(PROG) $(CONF): Makefile echo \# Auto-generated, do not edit >$(.TARGET) .ifdef CRUNCH_BUILDOPTS echo buildopts $(CRUNCH_BUILDOPTS) >>$(.TARGET) .endif .ifdef CRUNCH_LIBS echo libs $(CRUNCH_LIBS) >>$(.TARGET) .endif .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) echo progs $(P) >>$(.TARGET) .ifdef CRUNCH_SRCDIR_${P} echo special $(P) srcdir $(CRUNCH_SRCDIR_${P}) >>$(.TARGET) .else echo special $(P) srcdir $(.CURDIR)/../../$(D)/$(P) >>$(.TARGET) .endif .ifdef CRUNCH_BUILDOPTS_${P} echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ \ $(CRUNCH_BUILDOPTS_${P}) >>$(.TARGET) .else echo special $(P) buildopts DIRPRFX=${DIRPRFX}${P}/ >>$(.TARGET) .endif .for A in $(CRUNCH_ALIAS_$(P)) echo ln $(P) $(A) >>$(.TARGET) .endfor .endfor .endfor # XXX Make sure we don't pass -P to crunchgen(1). .MAKEFLAGS:= ${.MAKEFLAGS:N-P} .ORDER: $(OUTPUTS) objs $(OUTPUTS): $(CONF) MAKEOBJDIRPREFIX=${CRUNCHOBJS} crunchgen -fq -m $(OUTMK) \ -c $(OUTC) $(CONF) $(PROG): $(OUTPUTS) objs MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) exe objs: $(OUTMK) MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) objs # Someone should replace the bin/csh and bin/sh build-tools with # shell scripts so we can remove this nonsense. build-tools: .for _tool in bin/csh bin/sh cd $(.CURDIR)/../../${_tool}; \ MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} obj; \ MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} build-tools .endfor # Use a separate build tree to hold files compiled for this crunchgen binary # Yes, this does seem to partly duplicate bsd.subdir.mk, but I can't # get that to cooperate with bsd.prog.mk. Besides, many of the standard # targets should NOT be propagated into the components. cleandepend cleandir obj objlink: .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} cd ${CRUNCH_SRCDIR_$(P)} && \ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else cd $(.CURDIR)/../../${D}/${P} && \ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor .endfor clean: rm -f ${CLEANFILES} if [ -e ${.OBJDIR}/$(OUTMK) ]; then \ MAKEOBJDIRPREFIX=${CRUNCHOBJS} ${MAKE} -f $(OUTMK) clean; \ fi .for D in $(CRUNCH_SRCDIRS) .for P in $(CRUNCH_PROGS_$(D)) .ifdef CRUNCH_SRCDIR_${P} cd ${CRUNCH_SRCDIR_$(P)} && \ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .else cd $(.CURDIR)/../../${D}/${P} && \ MAKEOBJDIRPREFIX=${CANONICALOBJDIR} ${MAKE} \ DIRPRFX=${DIRPRFX}${P}/ ${CRUNCH_BUILDOPTS} ${.TARGET} .endif .endfor .endfor .include Index: head/sbin/atm/atm/atm_print.c =================================================================== --- head/sbin/atm/atm/atm_print.c (revision 179307) +++ head/sbin/atm/atm/atm_print.c (nonexistent) @@ -1,891 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Print routines for "show" subcommand - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -#define ARP_HDR \ -"Net Intf Flags Age Origin\n" - -#define ASRV_HDR \ -"Net Intf State ATM Address\n" - -#define CFG_HDR \ -"Intf Vendor Model Media Bus Serial No\n" - -#define IP_VCC_HDR \ -"Net Intf VPI VCI State Flags IP Address\n" - -#define INTF_HDR \ -"Interface Sigmgr State\n" - -#define NETIF_HDR \ -"Net Intf Phy Intf IP Address\n" - -#define VCC_HDR \ -"Interface VPI VCI AAL Type Dir State Encaps Owner\n" - -#define VCC_STATS_HDR \ -" Input Input Input Output Output Output\n\ -Interface VPI VCI PDUs Bytes Errs PDUs Bytes Errs\n" - -#define VERSION_HDR \ -"Version\n" - -#define PHY_STATS_HDR \ -" Input Input Input Output Output Output Cmd\n\ -Interface PDUs Bytes Errs PDUs Bytes Errs Errs\n" - -/* - * Local variables - */ -static int arp_hdr = 0; -static int asrv_hdr = 0; -static int cfg_hdr = 0; -static int ip_vcc_hdr = 0; -static int netif_hdr = 0; -static int vcc_hdr = 0; -static int vcc_stats_hdr = 0; -static int phy_stats_hdr = 0; -static int version_hdr = 0; - -/* - * SIGPVC state definitions - */ -static const struct state sigpvc_states[] = { - { "ACTIVE", SIGPVC_ACTIVE }, - { "DETACH", SIGPVC_DETACH }, - { 0, 0 } -}; - -/* - * SPANS state definitions - */ -static const struct state spans_states[] = { - { "ACTIVE", SPANS_ACTIVE }, - { "DETACH", SPANS_DETACH }, - { "INIT", SPANS_INIT }, - { "PROBE", SPANS_PROBE }, - { 0, 0 } -}; - -/* - * UNISIG state definitions - */ -static const struct state unisig_states[] = { - { "NULL", UNISIG_NULL }, - { "ADR_WAIT", UNISIG_ADDR_WAIT }, - { "INIT", UNISIG_INIT }, - { "ACTIVE", UNISIG_ACTIVE }, - { "DETACH", UNISIG_DETACH }, - { 0, 0 } -}; - -/* - * SIGPVC VCC state definitions - */ -static const struct state sigpvc_vcc_states[] = { - { "NULL", VCCS_NULL }, - { "ACTIVE", VCCS_ACTIVE }, - { "FREE", VCCS_FREE }, - { 0, 0 } -}; - -/* - * SPANS VCC state definitions - */ -static const struct state spans_vcc_states[] = { - { "NULL", SPANS_VC_NULL }, - { "ACTIVE", SPANS_VC_ACTIVE }, - { "ACT_DOWN", SPANS_VC_ACT_DOWN }, - { "POPEN", SPANS_VC_POPEN }, - { "R_POPEN", SPANS_VC_R_POPEN }, - { "OPEN", SPANS_VC_OPEN }, - { "CLOSE", SPANS_VC_CLOSE }, - { "ABORT", SPANS_VC_ABORT }, - { "FREE", SPANS_VC_FREE }, - {0, 0 } -}; - -/* - * UNISIG VCC state definitions - */ -static const struct state unisig_vcc_states[] = { - { "NULL", UNI_NULL }, - { "C_INIT", UNI_CALL_INITIATED }, - { "C_OUT_PR", UNI_CALL_OUT_PROC }, - { "C_DELIV", UNI_CALL_DELIVERED }, - { "C_PRES", UNI_CALL_PRESENT }, - { "C_REC", UNI_CALL_RECEIVED }, - { "CONN_REQ", UNI_CONNECT_REQUEST }, - { "C_IN_PR", UNI_CALL_IN_PROC }, - { "ACTIVE", UNI_ACTIVE }, - { "REL_REQ", UNI_RELEASE_REQUEST }, - { "REL_IND", UNI_RELEASE_IND }, - { "SSCF_REC", UNI_SSCF_RECOV }, - { "FREE", UNI_FREE }, - { "ACTIVE", UNI_PVC_ACTIVE }, - { "ACT_DOWN", UNI_PVC_ACT_DOWN }, - {0, 0 } -}; - -/* - * IP VCC state definitions - */ -static const struct state ip_vcc_states[] = { - { "FREE", IPVCC_FREE }, - { "PMAP", IPVCC_PMAP }, - { "POPEN", IPVCC_POPEN }, - { "PACCEPT", IPVCC_PACCEPT }, - { "ACTPENT", IPVCC_ACTPENT }, - { "ACTIVE", IPVCC_ACTIVE }, - { "CLOSED", IPVCC_CLOSED }, - { 0, 0 } -}; - -/* - * ARP server state definitions - */ -static const struct state arpserver_states[] = { - { "NOT_CONF", UIAS_NOTCONF }, - { "SERVER", UIAS_SERVER_ACTIVE }, - { "PEND_ADR", UIAS_CLIENT_PADDR }, - { "POPEN", UIAS_CLIENT_POPEN }, - { "REGISTER", UIAS_CLIENT_REGISTER }, - { "ACTIVE", UIAS_CLIENT_ACTIVE }, - { 0, 0 } -}; - -/* - * Supported signalling managers - */ -static const struct proto_state proto_states[] = { - { "SIGPVC", sigpvc_states, sigpvc_vcc_states, ATM_SIG_PVC }, - { "SPANS", spans_states, spans_vcc_states, ATM_SIG_SPANS }, - { "UNI 3.0", unisig_states, unisig_vcc_states, ATM_SIG_UNI30 }, - { "UNI 3.1", unisig_states, unisig_vcc_states, ATM_SIG_UNI31 }, - { "UNI 4.0", unisig_states, unisig_vcc_states, ATM_SIG_UNI40 }, - { 0, 0, 0, 0 } -}; - -/* - * ATMARP origin values - */ -static const struct state arp_origins[] = { - { "LOCAL", UAO_LOCAL }, - { "PERM", UAO_PERM }, - { "REG", UAO_REGISTER }, - { "SCSP", UAO_SCSP }, - { "LOOKUP", UAO_LOOKUP }, - { "PEER_RSP", UAO_PEER_RSP }, - { "PEER_REQ", UAO_PEER_REQ }, - { 0, 0 } -}; - - -/* - * Print ARP table information - * - * Arguments: - * ai pointer to a struct air_arp_rsp - * - * Returns: - * none - * - */ -void -print_arp_info(ai) - struct air_arp_rsp *ai; -{ - int i; - const char *atm_addr, *ip_addr, *origin; - char age[8], flags[32]; - struct sockaddr_in *sain; - - /* - * Print a header if it hasn't been done yet. - */ - if (!arp_hdr) { - printf(ARP_HDR); - arp_hdr = 1; - } - - /* - * Format the addresses - */ - atm_addr = format_atm_addr(&ai->aap_addr); - sain = (struct sockaddr_in *)(void *)&ai->aap_arp_addr; - ip_addr = format_ip_addr(&sain->sin_addr); - - /* - * Decode the flags - */ - bzero(flags, sizeof(flags)); - if (ai->aap_flags & ARPF_VALID) { - strcat(flags, "V"); - } - if (ai->aap_flags & ARPF_REFRESH) { - strcat(flags, "R"); - } - - /* - * Format the origin - */ - for (i=0; arp_origins[i].s_name != NULL && - ai->aap_origin != arp_origins[i].s_id; - i++); - if (arp_origins[i].s_name) { - origin = arp_origins[i].s_name; - } else { - origin = "-"; - } - - /* - * Format the age - */ - bzero(age, sizeof(age)); - if (!(ai->aap_flags & ARPF_VALID)) { - strcpy(age, "-"); - } else { - sprintf(age, "%d", ai->aap_age); - } - - /* - * Print the ARP information - */ - printf("%-8s %-5s %3s %s\n ATM address = %s\n IP address = %s\n", - ai->aap_intf, - flags, - age, - origin, - atm_addr, - ip_addr); -} - - -/* - * Print ARP server information - * - * Arguments: - * si pointer to a struct air_asrv_rsp - * - * Returns: - * none - * - */ -void -print_asrv_info(si) - struct air_asrv_rsp *si; -{ - int i; - const char *atm_addr, *state; - struct in_addr *addr; - - /* - * Print a header if it hasn't been done yet. - */ - if (!asrv_hdr) { - printf(ASRV_HDR); - asrv_hdr = 1; - } - - /* - * Format the ATM address of the ARP server - */ - atm_addr = format_atm_addr(&si->asp_addr); - - /* - * Format the server state - */ - for (i=0; arpserver_states[i].s_name != NULL && - si->asp_state != arpserver_states[i].s_id; - i++); - if (arpserver_states[i].s_name) { - state = arpserver_states[i].s_name; - } else { - state = "-"; - } - - /* - * Print the ARP server information - */ - printf("%-8s %-8s %s\n", - si->asp_intf, - state, - atm_addr); - - /* - * Format and print the LIS prefixes - */ - if (si->asp_nprefix) { - addr = (struct in_addr *)((u_long)si + - sizeof(struct air_asrv_rsp)); - printf(" LIS = "); - for (i = 0; i < si->asp_nprefix; i++) { - printf("%s", inet_ntoa(*addr)); - addr++; - printf("/0x%0lx", (u_long)ntohl(addr->s_addr)); - addr++; - if (i < si->asp_nprefix -1) - printf(", "); - } - printf("\n"); - } -} - - -/* - * Print adapter configuration information - * - * Arguments: - * si pointer to a struct air_cfg_rsp - * - * Returns: - * none - * - */ -void -print_cfg_info(si) - struct air_cfg_rsp *si; -{ - const char *adapter, *bus, *media, *vendor; - - /* - * Print a header if it hasn't been done yet. - */ - if (!cfg_hdr) { - printf(CFG_HDR); - cfg_hdr = 1; - } - - /* - * Format the vendor name and adapter type - */ - vendor = get_vendor(si->acp_vendor); - adapter = get_adapter(si->acp_device); - - /* - * Format the communications medium - */ - media = get_media_type(si->acp_media); - bus = get_bus_type(si->acp_bustype); - - /* - * Print the ARP server information - */ - printf("%-8s %-8s %-8s %-14s %-4s %ld\n", - si->acp_intf, - vendor, - adapter, - media, - bus, - si->acp_serial); - printf(" MAC address = %s\n", - format_mac_addr(&si->acp_macaddr)); - printf(" Hardware version = %s\n", si->acp_hard_vers); - printf(" Firmware version = %s\n", si->acp_firm_vers); -} - - -/* - * Print interface information - * - * Arguments: - * ni pointer to a struct air_int_rsp - * - * Returns: - * none - * - */ -void -print_intf_info(ni) - struct air_int_rsp *ni; -{ - int i; - char nif_names[(IFNAMSIZ *2)+4]; - char *atm_addr; - const char *sigmgr = "-"; - const char *state_name = "-"; - const struct state *s_t; - - /* - * Print a header - */ - printf(INTF_HDR); - - /* - * Translate signalling manager name - */ - for (i=0; proto_states[i].p_state != NULL; i++) - if (ni->anp_sig_proto == proto_states[i].p_id) - break; - if (proto_states[i].p_state != NULL) - sigmgr = proto_states[i].p_name; - - /* - * Get the signalling manager state - */ - if (proto_states[i].p_state != NULL) { - s_t = proto_states[i].p_state; - for (i=0; s_t[i].s_name != NULL; i++) - if (ni->anp_sig_state == s_t[i].s_id) - break; - if (s_t[i].s_name != NULL) - state_name = s_t[i].s_name; - } - - /* - * Format the ATM address - */ - atm_addr = format_atm_addr(&ni->anp_addr); - - /* - * Get the range of NIFs on the physical interface - */ - bzero(nif_names, sizeof(nif_names)); - if (strlen(ni->anp_nif_pref) == 0) { - strcpy(nif_names, "-"); - } else { - strcpy(nif_names, ni->anp_nif_pref); - strcat(nif_names, "0"); - if (ni->anp_nif_cnt > 1) { - strcat(nif_names, " - "); - strcat(nif_names, ni->anp_nif_pref); - sprintf(&nif_names[strlen(nif_names)], "%d", - ni->anp_nif_cnt-1); - } - } - - - /* - * Print the interface information - */ - printf("%-9s %-7s %s\n", - ni->anp_intf, - sigmgr, - state_name); - printf(" ATM address = %s\n", atm_addr); - printf(" Network interfaces: %s\n", nif_names); -} - - -/* - * Print IP address map information - * - * Arguments: - * ai pointer to a struct air_arp_rsp - * - * Returns: - * none - * - */ -void -print_ip_vcc_info(ai) - struct air_ip_vcc_rsp *ai; -{ - int i; - const char *ip_addr, *state; - char flags[32], vpi_vci[16]; - struct sockaddr_in *sain; - - /* - * Print a header if it hasn't been done yet. - */ - if (!ip_vcc_hdr) { - printf(IP_VCC_HDR); - ip_vcc_hdr = 1; - } - - /* - * Format the IP address - */ - sain = (struct sockaddr_in *)(void *)&ai->aip_dst_addr; - ip_addr = format_ip_addr(&sain->sin_addr); - - /* - * Format the VPI/VCI - */ - if (ai->aip_vpi == 0 && ai->aip_vci == 0) { - strcpy(vpi_vci, " - -"); - } else { - sprintf(vpi_vci, "%3d %5d", ai->aip_vpi, ai->aip_vci); - } - - /* - * Decode VCC flags - */ - bzero(flags, sizeof(flags)); - if (ai->aip_flags & IVF_PVC) { - strcat(flags, "P"); - } - if (ai->aip_flags & IVF_SVC) { - strcat(flags, "S"); - } - if (ai->aip_flags & IVF_LLC) { - strcat(flags, "L"); - } - if (ai->aip_flags & IVF_MAPOK) { - strcat(flags, "M"); - } - if (ai->aip_flags & IVF_NOIDLE) { - strcat(flags, "N"); - } - - /* - * Get the state of the VCC - */ - for (i=0; ip_vcc_states[i].s_name != NULL && - ai->aip_state != ip_vcc_states[i].s_id; - i++); - if (ip_vcc_states[i].s_name) { - state = ip_vcc_states[i].s_name; - } else { - state = "-"; - } - - /* - * Print the IP VCC information - */ - printf("%-8s %9s %-7s %-5s %s\n", - ai->aip_intf, - vpi_vci, - state, - flags, - ip_addr); -} - - -/* - * Print network interface information - * - * Arguments: - * ni pointer to a struct air_int_rsp - * - * Returns: - * none - * - */ -void -print_netif_info(ni) - struct air_netif_rsp *ni; -{ - const char *ip_addr; - struct sockaddr_in *sain; - - /* - * Print a header - */ - if (!netif_hdr) { - netif_hdr++; - printf(NETIF_HDR); - } - - /* - * Format the protocol address - */ - sain = (struct sockaddr_in *)(void *)&ni->anp_proto_addr; - ip_addr = format_ip_addr(&sain->sin_addr); - - /* - * Print the network interface information - */ - printf("%-8s %-8s %s\n", - ni->anp_intf, - ni->anp_phy_intf, - ip_addr); -} - - -/* - * Print physical interface statistics - * - * Arguments: - * pi pointer to a struct air_phy_stat_rsp - * - * Returns: - * none - * - */ -void -print_intf_stats(pi) - struct air_phy_stat_rsp *pi; -{ - /* - * Print a header if it hasn't already been done - */ - if (!phy_stats_hdr) { - printf(PHY_STATS_HDR); - phy_stats_hdr = 1; - } - - /* - * Print the interface statistics - */ - printf("%-9s %7lld %8lld %5lld %7lld %8lld %5lld %5lld\n", - pi->app_intf, - (unsigned long long)pi->app_ipdus, - (unsigned long long)pi->app_ibytes, - (unsigned long long)pi->app_ierrors, - (unsigned long long)pi->app_opdus, - (unsigned long long)pi->app_obytes, - (unsigned long long)pi->app_oerrors, - (unsigned long long)pi->app_cmderrors); -} - - -/* - * Print VCC statistics - * - * Arguments: - * vi pointer to VCC statistics to print - * - * Returns: - * none - * - */ -void -print_vcc_stats(vi) - struct air_vcc_rsp *vi; -{ - - /* - * Print a header if it hasn't already been done - */ - if (!vcc_stats_hdr) { - printf(VCC_STATS_HDR); - vcc_stats_hdr = 1; - } - - /* - * Print the VCC statistics - */ - printf("%-9s %3d %4d", - vi->avp_intf, - vi->avp_vpi, - vi->avp_vci); - if ( vi->avp_type & VCC_IN ) - printf ( " %7ld %8ld %5ld", - vi->avp_ipdus, - vi->avp_ibytes, - vi->avp_ierrors); - else - printf ( " - - -" ); - - if ( vi->avp_type & VCC_OUT ) - printf ( " %7ld %8ld %5ld\n", - vi->avp_opdus, - vi->avp_obytes, - vi->avp_oerrors); - else - printf ( " - - -\n" ); -} - - -/* - * Print VCC information - * - * Arguments: - * vi pointer to a struct air_vcc_rsp - * - * Returns: - * none - * - */ -void -print_vcc_info(vi) - struct air_vcc_rsp *vi; -{ - int i; - const char *aal_name = "-" , *encaps_name = "-", *owner_name = "-"; - const char *state_name = "-", *type_name = "-"; - char dir_name[10]; - const struct state *s_t; - - /* - * Print a header if it hasn't already been done - */ - if (!vcc_hdr) { - printf(VCC_HDR); - vcc_hdr = 1; - } - - /* - * Translate AAL - */ - for (i=0; aals[i].a_name != NULL; i++) - if (vi->avp_aal == aals[i].a_id) - break; - if (aals[i].a_name) - aal_name = aals[i].a_name; - - /* - * Translate VCC type - */ - if (vi->avp_type & VCC_PVC) - type_name = "PVC"; - else if (vi->avp_type & VCC_SVC) - type_name = "SVC"; - /* - * Translate VCC direction - */ - bzero(dir_name, sizeof(dir_name)); - if (vi->avp_type & VCC_IN) - strcat(dir_name, "In"); - if (vi->avp_type & VCC_OUT) - strcat(dir_name, "Out"); - if (strlen(dir_name) == 0) - strcpy(dir_name, "-"); - - /* - * Translate state - */ - for (i=0; proto_states[i].p_state != NULL; i++) - if (vi->avp_sig_proto == proto_states[i].p_id) - break; - if (proto_states[i].p_state) { - s_t = proto_states[i].v_state; - for (i=0; s_t[i].s_name != NULL; i++) - if (vi->avp_state == s_t[i].s_id) - break; - if (s_t[i].s_name) - state_name = s_t[i].s_name; - } - - /* - * Translate encapsulation - */ - for (i=0; encaps[i].e_name != NULL; i++) - if (vi->avp_encaps == encaps[i].e_id) - break; - if (encaps[i].e_name) - encaps_name = encaps[i].e_name; - - /* - * Print the VCC information - */ - printf("%-9s %3d %5d %-4s %-4s %-5s %-8s %-8s ", - vi->avp_intf, - vi->avp_vpi, - vi->avp_vci, - aal_name, - type_name, - dir_name, - state_name, - encaps_name); - - /* - * Print VCC owners' names - */ - for (i = 0, owner_name = vi->avp_owners; - i < O_CNT - 1 && strlen(owner_name); - i++, owner_name += (T_ATM_APP_NAME_LEN + 1)) { - if (i > 0) - printf(", "); - printf("%s", owner_name); - } - if (i == 0) - printf("-"); - printf("\n"); - - /* - * Print destination address if it's an SVC - */ - if (vi->avp_type & VCC_SVC) { - printf(" Dest = %s\n", - format_atm_addr(&vi->avp_daddr)); - } -} - - -/* - * Print network interface information - * - * Arguments: - * ni pointer to a struct air_int_rsp - * - * Returns: - * none - * - */ -void -print_version_info(vi) - struct air_version_rsp *vi; -{ - char version_str[80]; - - /* - * Print a header - */ - if (!version_hdr) { - version_hdr++; - printf(VERSION_HDR); - } - - /* - * Print the interface information - */ - sprintf(version_str, "%d.%d", - ATM_VERS_MAJ(vi->avp_version), - ATM_VERS_MIN(vi->avp_version)); - printf("%7s\n", version_str); -} Property changes on: head/sbin/atm/atm/atm_print.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm_show.c =================================================================== --- head/sbin/atm/atm/atm_show.c (revision 179307) +++ head/sbin/atm/atm/atm_show.c (nonexistent) @@ -1,1144 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Routines for "show" subcommand - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local functions - */ -static int vcc_compare(const void *, const void *); -static int ip_vcc_compare(const void *, const void *); -static int arp_compare(const void *, const void *); - - -/* - * Process show ARP command - * - * Command format: - * atm show ARP [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_arp(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t arp_info_len; - struct atminfreq air; - struct air_arp_rsp *arp_info, *arp_info_base; - struct sockaddr_in *sain; - union { - struct sockaddr_in sain; - struct sockaddr sa; - } host_addr; - - /* - * Get IP address of specified host name - */ - bzero(&host_addr, sizeof(host_addr)); - host_addr.sa.sa_family = AF_INET; - if (argc) { - sain = get_ip_addr(argv[0]); - if (!sain) { - fprintf(stderr, "%s: host \'%s\' not found\n", - prog, argv[0]); - exit(1); - } - host_addr.sain.sin_addr.s_addr = sain->sin_addr.s_addr; - } else { - host_addr.sain.sin_addr.s_addr = INADDR_ANY; - } - - /* - * Get ARP information from the kernel - */ - bzero(&air, sizeof(air)); - air.air_opcode = AIOCS_INF_ARP; - air.air_arp_addr = host_addr.sa; - arp_info_len = do_info_ioctl(&air, sizeof(struct air_arp_rsp) * 10); - if ((ssize_t)arp_info_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "not an ATM device\n"); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - arp_info_base = arp_info = - (struct air_arp_rsp *) air.air_buf_addr; - - /* - * Sort the ARP table - */ - qsort((void *) arp_info, - arp_info_len / sizeof(struct air_arp_rsp), - sizeof(struct air_arp_rsp), - arp_compare); - - /* - * Print the relevant information - */ - while (arp_info_len >= sizeof(struct air_arp_rsp)) { - print_arp_info(arp_info); - arp_info++; - arp_info_len -= sizeof(struct air_arp_rsp); - } - - /* - * Release the information from the kernel - */ - free(arp_info_base); -} - - -/* - * Process show ATM ARP server command - * - * Command format: - * atm show arpserver [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_arpserv(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t buf_len, asrv_info_len; - struct atminfreq air; - struct air_asrv_rsp *asrv_info, *asrv_info_base; - - /* - * Validate interface name - */ - bzero(air.air_int_intf, sizeof(air.air_int_intf)); - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - strcpy(air.air_int_intf, argv[0]); - argc--; argv++; - } - - /* - * Get interface information from the kernel - */ - air.air_opcode = AIOCS_INF_ASV; - buf_len = do_info_ioctl(&air, sizeof(struct air_asrv_rsp) * 3); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Print the interface information - */ - asrv_info_base = asrv_info = - (struct air_asrv_rsp *)(void *)air.air_buf_addr; - while (buf_len >= sizeof(struct air_asrv_rsp)) { - print_asrv_info(asrv_info); - asrv_info_len = sizeof(struct air_asrv_rsp) + - asrv_info->asp_nprefix * sizeof(struct in_addr) * 2; - asrv_info = (struct air_asrv_rsp *)(void *) - ((char *)asrv_info + asrv_info_len); - buf_len -= asrv_info_len; - } - free(asrv_info_base); -} - - -/* - * Process show ATM adapter configuration command - * - * Command format: - * atm show config [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_config(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t buf_len; - struct atminfreq air; - struct air_cfg_rsp *cfg_info, *cfg_info_base; - - /* - * Validate interface name - */ - bzero(air.air_cfg_intf, sizeof(air.air_cfg_intf)); - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - strcpy(air.air_cfg_intf, argv[0]); - argc--; argv++; - } - - /* - * Get configuration information from the kernel - */ - air.air_opcode = AIOCS_INF_CFG; - buf_len = do_info_ioctl(&air, sizeof(struct air_asrv_rsp) * 3); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Print the interface information - */ - cfg_info_base = cfg_info = - (struct air_cfg_rsp *)(void *)air.air_buf_addr; - for (; buf_len >= sizeof(struct air_cfg_rsp); cfg_info++, - buf_len -= sizeof(struct air_cfg_rsp)) { - print_cfg_info(cfg_info); - } - free(cfg_info_base); -} - - -/* - * Process show interface command - * - * Command format: - * atm show interface [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_intf(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t buf_len; - struct atminfreq air; - struct air_int_rsp *int_info, *int_info_base; - - /* - * Validate interface name - */ - bzero(&air, sizeof(air)); - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - strcpy(air.air_int_intf, argv[0]); - argc--; argv++; - } - - /* - * Get interface information from the kernel - */ - air.air_opcode = AIOCS_INF_INT; - buf_len = do_info_ioctl(&air, sizeof(struct air_int_rsp) * 3); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Print the interface information - */ - int_info_base = int_info = - (struct air_int_rsp *)(void *)air.air_buf_addr; - for (; buf_len >= sizeof(struct air_int_rsp); int_info++, - buf_len -= sizeof(struct air_int_rsp)) { - print_intf_info(int_info); - } - free(int_info_base); -} - - -/* - * Process show IP VCCs command - * - * Command format: - * atm show ipvcc [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_ip_vcc(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int rc; - size_t ip_info_len; - char *if_name = (char *)0; - struct atminfreq air; - struct air_ip_vcc_rsp *ip_info, *ip_info_base; - struct sockaddr_in *sain; - union { - struct sockaddr_in sain; - struct sockaddr sa; - } host_addr; - - /* - * First parameter can be a netif name, an IP host name, or - * an IP address. Figure out which it is. - */ - bzero(&host_addr, sizeof(host_addr)); - host_addr.sa.sa_family = AF_INET; - if (argc) { - rc = verify_nif_name(argv[0]); - if (rc < 0) { - /* - * Error occured - */ - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } else if (rc > 0) { - /* - * Parameter is a valid netif name - */ - if_name = argv[0]; - } else { - /* - * Get IP address of specified host name - */ - sain = get_ip_addr(argv[0]); - host_addr.sain.sin_addr.s_addr = - sain->sin_addr.s_addr; - } - } else { - host_addr.sain.sin_addr.s_addr = INADDR_ANY; - } - - /* - * Get IP map information from the kernel - */ - air.air_opcode = AIOCS_INF_IPM; - air.air_ip_addr = host_addr.sa; - ip_info_len = do_info_ioctl(&air, sizeof(struct air_ip_vcc_rsp) * 10); - if ((ssize_t)ip_info_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "not an ATM device\n"); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - ip_info_base = ip_info = - (struct air_ip_vcc_rsp *)(void *)air.air_buf_addr; - - /* - * Sort the information - */ - qsort((void *) ip_info, - ip_info_len / sizeof(struct air_ip_vcc_rsp), - sizeof(struct air_ip_vcc_rsp), - ip_vcc_compare); - - /* - * Print the relevant information - */ - while (ip_info_len >= sizeof(struct air_ip_vcc_rsp)) { - if (!if_name || !strcmp(if_name, ip_info->aip_intf)) { - print_ip_vcc_info(ip_info); - } - ip_info++; - ip_info_len -= sizeof(struct air_ip_vcc_rsp); - } - - /* - * Release the information from the kernel - */ - free(ip_info_base); -} - - -/* - * Process show network interface command - * - * Command format: - * atm show netif [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_netif(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t buf_len; - struct atminfreq air; - struct air_netif_rsp *int_info, *int_info_base; - - /* - * Validate network interface name - */ - bzero(air.air_int_intf, sizeof(air.air_int_intf)); - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - strcpy(air.air_int_intf, argv[0]); - argc--; argv++; - } - - /* - * Get network interface information from the kernel - */ - air.air_opcode = AIOCS_INF_NIF; - buf_len = do_info_ioctl(&air, sizeof(struct air_netif_rsp) * 3); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Print the network interface information - */ - int_info_base = int_info = - (struct air_netif_rsp *) air.air_buf_addr; - for (; buf_len >= sizeof(struct air_netif_rsp); int_info++, - buf_len -= sizeof(struct air_netif_rsp)) { - print_netif_info(int_info); - } - free(int_info_base); -} - - -/* - * Process interface statistics command - * - * Command format: - * atm show stats interface [] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_intf_stats(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t buf_len; - char intf[IFNAMSIZ]; - struct atminfreq air; - struct air_phy_stat_rsp *pstat_info, *pstat_info_base; - struct air_cfg_rsp *cfg_info; - - /* - * Validate interface name - */ - bzero(intf, sizeof(intf)); - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - strcpy(intf, argv[0]); - argc--; argv++; - } - - /* - * If there are parameters remaining, the request is for - * vendor-specific adaptor statistics - */ - if (argc) { - /* - * Get adapter configuration information - */ - air.air_opcode = AIOCS_INF_CFG; - strcpy(air.air_cfg_intf, intf); - buf_len = do_info_ioctl(&air, sizeof(struct air_cfg_rsp)); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - intf); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - cfg_info = (struct air_cfg_rsp *)(void *)air.air_buf_addr; - - /* - * Call the appropriate vendor-specific routine - */ - switch(cfg_info->acp_vendor) { - case VENDOR_FORE: - show_fore200_stats(intf, argc, argv); - break; - default: - fprintf(stderr, "%s: Unknown adapter vendor\n", - prog); - break; - } - - free(cfg_info); - } else { - /* - * Get generic interface statistics - */ - air.air_opcode = AIOCS_INF_PIS; - strcpy(air.air_physt_intf, intf); - buf_len = do_info_ioctl(&air, - sizeof(struct air_phy_stat_rsp) * 3); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - intf); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Display the interface statistics - */ - pstat_info_base = pstat_info = (struct air_phy_stat_rsp *) - (void *)air.air_buf_addr; - for (; buf_len >= sizeof(struct air_phy_stat_rsp); - pstat_info++, - buf_len-=sizeof(struct air_phy_stat_rsp)) { - print_intf_stats(pstat_info); - } - free((caddr_t)pstat_info_base); - } -} - - -/* - * Process VCC statistics command - * - * Command format: - * atm show stats VCC [ [ []]] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_vcc_stats(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t vcc_info_len; - int vpi = -1, vci = -1; - char *cp, *intf = NULL; - struct air_vcc_rsp *vcc_info, *vcc_info_base; - - /* - * Validate interface name - */ - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - intf = argv[0]; - argc--; argv++; - } - - /* - * Validate VPI value - */ - if (argc) { - vpi = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (vpi < 0) || (vpi >= 1 << 8)) { - fprintf(stderr, "%s: Invalid VPI value\n", prog); - exit(1); - } - argc--; argv++; - } - - /* - * Validate VCI value - */ - if (argc) { - vci = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (vci <= 0) || (vci >= 1 << 16)) { - fprintf(stderr, "%s: Invalid VCI value\n", - prog); - exit(1); - } - argc--; argv++; - } - - /* - * Get VCC information - */ - vcc_info_len = get_vcc_info(intf, &vcc_info); - if (vcc_info_len == 0) - exit(1); - else if ((ssize_t)vcc_info_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "Not an ATM device\n"); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Sort the VCC information - */ - qsort((void *) vcc_info, - vcc_info_len / sizeof(struct air_vcc_rsp), - sizeof(struct air_vcc_rsp), - vcc_compare); - - /* - * Display the VCC statistics - */ - vcc_info_base = vcc_info; - for (; vcc_info_len >= sizeof(struct air_vcc_rsp); - vcc_info_len-=sizeof(struct air_vcc_rsp), - vcc_info++) { - if (vpi != -1 && vcc_info->avp_vpi != vpi) - continue; - if (vci != -1 && vcc_info->avp_vci != vci) - continue; - print_vcc_stats(vcc_info); - } - free(vcc_info_base); -} - - -/* - * Process VCC information command - * - * Command format: - * atm show VCC [ [ [] | PVC | SVC]] - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_vcc(int argc, char **argv, const struct cmd *cmdp __unused) -{ - size_t vcc_info_len; - int vpi = -1, vci = -1, show_pvc = 0, show_svc = 0; - char *cp, *intf = NULL; - struct air_vcc_rsp *vcc_info, *vcc_info_base; - - /* - * Validate interface name - */ - if (argc) { - if (strlen(argv[0]) > IFNAMSIZ - 1) { - fprintf(stderr, "%s: Illegal interface name\n", - prog); - exit(1); - } - intf = argv[0]; - argc--; argv++; - } - - /* - * Validate VPI value - */ - if (argc) { - if (strcasecmp(argv[0], "pvc")) - show_pvc = 1; - else if (strcasecmp(argv[0], "svc")) - show_svc = 1; - else { - vpi = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (vpi < 0) || - (vpi >= 1 << 8)) { - fprintf(stderr, "%s: Invalid VPI value\n", prog); - exit(1); - } - } - argc--; argv++; - } - - /* - * Validate VCI value - */ - if (argc) { - vci = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (vci <= 0) || (vci >= 1 << 16)) { - fprintf(stderr, "%s: Invalid VCI value\n", - prog); - exit(1); - } - argc--; argv++; - } - - /* - * Get VCC information - */ - vcc_info_len = get_vcc_info(intf, &vcc_info); - if (vcc_info_len == 0) - exit(1); - else if ((ssize_t)vcc_info_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "Not an ATM device\n"); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Sort the VCC information - */ - qsort((void *) vcc_info, - vcc_info_len/sizeof(struct air_vcc_rsp), - sizeof(struct air_vcc_rsp), - vcc_compare); - - /* - * Display the VCC information - */ - vcc_info_base = vcc_info; - for (; vcc_info_len >= sizeof(struct air_vcc_rsp); - vcc_info_len-=sizeof(struct air_vcc_rsp), - vcc_info++) { - if (vpi != -1 && vcc_info->avp_vpi != vpi) - continue; - if (vci != -1 && vcc_info->avp_vci != vci) - continue; - if (show_pvc && vcc_info->avp_type & VCC_PVC) - continue; - if (show_svc && vcc_info->avp_type & VCC_SVC) - continue; - print_vcc_info(vcc_info); - } - free(vcc_info_base); -} - - -/* - * Process version command - * - * Command format: - * atm show version - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -show_version(int argc __unused, char **argv __unused, - const struct cmd *cmdp __unused) -{ - size_t buf_len; - struct atminfreq air; - struct air_version_rsp *ver_info, *ver_info_base; - - /* - * Get network interface information from the kernel - */ - air.air_opcode = AIOCS_INF_VER; - buf_len = do_info_ioctl(&air, sizeof(struct air_version_rsp)); - if ((ssize_t)buf_len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "Not an ATM device\n"); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - - /* - * Print the network interface information - */ - ver_info_base = ver_info = - (struct air_version_rsp *)(void *)air.air_buf_addr; - for (; buf_len >= sizeof(struct air_version_rsp); ver_info++, - buf_len -= sizeof(struct air_version_rsp)) { - print_version_info(ver_info); - } - free(ver_info_base); -} - - -/* - * Comparison function for qsort - * - * Arguments: - * p1 pointer to the first VCC response - * p2 pointer to the second VCC response - * - * Returns: - * int a number less than, greater than, or equal to zero, - * depending on whether *p1 is less than, greater than, or - * equal to *p2 - * - */ -static int -vcc_compare(p1, p2) - const void *p1, *p2; -{ - int rc; - const struct air_vcc_rsp *c1, *c2; - - c1 = (const struct air_vcc_rsp *) p1; - c2 = (const struct air_vcc_rsp *) p2; - - /* - * Compare the interface names - */ - rc = strcmp(c1->avp_intf, c2->avp_intf); - if (rc) - return(rc); - - /* - * Compare the VPI values - */ - rc = c1->avp_vpi - c2->avp_vpi; - if (rc) - return(rc); - - /* - * Compare the VCI values - */ - rc = c1->avp_vci - c2->avp_vci; - if (rc) - return(rc); - - /* - * Compare the types - */ - rc = c1->avp_type - c2->avp_type; - return(rc); -} - - -/* - * Comparison function for qsort - * - * Arguments: - * p1 pointer to the first VCC response - * p2 pointer to the second VCC response - * - * Returns: - * int a number less than, greater than, or equal to zero, - * depending on whether *p1 is less than, greater than, or - * equal to *p2 - * - */ -static int -ip_vcc_compare(p1, p2) - const void *p1, *p2; -{ - int rc; - const struct air_ip_vcc_rsp *c1, *c2; - - c1 = (const struct air_ip_vcc_rsp *) p1; - c2 = (const struct air_ip_vcc_rsp *) p2; - - /* - * Compare the interface names - */ - rc = strcmp(c1->aip_intf, c2->aip_intf); - if (rc) - return(rc); - - /* - * Compare the VPI values - */ - rc = c1->aip_vpi - c2->aip_vpi; - if (rc) - return(rc); - - /* - * Compare the VCI values - */ - rc = c1->aip_vci - c2->aip_vci; - return(rc); -} - - -/* - * Comparison function for qsort - * - * Arguments: - * p1 pointer to the first ARP or IP map entry - * p2 pointer to the second ARP or IP map entry - * - * Returns: - * int a number less than, greater than, or equal to zero, - * depending on whether *p1 is less than, greater than, or - * equal to *p2 - * - */ -static int -arp_compare(p1, p2) - const void *p1, *p2; -{ - int rc; - const struct air_arp_rsp *c1, *c2; - const struct sockaddr_in *sin1, *sin2; - - c1 = (const struct air_arp_rsp *)p1; - c2 = (const struct air_arp_rsp *)p2; - sin1 = (const struct sockaddr_in *)(const void *)&c1->aap_arp_addr; - sin2 = (const struct sockaddr_in *)(const void *)&c2->aap_arp_addr; - - /* - * Compare the IP addresses - */ - if ((rc = sin1->sin_family - sin2->sin_family) != 0) - return(rc); - if ((rc = sin1->sin_addr.s_addr - sin2->sin_addr.s_addr) != 0) - return(rc); - - /* - * Compare the ATM addresses - */ - if ((rc = c1->aap_addr.address_format - c2->aap_addr.address_format) != 0) - return(rc); - if ((rc = c1->aap_addr.address_length - c2->aap_addr.address_length) != 0) - return(rc); - switch(c1->aap_addr.address_format) { - case T_ATM_ABSENT: - rc = 0; - break; - case T_ATM_ENDSYS_ADDR: - rc = bcmp(c1->aap_addr.address, c2->aap_addr.address, - sizeof(Atm_addr_nsap)); - break; - case T_ATM_E164_ADDR: - rc = bcmp(c1->aap_addr.address, c2->aap_addr.address, - sizeof(Atm_addr_e164)); - break; - case T_ATM_SPANS_ADDR: - rc = bcmp(c1->aap_addr.address, c2->aap_addr.address, - sizeof(Atm_addr_spans)); - break; - } - - return(rc); -} Property changes on: head/sbin/atm/atm/atm_show.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm_fore200.c =================================================================== --- head/sbin/atm/atm/atm_fore200.c (revision 179307) +++ head/sbin/atm/atm/atm_fore200.c (nonexistent) @@ -1,596 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Routines for Fore SBA-200-specific subcommands - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local constants - */ -#define SHOW_PHY 1 -#define SHOW_DEV 2 -#define SHOW_ATM 4 -#define SHOW_AAL0 8 -#define SHOW_AAL4 16 -#define SHOW_AAL5 32 -#define SHOW_DRIVER 64 - - -/* - * Headers for statistics - */ -#define TAXI_STATS_HDR \ -"%s TAXI Statistics\n\ - CRC Errs Framing Errs\n" - -#define DEV_STATS_HDR \ -"%s Device Statistics\n\ -Type 1 Type 1 Type 2 Type 2\n\ -Small Buff Large Buff Small Buff Large Buff Receive Receive\n\ -Alloc Fail Alloc Fail Alloc Fail Alloc Fail Queue Full Carrier\n" - -#define ATM_STATS_HDR \ -"%s ATM Layer Statistics\n\ - Cells In Cells Out VPI Range VPI NoConn VCI Range VCI NoConn\n" - -#define AAL0_STATS_HDR \ -"%s AAL 0 Statistics\n\ - Cells In Cells Out Cell Drops\n" - -#define AAL4_STATS_HDR \ -"%s AAL 4 Statistics\n\ - CRC Proto Cell PDU PDU\n\ - Cells In Cells Out Errs Errs Drops PDUs In PDUs Out Errs Drops\n" - -#define AAL5_STATS_HDR \ -"%s AAL 5 Statistics\n\ - CRC/Len CRC Proto PDU\n\ - Cells In Cells Out Errs Drops PDUs In PDUs Out Errs Errs Drops\n" - -#define DRIVER_STATS_HDR \ -"%s Device Driver Statistics\n\ - No Xmit Max Seg No No No IQ No Cmd No\n\ - VCC Queue Seg Not Seg DMA VCC No Mbuf Full DMA Queue DMA\n\ - Out Full Size Align Pad Out In Buff In In Sup Full Cmd\n" - -#define OC3_STATS_HDR \ -"%s OC-3c Statistics\n\ -Section Path Line Line Path Corr Uncorr\n\ -BIP8 BIP8 BIP24 FEBE FEBE HCS HCS\n\ -Errs Errs Errs Errs Errs Errs Errs\n" - -static void print_fore200_taxi(struct air_vinfo_rsp *); -static void print_fore200_oc3(struct air_vinfo_rsp *); -static void print_fore200_dev(struct air_vinfo_rsp *); -static void print_fore200_atm(struct air_vinfo_rsp *); -static void print_fore200_aal0(struct air_vinfo_rsp *); -static void print_fore200_aal4(struct air_vinfo_rsp *); -static void print_fore200_aal5(struct air_vinfo_rsp *); -static void print_fore200_driver(struct air_vinfo_rsp *); - -/* - * Process show Fore SBA-200 statistics command - * - * The statistics printed are vendor-specific, depending on the brand of - * the interface card. - * - * Command format: - * atm show stats interface [ [phy | dev | atm | - * aal0 | aal4 | aal5 | driver]] - * - * Arguments: - * intf interface statistics are for - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * - * Returns: - * none - * - */ -void -show_fore200_stats(intf, argc, argv) - char *intf; - int argc; - char **argv; -{ - int stats_type; - ssize_t buf_len; - struct air_cfg_rsp *cfg; - struct air_vinfo_rsp *stats; - struct atminfreq air; - - /* - * Get statistics type qualifier - */ - if (!strcasecmp("phy", argv[0])) { - stats_type = SHOW_PHY; - } else if (!strcasecmp("dev", argv[0])) { - stats_type = SHOW_DEV; - } else if (!strcasecmp("atm", argv[0])) { - stats_type = SHOW_ATM; - } else if (!strcasecmp("aal0", argv[0])) { - stats_type = SHOW_AAL0; - } else if (!strcasecmp("aal4", argv[0])) { - stats_type = SHOW_AAL4; - } else if (!strcasecmp("aal5", argv[0])) { - stats_type = SHOW_AAL5; - } else if (!strcasecmp("driver", argv[0])) { - stats_type = SHOW_DRIVER; - } else { - errx(1, "Illegal statistics type"); - } - argc--; argv++; - - /* - * Get adapter configuration from the kernel - */ - bzero(&air, sizeof(air)); - air.air_opcode = AIOCS_INF_CFG; - strcpy(air.air_cfg_intf, intf); - buf_len = do_info_ioctl(&air, sizeof(struct air_cfg_rsp)); - if (buf_len == -1) { - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - err(1, "Internal error"); - case ENXIO: - errx(1, "%s is not an ATM device", intf); - default: - err(1, "ioctl (AIOCINFO)"); - } - } - cfg = (struct air_cfg_rsp *)(void *)air.air_buf_addr; - - /* - * Get vendor-specific statistics from the kernel - */ - bzero(&air, sizeof(air)); - air.air_opcode = AIOCS_INF_VST; - strcpy(air.air_vinfo_intf, intf); - buf_len = do_info_ioctl(&air, sizeof(struct air_vinfo_rsp) + 1024); - if (buf_len == -1) { - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - err(1, "Internal error"); - case ENXIO: - errx(1, "%s is not an ATM device", intf); - default: - err(1, "ioctl (AIOCINFO)"); - } - } - stats = (struct air_vinfo_rsp *)(void *)air.air_buf_addr; - - /* - * Print the statistics - */ - if ((size_t)buf_len < sizeof(struct air_vinfo_rsp) + - sizeof(Fore_stats)) { - free(stats); - free(cfg); - return; - } - - switch (stats_type) { - case SHOW_PHY: - switch (cfg->acp_media) { - case MEDIA_TAXI_100: - case MEDIA_TAXI_140: - print_fore200_taxi(stats); - break; - case MEDIA_OC3C: - print_fore200_oc3(stats); - break; - case MEDIA_OC12C: - break; - default: - break; - } - break; - case SHOW_DEV: - print_fore200_dev(stats); - break; - case SHOW_ATM: - print_fore200_atm(stats); - break; - case SHOW_AAL0: - print_fore200_aal0(stats); - break; - case SHOW_AAL4: - print_fore200_aal4(stats); - break; - case SHOW_AAL5: - print_fore200_aal5(stats); - break; - case SHOW_DRIVER: - print_fore200_driver(stats); - break; - } - - free(stats); - free(cfg); -} - - -/* - * Print Fore ASX-200 TAXI statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_taxi(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(TAXI_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the physical layer info - */ - printf("%10ld %12ld\n", - stats->st_taxi.taxi_bad_crc, - stats->st_taxi.taxi_framing); -} - - -/* - * Print Fore ASX-200 OC-3c statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_oc3(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(OC3_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the OC-3c info - */ - printf("%7ld %7ld %7ld %7ld %7ld %7ld %7ld\n", - stats->st_oc3.oc3_sect_bip8, - stats->st_oc3.oc3_path_bip8, - stats->st_oc3.oc3_line_bip24, - stats->st_oc3.oc3_line_febe, - stats->st_oc3.oc3_path_febe, - stats->st_oc3.oc3_hec_corr, - stats->st_oc3.oc3_hec_uncorr); -} - - -/* - * Print Fore ASX-200 device statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_dev(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(DEV_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the device info - */ - printf("%10ld %10ld %10ld %10ld %10ld %s\n", - stats->st_misc.buf1_sm_fail, - stats->st_misc.buf1_lg_fail, - stats->st_misc.buf2_sm_fail, - stats->st_misc.buf2_lg_fail, - stats->st_misc.rcvd_pdu_fail, - (stats->st_misc.carrier_status ? "On" : "Off")); -} - - -/* - * Print Fore ASX-200 ATM statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_atm(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(ATM_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the ATM layer info - */ - printf("%10ld %10ld %10ld %10ld %10ld %10ld\n", - stats->st_atm.atm_rcvd, - stats->st_atm.atm_xmit, - stats->st_atm.atm_vpi_range, - stats->st_atm.atm_vpi_noconn, - stats->st_atm.atm_vci_range, - stats->st_atm.atm_vci_noconn); -} - - -/* - * Print Fore ASX-200 AAL 0 statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_aal0(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(AAL0_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the AAL 0 info - */ - printf("%10ld %10ld %10ld\n", - stats->st_aal0.aal0_rcvd, - stats->st_aal0.aal0_xmit, - stats->st_aal0.aal0_drops); -} - - -/* - * Print Fore ASX-200 AAL 4 statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_aal4(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(AAL4_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the AAL 4 info - */ - printf("%10ld %10ld %5ld %5ld %5ld %9ld %9ld %5ld %5ld\n", - stats->st_aal4.aal4_rcvd, - stats->st_aal4.aal4_xmit, - stats->st_aal4.aal4_crc, - stats->st_aal4.aal4_sar_cs, - stats->st_aal4.aal4_drops, - stats->st_aal4.aal4_pdu_rcvd, - stats->st_aal4.aal4_pdu_xmit, - stats->st_aal4.aal4_pdu_errs, - stats->st_aal4.aal4_pdu_drops); -} - - -/* - * Print Fore ASX-200 AAL 5 statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_aal5(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(AAL5_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the AAL 5 info - */ - printf("%10ld %10ld %5ld %5ld %9ld %9ld %5ld %5ld %5ld\n", - stats->st_aal5.aal5_rcvd, - stats->st_aal5.aal5_xmit, - stats->st_aal5.aal5_crc_len, - stats->st_aal5.aal5_drops, - stats->st_aal5.aal5_pdu_rcvd, - stats->st_aal5.aal5_pdu_xmit, - stats->st_aal5.aal5_pdu_crc, - stats->st_aal5.aal5_pdu_errs, - stats->st_aal5.aal5_pdu_drops); -} - - -/* - * Print Fore ASX-200 device driver statistics - * - * Arguments: - * vi pointer to vendor-specific statistics to print - * - * Returns: - * none - * - */ -void -print_fore200_driver(vi) - struct air_vinfo_rsp *vi; -{ - Fore_stats *stats; - - /* - * Bump stats pointer past header info - */ - stats = (Fore_stats *) - ((u_long) vi + sizeof(struct air_vinfo_rsp)); - - /* - * Print a header - */ - printf(DRIVER_STATS_HDR, get_adapter_name(vi->avsp_intf)); - - /* - * Print the driver info - */ - printf("%4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld %4ld\n", - stats->st_drv.drv_xm_notact, - stats->st_drv.drv_xm_full, - stats->st_drv.drv_xm_maxpdu, - stats->st_drv.drv_xm_segnoal, - stats->st_drv.drv_xm_seglen, - stats->st_drv.drv_xm_segdma, - stats->st_drv.drv_rv_novcc, - stats->st_drv.drv_rv_nosbf, - stats->st_drv.drv_rv_nomb, - stats->st_drv.drv_rv_ifull, - stats->st_drv.drv_bf_segdma, - stats->st_drv.drv_cm_full, - stats->st_drv.drv_cm_nodma); - -} Property changes on: head/sbin/atm/atm/atm_fore200.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm_inet.c =================================================================== --- head/sbin/atm/atm/atm_inet.c (revision 179307) +++ head/sbin/atm/atm/atm_inet.c (nonexistent) @@ -1,154 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * IP support - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Process add command for a TCP/IP PVC - * - * Command format: - * atm add pvc IP - * | dynamic - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * app pointer to AIOCAPVC structure - * intp pointer to air_int_rsp structure with information - * about the physical interface that is the PVC is for. - * - * Returns: - * none - * - */ -void -ip_pvcadd(int argc, char **argv, const struct cmd *cmdp, - struct atmaddreq *app, struct air_int_rsp *intp) -{ - char *cp; - char nhelp[128]; - u_int netif_no; - u_int i, netif_pref_len; - - /* - * Yet more validation - */ - if (argc < 2) { - strcpy(nhelp, cmdp->help); - cp = strstr(nhelp, ""); - if (cp) - strcpy(cp, "ip {dyn|}"); - fprintf(stderr, "%s: Invalid number of arguments:\n", - prog); - fprintf(stderr, "\tformat is: %s%s %s\n", - prefix, cmdp->name, nhelp); - exit(1); - } - - /* - * Validate and set network interface - */ - bzero(app->aar_pvc_intf, sizeof(app->aar_pvc_intf)); - netif_pref_len = strlen(intp->anp_nif_pref); - cp = &argv[0][netif_pref_len]; - netif_no = (u_int)strtoul(cp, NULL, 10); - for (i = 0; i < strlen(cp); i++) { - if (cp[i] < '0' || cp[i] > '9') { - netif_no = -1; - break; - } - } - if (strlen(argv[0]) > sizeof(app->aar_pvc_intf) - 1) - errx(1, "Illegal network interface name '%s'", argv[0]); - - if (strncasecmp(intp->anp_nif_pref, argv[0], netif_pref_len) || - strlen(argv[0]) <= netif_pref_len || netif_no >= intp->anp_nif_cnt) - errx(1, "network interface %s is not associated with " - "interface %s", argv[0], intp->anp_intf); - - strcpy(app->aar_pvc_intf, argv[0]); - argc--; - argv++; - - /* - * Set PVC destination address - */ - bzero(&app->aar_pvc_dst, sizeof(struct sockaddr)); - if (strcasecmp(argv[0], "dynamic") == 0 || - strcasecmp(argv[0], "dyn") == 0) { - - /* - * Destination is dynamically determined - */ - app->aar_pvc_flags |= PVC_DYN; - } else { - - /* - * Get destination IP address - */ - struct sockaddr_in *sain, *ret; - - sain = (struct sockaddr_in *)(void *)&app->aar_pvc_dst; - ret = get_ip_addr(argv[0]); - if (ret == NULL) - errx(1, "%s: bad ip address '%s'", argv[-1], argv[0]); - sain->sin_addr.s_addr = ret->sin_addr.s_addr; - } - argc--; argv++; -} - Property changes on: head/sbin/atm/atm/atm_inet.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm_set.c =================================================================== --- head/sbin/atm/atm/atm_set.c (revision 179307) +++ head/sbin/atm/atm/atm_set.c (nonexistent) @@ -1,528 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Routines for "set" subcommand - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Process ATM ARP server set command - * - * Command format: - * atm set arpserver ... - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -set_arpserver(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int rc, s; - u_int i; - ssize_t len; - size_t prefix_len = 0; - char *intf; - Atm_addr server; - struct sockaddr_in *lis; - struct sockaddr_in if_mask; - struct atmsetreq asr; - struct atminfreq air; - struct air_netif_rsp *int_info; - struct { - struct in_addr ip_addr; - struct in_addr ip_mask; - } prefix_buf[64];; - - /* - * Validate interface name - */ - check_netif_name(argv[0]); - intf = argv[0]; - argc--; argv++; - - /* - * Get the ARP server's ATM address - */ - bzero(&server, sizeof(server)); - if (strcasecmp(argv[0], "local")) { - /* - * ARP server NSAP address is provided - */ - server.address_format = T_ATM_ENDSYS_ADDR; - server.address_length = sizeof(Atm_addr_nsap); - if (get_hex_atm_addr(argv[0], - (u_char *)server.address, - sizeof(Atm_addr_nsap)) != - sizeof(Atm_addr_nsap)) { - fprintf(stderr, "%s: Invalid ARP server address\n", - prog); - exit(1); - } - if (argc > 1) { - fprintf(stderr, "%s: Invalid number of arguments\n", - prog); - exit(1); - } - prefix_len = 0; - } else { - argc--; argv++; - - /* - * This host is the ARP server - */ - server.address_format = T_ATM_ABSENT; - server.address_length = 0; - - /* - * Get interface information from the kernel. We need - * to get the IP address and the subnet mask associated - * with the network interface and insert them into the - * list of permitted LIS prefixes. - */ - bzero(&air, sizeof(air)); - air.air_opcode = AIOCS_INF_NIF; - strcpy(air.air_int_intf, intf); - len = do_info_ioctl(&air, sizeof(struct air_netif_rsp)); - if (len == -1) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - intf); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - exit(1); - } - int_info = (struct air_netif_rsp *) air.air_buf_addr; - lis = (struct sockaddr_in *)(void *)&int_info->anp_proto_addr; - prefix_buf[0].ip_addr = lis->sin_addr; - free(int_info); - - rc = get_subnet_mask(intf, &if_mask); - if (rc) { - fprintf(stderr, "%s: Can't get subnet mask for %s\n", - prog, intf); - } - prefix_buf[0].ip_mask = if_mask.sin_addr; - prefix_buf[0].ip_addr.s_addr &= - prefix_buf[0].ip_mask.s_addr; - - /* - * Get the prefixes of the LISs that we'll support - */ - for (i = 1; argc; i++, argc--, argv++) { - rc = parse_ip_prefix(argv[0], - (struct in_addr *)&prefix_buf[i]); - if (rc != 0) { - fprintf(stderr, "%s: Invalid IP prefix value \'%s\'\n", - prog, argv[0]); - exit(1); - } - } - - /* - * Compress the prefix list - */ - prefix_len = compress_prefix_list((struct in_addr *)prefix_buf, - i * sizeof(struct in_addr) * 2); - } - - /* - * Build ioctl request - */ - bzero(&asr, sizeof(asr)); - asr.asr_opcode = AIOCS_SET_ASV; - strncpy(asr.asr_arp_intf, intf, sizeof(asr.asr_arp_intf)); - asr.asr_arp_addr = server; - asr.asr_arp_subaddr.address_format = T_ATM_ABSENT; - asr.asr_arp_subaddr.address_length = 0; - if (prefix_len) - asr.asr_arp_pbuf = (caddr_t)prefix_buf; - else - asr.asr_arp_pbuf = (caddr_t)0; - asr.asr_arp_plen = prefix_len; - - /* - * Pass the new ARP server address to the kernel - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCSET, (caddr_t)&asr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EOPNOTSUPP: - case EPROTONOSUPPORT: - perror("Internal error"); - break; - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case ENOMEM: - fprintf(stderr, "Kernel memory exhausted\n"); - break; - case ENETDOWN: - fprintf(stderr, "ATM network is inoperable\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use set subcommand\n"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM interface\n", intf); - break; - case ENOENT: - fprintf(stderr, "Signalling manager not attached\n"); - break; - case ENOPROTOOPT: - fprintf(stderr, - "%s does not have an IP address configured\n", - intf); - break; - default: - perror("Ioctl (AIOCSET) ARPSERVER address"); - break; - } - exit(1); - } - - (void)close(s); -} - - -/* - * Process set MAC address command - * - * Command format: - * atm set mac - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -set_macaddr(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int s; - char *intf; - struct mac_addr mac; - struct atmsetreq asr; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(asr.asr_mac_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - intf = argv[0]; - argc--; argv++; - - /* - * Get the MAC address provided by the user - */ - if (get_hex_atm_addr(argv[0], (u_char *)&mac, sizeof(mac)) != - sizeof(mac)) { - fprintf(stderr, "%s: Invalid MAC address\n", prog); - exit(1); - } - - /* - * Build ioctl request - */ - asr.asr_opcode = AIOCS_SET_MAC; - strncpy(asr.asr_mac_intf, intf, sizeof(asr.asr_mac_intf)); - bcopy(&mac, &asr.asr_mac_addr, sizeof(asr.asr_mac_addr)); - - /* - * Pass the new address to the kernel - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCSET, (caddr_t)&asr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EOPNOTSUPP: - case EPROTONOSUPPORT: - perror("Internal error"); - break; - case EADDRINUSE: - fprintf(stderr, "Interface must be detached to set MAC addres\n"); - break; - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case ENOMEM: - fprintf(stderr, "Kernel memory exhausted\n"); - break; - case ENETDOWN: - fprintf(stderr, "ATM network is inoperable\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use set subcommand\n"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("Ioctl (AIOCSET) MAC address"); - break; - } - exit(1); - } - - (void)close(s); -} - - -/* - * Process network interface set command - * - * Command format: - * atm set netif - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -set_netif(int argc, char **argv, const struct cmd *cmdp __unused) -{ - struct atmsetreq anr; - char str[16]; - char *cp; - int s; - u_long nifs; - - /* - * Set IOCTL opcode - */ - anr.asr_opcode = AIOCS_SET_NIF; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(anr.asr_nif_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - strcpy(anr.asr_nif_intf, argv[0]); - argc--; argv++; - - /* - * Validate network interface name prefix - */ - if ((strlen(argv[0]) > sizeof(anr.asr_nif_pref) - 1) || - (strpbrk(argv[0], "0123456789"))) { - fprintf(stderr, "%s: Illegal network interface prefix\n", prog); - exit(1); - } - strcpy(anr.asr_nif_pref, argv[0]); - argc--; argv++; - - /* - * Validate interface count - */ - errno = 0; - nifs = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || nifs > MAX_NIFS) { - fprintf(stderr, "%s: Invalid interface count\n", prog); - exit(1); - } - anr.asr_nif_cnt = nifs; - - /* - * Make sure the resulting name won't be too long - */ - sprintf(str, "%lu", nifs - 1); - if ((strlen(str) + strlen(anr.asr_nif_pref)) > - sizeof(anr.asr_nif_intf) - 1) { - fprintf(stderr, "%s: Network interface prefix too long\n", prog); - exit(1); - } - - /* - * Tell the kernel to do it - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCSET, (caddr_t)&anr) < 0) { - fprintf(stderr, "%s: ", prog); - perror("ioctl (AIOCSET) set NIF"); - exit(1); - } - (void)close(s); -} - - -/* - * Process set NSAP prefix command - * - * Command format: - * atm set nsap - * - * Arguments: - * argc number of remaining arguments to command - * argv pointer to remaining argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -void -set_prefix(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int s; - char *intf; - u_char pfx[13]; - struct atmsetreq asr; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(asr.asr_prf_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - intf = argv[0]; - argc--; argv++; - - /* - * Get the prefix provided by the user - */ - if (get_hex_atm_addr(argv[0], pfx, sizeof(pfx)) != sizeof(pfx)) { - fprintf(stderr, "%s: Invalid NSAP prefix\n", prog); - exit(1); - } - - /* - * Build ioctl request - */ - asr.asr_opcode = AIOCS_SET_PRF; - strncpy(asr.asr_prf_intf, intf, sizeof(asr.asr_prf_intf)); - bcopy(pfx, asr.asr_prf_pref, sizeof(asr.asr_prf_pref)); - - /* - * Pass the new prefix to the kernel - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCSET, (caddr_t)&asr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EOPNOTSUPP: - case EPROTONOSUPPORT: - perror("Internal error"); - break; - case EALREADY: - fprintf(stderr, "NSAP prefix is already set\n"); - break; - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case ENOMEM: - fprintf(stderr, "Kernel memory exhausted\n"); - break; - case ENETDOWN: - fprintf(stderr, "ATM network is inoperable\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use set subcommand\n"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - default: - perror("Ioctl (AIOCSET) NSAP prefix"); - break; - } - exit(1); - } - - (void)close(s); -} Property changes on: head/sbin/atm/atm/atm_set.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm.c =================================================================== --- head/sbin/atm/atm/atm.c (revision 179307) +++ head/sbin/atm/atm/atm.c (nonexistent) @@ -1,1143 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Main routine - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Usage string - */ -#define USAGE_STR "Interface management subcommands:\n\ - attach \n\ - detach \n\ - set mac \n\ - set netif \n\ - set prefix \n\ - show config []\n\ - show interface []\n\ - show netif []\n\ - show stats interface [ phy | dev | atm | aal0 | aal4 |\n\ - aal5 | driver]\n\ -\n\ -VC management subcommands:\n\ - add pvc ...\n\ - [UBR | CBR | VBR ]\n\ - delete pvc \n\ - delete svc \n\ - show stats vcc [ [vpi [vci]]]\n\ - show vcc [ [ [] | SVC | PVC]]\n\ -\n\ -IP management subcommands:\n\ - add arp [] \n\ - add pvc IP |\n\ - dynamic\n\ - delete arp [] \n\ - set arpserver ...\n\ - show arp []\n\ - show arpserver []\n\ - show ipvcc [ | ]\n\ -\n\ -Miscellaneous subcommands:\n\ - help\n\ - show version\n" - - -/* - * Local definitions - */ -static int do_cmd(const struct cmd *, int, char **); -static void usage(const struct cmd *, const char *); - -static void attach(int, char **, const struct cmd *); -static void detach(int, char **, const struct cmd *); -static void help(int, char **, const struct cmd *); -static void arp_add(int, char **, const struct cmd *); -static void pvc_add(int, char **, const struct cmd *); -static void pvc_dlt(int, char **, const struct cmd *); -static void svc_dlt(int, char **, const struct cmd *); -static void arp_dlt(int, char **, const struct cmd *); -static void vcc_dlt(int, char **, const struct cmd *, struct atmdelreq *); - -static const struct cmd add_subcmd[]; -static const struct cmd dlt_subcmd[]; -static const struct cmd set_subcmd[]; -static const struct cmd show_subcmd[]; -static const struct cmd stats_subcmd[]; - -static const struct cmd cmds[] = { - { "add", 0, 0, NULL, (const char *)add_subcmd }, - { "attach", 2, 2, attach, " " }, - { "delete", 0, 0, NULL, (const char *)dlt_subcmd }, - { "detach", 1, 1, detach, "" }, - { "set", 0, 0, NULL, (const char *)set_subcmd }, - { "show", 0, 0, NULL, (const char *)show_subcmd }, - { "help", 0, 99, help, "" }, - { 0, 0, 0, NULL, "" } -}; - -static const struct cmd add_subcmd[] = { - { "arp", 2, 3, arp_add, "[] " }, - { "pvc", 6, 16, pvc_add, " ... [UBR | CBR | VBR]" }, - { 0, 0, 0, NULL, "" } -}; - -static const struct cmd dlt_subcmd[] = { - { "arp", 1, 2, arp_dlt, "[] " }, - { "pvc", 3, 3, pvc_dlt, " " }, - { "svc", 3, 3, svc_dlt, " " }, - { 0, 0, 0, NULL, "" } -}; - -static const struct cmd set_subcmd[] = { - { "arpserver", 2, 18, set_arpserver, " " }, - { "mac", 2, 2, set_macaddr, " " }, - { "netif", 3, 3, set_netif, " " }, - { "prefix", 2, 2, set_prefix, " " }, - { 0, 0, 0, NULL, ""} -}; - -static const struct cmd show_subcmd[] = { - { "arp", 0, 1, show_arp, "[]" }, - { "arpserver", 0, 1, show_arpserv, "[]" }, - { "config", 0, 1, show_config, "[]" }, - { "interface", 0, 1, show_intf, "[]" }, - { "ipvcc", 0, 3, show_ip_vcc, "[ | ]" }, - { "netif", 0, 1, show_netif, "[]" }, - { "stats", 0, 3, NULL, (const char *)stats_subcmd }, - { "vcc", 0, 3, show_vcc, "[] [ [] | SVC | PVC]" }, - { "version", 0, 0, show_version, "" }, - { 0, 0, 0, NULL, "" } -}; - -static const struct cmd stats_subcmd[] = { - { "interface", 0, 2, show_intf_stats, "[ [cfg | phy | dev | atm | aal0 | aal4 | aal5 | driver]]" }, - { "vcc", 0, 3, show_vcc_stats, "[ [vpi [vci]]]" }, - { 0, 0, 0, NULL, "" } -}; - - -/* - * Supported signalling protocols - */ -static const struct proto protos[] = { - { "SIGPVC", ATM_SIG_PVC }, - { "SPANS", ATM_SIG_SPANS }, - { "UNI30", ATM_SIG_UNI30 }, - { "UNI31", ATM_SIG_UNI31 }, - { "UNI40", ATM_SIG_UNI40 }, - { 0, 0 } -}; - -/* - * Supported VCC owners - */ -static const struct owner owners[] = { - { "IP", ENDPT_IP, ip_pvcadd }, - { "SPANS", ENDPT_SPANS_SIG,0 }, - { "SPANS CLS", ENDPT_SPANS_CLS,0 }, - { "UNI SIG", ENDPT_UNI_SIG, 0 }, - { 0, 0, 0 } -}; - -/* - * Supported AAL parameters - */ -const struct aal aals[] = { - { "Null", ATM_AAL0 }, - { "AAL0", ATM_AAL0 }, - { "AAL1", ATM_AAL1 }, - { "AAL2", ATM_AAL2 }, - { "AAL4", ATM_AAL3_4 }, - { "AAL3", ATM_AAL3_4 }, - { "AAL3/4", ATM_AAL3_4 }, - { "AAL5", ATM_AAL5 }, - { 0, 0 }, -}; - -/* - * Supported VCC encapsulations - */ -const struct encaps encaps[] = { - { "Null", ATM_ENC_NULL }, - { "None", ATM_ENC_NULL }, - { "LLC/SNAP", ATM_ENC_LLC }, - { "LLC", ATM_ENC_LLC }, - { "SNAP", ATM_ENC_LLC }, - { 0, 0 }, -}; - -/* - * Supported ATM traffic types - */ -struct traffics traffics[] = { - { "UBR", T_ATM_UBR, 1, "UBR " }, - { "CBR", T_ATM_CBR, 1, "CBR " }, - { "VBR", T_ATM_VBR, 3, "VBR " }, -#ifdef notyet - { "ABR", T_ATM_ABR, 2, "ABR " }, -#endif - { NULL, 0, 0, NULL } -}; - -char *prog; -char prefix[128] = ""; - -int -main(int argc, char *argv[]) -{ - int error; - - /* - * Save program name, ignoring any path components - */ - if ((prog = (char *)strrchr(argv[0], '/')) != NULL) - prog++; - else - prog = argv[0]; - - if (argc < 2) { - usage(cmds, ""); - exit(1); - } - argc--; argv++; - - /* - * Validate and process command - */ - if ((error = do_cmd(cmds, argc, argv)) != 0) - usage(cmds, ""); - - exit(error); -} - - -/* - * Validate and process user command - * - * Arguments: - * descp pointer to command description array - * argc number of arguments left in command - * argv pointer to argument strings - * - * Returns: - * none - * - */ -static int -do_cmd(const struct cmd *descp, int argc, char **argv) -{ - const struct cmd *cmdp = NULL; - - /* - * Make sure we have paramaters to process - */ - if (!argc) { - usage(cmds, ""); - exit(1); - } - - /* - * Figure out what command user wants - */ - for (; descp->name; descp++) { - /* - * Use an exact match if there is one - */ - if (!strcasecmp(descp->name, argv[0])) { - cmdp = descp; - break; - } - /* - * Look for a match on the first part of keyword - */ - if (!strncasecmp(descp->name, argv[0], strlen(argv[0]))) { - if (cmdp) { - fprintf(stderr, "%s: Ambiguous parameter \"%s\"\n", - prog, argv[0]); - exit(1); - } - cmdp = descp; - } - } - if (!cmdp) - return(1); - argc--; argv++; - - /* - * See if this command has subcommands - */ - if (cmdp->func == NULL) { - strcat(prefix, cmdp->name); - strcat(prefix, " "); - return (do_cmd((const struct cmd *)(const void *)cmdp->help, - argc, argv)); - } - - /* - * Minimal validation - */ - if ((argc < cmdp->minp) || (argc > cmdp->maxp)) { - fprintf(stderr, "%s: Invalid number of arguments\n", - prog); - fprintf(stderr, "\tformat is: %s%s %s\n", - prefix, cmdp->name, cmdp->help); - exit(1); - } - - /* - * Process command - */ - (*cmdp->func)(argc, argv, cmdp); - return(0); -} - - -/* - * Print command usage information - * - * Arguments: - * cmdp pointer to command description - * pref pointer current command prefix - * - * Returns: - * none - * - */ -static void -usage(const struct cmd *cmdp __unused, const char *pref __unused) -{ - fprintf(stderr, "usage: %s command [arg] [arg]...\n", prog); - fprintf(stderr, USAGE_STR); -} - - -/* - * Process interface attach command - * - * Command format: - * atm attach - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -attach(int argc __unused, char **argv, const struct cmd *cmdp __unused) -{ - struct atmcfgreq aar; - const struct proto *prp; - int s; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(aar.acr_att_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - - /* - * Find/validate requested signalling protocol - */ - for (prp = protos; prp->p_name; prp++) { - if (strcasecmp(prp->p_name, argv[1]) == 0) - break; - } - if (prp->p_name == NULL) { - fprintf(stderr, "%s: Unknown signalling protocol\n", prog); - exit(1); - } - - - /* - * Build ioctl request - */ - aar.acr_opcode = AIOCS_CFG_ATT; - strncpy(aar.acr_att_intf, argv[0], sizeof(aar.acr_att_intf)); - aar.acr_att_proto = prp->p_id; - - /* - * Tell the kernel to do the attach - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCCFG, (caddr_t)&aar) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EINVAL: - case EOPNOTSUPP: - case EPROTONOSUPPORT: - perror("Internal error"); - break; - case ENOMEM: - fprintf(stderr, "Kernel memory exhausted\n"); - break; - case EEXIST: - fprintf(stderr, "Signalling manager already attached to %s\n", - argv[0]); - break; - case ENETDOWN: - fprintf(stderr, "ATM network is inoperable\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use attach subcommand\n"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - argv[0]); - break; - case ETOOMANYREFS: - fprintf(stderr, "%s has too few or too many network interfaces\n", - argv[0]); - break; - default: - perror("Ioctl (AIOCCFG) attach"); - break; - } - exit(1); - } - (void)close(s); -} - - -/* - * Process interface detach command - * - * Command format: - * atm detach - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -detach(int argc __unused, char **argv, const struct cmd *cmdp __unused) -{ - struct atmcfgreq adr; - int s; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(adr.acr_det_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - - /* - * Build ioctl request - */ - adr.acr_opcode = AIOCS_CFG_DET; - strncpy(adr.acr_det_intf, argv[0], sizeof(adr.acr_det_intf)); - - /* - * Tell the kernel to do the detach - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCCFG, (caddr_t)&adr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EALREADY: - fprintf(stderr, "Signalling manager already detaching from %s\n", - argv[0]); - break; - case EINVAL: - perror("Internal error"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use detach subcommand\n"); - break; - default: - perror("ioctl (AIOCCFG) detach"); - break; - } - exit(1); - } - (void)close(s); -} - - -/* - * Process PVC add command - * - * Command format: - * atm add PVC - * ...owner info... - * [ubr | cbr | vbr ] - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -pvc_add(int argc, char **argv, const struct cmd *cmdp) -{ - struct atmaddreq apr; - struct atminfreq air; - struct air_int_rsp *int_info; - const struct owner *owp; - const struct aal *alp; - const struct encaps *enp; - const struct traffics *trafp; - char *cp; - u_long v; - ssize_t buf_len; - int s; - - /* - * Initialize opcode and flags - */ - apr.aar_opcode = AIOCS_ADD_PVC; - apr.aar_pvc_flags = 0; - - /* - * Validate interface name and issue an information - * request IOCTL for the interface - */ - if (strlen(argv[0]) > sizeof(apr.aar_pvc_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - bzero(air.air_int_intf, sizeof(air.air_int_intf)); - strcpy(air.air_int_intf, argv[0]); - air.air_opcode = AIOCS_INF_INT; - buf_len = do_info_ioctl(&air, sizeof(struct air_int_rsp)); - if (buf_len == -1) { - switch (errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - err(1, "Internal error"); - case ENXIO: - errx(1, "%s is not an ATM device", argv[0]); - default: - err(1, "ioctl (AIOCINFO)"); - } - } - int_info = (struct air_int_rsp *)(void *)air.air_buf_addr; - strcpy(apr.aar_pvc_intf, argv[0]); - argc--; - argv++; - - /* - * Validate vpi/vci values - */ - errno = 0; - v = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v >= 1 << 8) - errx(1, "Invalid VPI value '%s'", argv[0]); - apr.aar_pvc_vpi = (u_short)v; - argc--; - argv++; - - errno = 0; - v = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v < MIN_VCI || v >= 1 << 16) - errx(1, "Invalid VCI value '%s'", argv[0]); - apr.aar_pvc_vci = (u_short)v; - argc--; - argv++; - - /* - * Validate requested PVC AAL - */ - for (alp = aals; alp->a_name; alp++) { - if (strcasecmp(alp->a_name, argv[0]) == 0) - break; - } - if (alp->a_name == NULL) - errx(1, "Invalid PVC AAL '%s'", argv[0]); - apr.aar_pvc_aal = alp->a_id; - argc--; - argv++; - - /* - * Validate requested PVC encapsulation - */ - for (enp = encaps; enp->e_name; enp++) { - if (strcasecmp(enp->e_name, argv[0]) == 0) - break; - } - if (enp->e_name == NULL) - errx(1, "Invalid PVC encapsulation '%s'", argv[0]); - apr.aar_pvc_encaps = enp->e_id; - argc--; - argv++; - - /* - * Validate requested PVC owner - */ - for (owp = owners; owp->o_name; owp++) { - if (strcasecmp(owp->o_name, argv[0]) == 0) - break; - } - if (owp->o_name == NULL) - errx(1, "Unknown PVC owner '%s'", argv[0]); - apr.aar_pvc_sap = owp->o_sap; - if (owp->o_pvcadd == NULL) - errx(1, "Unsupported PVC owner '%s'", argv[0]); - argc--; - argv++; - - /* - * Perform service user processing - */ - (*owp->o_pvcadd)(argc, argv, cmdp, &apr, int_info); - - argc -= 2; - argv += 2; - - if (argc > 0) { - /* - * Validate requested traffic - */ - for (trafp = traffics; trafp->t_name; trafp++) { - if (strcasecmp(trafp->t_name, argv[0]) == 0) - break; - } - if (trafp->t_name == NULL) - errx(1, "Unknown traffic type '%s'", argv[0]); - apr.aar_pvc_traffic_type = trafp->t_type; - argc--; - argv++; - - if (trafp->t_argc != argc) - errx(1, "Invalid traffic parameters\n\t %s", - trafp->help); - switch (trafp->t_type) { - - case T_ATM_UBR: - case T_ATM_CBR: - errno = 0; - v = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v >= 1 << 24) - errx(1, "Invalid PCR value '%s'", argv[0]); - apr.aar_pvc_traffic.forward.PCR_high_priority = (int32_t) v; - apr.aar_pvc_traffic.forward.PCR_all_traffic = (int32_t) v; - apr.aar_pvc_traffic.backward.PCR_high_priority = (int32_t) v; - apr.aar_pvc_traffic.backward.PCR_all_traffic = (int32_t) v; - argc--; - argv++; - apr.aar_pvc_traffic.forward.SCR_high_priority = T_ATM_ABSENT; - apr.aar_pvc_traffic.forward.SCR_all_traffic = T_ATM_ABSENT; - apr.aar_pvc_traffic.backward.SCR_high_priority = T_ATM_ABSENT; - apr.aar_pvc_traffic.backward.SCR_all_traffic = T_ATM_ABSENT; - apr.aar_pvc_traffic.forward.MBS_high_priority = T_ATM_ABSENT; - apr.aar_pvc_traffic.forward.MBS_all_traffic = T_ATM_ABSENT; - apr.aar_pvc_traffic.backward.MBS_high_priority = T_ATM_ABSENT; - apr.aar_pvc_traffic.backward.MBS_all_traffic = T_ATM_ABSENT; - break; - - case T_ATM_VBR: /* VBR pcr scr mbs */ - errno = 0; - v = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v >= 1 << 24) - errx(1, "Invalid PCR value '%s'", argv[0]); - apr.aar_pvc_traffic.forward.PCR_high_priority = (int32_t)v; - apr.aar_pvc_traffic.forward.PCR_all_traffic = (int32_t)v; - apr.aar_pvc_traffic.backward.PCR_high_priority = (int32_t)v; - apr.aar_pvc_traffic.backward.PCR_all_traffic = (int32_t)v; - argc--; - argv++; - - errno = 0; - v = strtoul(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v >= 1 << 24) - errx(1, "Invalid SCR value '%s'", argv[0]); - apr.aar_pvc_traffic.forward.SCR_high_priority = (int32_t)v; - apr.aar_pvc_traffic.forward.SCR_all_traffic = (int32_t)v; - apr.aar_pvc_traffic.backward.SCR_high_priority = (int32_t)v; - apr.aar_pvc_traffic.backward.SCR_all_traffic = (int32_t)v; - argc--; - argv++; - - errno = 0; - v = strtol(argv[0], &cp, 0); - if (errno != 0 || *cp != '\0' || v >= 1 << 24) - errx(1, "Invalid MBS value '%s'", argv[0]); - apr.aar_pvc_traffic.forward.MBS_high_priority = (int32_t)v; - apr.aar_pvc_traffic.forward.MBS_all_traffic = (int32_t)v; - apr.aar_pvc_traffic.backward.MBS_high_priority = (int32_t)v; - apr.aar_pvc_traffic.backward.MBS_all_traffic = (int32_t)v; - argc--; - argv++; - - break; - - case T_ATM_ABR: - errx(1, "ABR not yet supported"); - - default: - errx(1, "Unsupported traffic type '%d'", trafp->t_type); - } - } else { - /* - * No PVC traffic type - */ - apr.aar_pvc_traffic_type = T_ATM_NULL; - } - if (argc > 0) - errx(1, "Too many parameters"); - - /* - * Tell the kernel to add the PVC - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCADD, (caddr_t)&apr) < 0) { - switch (errno) { - case EPROTONOSUPPORT: - case ENOPROTOOPT: - err(1, "Internal error"); - case EINVAL: - errx(1, "Invalid parameter"); - case EEXIST: - errx(1, "PVC already exists"); - break; - case ENETDOWN: - errx(1, "ATM network is inoperable"); - break; - case ENOMEM: - errx(1, "Kernel memory exhausted"); - break; - case EPERM: - errx(1, "Must be super user to use add subcommand"); - break; - case ERANGE: - errx(1, "Invalid VPI or VCI value"); - break; - default: - err(1, "ioctl (AIOCADD) add PVC"); - } - } - (void)close(s); -} - - -/* - * Process ARP add command - * - * Command formats: - * atm add arp [] - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -arp_add(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int len, s; - struct atmaddreq apr; - Atm_addr host_atm; - struct sockaddr_in *sain; - union { - struct sockaddr_in sain; - struct sockaddr sa; - } host_ip; - - /* - * Initialize add request structure - */ - bzero(&apr, sizeof(apr)); - - /* - * Get network interface name if one is present - */ - if (argc == 3) { - check_netif_name(argv[0]); - strcpy(apr.aar_arp_intf, argv[0]); - argc--; argv++; - } - - /* - * Get IP address of specified host name - */ - bzero(&host_ip, sizeof(host_ip)); - host_ip.sa.sa_family = AF_INET; - sain = get_ip_addr(argv[0]); - host_ip.sain.sin_addr.s_addr = sain->sin_addr.s_addr; - argc--; argv++; - - /* - * Get specified ATM address - */ - len = get_hex_atm_addr(argv[0], (u_char *)host_atm.address, - sizeof(Atm_addr_nsap)); - switch(len) { - case sizeof(Atm_addr_nsap): - host_atm.address_format = T_ATM_ENDSYS_ADDR; - host_atm.address_length = sizeof(Atm_addr_nsap); - break; - case sizeof(Atm_addr_spans): - host_atm.address_format = T_ATM_SPANS_ADDR; - host_atm.address_length = sizeof(Atm_addr_spans); - break; - default: - fprintf(stderr, "%s: Invalid ATM address\n", prog); - exit(1); - } - - /* - * Build IOCTL request - */ - apr.aar_opcode = AIOCS_ADD_ARP; - apr.aar_arp_dst = host_ip.sa; - ATM_ADDR_COPY(&host_atm, &apr.aar_arp_addr); - apr.aar_arp_origin = ARP_ORIG_PERM; - - /* - * Tell the kernel to add the ARP table entry - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCADD, (caddr_t)&apr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use add subcommand\n"); - break; - case EADDRNOTAVAIL: - fprintf(stderr, "IP address not valid for interface\n"); - break; - default: - perror("ioctl (AIOCADD) add"); - break; - } - exit(1); - } - (void)close(s); -} - - -/* - * Process PVC delete command - * - * Command formats: - * atm delete pvc - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -pvc_dlt(int argc, char **argv, const struct cmd *cmdp) -{ - struct atmdelreq apr; - - /* - * Set opcode - */ - apr.adr_opcode = AIOCS_DEL_PVC; - - /* - * Complete request by calling subroutine - */ - vcc_dlt(argc, argv, cmdp, &apr); -} - - -/* - * Process SVC delete command - * - * Command formats: - * atm delete svc - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -svc_dlt(int argc, char **argv, const struct cmd *cmdp) -{ - struct atmdelreq apr; - - /* - * Set opcode - */ - apr.adr_opcode = AIOCS_DEL_SVC; - - /* - * Complete request by calling subroutine - */ - vcc_dlt(argc, argv, cmdp, &apr); -} - - -/* - * Complete an SVC or PVC delete command - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * apr pointer to ATM delete IOCTL structure - * - * Returns: - * none - * - */ -static void -vcc_dlt(int argc, char **argv, const struct cmd *cmdp __unused, - struct atmdelreq *apr) -{ - char *cp; - long v; - int s; - - /* - * Validate interface name - */ - if (strlen(argv[0]) > sizeof(apr->adr_pvc_intf) - 1) { - fprintf(stderr, "%s: Illegal interface name\n", prog); - exit(1); - } - strcpy(apr->adr_pvc_intf, argv[0]); - argc--; argv++; - - /* - * Validate vpi/vci values - */ - v = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (v < 0) || (v >= 1 << 8)) { - fprintf(stderr, "%s: Invalid VPI value\n", prog); - exit(1); - } - apr->adr_pvc_vpi = (u_short) v; - argc--; argv++; - - v = strtol(argv[0], &cp, 0); - if ((*cp != '\0') || (v < MIN_VCI) || (v >= 1 << 16)) { - fprintf(stderr, "%s: Invalid VCI value\n", prog); - exit(1); - } - apr->adr_pvc_vci = (u_short) v; - argc--; argv++; - - /* - * Tell the kernel to delete the VCC - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCDEL, (caddr_t)apr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case ENOENT: - fprintf(stderr, "VCC not found\n"); - break; - case EALREADY: - fprintf(stderr, "VCC already being closed\n"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - apr->adr_pvc_intf); - break; - case EPERM: - fprintf(stderr, "Must be super user to use delete subcommand\n"); - break; - default: - perror("ioctl (AIOCDEL) delete"); - break; - } - exit(1); - } - (void)close(s); -} - - -/* - * Process ARP delete command - * - * Command formats: - * atm delete arp - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -arp_dlt(int argc, char **argv, const struct cmd *cmdp __unused) -{ - int s; - struct atmdelreq apr; - struct sockaddr_in *sain; - union { - struct sockaddr_in sain; - struct sockaddr sa; - } host_addr; - - /* - * Set opcode - */ - bzero(&apr, sizeof(apr)); - apr.adr_opcode = AIOCS_DEL_ARP; - - /* - * Get network interface name if one is present - */ - if (argc == 2) { - check_netif_name(argv[0]); - strcpy(apr.adr_arp_intf, argv[0]); - argc--; argv++; - } - - /* - * Get IP address of specified host name - */ - bzero(&host_addr, sizeof(host_addr)); - host_addr.sa.sa_family = AF_INET; - sain = get_ip_addr(argv[0]); - host_addr.sain.sin_addr.s_addr = sain->sin_addr.s_addr; - apr.adr_arp_dst = host_addr.sa; - - /* - * Tell the kernel to delete the ARP table entry - */ - s = socket(AF_ATM, SOCK_DGRAM, 0); - if (s < 0) { - sock_error(errno); - } - if (ioctl(s, AIOCDEL, (caddr_t)&apr) < 0) { - fprintf(stderr, "%s: ", prog); - switch (errno) { - case EINVAL: - fprintf(stderr, "Invalid parameter\n"); - break; - case EPERM: - fprintf(stderr, "Must be super user to use delete subcommand\n"); - break; - default: - perror("ioctl (AIOCDEL) delete"); - break; - } - exit(1); - } - (void)close(s); -} - - -/* - * Process help command - * - * Arguments: - * argc number of arguments to command - * argv pointer to argument strings - * cmdp pointer to command description - * - * Returns: - * none - * - */ -static void -help(int argc __unused, char **argv __unused, const struct cmd *cmdp __unused) -{ - usage(cmds, ""); -} Property changes on: head/sbin/atm/atm/atm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm_subr.c =================================================================== --- head/sbin/atm/atm/atm_subr.c (revision 179307) +++ head/sbin/atm/atm/atm_subr.c (nonexistent) @@ -1,626 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * General subroutines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "atm.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Table entry definition - */ -typedef struct { - int type; - const char *name; -} tbl_ent; - - -/* - * Table to translate vendor codes to ASCII - */ -static const tbl_ent vendors[] = { - { VENDOR_UNKNOWN, "Unknown" }, - { VENDOR_FORE, "Fore" }, - { VENDOR_ENI, "ENI" }, - { VENDOR_IDT, "IDT" }, - { VENDOR_PROSUM, "ProSum" }, - { VENDOR_NETGRAPH, "Netgraph" }, - { 0, 0 }, -}; - - -/* - * Table to translate adapter codes to ASCII - */ -static const tbl_ent adapter_types[] = { - { DEV_UNKNOWN, "Unknown" }, - { DEV_FORE_SBA200E, "SBA-200E" }, - { DEV_FORE_SBA200, "SBA-200" }, - { DEV_FORE_PCA200E, "PCA-200E" }, - { DEV_FORE_ESA200E, "ESA-200E" }, - { DEV_ENI_155P, "ENI-155p" }, - { DEV_IDT_155, "IDT" }, - { DEV_PROATM_25, "PROATM-25" }, - { DEV_PROATM_155, "PROATM-155" }, - { DEV_VATMPIF, "VATMPIF" }, - { DEV_FORE_LE25, "ForeLE-25" }, - { DEV_FORE_LE155, "ForeLE-155" }, - { DEV_IDT_25, "NICStAR-25" }, - { DEV_IDTABR_25, "IDT77252-25" }, - { DEV_IDTABR_155, "IDT77252-155" }, - { DEV_FORE_HE155, "ForeHE-155" }, - { DEV_FORE_HE622, "ForeHE-622" }, - { 0, 0 }, -}; - -/* - * Table to translate medium types to ASCII - */ -static const tbl_ent media_types[] = { - { MEDIA_UNKNOWN, "Unknown" }, - { MEDIA_TAXI_100, "100 Mbps 4B/5B" }, - { MEDIA_TAXI_140, "140 Mbps 4B/5B" }, - { MEDIA_OC3C, "OC-3c" }, - { MEDIA_OC12C, "OC-12c" }, - { MEDIA_UTP155, "155 Mbps UTP" }, - { MEDIA_UTP25, "25.6 Mbps UTP" }, - { MEDIA_VIRTUAL, "Virtual Link" }, - { MEDIA_DSL, "xDSL" }, - { 0, 0 }, -}; - -/* - * Table to translate bus types to ASCII - */ -static const tbl_ent bus_types[] = { - { BUS_UNKNOWN, "Unknown" }, - { BUS_SBUS_B16, "SBus" }, - { BUS_SBUS_B32, "SBus" }, - { BUS_PCI, "PCI" }, - { BUS_EISA, "EISA" }, - { BUS_USB, "USB" }, - { BUS_VIRTUAL, "Virtual" }, - { 0, 0 }, -}; - - -/* - * Get interface vendor name - * - * Return a character string with a vendor name, given a vendor code. - * - * Arguments: - * vendor vendor ID - * - * Returns: - * char * pointer to a string with the vendor name - * - */ -const char * -get_vendor(int vendor) -{ - int i; - - for(i=0; vendors[i].name; i++) { - if (vendors[i].type == vendor) - return(vendors[i].name); - } - - return("-"); -} - - -/* - * Get adapter type - * - * Arguments: - * dev adapter code - * - * Returns: - * char * pointer to a string with the adapter type - * - */ -const char * -get_adapter(int dev) -{ - int i; - - for(i=0; adapter_types[i].name; i++) { - if (adapter_types[i].type == dev) - return(adapter_types[i].name); - } - - return("-"); -} - - -/* - * Get communication medium type - * - * Arguments: - * media medium code - * - * Returns: - * char * pointer to a string with the name of the medium - * - */ -const char * -get_media_type(int media) -{ - int i; - - for(i=0; media_types[i].name; i++) { - if (media_types[i].type == media) - return(media_types[i].name); - } - - return("-"); -} - - -/* - * Get bus type - * - * Arguments: - * bus bus type code - * - * Returns: - * char * pointer to a string with the bus type - * - */ -const char * -get_bus_type(int bus) -{ - int i; - - for(i=0; bus_types[i].name; i++) { - if (bus_types[i].type == bus) - return(bus_types[i].name); - } - - return("-"); -} - - -/* - * Get adapter ID - * - * Get a string giving the adapter's vendor and type. - * - * Arguments: - * intf interface name - * - * Returns: - * char * pointer to a string identifying the adapter - * - */ -const char * -get_adapter_name(const char *intf) -{ - size_t buf_len; - struct atminfreq air; - struct air_cfg_rsp *cfg; - static char name[256]; - - /* - * Initialize - */ - bzero(&air, sizeof(air)); - bzero(name, sizeof(name)); - - /* - * Get configuration information from the kernel - */ - air.air_opcode = AIOCS_INF_CFG; - strcpy(air.air_cfg_intf, intf); - buf_len = do_info_ioctl(&air, sizeof(struct air_cfg_rsp)); - if (buf_len < sizeof(struct air_cfg_rsp)) - return("-"); - cfg = (struct air_cfg_rsp *)(void *)air.air_buf_addr; - - /* - * Build a string describing the adapter - */ - strcpy(name, get_vendor(cfg->acp_vendor)); - strcat(name, " "); - strcat(name, get_adapter(cfg->acp_device)); - - free(cfg); - - return(name); -} - - -/* - * Format a MAC address into a string - * - * Arguments: - * addr pointer to a MAC address - * - * Returns: - * the address of a string representing the MAC address - * - */ -const char * -format_mac_addr(const Mac_addr *addr) -{ - static char str[256]; - - /* - * Check for null pointer - */ - if (!addr) - return("-"); - - /* - * Clear the returned string - */ - bzero(str, sizeof(str)); - - /* - * Format the address - */ - sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", - addr->ma_data[0], - addr->ma_data[1], - addr->ma_data[2], - addr->ma_data[3], - addr->ma_data[4], - addr->ma_data[5]); - - return(str); -} - - -/* - * Parse an IP prefix designation in the form nnn.nnn.nnn.nnn/mm - * - * Arguments: - * cp pointer to prefix designation string - * op pointer to a pair of in_addrs for the result - * - * Returns: - * 0 success - * -1 prefix was invalid - * - */ -int -parse_ip_prefix(const char *cp, struct in_addr *op) -{ - int len; - char *mp; - struct in_addr ip_addr; - - static u_long masks[33] = { - 0x0, - 0x80000000, - 0xc0000000, - 0xe0000000, - 0xf0000000, - 0xf8000000, - 0xfc000000, - 0xfe000000, - 0xff000000, - 0xff800000, - 0xffc00000, - 0xffe00000, - 0xfff00000, - 0xfff80000, - 0xfffc0000, - 0xfffe0000, - 0xffff0000, - 0xffff8000, - 0xffffc000, - 0xffffe000, - 0xfffff000, - 0xfffff800, - 0xfffffc00, - 0xfffffe00, - 0xffffff00, - 0xffffff80, - 0xffffffc0, - 0xffffffe0, - 0xfffffff0, - 0xfffffff8, - 0xfffffffc, - 0xfffffffe, - 0xffffffff - }; - - /* - * Find the slash that marks the start of the mask - */ - mp = strchr(cp, '/'); - if (mp) { - *mp = '\0'; - mp++; - } - - /* - * Convert the IP-address part of the prefix - */ - ip_addr.s_addr = inet_addr(cp); - if (ip_addr.s_addr == INADDR_NONE) - return(-1); - - /* - * Set the default mask length - */ - if (IN_CLASSA(ntohl(ip_addr.s_addr))) - len = 8; - else if (IN_CLASSB(ntohl(ip_addr.s_addr))) - len = 16; - else if (IN_CLASSC(ntohl(ip_addr.s_addr))) - len = 24; - else - return(-1); - - /* - * Get the mask length - */ - if (mp) { - len = atoi(mp); - if (len < 1 || len > 32) - return(-1); - } - - /* - * Select the mask and copy the IP address into the - * result buffer, ANDing it with the mask - */ - op[1].s_addr = htonl(masks[len]); - op[0].s_addr = ip_addr.s_addr & op[1].s_addr; - - return(0); -} - - -/* - * Compress a list of IP network prefixes - * - * Arguments: - * ipp pointer to list of IP address/mask pairs - * ipc length of list - * - * Returns: - * length of compressed list - * - */ -size_t -compress_prefix_list(struct in_addr *ipp, size_t ilen) -{ - u_int i, j, n; - struct in_addr *ip1, *ip2, *m1, *m2; - - /* - * Figure out how many pairs there are - */ - n = ilen / (sizeof(struct in_addr) * 2); - - /* - * Check each pair of address/mask pairs to make sure - * none contains the other - */ - for (i = 0; i < n; i++) { - ip1 = &ipp[i*2]; - m1 = &ipp[i*2+1]; - - /* - * If we've already eliminated this address, - * skip the checks - */ - if (ip1->s_addr == 0) - continue; - - /* - * Try all possible second members of the pair - */ - for (j = i + 1; j < n; j++) { - ip2 = &ipp[j*2]; - m2 = &ipp[j*2+1]; - - /* - * If we've already eliminated the second - * address, just skip the checks - */ - if (ip2->s_addr == 0) - continue; - - /* - * Compare the address/mask pairs - */ - if (m1->s_addr == m2->s_addr) { - /* - * Masks are equal - */ - if (ip1->s_addr == ip2->s_addr) { - ip2->s_addr = 0; - m2->s_addr = 0; - } - } else if (ntohl(m1->s_addr) < - ntohl(m2->s_addr)) { - /* - * m1 is shorter - */ - if ((ip2->s_addr & m1->s_addr) == - ip1->s_addr) { - ip2->s_addr = 0; - m2->s_addr = 0; - } - } else { - /* - * m1 is longer - */ - if ((ip1->s_addr & m2->s_addr) == - ip2->s_addr) { - ip1->s_addr = 0; - m1->s_addr = 0; - break; - } - } - } - } - - /* - * Now pull up the list, eliminating zeroed entries - */ - for (i = 0, j = 0; i < n; i++) { - ip1 = &ipp[i*2]; - m1 = &ipp[i*2+1]; - ip2 = &ipp[j*2]; - m2 = &ipp[j*2+1]; - if (ip1->s_addr != 0) { - if (i != j) { - *ip2 = *ip1; - *m2 = *m1; - } - j++; - } - } - - return(j * sizeof(struct in_addr) * 2); -} - - -/* - * Make sure a user-supplied parameter is a valid network interface - * name - * - * When a socket call fails, print an error message and exit - * - * Arguments: - * nif pointer to network interface name - * - * Returns: - * none exits if name is not valid - * - */ -void -check_netif_name(const char *nif) -{ - int rc; - - /* - * Look up the name in the kernel - */ - rc = verify_nif_name(nif); - - /* - * Check the result - */ - if (rc > 0) { - /* - * Name is OK - */ - return; - } else if (rc == 0) { - /* - * Name is not valid - */ - fprintf(stderr, "%s: Invalid network interface name %s\n", - prog, nif); - } else { - /* - * Error performing IOCTL - */ - fprintf(stderr, "%s: ", prog); - switch(errno) { - case ENOPROTOOPT: - case EOPNOTSUPP: - perror("Internal error"); - break; - case ENXIO: - fprintf(stderr, "%s is not an ATM device\n", - nif); - break; - default: - perror("ioctl (AIOCINFO)"); - break; - } - } - - exit(1); -} - - -/* - * Socket error handler - * - * When a socket call fails, print an error message and exit - * - * Arguments: - * err an errno describing the error - * - * Returns: - * none - * - */ -void -sock_error(int err) -{ - fprintf(stderr, "%s: ", prog); - - switch (err) { - - case EPROTONOSUPPORT: - fprintf(stderr, "ATM protocol support not loaded\n"); - break; - - default: - perror("socket"); - break; - } - - exit(1); -} Property changes on: head/sbin/atm/atm/atm_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/Makefile =================================================================== --- head/sbin/atm/atm/Makefile (revision 179307) +++ head/sbin/atm/atm/Makefile (nonexistent) @@ -1,42 +0,0 @@ -# =================================== -# 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. -# -# @(#) $Id: Makefile,v 1.5 1998/07/10 16:01:58 jpt Exp $ -# $FreeBSD$ - -PROG= atm -SRCS= atm.c atm_fore200.c atm_inet.c atm_print.c \ - atm_set.c atm_show.c atm_subr.c -MAN= atm.8 - -.if ${MACHINE_ARCH} == "arm" -WARNS?= 3 -.else -WARNS?= 6 -.endif - -CFLAGS+= -I${.CURDIR}/../../../sys - -DPADD= ${LIBATM} -LDADD= -latm - -.include Property changes on: head/sbin/atm/atm/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm.8 =================================================================== --- head/sbin/atm/atm/atm.8 (revision 179307) +++ head/sbin/atm/atm/atm.8 (nonexistent) @@ -1,993 +0,0 @@ -.\" -.\" =================================== -.\" 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$ -.\" -.\" -.de EX \"Begin example -.ne 5 -.if n .sp 1 -.if t .sp .5 -.nf -.in +.5i -.. -.de EE -.fi -.in -.5i -.if n .sp 1 -.if t .sp .5 -.. -.TH ATM 8 "1998-08-20" "HARP" -.SH NAME -atm \- user configuration and display command for HARP ATM interface -.SH SYNOPSIS -Interface management subcommands: -.in +10 -.ti -5 -.B atm attach - -.ti -5 -.B atm detach - -.ti -5 -.B atm set MAC - -.ti -5 -.B atm set netif - -.ti -5 -.B atm set prefix - -.ti -5 -.B atm show config -[] -.ti -5 -.B atm show interface -[] -.ti -5 -.B atm show netif -[] -.ti -5 -.B atm show stats interface -[ [phy | dev | atm | aal0 | aal4 | aal5 | driver]] -.sp -.ti -10 -VCC management subcommands: -.ti -5 -.B atm add PVC - ... -.ti -5 -.B atm delete PVC - -.ti -5 -.B atm delete SVC - -.ti -5 -.B atm show stats VCC -[ [ []]] -.ti -5 -.B atm show VCC -[ [ [] | SVC | PVC]] -.sp -.ti -10 -IP management subcommands: -.ti -5 -.B atm add ARP -[] -.ti -5 -.B atm add PVC - IP [ | dynamic] ... -.ti -5 -.B atm delete ARP -[] -.ti -5 -.B atm set arpserver - | local [ ...] -.ti -5 -.B atm show ARP -[] -.ti -5 -.B atm show arpserver -[] -.ti -5 -.B atm show IPVCC -[ | ] -.ti -5 -.sp -.ti -10 -Miscellaneous subcommands: -.ti -5 -.B atm help -.ti -5 -.B atm show version -.in -10 -.fi -.SH DESCRIPTION -.I atm -configures and displays the status of the Host ATM Research Platform -(HARP) networking software. -The subcommands fall into several categories: -.PP -\fIInterface management\fP subcommands allow manipulation of the -ATM interface. -Functions include assigning a signalling manager to an interface, -setting the ATM address, associating network interfaces with -an interface, and displaying information about interfaces. -.PP -\fIVCC management\fP subcommands allow for managing ATM virtual -channel connections (VCCs). -Functions include opening and closing VCCs and displaying information -about them. -.PP -\fIIP management\fP subcommands allow for managing the interface -between IP and the ATM software. -Functions include displaying and manipulating the ATMARP cache, -opening a PVC connected to IP, -assigning an ATMARP server to a network interface, -and displaying information about IP VCCs. -.PP -\fIMiscellaneous\fP subcommands allow for displaying the version -of the ATM software and for getting help with the \fIatm\fP command. -.SS "Signalling Managers" -The signalling manager is responsible for the opening and closing of -VCCs. -Four signalling managers are supported: -.PP -.in +10 -.ti -5 -PVC - for PVCs only, -.ti -5 -SPANS - supports SPANS, FORE's proprietary signalling protocol, -.ti -5 -UNI 3.0 - supports the signalling protocol from The ATM Forum's -\fIATM User-Network Interface Specification, Version 3.0\fP. -.ti -5 -UNI 3.1 - supports the signalling protocol from The ATM Forum's -\fIATM User-Network Interface Specification, Version 3.1\fP. -.in -10 -.PP -All four signalling managers support the opening and closing of PVCs -(see the \fIadd\fP and \fIdelete\fP subcommands). -.PP -A signalling manager must be attached to a physical interface -(see the \fIattach\fP subcommand) -before any VCCs can be created on the interface. -.SS "Physical and Network Interfaces" -Two types of interfaces are supported: -physical interfaces and network interfaces. -A physical interface represents a physical point of attachment to an -ATM network. -A physical interface has an ATM address associated with it, except -when the PVC-only signalling manager is being used. -.PP -A network interface is a logical interface. -One or more network interfaces are associated with a physical -interface; each network interface has an IP address associated with it. -For UNI-controlled interfaces, there can be up to 256 network -interfaces associated with a physical interface. -In this case, the correspondence between the network interface and -the ATM address is determined by the selector field (the last -byte) of the physical interface's ATM address. -For PVC-only interfaces, there can be up to 256 logical interfaces -associated with each physical interface. -For interfaces controlled by the SPANS signalling manager, -there must be one and -only one network interface associated with each physical interface. -.SS "Keyword and Documentation Conventions" -Command and subcommand keywords can be abbreviated by simply giving -enough of the first part of the keyword to make it unique. -Thus, \fIatm sh v\fB gives the same result as \fIatm show vcc\fB. -.PP -All keywords are case-insensitive. -.PP -Where a host address needs to be given to the \fIatm\fP command, -either a DNS name or an IP address in dotted decimal format can -be used. -.PP -ATM addresses are specified as strings of hex digits, with an -optional leading "0x". -Fields within the address may be separated by periods, but periods -are for readability only and are ignored. -SPANS addresses are 8 bytes long, while NSAP-format addresses -are 20 bytes long. -The full address, including any leading zeroes, must be given. -For example: -.in +5 -0x47.0005.80.ffe100.0000.f21a.0170.0020481a0170.00 (NSAP format) -.br -0x00000010.f2050aa9 (SPANS format) -.in -5 -.fi -.SH SUBCOMMANDS -.SS Interface Management Subcommands: -.in +5 -.ti -5 -\fIatm add PVC ...\fP -.in -5 -.PP -the format of the \fIadd PVC\fP subcommand varies depending on the -owner of the PVC. -See the description under "IP Management Subcommands." -.PP -\fIatm attach \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface to which the -signalling manager is to be attached, -.ti -5 -\fI\fP specifies which signalling manager is to be attached. -Valid choices are "SIGPVC", "SPANS", "UNI30", and "UNI31". -.in -10 -.PP -This command attaches a signalling manager to an interface. -Until this is done, VCCs cannot be opened or closed. -Only one signalling manager at a time can be attached to an interface. -.PP -\fIatm detach \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface whose signalling -manager is to be detached. -.in -10 -.PP -This command detaches a signalling manager from an interface. -All VCCs that the signalling manager has created will be closed, -and no new VCCs can be created until a signalling manager (either -the same or a different one) is attached again. -.PP -\fIatm set MAC \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface whose -MAC address is to be set, -.ti -5 -\fI\fP specifies the 6-byte MAC part of the NSAP -address for the interface. -The MAC address is specified as a string of 12 hexadecimal -digits with an optional leading "0x". -Fields in the address may be separated by periods. -.in -10 -.PP -This command sets the MAC address for a UNI-controlled interface. -The first 13 bytes (the prefix) of the 20-byte NSAP-format address -are set by the \fIatm set prefix\fP command or the ILMI daemon -(\fIilmid\fP (8)), -the next 6 bytes (the End System Identifier (ESI)) are set by -this command, -and the last byte (the selector) will be determined by which -network interface is to be associated with the address. -.PP -The \fIatm set MAC\fP command can be used to override the MAC -address in the interface hardware. -.PP -\fIatm set netif \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface that the network -interface(s) are to be associated with, -.ti -5 -\fI\fP specifies the invariant part of the network -interface name, -.ti -5 -\fI\fP specifies the number of network interface to be -created. -.in -10 -.PP -This command creates one or more network interfaces and associates them -with the specified physical interface. -The network interface names are determined by the prefix and the count. -The names will be of the form , where is the -prefix specified in the \fIset\fP subcommand and is a number -in the range 0 - -1. For example, the command: -.PP -.ti +5 -atm set netif hfa0 ni 2 -.PP -would create two network interfaces, named ni0 and ni1, and associate -them with physical interface hfa0. -.PP -\fIatm set prefix \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface whose NSAP -prefix is to be set, -.ti -5 -\fI\fP specifies the first 13 bytes of the NSAP address -for the interface. -The prefix is specified as a string of hexadecimal digits with an -optional leading "0x". -Fields in the prefix may be separated by periods. -.in -10 -.PP -This command sets the address for a UNI-controlled interface. -The first 13 bytes (the prefix) of the 20-byte NSAP-format address -are set by this command, -the next 6 bytes (the End System Identifier (ESI)) will be the -MAC address taken from the physical interface or set by the -\fIset MAC\fP subcommand, -and the last byte (the selector) will be determined by which -network interface is to be associated with the address. -.PP -The NSAP prefix must be set before a UNI-controlled -interface can become active. -This can be accomplished either by the ILMI daemon (\fIilmid\fP (8)) -or the \fIset prefix\fP subcommand. -.PP -.I atm show config [] -.PP -displays the following information: -.PP -.B Interface -\- the name of the physical interface. -.PP -.B Vendor -\- the name of the adapter vendor. -.PP -.B Model -\- the model of the adapter. -.PP -.B Media -\- the communications medium used by the adapter. -.PP -.B Bus -\- the type of bus the adapter is attached to. -.PP -.B Serial No. -\- the adapter's serial number. -.PP -.B MAC address -\- the MAC address of the interface. -Note that this is the MAC address encoded in the hardware of -the adapter, even if the \fIatm set MAC\fP command has been used -to change the effective MAC address of the interface. -.PP -.B Hardware version -\- the hardware revision level reported by the interface. -.PP -.B Firmware version -\- the firmware revision level reported by the interface. -.PP -If no parameters are specified on the \fIshow config\fP subcommand, -the configurations of all physical interfaces will be displayed. -If an interface name is specified, only the configuration of the given -interface is displayed. -.PP -.I atm show interface [] -.PP -displays the following information: -.PP -.B Interface -\- the name of the physical interface. -.PP -.B Sigmgr -\- the name of the signalling manager which has been attached to the -interface. -A dash (-) is shown if no signalling manager has been attached. -.PP -.B State -\- the state of the signalling manager for the interface. -Each signalling manager has its own set of states. -They are: -.in +21 -.ti -16 -PVC: -.ti -11 -ACTIVE\ ---\ The signalling manager is active. -.ti -11 -DETACH\ ---\ The signalling manager is being detached. -.ti -16 -SPANS: -.ti -11 -ACTIVE\ ---\ The signalling manager is active. -.ti -11 -DETACH\ ---\ The signalling manager is being detached. -.ti -11 -INIT\ -----\ The signalling manager's initial state. -.ti -11 -PROBE\ ----\ The signalling manager is attempting to make -contact with the ATM switch. -.ti -16 -UNI 3.0 or UNI 3.1: -.ti -11 -NULL\ -----\ The signalling manager's initial state. -.ti -11 -ADR_WAIT\ -\ The signalling manager is waiting for the NSAP -prefix to be set. -.ti -11 -INIT\ -----\ The signalling manager is attempting to establish -contact with the switch. -.ti -11 -ACTIVE\ ---\ The signalling manager is active. -.ti -11 -DETACH\ ---\ The signalling manager is being detached. -.ti -21 -.PP -.B ATM address -\- the ATM address of the interface. -.PP -.B Network interfaces -\- the names of network interfaces, if any, associated with the -physical interface. -.PP -If no parameters are specified on the \fIshow interface\fP subcommand, -information about all physical interfaces will be displayed. -If an interface name is specified, only information about the given -interface is displayed. -.PP -.I atm show netif [] -.PP -displays the following information: -.PP -.B Net Intf -\- the name of the network interface. -.PP -.B IP Address -\- the IP address of the network interface. -.PP -If no parameters are specified on the \fIshow netif\fP subcommand, -information about all network interfaces will be displayed. -If an interface name is specified, only information about the given -network interface is displayed. -.PP -\fIatm show stats interface [ [phy | dev | atm | aal0 | -aal4 | aal5 | driver]]\fP -.PP -displays statistics associated with one or more interfaces. -Subject-area keywords -(\fIphy\fP, \fIdev\fP, \fIatm\fP, \fIaal0\fP, -\fIaal4\fP, \fIaal5\fP, or \fIdriver\fP) -can be specified to change the scope of the statistics displayed. -.PP -If no subject area keyword is specified, the following information is -displayed: -.PP -.B Interface -\- the name of the physical ATM interface. -.PP -.B Input PDUs -\- the number of Protocol Data Units (PDUs) which have been received -by the interface. -.PP -.B Input Bytes -\- the number of bytes which have been received by the interface. -.PP -.B Input Errs -\- the number of input errors which the interface has experienced. -.PP -.B Output PDUs -\- the number of Protocol Data Units (PDUs) which have been transmitted -by the interface. -.PP -.B Output Bytes -\- the number of bytes which have been transmitted by the interface. -.PP -.B Output Errs -\- the number of output errors which the interface has experienced. -.PP -.B Cmd Errs -\- the number of command errors which the interface has experienced. -.PP -If a subject-area keyword is specified, then statistics for -that subject are displayed. -The statistics displayed depend on the adapter. -If requested statistics are not available for an adapter, -an error will be noted. -.PP -If no parameters are specified on the \fIshow stats interface\fP -subcommand, statistics for all ATM interfaces are displayed. -If an interface name is specified, only statistics for the given -interface are displayed. -.PP -.SS VCC Management Subcommands: -.PP -\fIatm delete PVC \fP -.br -\fIatm delete SVC \fP -.PP -where: -.in +10 -.ti -5 -\fIPVC\fP specifies that the VCC to be closed is a PVC, -.ti -5 -\fISVC\fP specifies that the VCC to be closed is an SVC, -.ti -5 -\fI\fP specifies the physical interface at which the -VCC to be closed terminates, -.ti -5 -\fI\fP specifies the Virtual Path Identifier (VPI) of the VCC, -.ti -5 -\fI\fP specifies the Virtual Channel Identifier (VCI) of the VCC. -.in -10 -.PP -This command closes a VCC. -The two forms differ only in that the first specifies that the -VCC is a PVC (that was created by the \fIadd PVC\fP subcommand) and -the second specifies that the VCC is an SVC. -Reserved VCCs (with VCI values less than 32) cannot be closed -with this command. -.PP -\fIatm show stats VCC [ [ []]]\fP -.PP -displays the following information: -.PP -.B Interface -\- the physical interface on which the VCC terminates. -.PP -.B VPI -\- the Virtual Path Identifier (VPI) for the VCC. -.PP -.B VCI -\- the Virtual Channel Identifier (VCI) for the VCC. -.PP -.B Input PDUs -\- the number of Protocol Data Units (PDUs) which have been received -on the VCC. -.PP -.B Input Bytes -\- the number of bytes which have been received on the VCC. -.PP -.B Input Errs -\- the number of input errors which the VCC has experienced. -.PP -.B Output PDUs -\- the number of Protocol Data Units (PDUs) which have been transmitted -on the VCC. -.PP -.B Output Bytes -\- the number of bytes which have been transmitted on the VCC. -.PP -.B Output Errs -\- the number of output errors which the VCC has experienced. -.PP -If no parameters are specified on the \fIshow VCC\fP subcommand, all -active VCCs are displayed. -If an interface name is specified, all active VCCs for the given -interface are displayed. -If an interface and VPI are specified, all active VCCs for the VPI -on the given interface are displayed. -If an interface, VPI, and VCI are specified, only the specified VCC on -the given interface is displayed (note that this could actually be -two VCCs, since SPANS considers SVCs to be unidirectional). -.PP -\fIatm show VCC [ [ [] | SVC | PVC]]\fP -.PP -displays the following information: -.PP -.B Interface -\- the physical interface on which the VCC terminates. -.PP -.B VPI -\- the Virtual Path Identifier (VPI) for the VCC. -.PP -.B VCI -\- the Virtual Channel Identifier (VCI) for the VCC. -.PP -.B AAL -\- the ATM Adaptation Layer (AAL) in use on the VCC. -Possible values are null and AAL 1-5. -.PP -.B Type -\- specifies whether the VCC is an SVC or a PVC. -.PP -.B Dir -\- the direction of information flow on the VCC. -VCCs can be inbound, outbound, or both. -.PP -.B State -\- the state of the VCC, as reported by the signalling manager. -Each signalling manager has its own set of states. -They are: -.in +21 -.ti -16 -PVC: -.ti -11 -NULL\ -----\ No state. -.ti -11 -ACTIVE\ ---\ The VCC is active. -.ti -11 -FREE\ -----\ The VCC is closed and the signalling manager is waiting for -its resources to be freed. -.ti -16 -SPANS: -.ti -11 -NULL\ -----\ No state. -.ti -11 -ACTIVE\ ---\ The VCC is a PVC and is active. -.ti -11 -ACT_DOWN\ -\ The VCC is a PVC and the interface is down. -.ti -11 -POPEN\ ----\ The VCC is being opened. -.ti -11 -R_POPEN\ --\ The VCC is being opened by a remote host. -.ti -11 -OPEN\ -----\ The VCC is active. -.ti -11 -CLOSE\ ----\ The VCC is being closed. -.ti -11 -ABORT\ ----\ The VCC is being aborted. -.ti -11 -FREE\ -----\ The VCC is closed and the signalling manager is waiting for -its resources to be freed. -.ti -16 -UNI 3.0 or UNI 3.1: -.ti -11 -NULL\ -----\ No state. -.ti -11 -C_INIT\ ---\ A VCC is being initiated. -.ti -11 -C_OUT_PR\ -\ An outgoing VCC request is proceeding. -.ti -11 -C_PRES\ ---\ A VCC is being initiated by the network. -.ti -11 -CONN_REQ\ -\ A VCC request has been accepted by a HARP user. -.ti -11 -C_IN_PR\ --\ An incoming VCC request is proceeding. -.ti -11 -ACTIVE\ ---\ The VCC is active. -.ti -11 -REL_REQ\ --\ The VCC is being closed. -.ti -11 -REL_IND\ --\ The network is clearing a VCC. -.ti -11 -SSCF_REC\ -\ The SSCF session on the signalling channel is in -recovery from an error. -.ti -11 -FREE\ -----\ The VCC is closed and the signalling manager is waiting -for its resources to be freed. -.ti -11 -ACT_DOWN\ -\ The VCC is a PVC and the interface is down. -.ti -21 -.PP -.B Encaps -\- the encapsulation in effect on the VCC. -Possible encapsulations are null and LLC/SNAP. -.PP -.B Owner -\- the owner or owners of the VCC. -Shows the name(s) of the function(s) using the VCC. -.PP -.B Destination -\- the ATM address of the host at the remote end of the VCC. -.PP -If no parameters are specified on the \fIshow VCC\fP subcommand, all -active VCCs are displayed. -If an interface name is specified, all active VCCs for the given -interface are displayed. -If an interface and VPI are specified, all active VCCs for the VPI -on the given interface are displayed. -If an interface, VPI, and VCI are specified, only the specified VCC on -the given interface is displayed (note that this could actually be -two VCCs, since SPANS considers SVCs to be unidirectional). -.PP -.SS IP Management Subcommands: -\fIatm add ARP [] \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP is the optional name of the network interface the -ATMARP entry is to be associated with. -If no name is specified, a network interface is chosen depending -on the IP address of the host being added. -.ti -5 -\fI\fP is the host name or IP address of the host to -be added to the ATMARP table, -.ti -5 -\fI\fP is the ATM address of the host. -.in -10 -.PP -This command adds an entry to the ATMARP table for ATM. -The given host's IP address is associated with the given ATM address. -When IP needs to transmit data to the host, the specified ATM -address will be used to open an SVC. -.PP -The entry will be marked as permanent in the ATMARP table and will not -be subject to aging. -.PP -.in +5 -.ti -5 -\fIatm add PVC IP [ | dynamic] \fP -.in -5 -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the physical interface where the PVC -is to terminate, -.ti -5 -\fI\fP specifies the Virtual Path Identifier (VPI) of the PVC, -.ti -5 -\fI\fP specifies the Virtual Channel Identifier (VCI) of the PVC, -.ti -5 -\fI\fP specifies the ATM Adaptation Layer (AAL) for the PVC. -Valid choices are "null" or "AAL0" for the null AAL; "AAL1" for -AAL 1; "AAL2" for AAL 2; "AAL3", "AAL4", or "AAL3/4" for AAL 3/4; -and "AAL5" for AAL 5, -.ti -5 -\fI\fP specifies the encapsulation for the PVC. -Valid choices are "null" or "none" for null encapsulation, and -"LLC/SNAP", "LLC", or "SNAP" for LLC/SNAP encapsulation, -.ti -5 -\fIIP\fP specifies that the owner of the PVC is IP. -.ti -5 -\fI\fP specifies the network interface which the PVC is -to be associated with. -The network interface must exist and be associated with the -specified physical interface, -.ti -5 -\fI | dynamic\fP gives the address of the host at -the far end of the PVC, or the word "dynamic" if its address -is to be determined with Inverse ARP. -If "dynamic" is specified, LLC/SNAP encapsulation must also -be specified. -.ti -5 -\fI\fP is the traffic type of the PVC and may be one of -UBR, CBR or VBR. -Following the traffic type the traffic parameters must be given. -For UBR and CBR this is the peak cell rate and for VBR these -are the peak and sustainable cell rate and the maximum burst size. -.PP -This command creates a PVC with the specified attributes and attaches -it to IP. -.PP -\fIatm delete ARP [] \fP -.PP -where: -.in +10 -.ti -5 -\fI\fP is the optional name of the network interface the -ATMARP entry is associated with. -If no name is specified, the specified host is deleted from the -cache regardless of what network interface it is associated with. -.ti -5 -\fI\fP is the host name or IP address of the host to -be deleted from the ATMARP table. -.PP -This command deletes the specified host's entry from the ATMARP table. -.PP -\fIatm set arpserver | local [ ...]\fP -.PP -where: -.in +10 -.ti -5 -\fI\fP specifies the network interface for which the -ATMARP server address is to be set. -.ti -5 -\fI\fP specifies the ATM address of the host which is to -provide ATMARP service. -If "local" is specified instead of an ATM address, the host on -which the command is issued will become the ATMARP server. -.ti -5 -\fI ...\fP is an optional list of IP prefixes -that the ATMARP server will provide information about. -An IP prefix is specified as a dotted decimal IP address, followed by -a slash, followed a number specifying how many bits of the IP address -are significant. -For example, 10.0.0.0/8 indicates that the ATMARP server will provide -services for all addresses on IP network 10. -The IP subnetwork which the network interface belongs to is -automatically included. -.in -10 -.PP -This command sets the address of the ATMARP server for a network -interface. -.PP -.I atm show ARP [] -.PP -displays the following information: -.PP -.B Net Intf -\- the network interface which traffic for the entry will use. -.PP -.B Flags -\- flags showing whether the entry is valid and whether it is -permanent. -\- flags giving further information about the ATMARP entry. -The meanings of the characters in the flags are: -.PP -.in +5 -P - the entry is permanent -.br -R - the entry has been refreshed -.br -V - the entry is valid -.in -5 -.PP -.B Age -\- the number of minutes for which the entry will remain valid. -.PP -.B Origin -\- the source of the ATMARP entry. -Possible values are: -.in +16 -.ti -11 -LOCAL\ ----\ The entry is for an interface on the host. -.ti -11 -PERM\ -----\ The entry is permanent. -This is used for entries that are created with the -\fIadd ARP\fP command. -.ti -11 -REG\ ------\ The entry was created as the result of a host -registering with the ATMARP server. -.ti -11 -SCSP\ -----\ The entry was learned via SCSP. -.ti -11 -LOOKUP\ ---\ The entry was created as the result of a host -performing an ATMARP lookup. -.ti -11 -PEER_RSP\ -\ The entry was created as the result of a host -answering an InARP Request. -.ti -11 -PEER_REQ\ -\ The entry was created as the result of a host -sending an InARP Request. -.in -5 -.PP -.B ATM address -\- the ATM address of the host the entry refers to. -.PP -.B IP address -\- the IP address or domain name of the host the entry refers to. -.PP -If no parameters are specified on the \fIshow ARP\fP subcommand, -the whole ATMARP table will be displayed. -If a host name or IP address is specified, only information about the -given host is displayed. -.PP -This command displays both information that has been learned dynamically -(through one form or another of ATMARP and via SCSP) and information -which has been configured by the user (through the \fIadd ARP\fP -subcommand). -.PP -.I atm show arpserver [] -.PP -displays the following information: -.PP -.B Net Intf -\- the network interface for which information is being displayed. -.PP -.B State -\- the state of the connection to the ATMARP server. -Possible values are: -.in +16 -.ti -11 -NOT_CONF\ -\ No ATMARP server has been configured for the interface. -.ti -11 -SERVER\ ---\ The host is the ATMARP server. -.ti -11 -PEND_ADR\ -\ No ATM address has been set for the interface. -.ti -11 -POPEN\ ----\ The host is attempting to open a VCC to the ATMARP server. -.ti -11 -REGISTER\ -\ The host has a VCC open to the ATMARP server and is in -the process of registering with the server. -.ti -11 -ACTIVE\ ---\ The ATMARP server connection is active. -.in -16 -.PP -.B ATM Address -\- the ATM address of the ATMARP server. -.PP -If no parameters are specified on the \fIshow arpserver\fP subcommand, -the ATMARP servers for all network interfaces will be displayed. -If an interface name is specified, only information about the given -network interface is displayed. -.PP -.I atm show IPVCC [ | ] -.PP -displays the following information: -.PP -.B Net Intf -\- the name of the network interface at which the VCC terminates. -.PP -.B VPI -\- the Virtual Path Identifier (VPI) for the VCC. -.PP -.B VCI -\- the Virtual Channel Identifier (VCI) for the VCC. -.PP -.B State -\- the state of the VCC. -Possible values are: -.in +15 -.ti -10 -PMAP\ ----\ The host has an IP packet to send and is waiting for -an ATMARP mapping. -.ti -10 -POPEN\ ---\ The VCC is being opened. -.ti -10 -PACCEPT\ -\ A VCC from a remote host is being accepted. -.ti -10 -ACTPENT\ -\ A PVC is open, but no ATMARP information is -available for it yet. -.ti -10 -ACTIVE\ --\ The VCC is active. -.in -15 -.PP -.B Flags -\- flags giving further information about the VCC. -The meanings of the characters in the flags are: -.PP -.in +5 -S - the VCC is an SVC -.br -P - the VCC is a PVC -.br -L - the VCC uses LLC/SNAP encapsulation -.br -M - the IP-to-ATM address mapping for the VCC is valid -.br -N - there is no idle timeout for the VCC -.in -5 -.PP -.B IP Address -\- the name and IP address of the host at the remote end of the VCC. -.PP -If no parameters are specified on the \fIshow IPVCC\fP subcommand, all -active VCCs are displayed. -If a host name is specified, the active VCC(s) for the given -host are displayed. -If a network interface name is specified, the active VCC(s) for the -given network interface are displayed. -.PP -.SS Miscellaneous Subcommands: -.I atm help -.PP -displays a synopsis of the atm command with its subcommands -and their parameters. -.PP -.I atm show version -displays the version of the running HARP software. -.fi -.SH "SEE ALSO" -\fIilmid\fP (8); \fIscspd\fP (8); \fIatmarpd\fP (8). -.fi -.SH BUGS -Care must be taken to avoid confusing physical interfaces and -network interfaces. -.PP -Please report any bugs to harp-bugs@magic.net. -.fi -.SH COPYRIGHT -Copyright (c) 1994-1998, Network Computing Services, Inc. -.fi -.SH AUTHORS -John Cavanaugh, Network Computing Services, Inc. -.br -Mike Spengler, Network Computing Services, Inc. -.br -Joe Thomas, Network Computing Services, Inc. -.fi -.SH ACKNOWLEDGMENTS -This software was developed with the support of the Defense -Advanced Research Projects Agency (DARPA). Property changes on: head/sbin/atm/atm/atm.8 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/atm/atm.h =================================================================== --- head/sbin/atm/atm/atm.h (revision 179307) +++ head/sbin/atm/atm/atm.h (nonexistent) @@ -1,195 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * User configuration and display program - * -------------------------------------- - * - * Control blocks - * - */ - -#define MAX_NIFS 256 /* Max network interfaces */ -#define MIN_VCI 32 /* Smallest non-reserved VCI */ - -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef FALSE -#define FALSE 0 -#endif - - -/* - * User commands - */ -struct cmd { - const char *name; /* Command name */ - int minp; /* Minimum number of parameters */ - int maxp; /* Maximum number of parameters */ - void (*func)(int, char **, - const struct cmd *);/* Processing function */ - const char *help; /* User help string */ -}; - - -/* - * Supported signalling protocols - */ -struct proto { - const char *p_name; /* Protocol name */ - u_char p_id; /* Protocol id */ -}; - - -/* - * Table of state names - */ -struct state { - const char *s_name; /* State name */ - u_char s_id; /* State id */ -}; - - -/* - * Supported signalling protocol states - */ -struct proto_state { - const char *p_name; /* Signalling manager name */ - const struct state *p_state; /* Protocol state table */ - const struct state *v_state; /* Protocol VCC state table */ - u_char p_id; /* Protocol ID */ -}; - - -/* - * Supported VCC owners - */ -struct owner { - const char *o_name; /* Owner name */ - u_int o_sap; /* Owner's SAP */ - void (*o_pvcadd)(int, char **, const struct cmd *, - struct atmaddreq *, struct air_int_rsp *); - /* PVC ADD processing function */ -}; - - -/* - * Supported AALs - */ -struct aal { - const char *a_name; /* AAL name */ - u_char a_id; /* AAL code */ -}; - - -/* - * Supported encapsulations - */ -struct encaps { - const char *e_name; /* Encapsulation name */ - u_char e_id; /* Encapsulation code */ -}; - -/* - * Supported traffic type - */ -struct traffics { - const char *t_name; /* Traffic name: CBR, VBR, UBR, ... */ - uint8_t t_type; /* HARP code T_ATM_XXX */ - int t_argc; /* Number of args */ - const char *help; /* User help string */ -}; - -/* - * External variables - */ -extern char *prog; /* Program invocation */ -extern char prefix[]; /* Current command prefix */ - -/* - * Global function declarations - */ - - /* atm_eni.c */ -void show_eni_stats(char *, int, char **); - - /* atm_fore200.c */ -void show_fore200_stats(char *, int, char **); - - /* atm_inet.c */ -void ip_pvcadd(int, char **, const struct cmd *, struct atmaddreq *, - struct air_int_rsp *); - - /* atm_print.c */ -void print_arp_info(struct air_arp_rsp *); -void print_asrv_info(struct air_asrv_rsp *); -void print_cfg_info(struct air_cfg_rsp *); -void print_intf_info(struct air_int_rsp *); -void print_ip_vcc_info(struct air_ip_vcc_rsp *); -void print_netif_info(struct air_netif_rsp *); -void print_intf_stats(struct air_phy_stat_rsp *); -void print_vcc_stats(struct air_vcc_rsp *); -void print_vcc_info(struct air_vcc_rsp *); -void print_version_info(struct air_version_rsp *); - - /* atm_set.c */ -void set_arpserver(int, char **, const struct cmd *); -void set_macaddr(int, char **, const struct cmd *); -void set_netif(int, char **, const struct cmd *); -void set_prefix(int, char **, const struct cmd *); - - /* atm_show.c */ -void show_arp(int, char **, const struct cmd *); -void show_arpserv(int, char **, const struct cmd *); -void show_config(int, char **, const struct cmd *); -void show_intf(int, char **, const struct cmd *); -void show_ip_vcc(int, char **, const struct cmd *); -void show_netif(int, char **, const struct cmd *); -void show_vcc(int, char **, const struct cmd *); -void show_version(int, char **, const struct cmd *); -void show_intf_stats(int, char **, const struct cmd *); -void show_vcc_stats(int, char **, const struct cmd *); - - /* atm_subr.c */ -const char * get_vendor(int); -const char * get_adapter(int); -const char * get_media_type(int); -const char * get_bus_type(int); -const char * get_bus_slot_info(int, u_long); -const char * get_adapter_name(const char *); -int get_hex_addr(char *, u_char *, int); -const char * format_mac_addr(const Mac_addr *); -int parse_ip_prefix(const char *, struct in_addr *); -size_t compress_prefix_list(struct in_addr *, size_t); -void check_netif_name(const char *); -void sock_error(int); - -extern const struct aal aals[]; -extern const struct encaps encaps[]; Property changes on: head/sbin/atm/atm/atm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/ilmid/ilmid.c =================================================================== --- head/sbin/atm/ilmid/ilmid.c (revision 179307) +++ head/sbin/atm/ilmid/ilmid.c (nonexistent) @@ -1,2725 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User utilities - * -------------- - * - * Implement very minimal ILMI address registration. - * - * Implement very crude and basic support for "cracking" and - * "encoding" SNMP PDU's to support ILMI prefix and NSAP address - * registration. Code is not robust nor is it meant to provide any - * "real" SNMP support. Much of the code expects predetermined values - * and will fail if anything else is found. Much of the "encoding" is - * done with pre-computed PDU's. - * - * See "The Simple Book", Marshall T. Rose, particularly chapter 5, - * for ASN and BER information. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -#define MAX_LEN 9180 - -#define MAX_UNITS 8 - -/* - * Define some ASN types - */ -#define ASN_INTEGER 0x02 -#define ASN_OCTET 0x04 -#define ASN_NULL 0x05 -#define ASN_OBJID 0x06 -#define ASN_SEQUENCE 0x30 -#define ASN_IPADDR 0x40 -#define ASN_TIMESTAMP 0x43 - -static const char *Var_Types[] = { - "", - "", - "ASN_INTEGER", - "", - "ASN_OCTET", - "ASN_NULL", - "ASN_OBJID" -}; - -/* - * Define SNMP PDU types - */ -#define PDU_TYPE_GET 0xA0 -#define PDU_TYPE_GETNEXT 0xA1 -#define PDU_TYPE_GETRESP 0xA2 -#define PDU_TYPE_SET 0xA3 -#define PDU_TYPE_TRAP 0xA4 - -static const char *const PDU_Types[] = { - "GET REQUEST", - "GETNEXT REQUEST", - "GET RESPONSE", - "SET REQUEST", - "TRAP", - " ?? ", - " ??? " -}; - -/* - * Define TRAP codes - */ -#define TRAP_COLDSTART 0 -#define TRAP_WARMSTART 1 -#define TRAP_LINKDOWN 2 -#define TRAP_LINKUP 3 -#define TRAP_AUTHFAIL 4 -#define TRAP_EGPLOSS 5 -#define TRAP_ENTERPRISE 6 - -/* - * Define SNMP Version numbers - */ -#define SNMP_VERSION_1 1 -#define SNMP_VERSION_2 2 - -/* - * SNMP Error-status values - */ -#define SNMP_ERR_NOERROR 0 -#define SNMP_ERR_TOOBIG 1 -#define SNMP_ERR_NOSUCHNAME 2 -#define SNMP_ERR_BADVALUE 3 -#define SNMP_ERR_READONLY 4 -#define SNMP_ERR_GENERR 5 - -/* - * Max string length for Variable - */ -#define STRLEN 128 - -/* - * Unknown variable - */ -#define VAR_UNKNOWN -1 - -/* - * Define our internal representation of an OBJECT IDENTIFIER - */ -struct objid { - int oid[128]; -}; -typedef struct objid Objid; - -/* - * Define a Veriable classso that we can handle multiple GET/SET's - * per PDU. - */ -typedef struct variable Variable; -struct variable { - Objid oid; - int type; - union { - int ival; /* INTEGER/TIMESTAMP */ - Objid oval; /* OBJID */ - long aval; /* IPADDR */ - char sval[STRLEN]; /* OCTET */ - } var; - Variable *next; -}; - -/* - * Every SNMP PDU has the first four fields of this header. The only type - * which doesn't have the last three fields is the TRAP type. - */ -struct snmp_header { - int pdulen; - int version; - char community[64]; - int pdutype; - - /* GET/GETNEXT/GETRESP/SET */ - int reqid; - int error; - int erridx; - - /* TRAP */ - Objid enterprise; - int ipaddr; - int generic_trap; - int specific_trap; - - int varlen; - Variable *head, - *tail; -}; -typedef struct snmp_header Snmp_Header; - -Snmp_Header *ColdStart_Header; -Snmp_Header *PDU_Header; - -/* - * Define some OBJET IDENTIFIERS that we'll try to reply to: - * - * sysUpTime: number of time ticks since this deamon came up - * netpfx_oid: network prefix table - * unitype: is this a PRIVATE or PUBLIC network link - * univer: which version of UNI are we running - * devtype: is this a USER or NODE ATM device - * setprefix: used when the switch wants to tell us its NSAP prefix - * foresiggrp: FORE specific Objid we see alot of (being connected to FORE - * switches...) - */ -Objid Objids[] = { -#define SYS_OBJID 0 - {{ 8, 43, 6, 1, 2, 1, 1, 2, 0 }}, -#define UPTIME_OBJID 1 - {{ 8, 43, 6, 1, 2, 1, 1, 3, 0 }}, -#define PORT_OBJID 2 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 1, 1, 1, 1, 0 }}, -#define IPNM_OBJID 3 - {{ 10, 43, 6, 1, 4, 1, 353, 2, 1, 2, 0 }}, -#define LAYER_OBJID 4 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 1, 0 }}, -#define MAXVCC_OBJID 5 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 3, 0 }}, -#define UNITYPE_OBJID 6 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 8, 0 }}, -#define UNIVER_OBJID 7 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 9, 0 }}, -#define DEVTYPE_OBJID 8 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 2, 1, 1, 10, 0 }}, -#define ADDRESS_OBJID 9 - {{ 8, 43, 6, 1, 4, 1, 353, 2, 6 }}, -#define NETPFX_OBJID 10 - {{ 9, 43, 6, 1, 4, 1, 353, 2, 7, 1 }}, -#define MY_OBJID 11 - {{ 7, 43, 6, 1, 4, 1, 9999, 1 }}, -#define SETPFX_OBJID 12 /* ATM Forum says 1=valid, 2=invalid, not 0! */ - {{ 12, 43, 6, 1, 4, 1, 353, 2, 7, 1, 1, 3, 0 }}, -#define ENTERPRISE_OBJID 13 - {{ 8, 43, 6, 1, 4, 1, 3, 1, 1 }}, -#define ATMF_PORTID 14 - {{ 10, 43, 6, 1, 4, 1, 353, 2, 1, 4, 0 }}, -#define ATMF_SYSID 15 - {{ 12, 43, 6, 1, 4, 1, 353, 2, 1, 1, 1, 8, 0 }}, -#define MADGE_OBJECT1 16 /* I don't have a clue ... -RH */ - {{ 9, 43, 6, 1, 4, 1, 353, 2, 7, 99 }}, -}; - -#define NUM_OIDS (sizeof(Objids)/sizeof(Objid)) - -#define UNIVER_UNI20 1 -#define UNIVER_UNI30 2 -#define UNIVER_UNI31 3 -#define UNIVER_UNI40 4 -#define UNIVER_UNKNOWN 5 - -#define UNITYPE_PUBLIC 1 -#define UNITYPE_PRIVATE 2 - -#define DEVTYPE_USER 1 -#define DEVTYPE_NODE 2 - -/* For print_pdu() */ -#define PDU_SEND 1 -#define PDU_RECV 2 - -/* - * ILMI protocol states - */ -enum ilmi_states { - ILMI_UNKNOWN, /* Uninitialized */ - ILMI_COLDSTART, /* We need to send a COLD_START trap */ - ILMI_INIT, /* Ensure that switch has reset */ - ILMI_REG, /* Looking for SET message */ - ILMI_RUNNING /* Normal processing */ -}; - -static const char *ILMI_State[] = { - "UNKNOWN", - "COLDSTART", - "INIT", - "REG", - "RUNNING" -}; - -/* - * Our (incrementing) Request ID - */ -int Req_ID; - -/* - * Temporary buffer for building response packets. Should help ensure - * that we aren't accidently overwriting some other memory. - */ -u_char Resp_Buf[1024]; - -/* - * Copy the reponse into a buffer we can modify without - * changing the original... - */ -#define COPY_RESP(resp) \ - bcopy ( (resp), Resp_Buf, (resp)[0] + 1 ) - -int NUnits; - -/* - * fd for units which have seen a coldStart TRAP and are now exchaning SNMP requests - */ -int ilmi_fd[MAX_UNITS + 1]; -/* - * enum ilmi_states for this unit - */ -int ilmi_state[MAX_UNITS + 1]; -/* - * Local copy for HARP physical configuration information - */ -struct air_cfg_rsp Cfg[MAX_UNITS + 1]; -/* - * Local copy for HARP interface configuration information - */ -struct air_int_rsp Intf[MAX_UNITS + 1]; - -/* - * addressEntry table - */ -Objid addressEntry[MAX_UNITS + 1]; - -/* - * When this daemon started - */ -struct timeval starttime; - -int Debug_Level = 0; -int foregnd = 0; /* run in the foreground? */ - -char *progname; -char hostname[80]; - - /* File to write debug messages to */ -#define LOG_FILE "/var/log/ilmid" -FILE *Log; /* File descriptor for log messages */ - -static const char *Months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; - -/* - * function declarations - */ -static void write_timestamp (void); -static void hexdump (FILE *, u_int8_t *, int, char *); -static int asn_get_pdu_len (u_char **, int *); -static int asn_get_encoded (u_char **, int *); -static int asn_get_int (u_char **, int *); -static void asn_set_int (u_char **, int); -static void print_objid (Objid *); -static void asn_get_objid (u_char **, Objid *, int *); -static int asn_put_objid (u_char **, Objid *); -static void asn_get_octet (u_char **, char *, int *); -static void print_header (Snmp_Header *); -static void parse_oids (Snmp_Header *, u_char **); -static int oid_cmp (Objid *, Objid *); -static int oid_ncmp (Objid *, Objid *, int); -static int find_var (Variable *); -static int get_ticks (void); -static void build_pdu (Snmp_Header *, int); -static void free_pdu (Snmp_Header *); -static void print_pdu (int, int, Snmp_Header *, int, u_char *); -static void send_resp (int, Snmp_Header *, u_char *); -static void init_ilmi (void); -static void ilmi_open (void); -static void get_local_ip (int, long *); -static void set_prefix (Objid *, Snmp_Header *, int); -static void set_address (Snmp_Header *, int); -static void process_get (Snmp_Header *, int); -static int lmi_object_find (Variable *); -static int lmi_rcvcmd_getnext(Snmp_Header *, int); -static int lmi_rcvcmd_trap (Snmp_Header *, int); -static void ilmi_do_state (void); -static void Increment_DL (int); -static void Decrement_DL (int); - -static Snmp_Header * asn_get_header (u_char **); -static Snmp_Header * build_cold_start (void); -static Snmp_Header * build_generic_header (void); - -/* - * Write a syslog() style timestamp - * - * Write a syslog() style timestamp with month, day, time and hostname - * to the log file. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -write_timestamp (void) -{ - time_t clk; - struct tm *tm; - - clk = time ( (time_t)NULL ); - tm = localtime ( &clk ); - - if ( Log && Debug_Level > 1 ) - if ( Log != stderr ) - fprintf ( Log, "%.3s %2d %.2d:%.2d:%.2d %s: ", - Months[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min, - tm->tm_sec, hostname ); - - return; - -} - -/* - * Utility to pretty print buffer as hex dumps - * - * Arguments: - * out - file handle - * ptr - buffer pointer - * len - length to pretty print - * desc - output header - * - * Returns: - * none - * - */ -static void -hexdump (out, ptr, len, desc) - FILE * out; - u_int8_t * ptr; - int len; - char * desc; -{ - char line[17]; - int i, j; - - if (out == NULL) - out = stdout; - - if (desc != NULL) - fprintf(out, "[ %s (%d bytes)]\n", desc, len); - - bzero(line, sizeof(line)); - - for (i = 0, j = 0; i < len; i++) { - - if (j == 0) fprintf(out, "%04x: ", i); - if (j == 8) fprintf(out, "| "); - - fprintf(out, "%02x ", ptr[i]); - line[j] = isalnum(ptr[i]) ? ptr[i] : '.' ; - if (j == 15) { - fprintf(out, " |%16s|\n", line); - bzero(line, sizeof(line)); - j = 0; - } else - j++; - } - - if (j != 0) { - if (j <= 8) fprintf(out, " "); - for (; j < 16; j++) fprintf(out, " "); - fprintf(out, " |%-16s|\n", line); - } - fflush(out); - - return; -} - -/* - * Get lengths from PDU encodings - * - * Lengths are sometimes encoded as a single byte if the length - * is less the 127 but are more commonly encoded as one byte with - * the high bit set and the lower seven bits indicating the nuber - * of bytes which make up the length value. Trailing data is (to my - * knowledge) not 7-bit encoded. - * - * Arguments: - * bufp - pointer to buffer pointer - * plen - pointer to PDU length or NULL if not a concern - * - * Returns: - * bufp - updated buffer pointer - * plen - (possibly) adjusted pdu length - * - decoded length - * - */ -static int -asn_get_pdu_len (u_char **bufp, int *plen) -{ - u_char *bp = *bufp; - int len = 0; - int i, b; - - b = *bp++; - if ( plen ) - (*plen)--; - if ( b & 0x80 ) { - for ( i = 0; i < (b & ~0x80); i++ ) { - len = len * 256 + *bp++; - if ( plen ) - (*plen)--; - } - } else - len = b; - - *bufp = bp; - return ( len ); -} - -/* - * Get an 7-bit encoded value. - * - * Get a value which is represented using a 7-bit encoding. The last - * byte in the stream has the high-bit clear. - * - * Arguments: - * bufp - pointer to the buffer pointer - * len - pointer to the buffer length - * - * Returns: - * bufp - updated buffer pointer - * len - updated buffer length - * - value encoding represented - * - */ -static int -asn_get_encoded (u_char **bufp, int *len) -{ - u_char *bp = *bufp; - int val = 0; - int l = *len; - - /* - * Keep going while high bit is set - */ - do { - /* - * Each byte can represent 7 bits - */ - val = ( val << 7 ) + ( *bp & ~0x80 ); - l--; - } while ( *bp++ & 0x80 ); - - *bufp = bp; /* update buffer pointer */ - *len = l; /* update buffer length */ - - return ( val ); -} - -/* - * Get a BER encoded integer - * - * Intergers are encoded as one byte length followed by data bytes - * - * Arguments: - * bufp - pointer to the buffer pointer - * plen - pointer to PDU length or NULL if not a concern - * - * Returns: - * bufp - updated buffer pointer - * plen - (possibly) updated PDU length - * - value of encoded integer - * - */ -static int -asn_get_int (u_char **bufp, int *plen) -{ - int i; - int len; - int v = 0; - u_char *bp = *bufp; - - len = *bp++; - if ( plen ) - (*plen)--; - for ( i = 0; i < len; i++ ) { - v = (v * 256) + *bp++; - if ( plen ) - (*plen)--; - } - *bufp = bp; - return ( v ); -} - -/* - * Set a BER encoded integer - * - * Arguments: - * bufp - pointer to buffer pointer where we are to set int in - * val - integer value to set - * - * Returns: - * none - * - updated buffer pointer - * - */ -static void -asn_set_int (u_char **bufp, int val) -{ - union { - int i; - u_char c[4]; - } u; - int len = sizeof(int); - size_t i = 0; - u_char *bp = *bufp; - - /* Check for special case where val == 0 */ - if ( val == 0 ) { - *bp++ = 1; - *bp++ = 0; - *bufp = bp; - return; - } - - u.i = htonl ( val ); - - while ( u.c[i] == 0 && i++ < sizeof(int) ) - len--; - - if ( u.c[i] > 0x7f ) { - i--; - len++; - } - - *bp++ = len; - bcopy ( (caddr_t)&u.c[sizeof(int)-len], bp, len ); - bp += len; - *bufp = bp; - - return; -} - -/* - * Utility to print an object identifier. - * - * Arguments: - * objid - pointer to objid representation - * - * Returns: - * none - * - */ -static void -print_objid (Objid *objid) -{ - int i; - - /* - * First oid coded as 40 * X + Y - */ - if ( Log ) { - write_timestamp(); - fprintf ( Log, ".%d.%d", objid->oid[1] / 40, - objid->oid[1] % 40 ); - } - for ( i = 2; i <= objid->oid[0]; i++ ) - if ( Log ) - fprintf ( Log, ".%d", objid->oid[i] ); - if ( Log ) - fprintf ( Log, "\n" ); - - return; -} - -/* - * Get Object Identifier - * - * Arguments: - * bufp - pointer to buffer pointer - * objid - pointer to objid buffer - * plen - pointer to PDU length or NULL of not a concern - * - * Returns: - * bufp - updated buffer pointer - * objid - internal representation of encoded objid - * plen - (possibly) adjusted PDU length - * - */ -static void -asn_get_objid (u_char **bufp, Objid *objid, int *plen) -{ - int len; - u_char *bp = *bufp; - int *ip = (int *)objid + 1; /* First byte will contain length */ - int oidlen = 0; - - len = *bp++; - if ( plen ) - (*plen)--; - while ( len ) { - *ip++ = asn_get_encoded ( &bp, &len ); - if ( plen ) - (*plen)--; - oidlen++; - } - objid->oid[0] = oidlen; - *bufp = bp; - - return; -} - -/* - * Put OBJID - assumes elements <= 16383 for two byte coding - * - */ -static int -asn_put_objid (u_char **bufp, Objid *objid) -{ - int len = 0; - u_char *bp = *bufp; - u_char *cpp; - int i; - - cpp = bp; - *bp++ = objid->oid[0]; - len++; - for ( i = 1; i <= objid->oid[0]; i++ ) { - u_int c = objid->oid[i]; - - while ( c > 127 ) { - *bp++ = ( ( c >> 7 ) & 0x7f ) | 0x80; - len++; - c &= 0x7f; /* XXX - assumption of two bytes */ - (*cpp)++; - } - *bp++ = c; - len++; - } - - *bufp = bp; - return ( len ); - -} - -/* - * Get OCTET STRING - * - * Octet strings are encoded as a 7-bit encoded length followed by - * data bytes; - * - * Arguments: - * bufp - pointer to buffer pointer - * octet - pointer to octet buffer - * plen - pointer to PDU length - * - * Returns: - * bufp - updated buffer pointer - * octet - encoded Octet String - * plen - (possibly) adjusted PDU length - * - */ -static void -asn_get_octet (u_char **bufp, char *octet, int *plen) -{ - u_char *bp = *bufp; - int i = 0; - int len = 0; - - /* - * &i is really a dummy value here as we don't keep track - * of the ongoing buffer length - */ - len = asn_get_encoded ( &bp, &i ); - - for ( i = 0; i < len; i++ ) { - *octet++ = *bp++; - if ( plen ) - (*plen)--; - } - - *bufp = bp; - - return; - -} - -/* - * Utility to print SNMP PDU header information - * - * Arguments: - * Hdr - pointer to internal SNMP header structure - * - * Returns: - * none - * - */ -static void -print_header (Snmp_Header *Hdr) -{ - Variable *var; - - if ( Log ) { - write_timestamp(); - fprintf(Log, - " PDU Type: 0x%x (%s)\n" - " PDU len: %d\n" - " Version: %d\n" - " Community: \"%s\"\n", - Hdr->pdutype, PDU_Types[Hdr->pdutype & 7], - Hdr->pdulen, - Hdr->version + 1, - Hdr->community); - - if (Hdr->pdutype != PDU_TYPE_TRAP) { - write_timestamp(); - fprintf(Log, - " Req Id: 0x%x\n" - " Error: %d\n" - " Error Index: %d\n", - Hdr->reqid, - Hdr->error, - Hdr->erridx); - } - } - - var = Hdr->head; - while ( var ) { - if ( Log ) { - write_timestamp(); - fprintf ( Log, "Variable Type: %d", var->type ); - if ( Var_Types[var->type] ) - fprintf ( Log, " (%s)", Var_Types[var->type] ); - fprintf ( Log, "\n Object: "); - print_objid ( &var->oid ); - fprintf ( Log, " Value: "); - switch ( var->type ) { - case ASN_INTEGER: - fprintf ( Log, "%d (0x%x)\n", var->var.ival, var->var.ival ); - break; - case ASN_NULL: - fprintf ( Log, "NULL" ); - break; - default: - fprintf ( Log, "[0x%x]", var->type ); - break; - } - fprintf ( Log, "\n" ); - } - var = var->next; - } - - return; - -} - -/* - * Pull OID's from GET/SET message - * - * Arguments: - * h - pointer to Snmp_Header - * bp - pointer to input PDU - * - * Returns: - * none - * - */ -static void -parse_oids (Snmp_Header *h, u_char **bp) -{ - int len = h->varlen; - int sublen; - Variable *var; - u_char *bufp = *bp; - - while ( len > 0 ) { - if ( *bufp++ == ASN_SEQUENCE ) { - len--; - - /* Create new Variable instance */ - if ( ( var = (Variable *)malloc(sizeof(Variable)) ) == NULL ) - { - *bp = bufp; - return; - } - bzero(var, sizeof(Variable)); - /* Link to tail */ - if ( h->tail ) - h->tail->next = var; - /* Set head iff NULL */ - if ( h->head == NULL ) { - h->head = var; - } - /* Adjust tail */ - h->tail = var; - - /* Get length of variable sequence */ - sublen = asn_get_pdu_len ( &bufp, &len ); - /* Should be OBJID type */ - if ( *bufp++ != ASN_OBJID ) { - *bp = bufp; - return; - } - asn_get_objid ( (u_char **)&bufp, &var->oid, &len ); - var->type = *bufp++; - len--; - switch ( var->type ) { - case ASN_INTEGER: - var->var.ival = asn_get_int ( &bufp, &len ); - break; - case ASN_NULL: - bufp++; - len--; - break; - case ASN_OBJID: - asn_get_objid ( &bufp, &var->var.oval, &len ); - break; - case ASN_OCTET: - asn_get_octet ( &bufp, var->var.sval, &len ); - break; - default: - if ( Log ) { - write_timestamp(); - fprintf ( Log, "Unknown variable type: %d\n", - var->type ); - } - break; - } - var->next = NULL; - } else - break; - } - - *bp = bufp; - return; -} - -/* - * Crack the SNMP header - * - * Pull the PDU length, SNMP version, SNMP community and PDU type. - * If present, also pull out the Request ID, Error status, and Error - * index values. - * - * Arguments: - * bufp - pointer to buffer pointer - * - * Returns: - * bufp - updated buffer pointer - * - generated SNMP header - * - */ -static Snmp_Header * -asn_get_header (u_char **bufp) -{ - Snmp_Header *h; - u_char *bp = *bufp; - int len = 0; - int dummy = 0; - - /* - * Allocate memory to hold the SNMP header - */ - if ( ( h = (Snmp_Header *)malloc(sizeof(Snmp_Header)) ) == NULL ) - return ( (Snmp_Header *)NULL ); - - /* - * Ensure that we wipe the slate clean - */ - bzero(h, sizeof(Snmp_Header)); - - /* - * PDU has to start as SEQUENCE OF - */ - if ( *bp++ != ASN_SEQUENCE ) /* Class == Universial, f == 1, tag == SEQUENCE */ - return ( (Snmp_Header *)NULL ); - - /* - * Get the length of remaining PDU data - */ - h->pdulen = asn_get_pdu_len ( &bp, NULL ); - - /* - * We expect to find an integer encoding Version-1 - */ - if ( *bp++ != ASN_INTEGER ) { - return ( (Snmp_Header *)NULL ); - } - h->version = asn_get_int ( &bp, NULL ); - - /* - * After the version, we need the community name - */ - if ( *bp++ != ASN_OCTET ) { - return ( (Snmp_Header *)NULL ); - } - asn_get_octet ( &bp, h->community, NULL ); - - /* - * Single byte PDU type - */ - h->pdutype = *bp++; - - /* - * If this isn't a TRAP PDU, then look for the rest of the header - */ - if ( h->pdutype != PDU_TYPE_TRAP ) { /* TRAP uses different format */ - - (void) asn_get_pdu_len ( &bp, &dummy ); - - /* Request ID */ - if ( *bp++ != ASN_INTEGER ) { - free( h ); - return ( (Snmp_Header *)NULL ); - } - h->reqid = asn_get_int ( &bp, NULL ); - - /* Error Status */ - if ( *bp++ != ASN_INTEGER ) { - free ( h ); - return ( (Snmp_Header *)NULL ); - } - h->error = asn_get_int ( &bp, NULL ); - - /* Error Index */ - if ( *bp++ != ASN_INTEGER ) { - free ( h ); - return ( (Snmp_Header *)NULL ); - } - h->erridx = asn_get_int ( &bp, NULL ); - - /* Sequence of... */ - if ( *bp++ != ASN_SEQUENCE ) { - free ( h ); - return ( (Snmp_Header *)NULL ); - } - h->varlen = ( asn_get_pdu_len ( &bp, &len ) - 1 ); - h->varlen += ( len - 1 ); - - parse_oids ( h, &bp ); - } - - *bufp = bp; - - return ( h ); - -} - -/* - * Compare two internal OID representations - * - * Arguments: - * oid1 - Internal Object Identifier - * oid2 - Internal Object Identifier - * - * Returns: - * 0 - Objid's match - * 1 - Objid's don't match - * - */ -static int -oid_cmp (Objid *oid1, Objid *oid2) -{ - int i; - int len; - - /* - * Compare lengths - */ - if ( !(oid1->oid[0] == oid2->oid[0] ) ) - /* Different lengths */ - return ( 1 ); - - len = oid1->oid[0]; - - /* - * value by value compare - */ - for ( i = 1; i <= len; i++ ) { - if ( !(oid1->oid[i] == oid2->oid[i]) ) - /* values don't match */ - return ( 1 ); - } - - /* Objid's are identical */ - return ( 0 ); -} - -/* - * Compare two internal OID representations - * - * Arguments: - * oid1 - Internal Object Identifier - * oid2 - Internal Object Identifier - * len - Length of OID to compare - * - * Returns: - * 0 - Objid's match - * 1 - Objid's don't match - * - */ -static int -oid_ncmp (Objid *oid1, Objid *oid2, int len) -{ - int i; - - /* - * value by value compare - */ - for ( i = 1; i <= len; i++ ) { - if ( !(oid1->oid[i] == oid2->oid[i]) ) - /* values don't match */ - return ( 1 ); - } - - /* Objid's are identical */ - return ( 0 ); -} - -/* - * Find the index of an OBJID which matches this Variable instance. - * - * Arguments: - * var - pointer to Variable instance - * - * Returns: - * idx - index of matched Variable instance - * -1 - no matching Variable found - * - */ -static int -find_var (Variable *var) -{ - size_t i; - - for ( i = 0; i < NUM_OIDS; i++ ) - if ( oid_cmp ( &var->oid, &Objids[i] ) == 0 ) { - return ( i ); - } - - return ( -1 ); - -} - -/* - * Return the time process has been running as a number of ticks - * - * Arguments: - * none - * - * Returns: - * number of ticks - * - */ -static int -get_ticks (void) -{ - struct timeval timenow; - struct timeval timediff; - - (void) gettimeofday ( &timenow, NULL ); - /* - * Adjust for subtraction - */ - timenow.tv_sec--; - timenow.tv_usec += 1000000; - - /* - * Compute time since 'starttime' - */ - timediff.tv_sec = timenow.tv_sec - starttime.tv_sec; - timediff.tv_usec = timenow.tv_usec - starttime.tv_usec; - - /* - * Adjust difference timeval - */ - if ( timediff.tv_usec >= 1000000 ) { - timediff.tv_usec -= 1000000; - timediff.tv_sec++; - } - - /* - * Compute number of ticks - */ - return ( ( timediff.tv_sec * 100 ) + ( timediff.tv_usec / 10000 ) ); - -} - -/* - * Build a response PDU - * - * Arguments: - * hdr - pointer to PDU Header with completed Variable list - * - * Returns: - * none - * - */ -static void -build_pdu (Snmp_Header *hdr, int type) -{ - u_char *bp = Resp_Buf; - u_char *vpp; - u_char *ppp; - int erridx = 0; - int varidx = 1; - int varlen = 0; - int pdulen = 0; - int traplen = 0; - Variable *var; - - /* - * Clear out the reply - */ - bzero ( Resp_Buf, sizeof(Resp_Buf) ); - - /* [0] is reserved for overall length */ - bp++; - - /* Start with SEQUENCE OF */ - *bp++ = ASN_SEQUENCE; - /* - assume we can code length in two octets */ - *bp++ = 0x82; - bp++; - bp++; - /* Version */ - *bp++ = ASN_INTEGER; - asn_set_int ( &bp, hdr->version ); - /* Community name */ - *bp++ = ASN_OCTET; - *bp++ = strlen ( hdr->community ); - bcopy ( hdr->community, bp, strlen ( hdr->community ) ); - bp += strlen ( hdr->community ); - /* PDU Type */ - *bp++ = type; - ppp = bp; - /* Length of OID data - assume it'll fit in one octet */ - bp++; - - if ( type != PDU_TYPE_TRAP ) { - /* Sequence ID */ - *bp++ = ASN_INTEGER; - asn_set_int ( &bp, hdr->reqid ); - /* - * Check to see if all the vaiables were resolved - we do this - * by looking for something which still has an ASN_NULL value. - */ - var = hdr->head; - if ( type == PDU_TYPE_GETRESP ) { - while ( var && erridx == 0 ) { - if ( var->type != ASN_NULL ) { - varidx++; - var = var->next; - } else - erridx = varidx; - } - } - - /* Error status */ - *bp++ = ASN_INTEGER; - *bp++ = 0x01; /* length = 1 */ - if ( erridx ) - *bp++ = SNMP_ERR_NOSUCHNAME; - else - *bp++ = SNMP_ERR_NOERROR; - /* Error Index */ - *bp++ = ASN_INTEGER; - *bp++ = 0x01; /* length = 1 */ - *bp++ = erridx; /* index == 0 if no error */ - } else { - /* type == PDU_TYPE_TRAP */ - - /* Fill in ENTERPRISE OBJID */ - *bp++ = ASN_OBJID; - (void) asn_put_objid ( &bp, &hdr->enterprise ); - - /* Fill in IP address */ - *bp++ = ASN_IPADDR; - *bp++ = sizeof ( hdr->ipaddr ); - bcopy ( (caddr_t)&hdr->ipaddr, bp, sizeof(hdr->ipaddr) ); - bp += sizeof(hdr->ipaddr); - - /* Fill in generic and specific trap types */ - *bp++ = ASN_INTEGER; - asn_set_int ( &bp, hdr->generic_trap ); - *bp++ = ASN_INTEGER; - asn_set_int ( &bp, hdr->specific_trap ); - - /* Fill in time-stamp - assume 0 for now */ - *bp++ = ASN_TIMESTAMP; - asn_set_int ( &bp, 0 ); - - /* encoded length */ - traplen = ( bp - ppp - 1 ); - - /* Continue with variable processing */ - } - - /* SEQUENCE OF */ - *bp++ = ASN_SEQUENCE; - *bp++ = 0x82; - /* - assume we can code length in two octets */ - vpp = bp; - varlen = 0; - bp++; - bp++; - - /* Install Variables */ - var = hdr->head; - varidx = 1; - while ( var ) { - u_char *bpp; - int len = 0; - - /* SEQUENCE OF */ - *bp++ = ASN_SEQUENCE; - *bp++ = 0x82; - /* - assume we can code length in two octets */ - bpp = bp; - bp++; - bp++; - /* OBJID */ - *bp++ = ASN_OBJID; - len++; - - len += asn_put_objid ( &bp, &var->oid ); - - if ( erridx && varidx >= erridx ) { - /* Code this variable as NULL */ - *bp++ = ASN_NULL; - len++; - bp++; - len++; - } else { - u_char *lpp; - /* Variable type */ - *bp++ = var->type; - len++; - lpp = bp; - switch ( var->type ) { - case ASN_INTEGER: - asn_set_int ( &bp, var->var.ival ); - len += ( *lpp + 1 ); - break; - case ASN_OCTET: - *bp++ = var->var.sval[0]; - len++; - bcopy ( (caddr_t)&var->var.sval[1], - bp, var->var.sval[0] ); - len += var->var.sval[0]; - bp += var->var.sval[0]; - break; - case ASN_NULL: - *bp++ = 0x00; - len++; - break; - case ASN_OBJID: - len += asn_put_objid ( &bp, &var->var.oval ); - break; - case ASN_SEQUENCE: - break; - case ASN_IPADDR: - *bp++ = 4; - len++; - bcopy ( (caddr_t)&var->var.aval, bp, 4 ); - len += 4; - bp += 4; - break; - case ASN_TIMESTAMP: - asn_set_int ( &bp, var->var.ival ); - len += ( *lpp + 1 ); - break; - default: - break; - } - } - - /* Accumulate total Variable sequence length */ - varlen += (len + 4); - - /* Fill in length of this sequence */ - bpp[1] = len & 0xff; - bpp[0] = len >> 8; - - var = var->next; - } - - - /* Fill in length of Variable sequence */ - vpp[1] = varlen & 0xff; - vpp[0] = varlen >> 8; - - if ( type != PDU_TYPE_TRAP ) { - /* Fill in length of data AFTER PDU type */ - *ppp = varlen + 12 + ppp[2]; /* + length of reqid */ - } else { - /* Fill in length of data AFTER PDU type */ - *ppp = varlen + traplen + 4; /* + length of initial sequence of */ - } - - /* Fill in overall sequence length */ - pdulen = *ppp + 7 + strlen ( hdr->community ); - Resp_Buf[4] = pdulen & 0x7f; - Resp_Buf[3] = pdulen >> 8; - - pdulen = bp - Resp_Buf - 1; - - Resp_Buf[0] = pdulen; - - hdr->pdutype = type; - hdr->pdulen = pdulen; - - return; -} - -static void -free_pdu (Snmp_Header *hdr) -{ - Variable *var; - - while ( hdr->head ) { - var = hdr->head->next; /* Save next link */ - free ( hdr->head ); /* Free current var */ - hdr->head = var; /* Set head to next link */ - } - - free ( hdr ); /* Free fixed portion */ -} - -static void -print_pdu (int dir, int intf, Snmp_Header *Hdr, int len, u_char *buf) -{ - const char * pdu_dir; - const char * pdu_type; - int pdu_num; - - write_timestamp(); - - switch (dir) { - case PDU_SEND: - pdu_dir = "SEND"; - break; - case PDU_RECV: - pdu_dir = "RECV"; - break; - default: - pdu_dir = "undefined"; - break; - } - - if (Hdr == NULL) { - pdu_type = "unknown"; - pdu_num = 0; - } else { - pdu_type = PDU_Types[Hdr->pdutype & 7]; - pdu_num = Hdr->pdutype; - } - - fprintf(Log, - "%s: %s(%d), ILMI %s(%d), PDU Type %s(0x%x) %d/%d bytes.\n", - pdu_dir, - Intf[intf].anp_intf, ilmi_fd[intf], - ILMI_State[intf], ilmi_state[intf], - pdu_type, pdu_num, - len, buf[0]); - - if (Hdr == NULL) - fprintf(Log, "Header seems to be invalid.\n"); - else - print_header(Hdr); - - hexdump(Log, (u_char *)&buf[1], len, NULL); - - return; -} - -/* - * Send a generic response packet - * - * Arguments: - * sd - socket to send the reply on - * reqid - original request ID from GET PDU - * resp - pointer to the response to send - * - * Returns: - * none - response sent - * - */ -static void -send_resp (int intf, Snmp_Header *Hdr, u_char *resp) -{ - int n; - - if ( ilmi_fd[intf] > 0 ) { - n = write ( ilmi_fd[intf], (caddr_t)&resp[1], resp[0] ); - if ( Log && Debug_Level > 1 ) { - print_pdu(PDU_SEND, intf, Hdr, n, resp); - } - } - - free_pdu ( Hdr ); - return; -} - -/* - * Build a COLD_START TRAP PDU - * - */ -static Snmp_Header * -build_cold_start (void) -{ - Snmp_Header *hdr; - Variable *var; - - hdr = (Snmp_Header *)malloc(sizeof(Snmp_Header)); - if (hdr == NULL) { - fprintf(stderr, "malloc() failed in %s()\n", __func__); - exit(1); - } - bzero(hdr, sizeof(Snmp_Header)); - - hdr->pdulen = 0; - hdr->version = SNMP_VERSION_1 - 1; - snprintf ( hdr->community, sizeof(hdr->community), "ILMI" ); - - hdr->ipaddr = 0x0; /* 0.0.0.0 */ - hdr->generic_trap = TRAP_COLDSTART; - hdr->specific_trap = 0; - bcopy ( (caddr_t)&Objids[ENTERPRISE_OBJID], (caddr_t)&hdr->enterprise, - sizeof(Objid) ); - - hdr->head = (Variable *)malloc(sizeof(Variable)); - if (hdr == NULL) { - fprintf(stderr, "malloc() failed in %s()\n", __func__); - exit(1); - } - bzero(hdr->head, sizeof(Variable)); - - var = hdr->head; - bcopy ( (caddr_t)&Objids[UPTIME_OBJID], (caddr_t)&var->oid, - sizeof(Objid) ); - var->type = ASN_NULL; - - return ( hdr ); -} - -/* - * Build a Generic PDU Header - * - */ -static Snmp_Header * -build_generic_header (void) -{ - Snmp_Header *hdr; - - hdr = (Snmp_Header *)malloc(sizeof(Snmp_Header)); - if (hdr == NULL) { - fprintf(stderr, "malloc() failed in %s()\n", __func__); - exit(1); - } - bzero(hdr, sizeof(Snmp_Header)); - - hdr->pdulen = 0; - hdr->version = SNMP_VERSION_1 - 1; - snprintf ( hdr->community, sizeof(hdr->community), "ILMI" ); - - return ( hdr ); -} - -/* - * Initialize information on what physical adapters HARP knows about - * - * Query the HARP subsystem about configuration and physical interface - * information for any currently registered ATM adapters. Store the information - * as arrays for easier indexing by SNMP port/index numbers. - * - * Arguments: - * none - * - * Returns: - * none Information from HARP available - * - */ -static void -init_ilmi (void) -{ - struct air_cfg_rsp *cfg_info = NULL; - struct air_int_rsp *intf_info = NULL; - int buf_len; - - /* - * Get configuration info - what's available with 'atm sh config' - */ - buf_len = get_cfg_info ( NULL, &cfg_info ); - /* - * If error occurred, clear out everything - */ - if ( buf_len <= 0 ) { - bzero ( Cfg, sizeof(Cfg) ); - bzero( Intf, sizeof(Intf) ); - NUnits = 0; - return; - } - - /* - * Move to local storage - */ - bcopy ( cfg_info, (caddr_t)Cfg, buf_len ); - /* - * Compute how many units information was returned for - */ - NUnits = buf_len / sizeof(struct air_cfg_rsp); - /* Housecleaning */ - free ( cfg_info ); - cfg_info = NULL; - /* - * Get the per interface information - */ - buf_len = get_intf_info ( NULL, &intf_info ); - /* - * If error occurred, clear out Intf info - */ - if ( buf_len <= 0 ) { - bzero ( Intf, sizeof(Intf) ); - return; - } - - /* - * Move to local storage - */ - bcopy ( intf_info, (caddr_t)Intf, buf_len ); - /* Housecleaning */ - free ( intf_info ); - intf_info = NULL; - - return; - -} - -/* - * Open a new SNMP session for ILMI - * - * Start by updating interface information, in particular, how many - * interfaces are in the system. While we'll try to open sessons on - * all interfaces, this deamon currently can only handle the first - * interface. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -ilmi_open (void) -{ - 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_app_name appname; - Atm_addr subaddr; - char nifname[IFNAMSIZ]; - int optlen; - int unit = 0; - u_char sig_proto; - - init_ilmi(); - - for ( unit = 0; unit < NUnits; unit++ ) { - - /* - * ILMI only makes sense for UNI signalling protocols - */ - sig_proto = Intf[unit].anp_sig_proto; - if ( sig_proto != ATM_SIG_UNI30 && sig_proto != ATM_SIG_UNI31 && - sig_proto != ATM_SIG_UNI40 ) - continue; - - if ( ilmi_fd[unit] == -1 ) { - - ilmi_fd[unit] = socket ( AF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5 ); - - if ( ilmi_fd[unit] < 0 ) { - perror ( "open" ); - continue; - } - - /* - * Set interface name. For now, we must have a netif to go on... - */ - if ( Intf[unit].anp_nif_cnt == 0 ) { - if ( Debug_Level > 1 && Log ) { - write_timestamp(); - fprintf ( Log, "No nif on unit %d\n", unit ); - } - close ( ilmi_fd[unit] ); - ilmi_fd[unit] = -1; - continue; - } - sprintf ( nifname, "%s0", Intf[unit].anp_nif_pref ); - optlen = sizeof ( nifname ); - if ( setsockopt ( ilmi_fd[unit], T_ATM_SIGNALING, - T_ATM_NET_INTF, (caddr_t)nifname, optlen ) < 0 ) { - perror ( "setsockopt" ); - if ( Log ) { - write_timestamp(); - fprintf ( Log, - "Couldn't set interface name \"%s\"\n", - nifname ); - } - if ( Debug_Level > 1 && Log ) { - write_timestamp(); - fprintf ( Log, "nifname: closing unit %d\n", unit ); - } - close ( ilmi_fd[unit] ); - ilmi_fd[unit] = -1; - continue; - } - - /* - * 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 - - 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_ABSENT; - satm.satm_addr.t_atm_sap_addr.address_format = T_ATM_PVC_ADDR; - satm.satm_addr.t_atm_sap_addr.address_length = sizeof(Atm_addr_pvc); - ATM_PVC_SET_VPI((Atm_addr_pvc *)satm.satm_addr.t_atm_sap_addr.address, - 0 ); - ATM_PVC_SET_VCI((Atm_addr_pvc *)satm.satm_addr.t_atm_sap_addr.address, - 16 ); - - satm.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT; - satm.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_SIMPLE_ID; - satm.satm_addr.t_atm_sap_layer2.ID.simple_ID = T_ATM_BLLI2_I8802; - - satm.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT; - - 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 ( ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_AAL5, - (caddr_t) &aal5, optlen ) < 0 ) { - perror ( "setsockopt(aal5)" ); - if ( Debug_Level > 1 && Log ) { - write_timestamp(); - fprintf ( Log, "aal5: closing unit %d\n", unit ); - } - close ( ilmi_fd[unit] ); - ilmi_fd[unit] = -1; - continue; - } - - 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(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_TRAFFIC, - (caddr_t)&traffic, optlen) < 0) { - perror("setsockopt(traffic)"); - } - 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(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_BEARER_CAP, - (caddr_t)&bearer, optlen) < 0) { - perror("setsockopt(bearer)"); - } - - 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(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_QOS, (caddr_t)&qos, - optlen) < 0) { - perror("setsockopt(qos)"); - } - - subaddr.address_format = T_ATM_ABSENT; - subaddr.address_length = 0; - optlen = sizeof(subaddr); - if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_DEST_SUB, - (caddr_t)&subaddr, optlen) < 0) { - perror("setsockopt(dest_sub)"); - } - - strncpy(appname.app_name, "ILMI", T_ATM_APP_NAME_LEN); - optlen = sizeof(appname); - if (setsockopt(ilmi_fd[unit], T_ATM_SIGNALING, T_ATM_APP_NAME, - (caddr_t)&appname, optlen) < 0) { - perror("setsockopt(appname)"); - } - - /* - * Now try to connect to destination - */ - if ( connect ( ilmi_fd[unit], (struct sockaddr *) &satm, - sizeof(satm)) < 0 ) { - perror ( "connect" ); - if ( Debug_Level > 1 && Log ) { - write_timestamp(); - fprintf ( Log, "connect: closing unit %d\n", unit ); - } - close ( ilmi_fd[unit] ); - ilmi_fd[unit] = -1; - continue; - } - - if ( Debug_Level && Log ) { - write_timestamp(); - fprintf ( Log, "***** opened unit %d\n", unit ); - } - - ilmi_state[unit] = ILMI_COLDSTART; - - } - - } - - return; - -} - -/* - * Get our local IP address for this interface - * - * Arguments: - * s - socket to find address for - * aval - pointer to variable to store address in - * - * Returns: - * none - * - */ -static void -get_local_ip (int s, long *aval) -{ - char intf_name[IFNAMSIZ]; - socklen_t namelen = IFNAMSIZ; - struct air_netif_rsp *net_info = NULL; - struct sockaddr_in *sain; - - /* - * Get physical interface name - */ - if ( getsockopt ( s, T_ATM_SIGNALING, T_ATM_NET_INTF, - (caddr_t) intf_name, &namelen ) ) - return; - - /* - * Get network interface information for this physical interface - */ - get_netif_info ( intf_name, &net_info ); - if ( net_info == NULL ) - return; - - sain = (struct sockaddr_in *)(void *)&net_info->anp_proto_addr; - - /* - * Fill in answer - */ - bcopy ( (caddr_t)&sain->sin_addr.s_addr, aval, 4 ); - - free ( net_info ); - - return; - -} - -/* - * Set local NSAP prefix and then reply with our full NSAP address. - * - * Switch will send a SET message with the NSAP prefix after a coldStart. - * We'll set that prefix into HARP and then send a SET message of our own - * with our full interface NSAP address. - * - * Arguments: - * oid - objid from SET message - * hdr - pointer to internal SNMP header - * buf - pointer to SET buffer - * s - socket to send messages on - * - * Returns: - * none - * - */ -static void -set_prefix (Objid *oid, Snmp_Header *hdr __unused, int intf) -{ - struct atmsetreq asr; - Atm_addr *aa; - int fd; - int i; - - /* - * Build IOCTL request to set prefix - */ - asr.asr_opcode = AIOCS_SET_PRF; - strncpy ( asr.asr_prf_intf, Intf[intf].anp_intf, - sizeof(asr.asr_prf_intf ) ); - /* - * Pull prefix out of received Objid - * save in set_prefix IOCTL and addressEntry table - */ - for ( i = 0; i < oid->oid[13]; i++ ) { - asr.asr_prf_pref[i] = oid->oid[i + 14]; - } - - /* - * Pass new prefix to the HARP kernel - */ - fd = socket ( AF_ATM, SOCK_DGRAM, 0 ); - if ( fd < 0 ) - return; - if ( ioctl ( fd, AIOCSET, (caddr_t)&asr ) < 0 ) { - if ( errno != EALREADY ) { - syslog ( LOG_ERR, "ilmid: error setting prefix: %m" ); - if ( Log ) { - write_timestamp(); - fprintf ( Log, "errno %d setting prefix\n", - errno ); - } - close ( fd ); - return; - } - } - close ( fd ); - - /* - * Reload the cfg/intf info with newly set prefix - */ - init_ilmi(); - - aa = &Intf[intf].anp_addr; - - /* - * Copy our NSAP into addressEntry table - */ - - addressEntry[intf].oid[0] = 0; - for ( i = 0; i < aa->address_length; i++ ) { - addressEntry[intf].oid[0]++; /* Increment length */ - addressEntry[intf].oid[i + 1] = (int)((u_char *)(aa->address))[i]; - - } - - return; - -} - -static void -set_address (Snmp_Header *hdr __unused, int intf) -{ - Variable *var; - int i, j; - - PDU_Header = build_generic_header(); - - PDU_Header->head = (Variable *)malloc(sizeof(Variable)); - if (PDU_Header->head == NULL) { - fprintf(stderr, "malloc() failed in %s()\n", __func__); - exit(1); - } - bzero(PDU_Header->head, sizeof(Variable)); - - var = PDU_Header->head; - /* Copy generic addressEntry OBJID */ - bcopy ( (caddr_t)&Objids[ADDRESS_OBJID], (caddr_t)&var->oid, - sizeof(Objid) ); - /* Set specific instance */ - i = var->oid.oid[0] + 1; /* Get length */ - var->oid.oid[i++] = 1; - var->oid.oid[i++] = 1; - var->oid.oid[i++] = 3; - var->oid.oid[i++] = 0; - - /* Copy in address length */ - var->oid.oid[i++] = addressEntry[intf].oid[0]; - - /* Copy in address */ - for ( j = 0; j < addressEntry[intf].oid[0]; j++ ) - var->oid.oid[i++] = addressEntry[intf].oid[j + 1]; - var->oid.oid[0] = i - 1; /* Set new length */ - - /* Set == VALID */ - var->type = ASN_INTEGER; - var->var.ival = 1; - - build_pdu ( PDU_Header, PDU_TYPE_SET ); - send_resp ( intf, PDU_Header, Resp_Buf ); -} - -/* - * Increment Debug Level - * - * Catches SIGUSR1 signal and increments value of Debug_Level - * - * Arguments: - * sig - signal number - * - * Returns: - * none - Debug_Level incremented - * - */ -static void -Increment_DL (int sig __unused) -{ - Debug_Level++; - if ( Debug_Level && Log == (FILE *)NULL ) { - if ( foregnd ) { - Log = stderr; - } else { - if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL ) - Log = NULL; - } - if ( Log ) { - setbuf ( Log, NULL ); - write_timestamp(); - fprintf ( Log, "Raised Debug_Level to %d\n", Debug_Level ); - } - } - signal ( SIGUSR1, Increment_DL ); - return; -} - -/* - * Decrement Debug Level - * - * Catches SIGUSR2 signal and decrements value of Debug_Level - * - * Arguments: - * sig - signal number - * - * Returns: - * none - Debug_Level decremented - * - */ -static void -Decrement_DL (int sig __unused) -{ - Debug_Level--; - if ( Debug_Level <= 0 ) { - Debug_Level = 0; - if ( Log ) { - write_timestamp(); - fprintf ( Log, "Lowered Debug_Level to %d\n", Debug_Level ); - if ( !foregnd ) - fclose ( Log ); - Log = NULL; - } - } - signal ( SIGUSR2, Decrement_DL ); - return; -} - -/* - * Loop through GET variable list looking for matches - * - */ -static void -process_get (Snmp_Header *hdr, int intf) -{ - Variable *var; - int idx; - int x; - int oidlen; - - var = hdr->head; - while ( var ) { - - /* Handle the 'GET PREFIX' request */ - oidlen = Objids[SETPFX_OBJID].oid[0]; - if (oid_ncmp(&var->oid, &Objids[SETPFX_OBJID], oidlen) == 0) { - var->var.ival = 2; /* assume not valid */ - for(x = 0; x < 13; x++) - if (var->oid.oid[oidlen + x + 2] != - addressEntry[intf].oid[x + 1]) - break; - - /* Address Match */ - if (x == 13) - hdr->head->var.ival = 1; - var = var->next; - continue; - } - - idx = find_var ( var ); - switch ( idx ) { - case MADGE_OBJECT1: - /* reply with NO SUCH OBJECT */ - var->type = ASN_NULL; - break; - case SYS_OBJID: - var->type = ASN_OBJID; - bcopy ( (caddr_t)&Objids[MY_OBJID], - (caddr_t)&var->var.oval, - sizeof(Objid) ); - break; - case UPTIME_OBJID: - var->type = ASN_TIMESTAMP; - var->var.ival = get_ticks(); - break; - case UNITYPE_OBJID: - var->type = ASN_INTEGER; - var->var.ival = UNITYPE_PRIVATE; - break; - case UNIVER_OBJID: - var->type = ASN_INTEGER; - switch ( Intf[intf].anp_sig_proto ) { - case ATM_SIG_UNI30: - var->var.ival = UNIVER_UNI30; - break; - case ATM_SIG_UNI31: - var->var.ival = UNIVER_UNI31; - break; - case ATM_SIG_UNI40: - var->var.ival = UNIVER_UNI40; - break; - default: - var->var.ival = UNIVER_UNKNOWN; - break; - } - break; - case DEVTYPE_OBJID: - var->type = ASN_INTEGER; - var->var.ival = DEVTYPE_USER; - break; - case MAXVCC_OBJID: - var->type = ASN_INTEGER; - var->var.ival = 1024; - break; - case PORT_OBJID: - var->type = ASN_INTEGER; - var->var.ival = intf + 1; - break; - case IPNM_OBJID: - var->type = ASN_IPADDR; - get_local_ip( ilmi_fd[intf], &var->var.aval ); - break; - case ADDRESS_OBJID: - break; - case ATMF_PORTID: - var->type = ASN_INTEGER; - var->var.ival = 0x30 + intf; - break; - case ATMF_SYSID: - var->type = ASN_OCTET; - var->var.sval[0] = 6; - bcopy ( (caddr_t)&Cfg[intf].acp_macaddr, - (caddr_t)&var->var.sval[1], 6 ); - break; - default: - /* NO_SUCH */ - break; - } - var = var->next; - } - build_pdu ( hdr, PDU_TYPE_GETRESP ); - send_resp ( intf, hdr, Resp_Buf ); - -} - -/****************************************************************************** - * - * Find an OBJID from known ones - * - * in: Variable with valid OID - * out: OID number (index), -1 = not found - */ -static int -lmi_object_find (Variable *var) -{ - Objid * obj_var; - Objid * obj_cur; - size_t x; - int y; - - obj_var = &var->oid; - - for (x = 0; x < NUM_OIDS; x++) { - obj_cur = &Objids[x]; - for (y = 0; y < 128; y++) { - if (obj_var->oid[y] != obj_cur->oid[y]) - break; - if (obj_var->oid[y] == 0) /* object ID endmark */ - return (x); - } - } - - return (-1); -} - -#if 0 -/****************************************************************************** - * - * Append instance number to OID - * - * in: Variable, instance number - * out: zero = success - * - */ -static int -lmi_object_instance (Variable *var, int instnum) -{ - int * oidptr; - int curlen; - - oidptr = var->oid.oid; - curlen = oidptr[0]; /* current length */ - if (curlen > 126) - return (1); - curlen++; - oidptr[curlen] = instnum; - oidptr[0] = curlen; - return (0); -} -#endif - -/****************************************************************************** - * - * Handle received GETNEXT - * - * in: Header with valid fields, interface number - * out: zero = success - * - */ -static int -lmi_rcvcmd_getnext (Snmp_Header *header, int intf) -{ - int * oidptr; - int oidlen; - int oidnum; - int x; - - oidnum = lmi_object_find(header->head); - oidptr = header->head->oid.oid; - oidlen = oidptr[0]; - - switch(oidnum) { - /* Should be because the remote side is attempting - * to verify that our table is empty - */ - case ADDRESS_OBJID: - if ( addressEntry[intf].oid[0] ) { - /* XXX - FIXME */ - /* Our table is not empty - return address */ - } - break; - - /* Madge Collage sends GETNEXT for this */ - case SETPFX_OBJID: - if(addressEntry[intf].oid[0]) { /* we have a prefix */ - oidptr[0] += 14; - oidptr += oidlen; /* skip to last number */ - oidptr++; - *oidptr++ = 13; /* length of prefix */ - - /* fill in the prefix */ - for(x = 0; x < 13; x++) { - *oidptr++ = addressEntry[intf].oid[x+1]; - } - header->head->type = ASN_INTEGER; - /* 1=valid, 2=invalid -- only 2 values */ - header->head->var.ival = 1; - } else { /* no prefix available */ - header->head->type = ASN_NULL; - } - break; - - default: - return (1); /* unknown object ID */ - } - - build_pdu(header, PDU_TYPE_GETRESP); - send_resp(intf, header, Resp_Buf); - - return (0); -} - - -/****************************************************************************** - * - * Handle received TRAP - * - * in: Header with valid fields, interface number - * out: zero = success - * - */ -static int -lmi_rcvcmd_trap (Snmp_Header *header __unused, int intf) -{ - - bzero((caddr_t)&addressEntry[intf], sizeof(Objid)); - return (0); -} - -/* - * ILMI State Processing Loop - * - * - */ -static void -ilmi_do_state(void) -{ - struct timeval tvp; - fd_set rfd; - u_char buf[1024]; - Variable *var; - int intf; - int maxfd = 0; - - /* - * Loop forever - */ - for ( ; ; ) { - int count; - int n; - u_char *bpp; - Snmp_Header *Hdr; - - /* - * SunOS CC doesn't allow automatic aggregate initialization. - * Initialize to zero which effects a poll operation. - */ - tvp.tv_sec = 15; - tvp.tv_usec = 0; - - /* - * Clear fd_set and initialize to check this interface - */ - FD_ZERO ( &rfd ); - for ( intf = 0; intf < MAX_UNITS; intf++ ) - if ( ilmi_fd[intf] > 0 ) { - FD_SET ( ilmi_fd[intf], &rfd ); - maxfd = MAX ( maxfd, ilmi_fd[intf] ); - } - - /* - * Check for new interfaces - */ - ilmi_open(); - - for ( intf = 0; intf < MAX_UNITS; intf++ ) { - /* - * Do any pre-message state processing - */ - switch ( ilmi_state[intf] ) { - case ILMI_COLDSTART: - /* - * Clear addressTable - */ - bzero ( (caddr_t)&addressEntry[intf], sizeof(Objid) ); - - /* - * Start by sending a COLD_START trap. This should cause the - * remote end to clear the associated prefix/address table(s). - */ - /* Build ColdStart TRAP header */ - ColdStart_Header = build_cold_start(); - build_pdu ( ColdStart_Header, PDU_TYPE_TRAP ); - send_resp ( intf, ColdStart_Header, Resp_Buf ); - - /* - * Start a timeout so that if the next state fails, we re-enter - * ILMI_COLDSTART. - */ - /* atm_timeout() */ - - /* Enter new state */ - ilmi_state[intf] = ILMI_INIT; - /* fall into ILMI_INIT */ - - case ILMI_INIT: - /* - * After a COLD_START, we need to check that the remote end has - * cleared any tables. Send a GET_NEXT request to check for this. - * In the event that the table is not empty, or that no reply is - * received, return to COLD_START state. - */ - PDU_Header = build_generic_header(); - - PDU_Header->head = (Variable *)malloc(sizeof(Variable)); - if (PDU_Header->head == NULL) { - fprintf(stderr, "malloc() failed in %s()\n", __func__); - exit(1); - } - bzero(PDU_Header->head, sizeof(Variable)); - - var = PDU_Header->head; - bcopy ( (caddr_t)&Objids[ADDRESS_OBJID], (caddr_t)&var->oid, - sizeof(Objid) ); - var->type = ASN_NULL; - var->next = NULL; - - /* - * Send GETNEXT request looking for empty ATM Address Table - */ - PDU_Header->reqid = Req_ID++; - build_pdu ( PDU_Header, PDU_TYPE_GETNEXT ); - send_resp ( intf, PDU_Header, Resp_Buf ); - - /* - * Start a timeout while looking for SET message. If we don't receive - * a SET, then go back to COLD_START state. - */ - /* atm_timeout() */ - break; - - case ILMI_RUNNING: - /* Normal SNMP processing */ - break; - - default: - break; - } - } - - count = select ( maxfd + 1, &rfd, NULL, NULL, &tvp ); - - for ( intf = 0; intf < MAX_UNITS; intf++ ) { - /* - * Check for received messages - */ - if ( ilmi_fd[intf] > 0 && FD_ISSET ( ilmi_fd[intf], & rfd ) ) { - - n = read ( ilmi_fd[intf], (caddr_t)&buf[1], sizeof(buf) - 1 ); - if ( n == -1 && ( errno == ECONNRESET || errno == EBADF ) ) { - ilmi_state[intf] = ILMI_COLDSTART; - close ( ilmi_fd[intf] ); - ilmi_fd[intf] = -1; - } else { - bpp = &buf[1]; - Hdr = asn_get_header(&bpp); - - if ( Log && Debug_Level > 1 ) - print_pdu(PDU_RECV, intf, Hdr, n, buf); - - if (Hdr == NULL) - continue; - - /* What we do with this messages depends upon the state we're in */ - switch ( ilmi_state[intf] ) { - case ILMI_COLDSTART: - /* We should never be in this state here */ - free_pdu ( Hdr ); - break; - case ILMI_INIT: - /* The only messages we care about are GETNEXTs, GETRESPs, and TRAPs */ - switch ( Hdr->pdutype ) { - case PDU_TYPE_GETNEXT: - lmi_rcvcmd_getnext(Hdr, intf); - break; - case PDU_TYPE_GETRESP: - /* - * This should be in response to our GETNEXT. - * Check the OIDs and go onto ILMI_RUNNING if - * the address table is empty. We can cheat and - * not check sequence numbers because we only send - * the one GETNEXT request and ILMI says we shouldn't - * have interleaved sessions. - */ - /* - * First look for empty table. If found, go to next state. - */ - if ((Hdr->error == SNMP_ERR_NOSUCHNAME) || - ((Hdr->error == SNMP_ERR_NOERROR) && - ( oid_ncmp ( &Objids[ADDRESS_OBJID], &Hdr->head->oid, - Objids[ADDRESS_OBJID].oid[0] ) == 1 ))) { - ilmi_state[intf] = ILMI_RUNNING; /* ILMI_REG; */ - } else if (Hdr->error == SNMP_ERR_NOERROR) { - /* - * Check to see if this matches our address - * and if so, that it's a VALID entry. - */ - Atm_addr *aa; - int l; - int match = 1; - - aa = &Intf[intf].anp_addr; - if ( aa->address_length == Hdr->head->oid.oid[13] ) { - for ( l = 0; l < aa->address_length; l++ ) { - if ( (int)((u_char *)(aa->address))[l] != - Hdr->head->oid.oid[14 + l] ) { - match = 0; - } - } - } - if ( match ) { - if ( Hdr->head->var.ival == 1 ) { - ilmi_state[intf] = ILMI_RUNNING; - } - } - } - free_pdu ( Hdr ); - break; - case PDU_TYPE_SET: - /* Look for SET_PREFIX Objid */ - if ( oid_ncmp ( &Hdr->head->oid, - &Objids[SETPFX_OBJID], - Objids[SETPFX_OBJID].oid[0] ) == 0 ) { - set_prefix ( &Hdr->head->oid, Hdr, intf ); - /* Reply to SET before sending our ADDRESS */ - build_pdu(Hdr, PDU_TYPE_GETRESP); - send_resp( intf, Hdr, Resp_Buf ); - set_address ( Hdr, intf ); - } else { - build_pdu(Hdr, PDU_TYPE_GETRESP); - send_resp( intf, Hdr, Resp_Buf ); - } - break; - case PDU_TYPE_TRAP: - /* Remote side wants us to start fresh */ - lmi_rcvcmd_trap(Hdr, intf); - free_pdu ( Hdr ); - break; - default: - /* Ignore */ - free_pdu ( Hdr ); - break; - } - break; - case ILMI_REG: - break; - case ILMI_RUNNING: - /* We'll take anything here */ - switch ( Hdr->pdutype ) { - case PDU_TYPE_GET: - process_get ( Hdr, intf ); - break; - case PDU_TYPE_GETRESP: - /* Ignore GETRESPs */ - free_pdu ( Hdr ); - break; - case PDU_TYPE_GETNEXT: - lmi_rcvcmd_getnext(Hdr, intf); - break; - case PDU_TYPE_SET: - /* Look for SET_PREFIX Objid */ - if ( oid_ncmp ( &Hdr->head->oid, - &Objids[SETPFX_OBJID], - Objids[SETPFX_OBJID].oid[0] ) == 0 ) { - set_prefix ( &Hdr->head->oid, Hdr, intf ); - /* Reply to SET before sending our ADDRESS */ - build_pdu(Hdr, PDU_TYPE_GETRESP); - send_resp( intf, Hdr, Resp_Buf ); - set_address ( Hdr, intf ); - } else { - build_pdu(Hdr, PDU_TYPE_GETRESP); - send_resp( intf, Hdr, Resp_Buf ); - } - break; - case PDU_TYPE_TRAP: - lmi_rcvcmd_trap(Hdr, intf); - free_pdu ( Hdr ); - break; - } - break; - default: - /* Unknown state */ - free_pdu ( Hdr ); - break; - } - } /* if n > 0 */ - } /* if received message */ - } /* for each interface */ - } /* for ever loop */ - -} - -int -main (int argc, char *argv[]) -{ - int c; - int i; - int Reset = 0; /* Should we send a coldStart and exit? */ - - /* - * What are we running as? (argv[0]) - */ - progname = strdup ( (char *)basename ( argv[0] ) ); - /* - * What host are we - */ - gethostname ( hostname, sizeof ( hostname ) ); - - /* - * Ilmid needs to run as root to set prefix - */ - if ( getuid() != 0 ) { - fprintf ( stderr, "%s: needs to run as root.\n", progname ); - exit ( -1 ); - } - - /* - * Parse arguments - */ - while ( ( c = getopt ( argc, argv, "d:fr" ) ) != -1 ) - switch ( c ) { - case 'd': - Debug_Level = atoi ( optarg ); - break; - case 'f': - foregnd++; - break; - case 'r': - Reset++; - break; - case '?': - fprintf ( stderr, "usage: %s [-d level] [-f] [-r]\n", - progname ); - exit ( -1 ); -/* NOTREACHED */ - break; - } - - /* - * If we're not doing debugging, run in the background - */ - if ( foregnd == 0 ) { - if ( daemon ( 0, 0 ) ) - err ( 1, "Can't fork" ); - } /* else - setbuf ( stdout, NULL ); */ - - signal ( SIGUSR1, Increment_DL ); - signal ( SIGUSR2, Decrement_DL ); - - /* - * Open log file - */ - if ( Debug_Level ) { - if ( foregnd ) { - Log = stderr; - } else { - if ( ( Log = fopen ( LOG_FILE, "a" ) ) == NULL ) - Log = NULL; - } - } - if ( Log ) - setbuf ( Log, NULL ); - - /* - * Get our startup time - */ - (void) gettimeofday ( &starttime, NULL ); - starttime.tv_sec--; - starttime.tv_usec += 1000000; - - /* Randomize starting request ID */ - Req_ID = starttime.tv_sec; - - /* - * Reset all the interface descriptors - */ - for ( i = 0; i < MAX_UNITS; i++ ) { - ilmi_fd[i] = -1; - } - /* - * Try to open all the interfaces - */ - ilmi_open (); - - /* - * If we're just sending a coldStart end exiting... - */ - if ( Reset ) { - for ( i = 0; i < MAX_UNITS; i++ ) - if ( ilmi_fd[i] >= 0 ) { - /* Build ColdStart TRAP header */ - ColdStart_Header = build_cold_start(); - build_pdu ( ColdStart_Header, PDU_TYPE_TRAP ); - send_resp ( i, ColdStart_Header, Resp_Buf ); - if ( Debug_Level > 1 && Log ) { - write_timestamp(); - fprintf ( Log, "Close ilmi_fd[%d]: %d\n", - i, ilmi_fd[i] ); - } - close ( ilmi_fd[i] ); - } - exit ( 2 ); - } - - ilmi_do_state(); - - exit(0); -} Property changes on: head/sbin/atm/ilmid/ilmid.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/ilmid/ilmid.8 =================================================================== --- head/sbin/atm/ilmid/ilmid.8 (revision 179307) +++ head/sbin/atm/ilmid/ilmid.8 (nonexistent) @@ -1,110 +0,0 @@ -.\" -.\" =================================== -.\" 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$ -.\" -.Dd September 14, 1998 -.Dt ILMID 8 -.Os -.Sh NAME -.Nm ilmid -.Nd "simple ILMI ATM address registration daemon" -.Sh SYNOPSIS -.Nm -.Op Fl d Ar level -.Op Fl f -.Op Fl r -.Sh DESCRIPTION -The -.Nm -utility is a HARP ATM daemon that performs the ILMI ATM address registration -procedures with an ATM network switch. -It is normally invoked at boot time -from the ATM startup script. -.Pp -For each ATM interface with a UNI signalling manager attached, -.Nm -will open an ILMI PVC (VPI = 0, VCI = 16) and register the interface's -ATM address with the switch. -As part of the address registration procedure, -the ATM switch will notify the endsystem (local host) of the -.Dq "network prefix" -portion of the endsystem's ATM address and -.Nm -will notify the switch of the endsystem's -.Dq "user part" -of its address -(typically the interface card MAC address). -.Sh OPTIONS -.Bl -tag -width indent -.It Fl d Ar level -Specify the debug level for optional protocol tracing. -Messages are -written to -.Pa /var/log/ilmid . -.It Fl f -Causes -.Nm -to run in the foreground. -.It Fl r -Causes -.Nm -to issue a coldStart TRAP on all ATM interfaces it is able to open and exit. -.El -.Sh NOTES -This daemon does not fully conform to the ATM Forum ILMI specifications. -In particular, it -does not make any queries of the network side to ensure -that the ATM Address table is empty. -It also does not implement any -of the ATM Forum MIB that is specified as part of ILMI. -.Pp -The -.Nm -utility will increment the debug level when it receives a -.Dv SIGUSR1 -signal and will -decrement the debug level when it receives a -.Dv SIGUSR2 -signal. -.Sh SEE ALSO -The ATM Forum, -.%T "ATM User-Network Interface, Version 3.1 (UNI 3.1) Specification" -for details on the ILMI protocols and address registration -procedures. -.Sh COPYRIGHT -Copyright (c) 1994-1998, Network Computing Services, Inc. -.Sh AUTHORS -.An John Cavanaugh , -Network Computing Services, Inc. -.An Mike Spengler , -Network Computing Services, Inc. -.An Joseph Thomas , -Network Computing Services, Inc. -.Sh ACKNOWLEDGMENTS -This software was developed with the support of the -Defense Advanced Research Projects Agency (DARPA). -.Sh BUGS -Please report any bugs to -.Aq harp\-bugs@magic.net . Property changes on: head/sbin/atm/ilmid/ilmid.8 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/ilmid/Makefile =================================================================== --- head/sbin/atm/ilmid/Makefile (revision 179307) +++ head/sbin/atm/ilmid/Makefile (nonexistent) @@ -1,40 +0,0 @@ -# =================================== -# 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. -# -# @(#) $Id: Makefile,v 1.5 1998/07/10 16:01:58 jpt Exp $ -# $FreeBSD$ - -PROG= ilmid -MAN= ilmid.8 - -.if ${MACHINE_ARCH} == "arm" -WARNS?= 3 -.else -WARNS?= 6 -.endif - -CFLAGS+= -I${.CURDIR}/../../../sys - -DPADD= ${LIBATM} -LDADD= -latm - -.include Property changes on: head/sbin/atm/ilmid/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/fore_dnld/COPYRIGHT =================================================================== --- head/sbin/atm/fore_dnld/COPYRIGHT (revision 179307) +++ head/sbin/atm/fore_dnld/COPYRIGHT (nonexistent) @@ -1,38 +0,0 @@ -$FreeBSD$ - -This copyright applies to the microcode image in the file pca200e.c. - -(Copyright Notice) - -Copyright (c) 1995-2000 FORE Systems, Inc., as an unpublished work. - -This notice does not imply unrestricted or public access to these -materials which are a trade secret of FORE Systems, Inc. or its -subsidiaries or affiliates (together referred to as "FORE"), and -which may not be reproduced, used, sold or transferred to any third -party without FORE's prior written consent. All rights reserved. - -U.S. Government Restricted Rights. - -If you are licensing the Software on behalf of the U.S. Government -("Government"), the following provisions apply to you. If the -software is supplied to the Department of Defense ("DoD"), it is -classified as "Commercial Computer Software" under paragraph -252.227-7014 of the DoD Supplement to the Federal Acquisition -Regulations ("DFARS") (or any successor regulations) and the -Government is acquiring only the license rights granted herein (the -license rights customarily provided to non-Government users). If -the Software is supplied to any unit or agency of the Government -other than the DoD, it is classified as "Restricted Computer -Software" and the Government's rights in the Software are defined -in paragraph 52.227-19 of the Federal Acquisition Regulations -("FAR") (or any successor regulations) or, in the cases of NASA, -in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or -any successor regulations). - -FORE Systems is a registered trademark, and ForeRunner, ForeRunnerLE, -and ForeThought are trademarks of FORE Systems, Inc. All other -brands or product names are trademarks or registered trademarks of -their respective holders. - -(End Copyright Notice) Property changes on: head/sbin/atm/fore_dnld/COPYRIGHT ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/fore_dnld/pca200e.c =================================================================== --- head/sbin/atm/fore_dnld/pca200e.c (revision 179307) +++ head/sbin/atm/fore_dnld/pca200e.c (nonexistent) @@ -1,3796 +0,0 @@ -/* - * (Copyright Notice) - * - * Copyright (c) 1995-2000 FORE Systems, Inc., as an unpublished work. - * - * This notice does not imply unrestricted or public access to these - * materials which are a trade secret of FORE Systems, Inc. or its - * subsidiaries or affiliates (together referred to as "FORE"), and - * which may not be reproduced, used, sold or transferred to any third - * party without FORE's prior written consent. All rights reserved. - * - * U.S. Government Restricted Rights. - * If you are licensing the Software on behalf of the U.S. Government - * ("Government"), the following provisions apply to you. If the - * software is supplied to the Department of Defense ("DoD"), it is - * classified as "Commercial Computer Software" under paragraph - * 252.227-7014 of the DoD Supplement to the Federal Acquisition - * Regulations ("DFARS") (or any successor regulations) and the - * Government is acquiring only the license rights granted herein (the - * license rights customarily provided to non-Government users). If - * the Software is supplied to any unit or agency of the Government - * other than the DoD, it is classified as "Restricted Computer - * Software" and the Government's rights in the Software are defined - * in paragraph 52.227-19 of the Federal Acquisition Regulations - * ("FAR") (or any successor regulations) or, in the cases of NASA, - * in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or - * any successor regulations). - * - * FORE Systems is a registered trademark, and ForeRunner, ForeRunnerLE, - * and ForeThought are trademarks of FORE Systems, Inc. All other - * brands or product names are trademarks or registered trademarks of - * their respective holders. - * - * (End Copyright Notice) - * - * This are binary copies of the PCA200E firmware versions 3.0.1 and - * 4.1.12 - * - * $FreeBSD$ - */ - -#include - -u_char pca200e_microcode_3[] = { -102,111,114,101,0,1,0,0,0,82,0,0,208,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,77,0,0,0,4,0,0,0,0,0,0,0,0,0,0,3, -0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,96,244,0,0,0,0,0,0,1,255,128,255, -0,0,0,0,1,255,255,255,113,0,0,0,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,0, -0,0,0,0,0,1,231,167,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,223,111,223,0,0,0,0,1, -127,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,127,65,127,0,0,0, -0,1,7,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,251,0,251,0,0,0,0,1, -255,240,240,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,15,0,0,0,0,0, -0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,15,0,0,0,0,0,0,1,127,1,127,0,0, -0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,173,0,129,0,0,0,0,1,175,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,1,255,175,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,1,255,0,0,0,0,0,0,1,255,255,0,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0, -0,0,0,0,0,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1,135,3,135,0,0,0,0,1,63,62,63,0,0,0,0,1,127,127,127, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,255,255,0,0,0,0,1,255,255, -255,144,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,255,255,255,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1,191,63,63,4,0,0,0,1,255,224,224,0,0,0,0,1,255,255, -255,0,0,0,0,1,255,255,255,0,0,0,0,1,255,0,0,0,0,0,0,1,255,255,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,1,255,159,159,4,0,0,0,1,255,255,255,0,0,0,0,1,255,255,255, -106,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,5,31,5,0,0,0,0,0,0,0,0,1,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,130,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,144,86,0,0,176, -86,0,0,208,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0, -0,0,0,0,160,0,0,0,0,0,0,0,200,0,0,0,0,0,0,0,250,0,0,0,0,0,0,64,156,0,0, -0,0,0,0,80,195,0,0,0,0,0,0,36,244,0,0,0,0,0,128,150,152,0,0,0,0,0,32,188, -190,0,0,0,0,0,40,107,238,0,0,0,0,0,249,2,149,0,0,0,0,64,183,67,186,0,0, -0,0,16,165,212,232,0,0,0,0,42,231,132,145,0,0,0,128,244,32,230,181,0,0, -0,160,49,169,95,227,0,0,0,0,4,0,0,0,7,0,0,0,10,0,0,0,14,0,0,0,17,0,0,0, -20,0,0,0,24,0,0,0,27,0,0,0,30,0,0,0,34,0,0,0,37,0,0,0,40,0,0,0,44,0,0,0, -47,0,0,0,50,0,0,0,255,255,255,255,255,255,255,255,0,0,0,4,191,201,27,142, -157,181,112,43,168,173,197,157,214,149,67,14,5,141,41,175,213,166,207,255, -73,31,120,194,251,247,218,135,143,122,231,215,162,20,155,197,22,171,179, -239,158,50,35,153,192,173,15,133,223,140,233,128,201,71,186,147,231,166, -211,168,197,185,2,164,170,23,230,127,43,161,22,182,147,191,155,133,145, -162,40,202,106,85,39,57,141,247,112,224,69,97,130,55,53,12,46,249,47,201, -60,227,255,150,82,138,101,23,191,214,243,166,145,153,141,222,249,157,251, -235,126,170,130,188,157,167,74,209,73,189,140,47,106,92,25,252,38,210,253, -131,124,36,32,223,80,233,0,0,0,0,54,0,0,0,107,0,0,0,160,0,0,0,213,0,0,0, -10,1,0,0,63,1,0,0,117,1,0,0,170,1,0,0,223,1,0,0,20,2,0,0,73,2,0,0,126,2, -0,0,179,2,0,0,233,2,0,0,30,3,0,0,83,3,0,0,136,3,0,0,189,3,0,0,242,3,0,0, -255,255,255,255,255,255,255,255,204,204,204,204,204,204,204,204,10,215, -163,112,61,10,215,163,59,223,79,141,151,110,18,131,43,101,25,226,88,23, -183,209,35,132,71,27,71,172,197,167,181,105,108,175,5,189,55,134,188,66, -122,229,213,148,191,214,252,206,97,132,17,119,204,171,151,165,180,54,65, -95,112,137,190,213,237,189,206,254,230,219,254,170,36,203,11,255,235,175, -203,136,80,111,9,204,188,140,19,14,180,75,66,19,46,225,15,216,92,9,53,220, -36,180,217,172,176,58,247,124,29,144,0,0,0,0,253,255,255,255,250,255,255, -255,247,255,255,255,243,255,255,255,240,255,255,255,237,255,255,255,233, -255,255,255,230,255,255,255,227,255,255,255,223,255,255,255,220,255,255, -255,217,255,255,255,213,255,255,255,210,255,255,255,207,255,255,255,255, -255,255,255,255,255,255,255,91,225,77,196,190,148,149,230,186,148,57,69, -173,30,177,207,89,193,126,177,83,124,18,187,165,233,57,165,39,234,127,168, -165,25,9,107,186,96,197,151,155,83,117,253,247,2,180,136,125,211,101,240, -188,53,67,246,160,228,188,100,124,70,208,221,200,130,83,124,110,186,202, -199,147,160,115,219,147,224,244,179,47,0,203,56,219,39,23,162,6,204,35, -84,119,131,255,145,96,188,164,61,169,222,128,131,189,78,49,74,236,60,229, -236,214,225,50,207,205,95,96,213,57,25,122,99,37,67,49,192,102,59,228,94, -171,142,28,173,119,197,106,131,98,206,236,155,37,73,11,186,217,220,113, -140,0,0,0,0,203,255,255,255,150,255,255,255,97,255,255,255,44,255,255,255, -247,254,255,255,194,254,255,255,140,254,255,255,87,254,255,255,34,254,255, -255,237,253,255,255,184,253,255,255,131,253,255,255,78,253,255,255,24,253, -255,255,227,252,255,255,174,252,255,255,121,252,255,255,68,252,255,255, -15,252,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,10,0,0, -0,0,0,0,0,100,0,0,0,0,0,0,0,232,3,0,0,0,0,0,0,16,39,0,0,0,0,0,0,160,134, -1,0,0,0,0,0,64,66,15,0,0,0,0,0,128,150,152,0,0,0,0,0,0,225,245,5,0,0,0, -0,0,202,154,59,0,0,0,0,0,228,11,84,2,0,0,0,0,232,118,72,23,0,0,0,0,16,165, -212,232,0,0,0,0,160,114,78,24,9,0,0,0,64,122,16,243,90,0,0,0,128,198,164, -126,141,3,0,0,0,193,111,242,134,35,0,0,0,138,93,120,69,99,1,0,0,100,167, -179,182,224,13,0,0,232,137,4,35,199,138,1,0,0,0,10,0,0,0,100,0,0,0,232, -3,0,0,16,39,0,0,160,134,1,0,64,66,15,0,128,150,152,0,0,225,245,5,0,202, -154,59,0,0,0,0,0,0,0,0,0,48,128,140,112,218,3,0,12,192,135,50,16,22,8,92, -4,0,0,9,128,62,0,102,0,0,0,140,0,30,240,92,0,48,128,140,32,242,0,0,0,48, -136,140,112,202,3,0,0,16,244,146,4,8,132,89,248,95,132,52,0,48,128,140, -0,16,0,59,204,129,0,9,252,148,0,9,20,128,0,9,112,98,0,9,140,119,0,9,0,48, -48,144,32,242,0,0,40,160,1,50,16,22,32,93,0,20,128,140,0,0,0,0,0,48,136, -140,64,93,0,0,17,1,132,89,16,128,49,89,0,144,1,134,4,22,128,93,72,0,0,9, -228,97,0,8,84,65,88,73,45,49,48,48,0,0,0,0,0,0,0,0,84,65,88,73,45,49,52, -48,0,0,0,0,0,0,0,0,83,79,78,69,84,95,79,67,51,0,0,0,0,0,0,0,85,78,75,78, -79,87,78,0,0,0,0,0,0,0,0,0,32,96,8,140,188,46,0,9,104,43,0,9,0,48,160,144, -68,20,0,80,63,0,40,140,64,224,47,130,8,222,40,89,148,64,33,88,65,224,247, -130,4,22,128,92,4,42,0,9,136,25,40,88,78,64,33,58,18,64,33,49,30,32,1,58, -16,1,0,8,0,0,0,0,137,25,40,88,102,64,33,58,0,1,0,8,0,0,0,0,0,48,160,144, -84,82,0,0,13,30,40,92,64,224,135,140,0,48,40,130,80,243,0,0,0,48,136,140, -96,93,0,0,5,30,40,92,40,0,0,8,0,48,160,144,84,82,0,0,9,30,40,92,64,224, -135,140,0,48,40,130,80,243,0,0,0,48,136,140,112,93,0,0,4,30,40,92,176,32, -45,146,16,106,0,11,180,0,0,8,0,48,160,136,2,4,0,136,8,30,40,92,0,48,40, -130,80,243,0,0,148,208,169,88,26,96,13,55,0,48,160,144,84,82,0,0,6,30,40, -92,92,0,0,8,0,0,0,0,149,16,161,88,46,32,21,48,26,96,5,48,0,48,160,144,84, -82,0,0,22,30,40,92,60,0,0,8,0,0,0,0,0,48,160,144,84,82,0,0,31,216,41,89, -40,0,0,8,26,96,5,48,0,48,160,144,84,82,0,0,31,216,45,89,20,0,0,8,0,0,0, -0,0,48,160,144,84,82,0,0,70,0,40,140,176,32,45,146,64,224,135,140,0,48, -136,140,128,93,0,0,116,105,0,11,24,0,0,8,0,0,0,0,64,224,135,140,0,48,136, -140,144,93,0,0,92,105,0,11,32,44,0,9,44,50,0,9,168,39,0,9,108,41,0,11,137, -25,40,88,54,64,33,61,0,30,128,92,80,224,143,140,136,89,0,11,38,32,4,58, -80,224,167,144,0,48,168,144,84,82,0,0,127,0,40,140,148,64,161,88,180,96, -165,146,24,0,0,8,0,0,0,0,0,48,160,144,84,82,0,0,1,25,40,89,180,32,45,146, -0,48,40,140,80,242,0,0,0,48,40,146,48,242,0,0,152,42,0,9,0,48,48,140,255, -255,0,0,31,88,62,89,0,48,64,140,96,0,0,32,0,48,72,140,112,243,0,0,0,48, -80,140,128,243,0,0,0,48,88,140,144,243,0,0,0,48,96,140,160,243,0,0,0,48, -104,140,176,243,0,0,0,48,112,140,192,243,0,0,0,48,120,140,208,243,0,0,0, -48,24,140,224,243,0,0,0,48,168,144,64,244,0,0,0,80,165,144,20,80,160,89, -0,80,165,146,0,48,160,144,48,242,0,0,0,16,133,144,0,13,0,9,0,48,160,144, -48,242,0,0,0,48,168,144,32,20,0,80,4,32,165,144,149,48,0,90,0,48,160,146, -48,242,0,0,42,0,0,21,0,48,160,144,36,20,0,80,30,32,5,61,0,48,160,144,40, -20,0,80,18,32,5,61,0,48,160,144,44,20,0,80,8,32,5,58,148,56,0,9,0,48,128, -144,16,82,0,0,18,32,4,58,36,13,0,9,0,48,240,146,16,82,0,0,0,48,136,144, -128,180,3,0,0,80,164,144,102,33,5,58,0,80,132,144,0,80,140,144,0,48,144, -144,52,242,0,0,31,29,40,88,144,208,131,88,145,64,137,88,220,28,0,9,0,48, -168,144,52,242,0,0,4,96,165,144,24,222,43,89,6,96,141,128,148,128,145,88, -148,64,161,88,24,12,165,89,74,32,37,58,14,32,37,60,18,32,5,58,140,0,0,8, -98,32,45,58,132,0,0,8,0,48,176,144,52,242,0,0,0,30,152,92,0,144,41,140, -8,160,165,144,0,144,133,144,22,16,180,89,148,64,169,88,16,12,165,89,28, -78,0,9,88,0,0,8,0,0,0,0,0,48,176,144,52,242,0,0,0,30,152,92,8,160,165,144, -0,144,133,144,22,16,180,89,148,128,169,88,16,12,165,89,192,79,0,9,44,0, -0,8,0,48,176,144,52,242,0,0,0,30,152,92,0,144,41,140,8,160,165,144,0,144, -133,144,22,16,180,89,148,64,169,88,16,12,165,89,196,72,0,9,0,48,160,144, -128,180,3,0,4,32,181,144,0,16,245,146,0,48,168,144,132,180,3,0,20,16,162, -89,0,48,160,146,128,180,3,0,22,64,165,54,0,48,160,144,136,180,3,0,0,48, -160,146,128,180,3,0,0,48,160,144,52,242,0,0,0,48,176,146,56,0,0,32,2,30, -40,92,0,48,40,146,96,0,0,48,4,32,165,144,28,12,165,89,46,32,5,58,0,48,168, -144,40,82,0,0,255,0,40,140,21,80,168,89,149,64,161,88,136,9,165,88,0,48, -168,146,40,82,0,0,0,48,160,146,4,0,0,32,0,48,160,144,56,242,0,0,0,16,165, -144,127,0,40,140,148,64,161,88,246,61,5,58,2,9,165,89,102,34,61,52,20,57, -160,144,232,97,0,0,0,16,5,132,0,0,0,0,8,98,0,0,108,100,0,0,32,98,0,0,108, -100,0,0,56,98,0,0,144,99,0,0,176,99,0,0,216,99,0,0,0,48,128,144,56,242, -0,0,80,47,0,9,16,22,232,92,88,2,0,8,0,0,0,0,0,48,128,144,56,242,0,0,168, -49,0,9,16,22,232,92,64,2,0,8,0,0,0,0,0,48,160,144,68,20,0,80,2,30,232,92, -30,32,157,48,147,9,165,88,0,48,240,146,52,244,0,0,0,48,160,146,68,20,0, -80,16,0,0,8,1,30,40,92,0,48,40,146,52,244,0,0,0,48,160,144,56,242,0,0,4, -32,165,144,0,48,184,140,96,243,0,0,0,48,160,146,84,0,0,32,0,48,56,146,96, -0,0,32,0,208,133,176,0,16,130,178,0,80,130,176,0,16,130,178,0,144,130,176, -0,16,130,178,0,208,130,176,0,16,130,178,0,16,131,176,0,16,130,178,0,80, -131,176,0,16,130,178,0,144,131,176,0,16,130,178,0,208,131,176,0,16,130, -178,0,208,128,176,0,16,130,178,0,48,160,140,240,243,0,0,0,16,133,176,0, -16,130,178,0,48,160,140,0,244,0,0,0,16,133,176,0,16,130,178,0,48,160,140, -16,244,0,0,0,16,133,176,0,48,184,140,32,244,0,0,0,16,130,178,0,208,165, -144,0,48,160,146,96,0,0,32,23,16,169,89,0,80,165,144,0,48,160,146,96,0, -0,32,23,16,170,89,0,80,165,144,23,16,171,89,0,48,160,146,96,0,0,32,0,80, -165,144,0,48,160,146,96,0,0,32,23,16,172,89,0,80,165,144,0,48,160,146,96, -0,0,32,23,16,173,89,0,80,165,144,0,48,160,146,96,0,0,32,23,16,174,89,0, -80,165,144,23,16,175,89,0,48,160,146,96,0,0,32,0,80,165,144,0,48,160,146, -96,0,0,32,228,0,0,8,0,48,128,144,56,242,0,0,80,89,0,11,2,30,232,92,210, -32,4,61,10,30,232,92,200,0,0,8,0,0,0,0,128,90,0,9,0,48,160,144,56,242,0, -0,4,32,141,144,16,30,128,92,0,48,144,140,240,193,3,0,228,25,0,9,2,30,232, -92,156,0,0,8,0,48,160,144,56,242,0,0,4,32,165,144,0,48,160,146,64,0,0,32, -0,48,160,144,0,225,1,240,0,48,160,146,96,0,0,48,0,48,160,144,4,225,1,240, -0,48,160,146,96,0,0,48,0,48,160,144,100,224,1,240,0,48,160,146,96,0,0,48, -0,48,160,144,104,224,1,240,2,30,232,92,0,48,160,146,96,0,0,48,64,0,0,8, -0,0,0,0,0,48,160,144,56,242,0,0,0,16,165,144,0,48,40,140,94,208,94,208, -34,64,161,61,0,48,160,144,64,244,0,0,0,30,128,92,0,48,40,140,13,0,173,222, -0,16,45,146,216,90,0,9,8,30,232,92,0,48,176,144,56,242,0,0,0,144,165,144, -118,32,61,48,16,160,189,144,0,144,245,146,0,48,168,144,60,242,0,0,32,160, -165,140,0,48,160,146,56,242,0,0,22,64,165,54,0,48,160,144,64,242,0,0,0, -48,160,146,56,242,0,0,0,48,168,144,40,82,0,0,0,48,184,146,56,0,0,32,255, -0,40,140,0,48,232,146,96,0,0,48,21,80,168,89,149,64,161,88,136,9,165,88, -0,48,168,146,40,82,0,0,0,48,160,146,4,0,0,32,80,0,0,8,0,0,0,0,0,48,160, -144,56,242,0,0,16,32,181,144,0,16,245,146,0,48,168,144,60,242,0,0,32,32, -165,140,0,48,160,146,56,242,0,0,22,64,165,54,0,48,160,144,64,242,0,0,0, -48,160,146,56,242,0,0,0,48,176,146,56,0,0,32,0,48,232,146,96,0,0,48,0,48, -160,144,56,242,0,0,0,16,165,144,127,0,40,140,148,64,161,88,132,60,5,61, -112,250,255,8,0,0,0,0,0,0,0,0,0,0,0,0,16,22,32,93,44,27,0,9,132,208,163, -88,255,0,144,140,148,128,164,88,62,32,5,61,133,48,0,90,0,48,232,140,0,0, -0,48,42,0,0,22,0,80,167,176,0,16,161,178,0,80,167,176,4,73,41,89,16,32, -33,140,133,48,0,90,0,16,161,178,4,16,36,89,224,255,255,17,0,0,0,10,0,48, -160,140,0,0,0,48,0,16,165,152,4,73,41,89,133,48,0,90,0,16,161,154,4,16, -34,89,0,48,152,140,0,0,0,48,42,0,0,22,0,208,164,176,0,16,161,178,0,208, -164,176,4,73,41,89,16,32,33,140,133,48,0,90,0,16,161,178,4,16,36,89,224, -255,255,17,0,48,160,140,0,0,0,48,0,16,165,176,0,16,161,178,0,48,160,140, -0,0,0,48,0,16,165,152,4,16,36,89,0,16,161,154,0,0,0,10,0,0,0,0,0,0,0,0, -0,0,0,0,28,32,180,144,12,32,172,144,0,48,160,144,40,82,0,0,0,144,181,144, -20,80,160,89,0,48,160,146,40,82,0,0,145,48,0,90,255,0,184,140,149,56,168, -140,0,0,0,0,0,48,176,146,48,0,0,32,0,48,168,146,96,0,0,32,148,192,165,88, -0,48,160,146,4,0,0,32,10,0,0,18,224,6,0,8,0,48,128,146,16,82,0,0,0,0,0, -10,0,48,160,144,16,82,0,0,16,22,40,92,16,32,36,144,22,32,5,58,20,22,128, -92,184,6,0,9,0,48,240,146,16,82,0,0,12,96,161,144,0,48,168,144,112,180, -3,0,20,1,161,89,14,64,165,52,1,30,128,92,0,0,0,10,0,48,160,144,112,242, -0,0,154,32,5,58,0,48,128,176,112,242,0,0,0,48,48,152,136,242,0,0,1,9,164, -89,0,16,133,140,0,48,160,146,112,242,0,0,148,160,4,90,148,157,185,140,6, -1,0,19,0,208,161,144,254,32,5,58,0,208,177,144,0,48,168,144,124,242,0,0, -0,48,160,144,40,82,0,0,0,48,176,146,48,0,0,32,0,48,232,140,112,242,0,0, -0,48,232,146,16,82,0,0,255,0,232,140,149,56,168,140,0,0,0,0,20,80,160,89, -0,48,168,146,96,0,0,32,148,64,183,88,0,48,160,146,40,82,0,0,0,48,176,146, -4,0,0,32,160,0,0,8,0,0,0,0,0,48,160,144,32,244,0,0,0,48,176,144,140,242, -0,0,20,80,160,89,0,48,160,146,32,244,0,0,0,144,165,144,146,32,5,58,0,144, -181,144,0,48,168,144,40,82,0,0,0,48,160,144,124,242,0,0,0,48,176,146,48, -0,0,32,148,56,160,140,0,0,0,0,0,48,160,146,96,0,0,32,21,80,168,89,255,0, -232,140,0,48,168,146,40,82,0,0,149,64,175,88,0,48,128,140,112,242,0,0,0, -48,168,146,4,0,0,32,124,5,0,9,0,48,160,144,112,242,0,0,0,48,168,144,136, -242,0,0,1,9,165,89,0,48,160,146,112,242,0,0,148,93,189,140,0,208,165,144, -0,16,161,146,4,16,34,89,16,96,33,146,4,224,133,144,0,0,0,10,168,254,255, -8,0,0,0,0,0,0,0,0,0,0,0,0,0,48,160,144,16,82,0,0,16,22,40,92,16,32,36,144, -22,32,5,58,20,22,128,92,24,5,0,9,0,48,240,146,16,82,0,0,12,96,161,144,0, -48,168,144,112,180,3,0,20,1,161,89,14,64,165,52,1,30,128,92,0,0,0,10,0, -48,160,144,160,242,0,0,146,32,5,58,0,48,128,176,160,242,0,0,0,48,48,152, -184,242,0,0,1,9,164,89,0,16,133,140,0,48,160,146,160,242,0,0,148,160,4, -90,148,157,185,140,250,0,0,19,0,208,161,144,242,32,5,58,0,208,177,144,0, -48,168,144,172,242,0,0,0,48,160,144,40,82,0,0,0,48,176,146,48,0,0,32,0, -48,232,140,160,242,0,0,0,48,232,146,16,82,0,0,255,0,232,140,1,78,173,89, -1,32,165,140,0,48,168,146,96,0,0,32,148,64,183,88,0,48,160,146,40,82,0, -0,0,48,176,146,4,0,0,32,152,0,0,8,0,48,160,144,36,244,0,0,0,48,176,144, -188,242,0,0,20,80,160,89,0,48,160,146,36,244,0,0,0,144,165,144,146,32,5, -58,0,144,181,144,0,48,168,144,40,82,0,0,0,48,160,144,172,242,0,0,0,48,176, -146,48,0,0,32,1,14,165,89,0,48,160,146,96,0,0,32,21,80,168,89,255,0,232, -140,0,48,168,146,40,82,0,0,149,64,175,88,0,48,128,140,160,242,0,0,0,48, -168,146,4,0,0,32,232,3,0,9,0,48,160,144,160,242,0,0,0,48,168,144,184,242, -0,0,1,9,165,89,0,48,160,146,160,242,0,0,148,93,189,140,0,208,165,144,0, -16,161,146,4,16,34,89,16,96,33,146,4,224,133,144,0,0,0,10,0,0,0,0,176,254, -255,8,0,0,0,0,0,48,160,144,16,82,0,0,16,22,40,92,16,32,36,144,22,32,5,58, -20,22,128,92,136,3,0,9,0,48,240,146,16,82,0,0,12,96,161,144,0,48,168,144, -112,180,3,0,20,1,161,89,14,64,165,52,1,30,128,92,0,0,0,10,0,48,160,144, -208,242,0,0,146,32,5,58,0,48,128,176,208,242,0,0,0,48,48,152,232,242,0, -0,1,9,164,89,0,16,133,140,0,48,160,146,208,242,0,0,148,160,4,90,148,157, -185,140,250,0,0,19,0,208,161,144,242,32,5,58,0,208,177,144,0,48,168,144, -220,242,0,0,0,48,160,144,40,82,0,0,0,48,176,146,48,0,0,32,0,48,232,140, -208,242,0,0,0,48,232,146,16,82,0,0,255,0,232,140,1,78,173,89,1,32,165,140, -0,48,168,146,96,0,0,32,148,64,183,88,0,48,160,146,40,82,0,0,0,48,176,146, -4,0,0,32,152,0,0,8,0,48,160,144,40,244,0,0,0,48,176,144,236,242,0,0,20, -80,160,89,0,48,160,146,40,244,0,0,0,144,165,144,146,32,5,58,0,144,181,144, -0,48,168,144,40,82,0,0,0,48,160,144,220,242,0,0,0,48,176,146,48,0,0,32, -1,14,165,89,0,48,160,146,96,0,0,32,21,80,168,89,255,0,232,140,0,48,168, -146,40,82,0,0,149,64,175,88,0,48,128,140,208,242,0,0,0,48,168,146,4,0,0, -32,88,2,0,9,0,48,160,144,208,242,0,0,0,48,168,144,232,242,0,0,1,9,165,89, -0,48,160,146,208,242,0,0,148,93,189,140,0,208,165,144,0,16,161,146,4,16, -34,89,16,96,33,146,4,224,133,144,0,0,0,10,0,0,0,0,176,254,255,8,0,0,0,0, -0,48,160,144,16,82,0,0,16,22,40,92,16,32,36,144,22,32,5,58,20,22,128,92, -248,1,0,9,0,48,240,146,16,82,0,0,12,96,161,144,0,48,168,144,112,180,3,0, -20,1,161,89,14,64,165,52,1,30,128,92,0,0,0,10,0,48,160,144,0,243,0,0,146, -32,5,58,0,48,128,176,0,243,0,0,0,48,48,152,24,243,0,0,1,9,164,89,0,16,133, -140,0,48,160,146,0,243,0,0,148,160,4,90,148,157,185,140,250,0,0,19,0,208, -161,144,242,32,5,58,0,208,177,144,0,48,168,144,12,243,0,0,0,48,160,144, -40,82,0,0,0,48,176,146,48,0,0,32,0,48,232,140,0,243,0,0,0,48,232,146,16, -82,0,0,255,0,232,140,1,78,173,89,1,32,165,140,0,48,168,146,96,0,0,32,148, -64,183,88,0,48,160,146,40,82,0,0,0,48,176,146,4,0,0,32,152,0,0,8,0,48,160, -144,44,244,0,0,0,48,176,144,28,243,0,0,20,80,160,89,0,48,160,146,44,244, -0,0,0,144,165,144,146,32,5,58,0,144,181,144,0,48,168,144,40,82,0,0,0,48, -160,144,12,243,0,0,0,48,176,146,48,0,0,32,1,14,165,89,0,48,160,146,96,0, -0,32,21,80,168,89,255,0,232,140,0,48,168,146,40,82,0,0,149,64,175,88,0, -48,128,140,0,243,0,0,0,48,168,146,4,0,0,32,200,0,0,9,0,48,160,144,0,243, -0,0,0,48,168,144,24,243,0,0,1,9,165,89,0,48,160,146,0,243,0,0,148,93,189, -140,0,208,165,144,0,16,161,146,4,16,34,89,16,96,33,146,4,224,133,144,0, -0,0,10,0,0,0,0,176,254,255,8,0,0,0,0,16,22,32,92,0,48,128,144,16,82,0,0, -18,32,4,58,112,0,0,9,0,48,240,146,16,82,0,0,28,32,177,144,0,144,165,144, -86,32,5,58,0,16,161,152,78,64,165,57,0,144,181,144,12,32,169,144,0,48,160, -144,40,82,0,0,0,48,32,146,16,82,0,0,0,48,176,146,48,0,0,32,255,0,184,140, -1,78,173,89,1,32,165,140,0,48,168,146,96,0,0,32,148,192,181,88,0,48,160, -146,40,82,0,0,0,48,176,146,4,0,0,32,0,0,0,10,0,0,0,0,0,16,68,176,24,32, -164,144,16,22,40,92,136,29,37,140,32,19,0,9,255,0,136,140,132,208,163,88, -148,64,164,88,148,48,0,90,0,208,130,140,66,0,0,21,139,48,0,90,0,48,152, -140,0,0,0,48,162,0,0,22,0,208,164,176,0,16,161,178,0,208,164,176,4,9,132, -89,16,32,33,140,144,48,0,90,0,16,161,178,4,16,36,89,224,255,255,17,120, -0,0,8,0,0,0,0,0,48,160,140,0,0,0,48,0,16,165,152,4,201,130,89,144,48,0, -90,0,16,161,154,4,16,34,89,0,48,144,140,0,0,0,48,42,0,0,22,0,144,164,176, -0,16,161,178,0,144,164,176,4,9,132,89,16,32,33,140,144,48,0,90,0,16,161, -178,4,16,36,89,224,255,255,17,0,48,160,140,0,0,0,48,0,16,165,176,0,16,161, -178,0,48,160,140,0,0,0,48,0,16,165,152,4,16,36,89,0,16,161,154,5,16,175, -89,0,80,165,144,4,32,133,144,0,16,245,146,0,80,165,144,32,96,177,152,20, -16,162,89,10,192,165,54,22,22,160,92,0,80,165,146,0,48,128,146,56,0,0,32, -2,30,136,92,0,48,136,146,96,0,0,48,0,80,161,176,20,192,165,89,0,80,161, -146,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,64,96,8,140,0,116,192,178,240,255, -255,255,120,32,164,144,0,48,160,146,128,242,0,0,136,32,172,144,0,48,168, -146,176,242,0,0,152,32,180,144,0,48,176,146,224,242,0,0,16,22,104,92,168, -32,188,144,64,32,132,140,148,48,0,90,0,48,184,146,16,243,0,0,34,0,0,21, -30,96,5,61,26,160,5,61,22,224,5,61,8,30,128,92,0,116,192,176,240,255,255, -255,0,0,0,10,52,32,180,144,0,48,176,146,132,242,0,0,68,32,164,144,0,48, -160,146,180,242,0,0,84,32,164,144,0,48,160,146,228,242,0,0,0,48,160,144, -128,242,0,0,100,32,172,144,148,48,0,90,0,48,168,146,20,243,0,0,14,0,0,18, -63,0,24,140,174,223,176,62,0,48,160,144,176,242,0,0,22,32,5,58,0,48,160, -144,180,242,0,0,63,0,24,140,146,223,160,62,0,48,160,144,224,242,0,0,22, -32,5,58,0,48,160,144,228,242,0,0,63,0,24,140,118,223,160,62,0,48,160,144, -16,243,0,0,22,32,5,58,0,48,160,144,20,243,0,0,63,0,24,140,90,223,160,62, -0,48,160,144,128,242,0,0,38,32,5,58,0,48,160,144,176,242,0,0,26,32,5,58, -0,48,168,144,132,242,0,0,0,48,160,144,180,242,0,0,46,31,173,57,0,48,160, -144,224,242,0,0,38,32,5,58,0,48,160,144,16,243,0,0,26,32,5,58,0,48,168, -144,228,242,0,0,0,48,160,144,20,243,0,0,2,31,173,57,0,48,160,144,128,242, -0,0,46,32,5,61,0,48,160,144,180,242,0,0,0,48,24,140,48,104,0,0,0,48,24, -146,48,243,0,0,0,48,160,146,132,242,0,0,24,0,0,8,0,0,0,0,0,48,24,140,144, -102,0,0,0,48,24,146,48,243,0,0,0,48,160,144,224,242,0,0,42,32,5,61,0,48, -160,144,20,243,0,0,0,48,24,140,80,107,0,0,0,48,24,146,52,243,0,0,0,48,160, -146,228,242,0,0,20,0,0,8,0,48,24,140,192,105,0,0,0,48,24,146,52,243,0,0, -60,32,180,144,0,48,176,146,124,242,0,0,76,32,164,144,0,48,160,146,172,242, -0,0,92,32,164,144,0,48,160,146,220,242,0,0,0,48,160,144,128,242,0,0,108, -32,172,144,148,48,0,90,0,48,168,146,12,243,0,0,10,0,0,18,58,190,5,59,0, -48,160,144,124,242,0,0,31,216,31,89,42,222,160,49,0,48,160,128,124,242, -0,0,255,0,24,140,148,208,160,88,148,192,160,88,18,62,5,61,0,48,160,144, -176,242,0,0,18,32,5,58,0,48,160,144,172,242,0,0,250,61,5,59,0,48,160,144, -172,242,0,0,31,216,31,89,234,221,160,49,0,48,160,128,172,242,0,0,255,0, -24,140,148,208,160,88,148,192,160,88,210,61,5,61,0,48,160,144,224,242,0, -0,18,32,5,58,0,48,160,144,220,242,0,0,186,61,5,59,0,48,160,144,220,242, -0,0,31,216,31,89,170,221,160,49,0,48,160,128,220,242,0,0,255,0,24,140,148, -208,160,88,148,192,160,88,146,61,5,61,0,48,160,144,16,243,0,0,18,32,5,58, -0,48,160,144,12,243,0,0,122,61,5,59,0,48,160,144,12,243,0,0,31,216,31,89, -106,221,160,49,0,48,160,128,12,243,0,0,255,0,24,140,148,208,160,88,148, -192,160,88,82,61,5,61,0,48,168,144,128,242,0,0,18,96,5,58,0,48,160,144, -124,242,0,0,58,29,173,60,0,48,168,144,176,242,0,0,18,96,5,58,0,48,160,144, -172,242,0,0,34,29,173,60,0,48,168,144,224,242,0,0,18,96,5,58,0,48,160,144, -220,242,0,0,10,29,173,60,0,48,168,144,16,243,0,0,18,96,5,58,0,48,160,144, -12,243,0,0,242,28,173,60,0,48,176,144,176,242,0,0,0,48,32,176,160,242,0, -0,0,48,96,144,128,242,0,0,0,48,128,176,112,242,0,0,0,48,232,144,16,243, -0,0,0,48,192,176,0,243,0,0,0,48,184,144,224,242,0,0,0,48,64,176,208,242, -0,0,19,1,163,89,1,13,171,89,0,16,141,140,21,22,144,92,0,48,128,146,112, -242,0,0,0,48,168,146,120,242,0,0,0,48,160,146,116,242,0,0,7,129,165,89, -0,48,152,146,124,242,0,0,1,141,181,89,0,16,45,140,22,22,48,92,0,48,32,146, -160,242,0,0,0,48,160,146,164,242,0,0,11,193,165,89,0,48,176,146,168,242, -0,0,1,205,189,89,0,16,77,140,23,22,80,92,0,48,64,146,208,242,0,0,0,48,184, -146,216,242,0,0,0,48,160,146,212,242,0,0,27,65,167,89,0,48,88,146,220,242, -0,0,1,77,239,89,0,16,205,140,29,22,208,92,0,48,192,146,0,243,0,0,0,48,56, -146,172,242,0,0,0,30,32,92,0,48,160,146,4,243,0,0,0,48,232,146,8,243,0, -0,0,48,216,146,12,243,0,0,98,32,3,58,112,96,139,144,0,48,112,140,112,242, -0,0,0,48,120,140,88,242,0,0,0,48,112,154,80,242,0,0,0,48,128,140,112,242, -0,0,8,37,0,9,1,30,32,92,184,59,68,58,0,48,160,144,140,242,0,0,12,96,163, -146,0,48,128,144,128,242,0,0,144,57,128,140,0,0,0,0,48,67,0,9,0,48,128, -146,136,242,0,0,140,59,4,58,0,48,160,144,176,242,0,0,126,32,5,58,0,48,24, -140,160,242,0,0,132,57,160,140,0,0,0,0,96,224,31,146,0,52,173,140,80,242, -0,0,0,52,165,140,88,242,0,0,128,96,139,144,100,224,167,146,96,224,31,144, -4,96,165,146,0,48,128,140,160,242,0,0,0,80,29,146,132,36,0,9,4,80,32,89, -52,59,68,58,0,48,160,144,188,242,0,0,16,96,163,146,0,48,128,144,176,242, -0,0,144,57,128,140,0,0,0,0,172,66,0,9,0,48,128,146,184,242,0,0,8,59,4,58, -0,48,160,144,224,242,0,0,126,32,5,58,0,48,24,140,208,242,0,0,132,57,160, -140,0,0,0,0,80,224,31,146,0,52,173,140,80,242,0,0,0,52,165,140,88,242,0, -0,144,96,139,144,84,224,167,146,80,224,31,144,4,96,165,146,0,48,128,140, -208,242,0,0,0,80,29,146,0,36,0,9,4,80,32,89,176,58,68,58,0,48,160,144,236, -242,0,0,20,96,163,146,0,48,128,144,224,242,0,0,144,57,128,140,0,0,0,0,40, -66,0,9,0,48,128,146,232,242,0,0,132,58,4,58,0,48,160,144,16,243,0,0,126, -32,5,58,0,48,24,140,0,243,0,0,132,57,160,140,0,0,0,0,64,224,31,146,0,52, -173,140,80,242,0,0,0,52,165,140,88,242,0,0,160,96,139,144,68,224,167,146, -64,224,31,144,4,96,165,146,0,48,128,140,0,243,0,0,0,80,29,146,124,35,0, -9,4,80,32,89,44,58,68,58,0,48,160,144,28,243,0,0,24,96,163,146,0,48,128, -144,16,243,0,0,144,57,128,140,0,0,0,0,164,65,0,9,0,48,128,146,24,243,0, -0,0,58,4,58,0,48,24,140,80,242,0,0,2,30,128,92,132,57,24,146,76,242,0,0, -0,116,192,176,240,255,255,255,0,0,0,10,0,0,0,0,0,48,128,146,76,243,0,0, -16,22,32,92,144,64,132,112,0,80,44,140,92,65,0,9,0,48,128,146,64,243,0, -0,18,32,4,61,8,30,128,92,0,0,0,10,0,0,0,0,4,57,128,140,0,0,0,0,56,65,0, -9,0,48,128,146,68,243,0,0,14,32,4,61,8,30,128,92,0,0,0,10,0,48,160,144, -64,243,0,0,132,48,0,90,0,48,168,144,68,243,0,0,0,30,176,92,82,0,0,22,0, -47,1,90,0,80,189,140,0,32,165,140,28,0,0,16,1,30,176,92,0,80,165,146,150, -32,1,90,20,64,161,89,4,96,189,140,42,0,0,19,23,22,168,92,0,80,165,146,20, -64,161,89,2,160,181,140,4,96,165,146,150,32,1,90,20,64,161,89,8,96,173, -140,228,255,255,20,4,57,128,140,0,0,0,0,176,64,0,9,0,48,128,146,72,243, -0,0,14,32,4,61,8,30,128,92,0,0,0,10,132,48,0,90,0,48,160,144,72,243,0,0, -0,30,176,92,66,0,0,22,0,47,1,90,0,16,173,140,24,0,0,16,1,30,176,92,150, -32,1,90,0,16,245,146,20,16,169,89,34,0,0,19,21,22,160,92,0,16,245,146,22, -144,176,89,4,32,245,146,150,32,1,90,8,32,165,140,236,255,255,20,2,30,128, -92,0,0,0,10,0,48,184,144,24,82,0,0,0,48,160,144,68,243,0,0,23,29,173,140, -0,80,181,144,16,22,32,93,62,160,5,58,0,48,160,144,76,243,0,0,0,144,141, -146,0,80,245,146,22,16,170,89,16,32,172,146,23,80,168,89,12,32,180,146, -1,9,165,89,148,64,165,88,1,0,128,140,0,48,160,146,24,82,0,0,0,0,0,10,0, -48,160,144,20,82,0,0,98,32,5,59,188,1,0,9,0,48,168,144,24,82,0,0,0,48,160, -144,68,243,0,0,21,29,189,140,0,208,181,144,66,160,5,58,0,48,160,144,76, -243,0,0,0,208,245,146,21,80,168,89,1,9,165,89,148,64,165,88,0,48,160,146, -24,82,0,0,0,144,45,146,22,16,162,89,16,32,161,146,1,30,128,92,12,32,177, -146,0,0,0,10,0,0,0,0,0,48,160,144,48,244,0,0,20,80,160,89,0,0,128,140,0, -48,160,146,48,244,0,0,0,0,0,10,0,0,0,0,0,48,136,144,112,180,3,0,16,22,32, -92,116,57,0,9,0,48,160,144,96,180,3,0,0,48,184,144,28,82,0,0,20,58,160, -140,16,0,0,0,0,16,161,146,0,48,168,144,68,243,0,0,0,48,160,144,76,243,0, -0,23,80,176,89,23,93,37,146,1,9,165,89,148,128,165,88,0,48,160,146,28,82, -0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,48,240,140,216,119,0,0,30,22,136,92,0,0, -240,140,0,48,184,144,32,82,0,0,0,48,128,144,72,243,0,0,0,48,160,144,76, -243,0,0,0,48,168,144,20,82,0,0,23,80,176,89,1,9,165,89,148,128,165,88,23, -29,132,144,1,73,173,89,0,48,160,146,32,82,0,0,0,48,168,146,20,82,0,0,0, -80,4,132,0,0,0,10,0,0,0,0,0,48,240,140,80,120,0,0,30,22,144,92,0,0,240, -140,0,48,160,144,48,244,0,0,0,48,184,144,36,82,0,0,0,48,136,144,72,243, -0,0,0,48,168,144,76,243,0,0,0,48,176,144,20,82,0,0,20,80,160,89,0,48,160, -146,48,244,0,0,23,80,160,89,1,73,173,89,149,0,173,88,23,93,132,146,22,80, -176,89,0,48,168,146,36,82,0,0,0,48,176,146,20,82,0,0,0,144,4,132,0,0,0, -0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,255,0,48,140,0,48,56,140,255,255,0,0, -0,48,160,144,140,180,3,0,0,16,165,144,74,33,5,58,0,48,168,144,32,82,0,0, -0,48,184,144,72,243,0,0,0,48,160,144,76,243,0,0,0,48,176,144,20,82,0,0, -21,221,37,144,1,137,181,89,0,48,176,146,20,82,0,0,21,80,168,89,1,9,165, -89,148,64,165,88,0,48,160,146,32,82,0,0,4,16,161,89,0,16,181,144,0,48,168, -144,140,180,3,0,150,192,129,88,0,16,133,146,0,80,141,144,4,22,144,92,144, -141,45,89,144,56,128,140,9,0,0,0,3,12,132,89,192,4,0,9,0,48,168,144,140, -180,3,0,0,48,160,144,144,180,3,0,4,96,181,144,0,80,245,146,21,16,170,89, -14,0,173,54,0,48,168,144,148,180,3,0,0,48,168,146,140,180,3,0,0,48,168, -144,40,82,0,0,0,48,136,144,112,180,3,0,0,48,176,146,56,0,0,32,129,73,161, -88,0,48,160,146,96,0,0,48,21,80,168,89,0,48,168,146,40,82,0,0,149,128,169, -88,136,73,173,88,0,16,129,140,0,48,168,146,4,0,0,32,56,55,0,9,0,48,160, -144,96,180,3,0,0,48,128,144,68,243,0,0,20,58,160,140,16,0,0,0,0,16,161, -146,0,48,176,144,28,82,0,0,0,48,160,144,76,243,0,0,0,48,184,144,20,82,0, -0,22,80,168,89,1,9,165,89,148,64,165,88,22,29,36,146,0,48,160,146,28,82, -0,0,180,254,5,60,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,16,36,176, -18,22,232,92,0,208,68,140,30,32,33,58,18,32,33,60,214,32,1,58,4,1,0,8,0, -0,0,0,106,32,41,58,248,0,0,8,50,224,20,61,0,48,160,144,196,243,0,0,0,48, -168,144,216,243,0,0,17,0,141,89,1,96,173,140,0,48,136,146,196,243,0,0,0, -48,168,146,216,243,0,0,200,0,0,8,0,48,160,144,208,243,0,0,0,48,168,144, -224,243,0,0,17,0,141,89,1,96,173,140,0,48,136,146,208,243,0,0,0,48,168, -146,224,243,0,0,156,0,0,8,0,0,0,0,50,224,20,61,0,48,160,144,244,243,0,0, -0,48,168,144,4,244,0,0,17,0,141,89,1,96,173,140,0,48,136,146,244,243,0, -0,0,48,168,146,4,244,0,0,104,0,0,8,0,48,160,144,248,243,0,0,0,48,168,144, -16,244,0,0,17,0,141,89,1,96,173,140,0,48,136,146,248,243,0,0,0,48,168,146, -16,244,0,0,60,0,0,8,0,0,0,0,34,224,20,61,0,48,160,144,180,243,0,0,17,0, -141,89,0,48,136,146,180,243,0,0,28,0,0,8,0,0,0,0,0,48,160,144,184,243,0, -0,17,0,141,89,0,48,136,146,184,243,0,0,16,32,164,144,7,1,165,89,8,9,165, -89,3,12,165,89,4,224,161,146,40,32,180,152,7,16,162,89,18,128,149,62,7, -16,164,89,22,129,236,89,12,224,177,146,26,192,237,60,23,65,239,89,4,32, -189,146,157,224,5,90,8,32,165,140,240,255,255,19,10,96,7,59,4,32,237,146, -0,48,160,144,20,82,0,0,10,32,5,59,28,253,255,9,0,48,136,144,140,180,3,0, -0,80,164,144,118,32,5,61,4,224,169,144,0,48,184,144,36,82,0,0,0,48,176, -144,72,243,0,0,16,14,162,89,148,67,165,88,4,224,161,146,23,157,61,146,0, -48,168,144,48,244,0,0,0,48,160,144,76,243,0,0,0,48,176,144,20,82,0,0,23, -80,184,89,1,96,173,140,1,9,165,89,148,192,165,88,0,48,168,146,48,244,0, -0,22,80,176,89,0,48,160,146,36,82,0,0,0,48,176,146,20,82,0,0,0,0,0,10,0, -0,0,0,4,224,129,144,0,80,140,144,7,22,144,92,144,56,128,140,9,0,0,0,131, -13,132,89,208,1,0,9,0,48,168,144,140,180,3,0,0,48,160,144,144,180,3,0,4, -96,181,144,0,80,245,146,21,16,170,89,14,0,173,54,0,48,168,144,148,180,3, -0,0,48,160,144,40,82,0,0,0,48,136,144,112,180,3,0,0,48,176,146,56,0,0,32, -0,48,168,146,140,180,3,0,129,9,170,88,0,48,168,146,96,0,0,48,20,80,160, -89,255,0,72,140,0,48,160,146,40,82,0,0,148,64,162,88,136,9,165,88,0,208, -129,140,0,48,160,146,4,0,0,32,68,52,0,9,0,48,160,144,96,180,3,0,0,48,184, -144,28,82,0,0,20,58,160,140,16,0,0,0,0,208,161,146,0,48,168,144,68,243, -0,0,0,48,160,144,76,243,0,0,23,80,176,89,23,93,61,146,1,9,165,89,148,128, -165,88,0,48,160,146,28,82,0,0,0,0,0,10,144,68,148,101,0,0,0,10,5,56,0,102, -0,0,0,10,33,22,128,92,0,0,0,10,16,54,8,92,16,22,128,92,16,22,128,92,16, -22,128,92,16,22,128,92,16,22,128,92,16,22,128,92,16,22,128,92,16,22,128, -92,0,0,0,10,16,54,0,92,0,0,0,10,32,22,128,92,0,0,0,10,0,48,32,140,0,0,31, -0,16,14,44,89,132,2,41,101,5,22,128,92,0,0,0,10,144,18,128,101,0,0,0,10, -0,48,32,140,255,255,255,255,16,64,36,97,4,22,128,92,0,0,0,10,16,64,148, -97,18,22,128,92,0,0,0,10,16,65,36,97,4,22,128,92,0,0,0,10,0,0,0,0,0,0,0, -0,0,0,0,0,0,48,136,146,48,0,0,32,144,57,160,140,0,0,0,0,0,30,136,92,144, -48,0,90,0,48,160,146,96,0,0,32,0,48,152,140,0,0,0,48,54,0,0,22,0,48,160, -144,8,0,0,16,248,63,61,51,0,208,164,176,0,144,164,178,0,208,164,176,17, -80,136,89,16,160,148,140,145,32,4,90,0,144,164,178,18,16,148,89,212,255, -255,20,0,0,0,10,18,22,184,92,144,57,160,140,0,0,0,0,0,48,136,146,84,0,0, -32,144,48,0,90,0,48,160,146,96,0,0,32,0,30,136,92,146,0,0,22,56,32,4,48, -0,144,36,176,0,48,160,140,96,0,0,48,1,30,136,92,0,16,37,178,18,16,188,89, -0,48,168,140,96,0,0,48,0,208,37,176,23,16,188,89,145,32,4,90,0,80,37,178, -90,0,0,19,0,48,176,140,96,0,0,48,0,48,168,140,96,0,0,48,0,48,152,140,96, -0,0,48,0,208,37,176,0,208,36,178,23,16,164,89,0,16,37,176,0,208,36,178, -32,224,165,140,0,16,37,176,0,144,37,178,48,224,165,140,0,16,37,176,17,144, -136,89,64,224,189,140,145,32,4,90,0,80,37,178,200,255,255,20,0,0,0,10,0, -0,0,0,0,0,0,0,0,48,240,140,144,127,0,0,30,22,184,92,0,0,240,140,16,22,176, -92,0,48,136,146,84,0,0,32,144,176,0,90,0,48,128,146,96,0,0,32,18,22,168, -92,42,0,0,18,18,32,20,60,50,32,12,58,64,0,0,8,0,0,0,0,56,32,28,61,0,144, -164,144,18,16,169,89,0,48,160,146,96,0,0,32,0,80,165,144,21,16,169,89,0, -48,160,146,96,0,0,32,0,80,165,144,0,48,160,146,96,0,0,32,0,208,5,132,0, -0,0,0,146,208,163,88,50,32,69,58,18,32,69,52,22,32,37,58,76,0,0,8,0,0,0, -0,50,32,101,58,64,0,0,8,0,144,164,144,18,16,169,89,1,9,180,89,0,48,160, -146,96,0,0,32,0,80,165,144,21,16,169,89,1,137,181,89,0,48,160,146,96,0, -0,32,0,80,165,144,21,16,169,89,1,137,181,89,0,48,160,146,96,0,0,32,150, -240,0,90,0,48,160,140,96,0,0,32,30,0,0,22,0,80,133,176,4,137,181,89,16, -96,173,140,150,240,0,90,0,16,133,178,236,255,255,17,34,160,5,59,0,80,165, -144,1,137,181,89,4,96,173,140,150,48,0,90,0,48,160,146,96,0,0,32,232,255, -255,17,0,208,5,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,255,0,176,140,144,128, -133,88,0,0,168,140,0,48,128,146,4,0,0,32,0,48,160,144,4,0,0,16,255,0,176, -140,148,128,165,88,188,0,164,58,0,48,160,144,4,0,0,16,148,128,165,88,172, -0,164,58,0,48,160,144,4,0,0,16,148,128,165,88,156,0,164,58,0,48,160,144, -4,0,0,16,148,128,165,88,140,0,164,58,0,48,160,144,4,0,0,16,148,128,165, -88,124,0,164,58,0,48,160,144,4,0,0,16,148,128,165,88,108,0,164,58,0,48, -160,144,4,0,0,16,148,128,165,88,92,0,164,58,0,48,160,144,4,0,0,16,148,128, -165,88,76,0,164,58,0,48,160,144,4,0,0,16,148,128,165,88,60,0,164,58,0,48, -160,144,4,0,0,16,148,128,165,88,44,0,164,58,21,144,170,89,0,48,176,140, -255,179,196,4,82,159,173,62,0,48,160,144,64,244,0,0,0,48,176,140,6,0,173, -222,0,16,181,146,148,62,0,8,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,30,176,92, -0,48,168,128,40,82,0,0,0,48,160,144,4,0,0,16,255,0,184,140,148,192,165, -88,188,64,165,58,0,48,160,144,4,0,0,16,148,192,165,88,172,64,165,58,0,48, -160,144,4,0,0,16,148,192,165,88,156,64,165,58,0,48,160,144,4,0,0,16,148, -192,165,88,140,64,165,58,0,48,160,144,4,0,0,16,148,192,165,88,124,64,165, -58,0,48,160,144,4,0,0,16,148,192,165,88,108,64,165,58,0,48,160,144,4,0, -0,16,148,192,165,88,92,64,165,58,0,48,160,144,4,0,0,16,148,192,165,88,76, -64,165,58,0,48,160,144,4,0,0,16,148,192,165,88,60,64,165,58,0,48,160,144, -4,0,0,16,148,192,165,88,44,64,165,58,22,144,178,89,0,48,184,140,255,179, -196,4,82,223,181,62,0,48,160,144,64,244,0,0,0,48,184,140,7,0,173,222,0, -16,189,146,172,61,0,8,0,0,0,10,0,0,0,0,0,48,240,140,176,129,0,0,30,22,128, -92,0,0,240,140,0,48,168,144,40,82,0,0,255,0,176,140,21,80,168,89,149,128, -165,88,136,9,165,88,0,48,168,146,40,82,0,0,0,48,160,146,4,0,0,32,0,16,4, -132,0,0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,22,40,92,1,9,52,89,0,0, -32,140,0,48,56,140,16,39,0,0,28,251,255,9,5,1,132,88,12,251,255,9,4,22, -160,92,148,224,1,90,1,32,33,140,10,0,0,22,32,61,0,9,252,250,255,9,144,64, -129,88,216,63,4,61,1,30,128,92,0,0,0,10,0,0,0,0,0,0,0,0,64,96,8,140,0,116, -128,178,192,255,255,255,0,116,160,178,208,255,255,255,0,116,192,178,224, -255,255,255,0,116,224,178,240,255,255,255,0,48,160,144,52,82,0,0,34,32, -5,61,0,48,160,144,64,244,0,0,0,48,176,140,1,0,173,222,0,16,181,146,188, -60,0,9,232,60,0,9,0,48,160,144,0,0,0,16,210,0,176,140,148,128,165,88,40, -0,176,140,0,48,40,140,16,39,0,0,148,131,165,88,0,0,32,140,0,48,160,146, -0,0,0,16,104,250,255,9,0,14,132,88,88,250,255,9,4,22,160,92,148,96,1,90, -1,32,33,140,10,0,0,22,108,60,0,9,72,250,255,9,220,63,4,55,0,48,160,144, -60,82,0,0,0,48,168,144,64,82,0,0,20,80,160,89,0,48,160,146,60,82,0,0,54, -96,5,58,0,48,168,144,40,82,0,0,255,0,176,140,21,80,168,89,149,128,165,88, -136,9,165,88,0,48,168,146,40,82,0,0,0,48,160,146,4,0,0,32,16,0,0,8,0,0, -0,0,0,48,240,146,52,82,0,0,0,116,128,176,192,255,255,255,0,116,160,176, -208,255,255,255,0,116,192,176,224,255,255,255,0,116,224,176,240,255,255, -255,3,54,8,92,0,0,0,10,64,96,8,140,0,116,128,178,192,255,255,255,0,116, -160,178,208,255,255,255,0,116,192,178,224,255,255,255,0,116,224,178,240, -255,255,255,0,48,160,128,68,20,0,80,22,32,37,48,0,48,160,144,68,20,0,80, -10,32,133,48,180,3,0,9,0,48,160,128,68,20,0,80,22,32,45,48,0,48,160,144, -68,20,0,80,10,32,141,48,184,3,0,9,0,48,160,128,68,20,0,80,22,32,53,48,0, -48,160,144,68,20,0,80,10,32,149,48,188,3,0,9,0,48,160,128,68,12,0,80,14, -32,21,48,10,32,29,48,200,3,0,9,0,30,32,92,0,48,40,140,16,39,0,0,40,249, -255,9,4,14,132,88,24,249,255,9,4,22,160,92,148,96,1,90,1,32,33,140,10,0, -0,22,44,59,0,9,8,249,255,9,220,63,36,55,0,116,128,176,192,255,255,255,0, -116,160,176,208,255,255,255,0,116,192,176,224,255,255,255,0,116,224,176, -240,255,255,255,3,54,8,92,0,0,0,10,0,0,0,0,0,0,0,0,64,96,8,140,0,116,128, -178,192,255,255,255,0,116,160,178,208,255,255,255,0,116,192,178,224,255, -255,255,0,116,224,178,240,255,255,255,0,48,160,144,76,82,0,0,34,32,5,61, -0,48,160,144,64,244,0,0,0,48,168,140,2,0,173,222,0,16,173,146,172,58,0, -9,216,58,0,9,68,4,0,9,0,30,32,92,0,48,40,140,16,39,0,0,116,248,255,9,5, -14,132,88,100,248,255,9,4,22,160,92,148,96,1,90,1,32,33,140,10,0,0,22,120, -58,0,9,84,248,255,9,220,63,44,55,0,116,128,176,192,255,255,255,0,116,160, -176,208,255,255,255,0,116,192,176,224,255,255,255,0,116,224,176,240,255, -255,255,3,54,8,92,0,0,0,10,0,0,0,0,64,96,8,140,0,116,128,178,192,255,255, -255,0,116,160,178,208,255,255,255,0,116,192,178,224,255,255,255,0,116,224, -178,240,255,255,255,0,48,160,144,48,82,0,0,34,32,5,61,0,48,160,144,64,244, -0,0,0,48,168,140,3,0,173,222,0,16,173,146,252,57,0,9,40,58,0,9,0,48,160, -144,0,0,0,16,210,0,168,140,0,48,40,140,16,39,0,0,148,64,165,88,128,9,165, -88,0,0,32,140,0,48,160,146,0,0,0,16,172,247,255,9,2,14,132,88,156,247,255, -9,4,22,160,92,148,96,1,90,1,32,33,140,10,0,0,22,176,57,0,9,140,247,255, -9,220,63,20,55,0,116,128,176,192,255,255,255,0,116,160,176,208,255,255, -255,0,116,192,176,224,255,255,255,0,116,224,176,240,255,255,255,3,54,8, -92,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,64,96,8,140,0,116,128,178,192,255,255, -255,0,116,160,178,208,255,255,255,0,116,192,178,224,255,255,255,0,116,224, -178,240,255,255,255,0,48,160,144,44,82,0,0,34,32,5,61,0,48,160,144,64,244, -0,0,0,48,168,140,4,0,173,222,0,16,173,146,44,57,0,9,88,57,0,9,0,116,128, -176,192,255,255,255,0,116,160,176,208,255,255,255,0,116,192,176,224,255, -255,255,0,116,224,176,240,255,255,255,3,54,8,92,0,0,0,10,0,0,0,0,0,0,0, -0,0,0,0,0,144,246,255,9,4,32,44,144,16,32,36,144,0,30,128,92,144,246,255, -9,0,30,128,92,0,48,64,140,1,50,0,0,168,246,255,9,4,30,72,92,0,48,88,140, -32,88,0,0,28,96,89,146,16,96,65,154,0,48,160,140,16,130,0,0,1,4,128,140, -76,32,161,146,0,48,160,140,208,132,0,0,0,30,136,92,140,32,161,146,0,48, -160,140,160,133,0,0,0,30,144,92,204,32,161,146,0,48,160,140,48,131,0,0, -12,33,161,146,20,246,255,9,0,30,128,92,76,246,255,9,255,15,128,140,28,246, -255,9,1,30,128,92,76,246,255,8,0,246,255,9,4,32,36,144,16,32,44,144,0,30, -128,92,0,246,255,9,0,30,128,92,32,246,255,9,84,0,160,140,1,4,128,140,20, -32,161,146,0,48,160,140,0,88,0,0,0,30,136,92,28,32,161,146,0,48,160,140, -48,131,0,0,0,30,144,92,12,97,161,146,0,48,160,140,32,132,0,0,76,97,161, -146,164,245,255,9,0,30,128,92,220,245,255,9,255,15,128,140,172,245,255, -9,1,30,128,92,220,245,255,8,0,48,160,144,64,244,0,0,0,48,168,140,16,0,173, -222,0,16,173,146,220,55,0,9,1,30,128,92,4,56,0,8,0,48,160,144,64,244,0, -0,0,48,168,140,17,0,173,222,0,16,173,146,188,55,0,9,1,30,128,92,228,55, -0,8,0,48,160,144,64,244,0,0,0,48,168,140,18,0,173,222,0,16,173,146,156, -55,0,9,1,30,128,92,196,55,0,8,0,48,160,144,64,244,0,0,0,48,168,140,19,0, -173,222,0,16,173,146,124,55,0,9,1,30,128,92,164,55,0,8,0,48,240,140,200, -135,0,0,30,22,136,92,0,0,240,140,255,0,160,140,144,0,133,88,0,48,128,146, -8,28,0,80,0,80,4,132,0,0,0,0,0,0,0,10,0,0,0,0,136,25,176,88,144,160,5,90, -0,0,160,140,0,30,168,92,58,0,0,18,14,128,133,49,26,32,4,58,84,0,0,8,137, -25,176,88,62,128,133,58,72,0,0,8,0,0,0,0,0,48,160,140,130,184,97,202,0, -48,168,140,118,116,210,62,48,0,0,8,0,0,0,0,0,48,160,140,222,153,139,252, -0,48,168,140,59,93,202,62,24,0,0,8,0,0,0,0,0,48,160,140,216,182,122,157, -0,48,168,140,98,194,199,62,20,22,128,93,0,0,144,140,0,48,152,140,132,215, -119,65,80,103,0,9,220,88,0,9,255,0,176,140,144,128,133,88,0,48,128,146, -8,28,0,80,0,0,0,10,0,0,0,0,0,48,240,140,160,136,0,0,30,22,128,92,0,0,240, -140,0,48,160,144,4,28,0,80,0,48,240,146,76,82,0,0,1,14,165,88,0,48,160, -146,4,28,0,80,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,160,144, -76,82,0,0,10,32,5,61,132,54,0,9,0,48,168,144,4,28,0,80,137,73,165,88,0, -48,160,146,4,28,0,80,0,48,160,136,4,28,0,80,22,32,85,48,9,222,176,89,149, -131,165,88,0,48,160,146,4,28,0,80,0,48,160,144,68,82,0,0,20,80,160,89,0, -48,160,146,68,82,0,0,0,0,0,10,0,0,0,0,0,0,0,0,30,22,32,92,0,48,128,144, -84,82,0,0,6,222,136,89,0,54,0,9,0,48,168,144,0,0,0,16,210,0,184,140,149, -192,165,88,128,9,173,88,0,48,168,146,0,0,0,16,0,48,160,144,84,82,0,0,20, -16,175,89,0,48,168,146,68,244,0,0,0,48,160,144,84,82,0,0,32,32,173,140, -0,48,168,146,72,244,0,0,0,48,160,144,84,82,0,0,48,32,173,140,0,48,168,146, -64,244,0,0,0,48,160,144,84,82,0,0,44,32,173,140,0,48,168,146,76,244,0,0, -2,30,160,92,0,48,160,146,80,244,0,0,0,48,160,144,84,82,0,0,0,48,168,140, -0,184,2,0,40,32,173,146,0,48,160,144,84,82,0,0,0,48,168,140,96,244,0,0, -36,32,173,146,0,48,160,144,84,82,0,0,0,48,168,140,1,0,3,0,52,32,173,146, -0,48,160,144,84,82,0,0,0,48,168,144,88,82,0,0,16,96,181,144,16,142,173, -89,56,32,173,146,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,0,48,160, -144,88,82,0,0,0,48,168,140,237,254,17,206,8,32,173,146,0,48,160,144,64, -244,0,0,0,16,173,144,1,73,181,89,0,16,181,146,0,48,160,144,84,82,0,0,64, -32,173,144,127,0,184,140,149,192,165,88,148,48,0,90,186,0,0,18,148,112, -0,90,10,0,0,18,180,0,0,8,0,48,128,144,84,82,0,0,0,10,0,9,64,224,135,146, -0,48,160,144,84,82,0,0,64,224,175,144,129,73,181,88,68,32,181,146,0,48, -160,144,84,82,0,0,64,32,173,144,21,22,160,92,0,48,184,140,128,255,255,255, -148,192,173,88,255,0,184,140,149,192,165,88,148,48,0,90,50,0,0,18,0,48, -160,144,40,82,0,0,20,80,168,89,0,48,168,146,40,82,0,0,0,48,168,144,40,82, -0,0,149,192,165,88,136,9,173,88,0,48,168,146,4,0,0,32,0,48,160,144,84,82, -0,0,0,30,168,92,64,32,173,146,64,224,167,144,148,176,0,90,14,0,0,21,0,0, -0,10,0,0,0,0,16,0,0,8,0,0,0,0,8,0,0,8,0,0,0,0,20,255,255,8,0,0,0,0,0,0, -0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,160,92,0,48,168,144,68,12, -0,80,128,73,181,88,0,48,176,146,68,12,0,80,0,48,168,144,68,12,0,80,0,78, -181,88,0,48,176,146,68,12,0,80,0,48,168,144,68,12,0,80,2,78,181,88,0,48, -176,146,68,12,0,80,0,30,168,92,0,48,168,146,72,16,0,80,1,30,168,92,0,48, -168,146,68,16,0,80,0,30,168,92,64,224,175,146,64,224,175,144,21,240,0,90, -78,0,0,17,64,224,175,144,21,57,176,140,0,0,0,0,0,160,173,140,15,30,176, -92,0,116,181,146,16,16,0,80,64,224,175,144,21,57,176,140,0,0,0,0,0,160, -173,140,0,30,176,92,0,116,181,146,0,16,0,80,64,224,175,144,21,80,176,89, -64,224,183,146,176,255,255,8,0,48,168,144,4,28,0,80,2,78,181,88,0,48,176, -146,4,28,0,80,0,48,168,144,68,20,0,80,1,78,181,88,0,48,176,146,68,20,0, -80,244,1,168,140,0,48,168,146,48,20,0,80,0,48,168,144,68,20,0,80,135,73, -181,88,0,48,176,146,68,20,0,80,0,48,168,144,68,20,0,80,134,73,181,88,0, -48,176,146,68,20,0,80,0,48,168,144,68,20,0,80,4,78,181,88,0,48,176,146, -68,20,0,80,0,48,168,144,68,20,0,80,5,78,181,88,0,48,176,146,68,20,0,80, -0,0,0,10,16,72,8,89,30,22,32,92,0,0,160,140,0,48,160,146,0,0,0,16,0,48, -168,144,0,0,0,16,210,0,184,140,149,192,165,88,129,9,173,88,0,48,168,146, -0,0,0,16,0,48,160,144,0,0,0,16,208,0,184,140,148,192,173,88,0,48,168,146, -0,0,0,16,0,48,168,144,0,0,0,16,210,0,184,140,149,192,165,88,128,9,173,88, -0,48,168,146,0,0,0,16,0,48,168,144,0,0,0,16,149,192,165,88,40,0,184,140, -148,195,173,88,0,48,168,146,0,0,0,16,10,30,128,92,4,50,0,11,0,48,160,144, -4,28,0,80,131,9,173,88,0,48,168,146,4,28,0,80,31,216,132,89,232,49,0,11, -0,48,168,144,4,28,0,80,11,222,184,89,149,195,165,88,0,48,184,140,56,24, -0,0,148,224,5,90,14,0,0,18,1,30,128,92,24,50,0,9,0,48,160,144,68,12,0,80, -148,48,0,90,14,0,0,18,1,30,128,92,0,50,0,9,0,48,168,144,68,20,0,80,8,222, -184,89,149,195,165,88,148,224,5,90,14,0,0,18,1,30,128,92,224,49,0,9,0,48, -160,144,68,12,0,80,129,9,173,88,0,48,168,146,68,12,0,80,0,48,160,144,68, -12,0,80,128,9,173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,20,0,80,130, -9,173,88,0,48,168,146,68,20,0,80,0,48,160,144,68,20,0,80,128,9,173,88,0, -48,168,146,68,20,0,80,0,48,160,144,68,20,0,80,10,14,173,88,0,48,168,146, -68,20,0,80,0,48,160,144,4,28,0,80,133,9,173,88,0,48,168,146,4,28,0,80,0, -48,160,144,4,28,0,80,132,9,173,88,0,48,168,146,4,28,0,80,0,48,160,144,4, -28,0,80,3,14,173,88,0,48,168,146,4,28,0,80,10,30,128,92,224,48,0,11,0,30, -160,92,64,224,167,146,64,224,167,144,20,240,0,90,110,0,0,17,64,224,167, -144,20,57,168,140,0,0,0,0,0,96,165,140,64,224,175,144,10,78,181,89,0,48, -168,144,80,82,0,0,21,128,181,89,0,52,181,146,0,12,0,144,64,224,167,144, -20,57,168,140,0,0,0,0,0,96,165,140,64,224,175,144,10,78,181,89,0,48,168, -144,80,82,0,0,21,128,181,89,0,52,181,146,16,12,0,144,64,224,167,144,20, -80,168,89,64,224,175,146,144,255,255,8,0,48,160,144,80,244,0,0,148,112, -0,90,110,0,0,21,0,48,160,144,80,82,0,0,0,52,173,140,0,32,0,0,0,48,168,146, -0,20,0,144,0,48,160,144,80,82,0,0,0,52,173,140,0,32,0,0,0,48,168,146,16, -20,0,144,0,48,160,144,80,82,0,0,0,52,173,140,0,16,0,0,0,48,168,146,0,24, -0,144,0,48,160,144,80,82,0,0,0,52,173,140,0,16,0,0,0,48,168,146,16,24,0, -144,24,1,0,8,0,0,0,0,0,30,160,92,64,224,167,146,64,224,167,144,20,240,0, -90,2,1,0,17,64,224,167,144,20,57,168,140,0,0,0,0,0,96,165,140,64,224,183, -144,150,56,168,140,0,0,0,0,21,128,173,89,11,78,173,89,0,116,181,140,0,32, -0,0,0,48,168,144,80,82,0,0,21,128,181,89,0,52,181,146,0,20,0,144,64,224, -167,144,20,57,168,140,0,0,0,0,0,96,165,140,64,224,183,144,150,56,168,140, -0,0,0,0,21,128,173,89,11,78,173,89,0,116,181,140,0,32,0,0,0,48,168,144, -80,82,0,0,21,128,181,89,0,52,181,146,16,20,0,144,64,224,167,144,20,57,168, -140,0,0,0,0,0,96,165,140,64,224,175,144,10,78,181,89,0,180,173,140,0,16, -0,0,0,48,176,144,80,82,0,0,22,64,173,89,0,52,173,146,0,24,0,144,64,224, -167,144,20,57,168,140,0,0,0,0,0,96,165,140,64,224,175,144,10,78,181,89, -0,180,173,140,0,16,0,0,0,48,176,144,80,82,0,0,22,64,173,89,0,52,173,146, -16,24,0,144,64,224,167,144,20,80,168,89,64,224,175,146,0,255,255,8,0,0, -0,0,1,30,160,92,0,48,160,146,68,16,0,80,0,30,160,92,64,224,167,146,64,224, -167,144,20,240,0,90,78,0,0,17,64,224,167,144,20,57,168,140,0,0,0,0,0,96, -165,140,15,30,168,92,0,52,173,146,16,16,0,80,64,224,167,144,20,57,168,140, -0,0,0,0,0,96,165,140,0,30,168,92,0,52,173,146,0,16,0,80,64,224,167,144, -20,80,168,89,64,224,175,146,176,255,255,8,0,48,160,144,68,12,0,80,1,14, -173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,12,0,80,0,14,173,88,0,48, -168,146,68,12,0,80,0,48,160,144,68,20,0,80,2,14,173,88,0,48,168,146,68, -20,0,80,0,48,160,144,68,20,0,80,0,14,173,88,0,48,168,146,68,20,0,80,0,48, -160,144,68,20,0,80,138,9,173,88,0,48,168,146,68,20,0,80,0,48,160,144,4, -28,0,80,5,14,173,88,0,48,168,146,4,28,0,80,0,48,160,144,4,28,0,80,4,14, -173,88,0,48,168,146,4,28,0,80,0,48,160,144,68,20,0,80,147,9,173,88,0,48, -168,146,68,20,0,80,0,30,128,92,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0, -0,30,22,160,92,0,48,168,128,80,243,0,0,0,48,168,146,68,16,0,80,0,30,168, -92,0,48,168,146,0,16,0,80,1,30,168,92,0,48,168,146,16,16,0,80,0,0,0,10, -24,22,40,92,16,72,8,89,0,116,200,146,240,255,255,255,0,116,208,154,248, -255,255,255,0,16,164,144,0,48,232,140,0,255,0,0,0,16,172,144,148,64,167, -88,8,78,239,89,4,32,180,144,136,13,141,89,149,64,175,88,144,77,149,89,42, -96,36,58,38,96,44,58,10,30,128,92,5,22,192,92,0,116,200,144,240,255,255, -255,0,116,208,152,248,255,255,255,0,0,0,10,0,0,0,0,10,160,4,58,220,191, -12,61,0,48,160,144,100,180,3,0,210,31,181,52,0,48,160,144,96,180,3,0,198, -31,181,49,0,48,160,144,224,193,3,0,22,157,173,140,21,30,37,140,4,32,161, -144,172,63,69,58,138,96,36,58,14,96,36,60,18,96,4,58,156,255,255,8,138, -96,44,58,148,255,255,8,8,32,164,144,31,88,236,89,157,5,165,112,72,32,161, -146,14,32,5,61,1,30,232,92,72,32,233,146,4,32,161,144,98,32,69,61,8,32, -137,144,72,32,161,144,38,0,141,60,145,92,148,140,18,58,144,140,0,0,0,0, -4,22,128,92,2,0,152,140,116,231,255,9,8,32,241,146,24,32,241,146,2,30,128, -92,5,22,192,92,0,116,200,144,240,255,255,255,0,116,208,152,248,255,255, -255,0,0,0,10,0,0,0,0,31,88,187,89,4,0,128,140,16,0,0,8,0,0,0,0,31,88,188, -89,0,0,128,140,18,160,4,58,134,160,12,58,0,255,255,8,0,0,0,0,0,48,160,144, -176,242,0,0,240,62,5,58,0,48,160,144,48,243,0,0,48,32,169,140,20,22,48, -92,0,48,56,140,48,104,0,0,0,80,165,146,4,96,61,146,0,48,160,144,132,242, -0,0,151,5,165,116,32,32,161,146,0,48,160,144,180,242,0,0,151,5,165,116, -32,32,177,140,0,144,69,144,20,22,72,92,151,0,170,112,151,0,189,112,4,160, -165,146,16,65,173,89,0,80,85,140,23,22,88,92,0,144,69,146,120,0,0,8,0,0, -0,0,0,48,160,144,16,243,0,0,120,62,5,58,0,48,160,144,52,243,0,0,48,32,169, -140,20,22,192,92,0,48,200,140,80,107,0,0,0,80,165,146,4,96,205,146,0,48, -160,144,228,242,0,0,151,5,165,116,32,32,161,146,0,48,160,144,20,243,0,0, -151,5,165,116,32,32,177,140,0,144,101,144,20,22,104,92,151,0,171,112,151, -0,189,112,4,160,165,146,16,65,173,89,0,80,117,140,23,22,120,92,0,144,101, -146,8,160,173,146,12,160,189,146,17,22,208,92,20,32,145,146,8,30,216,92, -0,16,137,146,2,30,128,92,4,32,217,146,5,22,192,92,0,116,200,144,240,255, -255,255,0,116,208,152,248,255,255,255,0,0,0,10,4,32,180,144,0,48,160,144, -100,180,3,0,42,0,181,52,0,48,160,144,96,180,3,0,30,0,181,49,0,48,160,144, -224,193,3,0,22,157,173,140,21,62,165,144,4,0,0,0,18,32,77,61,10,30,128, -92,0,0,0,10,0,0,0,0,0,48,168,144,224,193,3,0,22,157,165,140,20,94,37,140, -8,32,137,144,22,96,4,59,4,22,128,92,0,0,144,140,8,30,152,92,156,229,255, -9,4,22,128,92,80,0,136,140,224,42,0,9,9,30,184,92,4,32,185,146,159,25,184, -88,2,0,128,140,56,32,185,146,0,0,0,10,0,0,0,0,96,32,164,144,0,48,160,146, -116,180,3,0,96,32,164,144,148,57,160,140,32,0,0,0,0,48,160,146,120,180, -3,0,0,48,160,128,120,180,3,0,16,22,96,92,64,32,92,140,255,0,104,140,148, -208,167,88,148,64,163,88,14,32,5,58,8,30,128,92,0,0,0,10,0,48,128,144,120, -180,3,0,208,33,0,9,0,48,128,146,52,242,0,0,14,32,4,61,8,30,128,92,0,0,0, -10,28,224,162,144,148,57,160,140,32,0,0,0,0,48,160,146,112,180,3,0,0,48, -160,128,112,180,3,0,148,208,167,88,148,64,163,88,14,32,5,58,8,30,128,92, -0,0,0,10,24,224,162,144,148,208,160,88,148,64,163,88,14,32,5,58,8,30,128, -92,0,0,0,10,16,224,170,144,20,224,74,144,24,224,82,144,24,224,146,144,24, -224,154,144,48,224,234,144,56,224,34,144,64,224,42,144,72,224,50,144,80, -224,58,144,88,224,66,144,0,48,176,144,120,180,3,0,96,224,138,144,0,48,160, -144,112,180,3,0,104,224,130,144,12,224,186,144,22,16,178,89,150,64,178, -112,8,32,165,140,148,128,162,112,21,93,173,140,23,221,189,140,149,157,173, -140,21,0,173,89,18,93,149,140,19,157,156,140,157,221,236,140,132,93,39, -140,133,29,41,140,134,93,49,140,135,157,57,140,136,221,65,140,145,29,138, -140,144,93,132,140,0,48,104,140,0,192,2,0,23,30,188,140,14,64,187,62,8, -30,128,92,0,0,0,10,12,22,128,92,164,0,0,9,18,32,68,61,8,30,128,92,0,0,0, -10,0,0,0,0,12,22,128,92,28,1,0,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0,0, -0,12,22,128,92,164,1,0,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0,0,0,12,22, -128,92,140,216,255,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0,0,0,24,224,130, -144,0,48,136,144,112,180,3,0,236,222,255,9,18,32,68,61,8,30,128,92,0,0, -0,10,0,0,0,0,64,32,131,140,196,15,0,9,18,32,68,61,8,30,128,92,0,0,0,10, -0,0,0,0,0,30,128,92,76,233,255,9,2,30,128,92,0,0,0,10,16,22,32,92,80,32, -132,144,0,48,128,146,152,180,3,0,5,14,132,89,12,32,0,9,0,48,128,146,56, -242,0,0,18,32,4,61,8,30,128,92,0,0,0,10,0,0,0,0,0,48,184,144,56,242,0,0, -0,16,185,146,0,48,168,144,152,180,3,0,0,30,176,92,0,48,184,146,64,242,0, -0,5,78,165,89,23,60,165,140,224,255,255,255,0,48,160,146,60,242,0,0,34, -96,5,59,23,22,168,92,0,80,245,146,0,48,160,144,152,180,3,0,32,96,173,140, -22,80,176,89,236,31,181,60,2,30,128,92,0,0,0,10,0,0,0,0,88,32,36,144,16, -22,40,92,132,57,128,140,0,0,0,0,128,31,0,9,0,48,128,146,140,180,3,0,14, -32,4,61,8,30,128,92,0,0,0,10,0,48,176,144,140,180,3,0,0,30,168,92,132,48, -0,90,8,96,177,146,0,48,176,146,148,180,3,0,132,189,165,140,248,255,255, -255,0,48,160,146,144,180,3,0,62,0,0,22,0,47,1,90,0,144,165,140,24,0,0,16, -1,30,168,92,149,32,1,90,0,144,245,146,22,16,162,89,30,0,0,19,0,16,245,146, -21,144,168,89,8,32,245,146,149,32,1,90,16,32,165,140,236,255,255,20,2,30, -128,92,0,0,0,10,0,0,0,0,0,0,0,0,84,32,36,144,16,22,40,92,132,57,128,140, -0,0,0,0,224,30,0,9,0,48,128,146,128,180,3,0,14,32,4,61,8,30,128,92,0,0, -0,10,0,48,176,144,128,180,3,0,0,30,168,92,132,48,0,90,4,96,177,146,0,48, -176,146,136,180,3,0,132,189,165,140,248,255,255,255,0,48,160,146,132,180, -3,0,62,0,0,22,0,47,1,90,0,144,165,140,24,0,0,16,1,30,168,92,149,32,1,90, -0,144,245,146,22,16,162,89,30,0,0,19,0,16,245,146,21,144,168,89,8,32,245, -146,149,32,1,90,16,32,165,140,236,255,255,20,2,30,128,92,0,0,0,10,0,0,0, -0,0,0,0,0,16,22,32,92,145,57,128,140,0,0,0,0,17,22,40,92,64,30,0,9,28,32, -129,146,18,32,4,61,8,30,128,92,0,0,0,10,0,0,0,0,28,32,185,144,32,32,169, -140,0,30,176,92,133,48,0,90,133,253,165,140,248,255,255,255,0,80,189,146, -4,96,165,146,62,0,0,22,0,111,1,90,0,208,165,140,24,0,0,16,1,30,176,92,150, -96,1,90,0,208,245,146,23,16,162,89,30,0,0,19,0,16,245,146,22,144,176,89, -8,32,245,146,150,96,1,90,16,32,165,140,236,255,255,20,2,30,128,92,0,0,0, -10,0,0,0,0,80,96,8,140,0,116,192,178,240,255,255,255,0,30,88,92,0,48,192, -140,32,20,0,80,0,48,24,140,252,4,0,96,0,48,200,140,132,8,0,64,0,48,208, -140,255,63,0,0,1,25,216,89,0,16,166,144,222,44,5,58,8,206,114,89,0,180, -163,140,128,8,0,64,0,16,101,144,0,80,166,144,142,137,238,88,148,64,79,88, -0,48,232,140,255,255,255,0,4,12,171,89,149,64,167,88,16,12,165,89,148,44, -5,61,0,48,160,144,96,180,3,0,8,76,239,89,149,64,175,88,128,12,173,49,0, -48,160,144,224,193,3,0,21,93,173,140,21,30,45,140,4,96,161,144,0,80,169, -144,46,32,77,61,11,22,128,92,0,80,138,140,64,16,0,11,0,48,160,144,164,243, -0,0,20,80,160,89,0,48,160,146,164,243,0,0,76,12,0,8,0,0,0,0,140,144,163, -88,2,12,165,89,10,32,21,61,44,108,5,61,28,96,81,144,24,96,65,144,8,96,49, -144,78,100,37,58,18,96,37,60,142,105,5,58,16,12,0,8,0,0,0,0,8,108,45,61, -246,32,2,61,106,160,1,61,5,22,128,92,0,16,139,140,116,220,255,9,172,43, -4,58,48,96,161,144,5,22,128,92,0,16,5,134,144,112,0,90,0,16,84,140,50,0, -0,21,0,48,160,144,248,243,0,0,11,22,128,92,9,0,165,89,0,80,138,140,0,48, -160,146,248,243,0,0,160,15,0,11,12,96,129,144,16,221,255,9,116,11,0,8,32, -96,161,144,68,96,217,146,140,0,0,8,0,0,0,0,86,5,232,140,62,64,55,54,0,48, -160,144,252,243,0,0,11,22,128,92,1,32,165,140,9,22,136,92,0,48,160,146, -252,243,0,0,92,15,0,11,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152,140, -112,223,255,9,36,11,0,8,52,96,161,144,5,22,128,92,0,16,5,134,144,112,0, -90,0,16,84,140,46,0,0,21,11,22,128,92,0,80,138,140,32,15,0,11,5,22,128, -92,0,144,137,140,0,30,144,92,8,0,152,140,52,223,255,9,232,10,0,8,0,0,0, -0,36,96,161,144,24,96,161,146,86,5,232,140,126,64,55,54,0,48,160,144,252, -243,0,0,11,22,128,92,1,32,165,140,9,22,136,92,0,48,160,146,252,243,0,0, -212,14,0,11,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152,140,232,222,255, -9,156,10,0,8,11,22,128,92,0,80,138,140,176,14,0,11,24,0,0,8,11,22,128,92, -0,80,138,140,160,14,0,11,12,96,129,144,16,220,255,9,0,48,160,144,248,243, -0,0,9,0,165,89,0,48,160,146,248,243,0,0,36,1,0,8,0,0,0,0,42,33,11,48,26, -97,2,59,0,180,35,140,112,4,0,96,0,180,67,140,120,4,0,96,0,180,59,140,64, -4,0,64,68,96,161,144,0,48,80,146,84,0,0,32,10,30,232,92,0,48,232,146,96, -0,0,32,0,48,160,146,64,20,0,80,0,16,161,176,0,16,161,176,0,16,162,152,0, -208,161,152,64,224,167,154,0,48,160,144,64,20,0,80,6,80,48,89,0,48,232, -140,123,221,4,199,64,224,151,136,102,64,167,58,0,48,168,144,8,244,0,0,134, -156,161,140,20,58,160,140,0,0,0,0,18,1,165,89,8,9,165,89,47,0,232,140,21, -80,168,89,20,96,7,90,0,48,168,146,8,244,0,0,26,0,0,22,0,48,160,144,252, -243,0,0,20,80,160,89,0,48,160,146,252,243,0,0,5,22,128,92,0,144,137,140, -0,30,144,92,8,0,152,140,216,221,255,9,20,0,0,8,5,22,128,92,0,144,137,140, -2,30,152,92,196,221,255,9,129,75,74,90,54,0,0,18,5,22,128,92,68,96,217, -146,12,22,136,92,28,218,255,9,0,30,48,92,198,62,4,58,48,96,161,144,5,22, -128,92,0,16,5,134,144,112,0,90,0,16,84,140,190,254,255,18,8,127,2,60,8, -96,241,146,24,96,241,146,120,9,0,8,24,96,137,144,0,180,35,140,112,4,0,96, -86,64,76,62,11,22,128,92,0,144,146,140,68,96,153,140,92,10,0,9,24,96,161, -144,8,96,169,144,52,96,177,144,21,0,173,89,0,80,129,140,8,96,169,146,20, -65,74,89,0,144,5,134,144,112,0,90,0,16,84,140,202,8,0,18,36,96,161,144, -137,32,5,90,24,96,161,146,20,22,136,92,180,255,255,17,68,96,161,144,0,48, -160,146,64,20,0,80,8,96,161,144,24,96,169,144,137,48,0,90,9,0,165,89,9, -65,173,89,8,96,161,146,24,96,169,146,250,0,0,22,137,176,2,90,0,80,130,140, -10,0,0,22,10,30,128,92,144,28,164,140,144,28,172,140,20,57,160,140,0,0, -0,0,0,48,80,146,84,0,0,32,1,9,180,89,0,48,160,146,96,0,0,32,22,112,2,90, -21,158,82,140,178,0,0,17,22,57,160,144,48,157,0,0,0,16,5,132,196,157,0, -0,184,157,0,0,172,157,0,0,160,157,0,0,148,157,0,0,136,157,0,0,124,157,0, -0,112,157,0,0,100,157,0,0,88,157,0,0,0,16,161,176,0,16,161,176,0,16,161, -176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0, -16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161, -176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0, -16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161, -176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,0,16,161,176,16, -65,74,89,16,127,2,60,0,48,160,144,64,20,0,80,28,96,81,146,68,96,161,146, -228,7,0,8,0,0,0,0,0,180,123,140,192,4,0,64,137,48,0,90,56,96,33,144,0,30, -104,92,34,5,0,18,0,208,163,144,0,48,232,140,255,255,0,0,148,64,63,88,146, -0,57,61,74,32,2,61,210,5,232,140,22,64,55,54,11,22,128,92,140,16,0,11,44, -2,0,8,0,0,0,0,52,96,161,144,5,22,128,92,0,16,5,134,144,112,0,90,0,16,84, -140,22,0,0,21,11,22,128,92,100,16,0,11,4,2,0,8,0,0,0,0,36,96,65,144,0,48, -80,146,68,0,0,32,0,180,163,140,240,4,0,96,0,16,133,176,0,16,165,176,1,9, -66,89,44,160,82,140,6,80,48,89,138,48,0,90,0,208,160,144,0,208,160,144, -0,208,160,144,196,1,0,18,0,36,161,140,148,128,38,88,120,4,0,8,14,204,161, -89,102,32,13,58,18,32,13,49,254,33,21,58,234,34,29,58,68,4,0,8,11,22,128, -92,244,15,0,11,34,160,1,58,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152, -140,244,218,255,9,28,0,0,8,0,0,0,0,0,48,160,144,208,243,0,0,20,80,160,89, -0,48,160,146,208,243,0,0,159,25,32,88,0,0,64,140,0,30,48,92,20,4,0,8,0, -0,0,0,42,160,1,61,11,22,128,92,160,15,0,11,0,48,160,144,208,243,0,0,159, -25,32,88,1,32,165,140,0,30,64,92,228,3,0,8,0,0,0,0,142,9,161,88,135,32, -5,90,1,160,49,140,46,0,0,18,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152, -140,120,218,255,9,11,22,128,92,0,0,48,140,84,15,0,11,20,2,0,8,0,0,0,0,11, -22,128,92,80,224,143,140,128,14,0,11,0,48,128,144,76,20,0,80,28,12,164, -89,20,253,151,144,76,0,0,0,60,96,169,144,0,48,232,140,0,0,255,0,26,12,36, -89,146,64,167,88,54,0,173,58,0,48,160,144,204,243,0,0,5,22,128,92,0,144, -137,140,0,30,144,92,8,0,152,140,20,80,160,89,0,0,48,140,0,48,160,146,204, -243,0,0,0,218,255,9,168,1,0,8,146,208,160,88,44,0,232,140,20,57,160,144, -96,82,0,0,134,64,175,112,0,48,232,140,255,255,0,0,146,64,63,88,4,9,33,89, -7,0,165,89,4,124,173,140,208,255,255,255,58,64,165,58,0,48,160,144,204, -243,0,0,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152,140,20,80,160,89, -0,0,48,140,0,48,160,146,204,243,0,0,156,217,255,9,68,1,0,8,0,0,0,0,66,32, -2,61,48,96,161,144,5,22,128,92,0,16,5,134,144,112,0,90,0,16,84,140,42,0, -0,21,5,22,128,92,0,144,137,140,0,30,144,92,8,0,152,140,100,217,255,9,0, -30,48,92,159,25,32,88,164,2,0,8,0,0,0,0,26,32,1,58,4,208,128,89,2,12,132, -89,0,144,138,140,80,224,151,140,228,221,255,11,5,22,128,92,0,144,137,140, -7,22,144,92,2,0,152,140,204,0,0,8,0,0,0,0,26,160,1,58,11,22,128,92,0,14, -0,11,5,22,128,92,0,144,137,140,168,0,0,8,5,22,128,92,0,16,139,140,112,213, -255,9,38,32,4,61,11,22,128,92,220,13,0,11,0,48,160,144,208,243,0,0,20,80, -160,89,159,25,32,88,36,2,0,8,0,0,0,0,48,96,161,144,5,22,128,92,0,16,5,134, -144,112,0,90,0,16,84,140,46,0,0,21,12,96,129,144,12,214,255,9,11,22,128, -92,156,13,0,11,0,48,160,144,208,243,0,0,20,80,160,89,159,25,32,88,228,1, -0,8,0,0,0,0,0,208,163,144,11,22,128,92,0,48,232,140,0,0,255,0,148,64,167, -88,0,144,138,140,60,96,161,146,60,12,0,9,144,48,0,90,0,16,84,140,42,0,0, -21,5,22,128,92,0,0,136,140,0,30,144,92,8,0,152,140,0,30,48,92,88,216,255, -9,0,30,64,92,159,25,32,88,152,1,0,8,32,96,169,144,0,228,161,140,148,128, -38,88,1,0,48,140,1,73,69,89,128,1,0,8,38,160,1,58,5,22,128,92,0,144,137, -140,0,30,144,92,8,0,152,140,28,216,255,9,0,30,48,92,0,0,64,140,159,25,32, -88,11,22,128,92,80,224,143,140,140,12,0,11,0,48,128,144,76,20,0,80,26,12, -60,89,64,225,1,58,28,12,164,89,20,253,151,144,76,0,0,0,80,224,167,144,0, -48,232,140,0,0,255,0,146,64,175,88,148,64,167,88,40,0,173,61,146,208,160, -88,20,57,176,144,96,82,0,0,0,48,232,140,255,255,0,0,146,64,55,88,8,201, -169,89,6,128,165,89,46,64,165,58,0,48,160,144,204,243,0,0,0,30,48,92,0, -0,64,140,20,80,160,89,159,25,32,88,0,48,160,146,204,243,0,0,212,0,0,8,0, -0,0,0,22,16,162,89,20,193,57,89,0,80,129,140,12,22,136,92,224,211,255,9, -38,32,4,61,0,48,160,144,208,243,0,0,0,30,48,92,0,0,64,140,20,80,160,89, -159,25,32,88,148,0,0,8,0,0,0,0,48,96,161,144,5,22,128,92,0,16,5,134,144, -112,0,90,0,16,84,140,54,0,0,21,0,48,160,144,208,243,0,0,20,80,160,89,0, -48,160,146,208,243,0,0,12,96,129,144,0,30,48,92,0,0,64,140,159,25,32,88, -92,212,255,9,84,0,0,8,0,0,0,0,7,208,128,89,2,12,132,89,0,144,138,140,84, -224,151,140,152,219,255,11,5,22,128,92,1,0,136,140,6,22,144,92,2,0,152, -140,220,214,255,9,0,30,48,92,32,0,0,8,11,22,128,92,180,11,0,11,0,48,160, -144,208,243,0,0,20,80,160,89,0,48,160,146,208,243,0,0,13,80,104,89,232, -90,106,52,8,96,49,146,28,96,81,146,24,96,65,146,56,96,33,146,152,2,0,8, -76,96,161,144,50,0,101,58,42,160,1,59,8,96,137,144,134,156,145,140,18,58, -144,140,0,0,0,0,5,22,128,92,2,0,152,140,116,214,255,9,8,96,241,146,24,96, -241,146,76,96,97,146,98,98,2,59,24,96,161,144,230,32,5,61,8,96,161,144, -134,32,5,61,5,22,128,92,0,16,139,140,184,210,255,9,14,34,4,58,72,96,169, -144,32,96,161,144,26,0,173,62,52,96,161,144,5,22,128,92,0,16,5,134,36,96, -161,144,20,0,0,8,48,96,161,144,5,22,128,92,0,16,5,134,32,96,161,144,24, -96,161,146,16,22,80,92,146,32,12,61,0,48,160,144,184,243,0,0,9,0,165,89, -0,48,160,146,184,243,0,0,12,96,129,144,60,211,255,9,11,22,128,92,0,80,138, -140,184,5,0,11,24,96,241,146,212,1,0,8,0,0,0,0,52,96,161,144,5,22,128,92, -0,16,5,134,144,112,0,90,0,16,84,140,62,0,0,21,0,48,160,144,184,243,0,0, -11,22,128,92,9,0,165,89,0,80,138,140,0,48,160,146,184,243,0,0,116,5,0,11, -8,96,137,144,5,22,128,92,0,0,144,140,2,30,152,92,136,213,255,9,8,96,241, -146,36,96,161,144,24,96,161,146,8,96,177,144,72,96,169,144,9,22,32,92,9, -128,165,89,10,64,165,60,22,65,37,89,24,96,137,144,4,65,74,89,130,64,36, -62,11,22,128,92,0,144,146,140,68,96,153,140,72,2,0,9,24,96,161,144,8,96, -169,144,52,96,177,144,21,0,173,89,0,80,129,140,8,96,169,146,20,1,33,89, -0,144,5,134,144,112,0,90,0,16,84,140,54,0,0,21,8,96,137,144,5,22,128,92, -0,0,144,140,8,30,152,92,8,213,255,9,11,22,128,92,0,16,137,140,212,4,0,11, -24,96,241,146,8,96,241,146,16,0,0,8,0,0,0,0,36,96,161,144,24,96,161,146, -24,96,137,144,136,95,36,57,30,32,1,58,11,22,128,92,0,16,137,140,10,22,144, -92,68,96,153,140,196,1,0,9,16,22,80,92,8,96,161,144,72,96,169,144,4,0,141, -89,8,96,137,146,46,64,141,61,145,92,148,140,18,58,144,140,0,0,0,0,5,22, -128,92,2,0,152,140,148,212,255,9,8,96,241,146,24,96,241,146,24,0,0,8,0, -0,0,0,24,96,161,144,28,96,81,146,4,1,165,89,24,96,161,146,16,126,2,60,104, -0,0,8,8,96,137,144,5,22,128,92,0,0,144,140,8,30,152,92,88,212,255,9,11, -22,128,92,0,80,138,140,36,4,0,11,24,96,241,146,8,96,241,146,60,0,0,8,0, -0,0,0,0,48,160,144,184,243,0,0,11,22,128,92,9,0,165,89,0,80,138,140,0,48, -160,146,184,243,0,0,244,3,0,11,20,0,0,8,0,0,0,0,11,22,128,92,0,80,138,140, -224,3,0,11,0,16,166,144,48,51,5,61,11,80,88,89,11,240,0,90,4,32,198,140, -0,225,24,140,0,97,206,140,12,243,255,22,0,116,192,176,240,255,255,255,0, -0,0,10,0,0,0,0,0,0,0,0,12,32,36,144,4,29,129,140,16,58,128,140,0,0,0,0, -112,16,0,9,0,48,128,146,224,193,3,0,14,32,4,61,8,30,128,92,0,0,0,10,0,48, -128,144,224,193,3,0,4,29,41,140,5,58,40,140,0,0,0,0,5,22,136,92,224,24, -0,9,1,9,161,89,0,48,240,146,100,180,3,0,0,48,160,146,96,180,3,0,110,32, -1,59,0,47,1,90,0,0,176,140,40,0,0,16,0,48,168,144,224,193,3,0,80,0,176, -140,150,96,1,90,9,0,184,140,4,96,189,146,159,25,184,88,56,96,189,146,62, -0,0,19,9,30,144,92,159,25,152,88,0,48,168,144,224,193,3,0,22,64,165,89, -4,32,149,146,56,32,157,146,21,188,165,140,80,0,0,0,160,160,181,140,150, -96,1,90,4,32,149,146,56,32,157,146,212,255,255,20,2,30,128,92,0,0,0,10, -0,0,0,0,0,208,172,144,17,58,160,140,0,0,0,0,17,57,136,140,0,0,0,0,17,1, -237,89,127,0,64,140,29,32,2,90,0,48,168,146,64,20,0,80,190,0,0,22,8,14, -164,89,0,52,141,140,112,4,0,96,135,25,72,88,127,0,80,140,0,48,144,146,84, -0,0,32,0,48,72,146,96,0,0,32,0,80,164,176,0,80,164,176,0,80,164,176,0,80, -164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176, -0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164, -176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0, -80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164, -176,0,80,164,176,0,80,164,176,0,80,164,176,0,116,239,140,128,255,255,255, -0,162,148,140,29,160,2,90,0,80,164,176,0,80,164,176,0,80,164,176,96,255, -255,17,63,0,64,140,114,0,234,54,0,48,144,146,84,0,0,32,134,25,64,88,0,48, -64,146,96,0,0,32,8,14,164,89,0,52,165,140,112,4,0,96,0,16,37,176,0,16,37, -176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37, -176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,161,148, -140,0,116,239,140,192,255,255,255,0,16,37,176,0,16,37,176,0,16,165,176, -82,96,255,51,0,48,144,146,84,0,0,32,31,88,64,89,0,48,64,146,96,0,0,32,8, -14,164,89,0,52,165,140,112,4,0,96,0,16,37,176,0,16,37,176,0,16,37,176,0, -16,37,176,0,16,37,176,128,160,148,140,0,116,239,140,224,255,255,255,0,16, -37,176,0,16,37,176,0,16,165,176,58,96,191,51,0,48,144,146,80,0,0,32,8,14, -164,89,0,52,165,140,112,4,0,96,0,16,37,176,0,16,37,176,0,16,37,176,96,160, -148,140,24,73,239,89,0,16,37,176,0,16,37,176,0,16,165,176,46,96,95,51,8, -14,164,89,0,48,144,146,72,0,0,32,0,52,165,140,112,4,0,96,48,160,148,140, -12,73,239,89,0,16,37,176,0,16,37,176,0,16,165,176,46,96,31,51,8,14,164, -89,0,52,141,140,112,4,0,96,0,48,144,146,64,0,0,32,4,73,239,89,16,160,148, -140,29,240,0,90,0,80,164,176,232,255,255,17,46,96,7,58,8,14,132,89,0,52, -132,140,124,4,0,96,0,48,144,146,56,0,0,32,1,73,239,89,4,160,148,140,157, -48,0,90,0,16,164,144,232,255,255,21,0,48,160,144,64,20,0,80,18,22,128,92, -0,208,164,146,0,0,0,10,0,0,0,0,0,0,0,0,0,48,240,140,144,169,0,0,30,22,144, -92,0,0,240,140,8,78,140,89,0,116,140,140,64,4,0,64,0,80,164,176,0,16,164, -178,0,80,164,176,16,16,132,89,0,16,164,178,0,80,164,176,16,16,132,89,0, -16,164,178,0,144,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140,224, -169,0,0,30,22,152,92,0,0,240,140,8,14,132,89,145,48,0,90,0,80,148,140,0, -52,132,140,64,4,0,64,26,0,0,18,0,16,164,176,0,16,164,176,1,137,148,89,0, -16,164,176,240,191,4,61,0,208,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,55, -160,172,140,31,88,76,89,137,69,173,116,1,25,72,89,0,48,72,146,64,12,0,80, -0,48,160,144,0,244,0,0,8,206,236,89,0,48,184,144,240,243,0,0,17,22,56,92, -0,144,53,140,20,80,160,89,145,48,0,90,0,48,160,146,0,244,0,0,21,192,173, -89,0,48,168,146,240,243,0,0,0,116,135,146,64,8,0,64,0,116,71,140,64,0,0, -112,0,30,232,92,2,222,87,89,255,0,88,140,146,0,0,22,4,160,161,144,0,144, -41,144,6,16,50,89,1,201,57,89,130,13,37,89,118,32,1,58,29,129,170,89,4, -96,5,90,0,16,161,140,10,0,0,22,21,22,160,92,29,0,237,89,0,48,40,146,48, -0,0,32,20,1,33,89,0,48,160,146,96,0,0,32,29,240,2,90,20,93,41,140,202,255, -255,22,0,48,160,128,8,0,0,16,148,192,138,88,34,96,92,51,0,16,162,176,12, -73,140,89,0,16,162,176,17,240,2,90,0,16,162,176,12,73,239,89,232,255,255, -17,212,127,95,52,148,255,255,8,0,0,0,0,120,255,1,60,255,0,72,140,0,48,160, -128,8,0,0,16,148,64,162,88,244,95,167,52,18,98,95,52,29,57,160,144,16,171, -0,0,0,16,5,132,96,171,0,0,208,172,0,0,176,172,0,0,136,172,0,0,104,172,0, -0,64,172,0,0,24,172,0,0,240,171,0,0,200,171,0,0,160,171,0,0,128,171,0,0, -64,171,0,0,0,16,162,176,0,16,162,176,0,16,162,152,8,206,164,89,0,16,170, -144,0,52,165,140,64,0,0,64,0,16,245,146,8,206,164,89,129,9,132,88,0,52, -133,146,64,8,0,64,0,52,165,140,64,0,0,64,0,16,245,146,112,1,0,8,8,206,164, -89,129,9,132,88,0,52,133,146,64,8,0,64,0,16,162,176,0,16,162,176,0,16,162, -152,116,1,0,8,8,206,164,89,129,9,132,88,0,52,133,146,64,8,0,64,0,16,34, -176,0,52,165,140,64,0,0,64,0,16,34,176,0,16,170,144,72,1,0,8,8,206,164, -89,129,9,132,88,0,52,133,146,64,8,0,64,0,16,34,176,0,52,165,140,64,0,0, -64,0,16,34,176,32,1,0,8,0,0,0,0,8,206,164,89,129,9,132,88,0,52,133,146, -64,8,0,64,0,16,34,176,0,16,178,152,0,16,170,144,0,52,165,140,64,0,0,64, -240,0,0,8,8,206,164,89,129,9,132,88,0,52,133,146,64,8,0,64,0,16,34,176, -0,16,178,152,0,52,165,140,64,0,0,64,200,0,0,8,0,0,0,0,8,206,164,89,129, -9,132,88,0,52,133,146,64,8,0,64,0,16,34,176,0,16,170,144,0,52,165,140,64, -0,0,64,156,0,0,8,0,0,0,0,8,206,164,89,129,9,132,88,0,52,133,146,64,8,0, -64,0,16,34,176,0,52,165,140,64,0,0,64,116,0,0,8,8,206,164,89,129,9,132, -88,0,52,133,146,64,8,0,64,0,16,178,152,0,16,170,144,0,52,165,140,64,0,0, -64,76,0,0,8,0,0,0,0,8,206,164,89,129,9,132,88,0,52,133,146,64,8,0,64,0, -16,178,152,0,52,165,140,64,0,0,64,36,0,0,8,8,206,164,89,129,9,132,88,0, -52,133,146,64,8,0,64,0,16,170,144,0,52,165,140,64,0,0,64,0,16,245,146,0, -16,245,146,0,16,245,146,0,16,245,146,0,16,245,146,0,16,245,146,0,16,245, -146,0,16,245,146,0,16,245,146,8,206,156,89,0,244,156,140,64,0,0,64,0,208, -148,146,0,48,160,144,64,12,0,80,20,21,160,88,0,208,164,146,0,0,0,10,0,0, -0,0,0,0,0,0,0,0,0,0,0,48,240,140,136,173,0,0,30,22,144,92,0,0,240,140,1, -9,132,89,1,25,168,89,42,64,133,58,8,78,140,89,0,116,164,140,80,8,0,64,0, -116,140,140,96,8,0,64,0,16,245,146,1,9,132,89,0,80,244,146,244,95,133,61, -0,144,4,132,0,0,0,0,0,0,0,10,0,0,0,0,0,48,136,146,64,0,0,32,8,14,172,89, -0,116,181,140,240,4,0,96,0,144,37,176,17,16,164,89,0,48,160,146,64,0,0, -32,0,144,37,176,32,96,132,140,0,48,128,146,56,0,0,32,0,116,173,140,252, -4,0,96,16,16,129,89,0,80,165,144,0,48,128,146,56,0,0,32,16,16,129,89,0, -80,165,144,0,0,0,10,0,0,0,0,0,0,0,0,0,48,240,140,64,174,0,0,30,22,144,92, -0,0,240,140,8,14,132,89,0,52,132,140,192,4,0,64,0,16,164,144,1,30,176,92, -4,96,172,140,0,80,164,146,0,16,164,144,0,80,165,146,0,16,164,144,22,144, -176,89,150,176,2,90,4,96,165,146,21,16,170,89,228,255,255,22,0,144,4,132, -0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140,160,174,0,0,30,22,144,92, -0,0,240,140,8,14,132,89,0,52,132,140,192,4,0,64,0,16,164,144,1,30,176,92, -4,96,172,140,0,80,164,146,0,16,164,144,0,80,165,146,0,16,164,144,22,144, -176,89,150,176,2,90,4,96,165,146,21,16,170,89,228,255,255,22,0,144,4,132, -0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140,232,174,0,0,30,22,136,92, -0,0,240,140,8,14,132,89,0,52,132,140,192,4,0,64,0,16,164,176,0,16,164,176, -0,16,164,144,0,16,164,144,0,16,164,144,0,80,4,132,0,0,0,0,0,0,0,10,0,0, -0,0,21,22,80,92,48,0,232,140,0,48,184,144,176,243,0,0,157,133,172,116,0, -208,92,140,8,206,156,89,3,160,148,140,21,192,173,89,130,141,68,89,0,48, -168,146,176,243,0,0,0,244,132,146,64,8,0,64,22,22,72,92,148,48,0,90,0,144, -181,152,20,22,96,92,0,0,32,140,0,244,52,140,64,0,0,112,0,30,128,92,130, -205,45,89,0,144,61,140,162,0,0,21,136,48,0,90,2,222,119,89,255,0,24,140, -138,0,0,22,22,96,1,61,9,16,74,89,0,80,162,152,130,77,45,89,0,16,61,140, -4,129,171,89,133,96,5,90,0,80,161,140,10,0,0,22,21,22,160,92,4,0,37,89, -20,1,66,89,0,48,56,146,48,0,0,32,20,65,41,89,0,48,160,146,96,0,0,32,132, -240,2,90,20,221,57,140,54,0,0,22,0,48,160,128,8,0,0,16,28,0,0,8,0,144,161, -176,0,144,161,176,0,144,161,176,0,48,160,128,8,0,0,16,12,9,33,89,148,192, -160,88,228,63,93,52,212,63,89,60,128,63,2,60,0,0,0,10,0,0,0,0,136,48,0, -90,2,222,111,89,255,0,120,140,158,0,0,22,22,96,1,61,9,16,74,89,0,80,162, -152,130,77,45,89,0,16,61,140,4,65,171,89,133,96,5,90,0,80,161,140,10,0, -0,22,21,22,160,92,4,0,37,89,20,1,66,89,0,48,56,146,48,0,0,32,20,65,41,89, -0,48,160,146,96,0,0,32,132,240,2,90,20,221,57,140,74,0,0,22,48,0,0,8,0, -0,0,0,0,144,161,176,16,80,128,89,0,144,161,176,144,32,3,90,0,144,161,176, -12,9,33,89,18,0,0,21,10,22,128,93,208,252,255,11,0,30,128,92,0,48,160,128, -8,0,0,16,148,192,163,88,204,63,93,52,240,63,89,60,108,63,2,60,10,22,128, -93,164,252,255,8,0,30,32,92,0,16,36,146,132,73,140,89,16,16,129,89,244, -127,36,62,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,0,116,192,178,240,255,255, -255,18,208,136,89,4,25,216,89,145,192,142,88,51,96,188,140,31,88,219,89, -155,197,189,112,0,80,197,140,0,48,168,144,212,243,0,0,0,48,232,144,192, -243,0,0,18,22,208,92,1,96,173,140,19,22,120,92,0,48,168,146,212,243,0,0, -23,64,191,89,0,48,184,146,192,243,0,0,20,22,24,92,130,77,84,89,0,144,37, -152,22,22,104,92,0,0,232,140,17,16,114,89,2,222,223,89,130,77,73,89,137, -224,6,90,0,80,138,140,10,0,0,22,2,222,143,89,18,208,144,89,4,25,216,89, -146,192,150,88,0,48,184,144,112,82,0,0,17,22,64,92,44,0,216,140,14,224, -6,90,0,48,168,144,116,82,0,0,255,3,216,140,23,80,184,89,151,192,190,88, -0,48,216,140,0,0,255,255,149,192,174,88,0,48,216,140,255,255,255,0,0,48, -32,146,48,0,0,32,149,131,172,88,0,116,173,140,0,0,1,0,149,192,182,88,0, -48,216,140,0,0,255,0,0,48,136,146,96,0,0,32,17,129,82,89,17,29,97,140,17, -65,74,89,0,48,184,146,112,82,0,0,0,48,176,146,116,82,0,0,149,192,206,88, -250,0,0,17,42,160,2,59,13,16,106,89,0,80,163,152,130,77,77,89,0,48,160, -146,48,0,0,32,9,129,82,89,0,48,72,146,96,0,0,32,224,191,2,60,8,206,36,89, -0,52,161,140,64,8,0,64,0,16,133,146,0,48,160,144,112,82,0,0,0,48,176,144, -116,82,0,0,14,222,216,89,148,195,166,88,0,52,169,140,192,0,0,64,0,48,160, -146,76,12,0,80,0,80,181,146,80,206,255,9,0,48,160,128,8,0,0,16,30,32,5, -58,0,52,153,140,192,0,0,112,0,208,164,144,0,48,160,128,8,0,0,16,244,63, -5,61,8,206,163,89,153,131,182,88,44,0,216,140,14,193,174,89,0,52,165,140, -192,0,0,64,2,76,173,89,0,16,181,146,149,48,0,90,0,0,176,140,34,0,0,18,12, -96,5,48,1,30,176,92,12,0,0,8,0,16,245,146,22,144,176,89,0,16,245,146,244, -95,181,52,8,206,163,89,26,142,171,89,0,52,165,140,192,0,0,64,0,16,173,146, -0,116,192,176,240,255,255,255,0,0,0,10,145,112,2,90,2,222,223,89,78,0,0, -17,13,16,106,89,0,80,35,152,8,193,190,89,130,77,73,89,137,224,5,90,0,80, -138,140,10,0,0,22,23,22,136,92,8,64,68,89,17,65,74,89,0,48,32,146,48,0, -0,32,17,129,82,89,0,48,136,146,96,0,0,32,136,112,2,90,17,29,97,140,188, -255,255,22,0,48,184,144,112,82,0,0,8,206,180,89,0,180,173,140,64,8,0,64, -0,80,133,146,0,48,168,144,116,82,0,0,255,0,216,140,143,201,93,88,0,180, -181,140,192,0,0,64,0,48,88,146,76,12,0,80,0,144,173,146,0,48,168,128,8, -0,0,16,149,192,174,88,244,127,77,51,8,206,180,89,0,180,173,140,192,0,0, -112,0,80,37,176,0,80,37,176,148,48,0,90,0,80,165,152,0,180,181,140,192, -0,0,64,0,48,216,140,0,0,0,176,10,9,66,89,0,144,221,146,0,180,115,140,212, -255,255,255,230,1,0,21,14,160,2,61,31,88,219,89,252,193,118,54,82,160,2, -59,22,96,2,61,13,16,106,89,0,80,163,152,130,77,77,89,0,16,101,140,2,222, -223,89,8,193,166,89,137,32,5,90,0,80,138,140,10,0,0,22,20,22,136,92,8,64, -68,89,0,48,96,146,48,0,0,32,17,65,74,89,17,29,99,140,17,129,82,89,0,48, -136,146,96,0,0,32,134,32,82,59,8,206,164,89,0,52,133,140,192,0,0,112,0, -52,141,140,192,0,0,64,0,48,160,128,8,0,0,16,255,0,216,140,84,0,0,8,0,0, -0,0,0,228,162,140,0,48,216,140,255,63,0,0,148,192,94,88,0,48,88,146,76, -12,0,80,0,16,164,176,0,16,164,176,0,16,164,152,0,16,164,144,0,48,216,140, -0,0,0,176,0,80,220,146,0,48,160,128,8,0,0,16,255,0,216,140,11,9,66,89,0, -180,115,140,212,255,255,255,148,192,166,88,176,63,85,52,152,63,82,60,46, -191,2,61,31,88,219,89,36,223,118,49,24,1,0,8,82,160,2,59,22,96,2,61,13, -16,106,89,0,80,163,152,130,77,77,89,0,16,101,140,2,222,223,89,8,193,166, -89,137,32,5,90,0,80,138,140,10,0,0,22,20,22,136,92,8,64,68,89,0,48,96,146, -48,0,0,32,17,65,74,89,17,29,99,140,17,129,82,89,0,48,136,146,96,0,0,32, -162,32,82,59,8,206,163,89,0,52,37,140,192,0,0,112,0,52,53,140,192,0,0,64, -0,48,160,128,8,0,0,16,255,0,216,140,148,192,166,88,118,32,85,51,0,160,41, -140,29,80,232,89,22,192,232,61,24,22,128,92,0,208,139,140,24,248,255,11, -0,30,232,92,0,228,162,140,0,48,216,140,255,63,0,0,148,192,94,88,0,48,88, -146,76,12,0,80,0,16,161,176,0,16,161,176,0,16,161,152,0,16,161,144,0,48, -216,140,0,0,0,176,0,80,217,146,0,48,160,128,8,0,0,16,255,0,216,140,11,9, -66,89,0,180,115,140,212,255,255,255,148,192,166,88,152,63,85,52,124,63, -82,60,18,191,2,61,31,88,219,89,8,223,118,49,29,80,232,89,22,192,232,61, -24,22,128,92,0,208,139,140,156,247,255,11,0,30,232,92,0,228,162,140,0,48, -216,140,255,63,0,0,148,192,166,88,142,9,165,88,0,48,160,146,76,12,0,80, -255,0,216,140,0,48,160,128,8,0,0,16,148,192,166,88,244,31,162,60,0,48,160, -128,8,0,0,16,34,32,5,58,8,206,163,89,0,52,173,140,192,0,0,112,0,80,165, -144,0,48,160,128,8,0,0,16,244,63,5,61,8,206,163,89,153,131,182,88,44,0, -216,140,14,193,174,89,2,76,173,89,0,52,165,140,192,0,0,64,1,73,173,89,1, -25,216,89,0,16,181,146,18,192,174,58,1,73,173,89,0,16,245,146,248,223,174, -61,8,206,163,89,26,142,171,89,0,52,165,140,192,0,0,64,0,16,173,146,26,224, -0,58,29,80,232,89,18,192,232,61,24,22,128,92,0,208,139,140,220,246,255, -11,0,116,192,176,240,255,255,255,0,0,0,10,0,0,0,0,0,48,160,144,124,82,0, -0,16,16,180,89,0,48,184,140,0,192,2,0,0,48,32,144,120,82,0,0,22,0,165,89, -18,192,165,62,0,30,128,92,0,0,0,10,0,0,0,0,0,48,168,144,120,82,0,0,0,48, -160,144,124,82,0,0,4,22,128,92,0,144,141,140,21,188,173,140,0,0,0,0,22, -0,165,89,0,48,168,146,120,82,0,0,0,48,160,146,124,82,0,0,60,8,0,9,4,208, -131,89,16,25,184,89,144,192,133,88,0,32,132,140,0,0,0,10,0,0,0,0,0,48,160, -140,128,82,0,0,20,16,153,89,3,32,149,140,0,48,136,140,0,4,0,136,0,30,128, -92,0,0,232,140,255,0,104,140,135,25,112,88,0,16,173,128,36,96,5,58,0,80, -172,144,0,144,180,128,0,208,188,128,8,76,173,89,149,128,173,88,149,64,171, -88,8,192,173,58,16,80,128,89,8,32,173,128,36,96,5,58,4,96,172,144,8,160, -180,128,8,224,188,128,8,76,173,89,149,128,173,88,149,64,171,88,8,192,173, -58,16,80,128,89,16,32,173,128,36,96,5,58,8,96,172,144,16,160,180,128,16, -224,188,128,8,76,173,89,149,128,173,88,149,64,171,88,8,192,173,58,16,80, -128,89,29,208,232,89,157,160,3,90,12,96,140,140,20,16,166,89,24,224,156, -140,18,16,150,89,112,255,255,22,14,32,4,58,0,30,128,92,0,0,0,10,0,30,80, -92,0,0,72,140,0,30,32,92,0,0,40,140,0,30,48,92,52,1,0,9,0,30,64,92,0,0, -56,140,0,48,64,154,128,243,0,0,0,48,32,178,112,243,0,0,1,30,128,92,0,48, -240,146,136,243,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,48,240,140,152,184,0,0,30, -22,152,92,0,0,240,140,135,25,184,88,14,192,133,54,0,30,128,92,0,208,4,132, -144,57,168,140,128,82,0,0,0,80,165,128,14,32,5,61,0,30,128,92,0,208,4,132, -2,96,165,128,255,0,184,140,16,57,176,140,0,4,0,136,145,0,141,88,145,192, -141,88,8,78,164,89,146,48,0,90,0,144,165,146,38,0,0,18,0,144,165,144,1, -96,173,128,8,12,165,89,148,64,165,88,148,192,165,88,14,64,164,58,0,30,128, -92,0,208,4,132,1,30,128,92,0,208,4,132,0,0,0,10,0,0,0,0,0,48,240,140,0, -185,0,0,30,22,144,92,0,0,240,140,135,25,176,88,14,128,133,54,0,30,128,92, -0,144,4,132,144,57,168,140,128,82,0,0,0,80,165,128,14,32,5,61,0,30,128, -92,0,144,4,132,16,57,128,140,0,4,0,136,0,16,164,144,1,96,173,128,8,12,165, -89,148,64,165,88,1,0,128,140,0,80,164,130,0,144,4,132,0,0,0,0,0,0,0,10, -0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,0,48,160,128,64,84,0,0,1,30,136,92,64, -224,143,130,32,32,5,58,0,48,160,128,66,84,0,0,136,25,136,88,8,14,165,89, -148,64,164,88,0,48,160,146,224,4,0,136,232,3,128,140,160,5,0,11,0,48,160, -128,16,83,0,0,32,32,5,58,0,48,160,144,72,4,0,136,0,48,168,128,17,83,0,0, -8,12,165,89,148,64,165,88,64,224,167,130,0,48,160,128,24,83,0,0,65,224, -183,140,32,32,5,58,0,48,160,144,76,4,0,136,0,48,168,128,25,83,0,0,8,12, -165,89,148,64,165,88,0,144,165,130,65,224,167,128,64,224,175,128,0,48,176, -144,112,243,0,0,0,48,184,128,80,83,0,0,8,14,165,89,148,67,165,88,20,128, -165,89,0,48,160,146,112,243,0,0,32,224,5,58,0,48,160,144,104,4,0,136,0, -48,168,128,81,83,0,0,8,12,165,89,148,64,165,88,64,224,167,130,0,48,160, -128,88,83,0,0,66,224,183,140,32,32,5,58,0,48,160,144,108,4,0,136,0,48,168, -128,89,83,0,0,8,12,165,89,148,64,165,88,0,144,165,130,0,48,160,128,96,83, -0,0,65,224,183,140,32,32,5,58,0,48,160,144,112,4,0,136,0,48,168,128,97, -83,0,0,8,12,165,89,148,64,165,88,0,144,165,130,65,224,167,128,66,224,175, -128,64,224,183,128,0,48,184,144,120,243,0,0,0,48,128,128,104,83,0,0,16, -14,165,89,8,78,173,89,148,67,165,88,148,131,165,88,20,192,165,89,0,48,160, -146,120,243,0,0,32,32,4,58,0,48,160,144,116,4,0,136,0,48,168,128,105,83, -0,0,8,12,165,89,148,64,165,88,64,224,167,130,0,48,160,128,112,83,0,0,66, -224,183,140,32,32,5,58,0,48,160,144,120,4,0,136,0,48,168,128,113,83,0,0, -8,12,165,89,148,64,165,88,0,144,165,130,0,48,160,128,120,83,0,0,65,224, -183,140,32,32,5,58,0,48,160,144,124,4,0,136,0,48,168,128,121,83,0,0,8,12, -165,89,148,64,165,88,0,144,165,130,65,224,167,128,66,224,175,128,64,224, -183,128,0,48,184,144,124,243,0,0,0,48,128,128,64,84,0,0,16,14,165,89,8, -78,173,89,148,67,165,88,148,131,165,88,20,192,165,89,0,48,160,146,124,243, -0,0,32,32,4,58,0,48,160,144,224,4,0,136,0,48,168,128,65,84,0,0,8,12,165, -89,148,64,165,88,64,224,167,130,0,48,160,128,72,84,0,0,65,224,183,140,32, -32,5,58,0,48,160,144,228,4,0,136,0,48,168,128,73,84,0,0,8,12,165,89,148, -64,165,88,0,144,165,130,65,224,167,128,64,224,175,128,0,48,176,144,116, -243,0,0,0,48,184,128,80,84,0,0,8,14,165,89,148,67,165,88,20,128,165,89, -0,48,160,146,116,243,0,0,32,224,5,58,0,48,160,144,232,4,0,136,0,48,168, -128,81,84,0,0,8,12,165,89,148,64,165,88,64,224,167,130,0,48,160,128,88, -84,0,0,65,224,183,140,32,32,5,58,0,48,160,144,236,4,0,136,0,48,168,128, -89,84,0,0,8,12,165,89,148,64,165,88,0,144,165,130,65,224,167,128,64,224, -135,128,0,48,176,144,128,243,0,0,255,0,136,140,0,48,184,128,40,85,0,0,8, -14,165,89,144,64,172,88,148,67,165,88,20,128,165,89,0,48,160,146,128,243, -0,0,32,224,5,58,0,48,160,128,42,85,0,0,144,0,165,88,148,64,164,88,8,14, -165,89,0,48,160,146,84,5,0,136,232,3,128,140,160,2,0,11,0,48,160,128,32, -85,0,0,148,48,0,90,65,224,183,140,32,0,0,18,0,48,160,144,80,5,0,136,0,48, -168,128,33,85,0,0,8,12,165,89,148,64,165,88,0,144,165,130,65,224,167,128, -0,48,168,144,132,243,0,0,0,48,176,128,40,85,0,0,20,64,165,89,65,224,191, -140,0,48,160,146,132,243,0,0,32,160,5,58,0,48,160,144,84,5,0,136,0,48,168, -128,41,85,0,0,8,12,165,89,148,64,165,88,0,208,165,130,65,224,167,128,0, -48,168,144,136,243,0,0,20,64,165,89,0,48,160,146,136,243,0,0,0,0,0,10,0, -0,0,0,0,48,240,140,32,190,0,0,30,22,152,92,0,0,240,140,16,72,8,89,0,16, -164,144,0,16,172,144,0,48,144,140,0,0,255,0,149,128,172,88,255,0,144,140, -0,16,180,144,8,12,189,89,144,77,141,89,151,128,172,88,135,25,144,88,24, -140,133,89,14,128,172,54,0,30,176,92,64,0,0,8,149,57,176,140,128,82,0,0, -0,144,165,128,14,32,5,61,0,30,176,92,40,0,0,8,21,57,160,140,0,4,0,136,0, -16,165,144,1,160,173,128,8,12,165,89,148,64,165,88,1,0,176,140,0,116,160, -130,240,255,255,255,22,160,5,61,0,30,128,92,16,73,8,89,0,208,4,132,0,0, -0,0,16,73,176,89,0,144,165,128,145,0,172,88,255,0,144,140,151,128,188,88, -135,25,144,88,16,1,165,88,148,67,141,88,23,160,4,90,0,144,141,130,80,0, -0,17,151,57,128,140,128,82,0,0,0,16,164,128,64,32,5,58,2,32,172,128,255, -0,144,140,23,57,176,140,0,4,0,136,145,64,173,88,149,128,172,88,8,78,165, -89,0,144,165,146,0,144,165,144,1,32,180,128,1,30,184,92,8,12,165,89,148, -128,165,88,148,128,164,88,10,64,165,58,0,30,184,92,22,224,5,61,0,30,128, -92,16,73,8,89,0,208,4,132,0,0,0,0,1,30,128,92,16,73,8,89,0,208,4,132,0, -0,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,160,140,240,193,3,0,20,22,128, -92,0,48,184,140,0,4,0,136,0,48,176,140,128,82,0,0,0,30,136,92,255,0,152, -140,1,25,232,89,135,25,144,88,0,144,173,128,18,96,5,61,0,16,237,146,24, -0,0,8,0,0,0,0,0,208,173,144,8,76,173,89,149,192,172,88,0,16,172,146,8,160, -173,128,14,96,5,61,4,32,237,146,20,0,0,8,4,224,173,144,8,76,173,89,149, -192,172,88,4,32,172,146,16,160,173,128,14,96,5,61,8,32,237,146,20,0,0,8, -8,224,173,144,8,76,173,89,149,192,172,88,8,32,172,146,17,208,136,89,145, -160,4,90,12,32,132,140,20,16,163,89,12,224,189,140,22,16,182,89,132,255, -255,22,0,0,0,10,0,48,240,140,8,191,0,0,30,22,136,92,0,0,240,140,16,22,160, -92,148,48,0,90,1,9,132,89,244,255,255,19,0,80,4,132,0,0,0,0,0,0,0,10,0, -0,0,0,3,30,128,92,188,5,0,8,0,0,0,0,0,0,0,0,17,22,144,92,0,0,136,140,136, -0,0,8,0,0,0,0,1,30,128,92,12,30,0,9,12,32,244,146,0,0,0,10,16,22,48,92, -108,1,0,9,88,30,0,9,12,32,36,144,4,22,160,92,1,9,33,89,38,32,5,59,4,29, -44,140,16,96,161,144,0,16,5,134,4,22,160,92,148,48,0,90,4,73,41,89,1,9, -33,89,232,255,255,17,132,10,0,9,6,22,128,92,92,24,0,8,0,0,0,0,0,0,0,0,160, -255,255,9,76,6,0,9,16,9,0,11,1,30,128,92,192,4,0,8,0,0,0,0,0,0,0,0,0,0, -0,0,144,208,163,88,255,0,152,140,148,192,164,88,148,48,0,90,0,16,180,140, -18,22,184,92,42,0,0,18,38,160,4,58,0,144,141,130,22,80,176,89,150,208,163, -88,148,192,164,88,148,48,0,90,1,201,189,89,10,0,0,18,228,255,5,61,10,224, -5,61,0,0,0,10,58,224,125,51,145,192,164,88,8,14,173,89,149,3,173,88,16, -78,165,89,148,67,165,88,0,144,165,146,4,160,165,146,8,160,165,146,16,201, -189,89,12,160,165,146,23,240,3,90,16,160,181,140,228,255,255,17,26,224, -5,58,1,201,189,89,0,144,141,130,151,48,0,90,1,160,181,140,240,255,255,21, -0,0,0,10,0,0,0,0,0,48,240,140,112,192,0,0,30,22,136,92,0,0,240,140,0,16, -164,144,20,80,160,89,0,16,164,146,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0, -0,0,0,100,101,102,97,117,108,116,46,112,102,0,0,0,0,0,0,112,114,111,102, -105,108,101,32,99,111,108,108,101,99,116,105,111,110,32,101,114,114,111, -114,46,10,0,0,0,0,0,0,0,48,160,144,136,86,0,0,10,32,5,61,0,0,0,10,0,48, -160,144,200,92,0,0,0,48,48,140,200,92,0,0,0,30,32,92,0,0,64,140,34,32,5, -58,8,160,169,144,6,16,51,89,0,144,161,144,8,80,64,89,148,48,0,90,4,64,37, -89,232,255,255,21,0,48,128,140,128,192,0,0,182,1,136,140,28,25,0,9,144, -48,0,90,0,16,44,140,224,2,0,20,136,13,161,89,0,48,160,130,241,195,3,0,144, -13,169,89,0,48,32,130,240,195,3,0,152,13,161,89,0,48,168,130,242,195,3, -0,0,48,136,140,240,195,3,0,0,48,160,130,243,195,3,0,4,30,144,92,36,27,0, -9,18,32,36,58,158,98,1,57,144,2,0,8,0,0,0,0,0,48,160,144,200,92,0,0,0,48, -48,140,200,92,0,0,162,32,5,58,0,144,161,144,8,160,57,144,0,32,37,140,4, -192,137,89,4,96,4,90,0,16,185,140,66,0,0,19,4,208,128,89,0,208,165,144, -0,208,165,130,23,16,185,89,23,96,4,90,136,13,173,89,144,13,181,89,0,52, -172,130,254,255,255,255,152,13,165,89,0,52,180,130,255,255,255,255,0,16, -164,130,16,16,129,89,204,255,255,20,5,22,128,92,0,16,137,140,7,22,144,92, -152,26,0,9,14,192,129,58,18,98,1,57,4,2,0,8,4,192,145,89,4,160,4,90,0,16, -185,140,18,0,0,19,0,208,245,146,23,16,185,89,248,159,188,52,6,16,51,89, -0,144,161,144,104,63,5,61,0,48,72,144,136,86,0,0,8,80,64,89,136,28,170, -140,2,78,173,89,21,65,74,89,136,93,178,140,0,48,176,146,136,86,0,0,0,116, -85,140,200,92,0,0,0,48,168,128,136,86,0,0,5,22,128,92,0,48,136,140,240, -195,3,0,136,141,165,89,4,0,144,140,0,48,160,130,241,195,3,0,144,141,165, -89,152,141,181,89,0,48,160,130,242,195,3,0,0,48,176,130,243,195,3,0,0,48, -168,130,240,195,3,0,240,25,0,9,14,32,36,58,106,97,1,57,92,1,0,8,0,48,160, -144,200,92,0,0,0,48,48,140,200,92,0,0,0,30,32,92,210,32,5,58,6,16,58,89, -0,244,169,144,252,255,255,255,2,14,162,89,20,65,173,89,0,80,129,140,0,48, -168,130,240,195,3,0,0,48,136,140,240,195,3,0,4,30,144,92,136,77,165,89, -144,77,181,89,0,48,160,130,241,195,3,0,152,77,173,89,0,48,176,130,242,195, -3,0,0,48,168,130,243,195,3,0,120,25,0,9,14,32,36,58,242,96,1,57,228,0,0, -8,136,13,161,89,0,48,160,130,241,195,3,0,5,22,128,92,144,13,169,89,0,48, -32,130,240,195,3,0,152,13,161,89,0,48,168,130,242,195,3,0,0,48,136,140, -240,195,3,0,0,48,160,130,243,195,3,0,4,30,144,92,44,25,0,9,18,32,36,58, -166,96,1,57,152,0,0,8,0,0,0,0,6,16,51,89,0,144,161,144,0,208,169,144,7, -16,59,89,148,48,0,90,4,64,37,89,60,255,255,21,0,48,240,130,240,195,3,0, -0,48,240,130,241,195,3,0,5,22,128,92,0,48,240,130,242,195,3,0,0,48,136, -140,240,195,3,0,0,48,240,130,243,195,3,0,4,30,144,92,204,24,0,9,30,32,36, -61,5,22,128,92,0,48,136,140,240,195,3,0,4,30,144,92,180,24,0,9,16,32,36, -58,46,96,1,57,32,0,0,8,0,0,0,0,5,22,128,92,0,144,138,140,9,22,144,92,148, -24,0,9,38,64,130,58,14,96,1,57,5,22,128,92,164,21,0,9,2,30,128,92,0,48, -136,140,144,192,0,0,26,30,144,92,112,24,0,8,5,22,128,92,136,21,0,8,0,0, -0,0,0,48,240,140,88,196,0,0,30,22,144,92,0,0,240,140,0,48,136,144,140,86, -0,0,0,48,168,140,101,139,88,93,21,64,180,103,31,175,5,90,23,192,165,91, -20,128,165,89,31,14,165,88,0,16,133,140,0,48,160,146,140,86,0,0,0,144,4, -132,0,0,0,0,0,0,0,10,0,0,0,0,0,48,240,140,128,196,0,0,30,22,136,92,0,0, -240,140,0,48,128,146,140,86,0,0,0,80,4,132,0,0,0,0,0,0,0,10,0,0,0,0,0,0, -0,0,0,0,0,0,10,32,4,59,28,32,52,59,104,25,0,9,31,216,168,89,0,16,172,146, -0,48,128,140,255,255,255,255,0,0,0,10,16,57,128,140,252,195,3,0,0,16,164, -144,0,16,140,146,20,22,128,92,0,0,0,10,0,0,0,0,0,0,0,0,144,48,0,90,0,16, -44,140,10,0,0,22,12,32,52,59,1,25,128,89,0,0,0,10,16,57,32,144,252,195, -3,0,18,32,1,61,1,30,128,92,232,18,0,9,32,0,0,8,1,0,160,140,14,0,37,61,0, -30,128,92,0,0,0,10,16,57,240,146,252,195,3,0,0,16,1,134,0,30,128,92,5,57, -32,146,252,195,3,0,0,0,0,10,0,0,0,0,0,48,240,140,112,197,0,0,30,22,128, -92,0,0,240,140,0,48,160,140,16,196,3,0,8,32,245,146,0,16,245,146,4,32,245, -146,0,48,160,140,0,196,3,0,0,16,245,146,4,32,245,146,8,32,245,146,12,32, -245,146,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,130,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -130,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,32,96,8,140,0,116,192,178,240,255,255, -255,0,48,128,176,128,197,0,0,0,48,32,176,144,197,0,0,0,48,64,176,160,197, -0,0,0,48,128,178,144,86,0,0,0,48,128,176,192,197,0,0,0,48,192,176,176,197, -0,0,0,48,128,178,208,86,0,0,0,48,136,140,144,86,0,0,0,116,136,146,224,255, -255,255,0,48,96,176,208,197,0,0,0,48,144,140,176,86,0,0,0,116,144,146,228, -255,255,255,0,48,152,140,208,86,0,0,0,116,152,146,232,255,255,255,0,48, -160,140,240,86,0,0,0,116,128,144,232,255,255,255,12,32,245,146,8,32,133, -146,0,116,144,152,224,255,255,255,0,48,32,178,160,86,0,0,4,30,168,92,0, -16,149,154,0,48,160,140,0,87,0,0,0,48,64,178,176,86,0,0,0,48,192,178,192, -86,0,0,0,48,96,178,224,86,0,0,0,16,245,146,4,32,245,146,8,32,245,146,21, -16,169,89,12,32,245,146,149,240,4,90,16,32,165,140,228,255,255,22,0,116, -192,176,240,255,255,255,0,0,0,10,0,0,0,0,0,0,0,0,0,16,164,152,30,0,173, -51,4,32,172,144,21,80,160,89,4,32,164,146,0,80,133,128,12,0,0,8,0,0,0,0, -192,1,0,8,0,0,0,10,0,0,0,0,0,0,0,0,0,48,128,144,240,86,0,0,0,16,164,152, -30,0,173,51,4,32,172,144,21,80,160,89,4,32,164,146,0,80,133,128,12,0,0, -8,0,0,0,0,136,1,0,8,0,0,0,10,0,80,164,152,38,0,173,51,4,96,164,144,16,22, -168,92,255,0,184,140,20,80,176,89,149,192,173,88,4,96,180,146,0,16,133, -130,12,0,0,8,248,2,0,9,16,22,168,92,21,22,128,92,0,0,0,10,0,0,0,0,0,0,0, -0,0,48,136,144,244,86,0,0,0,80,164,152,38,0,173,51,4,96,164,144,16,22,168, -92,255,0,184,140,20,80,176,89,149,192,173,88,4,96,180,146,0,16,133,130, -12,0,0,8,176,2,0,9,16,22,168,92,21,22,128,92,0,0,0,10,0,48,240,140,232, -199,0,0,30,22,136,92,0,0,240,140,16,32,164,136,0,48,168,140,207,255,255, -255,148,64,165,88,16,32,164,138,0,80,4,132,0,0,0,10,0,0,0,0,0,48,240,140, -24,200,0,0,30,22,136,92,0,0,240,140,16,32,164,128,14,32,37,48,1,30,128, -92,0,80,4,132,0,30,128,92,0,80,4,132,0,0,0,10,0,0,0,0,0,48,240,140,72,200, -0,0,30,22,136,92,0,0,240,140,16,32,164,128,14,32,45,48,1,30,128,92,0,80, -4,132,0,30,128,92,0,80,4,132,0,0,0,10,0,0,0,0,0,48,240,140,152,200,0,0, -30,22,144,92,0,0,240,140,144,48,0,90,0,80,180,140,10,0,0,18,14,96,4,61, -0,30,128,92,0,144,4,132,1,9,172,89,0,144,165,128,21,80,168,89,1,160,181, -140,0,80,165,130,240,63,5,61,0,144,4,132,0,0,0,0,0,0,0,10,0,0,0,0,0,48, -240,140,184,200,0,0,30,22,128,92,0,0,240,140,0,16,4,132,0,0,0,0,0,0,0,10, -0,0,0,0,16,16,180,89,0,144,173,136,16,22,32,92,3,1,152,140,149,192,164, -88,136,25,152,88,10,192,164,61,128,73,173,88,113,0,152,140,149,192,164, -88,0,144,173,138,14,32,13,58,1,25,128,89,0,0,0,10,8,32,164,144,30,32,5, -61,144,10,0,9,22,32,4,62,16,32,161,136,133,9,165,88,168,0,0,8,0,0,0,0,0, -48,128,152,240,86,0,0,22,0,36,61,16,96,164,128,14,32,61,48,17,22,128,92, -96,3,0,9,204,20,0,9,4,16,50,89,1,25,56,89,0,16,44,140,16,32,161,128,18, -32,129,128,1,30,144,92,0,144,177,152,10,32,21,55,23,22,144,92,22,22,136, -92,80,18,0,9,14,192,129,61,0,80,161,144,216,63,37,58,8,32,81,144,1,25,152, -89,144,224,4,90,0,144,74,140,10,22,64,92,10,0,0,18,10,0,68,89,0,16,65,146, -4,32,81,146,14,192,132,58,26,32,4,58,44,0,0,8,16,32,161,136,133,9,165,88, -16,0,0,8,0,0,0,0,16,32,161,136,132,9,165,88,1,25,128,89,16,32,161,138,0, -0,0,10,0,0,0,0,4,32,169,144,21,80,160,89,4,32,161,146,0,80,133,128,0,0, -0,10,0,0,0,0,0,48,240,140,248,201,0,0,30,22,128,92,0,0,240,140,0,16,4,132, -0,0,0,0,0,0,0,10,0,0,0,0,0,48,32,140,240,86,0,0,0,30,40,92,0,16,129,144, -10,32,4,58,252,1,0,9,4,32,129,144,10,32,4,58,240,1,0,9,8,32,129,144,10, -32,4,58,228,1,0,9,12,32,129,144,10,32,4,58,216,1,0,9,16,32,129,144,10,32, -4,58,204,1,0,9,5,80,41,89,133,240,4,90,20,32,33,140,184,255,255,22,0,0, -0,10,0,0,0,0,16,96,180,128,16,22,56,92,0,80,36,140,38,160,53,48,4,96,164, -144,255,0,232,140,20,80,168,89,135,64,183,88,4,96,172,146,0,16,133,130, -22,22,128,92,0,0,0,10,17,16,188,89,0,208,173,136,2,1,232,140,149,64,167, -88,136,25,232,88,30,64,167,61,18,160,5,55,129,73,173,88,16,0,0,8,0,0,0, -0,10,160,37,48,21,211,172,88,31,216,232,89,149,64,167,88,0,208,173,138, -14,32,21,58,1,25,128,89,0,0,0,10,8,96,164,144,30,32,5,61,17,22,128,92,172, -8,0,9,18,32,4,62,1,25,128,89,0,0,0,10,0,0,0,0,16,32,161,128,132,0,232,140, -148,64,167,88,92,32,5,58,16,32,161,128,30,32,21,48,4,32,169,144,21,80,160, -89,0,0,48,140,4,32,161,146,0,80,61,130,64,0,0,8,0,16,129,176,18,192,164, -89,50,0,141,51,4,32,161,144,255,0,232,140,135,64,175,88,1,32,181,140,149, -176,2,90,4,32,177,146,0,16,61,130,174,0,0,21,0,30,48,92,12,0,0,8,0,0,0, -0,1,30,48,92,0,16,161,176,22,65,45,89,70,96,1,58,18,32,129,128,8,32,137, -144,5,22,144,92,244,16,0,9,50,64,129,58,16,32,161,136,8,32,113,144,1,25, -128,89,133,9,165,88,0,144,107,140,14,22,96,92,16,32,161,138,0,16,113,146, -4,32,113,146,0,0,0,10,0,0,0,0,16,32,161,128,8,32,81,152,132,0,232,140,148, -64,167,88,148,48,0,90,0,144,74,140,10,22,160,92,10,0,0,21,10,192,162,89, -20,22,64,92,0,16,161,146,255,0,232,140,134,64,167,88,4,32,81,146,22,32, -5,58,4,32,169,144,21,80,160,89,4,32,161,146,0,80,61,130,135,64,135,88,0, -0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,22,32,92,68,8,0,11,144,48,0,90,0,16,44, -140,18,0,0,21,1,25,128,89,0,0,0,10,0,0,0,0,0,48,168,140,240,86,0,0,21,1, -164,89,130,13,165,89,10,32,21,59,0,16,244,146,4,22,128,92,68,0,0,9,18,32, -129,128,60,13,0,9,18,32,4,58,1,25,128,89,0,0,0,10,0,0,0,0,16,32,161,128, -14,32,29,48,8,32,129,144,244,3,0,11,0,80,161,144,14,32,5,61,4,22,128,92, -228,3,0,11,0,30,128,92,0,0,0,10,16,32,164,128,16,22,40,92,18,32,45,48,1, -25,128,89,0,0,0,10,0,0,0,0,26,32,13,55,8,32,164,144,122,32,5,58,0,16,164, -146,4,32,164,146,108,0,0,8,50,32,21,55,0,16,164,176,22,65,37,89,38,32,1, -58,18,32,132,128,8,96,137,144,4,22,144,92,148,15,0,9,18,0,129,58,1,25,128, -89,0,0,0,10,0,0,0,0,8,96,161,144,54,32,5,58,16,96,161,128,8,96,81,152,132, -0,152,140,148,192,164,88,148,48,0,90,0,144,74,140,10,22,160,92,10,0,0,21, -10,192,162,89,20,22,64,92,0,80,161,146,4,96,81,146,0,30,128,92,0,0,0,10, -26,32,28,51,16,208,128,89,4,25,144,89,144,128,132,88,12,0,0,8,0,0,0,0,4, -30,128,92,16,48,2,90,16,0,56,140,10,0,0,17,16,22,56,92,7,17,48,89,4,32, -68,140,7,208,73,89,0,0,40,140,0,48,160,144,32,196,3,0,54,32,5,61,8,30,128, -92,212,10,0,9,4,25,144,89,3,32,132,140,144,128,132,88,4,32,132,140,0,48, -128,146,32,196,3,0,0,48,128,146,36,196,3,0,0,52,244,146,252,255,255,255, -0,48,128,144,40,196,3,0,0,30,136,92,178,32,4,58,7,60,164,140,255,255,255, -255,148,128,169,88,0,96,173,140,0,52,188,144,252,255,255,255,18,0,172,58, -16,64,162,89,148,128,169,88,0,96,173,140,21,0,178,89,116,192,181,49,22, -0,172,58,0,116,189,146,252,255,255,255,0,52,172,146,252,255,255,255,22, -16,161,89,34,192,165,51,0,180,189,146,252,255,255,255,0,116,181,146,252, -255,255,255,0,16,164,144,0,144,165,146,0,16,180,146,0,48,160,144,32,196, -3,0,182,0,173,52,34,0,172,61,18,96,4,58,0,16,164,144,0,80,164,146,16,0, -0,8,0,16,164,144,0,48,160,146,40,196,3,0,21,22,128,92,0,0,0,10,0,0,0,0, -16,22,136,92,0,16,132,144,88,63,4,61,0,48,168,144,36,196,3,0,0,48,144,140, -0,252,255,255,21,60,162,140,19,4,0,0,148,128,36,88,0,32,33,140,18,64,37, -52,4,22,128,92,148,10,0,9,16,32,4,58,0,30,160,92,48,0,0,8,0,0,0,0,0,48, -128,144,36,196,3,0,0,52,36,146,252,255,255,255,0,52,241,146,252,255,255, -255,176,1,0,11,1,30,160,92,0,48,32,146,36,196,3,0,22,32,5,58,5,80,40,89, -16,78,161,89,144,25,144,88,148,158,164,62,0,30,128,92,0,0,0,10,0,0,0,0, -0,0,0,0,0,0,0,0,144,48,0,90,0,16,60,140,14,0,0,21,17,22,128,92,48,254,255, -8,22,96,28,51,17,208,136,89,4,25,152,89,145,192,44,88,8,0,0,8,4,30,40,92, -5,48,2,90,16,0,184,140,10,0,0,17,5,22,184,92,0,52,180,144,252,255,255,255, -0,48,160,144,40,196,3,0,5,16,137,89,0,0,168,140,16,129,53,89,86,32,5,58, -82,128,165,49,66,128,165,61,0,180,165,144,252,255,255,255,0,52,164,146, -252,255,255,255,149,48,0,90,0,144,165,144,14,0,0,18,0,80,165,146,12,0,0, -8,0,48,160,146,40,196,3,0,0,52,180,144,252,255,255,255,20,0,0,8,0,0,0,0, -20,22,168,92,0,16,165,144,180,63,5,61,23,17,168,89,23,60,164,140,255,255, -255,255,148,64,165,88,0,32,165,140,58,0,164,61,16,64,36,89,50,128,37,49, -4,16,161,89,30,128,165,51,0,52,177,146,252,255,255,255,0,52,36,146,252, -255,255,255,4,22,128,92,144,0,0,11,7,22,128,92,0,0,0,10,0,0,0,0,5,22,128, -92,68,253,255,9,144,48,0,90,0,16,36,140,18,0,0,21,0,30,128,92,0,0,0,10, -0,0,0,0,10,64,49,54,5,22,48,92,7,22,128,92,0,16,137,140,6,22,144,92,212, -2,0,9,7,22,128,92,68,0,0,11,4,22,128,92,0,0,0,10,144,64,36,112,0,16,129, -140,248,252,255,9,144,48,0,90,0,16,44,140,14,0,0,21,0,30,128,92,0,0,0,10, -4,22,136,92,204,238,255,9,5,22,128,92,0,0,0,10,0,48,240,140,8,209,0,0,30, -22,136,92,0,0,240,140,10,32,4,61,0,80,4,132,0,48,168,144,40,196,3,0,0,30, -176,92,22,96,5,58,18,64,133,52,21,22,176,92,0,80,173,144,244,127,5,61,0, -16,172,146,14,160,5,58,0,144,133,146,12,0,0,8,0,48,128,146,40,196,3,0,42, -96,5,58,0,52,164,144,252,255,255,255,30,64,165,61,0,116,165,144,252,255, -255,255,0,52,164,146,252,255,255,255,0,80,165,144,0,16,164,146,42,160,5, -58,0,180,165,144,252,255,255,255,30,0,164,61,0,52,164,144,252,255,255,255, -0,180,165,146,252,255,255,255,0,16,164,144,0,144,165,146,0,80,4,132,0,0, -0,0,0,0,0,10,0,0,0,0,16,96,4,90,0,16,36,140,17,22,184,92,1,137,164,89,17, -0,181,89,16,0,173,89,10,0,0,20,28,128,133,54,10,64,172,52,20,128,173,54, -120,0,0,9,4,22,128,92,0,0,0,10,0,0,0,0,50,64,132,51,1,137,148,89,1,25,152, -89,78,192,148,58,0,208,165,128,23,80,184,89,1,137,148,89,146,224,4,90,0, -16,161,130,4,80,32,89,232,255,255,21,44,0,0,8,1,137,148,89,1,25,152,89, -34,192,148,58,0,144,165,128,1,137,181,89,1,137,148,89,146,224,4,90,0,80, -165,130,1,73,173,89,232,255,255,21,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,144, -67,164,88,148,208,163,88,255,0,32,140,148,0,161,88,148,48,0,90,0,16,156, -140,17,22,184,92,0,144,180,140,16,22,232,92,70,0,0,21,4,140,156,89,34,224, -4,59,0,80,164,176,1,201,156,89,16,96,140,140,147,48,0,90,0,80,167,178,29, -16,236,89,232,255,255,17,146,208,179,88,150,48,0,90,0,80,159,140,17,22, -184,92,14,0,0,21,0,0,0,10,0,0,0,0,147,195,165,88,148,208,161,88,148,0,161, -88,46,32,5,61,34,160,61,51,0,208,165,152,8,137,181,89,22,240,1,90,0,208, -164,154,19,16,154,89,8,224,189,140,232,255,255,17,10,160,5,61,0,0,0,10, -147,195,165,88,148,208,160,88,148,0,161,88,46,32,5,61,34,160,29,51,0,208, -165,144,4,137,181,89,22,240,0,90,0,208,164,146,19,16,153,89,4,224,189,140, -232,255,255,17,10,160,5,61,0,0,0,10,147,195,165,88,46,32,5,55,34,160,13, -51,0,208,165,136,2,137,181,89,22,112,0,90,0,208,164,138,19,144,152,89,2, -224,189,140,232,255,255,17,10,160,5,61,0,0,0,10,1,137,181,89,1,25,32,89, -34,0,177,58,0,208,165,128,23,80,184,89,1,137,181,89,150,32,1,90,0,208,164, -130,19,80,152,89,232,255,255,21,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,17,32, -4,90,0,16,236,140,17,22,152,92,0,16,188,140,1,137,164,89,16,0,181,89,17, -0,173,89,10,0,0,20,24,128,141,54,10,0,172,52,16,128,173,54,17,22,128,92, -0,80,143,140,140,254,255,8,50,0,140,51,1,137,148,89,1,25,32,89,34,0,145, -58,0,208,165,128,23,80,184,89,1,137,148,89,146,32,1,90,0,208,164,130,19, -80,152,89,232,255,255,21,0,0,0,10,1,137,148,89,1,25,32,89,34,0,145,58,0, -144,165,128,1,137,181,89,1,137,148,89,146,32,1,90,0,80,165,130,1,73,173, -89,232,255,255,21,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,32,164,128,16,22, -64,92,34,32,21,48,16,208,164,89,0,16,181,140,16,16,130,89,1,0,184,140,0, -16,164,146,4,32,188,146,80,0,0,8,138,25,128,88,116,249,255,9,8,32,130,146, -14,32,4,61,1,25,128,89,0,0,0,10,16,32,162,136,131,9,165,88,16,32,162,138, -16,32,162,128,138,25,168,88,12,32,170,146,30,32,5,55,18,32,130,128,96,6, -0,9,18,32,4,58,16,32,162,136,135,9,165,88,16,32,162,138,16,32,162,128,0, -16,34,176,46,32,13,48,132,0,168,140,148,64,165,88,148,48,0,90,0,144,41, -140,6,22,160,92,10,0,0,21,6,192,161,89,20,22,32,92,16,0,0,8,0,0,0,0,6,22, -40,92,0,144,33,140,0,16,34,146,7,22,128,92,4,32,50,146,0,0,0,10,0,48,240, -140,160,212,0,0,30,22,136,92,0,0,240,140,0,48,160,144,240,86,0,0,20,30, -176,92,0,48,168,140,240,86,0,0,26,0,164,58,1,137,181,89,30,160,5,57,21, -16,169,89,0,80,165,144,240,31,164,61,21,22,128,92,0,80,4,132,0,0,0,0,0, -30,128,92,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22, -32,92,0,48,128,140,48,196,3,0,138,25,136,88,220,2,0,9,16,22,160,92,148, -48,0,90,36,0,0,19,0,30,160,92,64,224,167,146,0,48,160,140,64,87,0,0,68, -224,167,146,0,30,160,92,72,224,167,146,20,0,0,8,64,224,135,140,0,48,136, -140,48,196,3,0,32,0,0,9,72,224,167,144,0,48,160,146,0,201,3,0,64,224,135, -176,0,0,0,10,0,0,0,10,0,0,0,0,32,96,8,140,30,22,32,92,64,224,135,146,68, -224,143,146,68,224,135,144,28,2,0,9,16,22,160,92,68,224,175,144,20,64,165, -89,1,32,173,140,76,224,175,146,64,224,167,144,0,30,168,92,0,16,173,146, -64,224,167,144,0,48,168,140,48,200,3,0,4,32,173,146,68,224,167,144,72,224, -167,146,72,224,167,144,0,16,173,128,149,48,0,90,52,1,0,18,64,224,167,144, -0,16,173,144,149,176,4,90,36,1,0,17,72,224,167,144,0,16,173,128,149,48, -0,90,92,0,0,18,72,224,167,144,0,16,173,128,31,88,184,89,149,224,5,90,56, -0,0,18,72,224,167,144,0,16,173,128,149,112,2,90,40,0,0,18,72,224,167,144, -0,16,173,128,149,112,3,90,24,0,0,18,72,224,167,144,0,16,173,128,149,176, -2,90,8,0,0,18,20,0,0,8,72,224,167,144,20,80,168,89,72,224,175,146,156,255, -255,8,72,224,167,144,0,16,173,128,149,48,0,90,168,0,0,18,64,224,175,144, -0,80,165,144,20,80,176,89,0,80,181,146,72,224,175,144,20,57,168,146,48, -200,3,0,72,224,167,144,0,16,173,128,149,48,0,90,88,0,0,18,72,224,167,144, -0,16,173,128,31,88,184,89,149,224,5,90,68,0,0,18,72,224,167,144,0,16,173, -128,149,112,2,90,52,0,0,18,72,224,167,144,0,16,173,128,149,112,3,90,36, -0,0,18,72,224,167,144,0,16,173,128,149,176,2,90,20,0,0,18,72,224,167,144, -20,80,168,89,72,224,175,146,160,255,255,8,72,224,167,144,0,16,173,128,149, -48,0,90,24,0,0,18,72,224,167,144,20,80,168,89,72,224,175,146,0,30,168,92, -0,16,173,130,196,254,255,8,64,224,167,144,0,16,173,144,0,30,160,92,21,57, -160,146,48,200,3,0,0,30,160,92,80,224,167,146,76,224,167,144,0,16,173,128, -149,48,0,90,72,0,0,18,80,224,167,144,148,48,7,90,60,0,0,17,80,224,167,144, -20,80,168,89,80,224,175,146,76,224,175,144,20,57,168,146,128,200,3,0,76, -224,135,144,76,0,0,9,16,22,160,92,1,32,173,140,76,224,167,144,21,0,173, -89,76,224,175,146,176,255,255,8,80,224,167,144,0,30,168,92,20,57,168,146, -128,200,3,0,64,224,167,144,0,48,168,140,128,200,3,0,8,32,173,146,0,0,0, -10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,160,92,64,224,135,146,0,30, -168,92,68,224,175,146,64,224,175,144,21,80,176,89,64,224,183,146,0,80,173, -128,149,48,0,90,20,0,0,18,68,224,175,144,21,80,176,89,68,224,183,146,220, -255,255,8,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,30, -22,32,92,16,22,40,92,17,22,48,92,242,0,56,140,64,224,63,146,5,22,128,92, -6,22,136,92,7,48,0,102,16,22,72,92,68,224,79,146,68,224,135,144,0,0,0,10, -0,0,0,10,0,0,0,10,0,0,0,0,16,72,8,89,30,22,32,92,64,224,135,146,64,224, -135,144,16,0,0,9,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,16,22, -40,92,1,1,48,140,64,224,55,146,5,22,128,92,6,48,0,102,0,0,0,10,0,0,0,10, -0,0,0,0,0,0,0,0,0,0,0,0,30,22,160,92,0,48,168,140,112,202,3,0,0,48,168, -146,16,201,3,0,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,64,224,135, -146,64,224,167,144,148,48,0,90,16,0,0,21,0,48,128,144,16,201,3,0,0,0,0, -10,0,48,160,144,16,201,3,0,20,208,43,89,16,25,176,89,133,128,45,88,5,22, -160,92,0,32,45,140,64,224,175,144,1,73,165,89,5,0,53,89,0,48,160,144,16, -201,3,0,5,32,5,90,32,0,0,20,6,96,1,90,24,0,0,20,0,48,176,140,111,218,3, -0,6,160,5,90,8,0,0,17,36,0,0,8,56,5,0,9,16,22,160,92,20,22,168,92,12,30, -160,92,0,80,165,146,0,48,128,140,255,255,255,255,0,0,0,10,6,80,160,89,0, -48,160,146,16,201,3,0,0,48,160,144,16,201,3,0,20,160,1,90,20,0,0,19,0,48, -160,140,111,218,3,0,0,48,160,146,16,201,3,0,5,22,128,92,0,0,0,10,0,0,0, -10,16,72,8,89,30,22,32,92,64,224,135,146,64,224,167,144,0,48,176,140,112, -202,3,0,20,160,5,90,32,0,0,20,64,224,175,144,1,73,165,89,0,48,176,140,111, -218,3,0,20,160,5,90,8,0,0,17,32,0,0,8,164,4,0,9,16,22,160,92,20,22,168, -92,12,30,160,92,0,80,165,146,1,25,128,89,0,0,0,10,64,224,167,144,0,48,160, -146,16,201,3,0,0,30,128,92,0,0,0,10,0,0,0,10,16,72,8,89,30,22,32,92,64, -224,135,146,64,224,135,144,64,0,0,9,68,224,135,146,68,224,167,144,148,48, -0,90,32,0,0,18,76,4,0,9,16,22,160,92,20,22,168,92,68,224,167,144,0,80,165, -146,1,25,128,89,0,0,0,10,0,30,128,92,0,0,0,10,0,0,0,10,0,0,0,0,16,72,8, -89,30,22,32,92,16,22,40,92,234,0,48,140,64,224,55,146,5,22,128,92,6,48, -0,102,16,22,64,92,68,224,71,146,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0, -10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,64,224,135,146,68,224, -143,146,64,224,135,144,1,3,136,140,68,224,151,144,180,0,0,9,0,0,0,10,0, -0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,64,224,135,146,68,224,167, -140,64,224,135,144,20,22,136,92,72,0,0,9,72,224,135,146,72,224,167,144, -148,48,0,90,32,0,0,18,132,3,0,9,16,22,160,92,20,22,168,92,72,224,167,144, -0,80,165,146,1,25,128,89,0,0,0,10,68,224,135,144,0,0,0,10,0,0,0,10,0,0, -0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,16,22,40,92,17,22,48,92,235, -0,56,140,64,224,63,146,5,22,128,92,6,22,136,92,7,48,0,102,16,22,72,92,68, -224,79,146,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,0,32,96,8,140, -30,22,32,92,64,224,135,146,68,224,143,146,72,224,151,146,76,224,167,140, -64,224,135,144,68,224,143,144,72,224,151,144,20,22,152,92,72,0,0,9,80,224, -135,146,80,224,167,144,148,48,0,90,32,0,0,18,212,2,0,9,16,22,160,92,20, -22,168,92,80,224,167,144,0,80,165,146,1,25,128,89,0,0,0,10,76,224,135,144, -0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,16,22, -40,92,17,22,48,92,18,22,56,92,19,22,64,92,230,0,72,140,64,224,79,146,5, -22,128,92,6,22,136,92,7,22,144,92,8,22,152,92,9,48,0,102,16,22,88,92,68, -224,95,146,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,0,32,96,8,140, -30,22,32,92,64,224,135,146,68,224,143,146,72,224,151,146,76,224,167,140, -64,224,135,144,68,224,143,144,72,224,151,144,20,22,152,92,72,0,0,9,80,224, -135,146,80,224,167,144,148,48,0,90,32,0,0,18,20,2,0,9,16,22,160,92,20,22, -168,92,80,224,167,144,0,80,165,146,1,25,128,89,0,0,0,10,76,224,135,144, -0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,16,22, -40,92,17,22,48,92,18,22,56,92,19,22,64,92,231,0,72,140,64,224,79,146,5, -22,128,92,6,22,136,92,7,22,144,92,8,22,152,92,9,48,0,102,16,22,88,92,68, -224,95,146,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,0,32,96,8,140, -30,22,32,92,64,224,135,146,68,224,143,146,72,224,151,146,76,224,167,140, -64,224,135,144,68,224,143,144,72,224,151,144,20,22,152,92,72,0,0,9,80,224, -135,146,80,224,167,144,148,48,0,90,32,0,0,18,84,1,0,9,16,22,160,92,20,22, -168,92,80,224,167,144,0,80,165,146,1,25,128,89,0,0,0,10,76,224,135,144, -0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8,89,30,22,32,92,16,22, -40,92,17,22,48,92,18,22,56,92,19,22,64,92,232,0,72,140,64,224,79,146,5, -22,128,92,6,22,136,92,7,22,144,92,8,22,152,92,9,48,0,102,16,22,88,92,68, -224,95,146,68,224,135,144,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,0,30,22,32,92, -252,250,255,9,0,0,0,10,0,0,0,0,16,72,8,89,30,22,160,92,64,224,135,146,0, -48,128,140,32,201,3,0,0,0,0,10,0,0,0,10,0,0,0,0,16,72,8,89,30,22,160,92, -64,224,135,146,0,48,128,140,176,201,3,0,0,0,0,10,0,0,0,10,0,0,0,0,16,72, -8,89,30,22,160,92,64,224,135,146,0,48,128,140,16,202,3,0,0,0,0,10,0,0,0, -10,0,0,0,0,30,22,160,92,0,48,128,140,32,201,3,0,0,0,0,10,0,0,0,10,0,0,0, -0,0,0,0,0,0,0,0,0,30,22,160,92,0,48,128,140,176,201,3,0,0,0,0,10,0,0,0, -10,0,0,0,0,0,0,0,0,0,0,0,0,30,22,160,92,0,48,128,140,16,202,3,0,0,0,0,10, -0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,30,22,160,92,0,48,128,140,16,202,3,0,0, -0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,30,22,32,92,16,22,40,92,4,96,161, -144,0,80,169,144,20,96,5,90,24,0,0,19,4,96,161,144,20,80,168,89,4,96,169, -146,0,16,133,128,12,0,0,8,5,22,128,92,112,234,255,9,0,0,0,10,0,0,0,10,0, -0,0,10,30,22,32,92,16,22,40,92,17,22,48,92,4,160,161,144,0,144,169,144, -20,96,5,90,36,0,0,19,4,160,161,144,20,80,168,89,4,160,169,146,5,22,168, -92,0,16,173,130,255,0,176,140,149,128,133,88,16,0,0,8,5,22,128,92,6,22, -136,92,188,235,255,9,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, -30,22,32,92,108,254,255,9,0,0,0,10,0,0,0,0,30,22,160,92,0,0,0,10,0,0,0, -0,0,0,0,0,30,22,160,92,1,25,136,89,145,2,132,100,0,0,0,10,144,48,0,90,19, -4,32,140,86,0,0,20,16,22,40,92,133,16,96,100,66,0,0,16,12,17,101,89,140, -48,0,90,18,0,0,20,12,70,137,89,0,30,128,92,20,0,0,8,12,17,104,89,13,68, -137,89,32,32,107,140,13,70,129,89,20,78,140,88,12,1,33,89,20,14,33,89,132, -67,140,88,0,0,0,10,0,30,128,93,248,255,255,8,16,17,40,89,133,16,96,100, -12,17,101,89,140,48,0,90,18,0,0,20,12,70,137,89,0,30,128,92,20,0,0,8,12, -17,104,89,13,68,137,89,32,32,107,140,13,70,129,89,20,78,140,88,12,1,33, -89,20,14,33,89,132,67,140,88,159,73,140,88,176,255,255,8,1,78,36,89,21, -12,33,89,19,4,104,140,4,65,107,89,32,96,99,140,140,48,0,90,46,0,0,22,145, -48,0,90,50,0,0,20,141,48,5,90,34,0,0,17,12,4,132,89,12,6,132,89,141,48, -0,90,14,0,0,22,13,68,140,89,13,70,140,89,0,0,0,10,0,30,128,93,248,255,255, -8,141,48,5,90,58,0,0,17,0,56,0,90,16,17,128,91,17,17,136,91,12,4,132,89, -12,6,132,89,141,48,0,90,14,0,0,22,13,68,140,89,13,70,140,89,0,56,0,90,16, -17,128,91,17,17,136,91,188,255,255,8,0,48,136,140,0,0,240,191,0,30,128, -92,172,255,255,8,1,78,36,89,0,48,96,140,0,0,224,255,4,32,3,90,106,0,0,17, -21,12,33,89,10,78,44,89,158,73,41,88,31,78,41,88,22,12,100,89,133,3,43, -88,145,48,0,90,29,4,96,140,38,0,0,20,4,32,3,90,4,1,35,89,14,0,0,17,4,68, -129,89,0,0,0,10,1,25,128,89,31,14,132,88,244,255,255,8,4,32,3,90,4,1,35, -89,18,0,0,17,5,17,40,89,132,69,129,89,220,255,255,8,31,94,128,89,212,255, -255,8,0,30,128,93,204,255,255,8,1,78,36,89,0,48,96,140,0,0,224,255,4,32, -3,90,106,0,0,17,21,12,33,89,10,78,44,89,158,73,41,88,31,78,41,88,22,12, -100,89,133,3,43,88,145,48,0,90,29,4,96,140,38,0,0,20,4,32,3,90,4,1,35,89, -14,0,0,17,4,68,129,89,0,0,0,10,1,25,128,89,31,14,132,88,244,255,255,8,4, -32,3,90,4,1,35,89,18,0,0,17,4,68,41,89,5,17,128,89,220,255,255,8,31,94, -128,89,212,255,255,8,0,30,128,92,204,255,255,8,1,78,36,89,0,48,96,140,0, -0,224,255,4,32,3,90,66,0,0,17,21,12,33,89,11,78,44,89,159,73,41,88,21,12, -100,89,133,3,43,88,145,48,0,90,38,0,0,20,30,4,96,140,4,32,3,90,18,0,0,17, -4,1,35,89,4,68,129,89,0,0,0,10,1,25,128,89,248,255,255,8,0,30,128,92,240, -255,255,8,1,78,36,89,0,48,96,140,255,255,223,255,12,32,1,90,4,49,0,90,82, -0,0,22,21,12,33,89,128,3,96,140,12,1,33,89,255,0,96,140,4,32,3,90,46,0, -0,19,23,14,33,89,12,78,44,89,9,76,41,89,132,67,33,88,29,12,44,89,28,47, -4,90,5,0,129,91,31,111,4,90,159,15,132,88,0,0,0,10,132,48,0,90,48,0,0,20, -24,0,0,8,42,0,0,18,0,48,96,140,0,0,224,255,4,32,3,90,18,0,0,17,0,48,128, -140,0,0,128,127,204,255,255,8,1,25,128,89,204,255,255,8,0,30,128,92,188, -255,255,8,31,12,84,89,31,142,82,89,1,14,36,89,0,48,96,140,255,255,255,254, -12,32,1,90,4,49,0,90,58,0,0,22,24,12,33,89,0,48,96,140,128,252,255,255, -12,1,33,89,20,14,33,89,9,14,44,89,12,76,41,89,132,67,137,88,29,14,132,89, -145,131,138,88,0,0,0,10,0,30,128,93,244,255,255,8,250,255,255,18,0,48,96, -140,0,0,0,255,12,32,1,90,22,0,0,20,0,48,136,140,0,0,240,127,0,30,128,92, -208,255,255,8,1,25,128,89,1,25,136,89,200,255,255,8,15,140,84,89,31,142, -82,89,17,142,36,89,17,12,33,89,31,111,4,90,90,0,0,16,0,48,96,140,0,60,0, -0,12,1,33,89,255,7,96,140,4,32,3,90,46,0,0,19,31,78,140,88,11,76,60,89, -21,78,52,89,20,14,33,89,135,3,137,88,10,47,4,90,11,12,132,89,6,0,132,91, -138,67,140,88,0,0,0,10,34,0,0,17,0,48,136,140,0,0,240,127,0,30,128,92,232, -255,255,8,144,67,140,88,17,48,0,90,220,255,255,18,1,25,128,89,1,25,136, -89,212,255,255,8,31,72,84,88,8,0,0,8,31,78,84,88,1,78,36,89,0,48,96,140, -0,0,224,255,4,32,3,90,10,0,0,17,10,22,136,92,0,0,0,10,16,22,24,92,0,30, -48,93,0,30,64,93,0,30,80,93,47,0,144,140,57,0,152,140,3,206,57,88,0,16, -36,128,1,8,132,89,19,32,1,90,4,161,4,90,134,0,0,22,143,8,33,88,4,239,1, -90,82,0,0,18,8,22,112,93,2,78,74,89,30,12,106,89,2,14,66,89,137,67,75,88, -0,120,0,90,14,0,66,91,15,64,74,91,8,0,66,91,9,64,74,91,4,0,66,91,0,72,74, -91,9,193,123,88,143,48,0,90,254,1,0,20,134,201,57,88,2,239,1,90,0,136,49, -91,148,255,255,8,10,22,88,92,2,142,82,89,11,128,82,89,1,142,82,89,4,128, -82,89,10,193,90,88,139,48,0,90,214,1,0,20,135,201,57,88,108,255,255,8,46, -0,88,140,4,224,2,90,234,1,0,18,45,0,88,140,4,224,2,90,238,1,0,18,43,0,88, -140,4,224,2,90,6,2,0,18,69,0,88,140,5,14,97,88,12,224,2,90,14,2,0,18,68, -0,88,140,12,224,2,90,2,2,0,18,3,1,28,89,1,201,24,89,0,80,28,146,6,239,1, -90,102,1,0,16,144,0,96,140,135,0,99,88,16,40,3,90,86,1,0,18,5,239,1,90, -8,0,0,16,10,17,80,89,6,129,82,89,54,1,96,140,12,17,104,89,1,73,107,89,140, -160,2,90,138,97,3,90,58,1,0,22,255,3,32,140,137,16,112,100,32,0,0,18,136, -16,112,100,54,1,0,16,14,209,119,89,14,6,74,89,0,30,64,92,32,160,115,140, -28,0,0,8,1,136,123,89,14,209,119,89,15,4,122,89,14,6,66,89,14,70,74,89, -143,67,74,88,14,1,33,89,0,48,40,140,0,88,0,0,138,48,0,90,18,0,0,19,0,48, -40,140,176,89,0,0,10,17,80,89,143,136,90,88,139,93,97,152,13,64,114,103, -12,64,146,103,0,120,0,90,14,192,116,91,15,16,120,91,13,0,146,103,14,192, -116,91,15,16,120,91,11,125,89,144,128,0,0,0,132,192,34,89,4,140,90,89,139, -125,65,152,192,0,0,0,15,64,98,103,14,64,146,103,0,120,0,90,12,192,100,91, -13,16,104,91,15,0,146,103,12,192,100,91,13,16,104,91,11,125,89,144,96,1, -0,0,132,192,34,89,63,32,33,140,31,111,3,90,20,0,0,18,12,0,99,91,13,64,107, -91,1,9,33,89,236,255,255,8,132,48,0,90,90,0,0,20,12,22,88,92,31,78,107, -88,11,12,131,89,21,78,115,89,11,76,139,89,142,3,132,88,20,14,33,89,145, -3,137,88,10,239,2,90,0,8,132,91,0,72,140,91,1,239,1,90,159,79,140,88,0, -0,0,10,1,25,128,89,1,25,136,89,244,255,255,8,16,0,0,18,28,0,0,8,5,239,1, -90,22,0,0,16,0,30,128,93,212,255,255,8,138,48,0,90,244,255,255,20,0,48, -136,140,0,0,240,127,0,30,128,92,188,255,255,8,2,239,1,90,194,255,255,18, -130,201,57,88,108,253,255,8,1,9,100,89,12,224,0,90,14,0,0,21,129,201,57, -88,88,253,255,8,3,239,1,90,158,255,255,16,133,201,57,88,72,253,255,8,1, -9,100,89,12,224,0,90,62,253,255,18,3,239,1,90,54,253,255,18,124,255,255, -8,4,239,1,90,118,255,255,18,132,201,57,88,131,201,57,88,32,253,255,8,0, -0,0,0,0,48,96,140,0,0,224,255,1,78,36,89,12,32,1,90,202,4,0,22,21,12,33, -89,32,0,96,140,145,48,0,90,8,0,0,19,45,0,96,140,0,144,100,130,1,136,148, -89,51,4,96,140,12,1,49,89,16,22,32,92,11,78,44,89,11,76,41,89,148,73,41, -88,1,78,100,89,144,3,99,88,12,48,0,90,12,0,0,21,0,30,32,93,0,30,48,92,0, -48,96,140,151,117,0,0,140,128,57,116,0,48,96,140,160,134,1,0,1,12,107,89, -159,205,113,89,14,67,107,88,7,64,59,89,140,197,57,116,7,22,24,92,134,48, -0,90,10,2,0,19,9,30,96,92,140,192,105,89,141,48,0,90,8,0,0,22,135,17,96, -89,140,192,57,89,12,57,104,144,160,92,0,0,5,64,83,103,4,64,35,103,0,120, -0,90,10,64,41,91,0,200,90,91,139,16,96,100,54,0,0,16,12,128,49,89,1,136, -49,89,12,4,33,89,0,47,1,90,1,12,33,89,12,68,81,89,1,140,82,89,12,209,103, -89,12,70,41,89,4,64,33,91,12,198,90,89,10,192,42,91,135,48,0,90,146,255, -255,20,6,48,0,90,38,0,0,18,32,160,97,140,6,17,48,89,1,137,121,89,15,39, -1,90,6,4,33,89,12,70,97,89,6,68,41,89,12,0,33,91,19,30,120,92,143,57,96, -152,0,92,0,0,1,201,123,89,5,96,3,90,240,255,255,20,22,0,0,17,12,112,0,90, -14,0,0,18,4,32,3,90,220,255,255,20,2,200,123,89,15,192,112,89,142,48,0, -90,8,0,0,17,1,30,112,92,1,136,107,89,20,64,107,89,20,48,0,90,0,0,96,33, -12,64,107,89,13,224,4,90,34,2,0,17,19,176,4,90,8,0,0,22,18,30,152,92,14, -17,100,89,20,32,3,90,8,0,0,22,12,22,160,92,0,30,64,92,14,224,3,90,8,0,0, -22,15,129,67,89,15,192,96,89,140,48,0,90,8,0,0,17,3,81,120,89,159,205,96, -89,3,3,107,88,12,65,107,89,140,64,107,88,13,32,5,90,132,0,0,22,20,65,107, -89,13,240,4,90,16,0,0,22,0,30,32,93,1,30,120,92,108,0,0,8,141,57,80,152, -0,92,0,0,1,140,82,89,31,206,130,89,1,204,90,89,144,131,82,88,0,120,0,90, -10,0,33,91,11,64,41,91,13,176,2,90,32,0,0,20,0,48,80,140,0,202,154,59,138, -0,33,103,5,22,32,92,0,30,40,92,9,73,107,89,9,201,123,89,13,57,80,144,160, -92,0,0,10,68,137,112,138,69,41,112,4,22,128,92,138,0,132,103,17,22,32,92, -13,193,123,89,4,22,128,93,184,2,0,11,136,48,0,90,24,0,0,22,48,0,96,140, -0,144,100,130,1,136,148,89,1,9,66,89,232,255,255,8,0,30,104,92,0,144,108, -130,1,136,148,89,0,30,240,92,0,0,0,10,0,48,96,140,16,91,0,0,0,30,104,92, -0,16,131,144,16,17,128,89,16,160,1,90,20,0,0,17,4,8,99,89,1,72,107,89,13, -48,4,90,228,255,255,20,4,9,99,89,1,73,107,89,0,16,131,144,16,48,0,90,70, -0,0,18,16,128,49,89,4,78,99,89,12,193,57,89,141,57,96,152,112,90,0,0,13, -64,81,103,12,64,129,103,0,120,0,90,10,64,84,91,11,16,88,91,13,0,129,103, -10,64,36,91,11,16,40,91,53,0,96,140,6,32,3,90,134,255,255,19,0,48,96,140, -48,90,0,0,0,30,104,92,0,16,131,144,16,17,128,89,16,160,1,90,20,0,0,17,4, -8,99,89,1,72,107,89,13,48,4,90,228,255,255,20,4,9,99,89,1,73,107,89,0,16, -131,144,16,48,0,90,54,0,0,18,16,128,49,89,13,193,57,89,141,57,96,152,176, -89,0,0,13,64,81,103,12,64,129,103,0,120,0,90,10,64,84,91,11,16,88,91,13, -0,129,103,10,64,36,91,11,16,40,91,6,70,41,89,32,0,96,140,6,1,99,89,12,4, -97,89,6,6,33,89,140,67,41,88,7,193,24,89,140,253,255,8,19,176,1,90,22,1, -0,20,15,192,24,89,1,201,24,89,0,30,104,92,19,240,1,90,22,0,0,22,7,201,108, -89,141,240,3,90,8,0,0,22,15,30,104,92,1,72,107,89,15,96,3,90,148,0,0,22, -13,193,115,89,142,57,80,152,0,92,0,0,1,140,82,89,31,206,130,89,1,204,90, -89,144,131,82,88,0,120,0,90,10,0,33,91,11,64,41,91,14,176,2,90,32,0,0,20, -0,48,80,140,0,202,154,59,138,0,33,103,5,22,32,92,0,30,40,92,9,137,115,89, -9,201,123,89,14,57,80,144,160,92,0,0,10,68,137,112,138,69,41,112,4,22,128, -92,138,0,132,103,17,22,32,92,14,193,123,89,143,57,96,152,0,92,0,0,5,96, -3,90,24,0,0,20,14,0,0,17,4,32,3,90,12,0,0,20,1,200,123,89,1,200,24,89,4, -22,128,93,1,30,112,92,164,0,0,11,69,0,96,140,0,144,100,130,1,136,148,89, -43,0,96,140,131,48,0,90,12,0,0,19,3,17,24,89,45,0,96,140,0,144,100,130, -1,136,148,89,3,22,128,92,0,30,136,92,3,30,120,92,15,22,112,92,15,22,104, -92,100,0,0,11,200,253,255,8,42,0,96,140,0,144,100,130,1,136,148,89,2,203, -156,90,240,255,255,20,176,253,255,8,0,48,96,140,78,97,78,0,36,0,0,21,43, -0,96,140,145,48,0,90,8,0,0,19,45,0,96,140,0,144,100,130,1,136,148,89,0, -48,96,140,73,78,70,0,0,144,100,130,1,136,148,89,12,48,0,90,8,12,99,89,240, -255,255,21,120,253,255,8,143,57,96,140,248,91,0,0,14,48,0,90,16,0,0,21, -46,0,120,140,0,144,124,130,1,136,148,89,0,16,83,152,8,9,99,89,47,0,120, -140,1,200,123,89,0,56,0,90,10,1,132,91,11,65,140,91,240,255,255,18,10,0, -132,91,11,64,140,91,0,144,124,130,1,136,148,89,1,137,115,89,144,67,124, -88,15,48,0,90,12,0,0,21,142,48,0,90,14,0,0,20,10,112,0,90,160,255,255,17, -0,144,7,132,0,0,0,0,31,200,156,88,1,78,36,89,1,206,44,89,21,94,96,89,4, -0,107,89,13,32,3,90,154,1,0,22,5,0,107,89,13,32,3,90,142,1,0,22,11,78,60, -89,21,12,100,89,11,14,52,89,140,195,57,88,159,201,57,88,11,206,76,89,21, -140,100,89,11,142,68,89,140,67,74,88,159,73,74,88,21,12,33,89,21,76,41, -89,31,76,84,89,31,142,82,89,4,96,1,90,32,0,104,140,52,0,0,20,5,1,97,89, -12,96,3,90,16,0,0,20,9,22,64,92,0,30,72,92,13,1,99,89,12,4,66,89,12,65, -107,89,13,70,106,89,12,68,74,89,141,3,66,88,52,0,0,8,4,65,97,89,12,96,3, -90,16,0,0,20,7,22,48,92,0,30,56,92,13,1,99,89,12,132,49,89,12,65,107,89, -13,198,105,89,12,196,57,89,141,131,49,88,5,22,32,92,17,195,100,88,31,47, -3,90,62,0,0,18,8,128,49,91,9,192,57,91,150,0,0,16,1,140,49,89,31,206,97, -89,1,204,57,89,140,131,49,88,1,8,33,89,255,7,96,140,4,32,3,90,116,0,0,20, -12,22,32,92,0,30,48,93,104,0,0,8,8,129,49,91,9,193,57,91,22,0,0,18,0,56, -0,90,6,17,48,91,7,17,56,91,31,136,82,88,135,16,96,100,32,0,0,18,134,16, -96,100,102,0,0,16,12,209,103,89,12,134,57,89,0,30,48,92,32,32,99,140,28, -0,0,8,12,132,105,89,1,76,107,89,12,209,103,89,12,198,57,89,12,134,49,89, -141,195,57,88,12,1,33,89,132,48,0,90,54,0,0,20,10,175,1,90,31,206,57,88, -11,140,129,89,21,206,105,89,11,204,137,89,20,14,33,89,145,3,137,88,13,0, -132,91,10,64,140,91,0,0,0,10,0,30,128,93,248,255,255,8,0,30,128,92,10,22, -136,92,236,255,255,8,0,48,96,140,0,0,224,255,12,32,1,90,70,0,0,18,90,0, -0,20,12,96,1,90,50,0,0,18,78,0,0,20,132,3,108,88,13,48,0,90,22,0,0,18,133, -131,108,88,13,48,0,90,70,254,255,21,176,255,255,8,133,131,108,88,13,48, -0,90,50,0,0,18,18,22,128,93,156,255,255,8,12,96,1,90,22,0,0,20,146,255, -255,17,17,195,100,88,140,48,0,90,134,255,255,19,1,25,128,89,1,25,136,89, -120,255,255,8,145,192,140,88,0,30,128,92,108,255,255,8,17,195,28,88,31, -204,24,89,31,206,24,89,1,78,36,89,1,206,44,89,21,94,96,89,4,0,107,89,13, -32,3,90,238,0,0,22,5,0,107,89,13,32,3,90,226,0,0,22,11,78,60,89,1,204,57, -89,10,14,52,89,22,12,108,89,141,195,57,88,158,201,57,88,11,206,76,89,11, -142,68,89,21,140,108,89,141,67,74,88,159,73,74,88,21,12,33,89,21,76,41, -89,137,128,81,103,10,22,104,92,0,30,96,92,137,0,99,103,13,22,80,92,1,12, -106,89,0,30,96,92,137,0,99,103,11,64,99,103,0,56,0,90,13,129,82,91,0,201, -90,91,13,129,82,91,0,201,90,91,31,239,2,90,16,0,0,18,10,128,82,91,11,192, -90,91,1,9,33,89,255,35,33,140,5,1,33,89,254,7,96,140,12,32,1,90,46,0,0, -20,10,175,2,90,11,140,130,89,21,206,106,89,11,204,138,89,20,78,140,88,20, -14,33,89,145,3,137,88,13,0,132,91,3,64,140,91,0,0,0,10,132,48,0,90,16,0, -0,20,1,8,35,89,0,30,80,93,200,255,255,8,0,30,32,92,0,30,80,93,188,255,255, -8,0,48,96,140,0,0,224,255,12,32,1,90,90,0,0,18,94,0,0,20,12,96,1,90,66, -0,0,18,82,0,0,20,132,3,108,88,13,48,0,90,38,0,0,18,133,131,108,88,13,48, -0,90,242,254,255,21,0,48,136,140,0,0,240,127,0,30,128,92,131,67,140,88, -148,255,255,8,133,131,108,88,13,48,0,90,26,0,0,18,0,30,128,93,131,67,140, -88,124,255,255,8,12,96,1,90,210,255,255,17,1,25,128,89,1,25,136,89,104, -255,255,8,0,0,0,0,0,0,0,0,0,0,0,0,17,195,28,88,31,204,24,89,31,206,24,89, -1,78,36,89,1,206,44,89,21,94,96,89,4,0,107,89,13,32,3,90,214,0,0,22,5,0, -107,89,13,32,3,90,202,0,0,22,11,78,60,89,11,14,52,89,21,12,108,89,141,195, -57,88,11,206,76,89,11,142,68,89,21,140,108,89,141,67,74,88,159,201,57,88, -159,73,74,88,21,12,33,89,21,76,41,89,7,64,98,103,6,64,82,103,0,120,0,90, -12,192,98,91,13,16,104,91,7,0,114,103,10,128,115,91,12,192,99,91,13,16, -104,91,31,111,3,90,16,0,0,18,12,0,99,91,13,64,107,91,1,9,33,89,4,124,33, -140,2,252,255,255,254,7,80,140,10,32,1,90,46,0,0,20,10,47,3,90,11,12,131, -89,21,78,83,89,11,76,139,89,20,78,140,88,20,14,33,89,145,3,137,88,10,0, -132,91,3,64,140,91,0,0,0,10,132,48,0,90,16,0,0,20,1,136,34,89,0,30,96,93, -200,255,255,8,0,30,32,92,0,30,96,93,188,255,255,8,31,204,24,89,31,206,24, -89,0,48,96,140,0,0,224,255,12,32,1,90,58,0,0,18,70,0,0,20,12,96,1,90,62, -0,0,20,70,0,0,18,132,3,108,88,13,48,0,90,18,0,0,18,133,131,108,88,13,48, -0,90,2,255,255,21,0,30,128,93,131,67,140,88,148,255,255,8,12,96,1,90,14, -0,0,20,5,48,0,90,30,0,0,21,1,25,128,89,1,25,136,89,120,255,255,8,132,3, -108,88,13,48,0,90,238,255,255,18,0,48,136,140,0,0,240,127,131,67,140,88, -0,30,128,92,88,255,255,8,0,0,0,0,1,78,36,89,1,206,52,89,0,48,96,140,0,0, -224,255,12,32,1,90,126,0,0,22,12,160,1,90,198,0,0,22,132,131,49,88,6,48, -0,90,98,0,0,18,159,77,100,89,31,78,60,88,16,3,51,88,7,3,59,88,0,56,0,90, -12,129,49,91,0,201,57,91,159,205,100,89,31,206,76,88,18,3,67,88,9,3,75, -88,0,56,0,90,12,1,66,91,0,73,74,91,135,96,2,90,1,25,128,89,34,0,0,20,1, -30,128,92,26,0,0,17,6,32,2,90,18,0,0,17,1,25,128,89,10,0,0,20,0,30,128, -92,0,0,0,10,12,32,1,90,30,0,0,18,3,30,128,92,240,255,255,8,1,30,128,92, -232,255,255,8,1,25,128,89,224,255,255,8,12,160,1,90,230,255,255,20,30,0, -0,17,17,195,100,88,140,48,0,90,198,255,255,19,31,111,4,90,214,255,255,16, -216,255,255,8,145,48,0,90,208,255,255,20,196,255,255,8,12,160,1,90,182, -255,255,20,31,239,4,90,182,255,255,18,184,255,255,8,0,0,0,10 -}; - -int pca200e_microcode_size_3 = sizeof(pca200e_microcode_3); - -u_char pca200e_microcode_4[] = { -102,111,114,101,0,1,0,0,64,81,0,0,192,86,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,64,77,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,3,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0, -0,80,45,3,0,0,0,0,0,1,255,128,255,48,0,0,0,1,126,255, -126,112,0,0,0,1,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, -15,0,0,0,0,0,0,1,231,167,167,32,0,0,0,1,11,3,3,0,0,0, -0,1,11,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, -223,111,223,0,0,0,0,1,127,0,0,0,0,0,0,1,255,0,0,0,0, -0,0,1,255,0,0,0,0,0,0,1,127,65,127,0,0,0,0,1,7,7,7, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,251,0, -251,0,0,0,0,1,255,240,240,0,0,0,0,1,255,0,0,0,0,0,0, -1,255,0,0,0,0,0,0,1,15,0,0,0,0,0,0,1,255,0,0,0,0,0, -0,1,255,0,0,0,0,0,0,1,15,0,0,0,0,0,0,1,127,1,127,0, -0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, -173,0,129,0,0,0,0,1,175,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -1,255,175,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,255,255,0,0,0, -0,0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1,7,3,7,0,0,0,0,1,127,126,127,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,1,255,255,255,0,0,0,0,1,255,255,255,144,0,0,0,0,0, -0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,255,255,255,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255, -127,127,4,0,0,0,1,254,224,224,0,0,0,0,1,255,255,255,0, -0,0,0,1,255,255,255,0,0,0,0,1,255,0,0,0,0,0,0,1,255, -255,0,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0,1, -3,0,0,0,0,0,0,1,255,255,255,252,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,255,159,159,4,0,0, -0,1,255,255,255,0,0,0,0,1,255,255,255,106,0,0,0,1,222, -206,207,0,0,0,0,1,255,0,0,0,0,0,0,1,255,0,0,0,0,0,0, -1,7,0,0,0,0,0,0,1,255,255,255,8,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,1,5,31,5,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255, -0,48,128,140,80,221,3,0,12,192,135,50,16,22,8,92,4,0,0, -9,128,62,0,102,0,0,0,140,0,30,240,92,0,48,128,140,0,228, -0,0,0,48,136,140,80,237,0,0,0,16,244,146,4,8,132,89,248, -95,132,52,0,48,128,140,0,16,0,59,60,131,0,9,236,140,0,9, -244,127,0,9,96,105,0,9,60,123,0,9,0,48,48,144,0,228,0, -0,40,160,1,50,16,22,32,93,0,20,128,140,0,0,0,0,0,48, -136,140,48,87,0,0,17,1,132,89,16,128,49,89,0,144,1,134, -4,22,128,93,8,0,0,9,116,107,0,8,16,72,8,89,12,38,0,9, -56,34,0,9,0,48,160,144,68,20,0,80,8,222,144,89,148,128, -36,88,0,16,129,140,240,32,0,9,136,25,160,88,66,0,37,58, -14,0,37,49,26,32,1,58,212,0,0,8,137,25,144,88,78,128,36, -58,200,0,0,8,0,0,0,0,0,48,168,144,140,81,0,0,13,30,144, -92,0,48,144,130,108,228,0,0,5,30,160,92,164,0,0,8,0,0, -0,0,0,48,168,144,140,81,0,0,9,30,144,92,0,48,144,130, -108,228,0,0,4,30,160,92,132,0,0,8,0,0,0,0,0,48,160,136, -2,4,0,136,8,30,144,92,1,47,5,90,0,48,144,130,108,228,0, -0,26,0,0,18,0,48,168,144,140,81,0,0,6,30,160,92,84,0,0, -8,0,0,0,0,42,32,21,48,22,32,5,48,0,48,168,144,140,81,0, -0,22,30,160,92,56,0,0,8,0,48,168,144,140,81,0,0,31,216, -161,89,40,0,0,8,26,32,5,48,0,48,168,144,140,81,0,0,31, -216,165,89,20,0,0,8,0,0,0,0,0,48,168,144,140,81,0,0,70, -0,160,140,176,96,165,146,136,35,0,9,180,42,0,9,224,30,0, -9,164,32,0,11,137,25,144,88,78,128,36,61,240,69,0,9,30, -32,4,61,0,48,168,144,112,228,0,0,0,48,160,140,20,0,173, -222,0,80,165,146,196,106,0,9,0,30,128,92,64,224,143,140, -16,71,0,11,30,32,4,58,64,224,167,144,0,48,168,144,140,81, -0,0,127,0,144,140,148,128,164,88,16,0,0,8,0,48,168,144, -140,81,0,0,1,25,160,89,180,96,165,146,0,48,160,140,48,3, -0,0,0,48,160,146,4,228,0,0,168,33,0,9,196,81,0,9,48,85, -0,9,1,30,128,92,216,105,0,9,0,0,0,10,0,48,128,144,8, -228,0,0,0,16,164,144,127,0,232,140,148,64,167,88,10,35,5, -58,2,9,165,89,238,33,77,52,20,57,160,144,32,89,0,0,0,16, -5,132,0,0,0,0,72,89,0,0,44,91,0,0,88,89,0,0,40,90,0, -0,104,89,0,0,240,89,0,0,8,90,0,0,248,90,0,0,48,90,0,0, -144,90,0,0,88,42,0,9,16,22,152,92,224,1,0,8,0,0,0,0, -24,45,0,9,16,22,152,92,208,1,0,8,0,0,0,0,0,48,160,144, -68,20,0,80,19,47,5,90,2,0,152,140,34,0,0,16,147,9,165, -88,0,48,240,146,164,86,0,0,0,48,160,146,68,20,0,80,20,0, -0,8,0,0,0,0,1,30,160,92,0,48,160,146,164,86,0,0,4,32, -172,144,0,48,128,140,96,0,0,32,31,88,166,89,0,48,144,140, -208,85,0,0,14,30,136,92,0,48,168,146,84,0,0,32,0,48,160, -146,96,0,0,32,1,73,140,89,0,144,164,176,145,48,0,90,16, -160,148,140,0,16,164,178,236,255,255,21,72,1,0,8,0,0,0, -0,24,74,0,11,144,48,0,90,2,0,152,140,54,1,0,21,10,30, -152,92,44,1,0,8,232,74,0,9,0,48,160,144,8,228,0,0,4,32, -141,144,16,30,128,92,0,48,144,140,176,228,0,0,236,20,0,9, -2,30,152,92,4,1,0,8,0,48,160,144,8,228,0,0,4,32,165, -144,0,48,160,146,64,0,0,32,0,48,160,144,0,225,1,240,0, -48,160,146,96,0,0,48,0,48,160,144,4,225,1,240,0,48,160, -146,96,0,0,48,0,48,160,144,100,224,1,240,0,48,160,146,96, -0,0,48,0,48,160,144,104,224,1,240,2,30,152,92,0,48,160, -146,96,0,0,48,168,0,0,8,0,0,0,0,0,48,160,144,8,228,0, -0,4,32,165,144,20,144,169,89,0,48,232,140,240,255,15,0,0, -48,168,146,252,2,0,0,149,69,175,89,0,48,232,140,0,240,15, -0,20,70,167,89,0,48,232,140,0,0,240,15,148,64,167,88,0, -48,232,140,240,255,15,0,0,48,160,146,248,2,0,0,149,64, -175,88,21,4,165,88,0,48,168,146,244,2,0,0,0,48,160,146, -240,2,0,0,60,0,0,8,0,48,160,144,8,228,0,0,0,16,165,144, -0,48,232,140,94,208,94,208,34,64,167,61,0,48,168,144,112, -228,0,0,0,48,160,140,13,0,173,222,0,30,128,92,0,80,165, -146,152,103,0,9,8,30,152,92,0,48,168,144,8,228,0,0,0,80, -165,144,150,32,61,48,0,48,160,144,12,228,0,0,16,96,189, -144,32,96,181,140,22,32,5,90,0,80,245,146,14,0,0,22,0, -48,176,144,16,228,0,0,0,48,160,144,116,228,0,0,0,48,184, -146,56,0,0,32,0,48,152,146,96,0,0,48,0,16,165,144,148, -48,0,90,0,48,176,146,8,228,0,0,66,0,0,18,0,48,168,144, -120,228,0,0,0,80,165,144,20,80,160,89,0,80,165,146,0,48, -168,144,96,81,0,0,255,1,232,140,21,80,168,89,149,64,167, -88,136,9,165,88,0,48,168,146,96,81,0,0,0,48,160,146,4,0, -0,32,0,0,0,10,0,48,160,144,12,228,0,0,16,96,189,144,32, -96,181,140,22,32,5,90,0,80,245,146,14,0,0,22,0,48,176, -144,16,228,0,0,0,48,184,146,56,0,0,32,0,48,176,146,8, -228,0,0,0,48,152,146,96,0,0,48,0,0,0,10,24,32,36,152,0, -48,168,144,140,228,0,0,4,65,161,89,20,96,5,90,0,16,52, -140,18,0,0,20,1,30,128,92,0,0,0,10,0,0,0,0,0,48,168, -144,80,3,0,0,58,96,5,58,0,48,160,144,104,3,0,0,1,73, -173,89,0,48,168,146,80,3,0,0,149,29,181,140,0,144,165, -144,5,16,170,89,0,80,161,146,28,32,172,146,4,160,133,144, -0,0,0,10,0,0,0,0,0,48,128,140,80,3,0,0,208,92,0,9,0, -48,168,144,80,3,0,0,54,96,5,58,0,48,160,144,104,3,0,0, -1,73,173,89,0,48,168,146,80,3,0,0,149,29,181,140,0,144, -165,144,5,16,170,89,0,80,161,146,28,160,169,146,4,160,133, -144,0,0,0,10,0,48,160,144,144,86,0,0,20,80,160,89,1,0, -128,140,0,48,160,146,144,86,0,0,0,0,0,10,0,0,0,0,24,32, -36,152,0,48,168,144,140,228,0,0,4,65,161,89,20,96,5,90, -0,16,52,140,18,0,0,20,1,30,128,92,0,0,0,10,0,0,0,0,0, -48,168,144,128,3,0,0,58,96,5,58,0,48,160,144,152,3,0,0, -1,73,173,89,0,48,168,146,128,3,0,0,149,29,181,140,0,144, -165,144,5,16,170,89,0,80,161,146,28,32,172,146,4,160,133, -144,0,0,0,10,0,0,0,0,0,48,128,140,128,3,0,0,0,92,0,9, -0,48,168,144,128,3,0,0,54,96,5,58,0,48,160,144,152,3,0, -0,1,73,173,89,0,48,168,146,128,3,0,0,149,29,181,140,0, -144,165,144,5,16,170,89,0,80,161,146,28,160,169,146,4,160, -133,144,0,0,0,10,0,48,160,144,148,86,0,0,20,80,160,89,1, -0,128,140,0,48,160,146,148,86,0,0,0,0,0,10,0,0,0,0,24, -32,36,152,0,48,168,144,140,228,0,0,4,65,161,89,20,96,5, -90,0,16,52,140,18,0,0,20,1,30,128,92,0,0,0,10,0,0,0,0, -0,48,168,144,176,3,0,0,58,96,5,58,0,48,160,144,200,3,0, -0,1,73,173,89,0,48,168,146,176,3,0,0,149,29,181,140,0, -144,165,144,5,16,170,89,0,80,161,146,28,32,172,146,4,160, -133,144,0,0,0,10,0,0,0,0,0,48,128,140,176,3,0,0,48,91, -0,9,0,48,168,144,176,3,0,0,54,96,5,58,0,48,160,144,200, -3,0,0,1,73,173,89,0,48,168,146,176,3,0,0,149,29,181,140, -0,144,165,144,5,16,170,89,0,80,161,146,28,160,169,146,4, -160,133,144,0,0,0,10,0,48,160,144,152,86,0,0,20,80,160, -89,1,0,128,140,0,48,160,146,152,86,0,0,0,0,0,10,0,0,0, -0,24,32,36,152,0,48,168,144,140,228,0,0,4,65,161,89,20, -96,5,90,0,16,52,140,18,0,0,20,1,30,128,92,0,0,0,10,0, -0,0,0,0,48,168,144,32,228,0,0,58,96,5,58,0,48,160,144, -56,228,0,0,1,73,173,89,0,48,168,146,32,228,0,0,149,29, -181,140,0,144,165,144,5,16,170,89,0,80,161,146,28,32,172, -146,4,160,133,144,0,0,0,10,0,0,0,0,0,48,128,140,32,228, -0,0,96,90,0,9,0,48,168,144,32,228,0,0,54,96,5,58,0,48, -160,144,56,228,0,0,1,73,173,89,0,48,168,146,32,228,0,0, -149,29,181,140,0,144,165,144,5,16,170,89,0,80,161,146,28, -160,169,146,4,160,133,144,0,0,0,10,0,48,160,144,156,86,0, -0,20,80,160,89,1,0,128,140,0,48,160,146,156,86,0,0,0,0, -0,10,0,0,0,0,64,96,8,140,112,224,199,178,16,22,192,92,0, -48,128,140,80,3,0,0,31,88,140,89,232,96,0,9,0,48,128, -140,128,3,0,0,31,88,140,89,216,96,0,9,0,48,128,140,176, -3,0,0,31,88,140,89,200,96,0,9,0,48,128,140,32,228,0,0, -31,88,140,89,184,96,0,9,0,48,160,140,144,86,0,0,0,48, -160,146,120,3,0,0,0,48,160,140,148,86,0,0,0,48,160,146, -168,3,0,0,0,48,160,140,152,86,0,0,0,48,160,146,216,3,0, -0,0,48,160,140,156,86,0,0,0,48,160,146,72,228,0,0,120, -32,166,144,0,48,160,146,96,3,0,0,136,32,174,144,0,48,168, -146,144,3,0,0,152,32,182,144,0,48,176,146,192,3,0,0,168, -32,190,144,64,32,38,140,148,48,0,90,0,48,184,146,48,228, -0,0,30,0,0,21,26,96,5,61,22,160,5,61,18,224,5,61,8,30, -128,92,112,224,199,176,0,0,0,10,52,32,169,144,0,48,168, -146,100,3,0,0,68,32,177,144,0,48,176,146,148,3,0,0,84, -32,185,144,0,48,184,146,196,3,0,0,0,48,160,144,96,3,0,0, -100,32,129,144,148,48,0,90,0,48,128,146,52,228,0,0,14,0, -0,18,63,0,200,140,178,95,174,62,0,48,160,144,144,3,0,0, -14,32,5,58,63,0,200,140,158,95,182,62,0,48,160,144,192,3, -0,0,14,32,5,58,63,0,200,140,138,95,190,62,0,48,160,144, -48,228,0,0,14,32,5,58,63,0,200,140,118,95,134,62,0,48, -160,144,96,3,0,0,38,32,5,58,0,48,160,144,144,3,0,0,26, -32,5,58,0,48,168,144,100,3,0,0,0,48,160,144,148,3,0,0, -74,31,173,57,0,48,160,144,192,3,0,0,38,32,5,58,0,48,160, -144,48,228,0,0,26,32,5,58,0,48,168,144,196,3,0,0,0,48, -160,144,52,228,0,0,30,31,173,57,0,48,160,144,96,3,0,0, -46,32,5,61,0,48,168,144,148,3,0,0,0,48,160,140,224,92,0, -0,0,48,160,146,80,228,0,0,0,48,168,146,100,3,0,0,24,0, -0,8,0,0,0,0,0,48,160,140,16,92,0,0,0,48,160,146,80,228, -0,0,0,48,160,144,192,3,0,0,42,32,5,61,0,48,168,144,52, -228,0,0,0,48,160,140,128,94,0,0,0,48,160,146,84,228,0,0, -0,48,168,146,196,3,0,0,20,0,0,8,0,48,160,140,176,93,0, -0,0,48,160,146,84,228,0,0,60,32,185,144,0,48,184,146,92, -3,0,0,76,32,129,144,0,48,128,146,140,3,0,0,92,32,145, -144,0,48,144,146,188,3,0,0,0,48,232,144,96,3,0,0,108,32, -153,144,157,48,0,90,0,48,152,146,44,228,0,0,10,0,0,18, -86,254,5,59,31,216,39,89,78,30,185,49,151,208,160,88,70, -62,5,61,0,48,136,144,144,3,0,0,10,96,4,58,54,62,4,59, -50,30,129,49,144,208,160,88,42,62,5,61,0,48,176,144,192, -3,0,0,10,160,5,58,26,190,4,59,22,30,145,49,146,208,160, -88,14,62,5,61,0,48,168,144,48,228,0,0,10,96,5,58,254, -253,4,59,250,29,153,49,147,208,160,88,242,61,5,61,10,96, -7,58,234,221,237,60,10,96,4,58,226,29,140,60,10,160,5,58, -218,157,180,60,10,96,5,58,210,221,172,60,0,48,104,144,144, -3,0,0,0,48,128,176,128,3,0,0,0,48,24,144,96,3,0,0,0, -48,160,176,80,3,0,0,0,48,120,144,48,228,0,0,0,48,64,176, -32,228,0,0,0,48,112,144,192,3,0,0,0,48,32,176,176,3,0, -0,23,193,232,89,1,205,96,89,0,80,175,140,12,22,176,92,0, -48,160,146,80,3,0,0,0,48,232,146,84,3,0,0,0,48,184,146, -92,3,0,0,0,48,96,146,88,3,0,0,19,65,163,89,1,77,107,89, -0,16,141,140,13,22,144,92,0,48,128,146,128,3,0,0,0,48, -160,146,132,3,0,0,0,48,104,146,136,3,0,0,0,48,152,146, -140,3,0,0,7,129,163,89,1,141,115,89,0,16,45,140,14,22, -48,92,0,48,32,146,176,3,0,0,0,48,160,146,180,3,0,0,0, -48,112,146,184,3,0,0,0,48,56,146,188,3,0,0,11,193,163, -89,1,205,123,89,0,16,77,140,15,22,80,92,0,48,64,146,32, -228,0,0,0,48,160,146,36,228,0,0,131,48,0,90,0,48,120, -146,40,228,0,0,0,48,128,140,80,3,0,0,0,30,32,92,0,48, -88,146,44,228,0,0,98,0,0,18,112,32,142,144,16,22,208,92, -0,48,216,140,56,3,0,0,0,48,128,146,48,3,0,0,0,48,216, -146,52,3,0,0,228,38,0,9,144,48,2,90,1,0,32,140,142,252, -255,18,0,48,160,144,108,3,0,0,12,32,166,146,0,48,128,144, -96,3,0,0,3,14,132,89,76,58,0,9,144,48,0,90,0,48,128, -146,104,3,0,0,98,252,255,18,0,48,160,144,144,3,0,0,148, -48,0,90,0,48,128,140,144,3,0,0,126,0,0,18,16,9,204,89, -132,57,160,140,0,0,0,0,0,48,168,140,48,3,0,0,96,224,207, -146,20,124,181,140,8,0,0,0,100,224,183,146,96,224,207,144, -128,32,142,144,20,64,165,89,16,9,132,89,0,16,205,146,4, -32,181,146,84,38,0,9,144,48,2,90,1,32,33,140,254,251,255, -18,0,48,160,144,156,3,0,0,16,32,166,146,0,48,128,144,144, -3,0,0,3,14,132,89,188,57,0,9,144,48,0,90,0,48,128,146, -152,3,0,0,210,251,255,18,0,48,160,144,192,3,0,0,148,48, -0,90,0,48,128,140,192,3,0,0,126,0,0,18,16,9,204,89,132, -57,160,140,0,0,0,0,0,48,168,140,48,3,0,0,80,224,207,146, -20,124,181,140,8,0,0,0,84,224,183,146,80,224,207,144,144, -32,142,144,20,64,165,89,16,9,132,89,0,16,205,146,4,32, -181,146,196,37,0,9,144,48,2,90,1,32,33,140,110,251,255, -18,0,48,160,144,204,3,0,0,20,32,166,146,0,48,128,144,192, -3,0,0,3,14,132,89,44,57,0,9,144,48,0,90,0,48,128,146, -200,3,0,0,66,251,255,18,0,48,160,144,48,228,0,0,148,48, -0,90,0,48,128,140,48,228,0,0,126,0,0,18,16,9,204,89,132, -57,160,140,0,0,0,0,0,48,168,140,48,3,0,0,64,224,207,146, -20,124,181,140,8,0,0,0,68,224,183,146,64,224,207,144,160, -32,142,144,20,64,165,89,16,9,132,89,0,16,205,146,4,32, -181,146,52,37,0,9,144,48,2,90,1,32,33,140,222,250,255,18, -0,48,160,144,60,228,0,0,24,32,166,146,0,48,128,144,48, -228,0,0,3,14,132,89,156,56,0,9,144,48,0,90,0,48,128,146, -56,228,0,0,178,250,255,18,0,48,160,140,48,3,0,0,2,30, -128,92,132,61,165,146,252,255,255,255,112,224,199,176,0,0, -0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,22,32,92,0,48,128, -146,104,228,0,0,1,9,164,89,0,80,44,140,144,64,129,112,0, -48,240,146,8,3,0,0,0,48,240,146,4,3,0,0,0,48,160,146, -12,3,0,0,48,56,0,9,144,48,0,90,0,48,128,146,96,228,0,0, -18,0,0,21,8,30,128,92,0,0,0,10,0,0,0,0,4,57,128,140,0, -0,0,0,8,56,0,9,144,48,0,90,0,48,128,146,0,3,0,0,18,0, -0,21,8,30,128,92,0,0,0,10,0,0,0,0,0,0,176,140,150,32, -1,90,0,48,184,144,96,228,0,0,98,0,0,19,0,47,1,90,0,0, -136,140,30,0,0,16,1,30,176,92,150,32,1,90,23,64,164,89, -23,64,185,89,0,16,164,146,62,0,0,19,0,48,168,144,0,3,0, -0,23,64,164,89,22,93,165,146,0,48,168,144,0,3,0,0,23,64, -185,89,23,64,164,89,22,125,165,146,4,0,0,0,22,144,176,89, -150,32,1,90,23,64,185,89,204,255,255,20,2,14,129,89,116, -55,0,9,144,48,0,90,0,48,128,146,100,228,0,0,14,0,0,21, -8,30,128,92,0,0,0,10,0,0,176,140,62,0,177,59,22,32,1, -48,1,30,176,92,150,32,1,90,0,16,244,146,42,0,0,19,0,48, -160,144,100,228,0,0,22,29,245,146,0,48,160,144,100,228,0, -0,22,61,245,146,4,0,0,0,22,144,176,89,224,31,177,60,2, -30,128,92,0,0,0,10,0,48,168,144,4,3,0,0,0,48,160,144,0, -3,0,0,21,29,165,140,0,16,149,144,146,48,0,90,0,16,44, -140,17,22,32,92,54,0,0,18,0,16,245,146,0,48,160,144,4,3, -0,0,0,48,168,144,104,228,0,0,0,144,140,146,16,16,134,89, -8,160,180,140,0,16,148,146,4,32,180,146,92,0,0,8,0,0,0, -0,0,48,160,144,84,81,0,0,106,32,5,59,188,1,0,9,0,48, -168,144,4,3,0,0,0,48,160,144,0,3,0,0,21,29,165,140,0, -16,149,144,74,160,4,58,0,16,245,146,0,48,160,144,4,3,0, -0,0,48,168,144,104,228,0,0,0,144,36,146,5,16,182,89,8, -160,188,140,0,144,149,146,4,160,189,146,1,73,173,89,1,32, -165,140,148,64,165,88,1,0,128,140,0,48,160,146,4,3,0,0, -0,0,0,10,0,48,160,144,160,86,0,0,20,80,160,89,0,0,128, -140,0,48,160,146,160,86,0,0,0,0,0,10,0,0,0,0,0,0,0,0, -0,0,0,0,0,48,136,144,140,228,0,0,16,22,32,92,16,47,0,9, -0,48,176,144,132,228,0,0,0,48,128,144,8,3,0,0,0,48,160, -144,8,3,0,0,0,48,168,144,104,228,0,0,0,48,184,144,0,3, -0,0,20,80,160,89,22,58,176,140,16,0,0,0,1,73,173,89,0, -16,177,146,148,64,165,88,16,221,37,146,0,48,160,146,8,3, -0,0,0,0,0,10,0,48,240,140,152,104,0,0,30,22,136,92,0,0, -240,140,0,48,168,144,88,81,0,0,0,48,184,144,100,228,0,0, -0,48,160,144,104,228,0,0,0,48,176,144,84,81,0,0,21,221, -133,144,1,9,165,89,1,96,173,140,149,0,173,88,1,137,181, -89,0,48,168,146,88,81,0,0,0,48,176,146,84,81,0,0,0,80, -4,132,0,0,0,10,0,0,0,0,0,48,240,140,12,105,0,0,30,22, -144,92,0,0,240,140,0,48,160,144,160,86,0,0,0,48,184,144, -92,81,0,0,0,48,136,144,100,228,0,0,0,48,168,144,104,228, -0,0,0,48,176,144,84,81,0,0,20,80,160,89,0,48,160,146, -160,86,0,0,1,73,173,89,1,224,165,140,148,64,165,88,23,93, -132,146,22,80,176,89,0,48,160,146,92,81,0,0,0,48,176,146, -84,81,0,0,0,144,4,132,0,0,0,10,0,48,64,140,88,81,0,0, -0,48,56,140,16,3,0,0,0,48,72,140,4,0,0,32,0,48,48,140, -8,3,0,0,0,48,136,144,16,3,0,0,0,80,164,144,110,33,5,58, -0,16,162,144,0,48,176,144,100,228,0,0,0,48,168,144,104, -228,0,0,20,157,37,144,1,73,173,89,1,32,165,140,148,64, -165,88,0,16,162,146,4,16,169,89,0,80,181,144,0,48,160, -144,84,81,0,0,0,48,128,140,255,255,0,0,150,0,132,88,0, -80,133,146,0,80,140,144,1,9,165,89,0,48,160,146,84,81,0, -0,4,22,144,92,144,56,128,140,9,0,0,0,3,12,132,89,144, -141,45,89,100,5,0,9,0,208,161,144,0,48,168,144,20,3,0,0, -20,16,178,89,4,32,189,144,22,96,5,90,0,16,245,146,14,0, -0,22,0,48,176,144,24,3,0,0,0,48,160,144,116,228,0,0,0, -48,184,146,56,0,0,32,129,73,169,88,0,48,168,146,96,0,0, -48,0,16,165,144,148,48,0,90,0,208,177,146,62,0,0,18,0, -48,168,144,120,228,0,0,0,80,165,144,20,80,160,89,0,80, -165,146,0,48,168,144,96,81,0,0,255,1,152,140,21,80,168, -89,149,192,164,88,0,48,168,146,96,81,0,0,136,9,165,88,0, -80,162,146,0,48,136,144,140,228,0,0,4,22,128,92,180,44,0, -9,0,48,160,144,132,228,0,0,0,48,128,144,8,3,0,0,0,48, -184,144,0,3,0,0,0,48,176,144,104,228,0,0,0,48,168,144, -84,81,0,0,20,58,160,140,16,0,0,0,0,16,161,146,0,144,161, -144,149,48,0,90,16,221,37,146,1,137,181,89,1,32,165,140, -148,128,165,88,0,144,161,146,148,254,255,17,0,0,0,10,0,0, -0,0,0,0,0,10,0,0,0,0,88,32,164,144,148,48,1,90,0,144, -236,140,19,22,48,92,26,0,0,18,14,32,37,52,210,32,5,58,0, -1,0,8,106,32,45,58,248,0,0,8,50,224,20,61,0,48,160,144, -52,86,0,0,0,48,168,144,72,86,0,0,17,0,141,89,1,96,173, -140,0,48,136,146,52,86,0,0,0,48,168,146,72,86,0,0,200,0, -0,8,0,48,160,144,64,86,0,0,0,48,168,144,80,86,0,0,17,0, -141,89,1,96,173,140,0,48,136,146,64,86,0,0,0,48,168,146, -80,86,0,0,156,0,0,8,0,0,0,0,50,224,20,61,0,48,160,144, -100,86,0,0,0,48,168,144,116,86,0,0,17,0,141,89,1,96,173, -140,0,48,136,146,100,86,0,0,0,48,168,146,116,86,0,0,104, -0,0,8,0,48,160,144,104,86,0,0,0,48,168,144,128,86,0,0, -17,0,141,89,1,96,173,140,0,48,136,146,104,86,0,0,0,48, -168,146,128,86,0,0,60,0,0,8,0,0,0,0,34,224,20,61,0,48, -160,144,36,86,0,0,17,0,141,89,0,48,136,146,36,86,0,0,28, -0,0,8,0,0,0,0,0,48,160,144,40,86,0,0,17,0,141,89,0,48, -136,146,40,86,0,0,24,32,36,152,4,65,161,89,8,9,165,89,3, -12,165,89,4,32,161,146,88,32,164,144,4,16,138,89,148,48, -0,90,48,32,164,176,22,0,0,18,18,64,149,62,4,16,140,89, -21,129,236,89,12,32,169,146,26,128,237,60,22,65,239,89,4, -96,180,146,157,160,5,90,8,96,140,140,240,255,255,19,10,96, -7,59,4,96,236,146,0,48,160,144,84,81,0,0,10,32,5,59,224, -252,255,9,0,48,136,144,16,3,0,0,0,80,164,144,122,32,5, -61,4,32,129,144,0,48,144,144,92,81,0,0,0,48,136,144,100, -228,0,0,0,48,168,144,92,81,0,0,0,48,176,144,104,228,0,0, -0,48,184,144,84,81,0,0,16,142,161,89,148,3,164,88,4,32, -161,146,18,93,36,146,0,48,160,144,160,86,0,0,1,137,181, -89,1,96,173,140,149,128,173,88,1,224,189,140,0,48,168,146, -92,81,0,0,0,48,184,146,84,81,0,0,20,80,160,89,0,48,160, -146,160,86,0,0,0,0,0,10,4,32,129,144,0,80,140,144,4,22, -144,92,144,56,128,140,9,0,0,0,131,13,132,89,64,2,0,9,0, -48,160,144,16,3,0,0,0,48,168,144,20,3,0,0,20,16,178,89, -4,32,189,144,22,96,5,90,0,16,245,146,14,0,0,22,0,48,176, -144,24,3,0,0,134,48,2,90,0,48,184,146,56,0,0,32,129,137, -161,88,0,48,176,146,16,3,0,0,0,48,160,146,96,0,0,48,34, -0,0,21,0,144,165,144,102,32,5,61,0,48,160,144,116,228,0, -0,0,16,165,144,86,32,5,58,20,0,0,8,0,48,160,144,116,228, -0,0,0,16,165,144,66,32,5,58,0,48,168,144,120,228,0,0,0, -80,165,144,20,80,160,89,0,80,165,146,0,48,168,144,96,81, -0,0,255,1,56,140,21,80,168,89,149,192,161,88,136,9,165, -88,0,48,168,146,96,81,0,0,0,48,160,146,4,0,0,32,0,48, -136,144,140,228,0,0,4,22,128,92,100,41,0,9,0,48,176,144, -132,228,0,0,0,48,128,144,8,3,0,0,0,48,160,144,8,3,0,0, -0,48,168,144,104,228,0,0,0,48,184,144,0,3,0,0,20,80,160, -89,22,58,176,140,16,0,0,0,1,73,173,89,0,16,177,146,148, -64,165,88,16,221,37,146,0,48,160,146,8,3,0,0,0,0,0,10, -144,68,148,101,0,0,0,10,5,56,0,102,0,0,0,10,33,22,128, -92,0,0,0,10,16,54,8,92,16,22,128,92,16,22,128,92,16,22, -128,92,16,22,128,92,16,22,128,92,16,22,128,92,16,22,128, -92,16,22,128,92,0,0,0,10,16,54,0,92,0,0,0,10,32,22,128, -92,0,0,0,10,0,48,32,140,0,0,31,0,16,14,44,89,132,2,41, -101,5,22,128,92,0,0,0,10,144,18,128,101,0,0,0,10,0,48, -32,140,255,255,255,255,16,64,36,97,4,22,128,92,0,0,0,10, -16,64,148,97,18,22,128,92,0,0,0,10,16,65,36,97,4,22,128, -92,0,0,0,10,0,0,0,0,0,0,0,0,0,30,152,92,0,48,136,146, -48,0,0,32,147,32,4,90,144,57,160,140,0,0,0,0,0,48,160, -146,96,0,0,32,82,0,0,19,0,48,232,140,8,0,0,16,0,48,136, -140,0,0,0,48,0,80,167,144,22,32,61,52,0,48,168,140,8,0, -0,16,0,80,165,144,252,63,61,51,0,80,164,176,0,144,164, -178,0,80,164,176,19,80,152,89,16,160,148,140,147,32,4,90, -0,144,164,178,18,16,148,89,200,255,255,20,0,0,0,10,0,0, -0,0,0,0,0,0,0,0,0,0,0,30,152,92,0,48,136,146,84,0,0, -32,147,32,4,90,144,57,160,140,0,0,0,0,0,48,160,146,96,0, -0,32,50,0,0,19,0,48,136,140,96,0,0,48,0,144,164,176,18, -16,148,89,1,224,156,140,147,32,4,90,0,80,164,178,0,144, -164,176,18,16,148,89,0,80,164,178,224,255,255,20,0,0,0, -10,0,0,0,0,0,0,0,0,0,0,0,0,144,176,0,90,0,48,136,146, -84,0,0,32,16,22,152,92,0,144,140,140,0,48,128,146,96,0, -0,32,42,0,0,18,18,32,20,60,50,32,12,58,64,0,0,8,0,0,0, -0,58,32,28,61,0,144,164,144,18,16,137,89,0,48,160,146,96, -0,0,32,0,80,164,144,17,16,137,89,0,48,160,146,96,0,0,32, -0,80,164,144,0,48,160,146,96,0,0,32,0,0,0,10,0,0,0,0, -146,208,163,88,50,32,69,58,18,32,69,52,22,32,37,58,76,0, -0,8,0,0,0,0,50,32,101,58,64,0,0,8,0,144,164,144,18,16, -137,89,1,9,156,89,0,48,160,146,96,0,0,32,0,80,164,144, -17,16,137,89,1,201,156,89,0,48,160,146,96,0,0,32,0,80, -164,144,17,16,137,89,1,201,156,89,0,48,160,146,96,0,0,32, -38,224,28,59,0,48,128,140,96,0,0,32,4,201,156,89,0,80, -164,176,147,240,0,90,16,96,140,140,0,16,164,178,236,255, -255,17,38,224,4,59,0,48,168,140,96,0,0,32,1,201,156,89, -0,80,164,144,147,48,0,90,4,96,140,140,0,80,165,146,236, -255,255,17,0,0,0,10,255,0,176,140,144,128,133,88,0,0,168, -140,0,48,136,140,255,179,196,4,0,48,184,140,4,0,0,16,0, -48,128,146,4,0,0,32,0,208,165,144,148,128,165,88,38,0, -164,58,21,80,168,89,240,95,172,62,0,48,168,144,112,228,0, -0,0,48,160,140,6,0,173,222,0,80,165,146,132,82,0,8,0,0, -0,10,0,0,0,0,0,0,0,0,0,0,0,0,255,0,184,140,0,30,168, -92,0,48,136,140,255,179,196,4,0,48,128,140,4,0,0,16,0, -48,176,128,96,81,0,0,0,16,164,144,148,192,165,88,42,128, -165,58,21,80,168,89,240,95,172,62,0,48,168,144,112,228,0, -0,0,48,160,140,7,0,173,222,0,80,165,146,40,82,0,8,0,0, -0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140, -160,113,0,0,30,22,128,92,0,0,240,140,0,48,160,144,116, -228,0,0,0,16,165,144,66,32,5,58,0,48,168,144,120,228,0, -0,0,80,165,144,20,80,160,89,0,80,165,146,0,48,168,144,96, -81,0,0,255,1,176,140,21,80,168,89,149,128,165,88,136,9, -165,88,0,48,168,146,96,81,0,0,0,48,160,146,4,0,0,32,0, -16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,22,40, -92,1,73,49,89,0,0,32,140,0,48,64,140,16,39,0,0,2,142, -57,89,108,252,255,9,5,1,132,88,92,252,255,9,4,22,160,92, -148,32,2,90,1,32,33,140,158,0,0,22,150,160,249,52,0,244, -161,144,248,113,0,0,0,16,5,132,0,0,0,0,120,114,0,0,120, -114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0, -120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114, -0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120, -114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0, -120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114, -0,0,120,114,0,0,120,114,0,0,120,114,0,0,120,114,0,0,120, -114,0,0,120,114,0,0,120,114,0,0,216,80,0,9,184,251,255, -9,144,64,129,88,68,63,4,61,1,30,128,92,0,0,0,10,64,96, -8,140,0,116,128,178,192,255,255,255,0,116,160,178,208,255, -255,255,0,116,192,178,224,255,255,255,0,116,224,178,240, -255,255,255,0,48,160,144,108,81,0,0,34,32,5,61,0,48,168, -144,112,228,0,0,0,48,160,140,1,0,173,222,0,80,165,146, -124,80,0,9,232,79,0,9,0,48,160,144,0,0,0,16,210,0,136, -140,148,64,164,88,40,0,136,140,148,67,164,88,0,0,32,140, -0,48,40,140,16,39,0,0,0,48,160,146,0,0,0,16,44,251,255, -9,0,14,132,88,28,251,255,9,4,22,160,92,148,96,1,90,1,32, -33,140,10,0,0,22,44,80,0,9,12,251,255,9,220,63,4,55,0, -48,168,144,120,81,0,0,0,48,160,144,116,81,0,0,149,48,0, -90,1,32,165,140,0,48,160,146,116,81,0,0,90,0,0,18,0,48, -160,144,116,228,0,0,0,16,165,144,82,32,5,58,0,48,168,144, -120,228,0,0,0,80,165,144,20,80,160,89,0,80,165,146,0,48, -168,144,96,81,0,0,255,1,136,140,21,80,168,89,149,64,164, -88,136,9,165,88,0,48,168,146,96,81,0,0,0,48,160,146,4,0, -0,32,16,0,0,8,0,0,0,0,0,48,240,146,108,81,0,0,0,116, -128,176,192,255,255,255,0,116,160,176,208,255,255,255,0, -116,192,176,224,255,255,255,0,116,224,176,240,255,255,255, -3,54,8,92,0,0,0,10,0,0,0,0,0,0,0,0,64,96,8,140,0,116, -128,178,192,255,255,255,0,116,160,178,208,255,255,255,0, -116,192,178,224,255,255,255,0,116,224,178,240,255,255,255, -0,48,160,144,68,20,0,80,14,32,37,48,10,32,133,48,156,3, -0,9,0,48,160,144,68,20,0,80,14,32,45,48,10,32,141,48, -168,3,0,9,0,48,160,144,68,20,0,80,14,32,53,48,10,32,149, -48,180,3,0,9,0,48,160,144,68,12,0,80,14,32,21,48,10,32, -29,48,192,3,0,9,0,30,32,92,0,48,40,140,16,39,0,0,212, -249,255,9,4,14,132,88,196,249,255,9,4,22,160,92,148,96,1, -90,1,32,33,140,10,0,0,22,212,78,0,9,180,249,255,9,220, -63,36,55,0,116,128,176,192,255,255,255,0,116,160,176,208, -255,255,255,0,116,192,176,224,255,255,255,0,116,224,176, -240,255,255,255,3,54,8,92,0,0,0,10,64,96,8,140,0,116, -128,178,192,255,255,255,0,116,160,178,208,255,255,255,0, -116,192,178,224,255,255,255,0,116,224,178,240,255,255,255, -0,48,160,144,132,81,0,0,34,32,5,61,0,48,168,144,112,228, -0,0,0,48,160,140,2,0,173,222,0,80,165,146,92,78,0,9,200, -77,0,9,0,30,32,92,0,48,40,140,16,39,0,0,56,4,0,9,40, -249,255,9,5,14,132,88,24,249,255,9,4,22,160,92,148,96,1, -90,1,32,33,140,10,0,0,22,40,78,0,9,8,249,255,9,220,63, -44,55,0,116,128,176,192,255,255,255,0,116,160,176,208,255, -255,255,0,116,192,176,224,255,255,255,0,116,224,176,240, -255,255,255,3,54,8,92,0,0,0,10,0,0,0,0,64,96,8,140,0, -116,128,178,192,255,255,255,0,116,160,178,208,255,255,255, -0,116,192,178,224,255,255,255,0,116,224,178,240,255,255, -255,0,48,160,144,104,81,0,0,34,32,5,61,0,48,168,144,112, -228,0,0,0,48,160,140,3,0,173,222,0,80,165,146,172,77,0, -9,24,77,0,9,0,48,160,144,0,0,0,16,210,0,136,140,148,64, -164,88,128,9,165,88,0,0,32,140,0,48,40,140,16,39,0,0,0, -48,160,146,0,0,0,16,96,248,255,9,2,14,132,88,80,248,255, -9,4,22,160,92,148,96,1,90,1,32,33,140,10,0,0,22,96,77, -0,9,64,248,255,9,220,63,20,55,0,116,128,176,192,255,255, -255,0,116,160,176,208,255,255,255,0,116,192,176,224,255, -255,255,0,116,224,176,240,255,255,255,3,54,8,92,0,0,0,10, -0,0,0,0,0,0,0,0,0,0,0,0,64,96,8,140,0,116,128,178,192, -255,255,255,0,116,160,178,208,255,255,255,0,116,192,178, -224,255,255,255,0,116,224,178,240,255,255,255,0,48,160,144, -100,81,0,0,34,32,5,61,0,48,168,144,112,228,0,0,0,48,160, -140,4,0,173,222,0,80,165,146,220,76,0,9,72,76,0,9,0,116, -128,176,192,255,255,255,0,116,160,176,208,255,255,255,0, -116,192,176,224,255,255,255,0,116,224,176,240,255,255,255, -3,54,8,92,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,68,247, -255,9,4,32,36,144,16,32,44,144,0,30,128,92,0,48,64,140, -1,50,0,0,60,247,255,9,0,30,128,92,4,0,72,140,88,247,255, -9,0,48,88,140,32,88,0,0,28,32,89,146,16,32,65,154,0,48, -160,140,144,114,0,0,76,96,161,146,0,48,160,140,96,117,0, -0,0,48,168,140,48,118,0,0,0,48,176,140,224,115,0,0,1,4, -128,140,0,30,136,92,0,0,144,140,140,96,161,146,204,96,169, -146,12,97,177,146,200,246,255,9,0,30,128,92,0,247,255,9, -255,15,128,140,208,246,255,9,1,30,128,92,0,247,255,8,180, -246,255,9,4,32,36,144,16,32,44,144,0,30,128,92,180,246, -255,9,0,30,128,92,212,246,255,9,84,0,160,140,20,32,161, -146,0,48,160,140,0,88,0,0,0,48,168,140,224,115,0,0,0,48, -176,140,176,116,0,0,1,4,128,140,0,30,136,92,0,0,144,140, -28,32,161,146,12,97,169,146,76,97,177,146,88,246,255,9,0, -30,128,92,144,246,255,9,255,15,128,140,96,246,255,9,1,30, -128,92,144,246,255,8,0,48,168,144,112,228,0,0,0,48,160, -140,16,0,173,222,0,80,165,146,140,75,0,9,1,30,128,92,244, -74,0,8,0,48,168,144,112,228,0,0,0,48,160,140,17,0,173, -222,0,80,165,146,108,75,0,9,1,30,128,92,212,74,0,8,0,48, -168,144,112,228,0,0,0,48,160,140,18,0,173,222,0,80,165, -146,76,75,0,9,1,30,128,92,180,74,0,8,0,48,168,144,112, -228,0,0,0,48,160,140,19,0,173,222,0,80,165,146,44,75,0, -9,1,30,128,92,148,74,0,8,0,48,240,140,84,120,0,0,30,22, -136,92,0,0,240,140,255,0,160,140,144,0,133,88,0,48,128, -146,8,28,0,80,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0, -136,25,176,88,144,160,5,90,0,30,160,93,62,0,0,18,18,128, -133,49,30,32,4,58,88,0,0,8,0,0,0,0,137,25,232,88,62,64, -135,58,72,0,0,8,0,0,0,0,0,48,160,140,130,184,97,202,0, -48,168,140,118,116,210,62,48,0,0,8,0,0,0,0,0,48,160,140, -222,153,139,252,0,48,168,140,59,93,202,62,24,0,0,8,0,0, -0,0,0,48,160,140,216,182,122,157,0,48,168,140,98,194,199, -62,0,30,144,92,0,48,152,140,132,215,119,65,20,22,128,93, -160,104,0,9,192,98,0,9,255,0,160,140,144,0,133,88,0,48, -128,146,8,28,0,80,0,0,0,10,0,0,0,0,0,48,240,140,48,121, -0,0,30,22,128,92,0,0,240,140,0,48,160,144,4,28,0,80,0, -48,240,146,132,81,0,0,1,14,165,88,0,48,160,146,4,28,0, -80,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48, -160,144,132,81,0,0,10,32,5,61,116,73,0,9,0,48,168,144,4, -28,0,80,137,73,173,88,10,96,85,48,138,73,173,88,0,48,160, -144,124,81,0,0,0,48,168,146,4,28,0,80,20,80,160,89,0,48, -160,146,124,81,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, -30,22,32,92,0,48,128,144,140,81,0,0,6,222,136,89,176,70, -0,9,16,22,160,92,0,48,160,144,0,0,0,16,210,0,168,140, -148,64,165,88,128,9,173,88,0,48,168,146,0,0,0,16,0,48, -160,144,140,81,0,0,20,16,175,89,0,48,168,146,116,228,0,0, -0,48,160,144,140,81,0,0,32,32,173,140,0,48,168,146,120, -228,0,0,0,48,160,144,140,81,0,0,48,32,173,140,0,48,168, -146,112,228,0,0,0,48,160,144,140,81,0,0,44,32,173,140,0, -48,168,146,124,228,0,0,1,30,160,92,0,48,160,146,128,228, -0,0,0,48,160,144,140,81,0,0,0,48,168,140,0,184,0,0,40, -32,173,146,0,48,160,144,140,81,0,0,0,48,168,140,80,45,3, -0,36,32,173,146,0,48,160,144,140,81,0,0,0,48,168,140,12, -1,4,0,52,32,173,146,0,48,160,144,140,81,0,0,0,48,168, -144,144,81,0,0,16,96,181,144,16,142,173,89,56,32,173,146, -0,0,0,10,0,0,0,0,16,72,8,89,0,144,39,140,0,48,160,144, -144,81,0,0,0,48,168,140,237,254,17,206,8,32,173,146,0,48, -168,144,112,228,0,0,0,48,160,144,112,228,0,0,0,48,168, -144,112,228,0,0,0,80,181,144,1,137,173,89,0,16,173,146,0, -16,165,144,0,48,160,144,140,81,0,0,64,32,173,144,127,0, -176,140,149,128,165,88,148,48,0,90,222,0,0,18,148,112,0, -90,14,0,0,18,216,0,0,8,0,0,0,0,0,48,128,144,140,81,0, -0,40,12,0,9,16,22,160,92,64,224,167,146,0,48,160,144,140, -81,0,0,64,224,175,144,129,73,181,88,68,32,181,146,0,48, -160,144,140,81,0,0,64,32,173,144,135,25,136,88,149,64,164, -88,148,48,0,90,96,0,0,18,0,48,160,144,116,228,0,0,0,16, -173,144,149,48,0,90,76,0,0,18,0,48,160,144,120,228,0,0, -0,48,168,144,120,228,0,0,0,80,181,144,22,80,168,89,0,16, -173,146,0,48,160,144,96,81,0,0,20,80,168,89,0,80,165,140, -0,48,160,146,96,81,0,0,255,0,168,140,148,64,165,88,136,9, -173,88,0,48,168,146,4,0,0,32,0,48,160,144,140,81,0,0,0, -30,168,92,64,32,173,146,64,224,167,144,148,176,0,90,8,0, -0,21,0,0,0,10,16,0,0,8,0,0,0,0,8,0,0,8,0,0,0,0,16, -0,0,8,0,0,0,0,16,0,0,8,0,0,0,0,204,254,255,8,0,0,0, -0,0,0,0,10,0,0,0,0,16,72,8,89,0,144,167,140,0,48,168, -144,68,12,0,80,128,73,181,88,0,48,176,146,68,12,0,80,0, -48,168,144,68,12,0,80,0,78,181,88,0,48,176,146,68,12,0, -80,0,48,168,144,68,12,0,80,2,78,181,88,0,48,176,146,68, -12,0,80,0,30,168,92,0,48,168,146,72,16,0,80,1,30,168,92, -0,48,168,146,68,16,0,80,0,30,168,92,64,224,175,146,64, -224,175,144,21,240,0,90,14,0,0,22,128,0,0,8,0,0,0,0,64, -224,175,144,21,22,176,92,22,57,168,140,0,0,0,0,0,48,176, -140,16,16,0,80,21,128,173,89,0,0,176,140,21,128,173,89,0, -80,181,140,15,30,168,92,0,144,173,146,64,224,175,144,21, -22,176,92,22,57,168,140,0,0,0,0,0,48,176,140,0,16,0,80, -21,128,173,89,0,0,176,140,21,128,173,89,0,80,181,140,0, -30,168,92,0,144,173,146,64,224,183,144,22,80,168,89,0,80, -181,140,64,224,183,146,124,255,255,8,0,0,0,0,0,48,168, -144,4,28,0,80,130,73,181,88,0,48,176,146,4,28,0,80,0,48, -168,144,68,20,0,80,1,78,181,88,0,48,176,146,68,20,0,80, -244,1,168,140,0,48,168,146,48,20,0,80,0,48,168,144,68,20, -0,80,135,73,181,88,0,48,176,146,68,20,0,80,0,48,168,144, -68,20,0,80,134,73,181,88,0,48,176,146,68,20,0,80,0,48, -168,144,68,20,0,80,4,78,181,88,0,48,176,146,68,20,0,80, -0,48,168,144,68,20,0,80,5,78,181,88,0,48,176,146,68,20, -0,80,0,0,0,10,0,0,0,0,0,0,0,0,16,72,8,89,0,144,39, -140,0,30,160,92,0,48,160,146,0,0,0,16,0,48,160,144,0,0, -0,16,210,0,168,140,148,64,165,88,129,9,173,88,0,48,168, -146,0,0,0,16,0,48,160,144,0,0,0,16,208,0,168,140,148,64, -165,88,0,48,160,146,0,0,0,16,0,48,160,144,0,0,0,16,210, -0,168,140,148,64,165,88,128,9,173,88,0,48,168,146,0,0,0, -16,0,48,160,144,0,0,0,16,210,0,168,140,148,64,165,88,40, -0,168,140,148,67,165,88,0,48,160,146,0,0,0,16,10,30,128, -92,128,39,0,11,16,22,160,92,0,48,160,144,4,28,0,80,131, -9,173,88,0,48,168,146,4,28,0,80,31,216,132,89,96,39,0, -11,16,22,160,92,0,48,160,144,4,28,0,80,11,222,168,89,148, -67,165,88,0,48,168,140,56,24,0,0,148,96,5,90,16,0,0,18, -1,30,128,92,140,68,0,9,16,22,160,92,0,48,160,144,68,12, -0,80,148,48,0,90,16,0,0,18,1,30,128,92,112,68,0,9,16, -22,160,92,0,48,160,144,68,20,0,80,8,222,168,89,148,67, -165,88,8,222,168,89,148,96,5,90,16,0,0,18,1,30,128,92, -72,68,0,9,16,22,160,92,0,48,160,144,68,12,0,80,129,9, -173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,12,0,80, -128,9,173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,20, -0,80,130,9,173,88,0,48,168,146,68,20,0,80,0,48,160,144, -68,20,0,80,128,9,173,88,0,48,168,146,68,20,0,80,0,48, -160,144,68,20,0,80,10,14,173,88,0,48,168,146,68,20,0,80, -0,48,160,144,4,28,0,80,133,9,173,88,0,48,168,146,4,28,0, -80,0,48,160,144,4,28,0,80,132,9,173,88,0,48,168,146,4, -28,0,80,0,48,160,144,4,28,0,80,3,14,173,88,0,48,168,146, -4,28,0,80,0,48,128,140,176,30,4,0,64,38,0,11,16,22,160, -92,0,0,160,140,64,224,167,146,64,224,167,144,20,240,0,90, -10,0,0,22,164,0,0,8,64,224,167,144,20,22,168,92,21,57, -160,140,0,0,0,0,0,48,168,140,0,12,0,144,20,64,165,89,0, -0,176,140,20,128,173,89,0,80,165,140,64,224,175,144,21,22, -176,92,10,142,173,89,0,48,176,144,136,81,0,0,22,64,173, -89,0,16,173,146,64,224,167,144,20,22,168,92,21,57,160,140, -0,0,0,0,0,48,168,140,16,12,0,144,20,64,165,89,0,0,176, -140,20,128,173,89,0,80,165,140,64,224,175,144,21,22,176, -92,10,142,173,89,0,48,176,144,136,81,0,0,22,64,173,89,0, -16,173,146,64,224,175,144,21,80,160,89,0,16,173,140,64, -224,175,146,88,255,255,8,0,0,0,0,0,48,160,144,128,228,0, -0,148,112,0,90,108,0,0,21,0,48,160,144,136,81,0,0,141, -25,168,88,20,64,165,89,0,48,160,146,0,20,0,144,0,48,160, -144,136,81,0,0,141,25,168,88,20,64,165,89,0,48,160,146, -16,20,0,144,0,48,160,144,136,81,0,0,140,25,168,88,20,64, -165,89,0,48,160,146,0,24,0,144,0,48,160,144,136,81,0,0, -140,25,168,88,20,64,165,89,0,48,160,146,16,24,0,144,104, -1,0,8,0,0,0,0,0,30,160,92,64,224,167,146,64,224,167,144, -20,240,0,90,10,0,0,22,76,1,0,8,64,224,167,144,20,22,168, -92,21,57,160,140,0,0,0,0,0,48,168,140,0,20,0,144,20,64, -165,89,0,0,176,140,20,128,173,89,0,80,165,140,64,224,175, -144,11,222,176,89,149,128,173,112,141,25,176,88,21,128,173, -89,0,48,176,144,136,81,0,0,22,64,173,89,0,16,173,146,64, -224,167,144,20,22,168,92,21,57,160,140,0,0,0,0,0,48,168, -140,16,20,0,144,20,64,165,89,0,0,176,140,20,128,173,89,0, -80,165,140,64,224,175,144,11,222,176,89,149,128,173,112, -141,25,176,88,21,128,173,89,0,48,176,144,136,81,0,0,22, -64,173,89,0,16,173,146,64,224,167,144,20,22,168,92,21,57, -160,140,0,0,0,0,0,48,168,140,0,24,0,144,20,64,165,89,0, -0,176,140,20,128,173,89,0,80,165,140,64,224,175,144,21,22, -176,92,10,142,173,89,140,25,176,88,21,128,173,89,0,48,176, -144,136,81,0,0,22,64,173,89,0,16,173,146,64,224,167,144, -20,22,168,92,21,57,160,140,0,0,0,0,0,48,168,140,16,24,0, -144,20,64,165,89,0,0,176,140,20,128,173,89,0,80,165,140, -64,224,175,144,21,22,176,92,10,142,173,89,140,25,176,88, -21,128,173,89,0,48,176,144,136,81,0,0,22,64,173,89,0,16, -173,146,64,224,175,144,21,80,160,89,0,16,173,140,64,224, -175,146,176,254,255,8,0,0,0,0,1,30,160,92,0,48,160,146, -68,16,0,80,0,30,160,92,64,224,167,146,64,224,167,144,20, -240,0,90,14,0,0,22,128,0,0,8,0,0,0,0,64,224,167,144,20, -22,168,92,21,57,160,140,0,0,0,0,0,48,168,140,16,16,0,80, -20,64,165,89,0,0,168,140,20,64,165,89,0,16,173,140,15,30, -160,92,0,80,165,146,64,224,167,144,20,22,168,92,21,57,160, -140,0,0,0,0,0,48,168,140,0,16,0,80,20,64,165,89,0,0, -168,140,20,64,165,89,0,16,173,140,0,30,160,92,0,80,165, -146,64,224,175,144,21,80,160,89,0,16,173,140,64,224,175, -146,124,255,255,8,0,0,0,0,0,48,160,144,68,12,0,80,1,14, -173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,12,0,80, -0,14,173,88,0,48,168,146,68,12,0,80,0,48,160,144,68,20, -0,80,2,14,173,88,0,48,168,146,68,20,0,80,0,48,160,144, -68,20,0,80,0,14,173,88,0,48,168,146,68,20,0,80,0,48,160, -144,68,20,0,80,138,9,173,88,0,48,168,146,68,20,0,80,0, -48,160,144,4,28,0,80,5,14,173,88,0,48,168,146,4,28,0,80, -0,48,160,144,4,28,0,80,4,14,173,88,0,48,168,146,4,28,0, -80,0,48,160,144,68,20,0,80,147,9,173,88,0,48,168,146,68, -20,0,80,0,30,128,92,0,0,0,10,0,0,0,10,0,0,0,0,30,22, -160,92,0,0,168,140,0,48,168,146,68,16,0,80,31,30,168,92, -0,48,168,146,72,16,0,80,0,48,168,128,108,228,0,0,0,48, -168,146,0,16,0,80,1,30,168,92,0,48,168,146,16,16,0,80,0, -48,168,128,108,228,0,0,0,48,168,146,4,16,0,80,1,30,168, -92,0,48,168,146,20,16,0,80,0,48,168,128,108,228,0,0,0, -48,168,146,8,16,0,80,1,30,168,92,0,48,168,146,24,16,0, -80,0,48,168,128,108,228,0,0,0,48,168,146,12,16,0,80,1, -30,168,92,0,48,168,146,28,16,0,80,0,0,0,10,0,16,188,144, -0,16,140,144,4,32,164,144,0,48,176,144,244,2,0,0,0,48, -144,144,248,2,0,0,0,48,152,144,252,2,0,0,0,48,168,144, -240,2,0,0,0,48,48,140,0,255,0,0,4,14,165,89,148,128,181, -88,148,128,164,88,19,4,165,89,150,3,181,88,150,64,173,88, -149,48,0,90,151,128,185,88,8,204,237,89,0,48,48,140,0,0, -255,0,145,128,137,88,16,76,140,89,18,0,0,18,10,30,128,92, -0,0,0,10,0,0,0,0,145,48,0,90,4,140,181,89,18,0,0,18, -118,96,12,58,228,255,255,8,0,0,0,0,0,48,160,144,144,3,0, -0,214,63,5,58,0,48,160,144,96,3,0,0,26,32,5,58,0,48, -160,144,144,228,0,0,34,32,5,61,10,160,253,52,26,160,117, -61,0,48,136,140,224,92,0,0,0,48,184,140,128,3,0,0,20,0, -0,8,0,48,184,140,80,3,0,0,0,48,136,144,80,228,0,0,0,48, -144,140,224,92,0,0,0,48,152,140,128,3,0,0,104,0,0,8,0, -0,0,0,0,48,160,144,48,228,0,0,110,63,5,58,0,48,160,144, -192,3,0,0,26,32,5,58,0,48,160,144,144,228,0,0,34,32,13, -61,10,160,253,52,26,160,117,61,0,48,136,140,128,94,0,0,0, -48,184,140,32,228,0,0,20,0,0,8,0,48,184,140,176,3,0,0, -0,48,136,144,84,228,0,0,0,48,144,140,128,94,0,0,0,48, -152,140,32,228,0,0,0,48,168,144,160,228,0,0,157,48,1,90, -7,142,165,89,20,64,37,89,166,0,0,18,18,96,39,60,22,96,7, -58,244,254,255,8,0,0,0,0,210,96,47,58,232,254,255,8,8, -32,164,144,31,88,132,89,144,5,173,112,10,96,5,61,1,30, -168,92,16,32,161,144,0,48,48,140,0,183,0,0,148,160,1,90, -84,32,169,146,50,0,0,18,4,16,45,89,0,80,137,144,30,64, -141,60,145,0,148,112,0,16,129,140,2,30,152,92,68,229,255, -9,0,80,241,146,36,32,241,146,2,30,128,92,0,0,0,10,60,32, -137,146,64,32,145,146,20,224,165,144,144,5,165,116,44,32, -161,146,0,48,168,140,176,183,0,0,20,224,164,144,16,32,169, -146,144,5,165,116,0,16,148,140,132,0,0,8,16,32,161,144,0, -48,48,140,0,183,0,0,82,158,161,61,60,32,137,146,64,32, -145,146,20,224,165,144,31,88,147,89,146,5,165,116,44,32, -161,146,20,224,164,144,146,5,165,116,0,48,168,140,128,183, -0,0,4,30,40,92,64,0,0,8,16,32,161,144,0,48,48,140,0, -183,0,0,18,158,161,61,64,32,153,146,60,32,185,146,20,224, -165,144,31,88,148,89,146,5,165,116,44,32,161,146,20,224, -164,144,146,5,165,116,0,48,168,140,80,178,0,0,0,30,40,92, -16,32,169,146,48,32,161,146,44,32,129,144,48,32,137,140,0, -80,164,176,146,0,132,112,88,32,233,146,5,1,132,89,0,16, -172,140,146,0,149,112,4,96,132,146,18,22,176,92,2,0,128, -140,0,80,164,146,8,96,148,146,12,96,188,146,0,0,0,10,4, -32,164,144,0,48,176,144,244,2,0,0,0,48,184,144,248,2,0, -0,0,48,128,144,252,2,0,0,0,48,168,144,240,2,0,0,4,14, -165,89,148,128,181,88,148,192,165,88,16,4,165,89,150,3, -181,88,150,64,173,88,14,96,5,58,10,30,128,92,0,0,0,10,0, -48,160,144,160,228,0,0,4,140,181,89,7,142,173,89,21,0,37, -89,16,32,161,144,0,48,40,140,0,183,0,0,18,64,161,61,10, -30,128,92,0,0,0,10,0,0,0,0,20,32,137,144,22,96,4,59,4, -22,128,92,0,0,144,140,8,30,152,92,180,227,255,9,4,22,128, -92,135,25,136,88,72,57,0,9,159,25,160,88,16,32,41,146,2, -30,128,92,68,32,161,146,0,0,0,10,96,32,180,144,96,32,172, -144,64,32,84,140,16,22,72,92,149,57,168,140,32,0,0,0,149, -208,167,88,148,48,0,90,0,48,176,146,148,228,0,0,0,48,168, -146,152,228,0,0,18,0,0,18,8,30,128,92,0,0,0,10,0,0,0, -0,92,32,164,144,3,14,189,89,32,224,173,140,149,208,167,88, -148,48,0,90,0,48,168,146,140,228,0,0,14,0,0,18,8,30,128, -92,0,0,0,10,88,32,164,144,148,208,160,88,18,32,5,58,8, -30,128,92,0,0,0,10,0,0,0,0,80,32,148,144,84,32,172,144, -88,32,180,144,88,32,156,144,88,32,236,144,112,32,36,144, -120,32,44,144,128,32,52,144,136,32,60,144,144,32,68,144, -31,88,98,89,146,0,147,112,40,224,165,140,148,128,165,112, -152,32,180,144,160,32,188,144,168,32,140,144,149,157,172, -140,21,0,173,89,19,93,157,140,29,221,236,140,132,93,39, -140,133,29,41,140,134,93,49,140,135,157,57,140,136,221,65, -140,150,29,178,140,0,48,88,140,79,205,3,0,0,48,96,140,80, -45,3,0,151,157,189,140,12,193,162,89,145,221,141,140,18,0, -141,54,8,30,128,92,0,0,0,10,0,0,0,0,184,0,0,9,14,32, -68,61,8,30,128,92,0,0,0,10,0,80,130,140,36,1,0,9,18,32, -68,61,8,30,128,92,0,0,0,10,0,0,0,0,0,80,130,140,140,1, -0,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0,0,0,0,80,130, -140,212,214,255,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0, -0,0,88,96,130,144,0,48,136,144,140,228,0,0,4,221,255,9, -18,32,68,61,8,30,128,92,0,0,0,10,0,0,0,0,0,144,130,140, -252,10,0,9,18,32,68,61,8,30,128,92,0,0,0,10,0,0,0,0,0, -0,128,140,180,231,255,9,36,160,162,144,2,30,128,92,0,48, -160,146,144,228,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, -16,22,32,92,80,32,161,144,5,14,133,89,0,48,160,146,156, -228,0,0,252,20,0,9,144,48,0,90,0,48,128,146,8,228,0,0, -14,0,0,21,8,30,128,92,0,0,0,10,0,48,176,144,156,228,0, -0,0,16,129,146,0,48,128,146,16,228,0,0,0,30,168,92,5, -142,165,89,149,160,5,90,16,60,165,140,224,255,255,255,0, -48,160,146,12,228,0,0,26,0,0,19,21,80,168,89,0,16,244, -146,149,160,5,90,32,32,132,140,240,255,255,20,2,30,128,92, -0,0,0,10,16,22,40,92,88,96,33,144,3,14,49,89,0,144,129, -140,128,20,0,9,144,48,0,90,0,48,128,146,16,3,0,0,18,0, -0,21,8,30,128,92,0,0,0,10,0,0,0,0,8,96,129,146,0,30, -168,92,0,48,128,146,24,3,0,0,149,32,1,90,16,188,161,140, -248,255,255,255,0,48,160,146,20,3,0,0,26,0,0,19,21,80, -168,89,0,16,244,146,149,32,1,90,8,32,132,140,240,255,255, -20,2,30,128,92,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16, -22,40,92,84,96,33,144,3,14,49,89,0,144,129,140,0,20,0,9, -144,48,0,90,0,48,128,146,32,3,0,0,18,0,0,21,8,30,128, -92,0,0,0,10,0,0,0,0,4,96,129,146,0,30,168,92,0,48,128, -146,28,3,0,0,149,32,1,90,16,188,161,140,248,255,255,255, -0,48,160,146,36,3,0,0,26,0,0,19,21,80,168,89,0,16,244, -146,149,32,1,90,8,32,132,140,240,255,255,20,2,30,128,92, -0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,17,22,32,92,132,57, -48,140,0,0,0,0,16,22,40,92,0,144,129,140,124,19,0,9,144, -48,0,90,28,96,129,146,18,0,0,21,8,30,128,92,0,0,0,10,0, -0,0,0,16,188,169,140,248,255,255,255,32,96,161,140,0,30, -176,92,0,16,133,146,150,32,1,90,4,32,173,146,22,0,0,19, -28,96,161,144,150,29,245,146,22,80,176,89,244,31,177,60,2, -30,128,92,0,0,0,10,0,0,0,0,0,0,0,0,0,48,240,140,76, -139,0,0,30,22,144,92,0,0,240,140,1,9,132,89,1,25,184,89, -82,192,133,58,8,78,140,89,0,0,168,140,16,81,160,88,21, -124,180,140,80,8,0,64,148,48,0,90,21,124,164,140,96,8,0, -64,26,0,0,18,1,9,132,89,144,224,5,90,0,144,245,146,0,16, -245,146,26,0,0,18,2,9,132,89,144,224,5,90,0,144,245,146, -0,16,245,146,240,255,255,21,0,144,4,132,0,0,0,10,20,22, -96,92,48,0,24,140,131,133,164,116,0,144,85,140,0,48,176, -144,32,86,0,0,19,22,88,92,8,206,138,89,0,0,184,140,21, -22,104,92,23,124,172,140,64,8,0,64,20,128,165,89,0,48, -160,146,32,86,0,0,0,80,133,146,0,144,162,152,18,208,144, -89,0,0,32,140,140,48,0,90,23,124,52,140,64,0,0,112,130, -141,76,89,0,0,128,140,20,22,56,92,130,77,45,89,210,0,0, -21,198,96,2,59,2,222,71,89,0,48,232,140,48,0,0,32,0,48, -152,140,96,0,0,32,0,48,144,140,4,0,0,32,0,48,136,140,8, -0,0,16,22,96,1,61,10,16,82,89,0,144,162,152,130,77,45, -89,0,16,61,140,4,1,162,89,133,32,5,90,0,80,177,140,10,0, -0,22,20,22,176,92,0,80,63,146,0,48,160,144,96,81,0,0,4, -128,37,89,255,0,168,140,132,240,2,90,22,221,57,140,22,65, -74,89,0,208,180,146,22,65,41,89,1,32,165,140,148,64,173, -88,0,48,160,146,96,81,0,0,0,144,172,146,54,0,0,22,0,80, -164,128,42,32,93,51,0,48,128,140,8,0,0,16,0,144,161,176, -0,144,161,176,0,144,161,176,0,16,164,128,20,240,2,90,12, -9,33,89,232,255,255,17,212,63,89,60,106,127,2,60,0,0,0, -10,0,0,0,0,214,96,2,59,0,48,120,140,4,0,0,32,0,48,112, -140,8,0,0,16,22,96,1,61,10,16,82,89,0,144,162,152,130, -77,45,89,0,16,61,140,2,222,31,89,4,193,160,89,133,32,5, -90,0,80,177,140,10,0,0,22,20,22,176,92,0,48,56,146,48,0, -0,32,0,48,160,144,96,81,0,0,4,128,37,89,255,0,168,140, -132,240,2,90,0,48,176,146,96,0,0,32,22,65,74,89,22,221, -57,140,22,65,41,89,1,32,165,140,148,64,173,88,0,48,160, -146,96,81,0,0,0,208,171,146,78,0,0,22,0,144,163,128,66, -32,93,51,0,48,64,140,8,0,0,16,16,80,128,89,0,144,161, -176,144,32,3,90,0,144,161,176,12,9,33,89,0,144,161,176, -22,0,0,21,13,22,128,92,0,208,138,140,164,253,255,11,0,30, -128,92,0,16,162,128,208,63,93,52,188,63,89,60,68,127,2, -60,13,22,128,92,0,208,138,140,124,253,255,8,0,0,0,0,0,0, -0,0,0,48,136,146,64,0,0,32,8,14,172,89,0,0,184,140,23, -124,181,140,240,4,0,96,0,144,37,176,17,16,164,89,0,48, -160,146,64,0,0,32,0,144,37,176,32,96,132,140,23,124,173, -140,252,4,0,96,0,48,128,146,56,0,0,32,16,16,129,89,0,80, -165,144,0,48,128,146,56,0,0,32,16,16,129,89,0,80,165,144, -0,0,0,10,0,0,0,0,0,48,240,140,12,142,0,0,30,22,144,92, -0,0,240,140,8,14,132,89,0,0,168,140,0,52,132,140,192,4, -0,64,0,16,164,144,21,80,168,89,149,176,2,90,0,80,164,146, -17,16,137,89,236,255,255,22,0,144,4,132,0,0,0,10,0,48, -240,140,76,142,0,0,30,22,144,92,0,0,240,140,8,14,132,89, -0,0,168,140,0,52,132,140,192,4,0,64,0,16,164,144,21,80, -168,89,149,176,2,90,0,80,164,146,17,16,137,89,236,255,255, -22,0,144,4,132,0,0,0,10,0,48,240,140,132,142,0,0,30,22, -136,92,0,0,240,140,8,14,132,89,0,52,132,140,192,4,0,64, -0,16,164,176,0,16,164,176,0,16,164,144,0,16,164,144,0,16, -164,144,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0,112,96,8, -140,160,224,199,146,16,22,56,92,32,224,161,176,18,22,120, -92,0,0,104,140,20,224,33,144,13,224,3,90,68,224,41,144, -17,22,112,92,0,48,192,140,192,4,0,64,22,22,72,92,0,80, -69,140,198,4,0,19,0,48,88,140,64,86,0,0,4,201,98,89,0, -48,24,140,76,20,0,80,0,16,166,144,0,48,80,140,255,255,0, -0,148,128,50,88,170,64,49,61,74,32,2,61,210,5,232,140,22, -64,39,54,0,30,128,92,84,255,255,11,244,1,0,8,0,0,0,0, -64,224,137,144,7,22,128,92,0,80,4,134,144,112,0,90,0,16, -76,140,22,0,0,21,0,30,128,92,44,255,255,11,204,1,0,8,0, -0,0,0,48,224,65,144,0,48,72,146,68,0,0,32,0,48,160,176, -240,4,0,96,0,48,160,176,240,4,0,96,44,96,74,140,137,48, -0,90,1,32,33,140,1,9,66,89,0,48,160,144,252,4,0,96,0, -48,160,144,252,4,0,96,0,48,160,144,252,4,0,96,130,1,0, -18,0,48,232,140,255,63,0,0,0,100,161,140,148,64,47,88, -244,3,0,8,0,0,0,0,14,140,161,89,94,32,13,58,18,32,13, -49,174,33,21,58,146,34,29,58,196,3,0,8,0,30,128,92,164, -254,255,11,34,32,1,58,7,22,128,92,0,16,137,140,0,30,144, -92,8,0,152,140,228,218,255,9,20,0,0,8,0,0,0,0,0,208, -162,144,20,80,160,89,0,208,162,146,159,25,40,88,0,0,64, -140,0,30,32,92,148,3,0,8,0,0,0,0,34,32,1,61,0,30,128, -92,88,254,255,11,0,208,162,144,20,80,160,89,159,25,40,88, -0,0,64,140,108,3,0,8,142,73,161,88,134,32,5,90,1,32,33, -140,38,0,0,18,7,22,128,92,0,16,137,140,0,30,144,92,8,0, -152,140,120,218,255,9,0,30,128,92,24,254,255,11,196,1,0, -8,0,30,128,92,64,224,143,140,136,253,255,11,0,208,128,144, -28,12,164,89,20,253,151,144,60,0,0,0,72,224,169,144,0,48, -232,140,0,0,255,0,146,64,167,88,149,32,5,90,26,12,44,89, -50,0,0,21,146,208,160,88,44,0,232,140,132,64,175,112,20, -57,160,144,160,81,0,0,4,73,41,89,146,128,50,88,6,0,165, -89,5,124,173,140,208,255,255,255,58,64,165,58,0,16,163, -144,7,22,128,92,0,0,144,140,8,30,152,92,1,32,165,140,4, -22,136,92,0,0,32,140,0,30,64,92,159,25,40,88,0,16,163, -146,220,217,255,9,172,2,0,8,0,0,0,0,66,32,2,61,60,224, -137,144,7,22,128,92,0,80,4,134,144,112,0,90,0,16,76,140, -42,0,0,21,7,22,128,92,0,16,137,140,0,30,144,92,8,0,152, -140,164,217,255,9,0,30,32,92,159,25,40,88,108,2,0,8,0,0, -0,0,26,96,1,58,5,208,128,89,0,80,138,140,2,12,132,89,64, -224,151,140,60,222,255,9,7,22,128,92,0,16,137,140,6,22, -144,92,2,0,152,140,188,0,0,8,0,0,0,0,26,32,1,58,0,30, -128,92,0,253,255,11,7,22,128,92,0,16,137,140,152,0,0,8, -7,22,128,92,0,144,139,140,128,213,255,9,30,32,4,61,0,30, -128,92,220,252,255,11,0,208,162,144,20,80,160,89,159,25, -40,88,244,1,0,8,60,224,137,144,7,22,128,92,0,80,4,134, -144,112,0,90,0,16,76,140,38,0,0,21,24,224,129,144,52,214, -255,9,0,30,128,92,164,252,255,11,0,208,162,144,20,80,160, -89,159,25,40,88,188,1,0,8,0,16,166,144,0,30,128,92,0,80, -138,140,0,48,232,140,0,0,255,0,148,64,167,88,72,224,161, -146,140,251,255,9,144,48,0,90,0,16,76,140,42,0,0,21,7, -22,128,92,0,0,136,140,0,30,144,92,8,0,152,140,172,216, -255,9,0,30,32,92,0,0,64,140,159,25,40,88,112,1,0,8,44, -224,169,144,0,48,232,140,255,63,0,0,0,164,161,140,148,64, -47,88,1,0,32,140,1,73,69,89,80,1,0,8,38,32,1,58,7,22, -128,92,0,0,144,140,8,30,152,92,0,16,137,140,0,30,32,92, -0,0,64,140,159,25,40,88,88,216,255,9,0,30,128,92,112,224, -143,140,180,251,255,11,0,208,128,144,26,12,52,89,22,161,1, -58,28,12,164,89,20,253,151,144,108,0,0,0,112,224,167,144, -0,48,168,140,0,0,255,0,146,64,181,88,148,64,165,88,34,0, -181,61,146,208,160,88,20,57,176,144,160,81,0,0,146,128,34, -88,8,137,169,89,4,128,165,89,34,64,165,58,0,16,163,144, -20,80,160,89,0,0,32,140,0,30,64,92,159,25,40,88,0,16, -163,146,184,0,0,8,22,16,162,89,0,208,129,140,14,22,136, -92,20,129,49,89,16,212,255,9,30,32,4,61,0,208,162,144,20, -80,160,89,0,0,32,140,0,30,64,92,159,25,40,88,132,0,0,8, -60,224,137,144,7,22,128,92,0,80,4,134,144,112,0,90,0,16, -76,140,46,0,0,21,0,208,162,144,24,224,129,144,20,80,160, -89,0,0,32,140,0,30,64,92,159,25,40,88,0,208,162,146,172, -212,255,9,76,0,0,8,0,0,0,0,6,208,128,89,0,80,138,140,2, -12,132,89,116,224,151,140,32,220,255,9,7,22,128,92,1,0, -136,140,4,22,144,92,2,0,152,140,76,215,255,9,0,30,32,92, -24,0,0,8,0,30,128,92,228,250,255,11,0,208,162,144,20,80, -160,89,0,208,162,146,13,80,104,89,88,219,107,52,20,224,33, -146,40,224,73,146,36,224,65,146,68,224,41,146,160,224,199, -144,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,160,140,80, -237,0,0,148,48,0,90,12,32,36,144,0,48,160,146,160,228,0, -0,18,0,0,21,8,30,128,92,0,0,0,10,0,0,0,0,0,16,133,140, -7,14,137,89,112,44,0,9,0,30,168,92,149,32,1,90,1,9,161, -89,0,48,240,146,136,228,0,0,0,48,160,146,132,228,0,0,94, -0,0,19,0,48,176,144,160,228,0,0,0,47,1,90,0,48,128,140, -0,183,0,0,159,25,184,88,0,144,165,140,30,0,0,16,16,160, -133,146,1,30,168,92,68,160,189,146,149,32,1,90,128,160, -165,140,38,0,0,19,16,32,133,146,68,32,189,146,144,32,133, -146,21,144,168,89,196,32,189,146,149,32,1,90,0,33,165,140, -228,255,255,20,2,30,128,92,0,0,0,10,0,0,0,0,0,0,0,0,0, -0,0,0,92,32,164,144,17,22,80,92,138,32,5,90,0,16,36,140, -18,22,56,92,40,32,52,144,46,0,0,18,16,16,45,89,0,80,137, -144,30,96,4,59,31,88,236,89,145,64,151,112,2,0,152,140, -12,214,255,9,0,80,241,146,36,32,241,146,92,32,81,146,230, -225,1,59,4,16,77,89,36,32,65,140,36,32,161,144,222,32,5, -61,20,32,161,144,182,32,5,61,4,22,128,92,0,144,138,140, -24,210,255,9,198,33,4,58,84,32,169,144,44,32,161,144,26, -0,173,62,64,32,137,144,4,22,128,92,0,80,4,134,48,32,161, -144,20,0,0,8,60,32,137,144,4,22,128,92,0,80,4,134,44,32, -161,144,16,22,48,92,36,32,161,146,136,32,12,61,0,48,160, -144,40,86,0,0,24,32,129,144,7,0,165,89,0,48,160,146,40, -86,0,0,172,210,255,9,135,16,139,112,0,0,128,140,40,19,0, -11,36,32,241,146,0,0,0,10,0,0,0,0,20,32,137,144,4,22, -128,92,0,0,144,140,8,30,152,92,80,213,255,9,0,30,128,92, -133,16,139,112,0,0,40,140,248,18,0,11,0,16,242,146,20,32, -241,146,188,0,0,8,64,32,137,144,4,22,128,92,0,80,4,134, -144,112,0,90,0,16,52,140,46,1,0,18,48,32,161,144,36,32, -161,146,20,32,177,144,84,32,169,144,7,128,165,89,148,96,5, -90,0,208,41,140,10,0,0,20,22,65,45,89,36,32,161,144,133, -32,5,90,5,193,57,89,86,0,0,22,36,32,137,144,0,30,128,92, -0,144,145,140,80,32,153,140,196,15,0,9,0,16,162,144,20, -32,169,144,64,32,137,144,4,22,128,92,21,0,173,89,20,65, -41,89,20,32,169,146,0,80,4,134,144,112,0,90,0,16,52,140, -74,255,255,18,48,32,161,144,133,32,5,90,0,16,162,146,180, -255,255,17,30,96,1,58,0,30,128,92,0,80,137,140,6,22,144, -92,80,32,153,140,112,15,0,9,16,22,48,92,0,80,162,144,84, -32,169,144,5,0,141,89,145,96,5,90,0,80,138,146,38,0,0, -21,31,88,236,89,145,64,151,112,0,16,129,140,2,30,152,92, -80,212,255,9,0,80,242,146,36,32,241,146,40,0,0,8,32,32, -161,140,0,16,133,176,8,32,53,146,5,65,172,89,0,80,141, -140,6,22,144,92,0,16,133,146,4,32,173,146,12,32,157,146, -44,254,1,60,0,0,0,10,0,0,0,0,0,48,160,144,40,86,0,0, -135,16,139,112,0,0,128,140,7,0,165,89,0,48,160,146,40,86, -0,0,164,17,0,8,0,48,160,144,40,86,0,0,135,16,139,112,0, -0,128,140,7,0,165,89,0,48,160,146,40,86,0,0,140,17,0,11, -20,32,137,144,4,22,128,92,0,0,144,140,2,30,152,92,192, -211,255,9,20,32,241,146,0,0,0,10,0,30,32,92,0,16,36,146, -132,73,140,89,16,16,129,89,244,127,36,62,0,0,0,10,0,0,0, -0,0,0,0,0,0,0,0,0,80,96,8,140,112,224,199,178,128,224, -231,146,21,22,216,92,3,160,172,140,21,210,232,88,0,144, -101,140,31,88,115,89,51,96,183,140,142,133,181,112,0,48, -168,144,68,86,0,0,0,48,184,144,48,86,0,0,21,80,168,89,0, -48,168,146,68,86,0,0,22,192,181,89,0,48,176,146,48,86,0, -0,4,32,171,144,19,22,200,92,0,16,213,140,0,30,24,92,8, -96,127,140,2,222,63,89,64,224,151,146,130,77,95,89,0,16, -83,144,130,77,77,89,137,224,1,90,0,80,138,140,10,0,0,22, -7,22,136,92,0,48,80,146,48,0,0,32,0,48,136,146,96,0,0, -32,0,48,176,144,96,81,0,0,0,48,184,144,176,81,0,0,0,48, -40,140,48,0,0,32,0,48,168,144,180,81,0,0,17,22,64,92,0, -48,104,140,4,0,0,32,255,0,32,140,0,48,224,140,0,0,255, -255,255,3,192,140,48,96,49,140,15,160,3,90,17,157,82,140, -17,193,90,89,1,160,181,140,17,65,74,89,0,48,176,146,96, -81,0,0,150,0,177,88,1,224,189,140,149,0,175,88,0,48,224, -140,252,255,255,0,149,67,175,88,0,48,176,146,4,0,0,32, -151,0,190,88,0,116,173,140,0,0,1,0,149,0,183,88,0,48, -192,140,0,0,255,0,149,0,198,88,0,48,184,146,176,81,0,0, -80,224,199,146,0,48,176,146,180,81,0,0,38,1,0,17,139,48, -0,90,17,192,66,89,70,0,0,22,12,16,98,89,4,32,163,144,0, -16,83,144,0,48,168,144,96,81,0,0,0,80,81,146,130,13,77, -89,1,96,173,140,9,193,90,89,0,144,73,146,149,0,161,88,0, -48,168,146,96,81,0,0,139,48,0,90,0,80,163,146,196,255, -255,17,8,206,180,89,0,180,133,146,64,8,0,64,0,48,160,144, -176,81,0,0,0,48,168,144,180,81,0,0,14,222,224,89,148,3, -167,88,0,48,160,146,76,12,0,80,0,180,173,146,192,0,0,64, -0,48,160,128,8,0,0,16,148,32,2,90,0,48,176,140,8,0,0, -16,255,0,168,140,18,0,0,18,0,144,165,128,148,64,165,88, -248,31,162,61,30,32,2,58,8,206,164,89,0,52,173,140,192,0, -0,112,129,11,66,90,0,80,165,144,248,255,255,21,80,224,231, -144,31,88,195,89,15,1,166,89,0,0,168,140,2,12,181,89,8, -206,164,89,21,160,5,90,0,52,165,140,192,0,0,64,156,131, -148,88,0,16,149,146,22,0,0,19,21,80,168,89,21,160,5,90, -0,16,245,146,244,255,255,20,8,206,156,89,26,206,163,89,0, -244,164,146,192,0,0,64,112,224,199,176,128,224,231,144,0, -0,0,10,102,96,76,60,12,16,98,89,4,32,171,144,8,193,177, -89,0,16,83,144,130,77,77,89,137,160,5,90,0,80,138,140,10, -0,0,22,22,22,136,92,0,80,81,146,0,48,176,144,96,81,0,0, -8,64,68,89,136,112,2,90,17,157,82,140,17,65,74,89,0,144, -137,146,17,193,90,89,1,160,181,140,150,0,169,88,0,48,176, -146,96,81,0,0,0,80,171,146,164,255,255,22,0,48,184,144, -176,81,0,0,8,206,180,89,0,180,133,146,64,8,0,64,0,48, -168,144,180,81,0,0,143,201,109,88,0,48,104,146,76,12,0, -80,0,180,173,146,192,0,0,64,0,48,168,128,8,0,0,16,21, -112,2,90,0,48,184,140,8,0,0,16,255,0,176,140,18,0,0,17, -0,208,173,128,149,128,173,88,248,127,77,51,8,206,180,89,0, -0,184,140,23,188,173,140,192,0,0,112,0,80,37,176,0,80,37, -176,0,80,133,152,0,48,168,140,0,0,0,176,23,188,181,140, -192,0,0,64,148,48,0,90,0,144,173,146,10,9,66,89,0,244, -123,140,212,255,255,255,38,1,0,21,14,224,2,61,31,88,195, -89,106,2,126,54,118,224,2,59,22,96,2,61,12,16,98,89,4, -32,163,144,0,16,83,144,130,13,77,89,2,222,231,89,8,1,167, -89,137,32,5,90,0,80,138,140,10,0,0,22,20,22,136,92,0,48, -80,146,48,0,0,32,0,48,160,144,96,81,0,0,255,0,168,140, -17,65,74,89,0,48,136,146,96,0,0,32,8,64,68,89,17,157,82, -140,17,193,90,89,1,32,165,140,148,64,173,88,0,48,160,146, -96,81,0,0,0,48,168,146,4,0,0,32,146,32,82,59,8,206,236, -89,0,48,32,140,8,0,0,16,255,0,144,140,0,48,56,140,255, -63,0,0,0,48,48,140,76,12,0,80,0,116,47,140,192,0,0,112, -0,16,161,128,148,128,164,88,90,32,85,51,0,30,160,92,5,0, -133,89,20,124,143,140,192,0,0,64,0,100,163,140,148,192, -105,88,0,144,105,146,0,16,164,176,0,16,164,176,0,16,164, -152,0,16,164,144,0,48,176,140,0,0,0,176,0,80,180,146,0, -16,161,128,148,128,164,88,20,176,2,90,11,9,66,89,0,244, -123,140,212,255,255,255,192,255,255,17,160,63,82,60,254, -254,2,61,31,88,195,89,246,30,126,49,84,1,0,8,14,224,2, -61,31,88,227,89,50,1,127,54,118,224,2,59,22,96,2,61,12, -16,98,89,4,32,163,144,0,16,83,144,130,13,77,89,2,222,199, -89,8,1,166,89,137,32,5,90,0,80,138,140,10,0,0,22,20,22, -136,92,0,48,80,146,48,0,0,32,0,48,160,144,96,81,0,0,255, -0,168,140,17,65,74,89,0,48,136,146,96,0,0,32,8,64,68,89, -17,157,82,140,17,193,90,89,1,32,165,140,148,64,173,88,0, -48,160,146,96,81,0,0,0,48,168,146,4,0,0,32,174,32,82,59, -8,78,62,89,0,48,112,140,8,0,0,16,255,0,48,140,0,244,233, -140,192,0,0,112,0,144,163,128,148,128,161,88,134,32,85,51, -0,30,160,92,29,0,37,89,20,252,41,140,192,0,0,64,3,80,24, -89,30,128,30,61,27,22,128,92,0,80,142,140,96,224,239,146, -116,238,255,11,0,30,24,92,96,224,239,144,0,48,224,140,255, -63,0,0,0,100,163,140,148,0,111,88,0,48,104,146,76,12,0, -80,0,16,161,176,0,16,161,176,0,16,161,152,0,16,161,144,0, -48,176,140,0,0,0,176,0,80,177,146,0,144,163,128,148,128, -161,88,20,176,2,90,11,9,66,89,0,244,123,140,212,255,255, -255,148,255,255,17,116,63,82,60,226,254,2,61,31,88,195,89, -216,30,126,49,3,80,24,89,22,128,30,61,27,22,128,92,0,80, -142,140,248,237,255,11,0,30,24,92,0,48,224,140,255,63,0, -0,0,100,163,140,148,0,167,88,142,9,165,88,0,48,160,146, -76,12,0,80,0,48,160,128,8,0,0,16,148,32,2,90,0,48,176, -140,8,0,0,16,255,0,168,140,18,0,0,19,0,144,165,128,148, -64,165,88,248,31,162,60,0,48,160,128,8,0,0,16,148,48,0, -90,0,48,184,140,8,0,0,16,255,0,176,140,34,0,0,18,8,78, -166,89,0,52,173,140,192,0,0,112,0,80,165,144,0,208,165, -128,148,128,165,88,244,63,5,61,31,88,195,89,80,224,231, -144,15,1,166,89,64,224,199,144,2,12,181,89,1,25,184,89,1, -137,181,89,8,78,166,89,150,224,5,90,0,52,165,140,192,0,0, -64,156,3,174,88,0,16,173,146,22,0,0,18,1,137,181,89,150, -224,5,90,0,16,245,146,244,255,255,21,8,78,174,89,154,48, -0,90,26,206,163,89,0,116,165,146,192,0,0,64,26,0,0,18,3, -80,24,89,18,128,30,61,27,22,128,92,0,80,142,140,4,237, -255,11,112,224,199,176,128,224,231,144,0,0,0,10,0,0,0,0, -0,0,0,0,0,0,0,0,0,48,160,144,188,81,0,0,16,16,140,89, -14,222,144,89,17,0,173,89,149,160,4,90,0,48,32,144,184, -81,0,0,18,0,0,22,0,30,128,92,0,0,0,10,0,0,0,0,17,0, -161,89,0,16,129,140,0,48,160,146,184,81,0,0,0,48,168,146, -188,81,0,0,8,34,0,9,4,208,131,89,16,210,131,88,0,0,0, -10,0,0,0,0,0,0,0,0,0,30,144,92,0,0,136,140,135,25,152, -88,0,48,128,140,0,4,0,136,0,48,184,140,192,81,0,0,0,208, -165,128,34,32,5,58,0,16,164,144,3,224,173,128,4,224,181, -128,8,12,165,89,148,64,165,88,10,128,165,58,18,80,144,89, -1,96,140,140,145,224,4,90,4,32,132,140,23,16,186,89,204, -255,255,22,14,160,4,58,0,30,128,92,0,0,0,10,0,0,80,140, -0,30,32,92,120,1,0,9,0,30,72,92,0,0,40,140,0,30,48,92, -0,0,64,140,0,48,160,140,240,85,0,0,0,48,240,146,248,85, -0,0,0,30,56,92,0,16,69,154,1,30,128,92,0,48,32,178,224, -85,0,0,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240, -140,144,159,0,0,30,22,152,92,0,0,240,140,135,25,184,88, -14,192,133,54,0,30,128,92,0,208,4,132,144,57,168,140,192, -81,0,0,0,80,165,128,14,32,5,61,0,30,128,92,0,208,4,132, -2,96,165,128,16,57,176,140,0,4,0,136,145,0,141,88,146,48, -0,90,8,78,164,89,0,144,165,146,38,0,0,18,0,144,165,144, -1,96,173,128,8,12,165,89,148,64,165,88,18,64,164,58,0,30, -128,92,0,208,4,132,0,0,0,0,1,30,128,92,0,208,4,132,0,0, -0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140,248,159,0, -0,30,22,144,92,0,0,240,140,135,25,176,88,14,128,133,54,0, -30,128,92,0,144,4,132,144,57,168,140,192,81,0,0,0,80,165, -128,14,32,5,61,0,30,128,92,0,144,4,132,16,57,160,144,0, -4,0,136,1,96,173,128,8,12,165,89,148,64,165,88,1,0,128, -140,0,80,164,130,0,144,4,132,0,0,0,10,0,0,0,0,0,30,160, -92,0,0,176,140,0,30,184,92,0,0,168,140,0,30,136,92,0,0, -144,140,0,48,160,178,224,85,0,0,0,30,128,92,0,48,160,140, -240,85,0,0,0,48,240,146,248,85,0,0,0,16,133,154,0,0,0, -10,0,0,0,0,16,72,8,89,0,48,160,128,128,83,0,0,1,30,144, -92,148,48,0,90,64,224,151,130,30,0,0,18,0,48,160,128,130, -83,0,0,148,80,160,88,8,14,165,89,0,48,160,146,224,4,0, -136,232,3,128,140,240,4,0,11,0,48,160,128,80,82,0,0,148, -48,0,90,64,224,143,140,34,0,0,18,0,48,160,144,72,4,0, -136,0,48,168,128,81,82,0,0,8,12,165,89,148,64,165,88,0, -80,164,130,0,48,160,128,88,82,0,0,34,32,5,58,0,48,160, -144,76,4,0,136,0,48,168,128,89,82,0,0,8,12,165,89,148, -64,165,88,65,224,167,130,65,224,167,128,0,48,168,128,144, -82,0,0,64,224,183,128,0,48,184,144,224,85,0,0,149,48,0, -90,8,14,165,89,148,131,165,88,20,192,165,89,0,48,160,146, -224,85,0,0,34,0,0,18,0,48,160,144,104,4,0,136,0,48,168, -128,145,82,0,0,8,12,165,89,148,64,165,88,0,80,164,130,0, -48,160,128,152,82,0,0,34,32,5,58,0,48,160,144,108,4,0, -136,0,48,168,128,153,82,0,0,8,12,165,89,148,64,165,88,66, -224,167,130,0,48,160,128,160,82,0,0,34,32,5,58,0,48,160, -144,112,4,0,136,0,48,168,128,161,82,0,0,8,12,165,89,148, -64,165,88,65,224,167,130,65,224,167,128,66,224,175,128,0, -48,176,128,168,82,0,0,64,224,191,128,0,48,128,144,232,85, -0,0,16,14,165,89,150,48,0,90,8,78,173,89,148,67,165,88, -148,195,165,88,20,0,164,89,0,48,160,146,232,85,0,0,34,0, -0,18,0,48,160,144,116,4,0,136,0,48,168,128,169,82,0,0,8, -12,165,89,148,64,165,88,0,80,164,130,0,48,160,128,176,82, -0,0,34,32,5,58,0,48,160,144,120,4,0,136,0,48,168,128, -177,82,0,0,8,12,165,89,148,64,165,88,66,224,167,130,0,48, -160,128,184,82,0,0,34,32,5,58,0,48,160,144,124,4,0,136, -0,48,168,128,185,82,0,0,8,12,165,89,148,64,165,88,65,224, -167,130,65,224,167,128,66,224,175,128,0,48,176,128,128,83, -0,0,64,224,191,128,0,48,128,144,236,85,0,0,16,14,165,89, -150,48,0,90,8,78,173,89,148,67,165,88,148,195,165,88,20, -0,164,89,0,48,160,146,236,85,0,0,34,0,0,18,0,48,160,144, -224,4,0,136,0,48,168,128,129,83,0,0,8,12,165,89,148,64, -165,88,0,80,164,130,0,48,160,128,136,83,0,0,34,32,5,58, -0,48,160,144,228,4,0,136,0,48,168,128,137,83,0,0,8,12, -165,89,148,64,165,88,65,224,167,130,65,224,167,128,0,48, -168,128,144,83,0,0,64,224,183,128,0,48,184,144,228,85,0, -0,149,48,0,90,8,14,165,89,148,131,165,88,20,192,165,89,0, -48,160,146,228,85,0,0,34,0,0,18,0,48,160,144,232,4,0, -136,0,48,168,128,145,83,0,0,8,12,165,89,148,64,165,88,0, -80,164,130,0,48,160,128,152,83,0,0,34,32,5,58,0,48,160, -144,236,4,0,136,0,48,168,128,153,83,0,0,8,12,165,89,148, -64,165,88,65,224,167,130,65,224,167,128,0,48,168,128,104, -84,0,0,0,80,188,128,0,48,176,144,240,85,0,0,149,48,0,90, -8,14,165,89,148,195,165,88,20,128,165,89,0,48,160,146,240, -85,0,0,30,0,0,18,0,48,160,128,106,84,0,0,151,0,165,88, -8,14,165,89,0,48,160,146,84,5,0,136,232,3,128,140,252,1, -0,11,0,48,160,128,96,84,0,0,34,32,5,58,0,48,160,144,80, -5,0,136,0,48,168,128,97,84,0,0,8,12,165,89,148,64,165, -88,65,224,167,130,65,224,167,128,0,48,168,128,104,84,0,0, -0,48,176,144,244,85,0,0,149,48,0,90,20,128,165,89,0,48, -160,146,244,85,0,0,34,0,0,18,0,48,160,144,84,5,0,136,0, -48,168,128,105,84,0,0,8,12,165,89,148,64,165,88,65,224, -167,130,65,224,167,128,0,48,168,144,248,85,0,0,20,64,165, -89,0,48,160,146,248,85,0,0,0,0,0,10,0,0,0,0,0,0,0,0, -0,48,240,140,228,164,0,0,30,22,152,92,0,0,240,140,16,72, -8,89,0,16,164,144,0,16,172,144,0,48,144,140,0,255,0,0,0, -16,180,144,148,128,164,88,8,12,133,89,135,25,144,88,16, -160,4,90,16,76,189,89,24,140,181,89,142,0,0,17,144,57, -168,140,192,81,0,0,0,80,165,128,126,32,5,58,16,57,160, -144,0,4,0,136,1,96,173,128,8,12,165,89,148,64,165,88,135, -25,144,88,16,160,4,90,22,1,165,88,151,128,173,88,148,67, -165,88,255,0,168,140,148,64,141,88,0,116,160,130,240,255, -255,255,66,0,0,17,144,57,184,140,192,81,0,0,0,208,165, -128,50,32,5,58,2,224,173,128,16,57,176,140,0,4,0,136,145, -64,173,88,8,78,165,89,0,144,165,146,0,144,165,144,1,224, -181,128,8,12,165,89,148,128,165,88,18,64,165,58,0,30,128, -92,16,73,8,89,0,208,4,132,1,30,128,92,16,73,8,89,0,208, -4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,30,128,92,135,25,152, -88,1,25,144,89,255,0,136,140,0,48,168,140,176,228,0,0,0, -48,184,140,0,4,0,136,0,48,176,140,192,81,0,0,0,144,165, -128,14,32,5,61,0,80,149,146,20,0,0,8,0,208,165,144,8,12, -165,89,148,64,164,88,0,80,165,146,16,80,128,89,144,224,4, -90,4,96,173,140,23,16,185,89,8,160,181,140,204,255,255,22, -0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,0,48,240,140,144, -165,0,0,30,22,136,92,0,0,240,140,144,48,0,90,1,9,132,89, -22,0,0,20,16,22,160,92,148,48,0,90,1,9,132,89,244,255, -255,19,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0, -0,208,172,144,4,78,164,89,17,57,136,140,0,0,0,0,17,1, -237,89,127,0,64,140,29,32,2,90,0,48,168,146,64,20,0,80, -198,0,0,22,8,14,164,89,0,48,48,140,84,0,0,32,0,48,40, -140,96,0,0,32,135,25,32,88,0,52,141,140,112,4,0,96,0, -144,145,146,0,80,33,146,0,80,164,176,0,80,164,176,0,80, -164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164, -176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176, -0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80, -164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164, -176,0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176, -0,80,164,176,0,80,164,176,0,80,164,176,0,80,164,176,0,80, -164,176,0,162,148,140,127,0,64,140,0,116,239,140,128,255, -255,255,29,32,2,90,0,80,164,176,0,80,164,176,0,80,164, -176,100,255,255,17,63,0,64,140,110,0,234,54,0,48,144,146, -84,0,0,32,134,25,168,88,0,48,168,146,96,0,0,32,8,14,164, -89,0,52,165,140,112,4,0,96,0,16,37,176,0,16,37,176,0,16, -37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176, -0,16,37,176,0,16,37,176,0,16,37,176,0,16,37,176,0,16,37, -176,0,16,37,176,0,161,148,140,21,65,239,89,0,16,37,176,0, -16,37,176,0,16,165,176,78,96,255,51,0,48,144,146,84,0,0, -32,31,88,168,89,0,48,168,146,96,0,0,32,8,14,164,89,0,52, -165,140,112,4,0,96,0,16,37,176,0,16,37,176,0,16,37,176, -0,16,37,176,0,16,37,176,128,160,148,140,21,65,239,89,0, -16,37,176,0,16,37,176,0,16,165,176,58,96,191,51,0,48,144, -146,80,0,0,32,8,14,164,89,0,52,165,140,112,4,0,96,0,16, -37,176,0,16,37,176,0,16,37,176,96,160,148,140,24,73,239, -89,0,16,37,176,0,16,37,176,0,16,165,176,46,96,95,51,8, -14,164,89,0,48,144,146,72,0,0,32,0,52,165,140,112,4,0, -96,48,160,148,140,12,73,239,89,0,16,37,176,0,16,37,176,0, -16,165,176,50,96,31,51,8,14,164,89,0,48,32,140,64,0,0, -32,0,52,141,140,112,4,0,96,4,73,239,89,0,16,145,146,29, -240,0,90,16,160,148,140,0,80,164,176,236,255,255,17,50,96, -7,58,8,14,132,89,0,48,168,140,56,0,0,32,0,52,132,140, -124,4,0,96,1,73,239,89,0,80,149,146,157,48,0,90,4,160, -148,140,0,16,164,144,236,255,255,21,0,48,160,144,64,20,0, -80,18,22,128,92,0,208,164,146,0,0,0,10,0,0,0,0,0,48, -240,140,92,168,0,0,30,22,144,92,0,0,240,140,8,78,140,89, -0,116,140,140,64,4,0,64,0,80,164,176,0,16,164,178,0,80, -164,176,16,16,132,89,0,16,164,178,0,80,164,176,16,32,164, -178,0,144,4,132,0,0,0,10,0,48,240,140,148,168,0,0,30,22, -144,92,0,0,240,140,34,96,4,58,8,14,132,89,0,52,132,140, -64,4,0,64,4,73,140,89,145,48,0,90,0,16,164,176,244,255, -255,21,0,144,4,132,0,0,0,10,0,0,0,0,0,0,0,0,8,0,188, -9,221,4,62,3,110,2,242,1,158,1,99,1,55,1,20,1,248,0, -226,0,207,0,191,0,177,0,165,0,155,0,146,0,137,0,130,0, -124,0,118,0,112,0,107,0,103,0,99,0,95,0,91,0,88,0,85,0, -82,0,79,0,77,0,75,0,72,0,70,0,68,0,66,0,65,0,63,0,61, -0,60,0,58,0,57,0,56,0,54,0,53,0,52,0,51,0,50,0,49,0, -48,0,47,0,46,0,45,0,44,0,44,0,43,0,42,0,41,0,41,0,40, -0,39,0,39,0,38,0,37,0,37,0,36,0,36,0,35,0,35,0,34,0, -34,0,33,0,33,0,32,0,32,0,31,0,31,0,31,0,30,0,30,0,29, -0,29,0,29,0,28,0,28,0,28,0,27,0,27,0,27,0,26,0,26,0, -26,0,26,0,25,0,25,0,25,0,24,0,24,0,24,0,24,0,23,0,23, -0,23,0,23,0,23,0,22,0,22,0,22,0,22,0,21,0,21,0,21,0, -21,0,21,0,20,0,20,0,20,0,20,0,20,0,20,0,19,0,19,0,19, -0,19,0,19,0,19,0,18,0,18,0,18,0,18,0,18,0,18,0,18,0, -17,0,17,0,17,0,17,0,17,0,17,0,17,0,17,0,16,0,16,0,16, -0,16,0,16,0,16,0,16,0,16,0,16,0,15,0,15,0,15,0,15,0, -15,0,15,0,15,0,15,0,15,0,14,0,14,0,14,0,14,0,14,0,14, -0,14,0,14,0,14,0,14,0,14,0,13,0,13,0,13,0,13,0,13,0, -13,0,13,0,13,0,13,0,13,0,13,0,13,0,13,0,12,0,12,0,12, -0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0,12,0, -12,0,12,0,11,0,11,0,11,0,11,0,11,0,11,0,11,0,11,0,11, -0,11,0,11,0,11,0,11,0,11,0,11,0,11,0,11,0,10,0,10,0, -10,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,10, -0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,10,0,9,0,9,0,9, -0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0,9,0, -9,0,9,0,8,0,0,48,32,140,0,178,0,0,0,48,40,140,32,12,0, -80,0,30,48,92,0,30,56,92,80,0,32,178,0,48,40,140,36,12, -0,80,144,0,32,178,0,48,40,140,40,12,0,80,208,0,32,178,0, -48,40,140,44,12,0,80,16,1,32,178,0,30,32,92,0,30,40,92, -80,0,64,140,144,0,72,140,208,0,80,140,16,1,88,140,16,32, -34,178,16,96,34,178,16,160,34,178,16,224,34,178,0,48,32, -140,64,8,0,64,0,48,40,140,64,0,0,112,32,32,34,178,0,48, -32,140,64,9,0,64,0,48,40,140,64,1,0,112,32,96,34,178,0, -48,32,140,64,10,0,64,0,48,40,140,64,2,0,112,32,160,34, -178,0,48,32,140,64,11,0,64,0,48,40,140,64,3,0,112,32, -224,34,178,0,30,40,92,0,48,32,140,0,16,0,80,48,32,34, -178,0,48,32,140,4,16,0,80,48,96,34,178,0,48,32,140,8,16, -0,80,48,160,34,178,0,48,32,140,12,16,0,80,48,224,34,178, -80,1,64,140,0,48,32,140,176,174,0,0,8,32,42,140,0,32,34, -154,5,22,56,92,0,48,32,140,80,3,0,0,16,32,49,144,18,160, -1,50,8,200,41,89,0,208,33,154,8,200,57,89,0,48,32,140, -128,3,0,0,16,32,49,144,18,160,1,50,8,200,41,89,0,208,33, -154,8,200,57,89,0,48,32,140,176,3,0,0,16,32,49,144,18, -160,1,50,8,200,41,89,0,208,33,154,8,200,57,89,0,48,32, -140,32,228,0,0,16,32,49,144,14,160,1,50,0,208,33,146,8, -200,57,89,4,201,57,89,8,32,42,140,0,208,41,146,0,30,32, -92,0,30,40,92,0,30,48,92,0,30,56,92,48,32,34,178,208,1, -64,140,0,48,32,140,16,176,0,0,0,48,40,144,32,3,0,0,0, -48,48,144,36,3,0,0,0,32,34,178,0,30,32,92,0,30,48,92, -16,32,34,178,32,32,34,178,16,2,64,140,0,48,32,140,224, -183,0,0,0,32,34,178,0,0,32,140,60,32,34,146,144,1,64, -140,0,48,32,140,0,185,0,0,0,32,34,178,80,2,64,140,80,0, -32,140,0,16,34,146,4,8,66,89,0,16,34,146,4,8,66,89,0, -16,34,146,4,8,66,89,0,16,34,146,4,8,66,89,80,1,32,140, -0,16,34,146,4,8,66,89,208,1,32,140,0,16,34,146,4,8,66, -89,16,2,32,140,0,16,34,146,4,8,66,89,144,1,32,140,0,16, -34,146,0,48,32,140,0,192,255,15,0,48,32,146,240,2,0,0,0, -48,32,140,240,63,0,0,0,48,32,146,244,2,0,0,0,0,32,140, -0,48,32,146,248,2,0,0,6,0,32,140,0,48,32,146,252,2,0,0, -0,2,40,140,32,0,48,140,0,48,56,140,80,237,2,0,132,2,56, -146,7,22,32,92,4,64,57,89,240,33,57,146,1,137,181,89,240, -191,5,53,0,30,56,92,240,33,57,146,0,48,64,140,192,2,0,0, -12,0,56,140,0,48,64,146,44,3,0,0,144,0,48,140,8,32,50, -146,7,0,42,89,0,16,42,146,5,22,64,92,208,0,48,140,8,32, -50,146,7,0,42,89,0,16,42,146,5,22,64,92,16,1,48,140,8, -32,50,146,0,32,242,146,0,48,240,146,40,3,0,0,0,0,0,10, -0,0,0,0,0,0,0,0,0,48,32,144,40,3,0,0,0,48,40,140,40, -3,0,0,94,32,1,50,4,32,49,144,16,128,129,50,4,22,40,92, -0,16,33,144,236,255,255,8,0,16,49,144,0,48,56,144,44,3, -0,0,0,80,49,146,0,16,57,146,0,48,32,146,44,3,0,0,80,2, -24,140,8,32,41,144,208,0,48,140,4,200,24,89,16,128,41,52, -4,200,24,89,8,128,41,50,4,200,24,89,80,0,48,140,0,208, -48,146,0,0,0,10,80,2,24,140,0,48,40,140,64,4,0,64,0,48, -48,140,128,8,0,64,0,48,56,140,64,20,0,80,0,48,64,140,64, -4,0,96,255,15,72,140,0,48,80,144,96,86,0,0,0,48,88,140, -8,0,0,16,0,48,96,140,64,12,0,80,0,48,104,140,0,0,0,48, -0,48,112,140,96,0,0,48,0,0,120,140,0,30,240,92,0,48,136, -144,112,228,0,0,0,48,128,140,255,255,15,0,0,80,132,146,0, -80,132,144,144,0,132,88,1,9,132,89,0,80,132,146,242,63,4, -53,0,208,130,144,12,32,4,50,0,80,131,144,244,255,255,8,0, -208,32,144,0,16,161,176,0,16,5,132,0,0,0,0,44,224,3,50, -0,0,120,140,0,48,136,144,120,228,0,0,0,0,120,140,0,80, -148,144,136,25,128,88,1,160,148,140,0,80,148,146,0,48,128, -146,4,0,0,32,0,80,197,152,4,200,24,89,28,32,150,144,4, -32,201,146,0,144,132,144,64,32,4,53,174,95,174,50,0,80, -198,152,28,32,150,144,0,144,132,144,44,32,4,53,154,95,174, -50,0,80,198,152,28,32,150,144,0,144,132,144,24,32,4,53, -134,95,174,50,0,80,198,152,28,32,150,144,0,144,132,144, -116,63,4,50,0,16,230,152,110,95,231,49,0,0,208,140,12,32, -222,144,120,0,200,140,28,65,231,89,90,31,223,49,155,56, -232,140,0,0,0,0,0,48,128,146,48,0,0,32,29,128,214,89,0, -48,232,146,96,0,0,32,29,65,206,89,4,160,164,144,2,30,168, -92,32,32,182,152,0,144,244,146,8,136,148,89,0,48,160,146, -56,0,0,32,8,192,149,54,22,22,144,92,0,144,132,144,0,144, -171,146,27,1,231,89,12,32,4,50,10,0,223,49,176,95,238,54, -28,32,150,146,0,16,222,144,24,32,206,144,1,140,142,89,155, -93,230,140,27,64,140,89,0,16,142,146,0,208,130,128,254,63, -68,49,8,137,214,89,0,80,131,176,0,168,6,90,0,80,163,176, -8,8,239,89,0,16,135,154,8,72,231,89,0,80,151,154,8,8, -239,89,0,16,167,154,8,72,231,89,0,80,183,154,200,255,255, -21,160,254,255,8,0,0,0,0,0,0,0,0,0,0,0,0,0,80,213,152, -132,2,200,144,4,200,24,89,120,0,192,140,128,190,6,50,126, -126,6,50,0,30,184,92,154,208,155,88,26,210,151,88,3,206, -212,89,70,0,214,49,26,192,189,89,0,80,245,146,0,48,144, -146,48,0,0,32,0,48,208,146,96,0,0,32,21,16,170,89,244, -97,222,146,26,1,198,89,0,80,214,146,8,128,173,54,20,32, -169,144,0,80,213,152,240,97,206,144,8,160,6,50,180,127,6, -53,0,48,160,140,16,176,0,0,0,16,161,178,132,2,160,144,0, -16,181,144,0,208,130,128,250,159,133,52,22,193,189,89,0, -16,229,140,0,80,131,176,16,8,239,89,0,80,195,176,8,137, -181,89,0,16,135,178,16,72,231,89,0,80,199,178,230,191,5, -53,10,32,141,136,255,0,144,140,7,32,133,128,145,128,140, -88,1,78,140,89,240,33,213,144,0,116,140,140,160,168,0,0, -143,8,132,88,0,80,140,136,240,33,245,146,10,32,141,138, -238,32,44,53,80,0,144,140,124,96,68,50,0,48,176,144,40,3, -0,0,0,16,173,144,4,160,157,144,18,160,5,50,96,192,172,50, -0,144,181,144,240,255,255,8,0,48,176,144,44,3,0,0,82,160, -5,50,4,160,173,146,0,144,133,144,0,48,136,144,40,3,0,0, -0,48,128,146,44,3,0,0,0,144,141,146,0,48,176,146,40,3,0, -0,80,2,144,140,8,160,141,144,208,0,128,140,4,136,148,89, -16,0,140,52,4,136,148,89,8,0,140,50,4,136,148,89,0,144, -140,146,8,160,149,144,0,48,192,144,112,86,0,0,24,160,132, -144,1,8,198,89,0,48,192,146,112,86,0,0,44,32,4,53,0,48, -128,140,200,191,0,0,24,160,164,146,80,0,136,140,0,160,132, -146,42,128,140,53,0,48,128,140,192,191,0,0,0,160,132,146, -24,0,0,8,240,33,140,144,12,96,4,50,17,22,128,92,244,255, -255,8,240,33,164,146,26,22,160,92,188,254,5,53,132,2,160, -146,200,252,255,8,16,2,144,140,60,160,132,144,214,63,4,53, -0,48,152,140,240,183,0,0,60,160,164,146,0,160,156,146,212, -255,255,8,0,0,0,0,0,48,136,144,12,0,0,16,48,0,144,140, -214,133,140,52,0,144,193,152,0,48,160,176,240,2,0,0,137, -64,206,88,194,101,6,50,152,0,133,88,152,128,149,88,238,36, -4,53,152,64,141,88,23,132,148,89,145,131,140,88,145,57, -216,140,80,237,0,0,16,224,150,152,42,37,30,55,0,144,4, -132,0,48,128,176,0,3,0,0,17,29,132,140,0,16,148,144,28, -160,4,53,0,48,128,144,160,86,0,0,1,8,132,89,0,48,128, -146,160,86,0,0,40,4,0,8,60,224,230,144,1,72,140,89,0, -144,196,146,145,192,140,88,0,16,244,146,8,160,156,140,0, -16,135,144,0,48,136,146,4,3,0,0,24,224,150,146,28,224, -158,146,40,32,4,53,28,22,128,92,160,6,0,9,0,16,135,144, -24,32,4,53,40,32,135,144,0,16,140,144,1,72,140,89,0,16, -140,146,180,3,0,8,24,32,143,144,1,9,132,89,144,93,140, -140,28,224,158,144,0,80,148,144,4,96,180,144,52,224,190, -144,0,16,135,146,0,208,148,146,8,200,156,89,28,224,158, -146,2,204,165,89,0,48,144,140,112,186,0,0,25,22,152,92,0, -48,184,140,255,255,255,255,4,78,134,89,16,224,150,154,2, -78,142,89,104,7,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,208, -129,144,0,48,136,140,123,221,4,199,150,1,140,53,0,48,128, -144,100,86,0,0,20,224,166,144,0,48,152,140,255,255,0,0,0, -48,136,144,116,86,0,0,20,0,132,89,1,96,140,140,0,48,128, -146,100,86,0,0,0,48,136,146,116,86,0,0,146,192,148,88,24, -224,134,152,48,224,166,160,16,65,140,89,8,73,140,89,3,76, -140,89,4,32,140,146,12,8,164,89,0,80,156,140,40,64,149, -54,0,16,173,146,21,129,148,89,8,32,165,140,24,128,149,54, -0,16,181,146,22,129,148,89,8,32,165,140,1,201,156,89,236, -255,255,8,0,16,149,146,20,224,12,50,8,32,165,140,0,16, -245,146,8,0,0,8,0,0,0,0,0,48,152,144,16,3,0,0,2,72, -140,89,0,208,148,144,36,160,4,53,0,48,160,144,120,228,0, -0,1,0,168,140,136,25,176,88,0,16,173,146,0,48,176,146,4, -0,0,32,220,255,255,8,1,76,140,89,0,48,160,176,0,3,0,0, -1,136,173,89,22,29,133,146,151,64,181,88,0,48,176,146,8, -3,0,0,1,75,140,90,0,16,164,176,16,8,132,89,0,48,144,146, -64,0,0,32,16,136,148,89,0,144,163,178,228,255,255,21,0, -48,136,144,20,3,0,0,4,224,132,144,0,208,244,146,8,200, -156,89,17,224,4,90,12,0,0,19,0,48,152,144,24,3,0,0,2, -30,136,92,0,48,128,146,56,0,0,32,0,144,139,146,0,48,152, -146,16,3,0,0,1,224,123,140,40,224,35,49,0,0,120,140,0, -48,136,144,120,228,0,0,136,25,128,88,0,80,148,144,1,160, -148,140,0,48,128,146,4,0,0,32,0,80,148,146,0,104,6,90, -20,224,246,146,0,48,128,140,80,178,0,0,16,224,134,146,138, -253,255,21,52,253,255,8,0,48,152,140,255,255,0,0,146,192, -148,88,20,224,142,144,2,140,148,89,17,58,128,140,0,0,0,0, -2,78,140,89,17,1,132,89,12,0,148,51,12,9,132,89,26,0, -148,49,0,48,128,144,108,86,0,0,1,8,132,89,0,48,128,146, -108,86,0,0,0,48,136,144,120,86,0,0,0,30,232,92,1,72,140, -89,0,48,136,146,120,86,0,0,4,0,0,8,0,48,128,144,104,86, -0,0,20,224,166,144,20,0,132,89,0,48,128,146,104,86,0,0, -24,224,134,152,16,65,140,89,8,73,140,89,3,76,140,89,4,32, -140,146,4,72,140,89,0,48,152,144,16,3,0,0,1,76,140,89,0, -48,160,176,0,3,0,0,1,136,173,89,22,29,133,146,151,64,181, -88,0,48,176,146,8,3,0,0,0,208,148,144,36,160,4,53,0,48, -160,144,120,228,0,0,1,0,168,140,136,25,176,88,0,16,173, -146,0,48,176,146,4,0,0,32,220,255,255,8,1,75,140,90,0, -48,144,146,64,0,0,32,16,136,148,89,0,16,164,176,16,8,132, -89,0,144,163,178,228,255,255,21,0,48,136,144,20,3,0,0,4, -224,132,144,0,208,244,146,8,200,156,89,17,224,4,90,12,0, -0,19,0,48,152,144,24,3,0,0,10,30,136,92,0,48,152,146,16, -3,0,0,0,48,128,146,56,0,0,32,0,144,139,146,1,224,123, -140,40,224,35,49,0,0,120,140,0,48,136,144,120,228,0,0, -136,25,128,88,0,80,148,144,1,160,148,140,0,80,148,146,0, -48,128,146,4,0,0,32,20,224,246,146,0,48,128,140,192,182, -0,0,12,32,14,48,0,48,128,140,80,178,0,0,16,224,134,146, -18,96,39,49,4,73,239,89,0,80,129,176,248,127,39,54,16,96, -7,50,0,80,129,144,1,73,239,89,244,255,255,8,140,123,6,50, -216,251,255,8,0,0,0,0,0,48,128,176,0,3,0,0,24,224,142, -144,18,29,140,146,1,136,148,89,146,192,148,88,0,48,144, -146,8,3,0,0,0,48,128,140,192,182,0,0,20,224,246,146,16, -224,134,146,16,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,48, -128,144,104,86,0,0,25,0,132,89,0,48,128,146,104,86,0,0, -124,32,14,48,0,48,136,140,80,178,0,0,0,48,128,144,128,86, -0,0,16,224,142,146,1,32,132,140,0,48,128,146,128,86,0,0, -88,0,0,8,0,0,0,0,0,48,128,144,20,86,0,0,25,0,132,89,0, -48,128,146,20,86,0,0,60,0,0,8,0,48,160,140,0,0,240,15, -152,0,165,88,0,48,128,140,8,86,0,0,20,129,165,88,12,32, -5,53,0,48,128,140,16,86,0,0,0,16,140,144,25,64,140,89,0, -16,140,146,8,0,0,8,0,0,0,0,0,80,129,176,1,104,6,90,0, -80,129,176,1,73,206,89,0,80,129,176,236,255,255,20,152, -250,255,8,0,0,0,0,224,255,255,8,0,0,0,0,0,0,0,0,0,0, -0,0,27,22,128,92,24,22,136,92,25,22,144,92,32,0,160,178, -48,0,192,178,64,0,224,178,248,214,255,9,64,0,224,176,48, -0,192,176,32,0,160,176,88,250,255,8,0,0,0,0,27,22,128, -92,24,22,136,92,25,22,144,92,32,0,160,178,48,0,192,178, -64,0,224,178,168,220,255,9,64,0,224,176,48,0,192,176,32, -0,160,176,40,250,255,8,0,0,0,0,4,200,24,89,188,246,255, -8,0,0,0,0,0,0,0,0,0,48,160,144,0,16,0,80,32,0,160,178, -48,0,192,178,64,0,224,178,0,48,128,140,32,12,0,80,0,16, -140,144,254,127,4,53,60,32,129,144,7,32,188,128,143,200, -189,88,6,32,140,128,4,32,148,136,0,30,152,92,10,32,196, -136,0,0,160,140,0,30,168,92,0,48,192,146,0,16,0,80,16, -32,180,140,0,32,132,144,12,224,37,50,4,211,255,9,8,0,0, -8,204,222,255,9,0,48,128,140,32,12,0,80,0,16,140,144,254, -127,4,53,64,0,224,176,48,0,192,176,32,0,160,176,0,48,160, -146,0,16,0,80,60,32,153,144,244,225,140,144,2,30,144,92, -0,48,136,146,56,0,0,32,0,144,147,146,4,224,132,144,0,48, -136,140,0,0,0,240,145,0,132,88,50,32,4,50,1,224,123,140, -40,224,35,49,0,0,120,140,0,48,136,144,120,228,0,0,136,25, -128,88,0,80,148,144,1,160,148,140,0,80,148,146,0,48,128, -146,4,0,0,32,240,225,148,144,132,2,136,144,0,168,4,90, -240,225,140,146,132,2,152,146,60,32,145,146,246,254,255,21, -0,48,128,140,224,183,0,0,0,32,129,146,228,254,255,8,0,48, -144,144,112,228,0,0,0,48,128,144,8,228,0,0,0,144,156,144, -80,2,24,140,1,200,156,89,0,16,140,144,0,144,156,146,124, -117,4,50,0,48,80,146,96,86,0,0,48,0,192,178,64,0,224, -178,184,159,255,9,64,0,224,176,48,0,192,176,92,245,255,8, -0,0,0,0,0,0,0,0,28,32,36,144,16,22,24,92,0,16,129,144, -204,32,4,50,120,0,96,140,0,224,48,152,0,0,64,140,12,224, -40,144,6,193,49,89,182,128,41,49,133,56,56,140,0,0,0,0, -0,48,128,146,48,0,0,32,7,0,66,89,0,48,56,146,96,0,0,32, -7,1,99,89,4,32,73,144,32,224,80,152,0,16,241,146,8,8,33, -89,0,48,72,146,56,0,0,32,8,192,34,54,10,22,32,92,2,30, -88,92,0,16,129,144,0,48,88,146,96,0,0,48,5,129,49,89,14, -64,49,52,10,32,4,50,172,31,59,54,28,224,32,146,0,208,40, -144,24,224,48,144,1,12,58,89,133,157,49,140,5,192,57,89, -0,208,56,146,0,48,32,140,8,0,0,16,0,48,72,140,0,0,0,48, -0,16,129,128,254,63,36,49,4,9,66,89,0,80,98,176,0,144, -97,154,8,136,49,89,0,144,113,154,8,136,49,89,224,63,2,53, -0,0,0,10,0,0,0,0,0,48,24,144,116,228,0,0,0,48,40,144, -120,228,0,0,1,0,48,140,136,25,56,88,0,208,32,144,26,32, -1,48,0,48,240,146,4,0,0,32,0,80,49,146,0,48,56,146,4,0, -0,32,0,0,0,10,0,0,0,0,0,0,0,0,0,208,166,176,25,192, -156,89,25,57,136,140,0,0,0,0,20,224,158,146,4,78,134,89, -0,208,185,146,17,1,228,89,50,33,14,55,0,30,200,92,0,0, -232,140,16,0,229,54,20,1,239,89,142,32,5,50,0,16,229,140, -48,0,168,140,28,1,165,89,21,22,184,92,8,64,229,51,28,22, -184,92,2,206,149,89,0,48,176,146,84,0,0,32,23,65,141,89, -0,48,184,146,96,0,0,32,0,48,128,140,232,186,0,0,18,128, -181,89,17,28,4,132,0,16,130,176,0,16,130,176,0,16,130, -176,0,16,130,176,0,16,130,176,0,16,130,176,0,16,130,176, -0,16,130,176,0,16,130,176,0,16,130,176,0,16,130,176,23,1, -231,89,0,16,130,176,152,63,7,52,18,96,7,53,0,208,185,144, -0,224,166,178,212,246,255,8,28,224,150,144,24,224,142,144, -0,48,128,144,140,228,0,0,17,129,148,89,236,25,148,51,64, -224,230,144,20,224,142,144,85,5,144,140,0,16,135,144,218, -153,140,49,40,32,4,53,28,22,128,92,236,253,255,9,0,16, -135,144,24,32,4,53,40,32,135,144,0,16,140,144,1,72,140, -89,0,16,140,146,176,249,255,8,24,32,143,144,1,9,132,89, -144,93,140,140,28,224,158,144,0,80,148,144,4,96,180,144, -56,224,190,144,0,16,135,146,0,208,148,146,8,200,156,89,28, -224,158,146,2,204,165,89,0,80,231,140,224,254,255,8,0,0, -0,0,1,73,206,89,0,0,232,140,8,33,101,54,10,30,184,92,0, -0,232,140,16,0,189,54,20,193,237,89,0,16,189,140,82,32,5, -50,151,56,144,140,0,0,0,0,0,48,176,146,84,0,0,32,22,128, -180,89,0,48,184,146,96,0,0,32,22,224,37,49,8,232,5,90,0, -16,130,176,4,201,189,89,244,255,255,22,26,224,13,49,0,16, -130,144,18,224,21,49,0,16,130,144,10,224,29,49,0,16,130, -144,144,96,7,50,28,224,150,144,24,224,142,144,0,48,128, -144,140,228,0,0,17,129,148,89,12,0,148,52,2,72,239,89, -228,248,255,8,64,224,230,144,0,16,135,144,44,32,4,53,28, -22,128,92,240,252,255,9,0,16,135,144,28,32,4,53,40,32, -135,144,0,16,140,144,1,72,140,89,0,16,140,146,2,72,239, -89,176,248,255,8,24,32,143,144,1,9,132,89,144,93,140,140, -28,224,158,144,0,80,148,144,4,96,180,144,56,224,190,144,0, -16,135,146,0,208,148,146,8,200,156,89,28,224,158,146,2, -204,165,89,29,22,184,92,24,255,255,8,0,80,145,152,112,246, -255,8,0,0,0,0,0,0,0,0,0,0,0,0,0,48,176,146,72,0,0,32, -0,16,130,176,0,16,130,176,0,16,130,176,76,246,255,8,0,0, -0,0,0,0,0,0,0,80,149,144,74,0,152,140,84,0,128,140,6, -213,148,51,32,32,193,176,0,0,224,140,18,1,164,89,0,16, -214,146,20,57,136,140,0,0,0,0,4,14,133,89,0,16,219,146, -120,0,216,140,17,1,236,89,0,0,160,140,27,65,239,89,48, -192,190,52,27,57,144,140,0,0,0,0,27,0,231,89,0,48,176, -146,48,0,0,32,27,193,189,89,0,48,216,146,96,0,0,32,18, -128,181,89,0,208,162,144,76,0,0,8,30,224,5,50,0,48,176, -146,48,0,0,32,23,193,222,89,0,48,184,146,96,0,0,32,23,0, -231,89,16,32,129,152,128,11,132,90,0,208,162,144,108,0,0, -18,0,80,180,152,8,96,140,140,3,200,189,89,16,32,129,154, -2,204,189,89,144,255,6,53,0,208,162,144,40,32,101,54,0, -208,162,144,120,0,216,140,244,63,7,53,116,95,223,54,0,16, -219,144,8,32,177,154,44,32,217,146,56,244,255,8,0,0,0,0, -0,80,134,176,12,9,165,89,1,160,82,140,0,80,134,176,12,9, -231,89,0,80,134,176,232,63,101,54,0,208,162,144,184,255, -255,8,20,32,101,54,0,208,162,144,248,63,103,54,46,0,167, -50,240,255,255,8,0,80,134,176,12,9,231,89,0,80,134,176,1, -160,82,140,12,9,165,89,0,80,134,176,232,63,101,54,0,208, -162,144,204,255,255,8,130,139,214,88,48,32,87,51,0,80,134, -176,0,48,160,140,255,255,255,79,0,80,134,176,153,0,165,88, -0,80,134,160,0,16,245,146,1,160,82,140,10,30,160,92,0,16, -214,146,56,0,0,8,28,145,162,89,0,16,214,146,26,32,39,49, -4,9,231,89,0,80,134,176,14,32,39,49,4,9,231,89,0,80,134, -176,14,32,23,49,2,9,231,89,0,80,134,152,10,32,15,49,0, -80,134,144,2,14,165,89,0,48,144,140,255,255,255,79,2,158, -138,89,0,48,128,140,192,190,0,0,20,65,140,89,146,64,166, -88,16,64,132,89,24,32,153,144,0,16,4,132,0,16,245,146,0, -16,245,146,0,16,245,146,0,16,245,146,0,16,245,146,0,16, -245,146,0,16,245,146,0,16,245,146,0,16,245,146,0,16,245, -146,4,224,132,136,1,136,82,89,0,16,133,146,0,16,131,144, -244,225,140,144,16,21,128,88,0,48,136,146,56,0,0,32,2,30, -144,92,0,16,133,146,0,144,147,146,4,224,132,144,0,48,136, -140,0,0,0,240,145,0,132,88,50,32,4,50,1,224,123,140,40, -224,35,49,0,0,120,140,0,48,136,144,120,228,0,0,0,80,148, -144,1,160,148,140,136,25,128,88,0,80,148,146,0,48,128,146, -4,0,0,32,240,225,148,144,132,2,136,144,0,168,4,90,132,2, -152,146,240,225,140,146,52,0,0,21,0,48,144,144,112,228,0, -0,0,48,128,140,32,192,0,0,0,144,156,144,0,48,136,140,0, -0,32,0,24,32,241,146,19,64,140,89,0,32,129,146,8,32,137, -146,104,242,255,8,10,160,140,136,10,224,132,136,52,64,132, -50,0,48,128,140,192,191,0,0,24,32,145,146,0,32,129,146, -72,242,255,8,0,0,0,0,0,80,133,144,60,50,4,53,0,48,128, -140,240,188,0,0,24,32,145,144,0,32,129,146,48,32,153,144, -10,160,140,136,0,160,228,144,1,25,232,89,0,208,140,146,24, -0,136,140,6,160,132,128,18,64,140,89,16,160,180,152,1,9, -132,89,3,224,189,140,24,32,145,146,2,204,189,89,16,32,129, -154,40,32,225,154,8,32,177,154,216,252,255,8,0,0,0,0,0, -48,144,144,112,228,0,0,0,144,156,144,212,145,157,53,40,32, -129,144,108,237,255,9,0,48,128,140,0,178,0,0,0,32,129, -146,188,241,255,8,0,0,0,0,0,0,0,0,17,22,144,92,0,0,136, -140,8,3,0,8,0,0,0,0,160,22,0,9,12,0,0,9,232,17,0,8,0, -0,0,0,128,5,0,9,84,1,0,11,120,3,0,9,196,3,0,8,128,192, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,240,215,0,0,16,216,0,0, -48,216,0,0,80,216,0,0,112,216,0,0,144,216,0,0,176,216,0, -0,208,216,0,0,240,216,0,0,16,217,0,0,48,217,0,0,240,215, -0,0,145,48,0,90,0,20,32,140,0,0,0,0,0,48,160,140,204, -192,0,0,20,1,33,89,10,0,0,18,38,32,92,51,0,52,241,133, -216,215,0,0,31,152,153,89,0,208,236,140,0,16,236,146,0, -52,129,140,96,194,0,0,0,0,0,10,0,52,161,140,160,194,0,0, -145,32,5,90,16,57,144,140,192,230,0,0,0,144,188,144,16, -22,128,92,22,0,0,21,0,52,137,140,240,215,0,0,52,0,0,8, -0,0,0,0,0,52,161,140,128,194,0,0,38,0,141,61,0,52,161, -140,128,192,0,0,16,61,169,144,144,192,0,0,0,16,181,144, -21,0,173,89,22,65,173,89,0,96,141,140,0,52,161,140,240, -215,0,0,151,32,5,90,0,144,140,146,16,22,128,92,18,0,0, -21,0,52,185,140,160,194,0,0,48,0,0,8,0,52,161,140,128, -192,0,0,16,61,169,144,144,192,0,0,0,16,181,144,21,0,173, -89,22,65,173,89,0,96,173,140,14,64,189,61,0,52,185,140, -128,194,0,0,23,22,128,92,0,0,0,10,0,0,0,0,0,0,0,0,0, -0,0,0,0,20,240,140,148,0,0,0,30,22,152,92,0,0,240,140, -0,30,136,92,0,20,160,140,0,0,0,0,0,48,168,140,220,193,0, -0,21,1,165,89,0,52,189,140,128,192,0,0,0,0,144,140,0,48, -176,140,192,230,0,0,0,52,165,140,144,192,0,0,0,208,133, -144,0,16,173,144,21,192,173,89,16,65,173,89,21,128,172,89, -0,144,173,146,4,32,173,144,21,192,173,89,16,65,173,89,21, -128,172,89,4,160,173,146,8,32,173,144,17,208,136,89,145, -240,2,90,21,192,173,89,16,65,173,89,21,128,172,89,8,160, -173,146,22,16,179,89,12,32,165,140,180,255,255,22,0,208,4, -132,0,0,0,10,0,20,240,140,12,0,0,0,30,22,128,92,0,0, -240,140,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240, -140,12,0,0,0,30,22,128,92,0,0,240,140,0,16,4,132,0,0,0, -10,0,0,0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22,128,92, -0,0,240,140,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,16, -22,56,92,180,20,0,11,16,22,40,92,236,20,0,11,5,16,50,89, -28,0,0,8,12,96,33,146,6,22,128,92,248,22,0,11,4,125,129, -144,16,0,0,0,0,16,4,134,6,22,128,92,164,22,0,11,12,96, -161,144,1,9,37,89,216,63,1,62,5,16,130,89,208,22,0,11,5, -22,128,92,136,22,0,11,4,96,33,144,34,32,1,58,32,32,161, -144,5,22,128,92,4,96,161,146,176,22,0,11,4,22,128,92,144, -3,0,9,216,255,255,8,7,22,128,92,44,23,0,11,7,22,128,92, -140,17,0,8,0,0,0,0,0,0,0,0,10,30,128,92,236,2,0,9,1, -30,128,92,116,17,0,8,0,20,240,140,132,0,0,0,7,168,4,90, -0,144,239,140,16,210,153,88,0,0,240,140,24,78,164,89,0, -16,180,140,8,12,173,89,78,0,0,19,19,32,4,90,7,224,156, -140,148,67,165,88,28,0,0,18,22,224,4,90,0,144,141,130,1, -137,148,89,1,160,181,140,240,255,255,21,42,160,60,51,16, -12,173,89,148,67,165,88,20,22,168,92,15,168,4,90,0,144, -165,154,8,137,148,89,8,160,181,140,240,255,255,20,24,160, -4,51,1,168,4,90,0,144,141,130,1,137,148,89,1,160,181,140, -240,255,255,21,0,80,7,132,0,0,0,10,144,0,128,140,36,19, -0,11,144,48,0,90,0,16,36,140,16,22,128,92,22,0,0,21,208, -19,0,11,0,16,132,144,0,0,0,10,0,0,0,0,4,32,244,146,92, -21,0,11,12,32,241,146,4,16,130,89,80,21,0,11,0,30,128, -92,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,24,22,40,92,64, -96,8,140,112,224,207,146,120,224,215,154,4,222,129,89,228, -18,0,11,144,48,0,90,0,16,36,140,16,22,128,92,30,0,0,21, -112,19,0,11,0,16,132,144,5,22,192,92,112,224,207,144,120, -224,215,152,0,0,0,10,138,25,128,88,76,4,0,9,0,16,129, -146,16,22,64,92,0,0,72,140,8,32,129,146,16,22,80,92,0,0, -128,140,1,30,88,92,4,32,73,146,12,32,89,146,76,21,0,11, -4,16,164,89,0,16,133,146,16,22,192,92,28,32,129,140,24, -32,241,146,138,25,200,88,0,0,208,140,68,224,247,146,4,32, -205,146,72,224,247,146,160,20,0,11,76,224,247,146,72,224, -55,152,1,30,128,92,36,32,241,146,40,32,49,154,8,21,0,11, -52,32,129,146,24,17,0,9,48,32,161,140,144,48,0,90,0,16, -101,152,16,22,128,92,14,0,0,18,66,0,96,140,8,0,0,8,2, -30,96,92,138,25,112,88,0,0,120,140,64,32,129,140,96,224, -247,146,0,16,101,178,80,224,247,146,100,224,247,146,64,20, -0,11,6,30,144,92,0,144,60,140,84,224,63,146,96,224,55, -152,80,224,151,152,2,30,128,92,72,32,49,154,80,32,145,154, -156,20,0,11,88,32,129,146,172,16,0,9,144,48,0,90,0,0, -160,140,16,22,128,92,10,0,0,21,138,25,160,88,92,32,161, -146,96,32,241,146,100,32,129,140,240,19,0,11,236,17,0,11, -8,20,0,11,228,17,0,11,4,32,164,144,32,32,161,146,248,17, -0,11,68,32,129,146,240,17,0,11,36,32,132,140,104,32,129, -146,196,17,0,11,16,22,32,92,220,17,0,11,72,32,132,140,4, -32,129,146,176,17,0,11,12,20,0,11,0,30,128,92,5,22,192, -92,112,224,207,144,120,224,215,152,0,0,0,10,0,0,0,0,0,0, -0,0,0,0,0,0,5,222,128,89,100,17,0,11,18,32,4,61,3,30, -128,92,0,0,0,10,0,0,0,0,48,32,164,140,1,30,136,92,0,80, -148,140,0,16,244,146,8,32,164,146,16,32,148,146,0,30,128, -92,0,0,0,10,0,0,0,0,0,0,0,0,48,198,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,16,72,8,89,16,48,3,90,0,20,136,140,0,0,0, -0,0,48,160,140,80,198,0,0,20,65,140,89,70,0,0,17,2,14, -172,89,0,116,180,140,48,198,0,0,0,144,189,144,21,124,164, -144,144,192,0,0,0,116,173,140,192,230,0,0,0,80,141,144, -20,128,165,89,23,1,165,89,0,32,165,140,0,80,165,146,0,80, -4,134,0,30,128,92,0,0,0,10,0,116,244,133,216,215,0,0,31, -152,145,89,0,144,156,140,0,16,156,146,1,25,128,89,0,0,0, -10,0,0,0,0,16,22,32,92,188,0,0,9,16,32,129,144,20,15,0, -9,24,32,129,144,10,32,4,58,152,1,0,9,8,32,129,144,18,32, -4,58,12,32,161,144,10,32,29,55,68,7,0,9,28,32,161,144, -14,32,5,58,4,16,135,89,188,18,0,11,152,16,0,11,110,0,36, -58,144,16,0,11,36,32,132,140,98,0,36,58,132,16,0,11,72, -32,132,140,30,0,36,61,80,0,0,8,0,0,0,0,32,32,161,144,0, -80,165,146,0,7,0,9,52,0,0,8,64,16,0,11,92,18,0,11,56, -16,0,11,16,16,169,89,24,0,0,8,0,0,0,0,0,80,133,144,214, -31,129,58,0,80,165,144,32,32,173,140,0,80,165,144,236,63, -5,61,16,16,0,11,108,18,0,11,0,30,128,92,0,0,0,10,0,0, -0,0,0,0,0,0,144,48,0,90,0,16,36,140,0,30,48,92,22,0,0, -21,240,0,0,9,0,30,128,92,0,0,0,10,0,0,0,0,12,32,164, -144,131,0,232,140,148,64,167,88,30,32,5,61,40,16,0,11,9, -30,232,92,0,80,159,140,0,16,156,146,1,25,128,89,0,0,0, -10,16,16,135,89,204,17,0,11,4,16,42,89,0,80,137,144,134, -96,4,58,0,16,145,144,126,64,148,58,12,32,161,144,9,47,5, -90,16,32,129,144,16,22,128,92,54,0,0,16,17,129,148,89, -196,14,0,9,0,16,161,144,0,80,169,144,21,1,165,89,58,0, -133,58,12,32,161,144,1,25,48,89,133,9,165,88,12,32,161, -146,36,0,0,8,0,0,0,0,0,16,137,144,4,32,145,144,40,17,0, -11,16,17,136,89,16,32,129,144,1,30,144,92,16,14,0,9,12, -32,161,144,8,32,169,144,4,32,241,146,9,14,165,88,12,32, -161,146,0,16,169,146,4,16,135,89,120,17,0,11,6,22,128,92, -0,0,0,10,0,0,0,0,32,14,0,8,0,0,0,0,0,0,0,0,0,0,0,0, -248,14,0,11,20,17,0,11,240,14,0,11,4,32,36,144,132,48,0, -90,0,0,40,140,16,22,128,92,34,0,0,18,4,22,128,92,220, -254,255,9,1,25,144,89,10,128,132,58,5,80,40,89,32,32,33, -144,232,63,1,61,188,14,0,11,24,17,0,11,5,22,128,92,0,0, -0,10,0,0,0,0,18,32,4,61,0,30,128,92,0,0,0,10,0,0,0,0, -0,48,32,144,240,230,0,0,16,208,131,89,132,48,0,90,16,210, -43,88,0,0,168,140,30,0,0,18,16,0,0,8,4,22,168,92,4,32, -33,144,14,32,1,58,12,32,161,144,240,95,161,52,94,32,1,58, -149,48,0,90,4,32,161,144,16,22,128,92,22,0,0,21,0,48, -160,146,240,230,0,0,12,0,0,8,0,0,0,0,4,96,165,146,12, -32,169,144,32,96,161,140,0,48,144,140,255,255,255,255,18, -22,152,92,20,96,5,90,4,32,153,146,16,22,128,92,14,0,0, -17,4,22,128,93,76,4,0,9,4,16,132,89,0,0,0,10,0,48,168, -144,244,230,0,0,218,96,5,58,4,96,165,144,0,48,152,140, -255,255,255,255,202,192,164,58,12,96,165,144,20,65,41,89, -0,80,129,140,120,11,0,9,6,33,4,58,0,48,144,140,255,255, -255,255,250,128,132,58,0,48,32,144,240,230,0,0,0,48,160, -144,244,230,0,0,132,48,0,90,0,0,168,140,16,22,128,92,26, -0,0,18,22,0,37,58,4,22,168,92,4,32,33,144,10,32,1,58, -244,31,37,61,34,32,1,61,244,13,0,11,31,216,145,89,0,144, -156,140,0,16,156,146,4,30,128,92,72,252,255,9,216,254,255, -8,149,48,0,90,4,32,161,144,16,22,128,92,22,0,0,21,0,48, -160,146,240,230,0,0,12,0,0,8,0,0,0,0,4,96,165,146,0,16, -161,176,4,16,132,89,0,48,168,140,255,255,255,255,5,192, -141,89,0,80,188,140,0,16,161,154,8,32,177,146,12,32,137, -146,0,0,0,10,0,0,0,0,5,16,132,89,188,10,0,9,74,32,4, -58,0,48,152,140,255,255,255,255,62,192,132,58,12,32,44, -146,0,48,160,144,244,230,0,0,0,48,64,140,203,173,219,172, -0,48,72,140,255,255,255,255,5,22,88,92,0,16,68,154,0,48, -128,146,244,230,0,0,8,32,164,146,16,16,132,89,0,0,0,10, -52,254,255,8,0,0,0,0,0,0,0,0,0,0,0,0,144,48,0,90,0, -16,68,140,16,22,128,92,14,0,0,21,17,22,128,92,12,254,255, -8,18,96,4,61,100,3,0,9,0,30,128,92,0,0,0,10,16,9,44, -89,0,80,161,144,0,48,152,140,203,173,219,172,26,192,164, -61,0,52,164,144,244,255,255,255,0,48,232,140,255,255,255, -255,30,64,167,58,216,12,0,11,31,216,233,89,0,80,159,140, -0,16,156,146,180,1,0,8,0,0,0,0,12,96,161,144,17,208,139, -89,17,210,51,88,20,129,57,89,26,224,1,60,5,22,128,92,0, -144,137,140,124,2,0,9,8,22,128,92,0,0,0,10,0,48,160,144, -244,230,0,0,50,0,45,61,7,22,128,92,192,9,0,9,6,33,4,58, -0,48,152,140,255,255,255,255,250,192,132,58,12,96,161,144, -8,22,128,92,7,0,165,89,12,96,161,146,0,0,0,10,12,96,161, -144,5,60,37,140,16,0,0,0,4,32,161,144,0,48,232,140,255, -255,255,255,202,64,167,58,0,48,184,144,240,230,0,0,151,32, -1,90,0,0,128,140,16,22,128,92,26,0,0,18,22,224,5,58,23, -22,128,92,4,224,189,144,10,0,185,58,244,255,5,61,26,224, -5,61,20,12,0,11,31,216,233,89,0,80,159,140,0,16,156,146, -240,0,0,8,144,48,0,90,4,224,165,144,16,22,128,92,22,0,0, -21,0,48,160,146,240,230,0,0,12,0,0,8,0,0,0,0,4,32,164, -146,12,96,161,144,0,48,168,144,244,230,0,0,12,224,181,144, -149,224,5,90,22,60,165,140,16,0,0,0,12,96,161,146,16,22, -128,92,18,0,0,21,0,48,40,146,244,230,0,0,16,0,0,8,12, -96,161,144,5,60,45,146,24,0,0,0,12,96,161,144,26,128,161, -52,5,22,128,92,0,144,137,140,100,1,0,9,5,16,132,89,0,0, -0,10,8,96,33,144,14,33,1,58,4,32,161,144,0,48,152,140, -255,255,255,255,254,192,164,58,12,96,161,144,12,32,169,144, -21,60,165,140,16,0,0,0,234,128,161,52,0,48,184,144,240, -230,0,0,151,32,1,90,0,0,128,140,16,22,128,92,26,0,0,18, -22,224,5,58,23,22,128,92,4,224,189,144,10,0,185,58,244, -255,5,61,34,224,5,61,36,11,0,11,31,216,153,89,0,208,236, -140,0,16,236,146,4,30,128,92,120,249,255,9,4,254,255,8, -12,32,161,144,0,48,168,144,244,230,0,0,12,96,177,144,149, -96,1,90,22,60,165,140,16,0,0,0,12,32,161,146,16,22,128, -92,22,0,0,21,0,48,32,146,244,230,0,0,20,0,0,8,0,0,0,0, -12,96,161,144,5,60,37,146,24,0,0,0,144,48,0,90,4,32,161, -144,16,22,128,92,18,0,0,21,0,48,160,146,240,230,0,0,8,0, -0,8,4,32,164,146,0,48,152,140,255,255,255,255,19,22,232, -92,16,32,129,140,4,32,233,146,7,129,145,89,0,16,138,140, -212,2,0,11,4,22,128,92,0,144,137,140,84,0,0,9,4,16,132, -89,0,0,0,10,6,22,128,92,100,251,255,9,144,48,0,90,0,16, -36,140,16,22,128,92,38,0,0,18,7,129,145,89,0,16,138,140, -156,2,0,11,8,22,128,92,160,0,0,9,4,22,128,92,0,0,0,10, -0,0,0,0,48,253,255,8,0,0,0,0,0,0,0,0,0,0,0,0,12,32, -172,144,32,96,164,140,118,64,165,49,16,124,180,140,16,0,0, -0,8,160,133,146,0,48,168,144,244,230,0,0,0,48,144,140, -203,173,219,172,18,22,152,92,0,144,157,146,0,48,144,140, -255,255,255,255,18,22,152,92,12,32,164,144,4,160,157,146, -149,32,4,90,16,9,165,89,17,1,165,89,12,160,165,146,12,32, -140,146,18,0,0,21,0,48,176,146,244,230,0,0,16,0,0,8,12, -160,165,144,22,60,181,146,24,0,0,0,22,16,132,89,8,0,0,8, -0,0,0,10,10,32,4,61,0,0,0,10,16,9,140,89,0,80,164,144, -0,48,232,140,203,173,219,172,34,65,167,61,0,52,164,144, -244,255,255,255,0,48,152,140,255,255,255,255,14,193,164,61, -0,48,168,144,240,230,0,0,98,97,5,58,0,48,160,144,244,230, -0,0,190,0,141,58,12,96,164,144,17,60,133,140,16,0,0,0,4, -32,164,144,0,48,232,140,255,255,255,255,162,64,167,58,149, -32,4,90,0,0,144,140,21,22,184,92,26,0,0,18,22,96,5,58, -23,22,144,92,4,224,189,144,10,0,188,58,244,255,5,61,26, -224,5,61,28,9,0,11,31,216,233,89,0,80,159,140,0,16,156, -146,172,0,0,8,12,96,164,144,0,48,168,144,244,230,0,0,12, -32,180,144,149,32,4,90,22,60,165,140,16,0,0,0,12,96,164, -146,16,22,128,92,22,0,0,21,0,48,136,146,244,230,0,0,20, -0,0,8,0,0,0,0,12,96,164,144,17,60,141,146,24,0,0,0,22, -160,4,61,4,224,165,144,0,48,160,146,240,230,0,0,12,0,0, -8,4,224,165,144,4,160,164,146,8,96,132,144,150,32,4,58,4, -32,164,144,0,48,152,140,255,255,255,255,134,192,164,58,0, -48,184,144,240,230,0,0,22,0,188,58,18,224,5,58,4,224,189, -144,10,0,188,58,248,255,5,61,30,224,5,61,112,8,0,11,31, -216,153,89,0,208,236,140,0,16,236,146,4,30,128,92,196,246, -255,8,12,32,164,144,0,48,168,144,244,230,0,0,12,96,180, -144,149,96,4,90,22,60,165,140,16,0,0,0,12,32,164,146,16, -22,128,92,22,0,0,21,0,48,128,146,244,230,0,0,0,0,0,10, -0,0,0,0,12,32,164,144,16,60,133,146,24,0,0,0,0,0,0,10, -0,48,160,144,240,230,0,0,0,48,136,146,240,230,0,0,4,96, -164,146,0,0,0,10,144,64,132,112,14,32,4,61,0,30,128,92, -0,0,0,10,224,248,255,9,144,48,0,90,0,16,36,140,16,22, -128,92,22,0,0,18,0,52,148,144,252,255,255,255,0,30,136, -92,88,243,255,11,4,22,128,92,0,0,0,10,0,20,240,140,220, -0,0,0,34,162,4,59,16,96,4,90,0,144,239,140,18,64,172,89, -198,0,0,18,21,33,4,90,17,210,152,88,2,1,0,17,19,96,4, -90,0,208,180,144,16,210,160,88,4,224,156,140,178,0,0,21, -16,32,5,90,4,9,165,89,108,0,0,18,8,8,165,89,0,16,140, -140,22,22,184,92,32,0,240,140,128,139,148,90,130,0,0,18, -8,136,247,89,0,80,188,130,8,204,189,89,1,96,140,140,232, -31,141,53,0,208,188,144,146,48,1,90,4,224,156,140,30,132, -141,93,62,0,0,20,23,22,176,92,0,208,188,144,132,137,148, -89,0,16,141,146,4,8,165,89,220,255,255,8,132,137,148,89, -0,208,180,144,4,200,156,89,0,16,141,146,146,48,1,90,4,8, -165,89,0,144,141,140,228,255,255,19,30,160,4,58,129,137, -148,89,0,16,141,130,128,168,4,90,1,32,165,140,8,76,140, -89,236,255,255,21,0,30,240,92,0,80,7,132,0,0,0,10,16,32, -5,90,0,208,188,144,131,72,140,88,3,78,244,89,128,255,255, -18,148,67,140,88,16,96,4,90,4,32,165,140,30,132,173,93,0, -16,140,140,14,0,0,17,23,22,176,92,4,224,156,140,21,22, -184,92,56,255,255,8,21,210,184,88,23,96,5,90,4,201,157, -89,18,0,140,89,17,210,160,88,182,0,0,21,17,32,5,90,0, -208,188,144,4,201,156,89,112,0,0,18,23,22,176,92,32,0, -240,140,128,139,148,90,134,255,255,18,136,142,181,89,0,116, -140,140,255,255,255,255,17,32,5,90,0,80,180,130,8,137,247, -89,224,255,255,21,0,208,180,144,146,48,1,90,0,244,156,140, -252,255,255,255,30,132,141,93,0,144,189,140,4,9,165,89,54, -0,0,20,0,208,180,144,132,137,148,89,0,16,141,146,216,255, -255,8,132,137,148,89,0,208,188,144,4,201,156,89,0,16,141, -146,146,48,1,90,4,9,165,89,0,208,141,140,228,255,255,19, -22,191,4,58,136,78,140,89,4,32,165,140,129,9,165,89,148, -32,4,90,0,16,141,130,136,78,140,89,240,255,255,21,244,254, -255,8,17,32,5,90,0,208,189,144,131,72,173,88,0,208,180, -144,3,78,245,89,124,255,255,18,148,67,173,88,17,96,5,90, -30,132,173,93,16,0,0,20,22,22,184,92,8,0,0,18,4,201,156, -89,21,22,176,92,48,255,255,8,30,22,232,92,176,254,255,8, -0,0,0,0,16,72,8,89,0,48,128,140,0,231,0,0,138,25,136, -88,242,0,232,140,29,48,0,102,36,32,4,62,0,30,32,92,0,48, -40,140,176,86,0,0,64,224,167,140,0,30,48,92,72,224,247, -146,0,16,37,154,20,0,0,8,64,224,135,140,0,48,136,140,0, -231,0,0,24,0,0,9,64,224,135,176,0,48,144,146,208,235,0, -0,0,0,0,10,0,0,0,0,16,22,64,92,17,22,32,92,4,22,128, -92,220,1,0,11,0,30,48,92,0,48,56,140,0,235,0,0,0,16,50, -154,0,16,161,192,128,40,5,90,1,8,44,89,4,64,41,89,164,0, -0,18,152,0,0,8,0,16,161,192,31,88,152,89,16,192,164,58, -12,32,77,58,8,32,109,58,16,32,85,61,4,80,32,89,0,16,161, -192,224,63,5,61,0,16,161,192,100,32,5,58,0,16,170,144,21, -80,160,89,21,57,32,146,0,235,0,0,0,16,162,146,0,16,161, -192,56,32,5,58,31,88,144,89,48,128,164,58,44,32,77,58,40, -32,109,58,36,32,85,58,4,80,32,89,0,16,161,192,24,32,5, -58,31,88,152,89,16,192,164,58,12,32,77,58,8,32,109,58, -228,63,85,61,0,16,161,192,12,32,5,58,0,16,241,130,4,80, -32,89,0,16,161,192,12,32,5,58,0,16,162,144,132,63,149,59, -0,16,162,144,20,57,240,146,0,235,0,0,0,80,161,192,128,40, -5,90,0,30,32,92,204,0,0,18,0,48,40,146,80,235,0,0,5,22, -128,92,236,0,0,11,1,72,41,89,16,64,41,89,0,80,161,192, -128,40,5,90,1,30,32,92,164,0,0,18,0,48,48,140,84,235,0, -0,0,144,41,146,5,22,128,92,192,0,0,11,1,72,41,89,16,64, -41,89,0,80,161,192,128,40,5,90,4,80,32,89,120,0,0,18,4, -160,41,146,5,22,128,92,156,0,0,11,1,72,41,89,16,64,41, -89,0,80,161,192,128,40,5,90,4,80,32,89,84,0,0,18,8,160, -41,146,5,22,128,92,120,0,0,11,1,72,41,89,16,64,41,89,0, -80,161,192,128,40,5,90,4,80,32,89,48,0,0,18,12,160,41, -146,5,22,128,92,84,0,0,11,1,72,41,89,16,64,41,89,0,80, -161,192,6,16,52,89,148,48,0,90,4,80,32,89,8,0,0,18,108, -63,225,59,0,48,152,140,80,235,0,0,4,57,240,146,80,235,0, -0,19,22,144,92,8,32,146,146,0,0,0,10,0,0,0,0,0,0,0,0, -0,0,0,0,0,20,240,140,48,0,0,0,30,22,136,92,0,30,240,92, -0,16,164,192,0,30,168,92,12,0,0,8,0,16,164,192,21,80, -168,89,148,48,0,90,16,80,128,89,240,255,255,21,21,22,128, -92,0,80,4,132,0,0,0,10,0,0,0,0,1,1,232,140,29,48,0, -102,0,0,0,10,0,0,0,0,0,20,240,140,32,0,0,0,30,22,128, -92,0,30,240,92,0,48,160,140,80,205,3,0,20,22,168,92,0, -48,168,146,224,235,0,0,0,16,4,132,0,0,0,10,0,0,0,0,144, -48,0,90,0,48,168,144,224,235,0,0,12,0,0,21,21,22,128,92, -0,0,0,10,21,208,163,89,20,210,163,88,0,32,165,140,21,32, -5,90,20,60,180,140,255,255,255,255,20,0,0,17,16,0,181,52, -0,48,144,140,79,221,3,0,32,128,180,54,132,2,0,11,12,30, -144,92,18,22,136,92,0,16,140,146,0,48,128,140,255,255,255, -255,0,0,0,10,22,80,168,89,12,128,173,51,0,48,168,140,79, -221,3,0,20,22,128,92,0,48,168,146,224,235,0,0,0,0,0,10, -0,48,136,140,80,205,3,0,20,64,132,52,1,9,164,89,0,48, -144,140,79,221,3,0,28,128,164,54,44,2,0,11,12,30,144,92, -18,22,136,92,0,16,140,146,1,25,128,89,0,0,0,10,0,48,128, -146,224,235,0,0,0,30,128,92,0,0,0,10,0,0,0,0,0,0,0,0, -0,0,0,0,234,0,232,140,29,48,0,102,144,48,0,90,16,22,32, -92,20,0,0,18,228,1,0,11,0,16,36,146,1,25,128,89,0,0,0, -10,0,30,128,92,0,0,0,10,0,0,0,0,16,72,8,89,64,224,143, -140,235,0,232,140,29,48,0,102,144,48,0,90,16,22,32,92,20, -0,0,18,172,1,0,11,0,16,36,146,1,25,128,89,0,0,0,10,64, -224,135,144,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,16,72,8, -89,64,224,159,140,233,0,232,140,29,48,0,102,144,48,0,90, -16,22,32,92,20,0,0,18,108,1,0,11,0,16,36,146,1,25,128, -89,0,0,0,10,64,224,135,144,0,0,0,10,0,0,0,0,0,0,0,0, -0,0,0,0,239,0,232,140,29,48,0,102,144,48,0,90,16,22,32, -92,20,0,0,18,52,1,0,11,0,16,36,146,1,25,128,89,0,0,0, -10,0,30,128,92,0,0,0,10,0,0,0,0,16,72,8,89,64,224,159, -140,232,0,232,140,29,48,0,102,144,48,0,90,16,22,32,92,20, -0,0,18,252,0,0,11,0,16,36,146,1,25,128,89,0,0,0,10,64, -224,135,144,0,0,0,10,0,0,0,0,0,0,0,0,0,0,0,0,224,253, -255,8,0,0,0,0,0,0,0,0,0,0,0,0,0,20,240,140,20,0,0,0, -30,22,136,92,0,30,240,92,0,48,128,140,240,235,0,0,0,80, -4,132,0,0,0,10,0,20,240,140,20,0,0,0,30,22,136,92,0,30, -240,92,0,48,128,140,128,236,0,0,0,80,4,132,0,0,0,10,0, -20,240,140,20,0,0,0,30,22,136,92,0,30,240,92,0,48,128, -140,240,236,0,0,0,80,4,132,0,0,0,10,0,20,240,140,20,0, -0,0,30,22,136,92,0,30,240,92,0,48,128,140,240,235,0,0,0, -80,4,132,0,0,0,10,0,20,240,140,20,0,0,0,30,22,136,92,0, -30,240,92,0,48,128,140,128,236,0,0,0,80,4,132,0,0,0,10, -0,20,240,140,20,0,0,0,30,22,136,92,0,30,240,92,0,48,128, -140,240,236,0,0,0,80,4,132,0,0,0,10,0,20,240,140,20,0, -0,0,30,22,136,92,0,30,240,92,0,48,128,140,240,236,0,0,0, -80,4,132,0,0,0,10,0,20,240,140,12,0,0,0,30,22,128,92,0, -30,240,92,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20, -240,140,12,0,0,0,30,22,128,92,0,30,240,92,0,16,4,132,0, -0,0,10,0,0,0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22, -128,92,0,30,240,92,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0, -0,0,20,240,140,12,0,0,0,30,22,128,92,0,30,240,92,0,16, -4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240,140,12,0,0,0, -30,22,128,92,0,30,240,92,0,16,4,132,0,0,0,10,0,0,0,0, -0,0,0,0,0,20,240,140,12,0,0,0,30,22,128,92,0,30,240,92, -0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240,140,12, -0,0,0,30,22,128,92,0,30,240,92,0,16,4,132,0,0,0,10,0, -0,0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22,128,92,0,30, -240,92,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240, -140,12,0,0,0,30,22,128,92,0,30,240,92,0,16,4,132,0,0,0, -10,0,0,0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22,128,92, -0,30,240,92,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20, -240,140,12,0,0,0,30,22,128,92,0,30,240,92,0,16,4,132,0, -0,0,10,0,0,0,0,0,0,0,0,0,20,240,140,16,0,0,0,30,22, -136,92,0,30,240,92,18,22,128,92,0,80,4,132,0,0,0,10,0, -0,0,0,0,20,240,140,12,0,0,0,30,22,128,92,0,30,240,92,0, -16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240,140,12,0, -0,0,30,22,128,92,0,30,240,92,0,16,4,132,0,0,0,10,0,0, -0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22,128,92,0,30, -240,92,0,16,4,132,0,0,0,10,0,0,0,0,0,0,0,0,0,20,240, -140,12,0,0,0,30,22,128,92,0,30,240,92,0,16,4,132,0,0,0, -10,0,0,0,0,0,0,0,0,0,20,240,140,12,0,0,0,30,22,136,92, -0,30,240,92,0,80,4,132,0,0,0,10,0,0,0,0,0,0,0,0,240, -252,255,8,0,0,0,0,0,0,0,0,0,0,0,0,0,20,240,140,12,0, -0,0,30,22,128,92,0,30,240,92,0,16,4,132,0,0,0,10,0,0, -0,0,0,0,0,0,0,20,240,140,20,0,0,0,30,22,136,92,0,30, -240,92,1,25,168,89,149,2,132,100,0,80,4,132,0,0,0,10,0, -20,240,140,12,0,0,0,30,22,128,92,0,30,240,92,0,16,4,132, -0,0,0,10,0,0,0,0,0,0,0,0,144,48,0,90,19,4,32,140,86, -0,0,20,16,22,40,92,133,16,96,100,66,0,0,16,12,17,101,89, -140,48,0,90,18,0,0,20,12,70,137,89,0,30,128,92,20,0,0, -8,12,17,104,89,13,68,137,89,32,32,107,140,13,70,129,89, -20,78,140,88,12,1,33,89,20,14,33,89,132,67,140,88,0,0,0, -10,0,30,128,93,248,255,255,8,16,17,40,89,133,16,96,100, -12,17,101,89,140,48,0,90,18,0,0,20,12,70,137,89,0,30, -128,92,20,0,0,8,12,17,104,89,13,68,137,89,32,32,107,140, -13,70,129,89,20,78,140,88,12,1,33,89,20,14,33,89,132,67, -140,88,159,73,140,88,176,255,255,8,1,78,36,89,0,48,96, -140,0,0,224,255,4,32,3,90,106,0,0,17,21,12,33,89,10,78, -44,89,158,73,41,88,31,78,41,88,22,12,100,89,133,3,43,88, -145,48,0,90,29,4,96,140,38,0,0,20,4,32,3,90,4,1,35,89, -14,0,0,17,4,68,129,89,0,0,0,10,1,25,128,89,31,14,132, -88,244,255,255,8,4,32,3,90,4,1,35,89,18,0,0,17,4,68,41, -89,5,17,128,89,220,255,255,8,31,94,128,89,212,255,255,8, -0,30,128,92,204,255,255,8,1,78,36,89,0,48,96,140,0,0, -224,255,4,32,3,90,66,0,0,17,21,12,33,89,11,78,44,89,159, -73,41,88,21,12,100,89,133,3,43,88,145,48,0,90,38,0,0,20, -30,4,96,140,4,32,3,90,18,0,0,17,4,1,35,89,4,68,129,89, -0,0,0,10,1,25,128,89,248,255,255,8,0,30,128,92,240,255, -255,8,1,78,36,89,0,48,96,140,255,255,223,255,12,32,1,90, -4,49,0,90,82,0,0,22,21,12,33,89,128,3,96,140,12,1,33, -89,255,0,96,140,4,32,3,90,46,0,0,19,23,14,33,89,12,78, -44,89,9,76,41,89,132,67,33,88,29,12,44,89,28,47,4,90,5, -0,129,91,31,111,4,90,159,15,132,88,0,0,0,10,132,48,0,90, -48,0,0,20,24,0,0,8,42,0,0,18,0,48,96,140,0,0,224,255, -4,32,3,90,18,0,0,17,0,48,128,140,0,0,128,127,204,255, -255,8,1,25,128,89,204,255,255,8,0,30,128,92,188,255,255, -8,31,12,84,89,31,142,82,89,1,14,36,89,0,48,96,140,255, -255,255,254,12,32,1,90,4,49,0,90,58,0,0,22,24,12,33,89, -0,48,96,140,128,252,255,255,12,1,33,89,20,14,33,89,9,14, -44,89,12,76,41,89,132,67,137,88,29,14,132,89,145,131,138, -88,0,0,0,10,0,30,128,93,244,255,255,8,250,255,255,18,0, -48,96,140,0,0,0,255,12,32,1,90,22,0,0,20,0,48,136,140, -0,0,240,127,0,30,128,92,208,255,255,8,1,25,128,89,1,25, -136,89,200,255,255,8,15,140,84,89,31,142,82,89,17,142,36, -89,17,12,33,89,31,111,4,90,90,0,0,16,0,48,96,140,0,60, -0,0,12,1,33,89,255,7,96,140,4,32,3,90,46,0,0,19,31,78, -140,88,11,76,60,89,21,78,52,89,20,14,33,89,135,3,137,88, -10,47,4,90,11,12,132,89,6,0,132,91,138,67,140,88,0,0,0, -10,34,0,0,17,0,48,136,140,0,0,240,127,0,30,128,92,232, -255,255,8,144,67,140,88,17,48,0,90,220,255,255,18,1,25, -128,89,1,25,136,89,212,255,255,8,31,72,84,88,8,0,0,8,31, -78,84,88,1,78,36,89,0,48,96,140,0,0,224,255,4,32,3,90, -10,0,0,17,10,22,136,92,0,0,0,10,31,200,156,88,1,78,36, -89,1,206,44,89,21,94,96,89,4,0,107,89,13,32,3,90,154,1, -0,22,5,0,107,89,13,32,3,90,142,1,0,22,11,78,60,89,21, -12,100,89,11,14,52,89,140,195,57,88,159,201,57,88,11,206, -76,89,21,140,100,89,11,142,68,89,140,67,74,88,159,73,74, -88,21,12,33,89,21,76,41,89,31,76,84,89,31,142,82,89,4, -96,1,90,32,0,104,140,52,0,0,20,5,1,97,89,12,96,3,90,16, -0,0,20,9,22,64,92,0,30,72,92,13,1,99,89,12,4,66,89,12, -65,107,89,13,70,106,89,12,68,74,89,141,3,66,88,52,0,0,8, -4,65,97,89,12,96,3,90,16,0,0,20,7,22,48,92,0,30,56,92, -13,1,99,89,12,132,49,89,12,65,107,89,13,198,105,89,12, -196,57,89,141,131,49,88,5,22,32,92,17,195,100,88,31,47,3, -90,62,0,0,18,8,128,49,91,9,192,57,91,150,0,0,16,1,140, -49,89,31,206,97,89,1,204,57,89,140,131,49,88,1,8,33,89, -255,7,96,140,4,32,3,90,116,0,0,20,12,22,32,92,0,30,48, -93,104,0,0,8,8,129,49,91,9,193,57,91,22,0,0,18,0,56,0, -90,6,17,48,91,7,17,56,91,31,136,82,88,135,16,96,100,32, -0,0,18,134,16,96,100,102,0,0,16,12,209,103,89,12,134,57, -89,0,30,48,92,32,32,99,140,28,0,0,8,12,132,105,89,1,76, -107,89,12,209,103,89,12,198,57,89,12,134,49,89,141,195,57, -88,12,1,33,89,132,48,0,90,54,0,0,20,10,175,1,90,31,206, -57,88,11,140,129,89,21,206,105,89,11,204,137,89,20,14,33, -89,145,3,137,88,13,0,132,91,10,64,140,91,0,0,0,10,0,30, -128,93,248,255,255,8,0,30,128,92,10,22,136,92,236,255,255, -8,0,48,96,140,0,0,224,255,12,32,1,90,70,0,0,18,90,0,0, -20,12,96,1,90,50,0,0,18,78,0,0,20,132,3,108,88,13,48,0, -90,22,0,0,18,133,131,108,88,13,48,0,90,70,254,255,21,176, -255,255,8,133,131,108,88,13,48,0,90,50,0,0,18,18,22,128, -93,156,255,255,8,12,96,1,90,22,0,0,20,146,255,255,17,17, -195,100,88,140,48,0,90,134,255,255,19,1,25,128,89,1,25, -136,89,120,255,255,8,145,192,140,88,0,30,128,92,108,255, -255,8,17,195,28,88,31,204,24,89,31,206,24,89,1,78,36,89, -1,206,44,89,21,94,96,89,4,0,107,89,13,32,3,90,238,0,0, -22,5,0,107,89,13,32,3,90,226,0,0,22,11,78,60,89,1,204, -57,89,10,14,52,89,22,12,108,89,141,195,57,88,158,201,57, -88,11,206,76,89,11,142,68,89,21,140,108,89,141,67,74,88, -159,73,74,88,21,12,33,89,21,76,41,89,137,128,81,103,10, -22,104,92,0,30,96,92,137,0,99,103,13,22,80,92,1,12,106, -89,0,30,96,92,137,0,99,103,11,64,99,103,0,56,0,90,13, -129,82,91,0,201,90,91,13,129,82,91,0,201,90,91,31,239,2, -90,16,0,0,18,10,128,82,91,11,192,90,91,1,9,33,89,255,35, -33,140,5,1,33,89,254,7,96,140,12,32,1,90,46,0,0,20,10, -175,2,90,11,140,130,89,21,206,106,89,11,204,138,89,20,78, -140,88,20,14,33,89,145,3,137,88,13,0,132,91,3,64,140,91, -0,0,0,10,132,48,0,90,16,0,0,20,1,8,35,89,0,30,80,93, -200,255,255,8,0,30,32,92,0,30,80,93,188,255,255,8,0,48, -96,140,0,0,224,255,12,32,1,90,90,0,0,18,94,0,0,20,12, -96,1,90,66,0,0,18,82,0,0,20,132,3,108,88,13,48,0,90,38, -0,0,18,133,131,108,88,13,48,0,90,242,254,255,21,0,48,136, -140,0,0,240,127,0,30,128,92,131,67,140,88,148,255,255,8, -133,131,108,88,13,48,0,90,26,0,0,18,0,30,128,93,131,67, -140,88,124,255,255,8,12,96,1,90,210,255,255,17,1,25,128, -89,1,25,136,89,104,255,255,8,0,0,0,0,0,0,0,0,0,0,0,0, -17,195,28,88,31,204,24,89,31,206,24,89,1,78,36,89,1,206, -44,89,21,94,96,89,4,0,107,89,13,32,3,90,214,0,0,22,5,0, -107,89,13,32,3,90,202,0,0,22,11,78,60,89,11,14,52,89,21, -12,108,89,141,195,57,88,11,206,76,89,11,142,68,89,21,140, -108,89,141,67,74,88,159,201,57,88,159,73,74,88,21,12,33, -89,21,76,41,89,7,64,98,103,6,64,82,103,0,120,0,90,12, -192,98,91,13,16,104,91,7,0,114,103,10,128,115,91,12,192, -99,91,13,16,104,91,31,111,3,90,16,0,0,18,12,0,99,91,13, -64,107,91,1,9,33,89,4,124,33,140,2,252,255,255,254,7,80, -140,10,32,1,90,46,0,0,20,10,47,3,90,11,12,131,89,21,78, -83,89,11,76,139,89,20,78,140,88,20,14,33,89,145,3,137,88, -10,0,132,91,3,64,140,91,0,0,0,10,132,48,0,90,16,0,0,20, -1,136,34,89,0,30,96,93,200,255,255,8,0,30,32,92,0,30,96, -93,188,255,255,8,31,204,24,89,31,206,24,89,0,48,96,140,0, -0,224,255,12,32,1,90,58,0,0,18,70,0,0,20,12,96,1,90,62, -0,0,20,70,0,0,18,132,3,108,88,13,48,0,90,18,0,0,18,133, -131,108,88,13,48,0,90,2,255,255,21,0,30,128,93,131,67, -140,88,148,255,255,8,12,96,1,90,14,0,0,20,5,48,0,90,30, -0,0,21,1,25,128,89,1,25,136,89,120,255,255,8,132,3,108, -88,13,48,0,90,238,255,255,18,0,48,136,140,0,0,240,127, -131,67,140,88,0,30,128,92,88,255,255,8,0,0,0,0,1,78,36, -89,1,206,52,89,0,48,96,140,0,0,224,255,12,32,1,90,126,0, -0,22,12,160,1,90,198,0,0,22,132,131,49,88,6,48,0,90,98, -0,0,18,159,77,100,89,31,78,60,88,16,3,51,88,7,3,59,88, -0,56,0,90,12,129,49,91,0,201,57,91,159,205,100,89,31,206, -76,88,18,3,67,88,9,3,75,88,0,56,0,90,12,1,66,91,0,73, -74,91,135,96,2,90,1,25,128,89,34,0,0,20,1,30,128,92,26, -0,0,17,6,32,2,90,18,0,0,17,1,25,128,89,10,0,0,20,0,30, -128,92,0,0,0,10,12,32,1,90,30,0,0,18,3,30,128,92,240, -255,255,8,1,30,128,92,232,255,255,8,1,25,128,89,224,255, -255,8,12,160,1,90,230,255,255,20,30,0,0,17,17,195,100,88, -140,48,0,90,198,255,255,19,31,111,4,90,214,255,255,16,216, -255,255,8,145,48,0,90,208,255,255,20,196,255,255,8,12,160, -1,90,182,255,255,20,31,239,4,90,182,255,255,18,184,255, -255,8,0,0,0,10 -}; - -int pca200e_microcode_size_4 = sizeof(pca200e_microcode_4); Property changes on: head/sbin/atm/fore_dnld/pca200e.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/fore_dnld/fore_dnld.c =================================================================== --- head/sbin/atm/fore_dnld/fore_dnld.c (revision 179307) +++ head/sbin/atm/fore_dnld/fore_dnld.c (nonexistent) @@ -1,1346 +0,0 @@ -/* - * - * =================================== - * 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. - */ - -/* - * User utilities - * -------------- - * - * Download (pre)processed microcode into Fore Series-200 host adapter - * Interact with i960 uart on Fore Series-200 host adapter - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#if (defined(BSD) && (BSD >= 199103)) -#include -#else -#include -#endif /* !BSD */ -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - -extern u_char pca200e_microcode_3[]; -extern int pca200e_microcode_size_3; -extern u_char pca200e_microcode_4[]; -extern int pca200e_microcode_size_4; - -#ifdef sun -#define DEV_NAME "/dev/sbus%d" -#endif /* sun */ -#if (defined(BSD) && (BSD >= 199103)) -#define DEV_NAME _PATH_KMEM -#endif /* BSD */ - -#define MAX_CHECK 60 - -static int comm_mode = 0; -static const char *progname; - -static int tty; -static cc_t vmin, vtime; -#if (defined(BSD) && (BSD >= 199103)) -static struct termios sgtty; -#define TCSETA TIOCSETA -#define TCGETA TIOCGETA -#else -static struct termio sgtty; -#endif /* !BSD */ - -static int endian = 0; -static int verbose = 0; -static int reset = 0; - -static char line[132]; -static u_int lineptr; - -static Mon960 *Uart; - -static void -delay(int cnt) -{ - usleep(cnt); -} - -static uint32_t -CP_READ(uint32_t val) -{ - if ( endian ) - return ( ntohl ( val ) ); - else - return ( val ); -} - -static uint32_t -CP_WRITE(uint32_t val) -{ - if ( endian ) - return ( htonl ( val ) ); - else - return ( val ); -} - -/* - * Print an error message and exit. - * - * Arguments: - * none - * - * Returns: - * none - */ -static void -error(const char *msg) -{ - printf ( "%s\n", msg ); - exit (1); -} - -/* - * Get a byte for the uart and if printing, display it. - * - * Returns: - * c Character from uart - */ -static char -getbyte(void) -{ - char c; - - while ( ! ( CP_READ(Uart->mon_xmithost) & UART_VALID ) ) - delay(10); - - c = CP_READ(Uart->mon_xmithost) & UART_DATAMASK; - Uart->mon_xmithost = CP_WRITE(UART_READY); - - /* - * We need to introduce a delay in here or things tend to hang... - */ - delay(10000); - - if ( lineptr >= sizeof(line) ) - lineptr = 0; - - /* - * Save character into line - */ - line[lineptr++] = c; - - if (verbose) { - if (isprint(c) || (c == '\n') || (c == '\r')) - putc(c, stdout); - } - return (c); -} - -/* - * Loop getting characters from uart into static string until eol. If printing, - * display the line retrieved. - * - * Arguments: - * prn Are we displaying characters - * - * Returns: - * none Line in global string 'line[]' - */ -static void -getline(int prn) -{ - char c = '\0'; - u_int i = 0; - - while ( c != '>' && c != '\n' && c != '\r' ) - { - c = getbyte(); - if ( ++i >= sizeof(line) ) - { - if ( prn ) - printf ( "%s", line ); - i = 0; - } - } - - /* - * Terminate line - */ - line[lineptr] = 0; - lineptr = 0; - -} - -/* - * Send a byte to the i960 - * - * Arguments: - * c Character to send - * - * Returns: - * none - */ -static void -xmit_byte(u_char c, int dn) -{ - int val; - - while ( CP_READ(Uart->mon_xmitmon) != UART_READY ) - { - if ( CP_READ(Uart->mon_xmithost) & UART_VALID ) - getbyte(); - if ( !dn ) delay ( 10000 ); - } - val = (int)c | UART_VALID; - Uart->mon_xmitmon = CP_WRITE( val ); - if ( !dn ) delay ( 10000 ); - if ( CP_READ(Uart->mon_xmithost) & UART_VALID ) - getbyte(); - -} - -/* - * Transmit a line to the i960. Eol must be included as part of text to transmit. - * - * Arguments: - * msg Character string to transmit - * len len of string. This allows us to include NULL's - * in the string/block to be transmitted. - * - * Returns: - * none - */ -static void -xmit_to_i960(const char *msg, int len, int dn) -{ - int i; - - for (i = 0; i < len; i++) - xmit_byte(msg[i], dn); -} - -/* - * Send autobaud sequence to i960 monitor - * - * Arguments: - * none - * - * Returns: - * none - */ -static void -autobaud(void) -{ - if ( strncmp ( line, "Mon960", 6 ) == 0 ) - xmit_to_i960 ( "\r\n\r\n\r\n\r\n", 8, 0 ); -} - -/* - * Reset tty to initial state - * - * Arguments: - * ret error code for exit() - * - * Returns: - * none - * - */ -static void -finish(int ret) -{ - sgtty.c_lflag |= ( ICANON | ECHO ); - sgtty.c_cc[VMIN] = vmin; - sgtty.c_cc[VTIME] = vtime; - ioctl ( tty, TCSETA, &sgtty ); - exit ( ret ); -} - -/* - * Utility to strip off any leading path information from a filename - * - * Arguments: - * path pathname to strip - * - * Returns: - * fname striped filename - * - */ -static const char * -basename(const char *path) -{ - const char *fname; - - if ( ( fname = strrchr ( path, '/' ) ) != NULL ) - fname++; - else - fname = path; - - return ( fname ); -} - -/* - * ASCII constants - */ -#define SOH 001 -#define STX 002 -#define ETX 003 -#define EOT 004 -#define ENQ 005 -#define ACK 006 -#define LF 012 -#define CR 015 -#define NAK 025 -#define SYN 026 -#define CAN 030 -#define ESC 033 - -#define NAKMAX 2 -#define ERRORMAX 10 -#define RETRYMAX 5 - -#define CRCCHR 'C' -#define CTRLZ 032 - -#define BUFSIZE 128 - -#define W 16 -#define B 8 - -/* - * crctab - CRC-16 constant array... - * from Usenet contribution by Mark G. Mendel, Network Systems Corp. - * (ihnp4!umn-cs!hyper!mark) - */ -static unsigned short crctab[1< NAKMAX ) - error ( "Remote system not responding" ); - - if ( c == CRCCHR ) - crcmode = 1; - - } while ( c != NAK && c != CRCCHR ); - - sectnum = 1; - attempts = errors = sendfin = extrachr = 0; - - /* - * Loop over each sector to be sent - */ - do { - if ( extrachr >= 128 ) - { - extrachr = 0; - numsect++; - } - - if ( sectnum > 0 ) - { - /* - * Read a sectors worth of data from the file into - * an internal buffer. - */ - for ( bufcntr = 0; bufcntr < bufsize; ) - { - int n; - /* - * Check for EOF - */ - if ( ( n = read ( fd, &c, 1 ) ) == 0 ) - { - sendfin = 1; - if ( !bufcntr ) - break; - buf[bufcntr++] = CTRLZ; - continue; - } - buf[bufcntr++] = c; - } - if ( !bufcntr ) - break; - } - - /* - * Fill in xmodem protocol values. Block size and sector number - */ - bbufcntr = 0; - blockbuf[bbufcntr++] = (bufsize == 1024) ? STX : SOH; - blockbuf[bbufcntr++] = sectnum; - blockbuf[bbufcntr++] = ~sectnum; - - checksum = 0; - - /* - * Loop over the internal buffer computing the checksum of the - * sector - */ - for ( bufcntr = 0; bufcntr < bufsize; bufcntr++ ) - { - blockbuf[bbufcntr++] = buf[bufcntr]; - - if ( crcmode ) - checksum = (checksum<>(W-B)) ^ buf[bufcntr]]; - else - checksum = ((checksum + buf[bufcntr]) & 0xff); - - } - - /* - * Place the checksum at the end of the transmit buffer - */ - if ( crcmode ) - { - checksum &= 0xffff; - blockbuf[bbufcntr++] = ((checksum >> 8) & 0xff); - blockbuf[bbufcntr++] = (checksum & 0xff); - } else - blockbuf[bbufcntr++] = checksum; - - attempts = 0; - - /* - * Make several attempts to send the data to the i960 - */ - do - { - /* - * Transmit the sector + protocol to the i960 - */ - xmit_to_i960 ( blockbuf, bbufcntr, 1 ); - - /* - * Inform user where we're at - */ - if ( verbose ) - printf ( "Sector %3d %3dk\r", - sectnum, (sectnum * bufsize) / 1024 ); - - attempts++; - /* - * Get response from i960 - */ - sendresp = getbyte(); - - /* - * If i960 didn't like the sector - */ - if ( sendresp != ACK ) - { - errors++; - - /* - * Are we supposed to cancel the transfer? - */ - if ( ( sendresp & 0x7f ) == CAN ) - if (getbyte() == CAN) - error ( "Send canceled at user's request" ); - } - - } while ( ( sendresp != ACK ) && ( attempts < RETRYMAX ) && ( errors < ERRORMAX ) ); - - /* - * Next sector - */ - sectnum++; - - } while ( !sendfin && ( attempts < RETRYMAX ) && ( errors < ERRORMAX ) ); - - /* - * Did we expire all our allows attempts? - */ - if ( attempts >= RETRYMAX ) - { - xmit_byte ( CAN, 1 ), xmit_byte ( CAN, 1 ), xmit_byte ( CAN, 1 ); - error ( "Remote system not responding" ); - } - - /* - * Check for too many transmission errors - */ - if ( errors >= ERRORMAX ) - { - xmit_byte ( CAN, 1 ), xmit_byte ( CAN, 1 ), xmit_byte ( CAN, 1 ); - error ( "Too many errors in transmission" ); - } - - attempts = 0; - - /* - * Indicate the transfer is complete - */ - xmit_byte ( EOT, 1 ); - - /* - * Wait until i960 acknowledges us - */ - while ((c = getbyte()) != ACK && (++attempts < RETRYMAX)) - xmit_byte ( EOT, 1 ); - - if ( attempts >= RETRYMAX ) - error ( "Remote system not responding on completion" ); - - /* - * After download, we'll see a few more command - * prompts as the CP does its stuff. Ignore them. - */ - while ( strncmp ( line, "=>", 2 ) != 0 ) - getline ( verbose ); - - while ( strncmp ( line, "=>", 2 ) != 0 ) - getline ( verbose ); - - while ( strncmp ( line, "=>", 2 ) != 0 ) - getline ( verbose ); - - /* - * Tell the i960 to start executing the downloaded code - */ - xmit_to_i960 ( "go\r\n", 4, 0 ); - - /* - * Get the messages the CP will spit out - * after the GO command. - */ - getline ( verbose ); - getline ( verbose ); - - close ( fd ); - - return ( 0 ); -} - - -static int -loadmicrocode(u_char *ucode, int size, u_char *ram) -{ - struct { - uint32_t Id; - uint32_t fver; - uint32_t start; - uint32_t entry; - } binhdr; -#ifdef sun - union { - uint32_t w; - char c[4]; - } w1, w2; - int n; -#endif - u_char *bufp; - uint32_t *lp; - - - /* - * Check that we understand this header - */ - memcpy(&binhdr, ucode, sizeof(binhdr)); - if ( strncmp ( (caddr_t)&binhdr.Id, "fore", 4 ) != 0 ) { - fprintf ( stderr, "Unrecognized format in micorcode file." ); - return ( -1 ); - } - -#ifdef sun - /* - * We always swap the SunOS microcode file... - */ - endian = 1; - - /* - * We need to swap the header start/entry words... - */ - w1.w = binhdr.start; - for ( n = 0; n < sizeof(uint32_t); n++ ) - w2.c[3-n] = w1.c[n]; - binhdr.start = w2.w; - w1.w = binhdr.entry; - for ( n = 0; n < sizeof(uint32_t); n++ ) - w2.c[3-n] = w1.c[n]; - binhdr.entry = w2.w; -#endif /* sun */ - - /* - * Set pointer to RAM load location - */ - bufp = (ram + binhdr.start); - - /* - * Load file - */ - if ( endian ) { - u_int i; - - lp = (uint32_t *)(void *)ucode; - /* Swap buffer */ - for ( i = 0; i < size / sizeof(uint32_t); i++ ) -#ifndef sun - lp[i] = CP_WRITE(lp[i]); -#else - { - int j; - - w1.w = lp[i]; - for ( j = 0; j < 4; j++ ) - w2.c[3-j] = w1.c[j]; - lp[i] = w2.w; - } -#endif - } - bcopy ( (caddr_t)ucode, bufp, size ); - - /* - * With .bin extension, we need to specify start address on 'go' - * command. - */ - { - char cmd[80]; - - sprintf ( cmd, "go %x\r\n", binhdr.entry ); - - xmit_to_i960 ( cmd, strlen ( cmd ), 0 ); - - while ( strncmp ( line, cmd, strlen(cmd) - 3 ) != 0 ) - getline ( verbose ); - - if ( verbose ) - printf("\n"); - } - return ( 0 ); -} - -static int -sendbinfile(const char *fname, u_char *ram) -{ - struct { - uint32_t Id; - uint32_t fver; - uint32_t start; - uint32_t entry; - } binhdr; -#ifdef sun - union { - uint32_t w; - char c[4]; - } w1, w2; -#endif - int fd; - int n; - int cnt = 0; - u_char *bufp; - uint32_t buffer[1024]; - - /* - * Try opening file - */ - if ( ( fd = open ( fname, O_RDONLY ) ) < 0 ) - return ( -1 ); - - /* - * Read the .bin header from the file - */ - if ( ( read ( fd, &binhdr, sizeof(binhdr) ) ) != sizeof(binhdr) ) - { - close ( fd ); - return ( -1 ); - } - - /* - * Check that we understand this header - */ - if ( strncmp ( (caddr_t)&binhdr.Id, "fore", 4 ) != 0 ) { - fprintf ( stderr, "Unrecognized format in micorcode file." ); - close ( fd ); - return ( -1 ); - } - -#ifdef sun - /* - * We always swap the SunOS microcode file... - */ - endian = 1; - - /* - * We need to swap the header start/entry words... - */ - w1.w = binhdr.start; - for ( n = 0; n < sizeof(uint32_t); n++ ) - w2.c[3-n] = w1.c[n]; - binhdr.start = w2.w; - w1.w = binhdr.entry; - for ( n = 0; n < sizeof(uint32_t); n++ ) - w2.c[3-n] = w1.c[n]; - binhdr.entry = w2.w; -#endif /* sun */ - - /* - * Rewind the file - */ - lseek ( fd, 0, 0 ); - - /* - * Set pointer to RAM load location - */ - bufp = (ram + binhdr.start); - - /* - * Load file - */ - if ( endian ) { - /* - * Need to swap longs - copy file into temp buffer - */ - while ( ( n = read ( fd, (char *)buffer, sizeof(buffer))) > 0 ) - { - u_int i; - - /* Swap buffer */ - for (i = 0; i < sizeof(buffer) / sizeof(uint32_t); i++) -#ifndef sun - buffer[i] = CP_WRITE(buffer[i]); -#else - { - int j; - - w1.w = buffer[i]; - for ( j = 0; j < 4; j++ ) - w2.c[3-j] = w1.c[j]; - buffer[i] = w2.w; - } -#endif - - /* - * Copy swapped buffer into CP RAM - */ - cnt++; - bcopy ( (caddr_t)buffer, bufp, n ); - if ( verbose ) - printf ( "%d\r", cnt ); - bufp += n; - } - } else { - while ( ( n = read ( fd, bufp, 128 ) ) > 0 ) - { - cnt++; - if ( verbose ) - printf ( "%d\r", cnt ); - bufp += n; - } - } - - /* - * With .bin extension, we need to specify start address on 'go' - * command. - */ - { - char cmd[80]; - - sprintf ( cmd, "go %x\r\n", binhdr.entry ); - - xmit_to_i960 ( cmd, strlen ( cmd ), 0 ); - - while ( strncmp ( line, cmd, strlen(cmd) - 3 ) != 0 ) - getline ( verbose ); - - if ( verbose ) - printf("\n"); - } - - close ( fd ); - return ( 0 ); -} - - -/* - * Program to download previously processed microcode to series-200 host adapter - */ -int -main(int argc, char *argv[]) -{ - int fd; /* mmap for Uart */ - u_char *ram; /* pointer to RAM */ - Mon960 *Mon; /* Uart */ - Aali *aap; - int c, i, err; - int binary = 0; /* Send binary file */ - caddr_t buf; /* Ioctl buffer */ - char bus_dev[80]; /* Bus device to mmap on */ - struct atminfreq req; - struct air_cfg_rsp *air; /* Config info response structure */ - int buf_len; /* Size of ioctl buffer */ - const char *dev = "\0"; /* Device to download */ - char *dirname = NULL; /* Directory path to objd files */ - char *objfile = NULL; /* Command line object filename */ - u_char *ucode = NULL; /* Pointer to microcode */ - int ucode_size = 0; /* Length of microcode */ - char *sndfile = NULL; /* Object filename to download */ - char filename[64]; /* Constructed object filename */ - char base[64]; /* sba200/sba200e/pca200e basename */ - int ext = 0; /* 0 == bin 1 == objd */ - struct stat sbuf; /* Used to find if .bin or .objd */ - int pca_vers = 4; - - progname = basename(argv[0]); - comm_mode = strcmp ( progname, "fore_comm" ) == 0; - - while ( ( c = getopt ( argc, argv, "3i:d:f:berv" ) ) != -1 ) - switch ( c ) { - case '3': - pca_vers = 3; - break; - case 'b': - binary++; - break; - case 'd': - dirname = (char *)strdup ( optarg ); - break; - case 'e': - endian++; - break; - case 'i': - dev = (char *)strdup(optarg); - break; - case 'f': - objfile = (char *)strdup ( optarg ); - break; - case 'v': - verbose++; - break; - case 'r': - reset++; - break; - case '?': - printf ( "usage: %s [-v] [-i intf] [-d dirname] [-f objfile]\n", argv[0] ); - exit ( 2 ); - } - - /* - * Unbuffer stdout - */ - setbuf ( stdout, NULL ); - - if ( ( fd = socket ( AF_ATM, SOCK_DGRAM, 0 ) ) < 0 ) - { - perror ( "Cannot create ATM socket" ); - exit ( 1 ); - } - /* - * Over allocate memory for returned data. This allows - * space for IOCTL reply info as well as config info. - */ - buf_len = 4 * sizeof(struct air_cfg_rsp); - if ( ( buf = (caddr_t)malloc(buf_len) ) == NULL ) - { - perror ( "Cannot allocate memory for reply" ); - exit ( 1 ); - } - /* - * Fill in request paramaters - */ - req.air_opcode = AIOCS_INF_CFG; - req.air_buf_addr = buf; - req.air_buf_len = buf_len; - - /* - * Copy interface name into ioctl request - */ - strcpy(req.air_cfg_intf, dev); - - /* - * Issue ioctl - */ - if ( ( ioctl ( fd, AIOCINFO, (caddr_t)&req ) ) ) { - perror ( "ioctl (AIOCSINFO)" ); - exit ( 1 ); - } - /* - * Reset buffer pointer - */ - req.air_buf_addr = buf; - - /* - * Close socket - */ - close ( fd ); - - /* - * Loop through all attached adapters - */ - for (; req.air_buf_len >= sizeof(struct air_cfg_rsp); - buf += sizeof(struct air_cfg_rsp), - req.air_buf_len -= sizeof(struct air_cfg_rsp)) { - - /* - * Point to vendor info - */ - air = (struct air_cfg_rsp *)(void *)buf; - - if (air->acp_vendapi == VENDAPI_FORE_1 && air->acp_ram != 0) - { - /* - * Create /dev name - */ -#ifdef sun - sprintf ( bus_dev, DEV_NAME, air->acp_busslot ); -#else - sprintf ( bus_dev, DEV_NAME ); -#endif - - /* - * Setup signal handlers - */ - signal ( SIGINT, SIG_IGN ); - signal ( SIGQUIT, SIG_IGN ); - - /* - * If comm_mode, setup terminal for single char I/O - */ - if ( comm_mode ) { - tty = open ( _PATH_TTY, O_RDWR ); - ioctl ( tty, TCGETA, &sgtty ); - sgtty.c_lflag &= ~( ICANON | ECHO ); - vmin = sgtty.c_cc[VMIN]; - vtime = sgtty.c_cc[VTIME]; - sgtty.c_cc[VMIN] = 0; - sgtty.c_cc[VTIME] = 0; - ioctl ( tty, TCSETA, &sgtty ); - } - - /* - * Open bus for memory access - */ - if ( ( fd = open ( bus_dev, O_RDWR ) ) < 0 ) - { - perror ( "open bus_dev" ); - fprintf(stderr, "%s download failed (%s)\n", - air->acp_intf, bus_dev); - continue; - } - - /* - * Map in the RAM memory to get access to the Uart - */ -#ifdef __FreeBSD__ /*XXX*/ - ram = (u_char *) mmap(0, PCA200E_MMAP_SIZE, -#else - ram = (u_char *) mmap(0, air->acp_ramsize, -#endif - PROT_READ | PROT_WRITE, MAP_SHARED | MAP_HASSEMAPHORE, - fd, air->acp_ram); - if (ram == (u_char *)-1) { - perror ( "mmap ram" ); - fprintf(stderr, "%s download failed\n", - air->acp_intf); - (void) close(fd); - continue; - } - Mon = (Mon960 *)(volatile void *)(ram + MON960_BASE); - Uart = (Mon960 *)(volatile void *)&(Mon->mon_xmitmon); - - /* - * Determine endianess - */ - switch ( Mon->mon_bstat ) { - case BOOT_COLDSTART: - case BOOT_MONREADY: - case BOOT_FAILTEST: - case BOOT_RUNNING: - break; - - default: - switch (ntohl(Mon->mon_bstat)) { - case BOOT_COLDSTART: - case BOOT_MONREADY: - case BOOT_FAILTEST: - case BOOT_RUNNING: - endian++; - break; - - default: - fprintf(stderr, "%s unknown status\n", - air->acp_intf); - (void) close(fd); - continue; - } - break; - } - -#ifdef __FreeBSD__ - if (reset) { - u_int *hcr = (u_int *)(void *)(ram + PCA200E_HCR_OFFSET); - PCA200E_HCR_INIT(*hcr, PCA200E_RESET_BD); - delay(10000); - PCA200E_HCR_CLR(*hcr, PCA200E_RESET_BD); - delay(10000); - } -#endif - - if ( comm_mode ) { - static struct timeval timeout = { 0, 0 }; - int esc_seen = 0; - - /* - * We want to talk with the i960 monitor - */ - - /* - * Loop forever accepting characters - */ - for ( ; ; ) { - fd_set fdr; - int ns; - - /* - * Check for data from the terminal - */ - FD_ZERO ( &fdr ); - FD_SET ( fileno(stdin), &fdr ); - - if ( ( ns = select ( FD_SETSIZE, &fdr, NULL, NULL, - &timeout ) ) < 0 ) { - perror ( "select" ); - finish( -1 ); - } - - if ( ns ) { - char c1; - int nr; - - nr = read ( fileno(stdin), &c1, 1 ); - c1 &= 0xff; - if ( !esc_seen ) { - if ( c1 == 27 ) - esc_seen++; - else - xmit_byte ( c1, 0 ); - } else { - if ( c1 == 27 ) - finish( -1 ); - else { - xmit_byte ( 27, 0 ); - esc_seen = 0; - } - xmit_byte ( c1, 0 ); - } - } - - /* - * Check for data from the i960 - */ - if ( CP_READ(Uart->mon_xmithost) & UART_VALID ) { - c = getbyte(); - putchar ( c ); - } - if ( strcmp ( line, "Mon960" ) == 0 ) - autobaud(); - - } - } else { - /* - * Make sure the driver is loaded and that the CP - * is ready for commands - */ - if ( CP_READ(Mon->mon_bstat) == BOOT_RUNNING ) - { - fprintf ( stderr, - "%s is up and running - no download allowed.\n", - air->acp_intf ); - (void) close(fd); - continue; - } - - if ( CP_READ(Mon->mon_bstat) != BOOT_MONREADY ) - { - fprintf ( stderr, - "%s is not ready for downloading.\n", - air->acp_intf ); - (void) close(fd); - continue; - } - - /* - * Indicate who we're downloading - */ - if ( verbose ) - printf ( "Downloading code for %s\n", - air->acp_intf ); - - /* - * Look for the i960 monitor message. - * We should see this after a board reset. - */ - while ( strncmp ( line, "Mon960", 6 ) != 0 && - strncmp ( line, "=>", 2 ) != 0 ) - getline( verbose ); /* Verbose */ - - /* - * Autobaud fakery - */ - if ( strncmp ( line, "Mon960", 6 ) == 0 ) { - xmit_to_i960 ( "\r\n\r\n\r\n\r\n", 8, 0 ); - delay ( 10000 ); - } - - /* - * Keep reading until we get a command prompt - */ - while ( strncmp ( line, "=>", 2 ) != 0 ) - getline( verbose ); /* Verbose */ - - /* - * Choose the correct microcode file based on the - * adapter type the card claims to be. - */ - switch ( air->acp_device ) - { - case DEV_FORE_SBA200: - sprintf ( base, "sba200" ); - break; - - case DEV_FORE_SBA200E: - sprintf ( base, "sba200e" ); - break; - - case DEV_FORE_PCA200E: - sprintf ( base, "pca200e" ); - break; - - default: - err = 1; - fprintf(stderr, "Unknown adapter type: %d\n", - air->acp_device ); - } - - sndfile = NULL; - - if ( objfile == NULL ) { - switch ( air->acp_device ) { - case DEV_FORE_SBA200: - case DEV_FORE_SBA200E: - sprintf ( filename, "%s.bin%d", base, - air->acp_bustype ); - if ( stat ( filename, &sbuf ) == -1 ) { - sprintf ( filename, "%s/%s.bin%d", - dirname, base, - air->acp_bustype ); - if ( stat ( filename, &sbuf ) == -1 ) { - ext = 1; - sprintf ( filename, "%s.objd%d", - base, air->acp_bustype ); - if ( stat(filename, &sbuf) == -1 ) { - sprintf ( filename, - "%s/%s.objd%d", dirname, - base, - air->acp_bustype ); - if ( stat ( filename, &sbuf ) != -1 ) - sndfile = filename; - } else - sndfile = filename; - } else - sndfile = filename; - } else - sndfile = filename; - break; - case DEV_FORE_PCA200E: - /* Use compiled in microcode */ - if (pca_vers == 3) { - ucode = pca200e_microcode_3; - ucode_size = pca200e_microcode_size_3; - } else { - ucode = pca200e_microcode_4; - ucode_size = pca200e_microcode_size_4; - } - break; - default: - break; - } - } else - sndfile = objfile; - - if ( ext && !binary ) - err = xmitfile ( sndfile ); - else if (sndfile != NULL) - err = sendbinfile ( sndfile, ram ); - else - err = loadmicrocode( ucode, ucode_size, ram ); - - if ( err ) { - fprintf(stderr, "%s download failed\n", - air->acp_intf); - (void) close(fd); - continue; - } - - /* - * Download completed - wait around a while for - * the driver to initialize the adapter - */ - aap = (Aali *)(void *)(ram + CP_READ(Mon->mon_appl)); - for (i = 0; i < MAX_CHECK; i++, sleep(1)) { - uint32_t hb1, hb2, hb3; - - hb3 = CP_READ(Mon->mon_bstat); - if (hb3 != BOOT_RUNNING) { - if (verbose) - printf("bstat %x\n", hb3); - continue; - } - - hb1 = CP_READ(aap->aali_heartbeat); - delay(1); - hb2 = CP_READ(aap->aali_heartbeat); - if (verbose) - printf("hb %x %x\n", hb1, hb2); - if (hb1 < hb2) - break; - } - } - - close ( fd ); - } - } - - /* - * Exit - */ - exit (0); -} Property changes on: head/sbin/atm/fore_dnld/fore_dnld.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/fore_dnld/Makefile =================================================================== --- head/sbin/atm/fore_dnld/Makefile (revision 179307) +++ head/sbin/atm/fore_dnld/Makefile (nonexistent) @@ -1,36 +0,0 @@ -# =================================== -# 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. -# -# @(#) $Id: Makefile,v 1.5 1998/07/10 16:01:58 jpt Exp $ -# $FreeBSD$ - -PROG= fore_dnld -MAN= fore_dnld.8 -SRCS= fore_dnld.c pca200e.c - -WARNS?= 6 -CFLAGS+= -I${.CURDIR}/../../../sys - -DPADD= ${LIBATM} -LDADD= -latm - -.include Property changes on: head/sbin/atm/fore_dnld/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/fore_dnld/fore_dnld.8 =================================================================== --- head/sbin/atm/fore_dnld/fore_dnld.8 (revision 179307) +++ head/sbin/atm/fore_dnld/fore_dnld.8 (nonexistent) @@ -1,114 +0,0 @@ -.\" -.\" =================================== -.\" 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$ -.\" -.Dd December 3, 1996 -.Dt FORE_DNLD 8 -.Os -.Sh NAME -.Nm fore_dnld -.Nd "download FORE Systems' microcode into host ATM adapter" -.Sh SYNOPSIS -.Nm -.Op Fl 3 -.Op Fl i Ar intf -.Op Fl d Ar path -.Op Fl f Ar objfile -.Op Fl r -.Sh DESCRIPTION -The -.Nm -utility downloads FORE Systems' microcode into the host ATM adapter(s). -.Sh OPTIONS -.Bl -tag -width indent -.It Fl i Ar intf -Specify which ATM interface to download microcode to. -Default is to load microcode into all FORE Systems host adapters. -.It Fl d Ar path -Specify the path to prepend to the -.Ar objfile -name. -Default is to use current directory. -.It Fl f Ar objfile -Specify the microcode binary file. -Defaults are: -.Pa sba200.obj -for SBA-200 adapters, -.Pa sba200e.obj -for SBA-200E adapters, and -.Pa pca200e.bin -for PCA-200E adapters. -.El -.Sh NOTES -For the PCA200E adapter, if no file is specified on the command -line a built-in copy of version 4.1.12 microcode is used. -When the -option -.Fl 3 -is specified version 3.0.1 microcode is used instead. -.Pp -Microcode as distributed by FORE Systems is not ready for downloading -directly into SBA host ATM adapters. -Instead, the supplied microcode needs -to be processed with the -.Xr objcopy 1 -command to create an image suitable -for downloading. -Arguments to -.Xr objcopy 1 -are -.Dq Li "-S -l -Fcoff" . -.Pp -Microcode as -distributed by FORE Systems for the PCA host ATM adapter does not need -to be processed. -.Sh FILES -.Bl -tag -width indent -.It Pa ~fore/etc/objcopy -command to process FORE Systems supplied microcode. -.It Pa ~fore/etc/sba200*.ucode* -microcode as supplied by FORE Systems for SBA -adapters. -.It Pa ~fore/i386/pca200e.bin -microcode as supplied by FORE Systems for PCA -adapters. -.It Pa ~harp/doc/Install -HARP installation instructions. -.El -.Sh COPYRIGHT -Copyright (c) 1994-1998, Network Computing Services, Inc. -.Sh AUTHORS -.An John Cavanaugh , -Minnesota Supercomputer Center, Inc. -.An Mike Spengler , -Minnesota Supercomputer Center, Inc. -.An Joe Thomas , -Minnesota Supercomputer Center, Inc. -.Sh ACKNOWLEDGMENTS -This software was developed under the sponsorship of the -Defense Advanced Research Projects Agency (DARPA) under -contract numbers F19628-92-C-0072 and F19628-95-C-0215. -.Sh BUGS -None known. Property changes on: head/sbin/atm/fore_dnld/fore_dnld.8 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sbin/atm/Makefile =================================================================== --- head/sbin/atm/Makefile (revision 179307) +++ head/sbin/atm/Makefile (revision 179308) @@ -1,33 +1,28 @@ # =================================== # 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. # # @(#) $Id: Makefile,v 1.5 1998/07/10 16:01:58 jpt Exp $ # $FreeBSD$ SUBDIR= atmconfig -# Disabled in 7.0 as netatm is not MPSAFE. -# atm \ -# fore_dnld \ -# ilmid - .include Index: head/share/examples/atm/cpcs-design.txt =================================================================== --- head/share/examples/atm/cpcs-design.txt (revision 179307) +++ head/share/examples/atm/cpcs-design.txt (nonexistent) @@ -1,84 +0,0 @@ - - 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$ - Property changes on: head/share/examples/atm/cpcs-design.txt ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/sscf-design.txt =================================================================== --- head/share/examples/atm/sscf-design.txt (revision 179307) +++ head/share/examples/atm/sscf-design.txt (nonexistent) @@ -1,129 +0,0 @@ - - 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$ - Property changes on: head/share/examples/atm/sscf-design.txt ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/README =================================================================== --- head/share/examples/atm/README (revision 179307) +++ head/share/examples/atm/README (nonexistent) @@ -1,140 +0,0 @@ - - =================================== - 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$ - Property changes on: head/share/examples/atm/README ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/sscop-design.txt =================================================================== --- head/share/examples/atm/sscop-design.txt (revision 179307) +++ head/share/examples/atm/sscop-design.txt (nonexistent) @@ -1,220 +0,0 @@ - - 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$ - Property changes on: head/share/examples/atm/sscop-design.txt ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/atm-config.sh =================================================================== --- head/share/examples/atm/atm-config.sh (revision 179307) +++ head/share/examples/atm/atm-config.sh (nonexistent) @@ -1,88 +0,0 @@ -#! /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 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 - -# -# Configure network interfaces -# -/sbin/ifconfig netmask + up -/sbin/atm set arpserver - -# -# Configure PVCs (optional) -# -#/sbin/atm add pvc hfa0 aal5 null ip - -# -# 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 ... - -exit 0 - Property changes on: head/share/examples/atm/atm-config.sh ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/atm-sockets.txt =================================================================== --- head/share/examples/atm/atm-sockets.txt (revision 179307) +++ head/share/examples/atm/atm-sockets.txt (nonexistent) @@ -1,572 +0,0 @@ - - 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 -#include -#include -#include -#include -#include - -#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 -#include -#include -#include -#include -#include - -#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$ - Property changes on: head/share/examples/atm/atm-sockets.txt ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/fore-microcode.txt =================================================================== --- head/share/examples/atm/fore-microcode.txt (revision 179307) +++ head/share/examples/atm/fore-microcode.txt (nonexistent) @@ -1,93 +0,0 @@ - -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 responsibility 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 /Drivers/PCA200E.BIN /etc/pca200e.bin - - pc_adapter->'Windows NT'->archive->pca2e_12.zip - unzip the file and execute the command: - - cp -p /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 - -Move the resulting in binary mode back to the HARP machine as -/etc/pca200e.bin and try to initialize the ATM system again. - - @(#) $FreeBSD$ Property changes on: head/share/examples/atm/fore-microcode.txt ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/NOTES =================================================================== --- head/share/examples/atm/NOTES (revision 179307) +++ head/share/examples/atm/NOTES (nonexistent) @@ -1,54 +0,0 @@ - - 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$ - Property changes on: head/share/examples/atm/NOTES ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/atm/Startup =================================================================== --- head/share/examples/atm/Startup (revision 179307) +++ head/share/examples/atm/Startup (nonexistent) @@ -1,127 +0,0 @@ -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 - - 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 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 - - where 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 .... - - where is the name of the ATM physical interface - over which the PVC is being defined; - is the VPI value for the PVC; - is the VCI value for the PVC; - is the AAL type which the PVC endpoints will use; - is the encapsulation which the PVC endpoints will use; - 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, - is the name of the PVC's network interface; - 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 152 0 - - If you are using a Cisco LightStream 1010 switch, you would use the - following configuration command: - - > atm route atm 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 - - See the man pages scspd(8) and atmarpd(8) for further information. - - @(#) $FreeBSD$ - Property changes on: head/share/examples/atm/Startup ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/examples/Makefile =================================================================== --- head/share/examples/Makefile (revision 179307) +++ head/share/examples/Makefile (revision 179308) @@ -1,299 +1,285 @@ # $FreeBSD$ # # Doing a make install builds /usr/share/examples .include LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ bootforth \ cvsup \ diskless \ drivers \ etc \ find_interface \ ibcs2 \ ipfw \ isdn \ kld \ libvgl \ mdoc \ netgraph \ nwclient \ perfmon \ portal \ ppi \ ppp \ pppd \ printing \ ses \ scsi_target \ slattach \ sliplogin \ startslip \ sunrpc -# Disabled in 7.0 as netatm is not MPSAFE. -#LDIRS+= atm - XFILES= BSD_daemon/FreeBSD.pfa \ BSD_daemon/README \ BSD_daemon/beastie.eps \ BSD_daemon/beastie.fig \ BSD_daemon/eps.patch \ BSD_daemon/poster.sh \ FreeBSD_version/FreeBSD_version.c \ FreeBSD_version/Makefile \ FreeBSD_version/README \ IPv6/USAGE \ bootforth/README \ bootforth/boot.4th \ bootforth/frames.4th \ bootforth/loader.rc \ bootforth/menu.4th \ bootforth/menuconf.4th \ bootforth/screen.4th \ cvsup/README \ cvsup/cvs-supfile \ cvsup/doc-supfile \ cvsup/gnats-supfile \ cvsup/ports-supfile \ cvsup/refuse \ cvsup/refuse.README \ cvsup/stable-supfile \ cvsup/standard-supfile \ cvsup/www-supfile \ diskless/ME \ diskless/README.BOOTP \ diskless/README.TEMPLATING \ diskless/clone_root \ drivers/README \ drivers/make_device_driver.sh \ drivers/make_pseudo_driver.sh \ etc/README.examples \ etc/bsd-style-copyright \ etc/make.conf \ find_interface/Makefile \ find_interface/README \ find_interface/find_interface.c \ ibcs2/README \ ibcs2/hello.uu \ ipfw/change_rules.sh \ isdn/FAQ \ isdn/KERNEL \ isdn/Overview \ isdn/README \ isdn/ROADMAP \ isdn/ReleaseNotes \ isdn/Resources \ isdn/SupportedCards \ isdn/ThankYou \ isdn/contrib/README \ isdn/contrib/anleitung.ppp \ isdn/contrib/answer.c \ isdn/contrib/answer.sh \ isdn/contrib/convert.sh \ isdn/contrib/hplay.c \ isdn/contrib/i4b-ppp-newbie.txt \ isdn/contrib/isdnctl \ isdn/contrib/isdnd_acct \ isdn/contrib/isdnd_acct.pl \ isdn/contrib/isdntelmux.c \ isdn/contrib/mrtg-isp0.sh \ isdn/i4brunppp/Makefile \ isdn/i4brunppp/README \ isdn/i4brunppp/i4brunppp-isdnd.rc \ isdn/i4brunppp/i4brunppp.8 \ isdn/i4brunppp/i4brunppp.c \ isdn/v21/Makefile \ isdn/v21/README \ isdn/v21/v21modem.c \ kld/Makefile \ kld/cdev/Makefile \ kld/cdev/README \ kld/cdev/module/Makefile \ kld/cdev/module/cdev.c \ kld/cdev/module/cdev.h \ kld/cdev/module/cdevmod.c \ kld/cdev/test/Makefile \ kld/cdev/test/testcdev.c \ kld/dyn_sysctl/Makefile \ kld/dyn_sysctl/README \ kld/dyn_sysctl/dyn_sysctl.c \ kld/syscall/Makefile \ kld/syscall/module/Makefile \ kld/syscall/module/syscall.c \ kld/syscall/test/Makefile \ kld/syscall/test/call.c \ libvgl/Makefile \ libvgl/demo.c \ mdoc/POSIX-copyright \ mdoc/deshallify.sh \ mdoc/example.1 \ mdoc/example.3 \ mdoc/example.4 \ mdoc/example.9 \ netgraph/ether.bridge \ netgraph/frame_relay \ netgraph/ngctl \ netgraph/raw \ netgraph/udp.tunnel \ nwclient/dot.nwfsrc \ nwclient/nwfs.sh.sample \ perfmon/Makefile \ perfmon/README \ perfmon/perfmon.c \ portal/README \ portal/portal.conf \ ppi/Makefile \ ppi/ppilcd.c \ ppp/chap-auth \ ppp/isdnd.rc \ ppp/login-auth \ ppp/ppp.conf.isdn \ ppp/ppp.conf.sample \ ppp/ppp.conf.span-isp \ ppp/ppp.conf.span-isp.working \ ppp/ppp.linkdown.sample \ ppp/ppp.linkdown.span-isp \ ppp/ppp.linkdown.span-isp.working \ ppp/ppp.linkup.sample \ ppp/ppp.linkup.span-isp \ ppp/ppp.linkup.span-isp.working \ ppp/ppp.secret.sample \ ppp/ppp.secret.span-isp \ ppp/ppp.secret.span-isp.working \ pppd/auth-down.sample \ pppd/auth-up.sample \ pppd/chap-secrets.sample \ pppd/chat.sh.sample \ pppd/ip-down.sample \ pppd/ip-up.sample \ pppd/options.sample \ pppd/pap-secrets.sample \ pppd/ppp.deny.sample \ pppd/ppp.shells.sample \ printing/README \ printing/diablo-if-net \ printing/hpdf \ printing/hpif \ printing/hpof \ printing/hprf \ printing/hpvf \ printing/if-simple \ printing/if-simpleX \ printing/ifhp \ printing/make-ps-header \ printing/netprint \ printing/psdf \ printing/psdfX \ printing/psif \ printing/pstf \ printing/pstfX \ ses/Makefile \ ses/Makefile.inc \ ses/getencstat/Makefile \ ses/getencstat/getencstat.0 \ ses/sesd/Makefile \ ses/sesd/sesd.0 \ ses/setencstat/Makefile \ ses/setencstat/setencstat.0 \ ses/setobjstat/Makefile \ ses/setobjstat/setobjstat.0 \ ses/srcs/chpmon.c \ ses/srcs/eltsub.c \ ses/srcs/getencstat.c \ ses/srcs/getnobj.c \ ses/srcs/getobjmap.c \ ses/srcs/getobjstat.c \ ses/srcs/inienc.c \ ses/srcs/sesd.c \ ses/srcs/setencstat.c \ ses/srcs/setobjstat.c \ scsi_target/Makefile \ scsi_target/scsi_target.c \ scsi_target/scsi_target.h \ scsi_target/scsi_target.8 \ scsi_target/scsi_cmds.c \ slattach/unit-command.sh \ sliplogin/slip.hosts \ sliplogin/slip.login \ sliplogin/slip.logout \ sliplogin/slip.slparms \ startslip/sldown.sh \ startslip/slip.sh \ startslip/slup.sh \ sunrpc/Makefile \ sunrpc/dir/Makefile \ sunrpc/dir/dir.x \ sunrpc/dir/dir_proc.c \ sunrpc/dir/rls.c \ sunrpc/msg/Makefile \ sunrpc/msg/msg.x \ sunrpc/msg/msg_proc.c \ sunrpc/msg/printmsg.c \ sunrpc/msg/rprintmsg.c \ sunrpc/sort/Makefile \ sunrpc/sort/rsort.c \ sunrpc/sort/sort.x \ sunrpc/sort/sort_proc.c - -# Disabled in 7.0 as netatm is not MPSAFE. -#XFILES+= atm/NOTES \ -# atm/README \ -# atm/Startup \ -# atm/atm-config.sh \ -# atm/atm-sockets.txt \ -# atm/cpcs-design.txt \ -# atm/fore-microcode.txt \ -# atm/sscf-design.txt \ -# atm/sscop-design.txt BINDIR= ${SHAREDIR}/examples NO_OBJ= # 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 beforeinstall: ${SHARED} etc-examples .ORDER: ${SHARED} etc-examples copies: .for i in ${LDIRS} if [ -L ${DESTDIR}${BINDIR}/$i ]; then \ rm -f ${DESTDIR}${BINDIR}/$i; \ fi .endfor mtree -deU ${MTREE_FOLLOWS_SYMLINKS} \ -f ${.CURDIR}/../../etc/mtree/BSD.usr.dist -p ${DESTDIR}/usr .for file in ${XFILES} ${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m ${SHAREMODE} \ ${.CURDIR}/${file} ${DESTDIR}${BINDIR}/${file} .endfor symlinks: .for i in ${LDIRS} rm -rf ${DESTDIR}${BINDIR}/$i ln -s ${.CURDIR}/$i ${DESTDIR}${BINDIR}/$i .endfor etc-examples: .if ${SHARED} != "symlinks" (cd ${.CURDIR}/../../etc; ${MAKE} etc-examples) .endif .if ${SHARED} != "symlinks" SUBDIR= smbfs .if ${MK_IPFILTER} != "no" SUBDIR+=ipfilter .endif .if ${MK_PF} != "no" SUBDIR+=pf .endif .endif .include Index: head/share/man/man4/ng_atmpif.4 =================================================================== --- head/share/man/man4/ng_atmpif.4 (revision 179307) +++ head/share/man/man4/ng_atmpif.4 (nonexistent) @@ -1,161 +0,0 @@ -.\" -.\" Copyright (c) 2001-2003 -.\" Harti Brandt. -.\" Vincent Jardin. -.\" 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. -.\" -.\" Author: Hartmut Brandt -.\" Author: Vincent Jardin -.\" -.\" $FreeBSD$ -.\" -.\" ng_atmpif(4) man page -.\" -.Dd August 7, 2003 -.Dt NG_ATMPIF 4 -.Os -.Sh NAME -.Nm ng_atmpif -.Nd netgraph HARP/ATM Virtual Physical Interface -.Sh SYNOPSIS -.In sys/types.h -.In netatm/atm_if.h -.In netgraph/atm/ng_atmpif.h -.Sh DESCRIPTION -The -.Nm atmpif -netgraph node type allows the emulation of -.Xr atm 8 -(netatm/HARP) Physical devices (PIF) to be connected to the -.Xr netgraph 4 -networking subsystem. -Moreover, it includes protection of the PDU against duplication and -desequencement. -It supports up to 65535 VCs and up to 255 VPs. -AAL0, AAL3/4 and AAL5 -emulation are provided. -In order to optimize CPU, this node does not emulate the SAR layer. -.Pp -The purpose of this node is to help in debugging and testing the HARP -stack when one does not have an ATM board or when the available boards do not -have enough features. -.Pp -When a node -is created, a PIF is created automatically. -It is named -.Li hvaX . -It has the same features as any other HARP devices. -The PIF is removed when the node is removed. -.Sh HOOKS -There is only one hook: -.Va link . -This hook can be connected to any other -Netgraph node. -For example, in order -to test the HARP stack over UDP, it can be connected on a -.Xr ng_ksocket 4 -node. -.Sh CONTROL MESSAGES -This node type supports the generic messages plus the following: -.Pp -.Bl -tag -width indent -compact -.It Dv NGM_ATMPIF_SET_CONFIG Pq Li setconfig -Configures the debugging features of the node and a virtual -Peak Cell Rate (PCR). -It uses the same structure as -.Dv NGM_ATMPIF_GET_CONFIG . -.Pp -.It Dv NGM_ATMPIF_GET_CONFIG Pq Li getconfig -Returns a structure defining the configuration of the interface: -.Bd -literal -struct ng_vatmpif_config { - uint8_t debug; /* debug bit field (see below) */ - uint32_t pcr; /* peak cell rate */ - Mac_addr macaddr; /* Mac Address */ -}; -.Ed -Note that the following debugging flags can be used: -.Pp -.Bl -tag -width ".Dv VATMPIF_DEBUG_PACKET" -offset indent -compact -.It Dv VATMPIF_DEBUG_NONE -disable debugging -.It Dv VATMPIF_DEBUG_PACKET -enable debugging -.El -.Pp -.It Dv NGM_ATMPIF_GET_LINK_STATUS Pq Li getlinkstatus -Returns the last received sequence number, the last sent sequence -number and the current total PCR that is reserved among all the VCCs -of the interface. -.Bd -literal -struct ng_atmpif_link_status { - uint32_t InSeq; /* last received sequence number + 1 */ - uint32_t OutSeq; /* last sent sequence number */ - uint32_t cur_pcr; /* slot's reserved PCR */ -}; -.Ed -.Pp -.It Dv NGM_ATMPIF_GET_STATS Pq Li getstats -.It Dv NGM_ATMPIF_CLR_STATS Pq Li clrstats -.It Dv NGM_ATMPIF_GETCLR_STATS Pq Li getclrstats -It returns the node's statistics, it clears them or it returns and resets -their values to 0. -The following stats are provided. -.Bd -literal -struct hva_stats_ng { - uint32_t ng_errseq; /* Duplicate or out of order */ - uint32_t ng_lostpdu; /* PDU lost detected */ - uint32_t ng_badpdu; /* Unknown PDU type */ - uint32_t ng_rx_novcc; /* Draining PDU on closed VCC */ - uint32_t ng_rx_iqfull; /* PDU drops no room in atm_intrq */ - uint32_t ng_tx_rawcell; /* PDU raw cells transmitted */ - uint32_t ng_rx_rawcell; /* PDU raw cells received */ - uint64_t ng_tx_pdu; /* PDU transmitted */ - uint64_t ng_rx_pdu; /* PDU received */ -}; -struct hva_stats_atm { - uint64_t atm_xmit; /* Cells transmitted */ - uint64_t atm_rcvd; /* Cells received */ -}; -struct hva_stats_aal5 { - uint64_t aal5_xmit; /* Cells transmitted */ - uint64_t aal5_rcvd; /* Cells received */ - uint32_t aal5_crc_len; /* Cells with CRC/length errors */ - uint32_t aal5_drops; /* Cell drops */ - uint64_t aal5_pdu_xmit; /* CS PDUs transmitted */ - uint64_t aal5_pdu_rcvd; /* CS PDUs received */ - uint32_t aal5_pdu_crc; /* CS PDUs with CRC errors */ - uint32_t aal5_pdu_errs; /* CS layer protocol errors */ - uint32_t aal5_pdu_drops; /* CS PDUs dropped */ -}; -.Ed -.El -.Sh SEE ALSO -.Xr natm 4 , -.Xr netgraph 4 , -.Xr ng_ksocket 4 , -.Xr ngctl 8 -.Sh AUTHORS -.An Harti Brandt Aq harti@FreeBSD.org -.An Vincent Jardin Aq vjardin@wanadoo.fr Property changes on: head/share/man/man4/ng_atmpif.4 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/share/man/man4/Makefile =================================================================== --- head/share/man/man4/Makefile (revision 179307) +++ head/share/man/man4/Makefile (revision 179308) @@ -1,579 +1,578 @@ # @(#)Makefile 8.1 (Berkeley) 6/18/93 # $FreeBSD$ MAN= aac.4 \ acpi.4 \ ${_acpi_dock.4} \ acpi_thermal.4 \ acpi_video.4 \ adv.4 \ adw.4 \ age.4 \ agp.4 \ aha.4 \ ahb.4 \ ahc.4 \ ahd.4 \ aio.4 \ altq.4 \ amd.4 \ ${_amdsmb.4} \ amr.4 \ an.4 \ arcmsr.4 \ ${_asmc.4} \ asr.4 \ ata.4 \ atapicam.4 \ ataraid.4 \ ath.4 \ ath_hal.4 \ atkbd.4 \ atkbdc.4 \ audit.4 \ auditpipe.4 \ aue.4 \ axe.4 \ bce.4 \ bfe.4 \ bge.4 \ bktr.4 \ blackhole.4 \ bpf.4 \ bt.4 \ cardbus.4 \ carp.4 \ ccd.4 \ cd.4 \ cdce.4 \ ch.4 \ ciss.4 \ cm.4 \ cmx.4 \ cnw.4 \ coda.4 \ ${_coretemp.4} \ cpufreq.4 \ crypto.4 \ cue.4 \ cxgb.4 \ cy.4 \ da.4 \ dc.4 \ dcons.4 \ dcons_crom.4 \ ddb.4 \ de.4 \ devctl.4 \ digi.4 \ disc.4 \ divert.4 \ dpt.4 \ dummynet.4 \ ed.4 \ edsc.4 \ ef.4 \ ehci.4 \ em.4 \ en.4 \ enc.4 \ esp.4 \ exca.4 \ faith.4 \ fatm.4 \ fd.4 \ fdc.4 \ firewire.4 \ fla.4 \ fpa.4 \ fwe.4 \ fwip.4 \ fwohci.4 \ fxp.4 \ gbde.4 \ gdb.4 \ gem.4 \ geom.4 \ geom_fox.4 \ geom_linux_lvm.4 \ geom_uzip.4 \ gif.4 \ gre.4 \ harp.4 \ hatm.4 \ hfa.4 \ hifn.4 \ hme.4 \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ icmp.4 \ icmp6.4 \ ida.4 \ idt.4 \ ieee80211.4 \ if_bridge.4 \ ifmib.4 \ iic.4 \ iicbb.4 \ iicbus.4 \ iicsmb.4 \ iir.4 \ inet.4 \ inet6.4 \ intpm.4 \ intro.4 \ ip.4 \ ip6.4 \ ipfirewall.4 \ ${_ipmi.4} \ ips.4 \ ipsec.4 \ ipw.4 \ iscsi_initiator.4 \ isp.4 \ ispfw.4 \ iwi.4 \ iwn.4 \ ixgb.4 \ joy.4 \ k8temp.4 \ kbdmux.4 \ keyboard.4 \ kld.4 \ ktr.4 \ kue.4 \ lagg.4 \ le.4 \ led.4 \ lge.4 \ lmc.4 \ lo.4 \ lp.4 \ lpbb.4 \ lpt.4 \ mac.4 \ mac_biba.4 \ mac_bsdextended.4 \ mac_ifoff.4 \ mac_lomac.4 \ mac_mls.4 \ mac_none.4 \ mac_partition.4 \ mac_portacl.4 \ mac_seeotheruids.4 \ mac_stub.4 \ mac_test.4 \ malo.4 \ md.4 \ mem.4 \ meteor.4 \ mfi.4 \ miibus.4 \ mlx.4 \ mly.4 \ mmc.4 \ mmcsd.4 \ mn.4 \ mouse.4 \ mpt.4 \ msk.4 \ mtio.4 \ multicast.4 \ mxge.4 \ my.4 \ natm.4 \ natmip.4 \ ncr.4 \ ncv.4 \ netgraph.4 \ netintro.4 \ ${_nfe.4} \ ${_nfsmb.4} \ ng_async.4 \ ng_atm.4 \ ngatmbase.4 \ ng_atmllc.4 \ - ng_atmpif.4 \ ng_bluetooth.4 \ ng_bpf.4 \ ng_bridge.4 \ ng_bt3c.4 \ ng_btsocket.4 \ ng_car.4 \ ng_ccatm.4 \ ng_cisco.4 \ ng_deflate.4 \ ng_device.4 \ nge.4 \ ng_echo.4 \ ng_eiface.4 \ ng_etf.4 \ ng_ether.4 \ ng_fec.4 \ ng_frame_relay.4 \ ng_gif.4 \ ng_gif_demux.4 \ ng_h4.4 \ ng_hci.4 \ ng_hole.4 \ ng_hub.4 \ ng_iface.4 \ ng_ipfw.4 \ ng_ip_input.4 \ ng_ksocket.4 \ ng_l2cap.4 \ ng_l2tp.4 \ ng_lmi.4 \ ng_mppc.4 \ ng_nat.4 \ ng_netflow.4 \ ng_one2many.4 \ ng_ppp.4 \ ng_pppoe.4 \ ng_pptpgre.4 \ ng_pred1.4 \ ng_rfc1490.4 \ ng_socket.4 \ ng_source.4 \ ng_split.4 \ ng_sppp.4 \ ng_sscfu.4 \ ng_sscop.4 \ ng_tag.4 \ ng_tcpmss.4 \ ng_tee.4 \ ng_tty.4 \ ng_ubt.4 \ ng_UI.4 \ ng_uni.4 \ ng_vjc.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ null.4 \ ${_nve.4} \ ${_nxge.4} \ ohci.4 \ orm.4 \ pass.4 \ patm.4 \ pccard.4 \ pccbb.4 \ pci.4 \ pcib.4 \ pcic.4 \ pcm.4 \ pcn.4 \ pim.4 \ polling.4 \ ppbus.4 \ ppc.4 \ ppi.4 \ ppp.4 \ psm.4 \ pst.4 \ pt.4 \ pty.4 \ puc.4 \ ral.4 \ random.4 \ rc.4 \ re.4 \ rl.4 \ rndtest.4 \ route.4 \ rp.4 \ rue.4 \ rum.4 \ sa.4 \ safe.4 \ sbp.4 \ sbp_targ.4 \ sbsh.4 \ scc.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ scsi.4 \ sctp.4 \ sem.4 \ ses.4 \ sf.4 \ si.4 \ sio.4 \ sis.4 \ sk.4 \ sl.4 \ smb.4 \ smbus.4 \ smp.4 \ sn.4 \ snd_ad1816.4 \ snd_als4000.4 \ snd_atiixp.4 \ snd_cmi.4 \ snd_cs4281.4 \ snd_csa.4 \ snd_ds1.4 \ snd_emu10k1.4 \ snd_emu10kx.4 \ snd_envy24.4 \ snd_envy24ht.4 \ snd_es137x.4 \ snd_ess.4 \ snd_fm801.4 \ snd_gusc.4 \ snd_hda.4 \ snd_ich.4 \ snd_maestro3.4 \ snd_maestro.4 \ snd_mss.4 \ snd_neomagic.4 \ snd_sbc.4 \ snd_solo.4 \ snd_spicds.4 \ snd_t4dwave.4 \ snd_uaudio.4 \ snd_via8233.4 \ snd_via82c686.4 \ snd_vibes.4 \ snp.4 \ spic.4 \ ${_spkr.4} \ splash.4 \ sppp.4 \ ste.4 \ stf.4 \ stg.4 \ stge.4 \ sym.4 \ syncache.4 \ syncer.4 \ syscons.4 \ sysmouse.4 \ tap.4 \ targ.4 \ tcp.4 \ tdfx.4 \ termios.4 \ textdump.4 \ ti.4 \ tl.4 \ trm.4 \ tty.4 \ tun.4 \ twa.4 \ twe.4 \ tx.4 \ txp.4 \ uark.4 \ uart.4 \ ubsa.4 \ ubsec.4 \ ubser.4 \ ubtbcmfw.4 \ uchcom.4 \ ucom.4 \ ucycom.4 \ udav.4 \ udbp.4 \ udp.4 \ ufm.4 \ ufoma.4 \ uftdi.4 \ ugen.4 \ uhci.4 \ uhid.4 \ ukbd.4 \ ulpt.4 \ umass.4 \ umct.4 \ umodem.4 \ ums.4 \ unix.4 \ uplcom.4 \ ural.4 \ urio.4 \ usb.4 \ uscanner.4 \ uslcom.4 \ utopia.4 \ uvisor.4 \ uvscom.4 \ vga.4 \ vge.4 \ vinum.4 \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ watchdog.4 \ wb.4 \ wi.4 \ witness.4 \ wlan.4 \ wlan_acl.4 \ wlan_amrr.4 \ wlan_ccmp.4 \ wlan_tkip.4 \ wlan_wep.4 \ wlan_xauth.4 \ ${_wpi.4} \ xe.4 \ xl.4 \ xpt.4 \ zero.4 \ zyd.4 MLINKS= agp.4 agpgart.4 MLINKS+=altq.4 ALTQ.4 MLINKS+=an.4 if_an.4 MLINKS+=ata.4 acd.4 \ ata.4 ad.4 \ ata.4 afd.4 \ ata.4 ast.4 MLINKS+=aue.4 if_aue.4 MLINKS+=axe.4 if_axe.4 MLINKS+=bce.4 if_bce.4 MLINKS+=bfe.4 if_bfe.4 MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 MLINKS+=cnw.4 if_cnw.4 MLINKS+=crypto.4 cryptodev.4 MLINKS+=cue.4 if_cue.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 MLINKS+=ed.4 if_ed.4 MLINKS+=edsc.4 if_edsc.4 MLINKS+=ef.4 if_ef.4 MLINKS+=em.4 if_em.4 MLINKS+=en.4 if_en.4 MLINKS+=faith.4 if_faith.4 MLINKS+=fatm.4 if_fatm.4 MLINKS+=fd.4 stderr.4 \ fd.4 stdin.4 \ fd.4 stdout.4 MLINKS+=firewire.4 ieee1394.4 MLINKS+=fpa.4 fea.4 MLINKS+=fwe.4 if_fwe.4 MLINKS+=fwip.4 if_fwip.4 MLINKS+=fxp.4 if_fxp.4 MLINKS+=gem.4 if_gem.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 MLINKS+=gre.4 if_gre.4 MLINKS+=hatm.4 if_hatm.4 MLINKS+=hme.4 if_hme.4 MLINKS+=${_hptrr.4} ${_rr232x.4} MLINKS+=idt.4 if_idt.4 MLINKS+=if_bridge.4 bridge.4 MLINKS+=ip.4 rawip.4 MLINKS+=ipfirewall.4 ipaccounting.4 \ ipfirewall.4 ipacct.4 \ ipfirewall.4 ipfw.4 MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 MLINKS+=ixgb.4 if_ixgb.4 MLINKS+=kue.4 if_kue.4 MLINKS+=lagg.4 trunk.4 MLINKS+=le.4 if_le.4 MLINKS+=lge.4 if_lge.4 MLINKS+=lo.4 loop.4 MLINKS+=lp.4 plip.4 MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 MLINKS+=mn.4 if_mn.4 MLINKS+=mxge.4 if_mxge.4 MLINKS+=my.4 if_my.4 MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 MLINKS+=pccbb.4 cbb.4 MLINKS+=pcm.4 snd.4 \ pcm.4 sound.4 MLINKS+=pcn.4 if_pcn.4 MLINKS+=ppp.4 if_ppp.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 MLINKS+=rue.4 if_rue.4 MLINKS+=rum.4 if_rum.4 MLINKS+=sbsh.4 if_sbsh.4 MLINKS+=scsi.4 CAM.4 \ scsi.4 cam.4 \ scsi.4 scbus.4 \ scsi.4 SCSI.4 MLINKS+=sf.4 if_sf.4 MLINKS+=sis.4 if_sis.4 MLINKS+=sk.4 if_sk.4 MLINKS+=sl.4 if_sl.4 MLINKS+=smp.4 SMP.4 MLINKS+=sn.4 if_sn.4 MLINKS+=snd_envy24.4 snd_ak452x.4 MLINKS+=snd_sbc.4 snd_sb16.4 \ snd_sbc.4 snd_sb8.4 MLINKS+=${_spkr.4} ${_speaker.4} MLINKS+=splash.4 screensaver.4 MLINKS+=ste.4 if_ste.4 MLINKS+=stf.4 if_stf.4 MLINKS+=stge.4 if_stge.4 MLINKS+=syncache.4 syncookies.4 MLINKS+=syscons.4 sc.4 MLINKS+=tap.4 if_tap.4 MLINKS+=tdfx.4 tdfx_linux.4 MLINKS+=ti.4 if_ti.4 MLINKS+=tl.4 if_tl.4 MLINKS+=tun.4 if_tun.4 MLINKS+=tx.4 if_tx.4 MLINKS+=txp.4 if_txp.4 MLINKS+=udav.4 if_udav.4 MLINKS+=ural.4 if_ural.4 MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 MLINKS+=wi.4 if_wi.4 MLINKS+=${_wpi.4} ${_if_wpi.4} MLINKS+=xe.4 if_xe.4 MLINKS+=xl.4 if_xl.4 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _acpi_dock.4= acpi_dock.4 _amdsmb.4= amdsmb.4 _asmc.4= asmc.4 _coretemp.4= coretemp.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 _ichwd.4= ichwd.4 _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nxge.4= nxge.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 _wpi.4= wpi.4 .endif .if exists(${.CURDIR}/man4.${MACHINE_ARCH}) SUBDIR= man4.${MACHINE_ARCH} .endif .include Index: head/share/man/man7/hier.7 =================================================================== --- head/share/man/man7/hier.7 (revision 179307) +++ head/share/man/man7/hier.7 (revision 179308) @@ -1,847 +1,843 @@ .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. 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 the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. .\" .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" .Dd June 28, 2007 .Dt HIER 7 .Os .Sh NAME .Nm hier .Nd layout of file systems .Sh DESCRIPTION A sketch of the file system hierarchy. .Bl -tag -width ".Pa /libexec/" .It Pa / root directory of the file system .It Pa /bin/ user utilities fundamental to both single-user and multi-user environments .It Pa /boot/ programs and configuration files used during operating system bootstrap .Pp .Bl -tag -width ".Pa defaults/" -compact .It Pa defaults/ default bootstrapping configuration files; see .Xr loader.conf 5 .It Pa kernel/ pure kernel executable (the operating system loaded into memory at boot time). .It Pa modules/ third-party loadable kernel modules; see .Xr kldstat 8 .El .It Pa /cdrom/ default mount point for CD-ROM drives (created by .Xr sysinstall 8 ) .It Pa /compat/ normally a link to .Pa /usr/compat . If not, then the .Pa /usr/compat comments apply (created by .Xr sysinstall 8 ) .It Pa /dev/ device special files managed by .Xr devfs 5 .Pp .Bl -tag -width ".Pa net/" -compact .It Pa fd/ file descriptor files; see .Xr \&fd 4 .It Pa net/ network devices .El .It Pa /dist/ mount point used by .Xr sysinstall 8 .It Pa /etc/ system configuration files and scripts .Pp .Bl -tag -width ".Pa bluetooth/" -compact .It Pa defaults/ default system configuration files; see .Xr rc 8 .It Pa bluetooth/ bluetooth configuration files .It Pa gnats/ gnats configuration files; see .Xr send-pr 1 .It Pa isdn/ isdn4bsd configuration files; see .Xr isdnd 8 .It Pa localtime local timezone information; see .Xr ctime 3 .It Pa mail/ Sendmail control files .It Pa mtree/ mtree configuration files; see .Xr mtree 8 .It Pa namedb/ named configuration files; see .Xr named 8 .It Pa pam.d/ configuration files for the Pluggable Authentication Modules (PAM) library .It Pa periodic/ scripts that are run daily, weekly, and monthly, via .Xr cron 8 ; see .Xr periodic 8 .It Pa rc.d/ System and daemon startup/control scripts; see .Xr rc 8 .It Pa security/ OpenBSM audit configuration files; see .Xr audit 8 .It Pa ppp/ ppp configuration files; see .Xr ppp 8 .It Pa ssh/ OpenSSH configuration files; see .Xr ssh 1 .It Pa ssl/ OpenSSL configuration files .El .It Pa /lib/ critical system libraries needed for binaries in .Pa /bin and .Pa /sbin .Pp .Bl -tag -width ".Pa geom/" -compact .It Pa geom/ class-specific libraries for the .Xr geom 8 utility .El .It Pa /libexec/ critical system utilities needed for binaries in .Pa /bin and .Pa /sbin .It Pa /media/ contains subdirectories to be used as mount points for removable media such as CDs, USB drives, and floppy disks .It Pa /mnt/ empty directory commonly used by system administrators as a temporary mount point .It Pa /proc/ process file system; see .Xr procfs 5 .It Pa /rescue/ statically linked programs for emergency recovery; see .Xr rescue 8 .It Pa /root/ root's HOME directory .It Pa /sbin/ system programs and administration utilities fundamental to both single-user and multi-user environments .It Pa /tmp/ temporary files that are not guaranteed to persist across system reboots .It Pa /usr/ contains the majority of user utilities and applications .Pp .Bl -tag -width ".Pa libdata/" -compact .It Pa bin/ common utilities, programming tools, and applications .It Pa compat/ files needed to support binary compatibility with other operating systems, such as Linux (created by .Xr sysinstall 8 ) .It Pa games/ useful and semi-frivolous programs .It Pa include/ standard C include files .Pp .Bl -tag -width ".Pa kerberos5/" -compact .It Pa altq/ C include files for alternate queueing .It Pa arpa/ C include files for Internet service protocols .It Pa bsnmp/ C include files for the SNMP daemon .It Pa c++/ C++ include files .It Pa cam/ C include files for the Common Access Methods Layer .Bl -tag -width ".Pa kerberos5/" -compact .It Pa scsi/ The SCSI device on top of CAM .El .It Pa dev/ C include files for programming various .Fx devices .Bl -tag -width ".Pa kerberos5/" -compact .It Pa ic/ Various header files describing driver- and bus-independent hardware circuits .It Pa ofw/ Open Firmware support .It Pa pbio/ 8255 PPI cards; see .Xr pbio 4 .It Pa ppbus/ The parallel port bus; see .Xr ppbus 4 .It Pa usb/ The USB subsystem .It Pa utopia/ Physical chip driver for ATM interfaces; see .Xr utopia 4 .It Pa wi/ The .Xr wi 4 WaveLAN driver .El .It Pa fs/ .Bl -tag -width ".Pa kerberos5/" -compact .It Pa fdescfs/ per-process file descriptors file system .It Pa fifofs/ .St -p1003.1 FIFOs file system .It Pa msdosfs/ MS-DOS file system .It Pa ntfs/ NTFS file system .It Pa nullfs/ loopback file system .It Pa nwfs/ NetWare file system .It Pa portalfs/ portal file system .It Pa procfs/ process file system .It Pa smbfs/ SMB/CIFS file system .It Pa udf/ UDF file system .It Pa unionfs union file system .El .It Pa geom/ GEOM framework .Bl -tag -width ".Pa kerberos5/" -compact .It Pa concat/ CONCAT GEOM class .It Pa gate/ GATE GEOM class .It Pa mirror/ MIRROR GEOM class .It Pa nop/ NOP GEOM class .It Pa raid3/ RAID3 GEOM class .It Pa stripe/ STRIPE GEOM class .El .Pp .It Pa isc/ ISC utility library libisc include files .It Pa isofs/ .Bl -tag -width ".Pa kerberos5/" -compact .It Pa cd9660/ iso9660 file system .El .It Pa libmilter/ C include files for libmilter, the .Xr sendmail 8 mail filter API .It Pa machine/ machine-specific C include files .It Pa net/ miscellaneous network C include files .It Pa netatalk/ Appletalk protocol -.It Pa netatm/ -ATM include files; -see -.Xr atm 8 .It Pa netinet/ C include files for Internet standard protocols; see .Xr inet 4 .It Pa netinet6/ C include files for Internet protocol version 6; see .Xr inet6 4 .It Pa netipsec/ kernel key-management service; see .Xr ipsec 4 .It Pa netipx/ IPX/SPX protocol stacks .It Pa netnatm/ NATM include files; see .Xr natm 4 .Bl -tag -width ".Pa kerberos5/" -compact .It Pa api/ include files for the signalling API .It Pa msg/ include files that describe signalling messages and declare associated functions .It Pa saal/ include files for the signalling AAL layer .It Pa sig/ include files for the UNI signalling protocol .El .It Pa netsmb/ SMB/CIFS requester .It Pa nfs/ C include files for NFS (Network File System) .It Pa objc/ Objective C include files .It Pa openssl/ OpenSSL (Cryptography/SSL toolkit) headers .It Pa pccard/ PC-CARD controllers .It Pa protocols/ C include files for Berkeley service protocols .It Pa readline/ get a line from a user, with editing; see .Xr readline 3 .It Pa rpc/ remote procedure calls; see .Xr rpc 3 .It Pa rpcsvc/ definition of RPC service structures; see .Xr rpc 3 .It Pa security/ PAM; see .Xr pam 8 .It Pa sys/ system C include files (kernel data structures) .\" .It Pa tcl/ .\" Tcl language; .\" see .\" .Xr Tcl n .\" .Bl -tag -width ".Pa kerberos5/" -compact .\" .It Pa generic/ .\" ??? .\" .It Pa unix/ .\" ??? .\" .El .It Pa ufs/ C include files for UFS (The U-word File System) .Bl -tag -width ".Pa kerberos5/" -compact .It Pa ffs/ Fast file system .It Pa ufs/ UFS file system .El .It Pa vm/ virtual memory; see .Xr vmstat 8 .El .Pp .It Pa lib/ shared and archive .Xr ar 1 Ns -type libraries .Bl -tag -width Fl -compact .It Pa aout/ a.out archive libraries .It Pa compat/ shared libraries for compatibility .Bl -tag -width Fl -compact .It Pa aout/ a.out backward compatibility libraries .El .It Pa dtrace/ DTrace library scripts .It Pa engines/ OpenSSL (Cryptography/SSL toolkit) dynamically loadable engines .El .Pp .It Pa libdata/ miscellaneous utility data files .Bl -tag -width Fl -compact .It Pa gcc/ .Xr gcc 1 configuration data .It Pa ldscripts/ linker scripts; see .Xr ld 1 .It Pa lint/ various prebuilt lint libraries; see .Xr lint 1 .El .Pp .It Pa libexec/ system daemons & system utilities (executed by other programs) .Bl -tag -width Fl -compact .It Pa aout/ utilities to manipulate a.out executables .It Pa elf/ utilities to manipulate ELF executables .It Pa lpr/ utilities and filters for LP print system; see .Xr lpr 1 .It Pa sendmail/ the .Xr sendmail 8 binary; see .Xr mailwrapper 8 .It Pa sm.bin/ restricted shell for .Xr sendmail 8 ; see .Xr smrsh 8 .El .Pp .It Pa local/ local executables, libraries, etc. Also used as the default destination for the .Fx ports framework. Within local/, the general layout sketched out by .Nm for /usr should be used. Exceptions are the man directory (directly under local/ rather than under local/share/), ports documentation (in share/doc//), and /usr/local/etc (mimics /etc). .It Pa obj/ architecture-specific target tree produced by building the /usr/src tree .It Pa ports/ The .Fx ports collection (optional). .It Pa sbin/ system daemons & system utilities (executed by users) .It Pa share/ architecture-independent files .Pp .Bl -tag -width ".Pa calendar/" -compact .It Pa calendar/ a variety of pre-fab calendar files; see .Xr calendar 1 .It Pa dict/ word lists; see .Xr look 1 .Pp .Bl -tag -width Fl -compact .It Pa freebsd .Fx Ns -specific terms, proper names, and jargon .It Pa words common words .It Pa web2 words from Webster's 2nd International .It Pa papers/ reference databases; see .Xr refer 1 .El .Pp .It Pa doc/ miscellaneous documentation; source for most of the printed .Bx manuals (available from the .Tn USENIX association) .Bl -tag -width Fl -compact .It Pa FAQ/ Frequently Asked Questions .It Pa IPv6/ implementation notes for IPv6 .It Pa bind/ documents pertaining to BIND (the Berkeley Internet Name Domain) .It Pa es/ Spanish translations of documents in /usr/share/doc .It Pa handbook/ .Fx Handbook .It Pa ja/ Japanese translations of documents in /usr/share/doc .It Pa legal/ License files for vendor supplied firmwares .It Pa ncurses/ HTML documents pertaining to ncurses; see .Xr ncurses 3 .It Pa ntp/ HTML documents pertaining to the Network Time Protocol .It Pa papers/ UNIX Papers .It Pa psd/ UNIX Programmer's Supplementary Documents .It Pa ru/ Russian translations of documents in /usr/share/doc .It Pa smm/ UNIX System Manager's Manual .It Pa tutorials/ .Fx tutorials .It Pa usd/ UNIX User's Supplementary Documents .It Pa zh/ Chinese translations of documents in /usr/share/doc .El .Pp .It Pa examples/ various examples for users and programmers .It Pa games/ ASCII text files used by various games .It Pa groff_font/ device description file for device name .It Pa info/ GNU Info hypertext system .It Pa isdn/ ISDN .It Pa locale/ localization files; see .Xr setlocale 3 .It Pa man/ manual pages .It Pa me/ macros for use with the me macro package; see .Xr me 7 .It Pa misc/ miscellaneous system-wide ASCII text files .Bl -tag -width Fl -compact .It Pa fonts/ ??? .It Pa termcap terminal characteristics database; see .Xr termcap 5 .El .It Pa mk/ templates for make; see .Xr make 1 .It Pa nls/ national language support files; see .Xr mklocale 1 .It Pa security/ data files for security policies such as .Xr mac_lomac 4 .It Pa sendmail/ .Xr sendmail 8 configuration files .It Pa skel/ example .Pa .\& (dot) files for new accounts .It Pa snmp/ MIBs, example files and tree definitions for the SNMP daemon. .Bl -tag -width Fl -compact .It Pa defs/ Tree definition files for use with .Xr gensnmptree 1 .It Pa mibs/ MIB files .El .It Pa syscons/ files used by syscons; see .Xr syscons 4 .Bl -tag -width ".Pa scrnmaps/" -compact .It Pa fonts/ console fonts; see .Xr vidcontrol 1 and .Xr vidfont 1 .It Pa keymaps/ console keyboard maps; see .Xr kbdcontrol 1 and .Xr kbdmap 1 .It Pa scrnmaps/ console screen maps .El .It Pa tabset/ tab description files for a variety of terminals; used in the termcap file; see .Xr termcap 5 .It Pa tmac/ text processing macros; see .Xr nroff 1 and .Xr troff 1 .It Pa vi/ localization support and utilities for .Xr vi 1 .It Pa zoneinfo/ timezone configuration information; see .Xr tzfile 5 .El .It Pa src/ .Bx , third-party, and/or local source files .Pp .Bl -tag -width ".Pa kerberos5/" -compact .It Pa bin/ source code for files in /bin .It Pa contrib/ source code for contributed software .It Pa crypto/ source code for contributed cryptography software .It Pa etc/ source code for files in /etc .It Pa games/ source code for files in /usr/games .It Pa gnu/ Utilities covered by the GNU General Public License .It Pa include/ source code for files in /usr/include .It Pa kerberos5/ build infrastructure for kerberos version 5 .It Pa lib/ source code for files in /usr/lib .It Pa libexec/ source code for files in /usr/libexec .It Pa release/ files required to produce a .Fx release .It Pa sbin/ source code for files in /sbin .It Pa secure/ build directory for files in /usr/src/crypto .It Pa share/ source for files in /usr/share .It Pa sys/ kernel source code .It Pa tools/ tools used for maintenance and testing of .Fx .It Pa usr.bin/ source code for files in /usr/bin .It Pa usr.sbin/ source code for files in /usr/sbin .El .El .It Pa /var/ multi-purpose log, temporary, transient, and spool files .Pp .Bl -tag -width ".Pa preserve/" -compact .It Pa account/ system accounting files .Pp .Bl -tag -width Fl -compact .It Pa acct execution accounting file; see .Xr acct 5 .El .Pp .It Pa at/ timed command scheduling files; see .Xr \&at 1 .Bl -tag -width ".Pa preserve/" -compact .It Pa jobs/ directory containing job files .It Pa spool/ directory containing output spool files .El .Pp .It Pa backups/ miscellaneous backup files .It Pa crash/ default directory to store kernel crash dumps; see .Xr crash 8 and .Xr savecore 8 .It Pa cron/ files used by cron; see .Xr cron 8 .Bl -tag -width ".Pa preserve/" -compact .It Pa tabs/ crontab files; see .Xr crontab 5 .El .Pp .It Pa db/ miscellaneous automatically generated system-specific database files .It Pa empty/ empty directory for use by programs that need a specifically empty directory. Used for instance by .Xr sshd 8 for privilege separation. .It Pa games/ miscellaneous game status and score files .It Pa heimdal/ kerberos server databases; see .Xr kdc 8 .It Pa log/ miscellaneous system log files .Pp .Bl -tag -width Fl -compact .It Pa wtmp login/logout log; see .Xr wtmp 5 .El .Pp .It Pa mail/ user mailbox files .It Pa msgs/ system messages database; see .Xr msgs 1 .It Pa preserve/ temporary home of files preserved after an accidental death of an editor; see .Xr \&ex 1 .It Pa quotas/ file system quota information files .It Pa run/ system information files describing various info about system since it was booted .Pp .Bl -tag -width Fl -compact .It Pa named/ writable by the .Dq bind user; see .Xr named 8 .It Pa ppp/ writable by the .Dq network group for command connection sockets; see .Xr ppp 8 .It Pa utmp database of current users; see .Xr utmp 5 .El .Pp .It Pa rwho/ rwho data files; see .Xr rwhod 8 , .Xr rwho 1 , and .Xr ruptime 1 .It Pa spool/ miscellaneous printer and mail system spooling directories .Pp .Bl -tag -width Fl -compact .It Pa clientmqueue/ undelivered submission mail queue; see .Xr sendmail 8 .It Pa ftp/ commonly ~ftp; the anonymous ftp root directory .It Pa mqueue/ undelivered mail queue; see .Xr sendmail 8 .It Pa output/ line printer spooling directories .El .Pp .It Pa tmp/ temporary files that are kept between system reboots .Bl -tag -width Fl -compact .It Pa vi.recover/ the directory where recovery files are stored .El .It Pa yp/ the NIS maps .El .El .Sh NOTES This manual page documents the default .Fx file system layout, but the actual hierarchy on a given system is defined at the system administrator's discretion. A well-maintained installation will include a customized version of this document. .Sh SEE ALSO .Xr apropos 1 , .Xr find 1 , .Xr finger 1 , .Xr grep 1 , .Xr ls 1 , .Xr whatis 1 , .Xr whereis 1 , .Xr which 1 , .Xr fd 4 , .Xr devfs 5 , .Xr fsck 8 .Sh HISTORY A .Nm manual page appeared in .At v7 . Index: head/sys/netatm/atm_pcb.h =================================================================== --- head/sys/netatm/atm_pcb.h (revision 179307) +++ head/sys/netatm/atm_pcb.h (nonexistent) @@ -1,92 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM socket protocol definitions - * - */ - -#ifndef _NETATM_ATM_PCB_H -#define _NETATM_ATM_PCB_H - - -#ifdef _KERNEL -/* - * ATM Socket PCB - * - * Common structure for all ATM protocol sockets. This control block - * will be used for all ATM socket types. - */ -struct atm_pcb { - struct socket *atp_socket; /* Socket */ - Atm_connection *atp_conn; /* Connection manager token */ - u_char atp_type; /* Protocol type (see below) */ - u_char atp_flags; /* Protocol flags (see below) */ - Atm_attributes atp_attr; /* Socket's call attributes */ - char atp_name[T_ATM_APP_NAME_LEN]; /* Owner's name */ -}; -typedef struct atm_pcb Atm_pcb; - -/* - * Protocol Types - */ -#define ATPT_AAL5 0 /* AAL type 5 protocol */ -#define ATPT_SSCOP 1 /* SSCOP protocol */ -#define ATPT_NUM 2 /* Number of protocols */ - -/* - * PCB Flags - */ - - -/* - * Handy macros - */ -#define sotoatmpcb(so) ((Atm_pcb *)(so)->so_pcb) - - -/* - * ATM Socket Statistics - */ -struct atm_sock_stat { - u_long as_connreq[ATPT_NUM]; /* Connection requests */ - u_long as_inconn[ATPT_NUM]; /* Incoming connection requests */ - u_long as_conncomp[ATPT_NUM]; /* Connections completed */ - u_long as_connfail[ATPT_NUM]; /* Connections failed */ - u_long as_connrel[ATPT_NUM]; /* Connections released */ - u_long as_connclr[ATPT_NUM]; /* Connections cleared */ - u_long as_indrop[ATPT_NUM]; /* Input packets dropped */ - u_long as_outdrop[ATPT_NUM]; /* Output packets dropped */ -}; -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_PCB_H */ Property changes on: head/sys/netatm/atm_pcb.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_usrreq.c =================================================================== --- head/sys/netatm/atm_usrreq.c (revision 179307) +++ head/sys/netatm/atm_usrreq.c (nonexistent) @@ -1,739 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM DGRAM socket protocol processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * Local functions - */ -static int atm_dgram_attach(struct socket *, int, struct thread *); -static int atm_dgram_control(struct socket *, u_long, caddr_t, - struct ifnet *, struct thread *); -static int atm_dgram_info(caddr_t); - - -/* - * New-style socket request routines - */ -struct pr_usrreqs atm_dgram_usrreqs = { - .pru_abort = atm_proto_notsupp5, - .pru_attach = atm_dgram_attach, - .pru_bind = atm_proto_notsupp2, - .pru_control = atm_dgram_control, - .pru_detach = atm_proto_notsupp5, - .pru_disconnect = atm_proto_notsupp1, - .pru_peeraddr = atm_proto_notsupp3, - .pru_send = atm_proto_notsupp4, - .pru_shutdown = atm_proto_notsupp1, - .pru_sockaddr = atm_proto_notsupp3, - .pru_sosend = NULL, - .pru_soreceive = NULL, - .pru_sopoll = NULL, - .pru_close = atm_proto_notsupp5, -}; - - -/* - * Handy common code macros - */ -#ifdef DIAGNOSTIC -#define ATM_INTRO() \ - int s, err = 0; \ - s = splnet(); \ - /* \ - * Stack queue should have been drained \ - */ \ - if (atm_stackq_head != NULL) \ - panic("atm_usrreq: stack queue not empty"); \ - ; -#else -#define ATM_INTRO() \ - int s, err = 0; \ - s = splnet(); \ - ; -#endif - -#define ATM_OUTRO() \ - /* \ - * Drain any deferred calls \ - */ \ - STACK_DRAIN(); \ - (void) splx(s); \ - return (err); \ - ; - -#define ATM_RETERR(errno) { \ - err = errno; \ - goto out; \ -} - - -/* - * Attach protocol to socket - * - * Arguments: - * so pointer to socket - * proto protocol identifier - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_dgram_attach(so, proto, td) - struct socket *so; - int proto; - struct thread *td; -{ - ATM_INTRO(); - - /* - * Nothing to do here for ioctl()-only sockets - */ - ATM_OUTRO(); -} - - -/* - * Process ioctl system calls - * - * Arguments: - * so pointer to socket - * cmd ioctl code - * data pointer to code specific parameter data area - * ifp pointer to ifnet structure if it's an interface ioctl - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_dgram_control(so, cmd, data, ifp, td) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; - struct thread *td; -{ - ATM_INTRO(); - - /* - * First, figure out which ioctl we're dealing with and - * then process it based on the sub-op code - */ - switch (cmd) { - - case AIOCCFG: { - struct atmcfgreq *acp = (struct atmcfgreq *)data; - struct atm_pif *pip; - - if (td != NULL) { - err = priv_check(td, PRIV_NETATM_CFG); - if (err) - ATM_RETERR(err); - } - - switch (acp->acr_opcode) { - - case AIOCS_CFG_ATT: - /* - * Attach signalling manager - */ - if ((pip = atm_pifname(acp->acr_att_intf)) == NULL) - ATM_RETERR(ENXIO); - err = atm_sigmgr_attach(pip, acp->acr_att_proto); - break; - - case AIOCS_CFG_DET: - /* - * Detach signalling manager - */ - if ((pip = atm_pifname(acp->acr_det_intf)) == NULL) - ATM_RETERR(ENXIO); - err = atm_sigmgr_detach(pip); - break; - - default: - err = EOPNOTSUPP; - } - break; - } - - case AIOCADD: { - struct atmaddreq *aap = (struct atmaddreq *)data; - Atm_endpoint *epp; - - if (td != NULL) { - err = priv_check(td, PRIV_NETATM_ADD); - if (err) - ATM_RETERR(err); - } - - switch (aap->aar_opcode) { - - case AIOCS_ADD_PVC: - /* - * Add a PVC definition - */ - - /* - * Locate requested endpoint service - */ - epp = aap->aar_pvc_sap > ENDPT_MAX ? NULL : - atm_endpoints[aap->aar_pvc_sap]; - if (epp == NULL) - ATM_RETERR(ENOPROTOOPT); - - /* - * Let endpoint service handle it from here - */ - err = (*epp->ep_ioctl)(AIOCS_ADD_PVC, data, NULL); - break; - - case AIOCS_ADD_ARP: - /* - * Add an ARP mapping - */ - epp = atm_endpoints[ENDPT_IP]; - if (epp == NULL) - ATM_RETERR(ENOPROTOOPT); - - /* - * Let IP/ATM endpoint handle this - */ - err = (*epp->ep_ioctl) (AIOCS_ADD_ARP, data, NULL); - break; - - default: - err = EOPNOTSUPP; - } - break; - } - - case AIOCDEL: { - struct atmdelreq *adp = (struct atmdelreq *)data; - struct atm_pif *pip; - struct sigmgr *smp; - Atm_endpoint *epp; - - if (td != NULL) { - err = priv_check(td, PRIV_NETATM_DEL); - if (err) - ATM_RETERR(err); - } - - switch (adp->adr_opcode) { - - case AIOCS_DEL_PVC: - case AIOCS_DEL_SVC: - /* - * Delete a PVC or SVC - */ - - /* - * Locate appropriate sigmgr - */ - if ((pip = atm_pifname(adp->adr_pvc_intf)) == NULL) - ATM_RETERR(ENXIO); - if ((smp = pip->pif_sigmgr) == NULL) - ATM_RETERR(ENOENT); - - /* - * Let sigmgr handle it from here - */ - err = (*smp->sm_ioctl)(adp->adr_opcode, data, - (caddr_t)pip->pif_siginst); - break; - - case AIOCS_DEL_ARP: - /* - * Delete an ARP mapping - */ - epp = atm_endpoints[ENDPT_IP]; - if (epp == NULL) - ATM_RETERR(ENOPROTOOPT); - - /* - * Let IP/ATM endpoint handle this - */ - err = (*epp->ep_ioctl) (AIOCS_DEL_ARP, data, NULL); - break; - - default: - err = EOPNOTSUPP; - } - break; - } - - case AIOCSET: { - struct atmsetreq *asp = (struct atmsetreq *)data; - struct atm_pif *pip; - struct atm_nif *nip; - struct sigmgr *smp; - struct ifnet *ifp2; - - if (td != NULL) { - err = priv_check(td, PRIV_NETATM_SET); - if (err) - ATM_RETERR(err); - } - - switch (asp->asr_opcode) { - - case AIOCS_SET_ASV: - /* - * Set an ARP server address - */ - - /* - * Locate appropriate sigmgr - */ - if ((nip = atm_nifname(asp->asr_arp_intf)) == NULL) - ATM_RETERR(ENXIO); - pip = nip->nif_pif; - if ((smp = pip->pif_sigmgr) == NULL) - ATM_RETERR(ENOENT); - - /* - * Let sigmgr handle it from here - */ - err = (*smp->sm_ioctl)(AIOCS_SET_ASV, data, - (caddr_t)nip); - break; - - case AIOCS_SET_MAC: - /* - * Set physical interface MAC/ESI address - */ - - /* - * Locate physical interface - */ - if ((pip = atm_pifname(asp->asr_mac_intf)) == NULL) - ATM_RETERR(ENXIO); - - /* - * Interface must be detached - */ - if (pip->pif_sigmgr != NULL) - ATM_RETERR(EADDRINUSE); - - /* - * Just plunk the address into the pif - */ - bcopy((caddr_t)&asp->asr_mac_addr, - (caddr_t)&pip->pif_macaddr, - sizeof(struct mac_addr)); - break; - - case AIOCS_SET_NIF: - /* - * Define network interfaces - */ - if ((pip = atm_pifname(asp->asr_nif_intf)) == NULL) - ATM_RETERR(ENXIO); - - /* - * Validate interface count - logical interfaces - * are differentiated by the atm address selector. - */ - if (asp->asr_nif_cnt == 0 || asp->asr_nif_cnt > 256) - ATM_RETERR(EINVAL); - - /* - * Make sure prefix name is unique - */ - IFNET_RLOCK(); - TAILQ_FOREACH(ifp2, &ifnet, if_link) { - if (!strcmp(ifp2->if_dname, asp->asr_nif_pref)) { - /* - * If this is for the interface we're - * (re-)defining, let it through - */ - for (nip = pip->pif_nif; nip; - nip = nip->nif_pnext) { - if (ANIF2IFP(nip) == ifp2) - break; - } - if (nip) - continue; - IFNET_RUNLOCK(); - ATM_RETERR(EEXIST); - } - } - IFNET_RUNLOCK(); - - /* - * Let interface handle it from here - */ - err = (*pip->pif_ioctl)(AIOCS_SET_NIF, data, - (caddr_t)pip); - break; - - case AIOCS_SET_PRF: - /* - * Set interface NSAP Prefix - */ - - /* - * Locate appropriate sigmgr - */ - if ((pip = atm_pifname(asp->asr_prf_intf)) == NULL) - ATM_RETERR(ENXIO); - if ((smp = pip->pif_sigmgr) == NULL) - ATM_RETERR(ENOENT); - - /* - * Let sigmgr handle it from here - */ - err = (*smp->sm_ioctl)(AIOCS_SET_PRF, data, - (caddr_t)pip->pif_siginst); - break; - - default: - err = EOPNOTSUPP; - } - break; - } - - case AIOCINFO: - err = atm_dgram_info(data); - break; - - default: - err = EOPNOTSUPP; - } - -out: - ATM_OUTRO(); -} - - -/* - * Process AIOCINFO ioctl system calls - * - * Called at splnet. - * - * Arguments: - * data pointer to AIOCINFO parameter structure - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_dgram_info(data) - caddr_t data; -{ - struct atminfreq *aip = (struct atminfreq *)data; - struct atm_pif *pip; - struct atm_nif *nip; - struct sigmgr *smp; - Atm_endpoint *epp; - int len = aip->air_buf_len; - int err = 0; - - switch (aip->air_opcode) { - - case AIOCS_INF_VST: - case AIOCS_INF_CFG: - /* - * Get vendor interface information - */ - if (aip->air_vinfo_intf[0] != '\0') { - /* - * Interface specified - */ - if ((pip = atm_pifname(aip->air_vinfo_intf))) { - err = (*pip->pif_ioctl)(aip->air_opcode, data, - (caddr_t)pip); - } else { - err = ENXIO; - } - } else { - /* - * Want info for every interface - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - err = (*pip->pif_ioctl)(aip->air_opcode, data, - (caddr_t)pip); - if (err) - break; - } - } - break; - - case AIOCS_INF_IPM: - /* - * Get IP Map information - */ - epp = atm_endpoints[ENDPT_IP]; - if (epp) { - err = (*epp->ep_ioctl) (AIOCS_INF_IPM, data, NULL); - } else { - err = ENOPROTOOPT; - } - break; - - case AIOCS_INF_ARP: - /* - * Get ARP table information - */ - for (pip = atm_interface_head; pip; pip = pip->pif_next) { - if ((smp = pip->pif_sigmgr) != NULL) { - err = (*smp->sm_ioctl)(AIOCS_INF_ARP, - data, (caddr_t)pip->pif_siginst); - } - if (err) - break; - } - break; - - case AIOCS_INF_ASV: - /* - * Get ARP server information - */ - if (aip->air_asrv_intf[0] != '\0') { - /* - * Interface specified - */ - if ((nip = atm_nifname(aip->air_asrv_intf))) { - if ((smp = nip->nif_pif->pif_sigmgr) != NULL) { - err = (*smp->sm_ioctl)(AIOCS_INF_ASV, - data, (caddr_t)nip); - } - } else { - err = ENXIO; - } - } else { - /* - * Want info for all arp servers - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - if ((smp = pip->pif_sigmgr) != NULL) { - for (nip = pip->pif_nif; nip; - nip = nip->nif_pnext) { - err = (*smp->sm_ioctl) - (AIOCS_INF_ASV, data, - (caddr_t)nip); - if (err) - break; - } - if (err) - break; - } - } - } - break; - - case AIOCS_INF_INT: - /* - * Get physical interface info - */ - if (aip->air_int_intf[0] != '\0') { - /* - * Interface specified - */ - if ((pip = atm_pifname(aip->air_int_intf))) { - err = (*pip->pif_ioctl)(AIOCS_INF_INT, - data, (caddr_t)pip); - } else { - err = ENXIO; - } - } else { - /* - * Want info for every physical interface - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - err = (*pip->pif_ioctl)(AIOCS_INF_INT, - data, (caddr_t)pip); - if (err) - break; - } - } - break; - - case AIOCS_INF_VCC: - /* - * Get VCC information - */ - if (aip->air_vcc_intf[0] != '\0') { - /* - * Interface specified - */ - if ((pip = atm_pifname(aip->air_vcc_intf))) { - if ((smp = pip->pif_sigmgr) != NULL) { - err = (*smp->sm_ioctl)(AIOCS_INF_VCC, - data, - (caddr_t)pip->pif_siginst); - } - } else { - err = ENXIO; - } - } else { - /* - * Want info for every interface - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - if ((smp = pip->pif_sigmgr) != NULL) { - err = (*smp->sm_ioctl)(AIOCS_INF_VCC, - data, - (caddr_t)pip->pif_siginst); - } - if (err) - break; - } - } - break; - - case AIOCS_INF_NIF: - /* - * Get network interface info - */ - if (aip->air_int_intf[0] != '\0') { - /* - * Interface specified - */ - if ((nip = atm_nifname(aip->air_int_intf))) { - pip = nip->nif_pif; - err = (*pip->pif_ioctl)(AIOCS_INF_NIF, - data, (caddr_t)nip); - } else { - err = ENXIO; - } - } else { - /* - * Want info for every network interface - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - for (nip = pip->pif_nif; nip; - nip = nip->nif_pnext) { - err = (*pip->pif_ioctl)(AIOCS_INF_NIF, - data, (caddr_t)nip); - if (err) - break; - } - if (err) - break; - } - } - break; - - case AIOCS_INF_PIS: - /* - * Get physical interface statistics - */ - if (aip->air_physt_intf[0] != '\0') { - /* - * Interface specified - */ - if ((pip = atm_pifname(aip->air_physt_intf))) { - err = (*pip->pif_ioctl)(AIOCS_INF_PIS, - data, (caddr_t)pip); - } else { - err = ENXIO; - } - } else { - /* - * Want statistics for every physical interface - */ - for (pip = atm_interface_head; pip; - pip = pip->pif_next) { - err = (*pip->pif_ioctl)(AIOCS_INF_PIS, - data, (caddr_t)pip); - if (err) - break; - } - } - break; - - case AIOCS_INF_VER: - /* - * Get ATM software version - */ - if (len < sizeof(atm_version)) { - err = ENOSPC; - break; - } - if ((err = copyout((caddr_t)&atm_version, - aip->air_buf_addr, - sizeof(atm_version))) != 0) { - break; - } - aip->air_buf_addr += sizeof(atm_version); - aip->air_buf_len -= sizeof(atm_version); - break; - - default: - err = EOPNOTSUPP; - } - - /* - * Calculate returned buffer length - */ - aip->air_buf_len = len - aip->air_buf_len; - - return (err); -} - Property changes on: head/sys/netatm/atm_usrreq.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_vc.h =================================================================== --- head/sys/netatm/atm_vc.h (revision 179307) +++ head/sys/netatm/atm_vc.h (nonexistent) @@ -1,89 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Virtual Channel definitions - * - */ - -#ifndef _NETATM_ATM_VC_H -#define _NETATM_ATM_VC_H - - -#ifdef _KERNEL -/* - * ATM Virtual Channel Connection control block. All vccb's are created - * and controlled by an ATM signalling manager. Each ATM signalling - * protocol will also have its own protocol-specific vccb format. Each - * of these protocol vccb's must have this common block at the beginning. - */ -struct vccb { - u_char vc_type; /* VCC type (see below) */ - u_char vc_proto; /* Signalling protocol */ - u_char vc_sstate; /* Signalling state (sigmgr specific) */ - u_char vc_ustate; /* User interface state (see below) */ - struct atm_pif *vc_pif; /* Physical interface */ - struct atm_nif *vc_nif; /* Network interface */ - Qelem_t vc_sigelem; /* Signalling instance vccb queue */ - struct atm_time vc_time; /* Timer controls */ - u_short vc_vpi; /* Virtual Path Identifier */ - u_short vc_vci; /* Virtual Channel Identifier */ - Atm_connvc *vc_connvc; /* CM connection VCC instance */ - u_long vc_ipdus; /* PDUs received from VCC */ - u_long vc_opdus; /* PDUs sent to VCC */ - u_long vc_ibytes; /* Bytes received from VCC */ - u_long vc_obytes; /* Bytes sent to VCC */ - u_long vc_ierrors; /* Errors receiving from VCC */ - u_long vc_oerrors; /* Errors sending to VCC */ - time_t vc_tstamp; /* State transition timestamp */ -}; -#endif /* _KERNEL */ - -/* - * VCC Types - */ -#define VCC_PVC 0x01 /* PVC (Permanent Virtual Channel) */ -#define VCC_SVC 0x02 /* SVC (Switched Virtual Channel) */ -#define VCC_IN 0x04 /* Inbound VCC */ -#define VCC_OUT 0x08 /* Outbound VCC */ - -/* - * VCC Signalling-to-User Interface States - */ -#define VCCU_NULL 0 /* No state */ -#define VCCU_POPEN 1 /* Pending open completion */ -#define VCCU_OPEN 2 /* Connection is open */ -#define VCCU_CLOSED 3 /* Connection has been terminated */ -#define VCCU_ABORT 4 /* Connection being aborted */ - - -#endif /* _NETATM_ATM_VC_H */ Property changes on: head/sys/netatm/atm_vc.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_load.c =================================================================== --- head/sys/netatm/ipatm/ipatm_load.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_load.c (nonexistent) @@ -1,813 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Support for running as a loadable kernel module - */ - -#include -__FBSDID("$FreeBSD$"); - -#ifndef ATM_IP_MODULE -#include "opt_atm.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -/* - * Global variables - */ -int ipatm_vccnt = 0; -int ipatm_vcidle = IPATM_VCIDLE; -u_long last_map_ipdst = 0; -struct ipvcc* last_map_ipvcc = NULL; - -struct ip_nif *ipatm_nif_head = NULL; - -struct ipatm_stat ipatm_stat = {0}; - -struct atm_time ipatm_itimer = {0, 0}; /* VCC idle timer */ - -Atm_endpoint ipatm_endpt = { - NULL, - ENDPT_IP, - ipatm_ioctl, - ipatm_getname, - ipatm_connected, - ipatm_cleared, - ipatm_incoming, - NULL, - NULL, - NULL, - ipatm_cpcs_data, - NULL, - NULL, - NULL, - NULL -}; - -uma_zone_t ipatm_vc_zone; - -/* - * net.harp.ip - */ -SYSCTL_NODE(_net_harp, OID_AUTO, ip, CTLFLAG_RW, 0, "IPv4 over ATM"); - -/* - * net.harp.ip.ipatm_print - */ -int ipatm_print = 0; -SYSCTL_INT(_net_harp_ip, OID_AUTO, ipatm_print, CTLFLAG_RW, - &ipatm_print, 0, "dump IPv4-over-ATM packets"); - - -/* - * Local functions - */ -static int ipatm_start(void); -static int ipatm_stop(void); - - -/* - * Local variables - */ -static struct atm_ncm ipatm_ncm = { - NULL, - AF_INET, - ipatm_ifoutput, - ipatm_nifstat -}; - -static struct ipatm_listener { - Atm_attributes attr; - Atm_connection *conn; -} ipatm_listeners[] = { -{ - { NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL5 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_ANY - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_PRESENT, - T_ATM_ABSENT, - { - { - T_ATM_SIMPLE_ID, - }, - { - T_ATM_ABSENT - } - } - }, - { /* llc */ - T_ATM_PRESENT, - { - T_ATM_LLC_SHARING, - IPATM_LLC_LEN, - IPATM_LLC_HDR - } - }, - { /* called */ - T_ATM_ANY - }, - { /* calling */ - T_ATM_ANY - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ANY - }, - { /* cause */ - T_ATM_ABSENT - }, - }, - NULL -}, -{ - { NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL5 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_ANY - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT - }, - { /* llc */ - T_ATM_ABSENT - }, - { /* called */ - T_ATM_ANY - }, - { /* calling */ - T_ATM_ANY - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ANY - }, - { /* cause */ - T_ATM_ABSENT - }, - }, - NULL -}, -{ - { NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL3_4 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_ANY - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT - }, - { /* llc */ - T_ATM_ABSENT - }, - { /* called */ - T_ATM_ANY - }, - { /* calling */ - T_ATM_ANY - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ANY - }, - { /* cause */ - T_ATM_ABSENT - }, - }, - NULL -}, -}; - -static struct t_atm_cause ipatm_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_UNSPECIFIED_NORMAL, - {0, 0, 0, 0} -}; - - -/* - * Initialize ipatm processing - * - * This will be called during module loading. We'll just register - * ourselves and wait for the packets to start flying. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -static int -ipatm_start() -{ - struct atm_pif *pip; - struct atm_nif *nip; - int err, s, i; - - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - log(LOG_ERR, "version mismatch: ipatm=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version)); - return (EINVAL); - } - - ipatm_vc_zone = uma_zcreate("ipatm vc", sizeof(struct ipvcc), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (ipatm_vc_zone == NULL) - panic("ipatm_start: unable to create ipatm_vc_zone"); - - /* - * Register ourselves as a network convergence module - */ - err = atm_netconv_register(&ipatm_ncm); - if (err) - goto done; - - /* - * Register ourselves as an ATM endpoint - */ - err = atm_endpoint_register(&ipatm_endpt); - if (err) - goto done; - - /* - * Get current system configuration - */ - s = splnet(); - for (pip = atm_interface_head; pip; pip = pip->pif_next) { - /* - * Process each network interface - */ - for (nip = pip->pif_nif; nip; nip = nip->nif_pnext) { - struct ifnet *ifp = ANIF2IFP(nip); - struct in_ifaddr *ia; - - /* - * Attach interface - */ - err = ipatm_nifstat(NCM_ATTACH, nip, 0); - if (err) { - (void) splx(s); - goto done; - } - - /* - * If IP address has been set, register it - */ - TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) { - if (ia->ia_ifp == ifp) - break; - } - if (ia) { - err = ipatm_nifstat(NCM_SETADDR, nip, - (intptr_t)ia); - if (err) { - (void) splx(s); - goto done; - } - } - } - } - (void) splx(s); - - /* - * Fill in union fields - */ - ipatm_aal5llc.aal.v.aal5.forward_max_SDU_size = - ATM_NIF_MTU + IPATM_LLC_LEN; - ipatm_aal5llc.aal.v.aal5.backward_max_SDU_size = - ATM_NIF_MTU + IPATM_LLC_LEN; - ipatm_aal5llc.aal.v.aal5.SSCS_type = T_ATM_NULL; - ipatm_aal5llc.blli.v.layer_2_protocol.ID.simple_ID = T_ATM_BLLI2_I8802; - - ipatm_aal5null.aal.v.aal5.forward_max_SDU_size = ATM_NIF_MTU; - ipatm_aal5null.aal.v.aal5.backward_max_SDU_size = ATM_NIF_MTU; - ipatm_aal5null.aal.v.aal5.SSCS_type = T_ATM_NULL; - - ipatm_aal4null.aal.v.aal4.forward_max_SDU_size = ATM_NIF_MTU; - ipatm_aal4null.aal.v.aal4.backward_max_SDU_size = ATM_NIF_MTU; - ipatm_aal4null.aal.v.aal4.SSCS_type = T_ATM_NULL; - ipatm_aal4null.aal.v.aal4.mid_low = 0; - ipatm_aal4null.aal.v.aal4.mid_high = 1023; - - /* - * Listen for incoming calls - */ - for (i = 0; - i < (sizeof(ipatm_listeners) / sizeof(struct ipatm_listener)); - i++) { - struct attr_aal *aalp = &ipatm_listeners[i].attr.aal; - int maxsdu = ATM_NIF_MTU; - - /* - * Fill in union fields - */ - if (ipatm_listeners[i].attr.blli.tag_l2 == T_ATM_PRESENT) { - struct t_atm_blli *bp = &ipatm_listeners[i].attr.blli.v; - - bp->layer_2_protocol.ID.simple_ID = T_ATM_BLLI2_I8802; - maxsdu += IPATM_LLC_LEN; - } - if (aalp->type == ATM_AAL5) { - aalp->v.aal5.forward_max_SDU_size = maxsdu; - aalp->v.aal5.backward_max_SDU_size = maxsdu; - aalp->v.aal5.SSCS_type = T_ATM_NULL; - } else { - aalp->v.aal4.forward_max_SDU_size = maxsdu; - aalp->v.aal4.backward_max_SDU_size = maxsdu; - aalp->v.aal4.SSCS_type = T_ATM_NULL; - aalp->v.aal4.mid_low = 0; - aalp->v.aal4.mid_high = 1023; - } - - /* - * Now start listening - */ - if ((err = atm_cm_listen(NULL, &ipatm_endpt, - (void *)(intptr_t)i, &ipatm_listeners[i].attr, - &ipatm_listeners[i].conn, -1)) != 0) - goto done; - } - - /* - * Start background VCC idle timer - */ - atm_timeout(&ipatm_itimer, IPATM_IDLE_TIME, ipatm_itimeout); - -done: - return (err); -} - - -/* - * Halt ipatm processing - * - * This will be called just prior to unloading the module from - * memory. All IP VCCs must be terminated before the protocol can - * be shutdown. - * - * Arguments: - * none - * - * Returns: - * 0 shutdown was successful - * errno shutdown failed - reason indicated - * - */ -static int -ipatm_stop() -{ - struct ip_nif *inp; - int err = 0, i; - int s = splnet(); - - /* - * Any VCCs still open?? - */ - if (ipatm_vccnt) { - - /* Yes, can't stop now */ - err = EBUSY; - goto done; - } - - /* - * Kill VCC idle timer - */ - (void) atm_untimeout(&ipatm_itimer); - - /* - * Stop listening for incoming calls - */ - for (i = 0; - i < (sizeof(ipatm_listeners) / sizeof(struct ipatm_listener)); - i++) { - if (ipatm_listeners[i].conn != NULL) { - (void) atm_cm_release(ipatm_listeners[i].conn, - &ipatm_cause); - } - } - - /* - * Detach all our interfaces - */ - while ((inp = ipatm_nif_head) != NULL) { - (void) ipatm_nifstat(NCM_DETACH, inp->inf_nif, 0); - } - - /* - * De-register from system - */ - (void) atm_netconv_deregister(&ipatm_ncm); - (void) atm_endpoint_deregister(&ipatm_endpt); - - /* - * Free up our storage pools - */ - uma_zdestroy(ipatm_vc_zone); -done: - (void) splx(s); - return (err); -} - - -#ifdef ATM_IP_MODULE -/* - ******************************************************************* - * - * Loadable Module Support - * - ******************************************************************* - */ -static int ipatm_doload(void); -static int ipatm_dounload(void); - -/* - * Generic module load processing - * - * This function is called by an OS-specific function when this - * module is being loaded. - * - * Arguments: - * none - * - * Returns: - * 0 load was successful - * errno load failed - reason indicated - * - */ -static int -ipatm_doload() -{ - int err = 0; - - /* - * Start us up - */ - err = ipatm_start(); - if (err) - /* Problems, clean up */ - (void)ipatm_stop(); - - return (err); -} - - -/* - * Generic module unload processing - * - * This function is called by an OS-specific function when this - * module is being unloaded. - * - * Arguments: - * none - * - * Returns: - * 0 unload was successful - * errno unload failed - reason indicated - * - */ -static int -ipatm_dounload() -{ - int err = 0; - - /* - * OK, try to clean up our mess - */ - err = ipatm_stop(); - - return (err); -} - - - - -#include -#include -#include - -/* - * Loadable miscellaneous module description - */ -MOD_MISC(ipatm); - - -/* - * Loadable module support "load" entry point - * - * This is the routine called by the lkm driver whenever the - * modload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -ipatm_load(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(ipatm_doload()); -} - - -/* - * Loadable module support "unload" entry point - * - * This is the routine called by the lkm driver whenever the - * modunload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -ipatm_unload(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(ipatm_dounload()); -} - - -/* - * Loadable module support entry point - * - * This is the routine called by the lkm driver for all loadable module - * functions for this driver. This routine name must be specified - * on the modload(1) command. This routine will be called whenever the - * modload(1), modunload(1) or modstat(1) commands are issued for this - * module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * ver lkm version - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -int -ipatm_mod(lkmtp, cmd, ver) - struct lkm_table *lkmtp; - int cmd; - int ver; -{ - MOD_DISPATCH(ipatm, lkmtp, cmd, ver, - ipatm_load, ipatm_unload, lkm_nullcmd); -} - -#else /* !ATM_IP_MODULE */ - -/* - ******************************************************************* - * - * Kernel Compiled Module Support - * - ******************************************************************* - */ -static void ipatm_doload(void *); - -SYSINIT(atmipatm, SI_SUB_PROTO_END, SI_ORDER_ANY, ipatm_doload, NULL); - -/* - * Kernel initialization - * - * Arguments: - * arg Not used - * - * Returns: - * none - * - */ -static void -ipatm_doload(void *arg) -{ - int err = 0; - - /* - * Start us up - */ - err = ipatm_start(); - if (err) { - /* Problems, clean up */ - (void)ipatm_stop(); - - log(LOG_ERR, "IP over ATM unable to initialize (%d)!!\n", err); - } - return; -} -#endif /* ATM_IP_MODULE */ - Property changes on: head/sys/netatm/ipatm/ipatm_load.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_usrreq.c =================================================================== --- head/sys/netatm/ipatm/ipatm_usrreq.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_usrreq.c (nonexistent) @@ -1,507 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Process user requests - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* - * Process IP PF_ATM ioctls - * - * Called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -int -ipatm_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmaddreq *aap; - struct atmdelreq *adp; - struct atminfreq *aip; - struct air_ip_vcc_rsp aivr; - struct atm_nif *nip; - struct ip_nif *inp; - struct ipvcc *ivp; - struct vccb *vcp; - struct ipatmpvc pv; - caddr_t cp; - struct in_addr ip; - int err = 0; - size_t space; - struct t_atm_traffic *traf; - - - switch (code) { - - case AIOCS_ADD_PVC: - /* - * Add an IP PVC - */ - aap = (struct atmaddreq *)data; - - /* - * Find the IP network interface - */ - if ((nip = atm_nifname(aap->aar_pvc_intf)) == NULL) { - err = ENXIO; - break; - } - - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if (inp == NULL) { - err = ENXIO; - break; - } - - /* - * Validate PVC params - */ - if (aap->aar_pvc_aal == ATM_AAL5) { - if ((aap->aar_pvc_encaps != ATM_ENC_LLC) && - (aap->aar_pvc_encaps != ATM_ENC_NULL)) { - err = EINVAL; - break; - } - } else if (aap->aar_pvc_aal == ATM_AAL3_4) { - if (aap->aar_pvc_encaps != ATM_ENC_NULL) { - err = EINVAL; - break; - } - } else { - err = EINVAL; - break; - } - - if (aap->aar_pvc_flags & PVC_DYN) { - /* - * For dynamic PVC destination addressing, the - * network interface must have support for this - */ - if ((inp->inf_serv == NULL) || - (inp->inf_serv->is_arp_pvcopen == NULL)) { - err = EDESTADDRREQ; - break; - } - } else { - u_long dst = ((struct sockaddr_in *)&aap->aar_pvc_dst) - ->sin_addr.s_addr; - - if (dst == INADDR_ANY) { - err = EINVAL; - break; - } - } - - /* - * Validate PVC traffic - */ -#define MAXVAL(bits) ((1 << bits) - 1) -#define MAXMASK(bits) (~MAXVAL(bits)) - traf = &aap->aar_pvc_traffic; - switch (aap->aar_pvc_traffic_type) { - - case T_ATM_CBR: - case T_ATM_UBR: - /* - * PCR is a value between 0 to the PIF's PCR - */ - if (traf->forward.PCR_high_priority == T_ATM_ABSENT || - (traf->forward.PCR_high_priority & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->forward.PCR_all_traffic == T_ATM_ABSENT || - (traf->forward.PCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - - if (traf->backward.PCR_high_priority == T_ATM_ABSENT || - (traf->backward.PCR_high_priority & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->backward.PCR_all_traffic == T_ATM_ABSENT || - (traf->backward.PCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - break; - - case T_ATM_VBR: - /* - * PCR, SCR and MBS are required - */ - if (traf->forward.PCR_high_priority == T_ATM_ABSENT || - (traf->forward.PCR_high_priority & MAXMASK(24)) || - traf->forward.PCR_all_traffic == T_ATM_ABSENT || - (traf->forward.PCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->forward.SCR_high_priority == T_ATM_ABSENT || - (traf->forward.SCR_high_priority & MAXMASK(24)) || - traf->forward.SCR_all_traffic == T_ATM_ABSENT || - (traf->forward.SCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->forward.MBS_high_priority == T_ATM_ABSENT || - (traf->forward.MBS_high_priority & MAXMASK(24)) || - traf->forward.MBS_all_traffic == T_ATM_ABSENT || - (traf->forward.MBS_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - - if (traf->backward.PCR_high_priority == T_ATM_ABSENT || - (traf->backward.PCR_high_priority & MAXMASK(24)) || - traf->backward.PCR_all_traffic == T_ATM_ABSENT || - (traf->backward.PCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->backward.SCR_high_priority == T_ATM_ABSENT || - (traf->backward.SCR_high_priority & MAXMASK(24)) || - traf->backward.SCR_all_traffic == T_ATM_ABSENT || - (traf->backward.SCR_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - if (traf->backward.MBS_high_priority == T_ATM_ABSENT || - (traf->backward.MBS_high_priority & MAXMASK(24)) || - traf->backward.MBS_all_traffic == T_ATM_ABSENT || - (traf->backward.MBS_all_traffic & MAXMASK(24))) { - err = EINVAL; - break; - } - break; - - case T_ATM_NULL: - /* - * No PVC traffic type - */ - break; - - default: - err = EINVAL; - break; - } - if (err != 0) - break; - - /* - * Build connection request - */ - pv.ipp_ipnif = inp; - pv.ipp_vpi = aap->aar_pvc_vpi; - pv.ipp_vci = aap->aar_pvc_vci; - pv.ipp_traffic_type = aap->aar_pvc_traffic_type; - pv.ipp_traffic = aap->aar_pvc_traffic; - pv.ipp_encaps = aap->aar_pvc_encaps; - pv.ipp_aal = aap->aar_pvc_aal; - if (aap->aar_pvc_flags & PVC_DYN) { - pv.ipp_dst.sin_addr.s_addr = INADDR_ANY; - } else - pv.ipp_dst = *(struct sockaddr_in *)&aap->aar_pvc_dst; - - /* - * Open a new VCC - */ - err = ipatm_openpvc(&pv, &ivp); - break; - - case AIOCS_ADD_ARP: - /* - * Add an ARP mapping - */ - aap = (struct atmaddreq *)data; - - /* - * Validate IP address - */ - if (aap->aar_arp_dst.sa_family != AF_INET) { - err = EAFNOSUPPORT; - break; - } - ip = SATOSIN(&aap->aar_arp_dst)->sin_addr; - - if (aap->aar_arp_intf[0] == '\0') { - /* - * Find the IP network interface associated with - * the supplied IP address - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (ipatm_chknif(ip, inp) == 0) - break; - } - if (inp == NULL) { - err = EADDRNOTAVAIL; - break; - } - } else { - /* - * Find the specified IP network interface - */ - if ((nip = atm_nifname(aap->aar_arp_intf)) == NULL) { - err = ENXIO; - break; - } - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if (inp == NULL) { - err = ENXIO; - break; - } - } - - if ((ip.s_addr == INADDR_ANY) || - in_broadcast(ip, ANIF2IFP(inp->inf_nif)) || - IN_MULTICAST(ntohl(ip.s_addr))) { - err = EADDRNOTAVAIL; - break; - } - - /* - * Notify the responsible ARP service - * - * XXX: if there is one. No idea how this happens, but at - * least don't panic on a NULL pointer if it does. - */ - if (inp->inf_serv == NULL) { - err = ENXIO; - break; - } - err = (*inp->inf_serv->is_ioctl)(code, data, inp->inf_isintf); - break; - - case AIOCS_DEL_ARP: - /* - * Delete an ARP mapping - */ - adp = (struct atmdelreq *)data; - - /* - * Validate IP address - */ - if (adp->adr_arp_dst.sa_family != AF_INET) { - err = EAFNOSUPPORT; - break; - } - ip = SATOSIN(&adp->adr_arp_dst)->sin_addr; - - if (adp->adr_arp_intf[0] == '\0') { - /* - * Find the IP network interface associated with - * the supplied IP address - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (ipatm_chknif(ip, inp) == 0) - break; - } - if (inp == NULL) { - err = EADDRNOTAVAIL; - break; - } - } else { - /* - * Find the specified IP network interface - */ - if ((nip = atm_nifname(adp->adr_arp_intf)) == NULL) { - err = ENXIO; - break; - } - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if (inp == NULL) { - err = ENXIO; - break; - } - } - - if ((ip.s_addr == INADDR_ANY) || - in_broadcast(ip, ANIF2IFP(inp->inf_nif)) || - IN_MULTICAST(ntohl(ip.s_addr))) { - err = EADDRNOTAVAIL; - break; - } - - /* - * Notify the responsible ARP service - */ - err = (*inp->inf_serv->is_ioctl)(code, data, inp->inf_isintf); - break; - - case AIOCS_INF_IPM: - /* - * Get IP VCC information - */ - aip = (struct atminfreq *)data; - - if (aip->air_ip_addr.sa_family != AF_INET) - break; - ip = SATOSIN(&aip->air_ip_addr)->sin_addr; - - cp = aip->air_buf_addr; - space = aip->air_buf_len; - - /* - * Loop through all our interfaces - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - /* - * Check out each VCC - */ - for (ivp = Q_HEAD(inp->inf_vcq, struct ipvcc); ivp; - ivp = Q_NEXT(ivp, struct ipvcc, iv_elem)) { - - if ((ip.s_addr != INADDR_ANY) && - (ip.s_addr != ivp->iv_dst.s_addr)) - continue; - - /* - * Make sure there's room in user buffer - */ - if (space < sizeof(aivr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - bzero((caddr_t)&aivr, sizeof(aivr)); - SATOSIN(&aivr.aip_dst_addr)->sin_family = - AF_INET; - SATOSIN(&aivr.aip_dst_addr)->sin_addr.s_addr = - ivp->iv_dst.s_addr; - strlcpy(aivr.aip_intf, - ANIF2IFP(inp->inf_nif)->if_xname, - sizeof(aivr.aip_intf)); - if ((ivp->iv_conn) && - (ivp->iv_conn->co_connvc) && - (vcp = ivp->iv_conn->co_connvc->cvc_vcc)) { - aivr.aip_vpi = vcp->vc_vpi; - aivr.aip_vci = vcp->vc_vci; - aivr.aip_sig_proto = vcp->vc_proto; - } - aivr.aip_flags = ivp->iv_flags; - aivr.aip_state = ivp->iv_state; - - /* - * Copy data to user buffer and - * update buffer controls - */ - err = copyout((caddr_t)&aivr, cp, sizeof(aivr)); - if (err) - break; - cp += sizeof(aivr); - space -= sizeof(aivr); - } - if (err) - break; - } - - /* - * Update buffer pointer/count - */ - aip->air_buf_addr = cp; - aip->air_buf_len = space; - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} - - -/* - * Get Connection's Application/Owner Name - * - * Arguments: - * tok ipatm connection token (pointer to ipvcc) - * - * Returns: - * addr pointer to string containing our name - * - */ -caddr_t -ipatm_getname(tok) - void *tok; -{ - return ("IP"); -} - Property changes on: head/sys/netatm/ipatm/ipatm_usrreq.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_input.c =================================================================== --- head/sys/netatm/ipatm/ipatm_input.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_input.c (nonexistent) @@ -1,156 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Process stack and data input - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * Process VCC Input Data - * - * Arguments: - * tok ipatm connection token (pointer to ipvcc) - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -void -ipatm_cpcs_data(tok, m) - void *tok; - KBuffer *m; -{ - struct ipvcc *ivp = tok; - - if (ipatm_print) { - atm_pdu_print(m, "ipatm_input"); - } - - /* - * Handle input packet - */ - if (ivp->iv_state != IPVCC_ACTIVE) { - KB_FREEALL(m); - ipatm_stat.ias_rcvstate++; - return; - } - - /* - * IP packet - reset idle timer - */ - ivp->iv_idle = 0; - - /* - * Pass packet to IP - */ - (void) ipatm_ipinput(ivp->iv_ipnif, m); -} - - -/* - * IP Input Packet Handler - * - * All IP packets received from various ATM sources will be sent here - * for final queuing to the IP layer. - * - * Arguments: - * inp pointer to packet's receiving IP network interface - * m pointer to packet buffer chain - * - * Returns: - * 0 packet successfully queued to IP layer - * else error queuing packet, buffer chain freed - * - */ -int -ipatm_ipinput(inp, m) - struct ip_nif *inp; - KBuffer *m; -{ - - if (ipatm_print) { - atm_pdu_print(m, "ipatm_ipinput"); - } - -#ifdef DIAGNOSTIC - if (!KB_ISPKT(m)) { - panic("ipatm_ipinput: no packet header"); - } - { - int cnt = 0; - KBuffer *m0 = m; - - while (m0) { - cnt += KB_LEN(m0); - m0 = KB_NEXT(m0); - } - if (m->m_pkthdr.len != cnt) { - panic("ipatm_ipinput: packet length incorrect"); - } - } -#endif - /* - * Save the input ifnet pointer in the packet header - */ - m->m_pkthdr.rcvif = ANIF2IFP(inp->inf_nif); - - /* - * Finally, hand packet off to IP. - * - * NB: Since we're already in the softint kernel state, we - * just call IP directly to avoid the extra unnecessary - * kernel scheduling. - */ - netisr_dispatch(NETISR_IP, m); - return (0); -} Property changes on: head/sys/netatm/ipatm/ipatm_input.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_serv.h =================================================================== --- head/sys/netatm/ipatm/ipatm_serv.h (revision 179307) +++ head/sys/netatm/ipatm/ipatm_serv.h (nonexistent) @@ -1,114 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * IP Over ATM Support - * ------------------- - * - * IP/ATM service interface definitions - * - */ - -#ifndef _IPATM_IPATM_SERV_H -#define _IPATM_IPATM_SERV_H - - -/* - * Structures specifying VCC parameters and pointers to all of the IP - * services offered by an external IP interface service provider. - */ -struct ip_vccparm { - Aal_t ivc_aal; /* AAL type */ - Encaps_t ivc_encaps; /* VCC encapsulation */ -}; - -#define IPATM_VCCPARMS 4 /* Number of parameter lists */ - -struct ip_serv { -/* Interfaces to IP/ATM interface services */ - int (*is_ifact) /* Interface activation */ - (struct ip_nif *); - int (*is_ifdact) /* Interface deactivation */ - (struct ip_nif *); - int (*is_ioctl) /* Interface ioctl */ - (int, caddr_t, caddr_t); - -/* Interfaces to IP/ATM ARP services */ - int (*is_arp_pvcopen) /* IP creating dynamic PVC */ - (struct ipvcc *); - int (*is_arp_svcout) /* IP creating outgoing SVC */ - (struct ipvcc *, struct in_addr *); - int (*is_arp_svcin) /* IP creating incoming SVC */ - (struct ipvcc *, Atm_addr *, Atm_addr *); - int (*is_arp_svcact) /* IP SVC is active */ - (struct ipvcc *); - void (*is_arp_close) /* IP closing VCC */ - (struct ipvcc *); - -/* Interfaces to IP/ATM broadcast services */ - int (*is_bcast_output) /* IP broadcast packet output */ - (struct ip_nif *, KBuffer *); - -/* Interfaces to IP/ATM multicast services */ - -/* Ordered list of parameters to try for IP/ATM VCC connections */ - struct ip_vccparm is_vccparm[IPATM_VCCPARMS]; /* List of vcc params */ -}; - - -/* - * ARP Interface - * ---------------- - */ - -/* - * Common header for IP/ATM ARP mappings. For each IP VCC created, the - * appropriate IP/ATM ARP server must assign one of these structures to - * indicate the address mapping. This is the only IP-visible ARP structure. - * The servers may embed this structure at the beginning of their - * module-specific mappings. - */ -struct arpmap { - struct in_addr am_dstip; /* Destination IP address */ - Atm_addr am_dstatm; /* Destination ATM address */ - Atm_addr am_dstatmsub; /* Destination ATM subaddress */ -}; - - -/* - * is_arp_[ps]open() return codes and ipatm_arpnotify() event types - */ -#define MAP_PROCEEDING 1 /* Lookup is proceeding (open only) */ -#define MAP_VALID 2 /* Mapping is valid */ -#define MAP_INVALID 3 /* Mapping is invalid */ -#define MAP_CHANGED 4 /* Mapping has changed */ -#define MAP_FAILED 5 /* Mapping request has failed */ - - -#endif /* _IPATM_IPATM_SERV_H */ Property changes on: head/sys/netatm/ipatm/ipatm_serv.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_var.h =================================================================== --- head/sys/netatm/ipatm/ipatm_var.h (revision 179307) +++ head/sys/netatm/ipatm/ipatm_var.h (nonexistent) @@ -1,219 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Protocol control blocks - * - */ - -#ifndef _IPATM_IPATM_VAR_H -#define _IPATM_IPATM_VAR_H - -#ifdef _KERNEL -/* - * Structure containing information for each VCC, both SVC and PVC, which - * supports IP traffic. - */ -struct ipvcc { - Qelem_t iv_elem; /* ip_nif queueing links */ - u_short iv_flags; /* VCC flags (see below) */ - u_char iv_state; /* VCC state (see below) */ - Atm_connection *iv_conn; /* Connection manager token */ - struct in_addr iv_dst; /* Peer's IP address */ - struct ip_nif *iv_ipnif; /* IP network interface */ - struct atm_time iv_time; /* Timer controls */ - short iv_idle; /* VCC idle timer */ - u_char iv_parmx; /* Index into provider's vcc params */ - KBuffer *iv_queue; /* Packet waiting for VCC */ - struct arpmap *iv_arpent; /* ARP entry for VCC */ - struct ipvcc *iv_arpnext; /* ARP link field */ - Atm_connection *iv_arpconn; /* ARP connection manager token */ -}; -#define iv_forw iv_elem.q_forw -#define iv_back iv_elem.q_back -#endif /* _KERNEL */ - -/* - * VCC Flags - */ -#define IVF_PVC 0x0001 /* PVC */ -#define IVF_SVC 0x0002 /* SVC */ -#define IVF_LLC 0x0004 /* VCC uses LLC/SNAP encapsulation */ -#define IVF_MAPOK 0x0008 /* VCC ARP mapping is valid */ -#define IVF_NOIDLE 0x0010 /* Do not idle-timeout this VCC */ - -/* - * VCC States - */ -#define IPVCC_FREE 0 /* No VCC associated with entry */ -#define IPVCC_PMAP 1 /* SVC waiting for ARP mapping */ -#define IPVCC_POPEN 2 /* Pending SVC open completion */ -#define IPVCC_PACCEPT 3 /* Pending SVC accept completion */ -#define IPVCC_ACTPENT 4 /* PVC open - waiting for ARP entry */ -#define IPVCC_ACTIVE 5 /* VCC open - available */ -#define IPVCC_CLOSED 6 /* VCC has been closed */ - - -#ifdef _KERNEL -/* - * Structure containing IP-specific information for each ATM network - * interface in the system. - */ -struct ip_nif { - struct ip_nif *inf_next; /* Next on interface chain */ - struct atm_nif *inf_nif; /* ATM network interface */ - u_short inf_state; /* Interface state (see below) */ - struct in_ifaddr *inf_addr; /* Interface's IP address */ - Queue_t inf_vcq; /* VCC connections queue */ - struct ip_serv *inf_serv; /* Interface service provider */ - -/* For use by IP interface service provider (ie signalling manager) */ - caddr_t inf_isintf; /* Interface control block */ - -/* IP/ATM provided interface services */ - void (*inf_arpnotify)/* ARP event notification */ - (struct ipvcc *, int); - int (*inf_ipinput) /* IP packet input */ - (struct ip_nif *, KBuffer *); - int (*inf_createsvc)/* Create an IP SVC */ - (struct ifnet *, u_short, caddr_t, - struct ipvcc **); -}; - -/* - * Network Interface States - */ -#define IPNIF_ADDR 1 /* Waiting for i/f address */ -#define IPNIF_SIGMGR 2 /* Waiting for sigmgr attach */ -#define IPNIF_ACTIVE 3 /* Active */ - - -/* - * Global IP/ATM Statistics - */ -struct ipatm_stat { - u_long ias_rcvstate; /* Packets received, bad vcc state */ - u_long ias_rcvnobuf; /* Packets received, no buf avail */ -}; - - -/* - * Structure to pass parameters for ipatm_openpvc() - */ -struct ipatmpvc { - struct ip_nif *ipp_ipnif; /* PVC's IP network interface */ - u_short ipp_vpi; /* VPI value */ - u_short ipp_vci; /* VCI value */ - Aal_t ipp_aal; /* AAL type */ - Encaps_t ipp_encaps; /* VCC encapsulation */ - struct sockaddr_in ipp_dst; /* Destination's IP address */ - uint8_t ipp_traffic_type; /* CBR, UBR, ... */ - struct t_atm_traffic ipp_traffic; /* traffic parameters */ -}; - - -/* - * Timer macros - */ -#define IPVCC_TIMER(s, t) atm_timeout(&(s)->iv_time, (t), ipatm_timeout) -#define IPVCC_CANCEL(s) atm_untimeout(&(s)->iv_time) - -/* - * Misc useful macros - */ -#define SATOSIN(sa) ((struct sockaddr_in *)(sa)) - - -/* - * Global function declarations - */ - /* ipatm_event.c */ -void ipatm_timeout(struct atm_time *); -void ipatm_connected(void *); -void ipatm_cleared(void *, struct t_atm_cause *); -void ipatm_arpnotify(struct ipvcc *, int); -void ipatm_itimeout(struct atm_time *); - - /* ipatm_if.c */ -int ipatm_nifstat(int, struct atm_nif *, intptr_t); - - /* ipatm_input.c */ -void ipatm_cpcs_data(void *, KBuffer *); -int ipatm_ipinput(struct ip_nif *, KBuffer *); - - /* ipatm_load.c */ - - /* ipatm_output.c */ -int ipatm_ifoutput(struct ifnet *, KBuffer *, struct sockaddr *); - - /* ipatm_usrreq.c */ -int ipatm_ioctl(int, caddr_t, caddr_t); -caddr_t ipatm_getname(void *); - - /* ipatm_vcm.c */ -int ipatm_openpvc(struct ipatmpvc *, struct ipvcc **); -int ipatm_createsvc(struct ifnet *, u_short, caddr_t, - struct ipvcc **); -int ipatm_opensvc(struct ipvcc *); -int ipatm_retrysvc(struct ipvcc *); -void ipatm_activate(struct ipvcc *); -int ipatm_incoming(void *, Atm_connection *, Atm_attributes *, - void **); -int ipatm_closevc(struct ipvcc *, int); -int ipatm_chknif(struct in_addr, struct ip_nif *); -struct ipvcc *ipatm_iptovc(struct sockaddr_in *, struct atm_nif *); - - -/* - * External variables - */ -extern int ipatm_vccnt; -extern int ipatm_vcidle; -extern int ipatm_print; -extern u_long last_map_ipdst; -extern struct ipvcc *last_map_ipvcc; -extern struct ip_nif *ipatm_nif_head; -extern uma_zone_t ipatm_vc_zone; -extern struct ipatm_stat ipatm_stat; -extern struct atm_time ipatm_itimer; -extern Atm_endpoint ipatm_endpt; -extern Atm_attributes ipatm_aal5llc; -extern Atm_attributes ipatm_aal5null; -extern Atm_attributes ipatm_aal4null; - -#ifdef SYSCTL_DECL -SYSCTL_DECL(_net_harp_ip); -#endif - -#endif /* _KERNEL */ - -#endif /* _IPATM_IPATM_VAR_H */ Property changes on: head/sys/netatm/ipatm/ipatm_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_event.c =================================================================== --- head/sys/netatm/ipatm/ipatm_event.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_event.c (nonexistent) @@ -1,465 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * IP VCC event handler - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Process an IP VCC timeout - * - * Called when a previously scheduled ipvcc control block timer expires. - * Processing will be based on the current ipvcc state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to ipvcc timer control block - * - * Returns: - * none - * - */ -void -ipatm_timeout(tip) - struct atm_time *tip; -{ - struct ipvcc *ivp; - - /* - * Back-off to ipvcc control block - */ - ivp = (struct ipvcc *) - ((caddr_t)tip - offsetof(struct ipvcc, iv_time)); - - /* - * Process timeout based on protocol state - */ - switch (ivp->iv_state) { - - case IPVCC_PMAP: - /* - * Give up waiting for arp response - */ - (void) ipatm_closevc(ivp, T_ATM_CAUSE_TEMPORARY_FAILURE); - break; - - case IPVCC_POPEN: - case IPVCC_PACCEPT: - /* - * Give up waiting for signalling manager response - */ - (void) ipatm_closevc(ivp, T_ATM_CAUSE_TEMPORARY_FAILURE); - break; - - case IPVCC_ACTPENT: - /* - * Try again to get an ARP entry - */ - switch ((*ivp->iv_ipnif->inf_serv->is_arp_pvcopen)(ivp)) { - - case MAP_PROCEEDING: - /* - * Wait for answer - */ - ivp->iv_state = IPVCC_ACTIVE; - break; - - case MAP_VALID: - /* - * We've got our answer already - */ - ivp->iv_state = IPVCC_ACTIVE; - ivp->iv_flags |= IVF_MAPOK; - ivp->iv_dst.s_addr = ivp->iv_arpent->am_dstip.s_addr; - break; - - case MAP_FAILED: - /* - * Try again later - */ - IPVCC_TIMER(ivp, 5 * ATM_HZ); - break; - - default: - panic("ipatm_timeout: invalid am_pvcopen return"); - } - break; - - default: - log(LOG_ERR, "ipatm: invalid timer state: ivp=%p, state=%d\n", - ivp, ivp->iv_state); - } -} - - -/* - * Process IP VCC Connected Notification - * - * Arguments: - * toku owner's connection token (ipvcc protocol block) - * - * Returns: - * none - * - */ -void -ipatm_connected(toku) - void *toku; -{ - struct ipvcc *ivp = (struct ipvcc *)toku; - - /* - * SVC is connected - */ - if ((ivp->iv_state != IPVCC_POPEN) && - (ivp->iv_state != IPVCC_PACCEPT)) { - log(LOG_ERR, "ipatm: invalid CALL_CONNECTED state=%d\n", - ivp->iv_state); - return; - } - - /* - * Verify possible negotiated parameter values - */ - if (ivp->iv_state == IPVCC_POPEN) { - Atm_attributes *ap = &ivp->iv_conn->co_connvc->cvc_attr; - int mtu = (ivp->iv_flags & IVF_LLC) ? - ATM_NIF_MTU + IPATM_LLC_LEN : - ATM_NIF_MTU; - - /* - * Verify final MTU - */ - if (ap->aal.type == ATM_AAL5) { - if ((ap->aal.v.aal5.forward_max_SDU_size < mtu) || - (ap->aal.v.aal5.backward_max_SDU_size > mtu)) { - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_AAL_PARAMETERS_NOT_SUPPORTED); - return; - } - } else { - if ((ap->aal.v.aal4.forward_max_SDU_size < mtu) || - (ap->aal.v.aal4.backward_max_SDU_size > mtu)) { - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_AAL_PARAMETERS_NOT_SUPPORTED); - return; - } - } - } - - /* - * Finish up VCC activation - */ - ipatm_activate(ivp); -} - - -/* - * Process IP VCC Cleared Notification - * - * Arguments: - * toku owner's connection token (ipvcc protocol block) - * cause pointer to cause code - * - * Returns: - * none - * - */ -void -ipatm_cleared(toku, cause) - void *toku; - struct t_atm_cause *cause; -{ - struct ipvcc *ivp = (struct ipvcc *)toku; - - - /* - * VCC has been cleared, so figure out what's next - */ - ivp->iv_conn = NULL; - - switch (ivp->iv_state) { - - case IPVCC_POPEN: - /* - * Call setup failed, see if there is another - * set of vcc parameters to try - */ - ivp->iv_state = IPVCC_CLOSED; - if (ipatm_retrysvc(ivp)) { - (void) ipatm_closevc(ivp, cause->cause_value); - } - break; - - case IPVCC_PACCEPT: - case IPVCC_ACTPENT: - case IPVCC_ACTIVE: - ivp->iv_state = IPVCC_CLOSED; - (void) ipatm_closevc(ivp, cause->cause_value); - break; - } -} - - -/* - * Process an ARP Event Notification - * - * Arguments: - * ivp pointer to IP VCC control block - * event ARP event type - * - * Returns: - * none - * - */ -void -ipatm_arpnotify(ivp, event) - struct ipvcc *ivp; - int event; -{ - struct sockaddr_in sin; - struct ifnet *ifp; - - /* - * Process event - */ - switch (event) { - - case MAP_VALID: - switch (ivp->iv_state) { - - case IPVCC_PMAP: - /* - * We've got our destination, however, first we'll - * check to make sure no other VCC to our destination - * has also had it's ARP table entry completed. - * If we don't find a better VCC to use, then we'll - * go ahead and open this SVC. - */ - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = ivp->iv_dst.s_addr; - if (ipatm_iptovc(&sin, ivp->iv_ipnif->inf_nif) != ivp) { - /* - * We found a better VCC, so use it and - * get rid of this VCC - */ - if (ivp->iv_queue) { - ifp = (struct ifnet *) - ivp->iv_ipnif->inf_nif; - (void) ipatm_ifoutput(ifp, - ivp->iv_queue, - (struct sockaddr *)&sin); - ivp->iv_queue = NULL; - } - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_UNSPECIFIED_NORMAL); - - } else { - /* - * We like this VCC... - */ - ivp->iv_flags |= IVF_MAPOK; - if (ipatm_opensvc(ivp)) { - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_TEMPORARY_FAILURE); - } - } - break; - - case IPVCC_POPEN: - case IPVCC_PACCEPT: - case IPVCC_ACTIVE: - /* - * Everything looks good, so accept new mapping - */ - ivp->iv_flags |= IVF_MAPOK; - ivp->iv_dst.s_addr = ivp->iv_arpent->am_dstip.s_addr; - - /* - * Send queued packet - */ - if ((ivp->iv_state == IPVCC_ACTIVE) && ivp->iv_queue) { - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = ivp->iv_dst.s_addr; - ifp = (struct ifnet *)ivp->iv_ipnif->inf_nif; - (void) ipatm_ifoutput(ifp, ivp->iv_queue, - (struct sockaddr *)&sin); - ivp->iv_queue = NULL; - } - break; - } - break; - - case MAP_INVALID: - switch (ivp->iv_state) { - - case IPVCC_POPEN: - case IPVCC_PACCEPT: - case IPVCC_ACTIVE: - - /* - * Mapping has gone stale, so we cant use this VCC - * until the mapping is refreshed - */ - ivp->iv_flags &= ~IVF_MAPOK; - break; - } - break; - - case MAP_FAILED: - /* - * ARP lookup failed, just trash it all - */ - (void) ipatm_closevc(ivp, T_ATM_CAUSE_TEMPORARY_FAILURE); - break; - - case MAP_CHANGED: - /* - * ARP mapping has changed - */ - if (ivp->iv_flags & IVF_PVC) { - /* - * For PVCs, just reset lookup cache if needed - */ - if (last_map_ipvcc == ivp) { - last_map_ipdst = 0; - last_map_ipvcc = NULL; - } - } else { - /* - * Close SVC if it has already used this mapping - */ - switch (ivp->iv_state) { - - case IPVCC_POPEN: - case IPVCC_ACTIVE: - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_UNSPECIFIED_NORMAL); - break; - } - } - break; - - default: - log(LOG_ERR, "ipatm: unknown arp event %d, ivp=%p\n", - event, ivp); - } -} - - -/* - * Process an IP VCC idle timer tick - * - * This function is called every IPATM_IDLE_TIME seconds, in order to - * scan for idle IP VCC's. If an active VCC reaches the idle time limit, - * then it will be closed. - * - * Called at splnet. - * - * Arguments: - * tip pointer to the VCC idle timer control block - * - * Returns: - * none - * - */ -void -ipatm_itimeout(tip) - struct atm_time *tip; -{ - struct ipvcc *ivp, *inext; - struct ip_nif *inp; - - - /* - * Schedule next timeout - */ - atm_timeout(&ipatm_itimer, IPATM_IDLE_TIME, ipatm_itimeout); - - /* - * Check for disabled idle timeout - */ - if (ipatm_vcidle == 0) - return; - - /* - * Check out all IP VCCs - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - for (ivp = Q_HEAD(inp->inf_vcq, struct ipvcc); ivp; - ivp = inext) { - - inext = Q_NEXT(ivp, struct ipvcc, iv_elem); - - /* - * Looking for active, idle SVCs - */ - if (ivp->iv_flags & (IVF_PVC | IVF_NOIDLE)) - continue; - if (ivp->iv_state != IPVCC_ACTIVE) - continue; - if (++ivp->iv_idle < ipatm_vcidle) - continue; - - /* - * OK, we found one - close the VCC - */ - (void) ipatm_closevc(ivp, - T_ATM_CAUSE_UNSPECIFIED_NORMAL); - } - } -} - Property changes on: head/sys/netatm/ipatm/ipatm_event.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_if.c =================================================================== --- head/sys/netatm/ipatm/ipatm_if.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_if.c (nonexistent) @@ -1,343 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Interface Manager - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -static MALLOC_DEFINE(M_IPATM_NIF, "ipatm_nif", "IP/ATM network interfaces"); - -/* - * Local functions - */ -static void ipatm_closenif(struct ip_nif *); - - -/* - * Process Network Interface status change - * - * Called whenever a network interface status change is requested. - * - * Called at splnet. - * - * Arguments: - * cmd command code - * nip pointer to atm network interface control block - * arg command specific parameter - * - * Returns: - * 0 command successful - * errno command failed - reason indicated - * - */ -int -ipatm_nifstat(cmd, nip, arg) - int cmd; - struct atm_nif *nip; - intptr_t arg; -{ - struct in_ifaddr *ia; - struct siginst *sip; - struct ip_nif *inp; - int err = 0; - - /* - * Look for corresponding IP interface - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - - /* - * Process command - */ - switch (cmd) { - - case NCM_ATTACH: - /* - * Make sure i/f isn't already attached - */ - if (inp != NULL) { - err = EEXIST; - break; - } - - /* - * Get a new interface block - */ - inp = malloc(sizeof(*inp), M_IPATM_NIF, M_WAITOK | M_ZERO); - inp->inf_nif = nip; - inp->inf_state = IPNIF_ADDR; - inp->inf_arpnotify = ipatm_arpnotify; - inp->inf_ipinput = ipatm_ipinput; - inp->inf_createsvc = ipatm_createsvc; - LINK2TAIL(inp, struct ip_nif, ipatm_nif_head, inf_next); - break; - - case NCM_DETACH: - /* - * Make sure i/f is attached - */ - if (inp == NULL) { - err = ENODEV; - break; - } - - /* - * Validate interface stuff - */ - if (Q_HEAD(inp->inf_vcq, struct ipvcc)) - panic("ipatm_nifstat: ipvcc queue not empty"); - - /* - * If we're active, close all our VCCs and tell the - * interface service about the deactivation - */ - if (inp->inf_state == IPNIF_ACTIVE) { - - ipatm_closenif(inp); - - if (inp->inf_serv) - (void) (*inp->inf_serv->is_ifdact)(inp); - } - - /* - * Clean up and free block - */ - UNLINK(inp, struct ip_nif, ipatm_nif_head, inf_next); - free(inp, M_IPATM_NIF); - break; - - case NCM_SETADDR: - /* - * We only care about IP addresses - */ - if (((struct ifaddr *)arg)->ifa_addr->sa_family != AF_INET) - break; - - /* - * Make sure i/f is there - */ - ia = (struct in_ifaddr *)arg; - if (inp == NULL) - panic("ipatm_nifstat: setaddr missing ip_nif"); - - /* - * Process new address - */ - switch (inp->inf_state) { - - case IPNIF_SIGMGR: - case IPNIF_ADDR: - inp->inf_addr = ia; - - /* - * If signalling manager is not set, wait for it - */ - sip = nip->nif_pif->pif_siginst; - if (sip == NULL) { - inp->inf_state = IPNIF_SIGMGR; - break; - } - - /* - * Otherwise, everything's set - */ - inp->inf_state = IPNIF_ACTIVE; - - /* - * Tell interface service we're around - */ - if (sip->si_ipserv) { - inp->inf_serv = sip->si_ipserv; - err = (*inp->inf_serv->is_ifact)(inp); - } - - /* - * Reset state if there's been a problem - */ - if (err) { - inp->inf_serv = NULL; - inp->inf_addr = NULL; - inp->inf_state = IPNIF_ADDR; - } - break; - - case IPNIF_ACTIVE: - /* - * We dont support an address change - */ - err = EEXIST; - break; - } - break; - - case NCM_SIGATTACH: - /* - * Make sure i/f is attached - */ - if (inp == NULL) { - err = ENODEV; - break; - } - - /* - * Are we waiting for the sigmgr attach?? - */ - if (inp->inf_state != IPNIF_SIGMGR) { - /* - * No, nothing else to do - */ - break; - } - - /* - * OK, everything's set - */ - inp->inf_state = IPNIF_ACTIVE; - - /* - * Tell interface service we're around - */ - sip = nip->nif_pif->pif_siginst; - if (sip->si_ipserv) { - inp->inf_serv = sip->si_ipserv; - err = (*inp->inf_serv->is_ifact)(inp); - } - - /* - * Just report any problems, since a NCM_SIGDETACH will - * be coming down immediately - */ - break; - - case NCM_SIGDETACH: - /* - * Make sure i/f is attached - */ - if (inp == NULL) { - err = ENODEV; - break; - } - - /* - * Are we currently active?? - */ - if (inp->inf_state != IPNIF_ACTIVE) { - /* - * No, nothing else to do - */ - break; - } - - /* - * Close all the IP VCCs for this interface - */ - ipatm_closenif(inp); - - /* - * Tell interface service that i/f has gone down - */ - if (inp->inf_serv) - (void) (*inp->inf_serv->is_ifdact)(inp); - - /* - * Just have to wait for another sigattach - */ - inp->inf_serv = NULL; - inp->inf_state = IPNIF_SIGMGR; - break; - - default: - log(LOG_ERR, "ipatm_nifstat: unknown command %d\n", cmd); - } - - return (err); -} - - -/* - * Close all VCCs on a Network Interface - * - * Called at splnet. - * - * Arguments: - * inp pointer to IP network interface - * - * Returns: - * none - * - */ -static void -ipatm_closenif(inp) - struct ip_nif *inp; -{ - struct ipvcc *ivp, *inext; - - /* - * Close each IP VCC on this interface - */ - for (ivp = Q_HEAD(inp->inf_vcq, struct ipvcc); ivp; ivp = inext) { - - inext = Q_NEXT(ivp, struct ipvcc, iv_elem); - - (void) ipatm_closevc(ivp, T_ATM_CAUSE_UNSPECIFIED_NORMAL); - } -} - Property changes on: head/sys/netatm/ipatm/ipatm_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm.h =================================================================== --- head/sys/netatm/ipatm/ipatm.h (revision 179307) +++ head/sys/netatm/ipatm/ipatm.h (nonexistent) @@ -1,55 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Protocol definitions - * - */ - -#ifndef _IPATM_IPATM_H -#define _IPATM_IPATM_H - -/* - * Protocol Variables - */ -#define IPATM_VCIDLE 15 /* VCC idle time (minutes) */ -#define IPATM_ARP_TIME (60 * ATM_HZ) /* Wait for ARP answer */ -#define IPATM_SVC_TIME (60 * ATM_HZ) /* Wait for SVC open answer */ -#define IPATM_IDLE_TIME (60 * ATM_HZ) /* VCC idle timer tick */ - -/* - * IP/ATM LLC/SNAP header - */ -#define IPATM_LLC_LEN 8 -#define IPATM_LLC_HDR {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00} - -#endif /* _IPATM_IPATM_H */ Property changes on: head/sys/netatm/ipatm/ipatm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_output.c =================================================================== --- head/sys/netatm/ipatm/ipatm_output.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_output.c (nonexistent) @@ -1,217 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Output IP packets across an ATM VCC - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* - * Output an IP Packet - * - * All IP packets output to an ATM interface will be directed here via - * the atm_ifoutput() function. If there is an ATM VCC already setup for - * the destination IP address, then we'll just send the packet to that VCC. - * Otherwise we will have to setup a new VCC, ARPing for the corresponding - * destination ATM hardware address along the way. - * - * Arguments: - * ifp pointer to ifnet structure - * m pointer to packet buffer chain to be output - * dst pointer to packet's IP destination address - * - * Returns: - * 0 packet "output" was successful - * errno output failed - reason indicated - * - */ -int -ipatm_ifoutput(ifp, m, dst) - struct ifnet *ifp; - KBuffer *m; - struct sockaddr *dst; -{ - struct ipvcc *ivp; - int err = 0; - - if (ipatm_print) { - atm_pdu_print(m, "ipatm_ifoutput"); - } - - /* - * See if we've already got an appropriate VCC - */ - ivp = ipatm_iptovc((struct sockaddr_in *)dst, IFP2ANIF(ifp)); - if (ivp) { - - /* - * Reset idle timer - */ - ivp->iv_idle = 0; - - /* - * Can we use this VCC now?? - */ - if ((ivp->iv_state == IPVCC_ACTIVE) && - (ivp->iv_flags & IVF_MAPOK)) { - - /* - * OK, now send packet - */ - err = atm_cm_cpcs_data(ivp->iv_conn, m); - if (err) { - /* - * Output problem, drop packet - */ - KB_FREEALL(m); - } - } else { - - /* - * VCC is unavailable for data packets. Queue packet - * for now, but only maintain a queue length of one. - */ - if (ivp->iv_queue) - KB_FREEALL(ivp->iv_queue); - - ivp->iv_queue = m; - } - } else { - struct in_ifaddr *ia; - - /* - * No VCC to destination - */ - - /* - * Is packet for our interface address? - */ - TAILQ_FOREACH(ia, &in_ifaddrhead, ia_link) { - if (ia->ia_ifp != ifp) - continue; - if (((struct sockaddr_in *)dst)->sin_addr.s_addr == - IA_SIN(ia)->sin_addr.s_addr) { - - /* - * It's for us - hand packet to loopback driver - */ - (void) if_simloop(ifp, m, dst->sa_family, 0); - goto done; - } - } - - /* - * Is this a broadcast packet ?? - */ - if (in_broadcast(((struct sockaddr_in *)dst)->sin_addr, ifp)) { - struct ip_nif *inp; - int s; - - /* - * If interface server exists and provides broadcast - * services, then let it deal with this packet - */ - s = splnet(); - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == IFP2ANIF(ifp)) - break; - } - (void) splx(s); - - if ((inp == NULL) || - (inp->inf_serv == NULL) || - (inp->inf_serv->is_bcast_output == NULL)) { - KB_FREEALL(m); - err = EADDRNOTAVAIL; - goto done; - } - - err = (*inp->inf_serv->is_bcast_output)(inp, m); - goto done; - } - - /* - * How about a multicast packet ?? - */ - if (IN_MULTICAST(ntohl(SATOSIN(dst)->sin_addr.s_addr))) { - /* - * Multicast isn't currently supported - */ - KB_FREEALL(m); - err = EADDRNOTAVAIL; - goto done; - } - - /* - * Well, I guess we need to create an SVC to the destination - */ - if ((err = ipatm_createsvc(ifp, AF_INET, - (caddr_t)&((struct sockaddr_in *)dst)->sin_addr, - &ivp)) == 0) { - /* - * SVC open is proceeding, queue packet - */ - ivp->iv_queue = m; - - } else { - /* - * SVC open failed, release buffers and return - */ - KB_FREEALL(m); - } - } - -done: - return (err); -} Property changes on: head/sys/netatm/ipatm/ipatm_output.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/ipatm/ipatm_vcm.c =================================================================== --- head/sys/netatm/ipatm/ipatm_vcm.c (revision 179307) +++ head/sys/netatm/ipatm/ipatm_vcm.c (nonexistent) @@ -1,1329 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * IP Over ATM Support - * ------------------- - * - * Virtual Channel Manager - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -Atm_attributes ipatm_aal5llc = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL5 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_PRESENT, - { - T_ATM_CLASS_X, - T_ATM_NULL, - T_ATM_NULL, - T_NO, - T_ATM_1_TO_1 - } - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_PRESENT, - T_ATM_ABSENT, - { - { - T_ATM_SIMPLE_ID, - }, - { - T_ATM_ABSENT - } - } - }, - { /* llc */ - T_ATM_PRESENT, - { - T_ATM_LLC_SHARING, - IPATM_LLC_LEN, - IPATM_LLC_HDR - } - }, - { /* called */ - T_ATM_PRESENT, - }, - { /* calling */ - T_ATM_ABSENT - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ABSENT - }, - { /* cause */ - T_ATM_ABSENT - } -}; - -Atm_attributes ipatm_aal5null = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - sizeof(struct ifnet *), /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL5 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_PRESENT, - { - T_ATM_CLASS_X, - T_ATM_NULL, - T_ATM_NULL, - T_NO, - T_ATM_1_TO_1 - } - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT - }, - { /* llc */ - T_ATM_ABSENT - }, - { /* called */ - T_ATM_PRESENT, - }, - { /* calling */ - T_ATM_ABSENT - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ABSENT - }, - { /* cause */ - T_ATM_ABSENT - } -}; - -Atm_attributes ipatm_aal4null = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - sizeof(struct ifnet *), /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL3_4 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_PRESENT, - { - T_ATM_CLASS_X, - T_ATM_NULL, - T_ATM_NULL, - T_NO, - T_ATM_1_TO_1 - } - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT - }, - { /* llc */ - T_ATM_ABSENT - }, - { /* called */ - T_ATM_PRESENT, - }, - { /* calling */ - T_ATM_ABSENT - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ABSENT - }, - { /* cause */ - T_ATM_ABSENT - } -}; - -static struct t_atm_cause ipatm_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - 0, - {0, 0, 0, 0} -}; - - -/* - * Open an IP PVC - * - * This function will perform all actions necessary to activate a - * PVC for IP usage. In particular, it will allocate control blocks, - * open the PVC, initialize PVC stack, and initiate whatever ARP - * procedures are required. - * - * Arguments: - * pvp pointer to PVC parameter structure - * sivp address to return pointer to IP PVC control block - * - * Returns: - * 0 PVC was successfully opened - * errno open failed - reason indicated - * - */ -int -ipatm_openpvc(struct ipatmpvc *pvp, struct ipvcc **sivp) -{ - struct ipvcc *ivp = NULL; /* XXX pacify gcc-3.1 */ - Atm_attributes *ap; - Atm_addr_pvc *pvcp; - struct atm_nif *nip; - struct ip_nif *inp; - int s, err = 0; - - inp = pvp->ipp_ipnif; - nip = inp->inf_nif; - - /* - * Make sure interface is ready to go - */ - if (inp->inf_state != IPNIF_ACTIVE) { - err = ENETDOWN; - goto done; - } - - /* - * Validate fixed destination IP address - */ - if (pvp->ipp_dst.sin_addr.s_addr != INADDR_ANY) { - if (in_broadcast(pvp->ipp_dst.sin_addr, ANIF2IFP(nip)) || - IN_MULTICAST(ntohl(pvp->ipp_dst.sin_addr.s_addr)) || - ipatm_chknif(pvp->ipp_dst.sin_addr, inp)) { - err = EINVAL; - goto done; - } - } - - /* - * Allocate IP VCC block - */ - ivp = uma_zalloc(ipatm_vc_zone, M_WAITOK); - if (ivp == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Initialize the PVC - */ - ivp->iv_flags = IVF_PVC; - if (pvp->ipp_encaps == ATM_ENC_LLC) - ivp->iv_flags |= IVF_LLC; - - /* - * Fill out connection attributes - * Make a temporary copy of the attributes here so that we - * do not change the default attributes for SVCs. Otherwise this - * will give trouble in a mixed SVC/PVC case. - */ - ap = malloc(sizeof(*ap), M_TEMP, M_NOWAIT); - if (ap == NULL) { - err = ENOMEM; - goto done; - } - if (pvp->ipp_aal == ATM_AAL5) { - if (pvp->ipp_encaps == ATM_ENC_LLC) - *ap = ipatm_aal5llc; - else - *ap = ipatm_aal5null; - } else { - *ap = ipatm_aal4null; - } - - /* - * Build the ATM attributes - */ - ap->nif = nip; - - ap->bearer.v.traffic_type = pvp->ipp_traffic_type; - switch(ap->bearer.v.traffic_type) { - case T_ATM_UBR: - case T_ATM_CBR: - /* - * PCR=0 means `use up to the PIF's PCR' - */ - if (pvp->ipp_traffic.forward.PCR_all_traffic == 0) - ap->traffic.v.forward.PCR_all_traffic = - nip->nif_pif->pif_pcr; - else - ap->traffic.v.forward.PCR_all_traffic = - pvp->ipp_traffic.forward.PCR_all_traffic; - - if (pvp->ipp_traffic.forward.PCR_high_priority == 0) - ap->traffic.v.forward.PCR_high_priority = - nip->nif_pif->pif_pcr; - else - ap->traffic.v.forward.PCR_high_priority = - pvp->ipp_traffic.forward.PCR_high_priority; - - if (pvp->ipp_traffic.backward.PCR_all_traffic == 0) - ap->traffic.v.backward.PCR_all_traffic = - nip->nif_pif->pif_pcr; - else - ap->traffic.v.backward.PCR_all_traffic = - pvp->ipp_traffic.backward.PCR_all_traffic; - - if (pvp->ipp_traffic.backward.PCR_high_priority == 0) - ap->traffic.v.backward.PCR_high_priority = - nip->nif_pif->pif_pcr; - else - ap->traffic.v.backward.PCR_high_priority = - pvp->ipp_traffic.backward.PCR_high_priority; - break; - - case T_ATM_VBR: - ap->traffic.v.forward.PCR_all_traffic = - pvp->ipp_traffic.forward.PCR_all_traffic; - ap->traffic.v.forward.PCR_high_priority = - pvp->ipp_traffic.forward.PCR_high_priority; - ap->traffic.v.forward.SCR_all_traffic = - pvp->ipp_traffic.forward.SCR_all_traffic; - ap->traffic.v.forward.SCR_high_priority = - pvp->ipp_traffic.forward.SCR_high_priority; - ap->traffic.v.forward.MBS_all_traffic = - pvp->ipp_traffic.forward.MBS_all_traffic; - ap->traffic.v.forward.MBS_high_priority = - pvp->ipp_traffic.forward.MBS_high_priority; - - ap->traffic.v.backward.PCR_all_traffic = - pvp->ipp_traffic.backward.PCR_all_traffic; - ap->traffic.v.backward.PCR_high_priority = - pvp->ipp_traffic.backward.PCR_high_priority; - ap->traffic.v.backward.SCR_all_traffic = - pvp->ipp_traffic.backward.SCR_all_traffic; - ap->traffic.v.backward.SCR_high_priority = - pvp->ipp_traffic.backward.SCR_high_priority; - ap->traffic.v.backward.MBS_all_traffic = - pvp->ipp_traffic.backward.MBS_all_traffic; - ap->traffic.v.backward.MBS_high_priority = - pvp->ipp_traffic.backward.MBS_high_priority; - break; - - case T_ATM_NULL: - /* - * No traffic type - */ - /* FALLTHRU */ - default: - ap->traffic.v.forward.PCR_all_traffic = - nip->nif_pif->pif_pcr; - ap->traffic.v.backward.PCR_all_traffic = - nip->nif_pif->pif_pcr; - break; - } - ap->called.addr.address_format = T_ATM_PVC_ADDR; - ap->called.addr.address_length = sizeof(Atm_addr_pvc); - pvcp = (Atm_addr_pvc *)ap->called.addr.address; - ATM_PVC_SET_VPI(pvcp, pvp->ipp_vpi); - ATM_PVC_SET_VCI(pvcp, pvp->ipp_vci); - ap->called.subaddr.address_format = T_ATM_ABSENT; - ap->called.subaddr.address_length = 0; - - /* - * Create PVC - */ - err = atm_cm_connect(&ipatm_endpt, ivp, ap, &ivp->iv_conn); - if (err) { - free(ap, M_TEMP); - uma_zfree(ipatm_vc_zone, ivp); - goto done; - } - - /* - * Save PVC information and link in VCC - */ - /* ivp->iv_ = ap->headout; */ - free(ap, M_TEMP); - - /* - * Queue VCC onto its network interface - */ - s = splnet(); - ipatm_vccnt++; - ENQUEUE(ivp, struct ipvcc, iv_elem, inp->inf_vcq); - ivp->iv_ipnif = inp; - (void) splx(s); - - /* - * Set destination IP address and IPVCC state - */ - if (pvp->ipp_dst.sin_addr.s_addr == INADDR_ANY) { - /* - * Initiate ARP processing - */ - switch ((*inp->inf_serv->is_arp_pvcopen)(ivp)) { - - case MAP_PROCEEDING: - /* - * Wait for answer - */ - ivp->iv_state = IPVCC_ACTIVE; - break; - - case MAP_VALID: - /* - * We've got our answer already - */ - ivp->iv_state = IPVCC_ACTIVE; - ivp->iv_flags |= IVF_MAPOK; - ivp->iv_dst.s_addr = ivp->iv_arpent->am_dstip.s_addr; - break; - - case MAP_FAILED: - /* - * Try again later - */ - ivp->iv_state = IPVCC_ACTPENT; - IPVCC_TIMER(ivp, 1 * ATM_HZ); - break; - - default: - panic("ipatm_openpvc: invalid arp_pvcopen return"); - } - - } else { - /* - * Use configured IP destination - */ - ivp->iv_dst.s_addr = pvp->ipp_dst.sin_addr.s_addr; - ivp->iv_state = IPVCC_ACTIVE; - ivp->iv_flags |= IVF_MAPOK; - } - -done: - if (err) - *sivp = NULL; - else - *sivp = ivp; - return (err); -} - - -/* - * Create an IP SVC - * - * This function will initiate the creation of an IP SVC. The IP VCC - * control block will be initialized and, if required, we will initiate - * ARP processing in order to resolve the destination's ATM address. Once - * the destination ATM address is known, ipatm_opensvc() will be called. - * - * Arguments: - * ifp pointer to destination ifnet structure - * daf destination address family type - * dst pointer to destination address - * sivp address to return pointer to IP SVC control block - * - * Returns: - * 0 SVC creation was successfully initiated - * errno creation failed - reason indicated - * - */ -int -ipatm_createsvc(struct ifnet *ifp, u_short daf, caddr_t dst, - struct ipvcc **sivp) -{ - struct atm_nif *nip = IFP2ANIF(ifp); - struct ip_nif *inp; - struct ipvcc *ivp = NULL; /* XXX pacify gcc-3.1 */ - struct in_addr *ip; - Atm_addr *atm; - int s, err = 0; - - /* - * Get IP interface and make sure its ready - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if (inp == NULL) { - err = ENXIO; - goto done; - } - if (inp->inf_state != IPNIF_ACTIVE) { - err = ENETDOWN; - goto done; - } - - /* - * Validate destination address - */ - if (daf == AF_INET) { - /* - * Destination is IP address - */ - ip = (struct in_addr *)dst; - atm = NULL; - if (ip->s_addr == INADDR_ANY) { - err = EADDRNOTAVAIL; - goto done; - } - } else if (daf == AF_ATM) { - /* - * Destination is ATM address - */ - atm = (Atm_addr *)dst; - ip = NULL; - if (atm->address_format == T_ATM_ABSENT) { - err = EINVAL; - goto done; - } - } else { - err = EINVAL; - goto done; - } - - /* - * Make sure we have services provider and ARP support - */ - if ((inp->inf_serv == NULL) || - (inp->inf_serv->is_arp_svcout == NULL)) { - err = ENETDOWN; - goto done; - } - - /* - * Allocate IP VCC - * May be called from timeout - don't wait. - */ - ivp = uma_zalloc(ipatm_vc_zone, M_NOWAIT); - if (ivp == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Initialize SVC - */ - ivp->iv_flags = IVF_SVC; - ivp->iv_ipnif = inp; - - /* - * Get destination ATM address - */ - if (daf == AF_INET) { - /* - * ARP is the way... - */ - ivp->iv_dst.s_addr = ip->s_addr; - - switch ((*inp->inf_serv->is_arp_svcout)(ivp, ip)) { - - case MAP_PROCEEDING: - /* - * Wait for answer - */ - ivp->iv_state = IPVCC_PMAP; - IPVCC_TIMER(ivp, IPATM_ARP_TIME); - break; - - case MAP_VALID: - /* - * We've got our answer already, so open SVC - */ - ivp->iv_flags |= IVF_MAPOK; - err = ipatm_opensvc(ivp); - if (err) { - (*inp->inf_serv->is_arp_close)(ivp); - uma_zfree(ipatm_vc_zone, ivp); - goto done; - } - break; - - case MAP_FAILED: - /* - * So sorry...come again - */ - uma_zfree(ipatm_vc_zone, ivp); - err = ENETDOWN; - goto done; - - default: - panic("ipatm_createsvc: invalid arp_svcout return"); - } - } else { - /* - * We were given the ATM address, so open the SVC - * - * Create temporary arp map entry so that opensvc() works. - * Caller must set up a permanent entry immediately! (yuk) - */ - struct arpmap map; - - ATM_ADDR_COPY(atm, &map.am_dstatm); - map.am_dstatmsub.address_format = T_ATM_ABSENT; - map.am_dstatmsub.address_length = 0; - ivp->iv_arpent = ↦ - err = ipatm_opensvc(ivp); - if (err) { - uma_zfree(ipatm_vc_zone, ivp); - goto done; - } - ivp->iv_arpent = NULL; - } - - /* - * Queue VCC onto its network interface - */ - s = splnet(); - ipatm_vccnt++; - ENQUEUE(ivp, struct ipvcc, iv_elem, inp->inf_vcq); - (void) splx(s); - -done: - if (err) - *sivp = NULL; - else - *sivp = ivp; - return (err); -} - - -/* - * Open an IP SVC - * - * This function will continue the IP SVC creation process. Here, we - * will issue an SVC open to the signalling manager and then wait for - * the final SVC setup results. - * - * Arguments: - * ivp pointer to IP SVC to open - * - * Returns: - * 0 SVC open was successfully initiated - * errno open failed - reason indicated - * - */ -int -ipatm_opensvc(struct ipvcc *ivp) -{ - struct ip_nif *inp = ivp->iv_ipnif; - Atm_attributes *ap; - int err = 0, i; - - /* - * Cancel possible arp timeout - */ - IPVCC_CANCEL(ivp); - - /* - * Fill out connection attributes - */ - i = ivp->iv_parmx; - if (inp->inf_serv->is_vccparm[i].ivc_aal == ATM_AAL5) { - if (inp->inf_serv->is_vccparm[i].ivc_encaps == ATM_ENC_LLC) { - ap = &ipatm_aal5llc; - ivp->iv_flags |= IVF_LLC; - } else { - ap = &ipatm_aal5null; - ivp->iv_flags &= ~IVF_LLC; - } - } else { - ap = &ipatm_aal4null; - ivp->iv_flags &= ~IVF_LLC; - } - - ap->nif = inp->inf_nif; - ap->traffic.v.forward.PCR_all_traffic = inp->inf_nif->nif_pif->pif_pcr; - ap->traffic.v.backward.PCR_all_traffic = inp->inf_nif->nif_pif->pif_pcr; - - ATM_ADDR_COPY(&ivp->iv_arpent->am_dstatm, &ap->called.addr); - ATM_ADDR_COPY(&ivp->iv_arpent->am_dstatmsub, &ap->called.subaddr); - - /* - * Initiate SVC open - */ - err = atm_cm_connect(&ipatm_endpt, ivp, ap, &ivp->iv_conn); - switch (err) { - - case EINPROGRESS: - /* - * Call is progressing - */ - /* ivp->iv_ = ap->headout; */ - - /* - * Now we just wait for a CALL_CONNECTED event - */ - ivp->iv_state = IPVCC_POPEN; - IPVCC_TIMER(ivp, IPATM_SVC_TIME); - err = 0; - break; - - case 0: - /* - * We've been hooked up with a shared VCC - */ - /* ivp->iv_ = ap->headout; */ - ipatm_activate(ivp); - break; - } - - return (err); -} - - -/* - * Retry an IP SVC Open - * - * This function will attempt to retry a failed SVC open request. The IP - * interface service provider specifies a list of possible VCC parameters - * for IP to use. We will try each set of parameters in turn until either - * an open succeeds or we reach the end of the list. - * - * Arguments: - * ivp pointer to IP SVC - * - * Returns: - * 0 SVC (re)open was successfully initiated - * else retry failed - * - */ -int -ipatm_retrysvc(struct ipvcc *ivp) -{ - struct ip_nif *inp = ivp->iv_ipnif; - - /* - * If there isn't another set of vcc parameters to try, return - */ - if ((++ivp->iv_parmx >= IPATM_VCCPARMS) || - (inp->inf_serv->is_vccparm[ivp->iv_parmx].ivc_aal == 0)) - return (1); - - /* - * Okay, now initiate open with a new set of parameters - */ - return (ipatm_opensvc(ivp)); -} - - -/* - * Finish IP SVC Activation - * - * Arguments: - * ivp pointer to IP SVC - * - * Returns: - * none - * - */ -void -ipatm_activate(struct ipvcc *ivp) -{ - - /* - * Connection is now active - */ - ivp->iv_state = IPVCC_ACTIVE; - IPVCC_CANCEL(ivp); - - /* - * Tell ARP module that connection is active - */ - if ((*ivp->iv_ipnif->inf_serv->is_arp_svcact)(ivp)) { - (void) ipatm_closevc(ivp, T_ATM_CAUSE_TEMPORARY_FAILURE); - return; - } - - /* - * Send any queued packet - */ - if ((ivp->iv_flags & IVF_MAPOK) && ivp->iv_queue) { - struct sockaddr_in sin; - struct ifnet *ifp; - - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = ivp->iv_dst.s_addr; - ifp = (struct ifnet *)ivp->iv_ipnif->inf_nif; - (void) ipatm_ifoutput(ifp, ivp->iv_queue, - (struct sockaddr *)&sin); - ivp->iv_queue = NULL; - } -} - - -/* - * Process Incoming Calls - * - * This function will receive control when an incoming call has been matched - * to one of our registered listen parameter blocks. Assuming the call passes - * acceptance criteria and all required resources are available, we will - * create an IP SVC and notify the connection manager of our decision. We - * will then await notification of the final SVC setup results. If any - * problems are encountered, we will just tell the connection manager to - * reject the call. - * - * Called at splnet. - * - * Arguments: - * tok owner's matched listening token - * cop pointer to incoming call's connection block - * ap pointer to incoming call's attributes - * tokp pointer to location to store our connection token - * - * Returns: - * 0 call is accepted - * errno call rejected - reason indicated - * - */ -int -ipatm_incoming(void *tok, Atm_connection *cop, Atm_attributes *ap, - void **tokp) -{ - struct atm_nif *nip = ap->nif; - struct ip_nif *inp; - struct ipvcc *ivp = NULL; - int err, cause; - int usellc = 0, mtu = ATM_NIF_MTU; - - /* - * Get IP interface and make sure its ready - */ - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if ((inp == NULL) || (inp->inf_state != IPNIF_ACTIVE)) { - err = ENETUNREACH; - cause = T_ATM_CAUSE_SERVICE_OR_OPTION_UNAVAILABLE; - goto reject; - } - - /* - * Make sure we have services provider and ARP support - */ - if ((inp->inf_serv == NULL) || - (inp->inf_serv->is_arp_svcin == NULL)) { - err = ENETUNREACH; - cause = T_ATM_CAUSE_SERVICE_OR_OPTION_UNAVAILABLE; - goto reject; - } - - /* - * Check for LLC encapsulation - */ - if ((ap->blli.tag_l2 == T_ATM_PRESENT) && - (ap->blli.v.layer_2_protocol.ID_type == T_ATM_SIMPLE_ID) && - (ap->blli.v.layer_2_protocol.ID.simple_ID == T_ATM_BLLI2_I8802)) { - usellc = 1; - mtu += IPATM_LLC_LEN; - } - - /* - * Verify requested MTU - */ - if (ap->aal.type == ATM_AAL5) { - if ((ap->aal.v.aal5.forward_max_SDU_size > mtu) || - (ap->aal.v.aal5.backward_max_SDU_size < mtu)) { - err = ENETUNREACH; - cause = T_ATM_CAUSE_AAL_PARAMETERS_NOT_SUPPORTED; - goto reject; - } - } else { - if ((ap->aal.v.aal4.forward_max_SDU_size > mtu) || - (ap->aal.v.aal4.backward_max_SDU_size < mtu)) { - err = ENETUNREACH; - cause = T_ATM_CAUSE_AAL_PARAMETERS_NOT_SUPPORTED; - goto reject; - } - } - - /* - * Allocate IP VCC - * May be called from timeout - don't wait. - */ - ivp = uma_zalloc(ipatm_vc_zone, M_NOWAIT); - if (ivp == NULL) { - err = ENOMEM; - cause = T_ATM_CAUSE_UNSPECIFIED_RESOURCE_UNAVAILABLE; - goto reject; - } - - /* - * Initialize SVC - */ - ivp->iv_flags = IVF_SVC; - ivp->iv_ipnif = inp; - if (usellc) - ivp->iv_flags |= IVF_LLC; - - /* - * Lookup ARP entry for destination - */ - switch ((*inp->inf_serv->is_arp_svcin) - (ivp, &ap->calling.addr, &ap->calling.subaddr)) { - - case MAP_PROCEEDING: - /* - * We'll be (hopefully) notified later - */ - break; - - case MAP_VALID: - /* - * We've got our answer already - */ - ivp->iv_flags |= IVF_MAPOK; - ivp->iv_dst.s_addr = ivp->iv_arpent->am_dstip.s_addr; - break; - - case MAP_FAILED: - /* - * So sorry...come again - */ - err = ENETUNREACH; - cause = T_ATM_CAUSE_SERVICE_OR_OPTION_UNAVAILABLE; - goto reject; - - default: - panic("ipatm_incoming: invalid arp_svcin return"); - } - - /* - * Accept SVC connection - */ - ivp->iv_state = IPVCC_PACCEPT; - - /* - * Save VCC information - */ - ivp->iv_conn = cop; - *tokp = ivp; - /* ivp->iv_ = ap->headout; */ - - /* - * Queue VCC onto its network interface - */ - ipatm_vccnt++; - ENQUEUE(ivp, struct ipvcc, iv_elem, inp->inf_vcq); - - /* - * Wait for a CALL_CONNECTED event - */ - IPVCC_TIMER(ivp, IPATM_SVC_TIME); - - return (0); - -reject: - /* - * Clean up after call failure - */ - if (ivp) { - (*inp->inf_serv->is_arp_close)(ivp); - uma_zfree(ipatm_vc_zone, ivp); - } - ap->cause.tag = T_ATM_PRESENT; - ap->cause.v = ipatm_cause; - ap->cause.v.cause_value = cause; - return (err); -} - - -/* - * Close an IP VCC - * - * This function will close an IP VCC (PVC or SVC), including notifying - * the signalling and ARP subsystems of the VCC's demise and cleaning - * up memory after ourselves. - * - * Arguments: - * ivp pointer to VCC - * code cause code - * - * Returns: - * 0 VCC successfully closed - * errno close failed - reason indicated - * - */ -int -ipatm_closevc(struct ipvcc *ivp, int code) -{ - struct ip_nif *inp = ivp->iv_ipnif; - int s, err; - - /* - * Make sure VCC hasn't been through here already - */ - switch (ivp->iv_state) { - - case IPVCC_FREE: - return (EALREADY); - } - - /* - * Reset lookup cache - */ - if (last_map_ipvcc == ivp) { - last_map_ipvcc = NULL; - last_map_ipdst = 0; - } - - /* - * Tell ARP about SVCs and dynamic PVCs - */ - if (inp->inf_serv && - ((ivp->iv_flags & IVF_SVC) || inp->inf_serv->is_arp_pvcopen)) { - (*inp->inf_serv->is_arp_close)(ivp); - } - - /* - * Free queued packets - */ - if (ivp->iv_queue) - KB_FREEALL(ivp->iv_queue); - - /* - * Cancel any timers - */ - IPVCC_CANCEL(ivp); - - /* - * Close VCC - */ - switch (ivp->iv_state) { - - case IPVCC_PMAP: - break; - - case IPVCC_POPEN: - case IPVCC_PACCEPT: - case IPVCC_ACTPENT: - case IPVCC_ACTIVE: - ipatm_cause.cause_value = code; - err = atm_cm_release(ivp->iv_conn, &ipatm_cause); - if (err) { - log(LOG_ERR, - "ipatm_closevc: release fail: err=%d\n", err); - } - break; - - case IPVCC_CLOSED: - break; - - default: - log(LOG_ERR, - "ipatm_closevc: unknown state: ivp=%p, state=%d\n", - ivp, ivp->iv_state); - } - - /* - * Remove VCC from network i/f - */ - s = splnet(); - DEQUEUE(ivp, struct ipvcc, iv_elem, inp->inf_vcq); - - /* - * Reset state just to be sure - */ - ivp->iv_state = IPVCC_FREE; - - /* - * If ARP module is done with VCC too, then free it - */ - if (ivp->iv_arpconn == NULL) - uma_zfree(ipatm_vc_zone, ivp); - ipatm_vccnt--; - (void) splx(s); - - return (0); -} - - -/* - * Check if IP address is valid on a Network Interface - * - * Checks whether the supplied IP address is allowed to be assigned to - * the supplied IP network interface. - * - * Arguments: - * in IP address - * inp pointer to IP network interface - * - * Returns: - * 0 - OK to assign - * 1 - not valid to assign - * - */ -int -ipatm_chknif(struct in_addr in, struct ip_nif *inp) -{ - struct in_ifaddr *ia; - u_long i; - - /* - * Make sure there's an interface requested - */ - if (inp == NULL) - return (1); - - /* - * Make sure we have an IP address - */ - i = ntohl(in.s_addr); - if (i == 0) - return (1); - - /* - * Make sure an interface address is set - */ - ia = inp->inf_addr; - if (ia == NULL) - return (1); - - /* - * Make sure we're on the right subnet - */ - if ((i & ia->ia_subnetmask) != ia->ia_subnet) - return (1); - - return (0); -} - - -/* - * Map an IP Address to an IP VCC - * - * Given a destination IP address, this function will return a pointer - * to the appropriate output IP VCC to which to send the packet. - * This is currently implemented using a one-behind cache containing the - * last successful mapping result. If the cache lookup fails, then a - * simple linear search of all IP VCCs on the destination network interface - * is performed. This is obviously an area to look at for performance - * improvements. - * - * Arguments: - * dst pointer to destination IP address - * nip pointer to destination network interface - * - * Returns: - * addr pointer to located IP VCC - * 0 no such mapping exists - * - */ -struct ipvcc * -ipatm_iptovc(struct sockaddr_in *dst, struct atm_nif *nip) -{ - struct ip_nif *inp; - struct ipvcc *ivp; - u_long dstip = dst->sin_addr.s_addr; - int s; - - /* - * Look in cache first - */ - if (last_map_ipdst == dstip) - return (last_map_ipvcc); - - /* - * Oh well, we've got to search for it...first find the interface - */ - s = splnet(); - for (inp = ipatm_nif_head; inp; inp = inp->inf_next) { - if (inp->inf_nif == nip) - break; - } - if (inp == NULL) { - (void) splx(s); - return (NULL); - } - - /* - * Now home in on the VCC - */ - for (ivp = Q_HEAD(inp->inf_vcq, struct ipvcc); ivp; - ivp = Q_NEXT(ivp, struct ipvcc, iv_elem)) { - if (ivp->iv_dst.s_addr == dstip) - break; - } - - /* - * Update lookup cache - */ - if (ivp) { - last_map_ipdst = dstip; - last_map_ipvcc = ivp; - } - (void) splx(s); - - return (ivp); -} Property changes on: head/sys/netatm/ipatm/ipatm_vcm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_sap.h =================================================================== --- head/sys/netatm/atm_sap.h (revision 179307) +++ head/sys/netatm/atm_sap.h (nonexistent) @@ -1,81 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Services definitions - * - */ - -#ifndef _NETATM_ATM_SAP_H -#define _NETATM_ATM_SAP_H - -/* - * Service Access Point (SAP) - * - * A SAP specifies the definition of an interface used between two adjacent - * layers. The SAP is named for the services the lower layer provides to - * the upper layer. - * - * The types of SAPs used are: - * Stack - defines the interfaces between stack service entities. - * These are further divided into: - * - * Stack class SAP - which identifies the type of interface - * used. All SAPs of a particular class will provide - * the same interface services to the higher layer. - * All stack command codes are constructed using class - * SAP values. - * - * Stack instance SAP - which identifies the specific identity - * of the layer providing the class interface. - */ -typedef u_short Sap_t; - -#define SAP_TYPE_MASK 0xc000 -#define SAP_TYPE_STACK 0x8000 -#define SAP_CLASS_MASK 0xff80 - -#define SAP_STACK(c, i) (SAP_TYPE_STACK | ((c) << 7) | (i)) - -/* Stack SAPs */ -#define SAP_ATM SAP_STACK(1, 0) /* ATM cell */ -#define SAP_SAR SAP_STACK(2, 0) /* AAL SAR */ -#define SAP_SAR_AAL3_4 SAP_STACK(2, 3) /* AAL3/4 SAR */ -#define SAP_SAR_AAL5 SAP_STACK(2, 5) /* AAL5 SAR */ -#define SAP_CPCS SAP_STACK(3, 0) /* AAL CPCS */ -#define SAP_CPCS_AAL3_4 SAP_STACK(3, 3) /* AAL3/4 CPCS */ -#define SAP_CPCS_AAL5 SAP_STACK(3, 5) /* AAL5 CPCS */ -#define SAP_SSCOP SAP_STACK(4, 0) /* ITU Q.2110 */ -#define SAP_SSCF_UNI SAP_STACK(5, 0) /* ITU Q.2130 */ -#define SAP_SSCF_NNI SAP_STACK(6, 0) /* ITU Q.2140 */ - -#endif /* _NETATM_ATM_SAP_H */ Property changes on: head/sys/netatm/atm_sap.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_sys.h =================================================================== --- head/sys/netatm/atm_sys.h (revision 179307) +++ head/sys/netatm/atm_sys.h (nonexistent) @@ -1,220 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * General system definitions - * - */ - -#ifndef _NETATM_ATM_SYS_H -#define _NETATM_ATM_SYS_H - -/* - * Software Version - */ -#define ATM_VERSION 0x00030000 /* Version 3.0 */ -#define ATM_VERS_MAJ(v) ((v) >> 16) -#define ATM_VERS_MIN(v) ((v) & 0xffff) - - -/* - * Misc system defines - */ -#define ATM_CALLQ_MAX 100 /* Maximum length of call queue */ -#define ATM_INTRQ_MAX 1000 /* Maximum length of interrupt queue */ - - -/* - * ATM address manipulation macros - */ -#define ATM_ADDR_EQUAL(a1, a2) \ - (((a1)->address_format == (a2)->address_format) && \ - ((a1)->address_length == (a2)->address_length) && \ - (bcmp((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length) == 0)) - -#define ATM_ADDR_SEL_EQUAL(a1, s1, a2) \ - (((a1)->address_format == (a2)->address_format) && \ - ((a1)->address_length == (a2)->address_length) && \ - (((((a1)->address_format == T_ATM_ENDSYS_ADDR) || \ - ((a1)->address_format == T_ATM_NSAP_ADDR)) && \ - (bcmp((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length - 1) == 0) && \ - ((s1) == ((struct atm_addr_nsap *)(a2)->address)->aan_sel)) || \ - (((a1)->address_format != T_ATM_ENDSYS_ADDR) && \ - ((a1)->address_format != T_ATM_NSAP_ADDR) && \ - (bcmp((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length) == 0)))) - -#define ATM_ADDR_COPY(a1, a2) \ -{ \ - (a2)->address_format = (a1)->address_format; \ - (a2)->address_length = (a1)->address_length; \ - bcopy((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length); \ -} - -#define ATM_ADDR_SEL_COPY(a1, s1, a2) \ -{ \ - (a2)->address_format = (a1)->address_format; \ - (a2)->address_length = (a1)->address_length; \ - if (((a1)->address_format == T_ATM_ENDSYS_ADDR) || \ - ((a1)->address_format == T_ATM_NSAP_ADDR)) { \ - bcopy((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length - 1); \ - ((struct atm_addr_nsap *)(a2)->address)->aan_sel = (s1);\ - } else { \ - bcopy((caddr_t)(a1)->address, (caddr_t)(a2)->address, \ - (a1)->address_length); \ - } \ -} - - -/* - * ATM Cell Header definitions - */ - -/* - * These macros assume that the cell header (minus the HEC) - * is contained in the least-significant 32-bits of a word - */ -#define ATM_HDR_SET_VPI(vpi) (((vpi) & 0xff) << 20) -#define ATM_HDR_SET_VCI(vci) (((vci) & 0xffff) << 4) -#define ATM_HDR_SET_PT(pt) (((pt) & 0x7) << 1) -#define ATM_HDR_SET_CLP(clp) ((clp) & 0x1) -#define ATM_HDR_SET(vpi,vci,pt,clp) (ATM_HDR_SET_VPI(vpi) | \ - ATM_HDR_SET_VCI(vci) | \ - ATM_HDR_SET_PT(pt) | \ - ATM_HDR_SET_CLP(clp)) -#define ATM_HDR_GET_VPI(hdr) (((hdr) >> 20) & 0xff) -#define ATM_HDR_GET_VCI(hdr) (((hdr) >> 4) & 0xffff) -#define ATM_HDR_GET_PT(hdr) (((hdr) >> 1) & 0x7) -#define ATM_HDR_GET_CLP(hdr) ((hdr) & 0x1) - -/* - * Payload Type Identifier (3 bits) - */ -#define ATM_PT_USER_SDU0 0x0 /* User, no congestion, sdu type 0 */ -#define ATM_PT_USER_SDU1 0x1 /* User, no congestion, sdu type 1 */ -#define ATM_PT_USER_CONG_SDU0 0x2 /* User, congestion, sdu type 0 */ -#define ATM_PT_USER_CONG_SDU1 0x3 /* User, congestion, sdu type 1 */ -#define ATM_PT_NONUSER 0x4 /* User/non-user differentiator */ -#define ATM_PT_OAMF5_SEG 0x4 /* OAM F5 segment flow */ -#define ATM_PT_OAMF5_E2E 0x5 /* OAM F5 end-to-end flow */ - - -/* - * AAL (ATM Adaptation Layer) codes - */ -typedef u_char Aal_t; -#define ATM_AAL0 0 /* AAL0 - Cell service */ -#define ATM_AAL1 1 /* AAL1 */ -#define ATM_AAL2 2 /* AAL2 */ -#define ATM_AAL3_4 3 /* AAL3/4 */ -#define ATM_AAL5 5 /* AAL5 */ - - -/* - * VCC Encapsulation codes - */ -typedef u_char Encaps_t; -#define ATM_ENC_NULL 1 /* Null encapsulation */ -#define ATM_ENC_LLC 2 /* LLC encapsulation */ - - -#ifdef _KERNEL -/* - * ATM timer control block. Used to schedule a timeout via atm_timeout(). - * This control block will typically be embedded in a processing-specific - * control block. - */ -struct atm_time { - u_short ti_ticks; /* Delta of ticks until timeout */ - u_char ti_flag; /* Timer flag bits (see below) */ - void (*ti_func) /* Call at timeout expiration */ - (struct atm_time *); - struct atm_time *ti_next; /* Next on queue */ -}; - -/* - * Timer Flags - */ -#define TIF_QUEUED 0x01 /* Control block on timer queue */ - -#define ATM_HZ 2 /* Time ticks per second */ - -/* - * Debugging - */ -#ifdef DIAGNOSTIC -#define ATM_TIME \ - struct timeval now, delta; \ - KT_TIME(now); \ - delta.tv_sec = now.tv_sec - atm_debugtime.tv_sec; \ - delta.tv_usec = now.tv_usec - atm_debugtime.tv_usec; \ - atm_debugtime = now; \ - if (delta.tv_usec < 0) { \ - delta.tv_sec--; \ - delta.tv_usec += 1000000; \ - } \ - printf("%3ld.%6ld: ", (long)delta.tv_sec, delta.tv_usec); - -#define ATM_DEBUG0(f) if (atm_debug) {ATM_TIME; printf(f);} -#define ATM_DEBUGN0(f) if (atm_debug) {printf(f);} -#define ATM_DEBUG1(f,a1) if (atm_debug) {ATM_TIME; printf(f, a1);} -#define ATM_DEBUGN1(f,a1) if (atm_debug) {printf(f, a1);} -#define ATM_DEBUG2(f,a1,a2) if (atm_debug) {ATM_TIME; printf(f, a1, a2);} -#define ATM_DEBUGN2(f,a1,a2) if (atm_debug) {printf(f, a1, a2);} -#define ATM_DEBUG3(f,a1,a2,a3) if (atm_debug) {ATM_TIME; printf(f, a1, a2, a3);} -#define ATM_DEBUGN3(f,a1,a2,a3) if (atm_debug) {printf(f, a1, a2, a3);} -#define ATM_DEBUG4(f,a1,a2,a3,a4) if (atm_debug) {ATM_TIME; printf(f, a1, a2, a3, a4);} -#define ATM_DEBUGN4(f,a1,a2,a3,a4) if (atm_debug) {printf(f, a1, a2, a3, a4);} -#define ATM_DEBUG5(f,a1,a2,a3,a4,a5) if (atm_debug) {ATM_TIME; printf(f, a1, a2, a3, a4, a5);} -#define ATM_DEBUGN5(f,a1,a2,a3,a4,a5) if (atm_debug) {printf(f, a1, a2, a3, a4, a5);} -#else -#define ATM_DEBUG0(f) -#define ATM_DEBUGN0(f) -#define ATM_DEBUG1(f,a1) -#define ATM_DEBUGN1(f,a1) -#define ATM_DEBUG2(f,a1,a2) -#define ATM_DEBUGN2(f,a1,a2) -#define ATM_DEBUG3(f,a1,a2,a3) -#define ATM_DEBUGN3(f,a1,a2,a3) -#define ATM_DEBUG4(f,a1,a2,a3,a4) -#define ATM_DEBUGN4(f,a1,a2,a3,a4) -#define ATM_DEBUG5(f,a1,a2,a3,a4,a5) -#define ATM_DEBUGN5(f,a1,a2,a3,a4,a5) -#endif - -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_SYS_H */ Property changes on: head/sys/netatm/atm_sys.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_print.h =================================================================== --- head/sys/netatm/uni/unisig_print.h (revision 179307) +++ head/sys/netatm/uni/unisig_print.h (nonexistent) @@ -1,47 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Protocol control blocks - * - */ - -#ifndef _UNISIG_PRINT_H -#define _UNISIG_PRINT_H - -/* - * Message direction for print routine - */ -#define UNISIG_MSG_IN 1 -#define UNISIG_MSG_OUT 2 - -#endif /* _UNISIG_PRINT_H */ Property changes on: head/sys/netatm/uni/unisig_print.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_sigmgr_state.c =================================================================== --- head/sys/netatm/uni/unisig_sigmgr_state.c (revision 179307) +++ head/sys/netatm/uni/unisig_sigmgr_state.c (nonexistent) @@ -1,865 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Signalling manager finite state machine - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static int unisig_sigmgr_invalid(struct unisig *, KBuffer *); -static int unisig_sigmgr_act01(struct unisig *, KBuffer *); -static int unisig_sigmgr_act02(struct unisig *, KBuffer *); -static int unisig_sigmgr_act03(struct unisig *, KBuffer *); -static int unisig_sigmgr_act04(struct unisig *, KBuffer *); -static int unisig_sigmgr_act05(struct unisig *, KBuffer *); -static int unisig_sigmgr_act06(struct unisig *, KBuffer *); -static int unisig_sigmgr_act07(struct unisig *, KBuffer *); -static int unisig_sigmgr_act08(struct unisig *, KBuffer *); -static int unisig_sigmgr_act09(struct unisig *, KBuffer *); -static int unisig_sigmgr_act10(struct unisig *, KBuffer *); -static int unisig_sigmgr_act11(struct unisig *, KBuffer *); -static int unisig_sigmgr_act12(struct unisig *, KBuffer *); -static int unisig_sigmgr_act13(struct unisig *, KBuffer *); -static int unisig_sigmgr_act14(struct unisig *, KBuffer *); - - -/* - * State table. - */ -static int sigmgr_state_table[10][7] = { - /* 0 1 2 3 4 5 */ - { 1, 0, 0, 0, 0 }, /* 0 - Time out */ - { 0, 0, 3, 5, 0 }, /* 1 - SSCF estab ind */ - { 0, 0, 3, 5, 0 }, /* 2 - SSCF estab cnf */ - { 0, 0, 4, 6, 0 }, /* 3 - SSCF release ind */ - { 0, 0, 0, 6, 0 }, /* 4 - SSCF release cnf */ - { 0, 0, 0, 7, 0 }, /* 5 - SSCF data ind */ - { 0, 0, 2, 2, 0 }, /* 6 - SSCF unit data ind */ - { 0, 0, 8, 8, 8 }, /* 7 - Call cleared */ - { 14, 14, 14, 14, 0 }, /* 8 - Detach */ - { 13, 13, 0, 0, 0 } /* 9 - Address set */ -}; - -/* - * Action vector - */ -#define MAX_ACTION 15 -static int (*unisig_sigmgr_act_vec[MAX_ACTION]) - (struct unisig *, KBuffer *) = { - unisig_sigmgr_invalid, - unisig_sigmgr_act01, - unisig_sigmgr_act02, - unisig_sigmgr_act03, - unisig_sigmgr_act04, - unisig_sigmgr_act05, - unisig_sigmgr_act06, - unisig_sigmgr_act07, - unisig_sigmgr_act08, - unisig_sigmgr_act09, - unisig_sigmgr_act10, - unisig_sigmgr_act11, - unisig_sigmgr_act12, - unisig_sigmgr_act13, - unisig_sigmgr_act14 -}; - - -/* - * ATM endpoint for UNI signalling channel - */ -static Atm_endpoint unisig_endpt = { - NULL, /* ep_next */ - ENDPT_UNI_SIG, /* ep_id */ - NULL, /* ep_ioctl */ - unisig_getname, /* ep_getname */ - unisig_connected, /* ep_connected */ - unisig_cleared, /* ep_cleared */ - NULL, /* ep_incoming */ - NULL, /* ep_addparty */ - NULL, /* ep_dropparty */ - NULL, /* ep_cpcs_ctl */ - NULL, /* ep_cpcs_data */ - unisig_saal_ctl, /* ep_saal_ctl */ - unisig_saal_data, /* ep_saal_data */ - NULL, /* ep_sscop_ctl */ - NULL /* ep_sscop_data */ -}; - - -/* - * ATM connection attributes for UNI signalling channel - */ -static Atm_attributes unisig_attr = { - NULL, /* nif */ - CMAPI_SAAL, /* api */ - UNI_VERS_3_0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, /* aal.tag */ - ATM_AAL5 /* aal.aal_type */ - }, - { /* traffic */ - T_ATM_PRESENT, /* traffic.tag */ - { /* traffic.v */ - { /* traffic.v.forward */ - T_ATM_ABSENT, /* PCR_high */ - 0, /* PCR_all */ - T_ATM_ABSENT, /* SCR_high */ - T_ATM_ABSENT, /* SCR_all */ - T_ATM_ABSENT, /* MBS_high */ - T_ATM_ABSENT, /* MBS_all */ - T_NO, /* tagging */ - }, - { /* traffic.v.backward */ - T_ATM_ABSENT, /* PCR_high */ - 0, /* PCR_all */ - T_ATM_ABSENT, /* SCR_high */ - T_ATM_ABSENT, /* SCR_all */ - T_ATM_ABSENT, /* MBS_high */ - T_ATM_ABSENT, /* MBS_all */ - T_NO, /* tagging */ - }, - T_YES, /* best_effort */ - } - }, - { /* bearer */ - T_ATM_PRESENT, /* bearer.tag */ - { /* bearer.v */ - T_ATM_CLASS_X, /* class */ - T_ATM_NULL, /* traffic_type */ - T_ATM_NO_END_TO_END, /* timing_req */ - T_NO, /* clipping */ - T_ATM_1_TO_1, /* conn_conf */ - } - }, - { /* bhli */ - T_ATM_ABSENT, /* bhli.tag */ - }, - { /* blli */ - T_ATM_ABSENT, /* blli.tag_l2 */ - T_ATM_ABSENT, /* blli.tag_l3 */ - }, - { /* llc */ - T_ATM_ABSENT, /* llc.tag */ - }, - { /* called */ - T_ATM_PRESENT, /* called.tag */ - }, - { /* calling */ - T_ATM_ABSENT, /* calling.tag */ - }, - { /* qos */ - T_ATM_PRESENT, /* qos.tag */ - { /* qos.v */ - T_ATM_NETWORK_CODING, /* coding_standard */ - { /* qos.v.forward */ - T_ATM_QOS_CLASS_0, /* class */ - }, - { /* qos.v.backward */ - T_ATM_QOS_CLASS_0, /* class */ - } - } - }, - { /* transit */ - T_ATM_ABSENT, /* transit.tag */ - }, - { /* cause */ - T_ATM_ABSENT, /* cause.tag */ - } -}; - - -/* - * Finite state machine for the UNISIG signalling manager - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * event indication of the event to be processed - * m pointer to a buffer with a message (optional) - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -unisig_sigmgr_state(usp, event, m) - struct unisig *usp; - int event; - KBuffer *m; -{ - int action, err = 0; - - /* - * Cancel any signalling manager timer - */ - UNISIG_CANCEL(usp); - - /* - * Select an action based on the incoming event and - * the signalling manager's state - */ - action = sigmgr_state_table[event][usp->us_state]; - ATM_DEBUG4("unisig_sigmgr_state: usp=%p, state=%d, event=%d, action=%d\n", - usp, usp->us_state, event, action); - if (action >= MAX_ACTION || action < 0) { - panic("unisig_sigmgr_state: invalid action\n"); - } - - /* - * Perform the requested action - */ - err = unisig_sigmgr_act_vec[action](usp, m); - - return(err); -} - - -/* - * Signalling manager state machine action 0 - * - * Invalid action - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_invalid(usp, m) - struct unisig *usp; - KBuffer *m; -{ - log(LOG_ERR, "unisig_sigmgr_state: unexpected action\n"); - if (m) - KB_FREEALL(m); - return(0); -} - - -/* - * Signalling manager state machine action 1 - * - * The kickoff timer has expired at attach time; go to - * UNISIG_ADDR_WAIT state. - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act01(usp, m) - struct unisig *usp; - KBuffer *m; -{ - /* - * Set the new state - */ - usp->us_state = UNISIG_ADDR_WAIT; - - return(0); -} - - -/* - * Signalling manager state machine action 2 - * - * Ignore the event - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act02(usp, m) - struct unisig *usp; - KBuffer *m; -{ - /* - * Ignore event, discard message if present - */ - if (m) - KB_FREEALL(m); - - return(0); -} - - -/* - * Signalling manager state machine action 3 - * - * SSCF session on signalling channel has come up - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act03(usp, m) - struct unisig *usp; - KBuffer *m; -{ - struct unisig_vccb *uvp, *vnext; - - /* - * Log the activation - */ - log(LOG_INFO, "unisig: signalling channel active\n"); - - /* - * Go to ACTIVE state - */ - usp->us_state = UNISIG_ACTIVE; - - /* - * Notify the VC state machine that the channel is up - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); - uvp; uvp = vnext) { - vnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - (void) unisig_vc_state(usp, uvp, UNI_VC_SAAL_ESTAB, - (struct unisig_msg *) 0); - } - - return(0); -} - - -/* - * Signalling manager state machine action 4 - * - * A SSCF release indication was received. Try to establish an - * SSCF session on the signalling PVC. - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act04(usp, m) - struct unisig *usp; - KBuffer *m; -{ - int err; - - /* - * Try to establish an SSCF session. - */ - err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ, - usp->us_conn, - (void *)0); - if (err) - panic("unisig_sigmgr_act04: SSCF_UNI_ESTABLISH_REQ"); - - return(0); -} - - -/* - * Signalling manager state machine action 5 - * - * SSCF session on signalling channel has been reset - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act05(usp, m) - struct unisig *usp; - KBuffer *m; -{ - struct unisig_vccb *uvp, *vnext; - - /* - * Log the reset - */ - log(LOG_INFO, "unisig: signalling channel reset\n"); - - /* - * Notify the VC state machine of the reset - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); - uvp; uvp = vnext) { - vnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - (void) unisig_vc_state(usp, uvp, UNI_VC_SAAL_ESTAB, - (struct unisig_msg *) 0); - } - - return(0); -} - - -/* - * Signalling manager state machine action 6 - * - * SSCF session on signalling channel has been lost - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act06(usp, m) - struct unisig *usp; - KBuffer *m; -{ - struct unisig_vccb *uvp, *vnext; - - /* - * Log the fact that the session has been lost - */ - log(LOG_INFO, "unisig: signalling channel SSCF session lost\n"); - - /* - * Notify the VC state machine of the loss - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); - uvp; uvp = vnext) { - vnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - (void) unisig_vc_state(usp, uvp, UNI_VC_SAAL_FAIL, - (struct unisig_msg *) 0); - } - - /* - * Try to restart the SSCF session - */ - (void) unisig_sigmgr_act04(usp, (KBuffer *) 0); - - /* - * Go to INIT state - */ - usp->us_state = UNISIG_INIT; - - return(0); -} - - -/* - * Signalling manager state machine action 7 - * - * A Q.2931 signalling message has been received - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act07(usp, m) - struct unisig *usp; - KBuffer *m; -{ - int err; - - /* - * Pass the Q.2931 signalling message on - * to the VC state machine - */ - err = unisig_rcv_msg(usp, m); - - return(err); -} - - -/* - * Signalling manager state machine action 8 - * - * Process a CALL_CLOSED event for the signalling PVC - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act08(usp, m) - struct unisig *usp; - KBuffer *m; -{ - - /* - * Signalling manager is now incommunicado - */ - if (usp->us_state != UNISIG_DETACH) { - /* - * Log an error and set the state to NULL if - * we're not detaching - */ - log(LOG_ERR, "unisig: signalling channel closed\n"); - usp->us_state = UNISIG_NULL; - } - usp->us_conn = 0; - - return(0); -} - - -/* - * Signalling manager state machine action 9 - * - * Not used - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act09(usp, m) - struct unisig *usp; - KBuffer *m; -{ - log(LOG_ERR, "unisig_sigmgr_act09: unexpected action\n"); - if (m) - KB_FREEALL(m); - return (0); -} - - -/* - * Signalling manager state machine action 10 - * - * Not used - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act10(usp, m) - struct unisig *usp; - KBuffer *m; -{ - return(0); -} - - -/* - * Signalling manager state machine action 11 - * - * Not used - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act11(usp, m) - struct unisig *usp; - KBuffer *m; -{ - log(LOG_ERR, "unisig_sigmgr_act11: unexpected action\n"); - if (m) - KB_FREEALL(m); - return(0); -} - - -/* - * Signalling manager state machine action 12 - * - * Not used - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act12(usp, m) - struct unisig *usp; - KBuffer *m; -{ - log(LOG_ERR, "unisig_sigmgr_act11: unexpected action\n"); - if (m) - KB_FREEALL(m); - return(0); -} - - -/* - * Signalling manager state machine action 13 - * - * NSAP prefix has been set - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act13(usp, m) - struct unisig *usp; - KBuffer *m; -{ - int err; - Atm_addr_pvc *pvcp; - - /* - * Set UNI signalling channel connection attributes - */ - if (usp->us_proto == ATM_SIG_UNI30) - unisig_attr.api_init = UNI_VERS_3_0; - else - unisig_attr.api_init = UNI_VERS_3_1; - - unisig_attr.nif = usp->us_pif->pif_nif; - - unisig_attr.aal.v.aal5.forward_max_SDU_size = ATM_NIF_MTU; - unisig_attr.aal.v.aal5.backward_max_SDU_size = ATM_NIF_MTU; - unisig_attr.aal.v.aal5.SSCS_type = T_ATM_SSCS_SSCOP_REL; - - unisig_attr.called.tag = T_ATM_PRESENT; - unisig_attr.called.addr.address_format = T_ATM_PVC_ADDR; - unisig_attr.called.addr.address_length = sizeof(Atm_addr_pvc); - pvcp = (Atm_addr_pvc *)unisig_attr.called.addr.address; - ATM_PVC_SET_VPI(pvcp, UNISIG_SIG_VPI); - ATM_PVC_SET_VCI(pvcp, UNISIG_SIG_VCI); - unisig_attr.called.subaddr.address_format = T_ATM_ABSENT; - unisig_attr.called.subaddr.address_length = 0; - - unisig_attr.traffic.v.forward.PCR_all_traffic = - usp->us_pif->pif_pcr; - unisig_attr.traffic.v.backward.PCR_all_traffic = - usp->us_pif->pif_pcr; - - /* - * Create UNISIG signalling channel - */ - err = atm_cm_connect(&unisig_endpt, usp, &unisig_attr, - &usp->us_conn); - if (err) { - return(err); - } - - /* - * Establish the SSCF session - */ - err = atm_cm_saal_ctl(SSCF_UNI_ESTABLISH_REQ, - usp->us_conn, - (void *)0); - if (err) - panic("unisig_sigmgr_act13: SSCF_UNI_ESTABLISH_REQ"); - - /* - * Set the new state - */ - usp->us_state = UNISIG_INIT; - - return(0); -} - - -/* - * Signalling manager state machine action 14 - * - * Process a detach event - * - * Arguments: - * usp pointer to the UNISIG protocol control block - * m buffer pointer (may be NULL) - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_sigmgr_act14(usp, m) - struct unisig *usp; - KBuffer *m; -{ - int err; - struct unisig_vccb *sig_vccb, *uvp, *vnext; - struct atm_pif *pip; - struct t_atm_cause cause; - - /* - * Locate the signalling channel's VCCB - */ - sig_vccb = (struct unisig_vccb *)0; - if (usp->us_conn && usp->us_conn->co_connvc) - sig_vccb = (struct unisig_vccb *) - usp->us_conn->co_connvc->cvc_vcc; - - /* - * Terminate all of our VCCs - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); - uvp; uvp = vnext) { - vnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - - /* - * Don't close the signalling VCC yet - */ - if (uvp == sig_vccb) - continue; - - /* - * Close VCC and notify owner - */ - err = unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - } - - /* - * Close the signalling channel - */ - if (usp->us_conn) { - cause.coding_standard = T_ATM_ITU_CODING; - cause.coding_standard = T_ATM_LOC_USER; - cause.coding_standard = T_ATM_CAUSE_UNSPECIFIED_NORMAL; - err = atm_cm_release(usp->us_conn, &cause); - if (err) - panic("unisig_sigmgr_act14: close failed\n"); - } - - /* - * Get rid of protocol instance if there are no VCCs queued - */ - pip = usp->us_pif; - if (Q_HEAD(usp->us_vccq, struct vccb) == NULL && - pip->pif_sigmgr) { - struct sigmgr *smp = pip->pif_sigmgr; - int s = splimp(); - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - (void) splx(s); - - UNLINK((struct siginst *)usp, struct siginst, - smp->sm_prinst, si_next); - free(usp, M_DEVBUF); - } else { - /* - * Otherwise, set new signalling manager state and - * wait for protocol instance to be freed during - * unisig_free processing for the last queued VCC - */ - usp->us_state = UNISIG_DETACH; - } - - return (0); -} Property changes on: head/sys/netatm/uni/unisig_sigmgr_state.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp_input.c =================================================================== --- head/sys/netatm/uni/uniarp_input.c (revision 179307) +++ head/sys/netatm/uni/uniarp_input.c (nonexistent) @@ -1,862 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - Input packet processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static void proc_arp_req(struct ipvcc *, KBuffer *); -static void proc_arp_rsp(struct ipvcc *, KBuffer *); -static void proc_arp_nak(struct ipvcc *, KBuffer *); -static void proc_inarp_req(struct ipvcc *, KBuffer *); -static void proc_inarp_rsp(struct ipvcc *, KBuffer *); - - -/* - * Local variables - */ -static Atm_addr satm; -static Atm_addr satmsub; -static Atm_addr tatm; -static Atm_addr tatmsub; -static struct in_addr sip; -static struct in_addr tip; - - -/* - * Process ATMARP Input Data - * - * Arguments: - * tok uniarp connection token (pointer to ipvcc) - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -void -uniarp_cpcs_data(tok, m) - void *tok; - KBuffer *m; -{ - struct ipvcc *ivp = tok; - struct atmarp_hdr *ahp; - KBuffer *n; - int len, plen = sizeof(struct atmarp_hdr); - - if (uniarp_print) - uniarp_pdu_print(ivp, m, "receive"); - - /* - * Verify IP's VCC state - */ - if (ivp->iv_state != IPVCC_ACTIVE) { - goto bad; - } - - /* - * Get the fixed fields together - */ - if (KB_LEN(m) < sizeof(struct atmarp_hdr)) { - KB_PULLUP(m, sizeof(struct atmarp_hdr), m); - if (m == NULL) - goto bad; - } - - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Initial packet verification - */ - if ((ahp->ah_hrd != htons(ARP_ATMFORUM)) || - (ahp->ah_pro != htons(ETHERTYPE_IP))) - goto bad; - - /* - * Verify/gather source address fields - */ - if ((len = (ahp->ah_shtl & ARP_TL_LMASK)) != 0) { - if (ahp->ah_shtl & ARP_TL_E164) { - if (len > sizeof(struct atm_addr_e164)) - goto bad; - satm.address_format = T_ATM_E164_ADDR; - } else { - if (len != sizeof(struct atm_addr_nsap)) - goto bad; - satm.address_format = T_ATM_ENDSYS_ADDR; - } - satm.address_length = len; - if (KB_COPYDATA(m, plen, len, (caddr_t)satm.address)) - goto bad; - plen += len; - } else { - satm.address_format = T_ATM_ABSENT; - satm.address_length = 0; - } - - if ((len = (ahp->ah_sstl & ARP_TL_LMASK)) != 0) { - if (((ahp->ah_sstl & ARP_TL_TMASK) != ARP_TL_NSAPA) || - (len != sizeof(struct atm_addr_nsap))) - goto bad; - satmsub.address_format = T_ATM_ENDSYS_ADDR; - satmsub.address_length = len; - if (KB_COPYDATA(m, plen, len, (caddr_t)satmsub.address)) - goto bad; - plen += len; - } else { - satmsub.address_format = T_ATM_ABSENT; - satmsub.address_length = 0; - } - - if ((len = ahp->ah_spln) != 0) { - if (len != sizeof(struct in_addr)) - goto bad; - if (KB_COPYDATA(m, plen, len, (caddr_t)&sip)) - goto bad; - plen += len; - } else { - sip.s_addr = 0; - } - - /* - * Verify/gather target address fields - */ - if ((len = (ahp->ah_thtl & ARP_TL_LMASK)) != 0) { - if (ahp->ah_thtl & ARP_TL_E164) { - if (len > sizeof(struct atm_addr_e164)) - goto bad; - tatm.address_format = T_ATM_E164_ADDR; - } else { - if (len != sizeof(struct atm_addr_nsap)) - goto bad; - tatm.address_format = T_ATM_ENDSYS_ADDR; - } - tatm.address_length = len; - if (KB_COPYDATA(m, plen, len, (caddr_t)tatm.address)) - goto bad; - plen += len; - } else { - tatm.address_format = T_ATM_ABSENT; - tatm.address_length = 0; - } - - if ((len = (ahp->ah_tstl & ARP_TL_LMASK)) != 0) { - if (((ahp->ah_tstl & ARP_TL_TMASK) != ARP_TL_NSAPA) || - (len != sizeof(struct atm_addr_nsap))) - goto bad; - tatmsub.address_format = T_ATM_ENDSYS_ADDR; - tatmsub.address_length = len; - if (KB_COPYDATA(m, plen, len, (caddr_t)tatmsub.address)) - goto bad; - plen += len; - } else { - tatmsub.address_format = T_ATM_ABSENT; - tatmsub.address_length = 0; - } - - if ((len = ahp->ah_tpln) != 0) { - if (len != sizeof(struct in_addr)) - goto bad; - if (KB_COPYDATA(m, plen, len, (caddr_t)&tip)) - goto bad; - plen += len; - } else { - tip.s_addr = 0; - } - - /* - * Verify packet length - */ - for (len = 0, n = m; n; n = KB_NEXT(n)) - len += KB_LEN(n); - if (len != plen) - goto bad; - - /* - * Now finish with packet-specific processing - */ - switch (ntohs(ahp->ah_op)) { - case ARP_REQUEST: - proc_arp_req(ivp, m); - break; - - case ARP_REPLY: - proc_arp_rsp(ivp, m); - break; - - case INARP_REQUEST: - proc_inarp_req(ivp, m); - break; - - case INARP_REPLY: - proc_inarp_rsp(ivp, m); - break; - - case ARP_NAK: - proc_arp_nak(ivp, m); - break; - - default: - goto bad; - } - - return; - -bad: - uniarp_stat.uas_rcvdrop++; - if (m) - KB_FREEALL(m); -} - - -/* - * Process an ATMARP request packet - * - * Arguments: - * ivp pointer to input VCC's IPVCC control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -proc_arp_req(ivp, m) - struct ipvcc *ivp; - KBuffer *m; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct uniip *uip; - struct uniarp *uap; - struct in_addr myip; - int s = splnet(); - - /* - * Only an arp server should receive these - */ - inp = ivp->iv_ipnif; - nip = inp->inf_nif; - uip = (struct uniip *)inp->inf_isintf; - if ((uip == NULL) || - (uip->uip_arpstate != UIAS_SERVER_ACTIVE)) - goto drop; - - /* - * These should be sent only on SVCs - */ - if ((ivp->iv_flags & IVF_SVC) == 0) - goto drop; - - /* - * Locate our addresses - */ - sgp = nip->nif_pif->pif_siginst; - myip.s_addr = IA_SIN(inp->inf_addr)->sin_addr.s_addr; - - /* - * Target IP address must be present - */ - if (tip.s_addr == 0) - goto drop; - - /* - * Drop packet if both Source addresses aren't present - */ - if ((sip.s_addr == 0) || (satm.address_format == T_ATM_ABSENT)) - goto drop; - - /* - * Source addresses can't be ours - */ - if (ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &satm) && - ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &satmsub)) { - struct vccb *vcp = ivp->iv_conn->co_connvc->cvc_vcc; - - log(LOG_WARNING, - "uniarp: vcc=(%d,%d) reports our ATM address\n", - vcp->vc_vpi, vcp->vc_vci); - goto drop; - } - if (sip.s_addr == myip.s_addr) { - struct vccb *vcp = ivp->iv_conn->co_connvc->cvc_vcc; - - log(LOG_WARNING, - "uniarp: vcc=(%d,%d) reports our IP address\n", - vcp->vc_vpi, vcp->vc_vci); - goto drop; - } - - /* - * Validate Source IP address - */ - if (uniarp_validate_ip(uip, &sip, UAO_REGISTER) != 0) - goto drop; - - /* - * If the source and target IP addresses are the same, then this - * must be a client registration request (RFC-2225). Otherwise, - * try to accomodate old clients (per RFC-2225 8.4.4). - */ - if (sip.s_addr == tip.s_addr) - (void) uniarp_cache_svc(uip, &sip, &satm, &satmsub, - UAO_REGISTER); - else { - uap = (struct uniarp *)ivp->iv_arpent; - if ((uap == NULL) || (uap->ua_origin < UAO_REGISTER)) - (void) uniarp_cache_svc(uip, &sip, &satm, &satmsub, - UAO_REGISTER); - } - - /* - * Lookup the target IP address in the cache (and also check if - * the query is for our address). - */ - UNIARP_LOOKUP(tip.s_addr, uap); - if (uap && (uap->ua_flags & UAF_VALID)) { - /* - * We've found a valid mapping - */ - (void) uniarp_arp_rsp(uip, &uap->ua_arpmap, &sip, &satm, - &satmsub, ivp); - - } else if (tip.s_addr == myip.s_addr) { - /* - * We're the target, so respond accordingly - */ - (void) uniarp_arp_rsp(uip, &uip->uip_arpsvrmap, &sip, &satm, - &satmsub, ivp); - - } else { - /* - * We don't know who the target is, so NAK the query - */ - (void) uniarp_arp_nak(uip, m, ivp); - m = NULL; - } - -drop: - (void) splx(s); - if (m) - KB_FREEALL(m); - return; -} - - -/* - * Process an ATMARP reply packet - * - * Arguments: - * ivp pointer to input VCC's IPVCC control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -proc_arp_rsp(ivp, m) - struct ipvcc *ivp; - KBuffer *m; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct uniip *uip; - struct uniarp *uap; - struct in_addr myip; - int s = splnet(); - - /* - * Only the arp server should send these - */ - inp = ivp->iv_ipnif; - nip = inp->inf_nif; - uip = (struct uniip *)inp->inf_isintf; - if ((uip == NULL) || - (uip->uip_arpsvrvcc != ivp)) - goto drop; - - /* - * Locate our addresses - */ - sgp = nip->nif_pif->pif_siginst; - myip.s_addr = IA_SIN(inp->inf_addr)->sin_addr.s_addr; - - /* - * Target addresses must be ours - */ - if ((tip.s_addr != myip.s_addr) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &tatm) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &tatmsub)) - goto drop; - - /* - * Drop packet if both Source addresses aren't present - */ - if ((sip.s_addr == 0) || (satm.address_format == T_ATM_ABSENT)) - goto drop; - - /* - * If the Source addresses are ours, this is an arp server - * registration response - */ - if (ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &satm) && - ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &satmsub)) { - if (sip.s_addr == myip.s_addr) { - /* - * Registration response - update our state and - * set a registration refresh timer - */ - if (uip->uip_arpstate == UIAS_CLIENT_REGISTER) - uip->uip_arpstate = UIAS_CLIENT_ACTIVE; - - if (uip->uip_arpstate == UIAS_CLIENT_ACTIVE) { - UNIIP_ARP_CANCEL(uip); - UNIIP_ARP_TIMER(uip, UNIARP_REGIS_REFRESH); - } - - /* - * If the cache entry for the server VCC isn't valid - * yet, then send an Inverse ATMARP request to solicit - * the server's IP address - */ - uap = (struct uniarp *)ivp->iv_arpent; - if ((uap->ua_flags & UAF_VALID) == 0) { - (void) uniarp_inarp_req(uip, &uap->ua_dstatm, - &uap->ua_dstatmsub, ivp); - } - goto drop; - } else { - log(LOG_WARNING, - "uniarp: arpserver has our IP address wrong\n"); - goto drop; - } - } else if (sip.s_addr == myip.s_addr) { - log(LOG_WARNING, - "uniarp: arpserver has our ATM address wrong\n"); - goto drop; - } - - /* - * Validate the Source IP address - */ - if (uniarp_validate_ip(uip, &sip, UAO_LOOKUP) != 0) - goto drop; - - /* - * Now we believe this packet contains an authoritative mapping, - * which we probably need to setup an outgoing SVC connection - */ - (void) uniarp_cache_svc(uip, &sip, &satm, &satmsub, UAO_LOOKUP); - -drop: - (void) splx(s); - KB_FREEALL(m); - return; -} - - -/* - * Process an ATMARP negative ack packet - * - * Arguments: - * ivp pointer to input VCC's IPVCC control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -proc_arp_nak(ivp, m) - struct ipvcc *ivp; - KBuffer *m; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct uniip *uip; - struct uniarp *uap; - struct in_addr myip; - struct ipvcc *inext; - int s = splnet(); - - /* - * Only the arp server should send these - */ - inp = ivp->iv_ipnif; - nip = inp->inf_nif; - uip = (struct uniip *)inp->inf_isintf; - if ((uip == NULL) || - (uip->uip_arpsvrvcc != ivp)) - goto drop; - - /* - * Locate our addresses - */ - sgp = nip->nif_pif->pif_siginst; - myip.s_addr = IA_SIN(inp->inf_addr)->sin_addr.s_addr; - - /* - * Source addresses must be ours - */ - if ((sip.s_addr != myip.s_addr) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &satm) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &satmsub)) - goto drop; - - /* - * Drop packet if the Target IP address isn't there or if this - * is a registration response, indicating an old or flakey server - */ - if ((tip.s_addr == 0) || (tip.s_addr == myip.s_addr)) - goto drop; - - /* - * Otherwise, see who we were looking for - */ - UNIARP_LOOKUP(tip.s_addr, uap); - if (uap == NULL) - goto drop; - - /* - * This entry isn't valid any longer, so notify all VCCs using this - * entry that they must finish up. The last notify should cause - * this entry to be freed by the vcclose() function. - */ - uap->ua_flags &= ~UAF_VALID; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_FAILED); - } - -drop: - (void) splx(s); - KB_FREEALL(m); - return; -} - - -/* - * Process an InATMARP request packet - * - * Arguments: - * ivp pointer to input VCC's IPVCC control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -proc_inarp_req(ivp, m) - struct ipvcc *ivp; - KBuffer *m; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct uniip *uip; - struct in_addr myip; - int s = splnet(); - - /* - * Get interface pointers - */ - inp = ivp->iv_ipnif; - nip = inp->inf_nif; - uip = (struct uniip *)inp->inf_isintf; - if (uip == NULL) - goto drop; - - /* - * Locate our addresses - */ - sgp = nip->nif_pif->pif_siginst; - myip.s_addr = IA_SIN(inp->inf_addr)->sin_addr.s_addr; - - /* - * Packet must have a Source IP address and, if it was received - * over an SVC, a Source ATM address too. - */ - if ((sip.s_addr == 0) || - ((ivp->iv_flags & IVF_SVC) && (satm.address_format == T_ATM_ABSENT))) - goto drop; - - /* - * Validate Source ATM address - * - can't be me - */ - if (satm.address_format != T_ATM_ABSENT) { - if (ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &satm) && - ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, - &satmsub)) - goto drop; - } - - /* - * Validate Source IP address - */ - if ((sip.s_addr == myip.s_addr) || - (uniarp_validate_ip(uip, &sip, UAO_PEER_REQ) != 0)) - goto drop; - - /* - * The Target ATM address is required for a packet received over - * an SVC, optional for a PVC. If one is present, it must be our - * address. - */ - if ((ivp->iv_flags & IVF_SVC) && (tatm.address_format == T_ATM_ABSENT)) - goto drop; - if ((tatm.address_format != T_ATM_ABSENT) && - (!ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &tatm) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &tatmsub))) - goto drop; - - /* - * See where this packet is from - */ - if (ivp->iv_flags & IVF_PVC) { - /* - * Process the PVC arp data, although we don't really - * update the arp cache with this information - */ - uniarp_cache_pvc(ivp, &sip, &satm, &satmsub); - - } else if (uip->uip_arpsvrvcc == ivp) { - /* - * Packet is from the arp server, so we've received a - * registration/refresh request (1577 version). - * - * Therefore, update cache with authoritative data. - */ - (void) uniarp_cache_svc(uip, &sip, &satm, &satmsub, UAO_LOOKUP); - - /* - * Make sure the cache update didn't kill the server VCC - */ - if (uip->uip_arpsvrvcc != ivp) - goto drop; - - /* - * Update the server state and set the - * registration refresh timer - */ - uip->uip_arpstate = UIAS_CLIENT_ACTIVE; - UNIIP_ARP_CANCEL(uip); - UNIIP_ARP_TIMER(uip, UNIARP_REGIS_REFRESH); - } else { - /* - * Otherwise, we consider this source mapping data as - * non-authoritative and update the cache appropriately - */ - if (uniarp_cache_svc(uip, &sip, &satm, &satmsub, UAO_PEER_REQ)) - goto drop; - } - - /* - * Send an InATMARP response back to originator - */ - (void) uniarp_inarp_rsp(uip, &sip, &satm, &satmsub, ivp); - -drop: - (void) splx(s); - KB_FREEALL(m); - return; -} - - -/* - * Process an InATMARP response packet - * - * Arguments: - * ivp pointer to input VCC's IPVCC control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -proc_inarp_rsp(ivp, m) - struct ipvcc *ivp; - KBuffer *m; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct uniip *uip; - struct in_addr myip; - int s = splnet(); - - /* - * Get interface pointers - */ - inp = ivp->iv_ipnif; - nip = inp->inf_nif; - uip = (struct uniip *)inp->inf_isintf; - if (uip == NULL) - goto drop; - - /* - * Locate our addresses - */ - sgp = nip->nif_pif->pif_siginst; - myip.s_addr = IA_SIN(inp->inf_addr)->sin_addr.s_addr; - - /* - * Packet must have a Source IP address and, if it was received - * over an SVC, a Source ATM address too. - */ - if ((sip.s_addr == 0) || - ((ivp->iv_flags & IVF_SVC) && (satm.address_format == T_ATM_ABSENT))) - goto drop; - - /* - * Validate Source ATM address - * - can't be me - */ - if (satm.address_format != T_ATM_ABSENT) { - if (ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &satm) && - ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, - &satmsub)) - goto drop; - } - - /* - * Validate Source IP address - * - must be in our LIS - * - can't be me - * - can't be broadcast - * - can't be multicast - */ - if ((sip.s_addr == myip.s_addr) || - (uniarp_validate_ip(uip, &sip, UAO_PEER_RSP) != 0)) - goto drop; - - /* - * The Target ATM address is required for a packet received over - * an SVC, optional for a PVC. If one is present, it must be our - * address. - */ - if ((ivp->iv_flags & IVF_SVC) && (tatm.address_format == T_ATM_ABSENT)) - goto drop; - if ((tatm.address_format != T_ATM_ABSENT) && - (!ATM_ADDR_SEL_EQUAL(&sgp->si_addr, nip->nif_sel, &tatm) || - !ATM_ADDR_SEL_EQUAL(&sgp->si_subaddr, nip->nif_sel, &tatmsub))) - goto drop; - - /* - * See where this packet is from - */ - if (ivp->iv_flags & IVF_PVC) { - /* - * Process the PVC arp data, although we don't really - * update the arp cache with this information - */ - uniarp_cache_pvc(ivp, &sip, &satm, &satmsub); - - } else { - /* - * Can't tell the difference between an RFC-1577 registration - * and a data connection from a client of another arpserver - * on our LIS (using SCSP) - so we'll update the cache now - * with what we've got. Our clients will get "registered" - * when (if) they query us with an arp request. - */ - (void) uniarp_cache_svc(uip, &sip, &satm, &satmsub, - UAO_PEER_RSP); - } - -drop: - (void) splx(s); - KB_FREEALL(m); - return; -} - - -/* - * Print an ATMARP PDU - * - * Arguments: - * ivp pointer to input VCC control block - * m pointer to pdu buffer chain - * msg pointer to message string - * - * Returns: - * none - * - */ -void -uniarp_pdu_print(const struct ipvcc *ivp, const KBuffer *m, const char *msg) -{ - char buf[128]; - struct vccb *vcp; - - vcp = ivp->iv_conn->co_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), - "uniarp %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); - atm_pdu_print(m, buf); -} Property changes on: head/sys/netatm/uni/uniarp_input.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp_vcm.c =================================================================== --- head/sys/netatm/uni/uniarp_vcm.c (revision 179307) +++ head/sys/netatm/uni/uniarp_vcm.c (nonexistent) @@ -1,723 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - Virtual Channel Management - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -extern uma_zone_t unisig_vc_zone; - -/* - * Local variables - */ -static struct attr_llc uniarp_llc = { - T_ATM_PRESENT, - { - T_ATM_LLC_SHARING, - 8, - {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x08, 0x06} - } -}; - -static struct t_atm_cause uniarp_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_TEMPORARY_FAILURE, - {0, 0, 0, 0} -}; - - -/* - * Process a new PVC requiring ATMARP support - * - * This function is called after IP/ATM has successfully opened a PVC which - * requires ATMARP support. We will send an InATMARP request over the PVC - * to elicit a response from the PVC's ATMARP peer informing us of its - * network address. This information will also be used by IP/ATM in order - * to complete its address-to-VC mapping table. - * - * Arguments: - * ivp pointer to PVC's IPVCC control block - * - * Returns: - * MAP_PROCEEDING - OK so far, querying for peer's mapping - * MAP_FAILED - error, unable to allocate resources - * - */ -int -uniarp_pvcopen(ivp) - struct ipvcc *ivp; -{ - struct uniip *uip; - struct uniarp *uap; - int s, err; - - ATM_DEBUG1("uniarp_pvcopen: ivp=%p\n", ivp); - - ivp->iv_arpent = NULL; - - /* - * Check things out - */ - if ((ivp->iv_flags & IVF_LLC) == 0) - return (MAP_FAILED); - - /* - * Get uni interface - */ - uip = (struct uniip *)ivp->iv_ipnif->inf_isintf; - if (uip == NULL) - return (MAP_FAILED); - - /* - * Get an arp map entry - */ - uap = uma_zalloc(uniarp_zone, M_WAITOK | M_ZERO); - if (uap == NULL) - return (MAP_FAILED); - - /* - * Create our CM connection - */ - err = atm_cm_addllc(&uniarp_endpt, ivp, &uniarp_llc, - ivp->iv_conn, &ivp->iv_arpconn); - if (err) { - /* - * We don't take no (or maybe) for an answer - */ - if (ivp->iv_arpconn) { - (void) atm_cm_release(ivp->iv_arpconn, &uniarp_cause); - ivp->iv_arpconn = NULL; - } - uma_zfree(uniarp_zone, uap); - return (MAP_FAILED); - } - - /* - * Get map entry set up - */ - s = splnet(); - uap->ua_dstatm.address_format = T_ATM_ABSENT; - uap->ua_dstatmsub.address_format = T_ATM_ABSENT; - uap->ua_intf = uip; - - /* - * Put ivp on arp entry chain - */ - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - - /* - * Put arp entry on pvc chain - */ - LINK2TAIL(uap, struct uniarp, uniarp_pvctab, ua_next); - - /* - * Send Inverse ATMARP request - */ - (void) uniarp_inarp_req(uip, &uap->ua_dstatm, &uap->ua_dstatmsub, ivp); - - /* - * Start resend timer - */ - uap->ua_aging = UNIARP_REVALID_AGE; - - (void) splx(s); - return (MAP_PROCEEDING); -} - - -/* - * Process a new outgoing SVC requiring ATMARP support - * - * This function is called by the IP/ATM module to resolve a destination - * IP address to an ATM address in order to open an SVC to that destination. - * If a valid mapping is already in our cache, then we just tell the caller - * about it and that's that. Otherwise, we have to allocate a new arp entry - * and issue a query for the mapping. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * dst pointer to destination IP address - * - * Returns: - * MAP_VALID - Got the answer, returned via iv_arpent field. - * MAP_PROCEEDING - OK so far, querying for peer's mapping - * MAP_FAILED - error, unable to allocate resources - * - */ -int -uniarp_svcout(ivp, dst) - struct ipvcc *ivp; - struct in_addr *dst; -{ - struct uniip *uip; - struct uniarp *uap; - int s = splnet(); - - ATM_DEBUG2("uniarp_svcout: ivp=%p,dst=0x%x\n", ivp, dst->s_addr); - - ivp->iv_arpent = NULL; - - /* - * Get uni interface - */ - uip = (struct uniip *)ivp->iv_ipnif->inf_isintf; - if (uip == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Lookup IP destination address - */ - UNIARP_LOOKUP(dst->s_addr, uap); - - if (uap) { - /* - * We've got an entry, verify interface - */ - if (uap->ua_intf != uip) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Chain this vcc onto entry - */ - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - uap->ua_flags |= UAF_USED; - - if (uap->ua_flags & UAF_VALID) { - /* - * Entry is valid, we're done - */ - (void) splx(s); - return (MAP_VALID); - } else { - /* - * We're already looking for this address - */ - (void) splx(s); - return (MAP_PROCEEDING); - } - } - - /* - * No info in the cache. If we're the server, then - * we're already authoritative, so just deny request. - * If we're a client but the server VCC isn't open we - * also deny the request. - */ - if (uip->uip_arpstate != UIAS_CLIENT_ACTIVE) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * We're a client with an open VCC to the server, get a new arp entry - * May be called from timeout - don't wait. - */ - uap = uma_zalloc(uniarp_zone, M_NOWAIT); - if (uap == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Get entry set up - */ - uap->ua_dstip.s_addr = dst->s_addr; - uap->ua_dstatm.address_format = T_ATM_ABSENT; - uap->ua_dstatm.address_length = 0; - uap->ua_dstatmsub.address_format = T_ATM_ABSENT; - uap->ua_dstatmsub.address_length = 0; - uap->ua_intf = uip; - - /* - * Link ipvcc to arp entry for later notification - */ - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - uap->ua_flags |= UAF_USED; - - /* - * Add arp entry to table - */ - UNIARP_ADD(uap); - - /* - * Issue arp request for this address - */ - (void) uniarp_arp_req(uip, dst); - - /* - * Start retry timer - */ - UNIARP_TIMER(uap, UNIARP_ARP_RETRY); - - (void) splx(s); - return (MAP_PROCEEDING); -} - - -/* - * Process a new incoming SVC requiring ATMARP support - * - * This function is called by the IP/ATM module to resolve a caller's ATM - * address to its IP address for an incoming call in order to allow a - * bi-directional flow of IP packets on the SVC. If a valid mapping is - * already in our cache, then we will use it. Otherwise, we have to allocate - * a new arp entry and wait for the SVC to become active so that we can issue - * an InATMARP to the peer. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * dst pointer to caller's ATM address - * dstsub pointer to caller's ATM subaddress - * - * Returns: - * MAP_VALID - Got the answer, returned via iv_arpent field. - * MAP_PROCEEDING - OK so far, querying for peer's mapping - * MAP_FAILED - error, unable to allocate resources - * - */ -int -uniarp_svcin(ivp, dst, dstsub) - struct ipvcc *ivp; - Atm_addr *dst; - Atm_addr *dstsub; -{ - struct uniip *uip; - struct uniarp *uap; - int found = 0, i, s = splnet(); - - ATM_DEBUG1("uniarp_svcin: ivp=%p\n", ivp); - - /* - * Clear ARP entry field - */ - ivp->iv_arpent = NULL; - - /* - * Check things out - */ - if ((ivp->iv_flags & IVF_LLC) == 0) - return (MAP_FAILED); - - /* - * Get uni interface - */ - uip = (struct uniip *)ivp->iv_ipnif->inf_isintf; - if (uip == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Make sure we're configured as a client or server - */ - if (uip->uip_arpstate == UIAS_NOTCONF) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * If we know the caller's ATM address, look it up - */ - uap = NULL; - if (dst->address_format != T_ATM_ABSENT) { - for (i = 0; (i < UNIARP_HASHSIZ) && (found == 0); i++) { - for (uap = uniarp_arptab[i]; uap; uap = uap->ua_next) { - if (ATM_ADDR_EQUAL(dst, &uap->ua_dstatm) && - ATM_ADDR_EQUAL(dstsub, &uap->ua_dstatmsub)){ - found = 1; - break; - } - } - } - if (uap == NULL) { - for (uap = uniarp_nomaptab; uap; uap = uap->ua_next) { - if (ATM_ADDR_EQUAL(dst, &uap->ua_dstatm) && - ATM_ADDR_EQUAL(dstsub, &uap->ua_dstatmsub)) - break; - } - } - } - - if (uap) { - /* - * We've got an entry, verify interface - */ - if (uap->ua_intf != uip) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Chain the vcc onto this entry - */ - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - uap->ua_flags |= UAF_USED; - - if (uap->ua_flags & UAF_VALID) { - /* - * Entry is valid, we're done - */ - (void) splx(s); - return (MAP_VALID); - } else { - /* - * We're already looking for this address - */ - (void) splx(s); - return (MAP_PROCEEDING); - } - } - - /* - * No info in the cache - get a new arp entry - * May be called from timeout - don't wait. - */ - uap = uma_zalloc(uniarp_zone, M_NOWAIT | M_ZERO); - if (uap == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Get entry set up - */ - ATM_ADDR_COPY(dst, &uap->ua_dstatm); - ATM_ADDR_COPY(dstsub, &uap->ua_dstatmsub); - uap->ua_intf = uip; - - /* - * Link ipvcc to arp entry for later notification - */ - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - uap->ua_flags |= UAF_USED; - - /* - * Add arp entry to 'nomap' table - */ - LINK2TAIL(uap, struct uniarp, uniarp_nomaptab, ua_next); - - (void) splx(s); - - /* - * Now we just wait for SVC to become active - */ - return (MAP_PROCEEDING); -} - - -/* - * Process ARP SVC activation notification - * - * This function is called by the IP/ATM module whenever a previously - * opened SVC has successfully been connected. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * - * Returns: - * 0 activation processing successful - * errno activation failed - reason indicated - * - */ -int -uniarp_svcactive(ivp) - struct ipvcc *ivp; -{ - struct ip_nif *inp; - struct uniip *uip; - struct uniarp *uap; - int err, s = splnet(); - - ATM_DEBUG1("uniarp_svcactive: ivp=%p\n", ivp); - - inp = ivp->iv_ipnif; - uip = (struct uniip *)inp->inf_isintf; - uap = (struct uniarp *)ivp->iv_arpent; - - /* - * First, we need to create our CM connection - */ - err = atm_cm_addllc(&uniarp_endpt, ivp, &uniarp_llc, - ivp->iv_conn, &ivp->iv_arpconn); - if (err) { - /* - * We don't take no (or maybe) for an answer - */ - if (ivp->iv_arpconn) { - (void) atm_cm_release(ivp->iv_arpconn, &uniarp_cause); - ivp->iv_arpconn = NULL; - } - return (err); - } - - /* - * Is this the client->server vcc?? - */ - if (uip->uip_arpsvrvcc == ivp) { - - /* - * Yep, go into the client registration phase - */ - uip->uip_arpstate = UIAS_CLIENT_REGISTER; - - /* - * To register ourselves, RFC1577 says we should wait - * around for the server to send us an InATMARP_Request. - * However, draft-1577+ just has us send an ATMARP_Request - * for our own address. To keep everyone happy, we'll go - * with both and see what works! - */ - (void) uniarp_arp_req(uip, &(IA_SIN(inp->inf_addr)->sin_addr)); - - /* - * Start retry timer - */ - UNIIP_ARP_TIMER(uip, 1 * ATM_HZ); - - (void) splx(s); - return (0); - } - - /* - * Send an InATMARP_Request on this VCC to find out/notify who's at - * the other end. If we're the server, this will start off the - * RFC1577 registration procedure. If we're a client, then this - * SVC is for user data and it's pretty likely that both ends are - * going to be sending packets. So, if we're the caller, we'll be - * nice and let the callee know right away who we are. If we're the - * callee, let's find out asap the caller's IP address. - */ - (void) uniarp_inarp_req(uip, &uap->ua_dstatm, &uap->ua_dstatmsub, ivp); - - /* - * Start retry timer if entry isn't valid yet - */ - if (((uap->ua_flags & UAF_VALID) == 0) && - ((uap->ua_time.ti_flag & TIF_QUEUED) == 0)) - UNIARP_TIMER(uap, UNIARP_ARP_RETRY); - - (void) splx(s); - return (0); -} - - -/* - * Process VCC close - * - * This function is called just prior to IP/ATM closing a VCC which - * supports ATMARP. We'll sever our links to the VCC and then - * figure out how much more cleanup we need to do for now. - * - * Arguments: - * ivp pointer to VCC's IPVCC control block - * - * Returns: - * none - * - */ -void -uniarp_vcclose(ivp) - struct ipvcc *ivp; -{ - struct uniip *uip; - struct uniarp *uap; - int s; - - ATM_DEBUG1("uniarp_vcclose: ivp=%p\n", ivp); - - /* - * Close our CM connection - */ - if (ivp->iv_arpconn) { - (void) atm_cm_release(ivp->iv_arpconn, &uniarp_cause); - ivp->iv_arpconn = NULL; - } - - /* - * Get atmarp entry - */ - if ((uap = (struct uniarp *)ivp->iv_arpent) == NULL) - return; - uip = uap->ua_intf; - - s = splnet(); - - /* - * If this is the arpserver VCC, then schedule ourselves to - * reopen the connection soon - */ - if (uip->uip_arpsvrvcc == ivp) { - uip->uip_arpsvrvcc = NULL; - uip->uip_arpstate = UIAS_CLIENT_POPEN; - UNIIP_ARP_CANCEL(uip); - UNIIP_ARP_TIMER(uip, 5 * ATM_HZ); - } - - /* - * Remove IP VCC from chain - */ - UNLINK(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - - /* - * SVCs and PVCs are handled separately - */ - if (ivp->iv_flags & IVF_SVC) { - /* - * If the mapping is currently valid or in use, or if there - * are other VCCs still using this mapping, we're done for now - */ - if ((uap->ua_flags & (UAF_VALID | UAF_LOCKED)) || - (uap->ua_origin >= UAO_PERM) || - (uap->ua_ivp != NULL)) { - (void) splx(s); - return; - } - - /* - * Unlink the entry - */ - if (uap->ua_dstip.s_addr == 0) { - UNLINK(uap, struct uniarp, uniarp_nomaptab, ua_next); - } else { - UNIARP_DELETE(uap); - } - } else { - /* - * Remove entry from pvc table - */ - UNLINK(uap, struct uniarp, uniarp_pvctab, ua_next); - } - - UNIARP_CANCEL(uap); - - /* - * Finally, free the entry - */ - uma_zfree(uniarp_zone, uap); - (void) splx(s); - return; -} - - -/* - * Process ATMARP VCC Connected Notification - * - * Arguments: - * toku owner's connection token (ipvcc protocol block) - * - * Returns: - * none - * - */ -void -uniarp_connected(toku) - void *toku; -{ - - /* - * Since we only do atm_cm_addllc()'s on active connections, - * we should never get called here... - */ - panic("uniarp_connected"); -} - - -/* - * Process ATMARP VCC Cleared Notification - * - * Arguments: - * toku owner's connection token (ipvcc protocol block) - * cause pointer to cause code - * - * Returns: - * none - * - */ -void -uniarp_cleared(toku, cause) - void *toku; - struct t_atm_cause *cause; -{ - struct ipvcc *ivp = toku; - int s; - - s = splnet(); - - /* - * We're done with VCC - */ - ivp->iv_arpconn = NULL; - - /* - * If IP is finished with VCC, then we'll free it - */ - if (ivp->iv_state == IPVCC_FREE) - uma_zfree(unisig_vc_zone, ivp); - (void) splx(s); -} - Property changes on: head/sys/netatm/uni/uniarp_vcm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_subr.c =================================================================== --- head/sys/netatm/uni/sscop_subr.c (revision 179307) +++ head/sys/netatm/uni/sscop_subr.c (nonexistent) @@ -1,982 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP - Subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static int sscop_proc_xmit(struct sscop *); - - -/* - * Get Next Element from STAT PDU - * - * Arguments: - * m pointer to current buffer in STAT PDU - * pelem pointer to location to store element value - * - * Returns: - * addr pointer to updated current buffer in STAT PDU - * - */ -KBuffer * -sscop_stat_getelem(m, pelem) - KBuffer *m; - sscop_seq *pelem; -{ - caddr_t cp; - - /* - * Get to start of element - * - * Note that we always ensure that the current buffer has - * at least one byte of the next element. - */ - KB_DATASTART(m, cp, caddr_t); - - /* - * See how much of element is in this buffer - */ - if (KB_LEN(m) >= sizeof(sscop_seq)) { - /* - * Get element from this buffer - */ - if ((intptr_t)cp & (sizeof(sscop_seq) - 1)) - bcopy(cp, (caddr_t)pelem, sizeof(sscop_seq)); - else - *pelem = *(sscop_seq *)cp; - - /* - * Update buffer controls - */ - KB_HEADADJ(m, -sizeof(sscop_seq)); - } else { - /* - * Get element split between two buffers - */ - int i, j; - - /* - * Copy what's in this buffer - */ - i = KB_LEN(m); - bcopy(cp, (caddr_t)pelem, i); - KB_LEN(m) = 0; - - /* - * Now get to next buffer - */ - while (m && (KB_LEN(m) == 0)) - m = KB_NEXT(m); - - /* - * And copy remainder of element - */ - j = sizeof(sscop_seq) - i; - KB_DATASTART(m, cp, caddr_t); - bcopy(cp, (caddr_t)pelem + i, j); - - /* - * Update buffer controls - */ - KB_HEADADJ(m, -j); - } - - /* - * Put element (sequence number) into host order - */ - *pelem = ntohl(*pelem); - - /* - * Get pointers set for next call - */ - while (m && (KB_LEN(m) == 0)) - m = KB_NEXT(m); - - return (m); -} - - -/* - * Locate SD PDU on Pending Ack Queue - * - * Arguments: - * sop pointer to sscop connection block - * seq sequence number of PDU to locate - * - * Returns: - * addr pointer to located PDU header - * 0 SD PDU sequence number not found - * - */ -struct pdu_hdr * -sscop_pack_locate(sop, seq) - struct sscop *sop; - sscop_seq seq; -{ - struct pdu_hdr *php; - - /* - * Loop thru queue until we either find the PDU or the queue's - * sequence numbers are greater than the PDU's sequence number, - * indicating that the PDU is not on the queue. - */ - for (php = sop->so_pack_hd; php; php = php->ph_pack_lk) { - if (php->ph_ns == seq) - break; - - if (SEQ_GT(php->ph_ns, seq, sop->so_ack)) { - php = NULL; - break; - } - } - - return (php); -} - - -/* - * Free Acknowledged SD PDU - * - * Arguments: - * sop pointer to sscop connection block - * seq sequence number of PDU to free - * - * Returns: - * none - * - */ -void -sscop_pack_free(sop, seq) - struct sscop *sop; - sscop_seq seq; -{ - struct pdu_hdr *php, *prev; - - /* - * Unlink PDU from pending ack queue - * - * First, check for an empty queue - */ - php = sop->so_pack_hd; - if (php == NULL) - return; - - /* - * Now check for PDU at head of queue - */ - if (php->ph_ns == seq) { - if ((sop->so_pack_hd = php->ph_pack_lk) == NULL) - sop->so_pack_tl = NULL; - goto found; - } - - /* - * Otherwise, loop thru queue until we either find the PDU or - * the queue's sequence numbers are greater than the PDU's - * sequence number, indicating that the PDU is not on the queue. - */ - prev = php; - php = php->ph_pack_lk; - while (php) { - if (php->ph_ns == seq) { - if ((prev->ph_pack_lk = php->ph_pack_lk) == NULL) - sop->so_pack_tl = prev; - goto found; - } - - if (SEQ_GT(php->ph_ns, seq, sop->so_ack)) - return; - - prev = php; - php = php->ph_pack_lk; - } - - return; - -found: - /* - * We've got the ack'ed PDU - unlink it from retransmit queue - */ - sscop_rexmit_unlink(sop, php); - - /* - * Free PDU buffers - */ - KB_FREEALL(php->ph_buf); - - return; -} - - -/* - * Insert SD PDU into Retransmit Queue - * - * Arguments: - * sop pointer to sscop connection block - * php pointer to SD PDU header - * - * Returns: - * none - * - */ -void -sscop_rexmit_insert(sop, php) - struct sscop *sop; - struct pdu_hdr *php; -{ - struct pdu_hdr *curr, *next; - sscop_seq seq = php->ph_ns; - - /* - * Check for an empty queue - */ - if ((curr = sop->so_rexmit_hd) == NULL) { - php->ph_rexmit_lk = NULL; - sop->so_rexmit_hd = php; - sop->so_rexmit_tl = php; - return; - } - - /* - * Now see if PDU belongs at head of queue - */ - if (SEQ_LT(seq, curr->ph_ns, sop->so_ack)) { - php->ph_rexmit_lk = curr; - sop->so_rexmit_hd = php; - return; - } - - /* - * Otherwise, loop thru the queue until we find the - * proper insertion point for the PDU - */ - while ((next = curr->ph_rexmit_lk) != NULL) { - if (SEQ_LT(seq, next->ph_ns, sop->so_ack)) { - php->ph_rexmit_lk = next; - curr->ph_rexmit_lk = php; - return; - } - curr = next; - } - - /* - * Insert PDU at end of queue - */ - php->ph_rexmit_lk = NULL; - curr->ph_rexmit_lk = php; - sop->so_rexmit_tl = php; - - return; -} - - -/* - * Unlink SD PDU from Retransmit Queue - * - * Arguments: - * sop pointer to sscop connection block - * php pointer to PDU header to unlink - * - * Returns: - * none - * - */ -void -sscop_rexmit_unlink(sop, php) - struct sscop *sop; - struct pdu_hdr *php; -{ - struct pdu_hdr *curr; - - /* - * See if PDU is on retransmit queue - */ - if ((php->ph_rexmit_lk == NULL) && (sop->so_rexmit_tl != php)) - return; - - /* - * It's here somewhere, so first check for the PDU at the - * head of the queue - */ - if (php == sop->so_rexmit_hd) { - if ((sop->so_rexmit_hd = php->ph_rexmit_lk) == NULL) - sop->so_rexmit_tl = NULL; - php->ph_rexmit_lk = NULL; - return; - } - - /* - * Otherwise, loop thru the queue until we find the PDU - */ - for (curr = sop->so_rexmit_hd; curr; curr = curr->ph_rexmit_lk) { - if (curr->ph_rexmit_lk == php) - break; - } - if (curr) { - if ((curr->ph_rexmit_lk = php->ph_rexmit_lk) == NULL) - sop->so_rexmit_tl = curr; - } else { - log(LOG_ERR, - "sscop_rexmit_unlink: Not found - sop=%p, php=%p\n", - sop, php); -#ifdef DIAGNOSTIC - panic("sscop_rexmit_unlink: Not found"); -#endif - } - php->ph_rexmit_lk = NULL; - - return; -} - - -/* - * Drain Transmission Queues - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -sscop_xmit_drain(sop) - struct sscop *sop; -{ - KBuffer *m; - struct pdu_hdr *php; - - /* - * Free transmission queue buffers - */ - while ((m = sop->so_xmit_hd) != NULL) { - sop->so_xmit_hd = KB_QNEXT(m); - KB_FREEALL(m); - } - sop->so_xmit_tl = NULL; - - /* - * Free retransmission queue - * - * All retranmission buffers are also on the pending ack - * queue (but not the converse), so we just clear the queue - * pointers here and do all the real work below. - */ - sop->so_rexmit_hd = NULL; - sop->so_rexmit_tl = NULL; - - /* - * Free pending ack queue buffers - */ - while ((php = sop->so_pack_hd) != NULL) { - sop->so_pack_hd = php->ph_pack_lk; - KB_FREEALL(php->ph_buf); - } - sop->so_pack_tl = NULL; - - /* - * Clear service required flag - */ - sop->so_flags &= ~SOF_XMITSRVC; - - return; -} - - -/* - * Insert SD PDU into Receive Queue - * - * Arguments: - * sop pointer to sscop connection block - * php pointer to SD PDU header - * - * Returns: - * 0 PDU successfully inserted into queue - * 1 duplicate sequence number PDU on queue, PDU not inserted - * - */ -int -sscop_recv_insert(sop, php) - struct sscop *sop; - struct pdu_hdr *php; -{ - struct pdu_hdr *curr, *next; - sscop_seq seq = php->ph_ns; - - /* - * Check for an empty queue - */ - if ((curr = sop->so_recv_hd) == NULL) { - php->ph_recv_lk = NULL; - sop->so_recv_hd = php; - sop->so_recv_tl = php; - return (0); - } - - /* - * Now see if PDU belongs at head of queue - */ - if (SEQ_LT(seq, curr->ph_ns, sop->so_rcvnext)) { - php->ph_recv_lk = curr; - sop->so_recv_hd = php; - return (0); - } - - /* - * Otherwise, loop thru the queue until we find the - * proper insertion point for the PDU. We also check - * to make sure there isn't a PDU already on the queue - * with a matching sequence number. - */ - while ((next = curr->ph_recv_lk) != NULL) { - if (SEQ_LT(seq, next->ph_ns, sop->so_rcvnext)) { - if (seq == curr->ph_ns) - return (1); - php->ph_recv_lk = next; - curr->ph_recv_lk = php; - return (0); - } - curr = next; - } - - /* - * Insert PDU at end of queue - */ - if (seq == curr->ph_ns) - return (1); - php->ph_recv_lk = NULL; - curr->ph_recv_lk = php; - sop->so_recv_tl = php; - - return (0); -} - - -/* - * Drain Receiver Queues - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -sscop_rcvr_drain(sop) - struct sscop *sop; -{ - struct pdu_hdr *php; - - /* - * Free receive queue buffers - */ - while ((php = sop->so_recv_hd) != NULL) { - sop->so_recv_hd = php->ph_recv_lk; - KB_FREEALL(php->ph_buf); - } - sop->so_recv_tl = NULL; - - return; -} - - -/* - * Service connection's transmit queues - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -sscop_service_xmit(sop) - struct sscop *sop; -{ - KBuffer *m, *n; - struct pdu_hdr *php; - int err = 0, pollsent = 0; - - /* - * Initially assume we need service - */ - sop->so_flags |= SOF_XMITSRVC; - - /* - * Loop until done with queues - * - * (Congestion control will be added later) - */ - while (1) { - if ((php = sop->so_rexmit_hd) != NULL) { - - /* - * Send SD PDU from retransmit queue - * - * First, get a copy of the PDU to send - */ - m = php->ph_buf; - if (KB_LEN(m) == 0) - m = KB_NEXT(m); - KB_COPY(m, 0, KB_COPYALL, n, KB_F_NOWAIT); - if (n == NULL) { - err = 1; - break; - } - - /* - * Now pass it down the stack - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, - sop->so_tokl, sop->so_connvc, (intptr_t)n, 0, - err); - if (err) { - KB_FREEALL(n); - break; - } - - /* - * PDU is on its way, so remove it from - * the retransmit queue - */ - if (sop->so_rexmit_tl == php) { - sop->so_rexmit_hd = NULL; - sop->so_rexmit_tl = NULL; - } else { - sop->so_rexmit_hd = php->ph_rexmit_lk; - } - php->ph_rexmit_lk = NULL; - - /* - * Update PDU's poll sequence - */ - php->ph_nps = sop->so_pollsend; - - } else if (sop->so_xmit_hd) { - - /* - * Newly arrived data waiting to be sent. - * See if transmit window allows us to send it. - */ - if (SEQ_LT(sop->so_send, sop->so_sendmax, sop->so_ack)){ - /* - * OK, send SD PDU from transmission queue - */ - err = sscop_proc_xmit(sop); - if (err) - break; - } else { - /* - * Can't send now, so leave idle phase. - */ - if (sop->so_timer[SSCOP_T_IDLE] != 0) { - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_timer[SSCOP_T_NORESP] = - sop->so_parm.sp_timeresp; - err = 1; - } - break; - } - - } else { - - /* - * We're finished, so clear service required flag - */ - sop->so_flags &= ~SOF_XMITSRVC; - break; - } - - /* - * We've sent another SD PDU - */ - sop->so_polldata++; - - /* - * Transition into active (polling) phase - */ - if (sop->so_timer[SSCOP_T_POLL] != 0) { - if (sop->so_flags & SOF_KEEPALIVE) { - /* - * Leaving transient phase - */ - sop->so_flags &= ~SOF_KEEPALIVE; - sop->so_timer[SSCOP_T_POLL] = - sop->so_parm.sp_timepoll; - } - } else { - /* - * Leaving idle phase - */ - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_timer[SSCOP_T_NORESP] = - sop->so_parm.sp_timeresp; - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - } - - /* - * Let's see if we need to send a POLL yet - */ - if (sop->so_polldata < sop->so_parm.sp_maxpd) - continue; - - /* - * Yup, send another poll out - */ - SEQ_INCR(sop->so_pollsend, 1); - (void) sscop_send_poll(sop); - pollsent++; - - /* - * Reset data counter for this poll cycle - */ - sop->so_polldata = 0; - - /* - * Restart polling timer in active phase - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - } - - /* - * If we need/want to send a poll, but haven't sent any yet - * on this servicing, send one now - */ - if (err && (pollsent == 0)) { - /* - * Send poll - */ - SEQ_INCR(sop->so_pollsend, 1); - (void) sscop_send_poll(sop); - - /* - * Reset data counter for this poll cycle - */ - sop->so_polldata = 0; - - /* - * Restart polling timer in active phase - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_flags &= ~SOF_KEEPALIVE; - } - - return; -} - - -/* - * Process Transmission Queue PDU - * - * For the first entry on the transmission queue: add a PDU header and - * trailer, send a copy of the PDU down the stack and move the PDU from - * the transmission queue to the pending ack queue. - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * 0 head of transmission queue successfully processed - * else processing error, tranmission queue unchanged - * - */ -static int -sscop_proc_xmit(sop) - struct sscop *sop; -{ - KBuffer *m, *ml, *n; - struct pdu_hdr *php; - sscop_seq seq; - int len = 0, err; - int pad, trlen, space; - u_char *cp; - - /* - * Get first buffer chain on queue - */ - if ((m = sop->so_xmit_hd) == NULL) - return (0); - - /* - * Count data and get to last buffer in chain - */ - for (ml = m; ; ml = KB_NEXT(ml)) { - len += KB_LEN(ml); - if (KB_NEXT(ml) == NULL) - break; - } - - /* - * Verify data length - */ - if (len > sop->so_parm.sp_maxinfo) { - sscop_abort(sop, "sscop: maximum data size exceeded\n"); - return (1); - } - - /* - * Get space for PDU header - */ - KB_HEADROOM(m, space); - if (space < sizeof(struct pdu_hdr)) { - /* - * Allocate & link buffer for header - */ - KB_ALLOC(n, sizeof(struct pdu_hdr), KB_F_NOWAIT, KB_T_HEADER); - if (n == NULL) - return (1); - - KB_LEN(n) = 0; - KB_HEADSET(n, sizeof(struct pdu_hdr)); - KB_LINKHEAD(n, m); - KB_QNEXT(n) = KB_QNEXT(m); - KB_QNEXT(m) = NULL; - sop->so_xmit_hd = n; - if (sop->so_xmit_tl == m) - sop->so_xmit_tl = n; - m = n; - } - - /* - * Figure out how much padding we'll need - */ - pad = ((len + (PDU_PAD_ALIGN - 1)) & ~(PDU_PAD_ALIGN - 1)) - len; - trlen = pad + sizeof(struct sd_pdu); - - /* - * Now get space for PDU trailer and padding - */ - KB_TAILROOM(ml, space); - if (space < trlen) { - /* - * Allocate & link buffer for pad and trailer - */ - KB_ALLOC(n, trlen, KB_F_NOWAIT, KB_T_HEADER); - if (n == NULL) - return (1); - - KB_LEN(n) = 0; - KB_LINK(n, ml); - ml = n; - } - - /* - * Build the PDU trailer - * - * Since we can't be sure of alignment in the buffers, we - * have to move this a byte at a time and we have to be - * careful with host byte order issues. - */ - KB_DATASTART(ml, cp, u_char *); - cp += KB_LEN(ml) + pad; - *cp++ = (pad << PT_PAD_SHIFT) | PT_SD; - seq = sop->so_send; - *(cp + 2) = (u_char)(seq & 0xff); - seq >>= 8; - *(cp + 1) = (u_char)(seq & 0xff); - seq >>= 8; - *(cp) = (u_char)(seq & 0xff); - KB_LEN(ml) += trlen; - - /* - * Get a copy of the SD PDU to send - */ - if (KB_LEN(m) == 0) - n = KB_NEXT(m); - else - n = m; - KB_COPY(n, 0, KB_COPYALL, n, KB_F_NOWAIT); - if (n == NULL) { - KB_LEN(ml) -= trlen; - return (1); - } - - /* - * Now pass copy down the stack - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)n, 0, err); - if (err) { - KB_FREEALL(n); - KB_LEN(ml) -= trlen; - return (1); - } - - /* - * PDU is on its way, so remove buffer from - * the transmission queue - */ - if (sop->so_xmit_tl == m) { - sop->so_xmit_hd = NULL; - sop->so_xmit_tl = NULL; - } else { - sop->so_xmit_hd = KB_QNEXT(m); - } - KB_QNEXT(m) = NULL; - - /* - * Build PDU header - * - * We can at least assume/require that the start of - * the user data is aligned. Also note that we don't - * include this header in the buffer len/offset fields. - */ - KB_DATASTART(m, php, struct pdu_hdr *); - php--; - php->ph_ns = sop->so_send; - php->ph_nps = sop->so_pollsend; - php->ph_buf = m; - php->ph_rexmit_lk = NULL; - php->ph_pack_lk = NULL; - - /* - * Put PDU onto the pending ack queue - */ - if (sop->so_pack_hd == NULL) - sop->so_pack_hd = php; - else - sop->so_pack_tl->ph_pack_lk = php; - sop->so_pack_tl = php; - - /* - * Finally, bump send sequence number - */ - SEQ_INCR(sop->so_send, 1); - - return (0); -} - - -/* - * Detect Retransmitted PDUs - * - * Arguments: - * sop pointer to sscop connection block - * nsq connection sequence value (N(SQ)) from received PDU - * - * Returns: - * 0 received PDU was NOT retransmitted - * 1 received PDU was retransmitted - * - */ -int -sscop_is_rexmit(sop, nsq) - struct sscop *sop; - u_char nsq; -{ - - /* - * For Q.SAAL1, N(SQ) doesn't exist - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) - return (0); - - /* - * If we've already received the N(SQ) value, - * then this PDU has been retransmitted - */ - if (nsq == sop->so_rcvconn) - return (1); - - /* - * New PDU, save its N(SQ) - */ - sop->so_rcvconn = nsq; - - return (0); -} - - -/* - * Start connection poll timer - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -sscop_set_poll(sop) - struct sscop *sop; -{ - - /* - * Decide which polling timer value to set - */ - if ((sop->so_xmit_hd != NULL) || SEQ_NEQ(sop->so_send, sop->so_ack)) { - /* - * Data outstanding, poll frequently - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_flags &= ~SOF_KEEPALIVE; - } else { - /* - * No data outstanding, just poll occassionally - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timekeep; - sop->so_flags |= SOF_KEEPALIVE; - } - - return; -} - Property changes on: head/sys/netatm/uni/sscop_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_sigaa.c =================================================================== --- head/sys/netatm/uni/sscop_sigaa.c (revision 179307) +++ head/sys/netatm/uni/sscop_sigaa.c (nonexistent) @@ -1,449 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP Common - Process AA-signals (SAP_SSCOP) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * SSCOP_ESTABLISH_REQ / SOS_IDLE Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 buffer release parameter - * - * Returns: - * none - * - */ -void -sscop_estreq_idle(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * We currently only support BR=YES - */ - if (arg2 != SSCOP_BR_YES) { - sscop_abort(sop, "sscop: BR != YES\n"); - return; - } - - /* - * Initialize receiver window - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - /* - * Send first BGN PDU - */ - sop->so_connctl = 1; - SEQ_INCR(sop->so_sendconn, 1); - (void) sscop_send_bgn(sop, SSCOP_SOURCE_USER); - - /* - * Reset transmitter state - */ - if (sop->so_vers == SSCOP_VERS_Q2110) - q2110_clear_xmit(sop); - else - qsaal1_reset_xmit(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for BGAK - */ - sop->so_state = SOS_OUTCONN; - - return; -} - - -/* - * SSCOP_ESTABLISH_RSP / SOS_INCONN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 buffer release parameter - * - * Returns: - * none - * - */ -void -sscop_estrsp_inconn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * We currently only support BR=YES - */ - if (arg2 != SSCOP_BR_YES) { - sscop_abort(sop, "sscop: BR != YES\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_Q2110) { - /* - * Clear transmitter buffers - */ - q2110_clear_xmit(sop); - - /* - * Initialize state variables - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - q2110_init_state(sop); - } else { - /* - * Reset transmitter state - */ - qsaal1_reset_xmit(sop); - } - - /* - * Send BGAK PDU - */ - (void) sscop_send_bgak(sop); - - /* - * Start polling timer - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - - /* - * Start lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * OK, we're ready for data - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * SSCOP_RELEASE_REQ / SOS_OUTCONN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 unused - * - * Returns: - * none - * - */ -void -sscop_relreq_outconn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Clear reestablishment flag - */ - sop->so_flags &= ~SOF_REESTAB; - - /* - * Send first END PDU - */ - sop->so_connctl = 1; - (void) sscop_send_end(sop, SSCOP_SOURCE_USER); - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for ENDAK - */ - sop->so_state = SOS_OUTDISC; - - return; -} - - -/* - * SSCOP_RELEASE_REQ / SOS_INCONN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 unused - * - * Returns: - * none - * - */ -void -sscop_relreq_inconn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Return a BGREJ PDU - */ - (void) sscop_send_bgrej(sop); - - /* - * Back to IDLE state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * SSCOP_RELEASE_REQ / SOS_READY Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 unused - * - * Returns: - * none - * - */ -void -sscop_relreq_ready(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Send first END PDU - */ - sop->so_connctl = 1; - (void) sscop_send_end(sop, SSCOP_SOURCE_USER); - - if (sop->so_vers == SSCOP_VERS_Q2110) { - /* - * Clear out appropriate queues - */ - if (sop->so_state == SOS_READY) - q2110_prep_retrieve(sop); - else - sscop_rcvr_drain(sop); - } else { - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - } - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for ENDAK - */ - sop->so_state = SOS_OUTDISC; - - return; -} - - -/* - * SSCOP_DATA_REQ / SOS_READY Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing assured user data - * arg2 unused - * - * Returns: - * none - * - */ -void -sscop_datreq_ready(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - KBuffer *m = (KBuffer *)arg1; - - /* - * We must have a buffer (even if it contains no data) - */ - if (m == NULL) { - sscop_abort(sop, "sscop_datreq_ready: no buffer\n"); - return; - } - - /* - * Place data at end of transmission queue - */ - KB_QNEXT(m) = NULL; - if (sop->so_xmit_hd == NULL) - sop->so_xmit_hd = m; - else - KB_QNEXT(sop->so_xmit_tl) = m; - sop->so_xmit_tl = m; - - /* - * Service the transmit queues - */ - sscop_service_xmit(sop); - - return; -} - - -/* - * SSCOP_UNITDATA_REQ / SOS_* Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing unassured user data - * arg2 unused - * - * Returns: - * none - * - */ -void -sscop_udtreq_all(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - KBuffer *m = (KBuffer *)arg1; - - /* - * We must have a buffer (even if it contains no data) - */ - if (m == NULL) { - sscop_abort(sop, "sscop_udtreq_all: no buffer\n"); - return; - } - - /* - * Send the data in a UD PDU - */ - (void) sscop_send_ud(sop, m); - - return; -} - Property changes on: head/sys/netatm/uni/sscop_sigaa.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniip.c =================================================================== --- head/sys/netatm/uni/uniip.c (revision 179307) +++ head/sys/netatm/uni/uniip.c (nonexistent) @@ -1,249 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI IP interface module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -/* - * Local functions - */ -static int uniip_ipact(struct ip_nif *); -static int uniip_ipdact(struct ip_nif *); - - -/* - * Global variables - */ -struct uniip *uniip_head = NULL; - -struct ip_serv uniip_ipserv = { - uniip_ipact, - uniip_ipdact, - uniarp_ioctl, - uniarp_pvcopen, - uniarp_svcout, - uniarp_svcin, - uniarp_svcactive, - uniarp_vcclose, - NULL, - { { ATM_AAL5, ATM_ENC_LLC} }, -}; - - -/* - * Local variables - */ -static uma_zone_t uniip_zone; - -/* - * Process module loading notification - * - * Called whenever the uni module is initializing. - * - * Arguments: - * none - * - * Returns: - * 0 initialization successful - * errno initialization failed - reason indicated - * - */ -int -uniip_start() -{ - int err; - - uniip_zone = uma_zcreate("uni ip", sizeof(struct uniip), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); - if (uniip_zone == NULL) - panic("uniip_start: uma_zcreate"); - - /* - * Tell arp to initialize stuff - */ - err = uniarp_start(); - return (err); -} - - -/* - * Process module unloading notification - * - * Called whenever the uni module is about to be unloaded. All signalling - * instances will have been previously detached. All uniip resources - * must be freed now. - * - * Arguments: - * none - * - * Returns: - * 0 shutdown was successful - * errno shutdown failed - reason indicated - * - */ -int -uniip_stop() -{ - - /* - * All IP interfaces should be gone - */ - if (uniip_head) - return (EBUSY); - - /* - * Tell arp to stop - */ - uniarp_stop(); - uma_zdestroy(uniip_zone); - return (0); -} - - -/* - * Process IP Network Interface Activation - * - * Called whenever an IP network interface becomes active. - * - * Called at splnet. - * - * Arguments: - * inp pointer to IP network interface - * - * Returns: - * 0 command successful - * errno command failed - reason indicated - * - */ -static int -uniip_ipact(inp) - struct ip_nif *inp; -{ - struct uniip *uip; - - /* - * Make sure we don't already have this interface - */ - for (uip = uniip_head; uip; uip = uip->uip_next) { - if (uip->uip_ipnif == inp) - return (EEXIST); - } - - /* - * Get a new interface control block - */ - uip = uma_zalloc(uniip_zone, M_WAITOK | M_ZERO); - if (uip == NULL) - return (ENOMEM); - - /* - * Initialize and link up - */ - uip->uip_ipnif = inp; - LINK2TAIL(uip, struct uniip, uniip_head, uip_next); - - /* - * Link from IP world - */ - inp->inf_isintf = (caddr_t)uip; - - /* - * Tell arp about new interface - */ - uniarp_ipact(uip); - - return (0); -} - - -/* - * Process IP Network Interface Deactivation - * - * Called whenever an IP network interface becomes inactive. - * - * Called at splnet. - * - * Arguments: - * inp pointer to IP network interface - * - * Returns: - * 0 command successful - * errno command failed - reason indicated - * - */ -static int -uniip_ipdact(inp) - struct ip_nif *inp; -{ - struct uniip *uip; - - /* - * Get the appropriate IP interface block - */ - uip = (struct uniip *)inp->inf_isintf; - if (uip == NULL) - return (ENXIO); - - /* - * Let arp know about this - */ - uniarp_ipdact(uip); - - /* - * Free interface info - */ - UNLINK(uip, struct uniip, uniip_head, uip_next); - if (uip->uip_prefix != NULL) - free(uip->uip_prefix, M_DEVBUF); - uma_zfree(uniip_zone, uip); - return (0); -} - Property changes on: head/sys/netatm/uni/uniip.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscf_uni.c =================================================================== --- head/sys/netatm/uni/sscf_uni.c (revision 179307) +++ head/sys/netatm/uni/sscf_uni.c (nonexistent) @@ -1,317 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * Signalling AAL SSCF at the UNI - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -/* - * Global variables - */ -int sscf_uni_vccnt = 0; - -/* - * Local functions - */ -static int sscf_uni_inst(struct stack_defn **, Atm_connvc *); - -/* - * Local variables - */ - -uma_zone_t sscf_uni_zone; - -static struct stack_defn sscf_uni_service = { - NULL, - SAP_SSCF_UNI, - 0, - sscf_uni_inst, - sscf_uni_lower, - sscf_uni_upper, - 0 -}; - -static struct t_atm_cause sscf_uni_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_TEMPORARY_FAILURE, - {0, 0, 0, 0} -}; - - -/* - * Initialize SSCF UNI processing - * - * This will be called during module loading. We will register our stack - * service and wait for someone to talk to us. - * - * Arguments: - * none - * - * Returns: - * 0 initialization was successful - * errno initialization failed - reason indicated - * - */ -int -sscf_uni_start() -{ - int err = 0; - - sscf_uni_zone = uma_zcreate("sscf uni", sizeof(struct univcc), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (sscf_uni_zone == NULL) - panic("sscf_uni_start: uma_zcreate"); - - /* - * Register stack service - */ - err = atm_stack_register(&sscf_uni_service); - return (err); -} - - -/* - * Terminate SSCF UNI processing - * - * This will be called just prior to unloading the module from memory. All - * signalling instances should have been terminated by now, so we just free - * up all of our resources. - * - * Called at splnet. - * - * Arguments: - * none - * - * Returns: - * 0 termination was successful - * errno termination failed - reason indicated - * - */ -int -sscf_uni_stop() -{ - /* - * Any connections still exist?? - */ - if (sscf_uni_vccnt) { - - /* - * Yes, can't stop yet - */ - return (EBUSY); - } - - /* - * Deregister the stack service - */ - (void)atm_stack_deregister(&sscf_uni_service); - uma_zdestroy(sscf_uni_zone); - return (0); -} - - -/* - * SSCF_UNI Stack Instantiation - * - * Called at splnet. - * - * Arguments: - * ssp pointer to array of stack definition pointers for connection - * ssp[0] points to upper layer's stack service definition - * ssp[1] points to this layer's stack service definition - * ssp[2] points to lower layer's stack service definition - * cvp pointer to connection vcc for this stack - * - * Returns: - * 0 instantiation successful - * errno instantiation failed - reason indicated - * - */ -static int -sscf_uni_inst(ssp, cvp) - struct stack_defn **ssp; - Atm_connvc *cvp; -{ - struct stack_defn *sdp_up = ssp[0], - *sdp_me = ssp[1], - *sdp_low = ssp[2]; - struct univcc *uvp; - int err; - - ATM_DEBUG2("sscf_uni_inst: ssp=%p, cvp=%p\n", ssp, cvp); - - /* - * Validate lower SAP - */ - if (sdp_low->sd_sap != SAP_SSCOP) - return (EINVAL); - - /* - * Allocate our control block - */ - uvp = uma_zalloc(sscf_uni_zone, M_WAITOK); - if (uvp == NULL) - return (ENOMEM); - uvp->uv_ustate = UVU_INST; - uvp->uv_lstate = UVL_INST; - uvp->uv_connvc = cvp; - uvp->uv_toku = sdp_up->sd_toku; - uvp->uv_upper = sdp_up->sd_upper; - sscf_uni_vccnt++; - - /* - * Store my token into service definition - */ - sdp_me->sd_toku = uvp; - - /* - * Update and save input buffer headroom - */ - HEADIN(cvp, 0, 0); - /* uvp->uv_headin = cvp->cvc_attr.headin; */ - - /* - * Pass instantiation down the stack - */ - err = sdp_low->sd_inst(ssp + 1, cvp); - if (err) { - /* - * Lower layer instantiation failed, free our resources - */ - uma_zfree(sscf_uni_zone, uvp); - sscf_uni_vccnt--; - return (err); - } - - /* - * Save and update output buffer headroom - */ - /* uvp->uv_headout = cvp->cvc_attr.headout; */ - HEADOUT(cvp, 0, 0); - - /* - * Save lower layer's interface info - */ - uvp->uv_lower = sdp_low->sd_lower; - uvp->uv_tokl = sdp_low->sd_toku; - - return (0); -} - - -/* - * Abort an SSCF_UNI connection - * - * Called when an unrecoverable or "should never happen" error occurs. - * We just log a message and request the signalling manager to abort the - * connection. - * - * Arguments: - * uvp pointer to univcc control block - * msg pointer to error message - * - * Returns: - * none - * - */ -void -sscf_uni_abort(uvp, msg) - struct univcc *uvp; - char *msg; -{ - /* - * Log error message - */ - log(LOG_ERR, "%s", msg); - - /* - * Set termination states - */ - uvp->uv_ustate = UVU_TERM; - uvp->uv_lstate = UVL_TERM; - - /* - * Tell Connection Manager to abort this connection - */ - (void) atm_cm_abort(uvp->uv_connvc, &sscf_uni_cause); -} - - -/* - * Print an SSCF PDU - * - * Arguments: - * uvp pointer to univcc control block - * m pointer to pdu buffer chain - * msg pointer to message string - * - * Returns: - * none - * - */ -void -sscf_uni_pdu_print(const struct univcc *uvp, const KBuffer *m, const char *msg) -{ - char buf[128]; - struct vccb *vcp; - - vcp = uvp->uv_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), "sscf_uni %s: vcc=(%d,%d)\n", - msg, vcp->vc_vpi, vcp->vc_vci); - atm_pdu_print(m, buf); -} Property changes on: head/sys/netatm/uni/sscf_uni.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_msg.c =================================================================== --- head/sys/netatm/uni/unisig_msg.c (revision 179307) +++ head/sys/netatm/uni/unisig_msg.c (nonexistent) @@ -1,1010 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message handling module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -/* - * Local functions - */ -static void unisig_rcv_restart(struct unisig *, struct unisig_msg *); -static void unisig_rcv_setup(struct unisig *, struct unisig_msg *); - - -/* - * net.harp.uni.unisig_print_msg - * - * 0 - disable - * 1 - dump UNI message - * 2 - dump UNI message + print decoded form - */ -static int unisig_print_msg = 0; -SYSCTL_INT(_net_harp_uni, OID_AUTO, unisig_print_msg, CTLFLAG_RW, - &unisig_print_msg, 0, "dump UNI messages"); - -/* - * Set a Cause IE based on information in an ATM attribute block - * - * Arguments: - * iep pointer to a cause IE - * aap pointer to attribute block - * - * Returns: - * 0 message sent OK - * errno error encountered - * - */ -void -unisig_cause_from_attr(iep, aap) - struct ie_generic *iep; - Atm_attributes *aap; -{ - /* - * Copy cause info from attribute block to IE - */ - iep->ie_ident = UNI_IE_CAUS; - iep->ie_coding = aap->cause.v.coding_standard; - iep->ie_caus_loc = aap->cause.v.location; - iep->ie_caus_cause = aap->cause.v.cause_value; -} - - -/* - * Set a Cause IE based on information in a UNI signalling message - * - * Arguments: - * iep pointer to a cause IE - * msg pointer to message - * cause cause code for the error - * - * Returns: - * 0 message sent OK - * errno error encountered - * - */ -void -unisig_cause_from_msg(iep, msg, cause) - struct ie_generic *iep; - struct unisig_msg *msg; - int cause; -{ - struct ie_generic *ie1; - int i; - - /* - * Fill out the cause IE fixed fields - */ - iep->ie_ident = UNI_IE_CAUS; - iep->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - iep->ie_caus_cause = cause; - - /* - * Set diagnostics if indicated - */ - switch(cause) { - case UNI_IE_CAUS_IECONTENT: - iep->ie_caus_diag_len = 0; - for (i = 0, ie1 = msg->msg_ie_err; - ie1 && i < UNI_IE_CAUS_MAX_ID; - ie1 = ie1->ie_next) { - if (ie1->ie_err_cause == UNI_IE_CAUS_IECONTENT) { - iep->ie_caus_diagnostic[i] = - ie1->ie_ident; - iep->ie_caus_diag_len++; - i++; - } - } - break; - case UNI_IE_CAUS_REJECT: - iep->ie_caus_diag_len = 2; - iep->ie_caus_diagnostic[0] = UNI_IE_EXT_BIT + - (UNI_IE_CAUS_RR_USER << UNI_IE_CAUS_RR_SHIFT) + - UNI_IE_CAUS_RC_TRANS; - iep->ie_caus_diagnostic[1] = 0; - break; - case UNI_IE_CAUS_MISSING: - iep->ie_caus_diag_len = 0; - for (i = 0, ie1 = msg->msg_ie_err; - ie1 && i < UNI_IE_CAUS_MAX_ID; - ie1 = ie1->ie_next) { - if (ie1->ie_err_cause == UNI_IE_CAUS_MISSING) { - iep->ie_caus_diagnostic[i] = - ie1->ie_ident; - iep->ie_caus_diag_len++; - i++; - } - } - } -} - - -/* - * Send a UNISIG signalling message - * - * Called to send a Q.2931 message. This routine encodes the message - * and hands it to SSCF for transmission. - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * msg pointer to message - * - * Returns: - * 0 message sent OK - * errno error encountered - * - */ -int -unisig_send_msg(usp, msg) - struct unisig *usp; - struct unisig_msg *msg; -{ - int err = 0; - struct usfmt usf; - - ATM_DEBUG2("unisig_send_msg: msg=%p, type=%d\n", msg, - msg->msg_type); - - /* - * Make sure the network is up - */ - if (usp->us_state != UNISIG_ACTIVE) - return(ENETDOWN); - - /* - * Print the message we're sending. - */ - if (unisig_print_msg) - usp_print_msg(msg, UNISIG_MSG_OUT); - - /* - * Convert message to network order - */ - err = usf_init(&usf, usp, (KBuffer *) 0, USF_ENCODE, - usp->us_headout); - if (err) - return(err); - - err = usf_enc_msg(&usf, msg); - if (err) { - ATM_DEBUG1("unisig_send_msg: encode failed with %d\n", - err); - KB_FREEALL(usf.usf_m_base); - return(EIO); - } - - /* - * Print the converted message - */ - if (unisig_print_msg > 1) - unisig_print_mbuf(usf.usf_m_base); - - /* - * Send the message - */ - err = atm_cm_saal_data(usp->us_conn, usf.usf_m_base); - if (err) - KB_FREEALL(usf.usf_m_base); - - return(err); -} - - -/* - * Send a SETUP request - * - * Build and send a Q.2931 SETUP message. - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * uvp pointer to VCCB for which the request is being sent - * - * Returns: - * none - * - */ -int -unisig_send_setup(usp, uvp) - struct unisig *usp; - struct unisig_vccb *uvp; -{ - int err = 0; - struct unisig_msg *setup; - Atm_attributes *ap = &uvp->uv_connvc->cvc_attr; - - ATM_DEBUG1("unisig_send_setup: uvp=%p\n", uvp); - - /* - * Make sure required connection attriutes are set - */ - if (ap->aal.tag != T_ATM_PRESENT || - ap->traffic.tag != T_ATM_PRESENT || - ap->bearer.tag != T_ATM_PRESENT || - ap->called.tag != T_ATM_PRESENT || - ap->qos.tag != T_ATM_PRESENT) { - err = EINVAL; - setup = NULL; - goto done; - } - - /* - * Get memory for a SETUP message - */ - setup = uma_zalloc(unisig_msg_zone, M_ZERO | M_NOWAIT); - if (setup == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Fill in the SETUP message - */ - if (!uvp->uv_call_ref) - uvp->uv_call_ref = unisig_alloc_call_ref(usp); - setup->msg_call_ref = uvp->uv_call_ref; - setup->msg_type = UNI_MSG_SETU; - - /* - * Set IEs from connection attributes - */ - err = unisig_set_attrs(usp, setup, ap); - if (err) - goto done; - - /* - * Attach a Calling Party Number IE if the user didn't - * specify one in the attribute block - */ - if (ap->calling.tag != T_ATM_PRESENT) { - setup->msg_ie_cgad = uma_zalloc(unisig_ie_zone, M_NOWAIT); - if (setup->msg_ie_cgad == NULL) { - err = ENOMEM; - goto done; - } - setup->msg_ie_cgad->ie_ident = UNI_IE_CGAD; - ATM_ADDR_COPY(&usp->us_addr, - &setup->msg_ie_cgad->ie_cgad_addr); - ATM_ADDR_SEL_COPY(&usp->us_addr, - uvp->uv_nif ? uvp->uv_nif->nif_sel : 0, - &setup->msg_ie_cgad->ie_cgad_addr); - } - - /* - * Send the SETUP message - */ - err = unisig_send_msg(usp, setup); - -done: - if (setup) - unisig_free_msg(setup); - - return(err); -} - - -/* - * Send a RELEASE message - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * uvp pointer to VCCB for which the RELEASE is being sent - * msg pointer to UNI signalling message that the RELEASE - * responds to (may be NULL) - * cause the reason for the RELEASE; a value of - * T_ATM_ABSENT indicates that the cause code is - * in the VCC's ATM attributes block - * - * Returns: - * none - * - */ -int -unisig_send_release(usp, uvp, msg, cause) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; - int cause; -{ - int err = 0; - struct unisig_msg *rls_msg; - struct ie_generic *cause_ie; - - ATM_DEBUG2("unisig_send_release: usp=%p, uvp=%p\n", - usp, uvp); - - /* - * Get memory for a RELEASE message - */ - rls_msg = uma_zalloc(unisig_msg_zone, M_ZERO | M_NOWAIT); - if (rls_msg == NULL) { - return(ENOMEM); - } - cause_ie = uma_zalloc(unisig_ie_zone, M_ZERO | M_NOWAIT); - if (cause_ie == NULL) { - uma_zfree(unisig_msg_zone, rls_msg); - return(ENOMEM); - } - - /* - * Fill in the RELEASE message - */ - rls_msg->msg_call_ref = uvp->uv_call_ref; - rls_msg->msg_type = UNI_MSG_RLSE; - rls_msg->msg_type_flag = 0; - rls_msg->msg_type_action = 0; - rls_msg->msg_ie_caus = cause_ie; - - /* - * Fill out the cause IE - */ - cause_ie->ie_ident = UNI_IE_CAUS; - if (cause == T_ATM_ABSENT) { - unisig_cause_from_attr(cause_ie, - &uvp->uv_connvc->cvc_attr); - } else { - cause_ie->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - unisig_cause_from_msg(cause_ie, msg, cause); - } - - /* - * Send the RELEASE - */ - err = unisig_send_msg(usp, rls_msg); - unisig_free_msg(rls_msg); - - return(err); -} - - -/* - * Send a RELEASE COMPLETE message - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * uvp pointer to VCCB for which the RELEASE is being sent. - * NULL indicates that a VCCB wasn't found for a call - * reference value. - * msg pointer to the message which triggered the send - * cause the cause code for the message; a value of - * T_ATM_ABSENT indicates that the cause code is - * in the VCC's ATM attributes block - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -unisig_send_release_complete(usp, uvp, msg, cause) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; - int cause; -{ - int err = 0; - struct unisig_msg *rls_cmp; - struct ie_generic *cause_ie; - - ATM_DEBUG4("unisig_send_release_complete usp=%p, uvp=%p, msg=%p, cause=%d\n", - usp, uvp, msg, cause); - - /* - * Get memory for a RELEASE COMPLETE message - */ - rls_cmp = uma_zalloc(unisig_msg_zone, M_ZERO | M_NOWAIT); - if (rls_cmp == NULL) { - return(ENOMEM); - } - cause_ie = uma_zalloc(unisig_ie_zone, M_ZERO | M_NOWAIT); - if (cause_ie == NULL) { - uma_zfree(unisig_msg_zone, rls_cmp); - return(ENOMEM); - } - - /* - * Fill in the RELEASE COMPLETE message - */ - if (uvp) { - rls_cmp->msg_call_ref = uvp->uv_call_ref; - } else if (msg) { - rls_cmp->msg_call_ref = EXTRACT_CREF(msg->msg_call_ref); - } else { - rls_cmp->msg_call_ref = UNI_MSG_CALL_REF_GLOBAL; - } - rls_cmp->msg_type = UNI_MSG_RLSC; - rls_cmp->msg_type_flag = 0; - rls_cmp->msg_type_action = 0; - rls_cmp->msg_ie_caus = cause_ie; - - /* - * Fill out the cause IE - */ - cause_ie->ie_ident = UNI_IE_CAUS; - if (cause == T_ATM_ABSENT) { - unisig_cause_from_attr(cause_ie, - &uvp->uv_connvc->cvc_attr); - } else { - cause_ie->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - unisig_cause_from_msg(cause_ie, msg, cause); - } - - /* - * Send the RELEASE COMPLETE - */ - err = unisig_send_msg(usp, rls_cmp); - unisig_free_msg(rls_cmp); - - return(err); -} - - -/* - * Send a STATUS message - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * uvp pointer to VCCB for which the STATUS is being sent. - * NULL indicates that a VCCB wasn't found for a call - * reference value. - * msg pointer to the message which triggered the send - * cause the cause code to include in the message - * - * Returns: - * none - * - */ -int -unisig_send_status(usp, uvp, msg, cause) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; - int cause; -{ - int err = 0, i; - struct unisig_msg *stat_msg; - struct ie_generic *cause_ie, *clst_ie, *iep; - - ATM_DEBUG4("unisig_send_status: usp=%p, uvp=%p, msg=%p, cause=%d\n", - usp, uvp, msg, cause); - - /* - * Get memory for a STATUS message - */ - stat_msg = uma_zalloc(unisig_msg_zone, M_ZERO | M_NOWAIT); - if (stat_msg == NULL) { - return(ENOMEM); - } - cause_ie = uma_zalloc(unisig_ie_zone, M_ZERO | M_NOWAIT); - if (cause_ie == NULL) { - uma_zfree(unisig_msg_zone, stat_msg); - return(ENOMEM); - } - clst_ie = uma_zalloc(unisig_ie_zone, M_ZERO | M_NOWAIT); - if (clst_ie == NULL) { - uma_zfree(unisig_msg_zone, stat_msg); - uma_zfree(unisig_ie_zone, cause_ie); - return(ENOMEM); - } - - /* - * Fill in the STATUS message - */ - if (uvp) { - stat_msg->msg_call_ref = uvp->uv_call_ref; - } else if (msg) { - stat_msg->msg_call_ref = - EXTRACT_CREF(msg->msg_call_ref); - } else { - stat_msg->msg_call_ref = UNI_MSG_CALL_REF_GLOBAL; - } - stat_msg->msg_type = UNI_MSG_STAT; - stat_msg->msg_type_flag = 0; - stat_msg->msg_type_action = 0; - stat_msg->msg_ie_clst = clst_ie; - stat_msg->msg_ie_caus = cause_ie; - - /* - * Fill out the call state IE - */ - clst_ie->ie_ident = UNI_IE_CLST; - clst_ie->ie_coding = 0; - clst_ie->ie_flag = 0; - clst_ie->ie_action = 0; - if (uvp) { - clst_ie->ie_clst_state = uvp->uv_sstate; - } else { - clst_ie->ie_clst_state = UNI_NULL; - } - - /* - * Fill out the cause IE - */ - cause_ie->ie_ident = UNI_IE_CAUS; - cause_ie->ie_coding = 0; - cause_ie->ie_flag = 0; - cause_ie->ie_action = 0; - cause_ie->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - cause_ie->ie_caus_cause = cause; - switch (cause) { - case UNI_IE_CAUS_MTEXIST: - case UNI_IE_CAUS_STATE: - if (msg) { - cause_ie->ie_caus_diagnostic[0] = msg->msg_type; - } - break; - case UNI_IE_CAUS_MISSING: - case UNI_IE_CAUS_IECONTENT: - case UNI_IE_CAUS_IEEXIST: - for (i=0, iep=msg->msg_ie_err; - iep && iie_next) { - if (iep->ie_err_cause == cause) { - cause_ie->ie_caus_diagnostic[i] = - iep->ie_ident; - } - } - } - - /* - * Send the STATUS message - */ - err = unisig_send_msg(usp, stat_msg); - unisig_free_msg(stat_msg); - - return(err); -} - - -/* - * Process a RESTART message - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * msg pointer to the RESTART message - * - * Returns: - * none - * - */ -static void -unisig_rcv_restart(usp, msg) - struct unisig *usp; - struct unisig_msg *msg; -{ - struct unisig_vccb *uvp, *uvnext; - struct unisig_msg *rsta_msg; - int s; - - ATM_DEBUG2("unisig_rcv_restart: usp=%p, msg=%p\n", - usp, msg); - - /* - * Check what class of VCCs we're supposed to restart - */ - if (msg->msg_ie_rsti->ie_rsti_class == UNI_IE_RSTI_IND_VC) { - /* - * Just restart the indicated VCC - */ - if (msg->msg_ie_cnid) { - uvp = unisig_find_vpvc(usp, - msg->msg_ie_cnid->ie_cnid_vpci, - msg->msg_ie_cnid->ie_cnid_vci, - 0); - if (uvp && uvp->uv_type & VCC_SVC) { - (void) unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - } - } - } else { - /* - * Restart all VCCs - */ - s = splnet(); - for (uvp=Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp=uvnext) { - uvnext = Q_NEXT(uvp, struct unisig_vccb, - uv_sigelem); - if (uvp->uv_type & VCC_SVC) { - (void) unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - } - } - (void) splx(s); - } - - /* - * Get memory for a RESTART ACKNOWLEDGE message - */ - rsta_msg = uma_zalloc(unisig_msg_zone, M_NOWAIT); - if (rsta_msg == NULL) { - return; - } - - /* - * Fill out the message - */ - rsta_msg->msg_call_ref = EXTRACT_CREF(msg->msg_call_ref); - rsta_msg->msg_type = UNI_MSG_RSTA; - rsta_msg->msg_type_flag = 0; - rsta_msg->msg_type_action = 0; - rsta_msg->msg_ie_rsti = msg->msg_ie_rsti; - if (msg->msg_ie_cnid) { - rsta_msg->msg_ie_cnid = msg->msg_ie_cnid; - } - - /* - * Send the message - */ - (void) unisig_send_msg(usp, rsta_msg); - rsta_msg->msg_ie_rsti = NULL; - rsta_msg->msg_ie_cnid = NULL; - unisig_free_msg(rsta_msg); - - return; -} - - -/* - * Process a SETUP message - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * msg pointer to the SETUP message - * - * Returns: - * none - * - */ -static void -unisig_rcv_setup(usp, msg) - struct unisig *usp; - struct unisig_msg *msg; -{ - struct unisig_vccb *uvp = NULL; - struct ie_generic *iep; - - ATM_DEBUG2("unisig_rcv_setup: usp=%p, msg=%p\n", usp, msg); - - /* - * If we already have a VCC with the call reference, - * ignore the SETUP message - */ - uvp = unisig_find_conn(usp, EXTRACT_CREF(msg->msg_call_ref)); - if (uvp) - return; - - /* - * If the call reference flag is incorrectly set, - * ignore the SETUP message - */ - if (msg->msg_call_ref & UNI_MSG_CALL_REF_RMT) - return; - - /* - * If there are missing mandatory IEs, send a - * RELEASE COMPLETE message and ignore the SETUP - */ - for (iep = msg->msg_ie_err; iep; iep = iep->ie_next) { - if (iep->ie_err_cause == UNI_IE_CAUS_MISSING) { - (void) unisig_send_release_complete(usp, - uvp, msg, UNI_IE_CAUS_MISSING); - return; - } - } - - /* - * If there are mandatory IEs with invalid content, send a - * RELEASE COMPLETE message and ignore the SETUP - */ - for (iep = msg->msg_ie_err; iep; iep = iep->ie_next) { - if (iep->ie_err_cause == UNI_IE_CAUS_IECONTENT) { - (void) unisig_send_release_complete(usp, - uvp, msg, - UNI_IE_CAUS_IECONTENT); - return; - } - } - - /* - * Get a new VCCB for the connection - */ - uvp = uma_zalloc(unisig_vc_zone, M_ZERO | M_NOWAIT); - if (uvp == NULL) { - return; - } - - /* - * Put the VCCB on the UNISIG queue - */ - ENQUEUE(uvp, struct unisig_vccb, uv_sigelem, usp->us_vccq); - - /* - * Set the state and call reference value - */ - uvp->uv_sstate = UNI_NULL; - uvp->uv_call_ref = EXTRACT_CREF(msg->msg_call_ref); - - /* - * Pass the VCCB and message to the VC state machine - */ - (void) unisig_vc_state(usp, uvp, UNI_VC_SETUP_MSG, msg); - - /* - * If the VCCB state is NULL, the open failed and the - * VCCB should be released - */ - if (uvp->uv_sstate == UNI_NULL) { - DEQUEUE(uvp, struct unisig_vccb, uv_sigelem, - usp->us_vccq); - uma_zfree(unisig_vc_zone, uvp); - } - return; -} - - -/* - * Process a UNISIG signalling message - * - * Called when a UNISIG message is received. The message is decoded - * and passed to the UNISIG state machine. Unrecognized and - * unexpected messages are logged. - * - * Arguments: - * usp pointer to UNISIG protocol instance block - * m pointer to a buffer chain containing the UNISIG message - * - * Returns: - * none - * - */ -int -unisig_rcv_msg(usp, m) - struct unisig *usp; - KBuffer *m; -{ - int err; - u_int cref; - struct usfmt usf; - struct unisig_msg *msg = 0; - struct unisig_vccb *uvp = 0; - struct ie_generic *iep; - - ATM_DEBUG2("unisig_rcv_msg: bfr=%p, len=%d\n", m, KB_LEN(m)); - -#ifdef NOTDEF - unisig_print_mbuf(m); -#endif - - /* - * Get storage for the message - */ - msg = uma_zalloc(unisig_msg_zone, M_ZERO | M_NOWAIT); - if (msg == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Convert the message from network order to internal format - */ - err = usf_init(&usf, usp, m, USF_DECODE, 0); - if (err) { - if (err == EINVAL) - panic("unisig_rcv_msg: invalid parameter\n"); - ATM_DEBUG1("unisig_rcv_msg: decode init failed with %d\n", - err); - goto done; - } - - err = usf_dec_msg(&usf, msg); - if (err) { - ATM_DEBUG1("unisig_rcv_msg: decode failed with %d\n", - err); - goto done; - } - - /* - * Debug--print some information about the message - */ - if (unisig_print_msg) - usp_print_msg(msg, UNISIG_MSG_IN); - - /* - * Get the call reference value - */ - cref = EXTRACT_CREF(msg->msg_call_ref); - - /* - * Any message with the global call reference value except - * RESTART, RESTART ACK, or STATUS is in error - */ - if (GLOBAL_CREF(cref) && - msg->msg_type != UNI_MSG_RSTR && - msg->msg_type != UNI_MSG_RSTA && - msg->msg_type != UNI_MSG_STAT) { - /* - * Send STATUS message indicating the error - */ - err = unisig_send_status(usp, (struct unisig_vccb *) 0, - msg, UNI_IE_CAUS_CREF); - goto done; - } - - /* - * Check for missing mandatory IEs. Checks for SETUP, - * RELEASE, and RELEASE COMPLETE are handled elsewhere. - */ - if (msg->msg_type != UNI_MSG_SETU && - msg->msg_type != UNI_MSG_RLSE && - msg->msg_type != UNI_MSG_RLSC) { - for (iep = msg->msg_ie_err; iep; iep = iep->ie_next) { - if (iep->ie_err_cause == UNI_IE_CAUS_MISSING) { - err = unisig_send_status(usp, - uvp, msg, - UNI_IE_CAUS_MISSING); - goto done; - } - } - } - - /* - * Find the VCCB associated with the message - */ - uvp = unisig_find_conn(usp, cref); - - /* - * Process the message based on its type - */ - switch(msg->msg_type) { - case UNI_MSG_CALP: - (void) unisig_vc_state(usp, uvp, - UNI_VC_CALLP_MSG, msg); - break; - case UNI_MSG_CONN: - (void) unisig_vc_state(usp, uvp, - UNI_VC_CONNECT_MSG, msg); - break; - case UNI_MSG_CACK: - (void) unisig_vc_state(usp, uvp, - UNI_VC_CNCTACK_MSG, msg); - break; - case UNI_MSG_SETU: - unisig_rcv_setup(usp, msg); - break; - case UNI_MSG_RLSE: - (void) unisig_vc_state(usp, uvp, - UNI_VC_RELEASE_MSG, msg); - break; - case UNI_MSG_RLSC: - /* - * Ignore a RELEASE COMPLETE with an unrecognized - * call reference value - */ - if (uvp) { - (void) unisig_vc_state(usp, uvp, - UNI_VC_RLSCMP_MSG, msg); - } - break; - case UNI_MSG_RSTR: - unisig_rcv_restart(usp, msg); - break; - case UNI_MSG_RSTA: - break; - case UNI_MSG_STAT: - (void) unisig_vc_state(usp, uvp, - UNI_VC_STATUS_MSG, msg); - break; - case UNI_MSG_SENQ: - (void) unisig_vc_state(usp, uvp, - UNI_VC_STATUSENQ_MSG, msg); - break; - case UNI_MSG_ADDP: - (void) unisig_vc_state(usp, uvp, - UNI_VC_ADDP_MSG, msg); - break; - case UNI_MSG_ADPA: - (void) unisig_vc_state(usp, uvp, - UNI_VC_ADDPACK_MSG, msg); - break; - case UNI_MSG_ADPR: - (void) unisig_vc_state(usp, uvp, - UNI_VC_ADDPREJ_MSG, msg); - break; - case UNI_MSG_DRPP: - (void) unisig_vc_state(usp, uvp, - UNI_VC_DROP_MSG, msg); - break; - case UNI_MSG_DRPA: - (void) unisig_vc_state(usp, uvp, - UNI_VC_DROPACK_MSG, msg); - break; - default: - /* - * Message size didn't match size received - */ - err = unisig_send_status(usp, uvp, msg, - UNI_IE_CAUS_MTEXIST); - } - -done: - /* - * Handle message errors that require a response - */ - switch(err) { - case EMSGSIZE: - /* - * Message size didn't match size received - */ - err = unisig_send_status(usp, uvp, msg, - UNI_IE_CAUS_LEN); - break; - } - - /* - * Free the incoming message (both buffer and internal format) - * if necessary. - */ - if (msg) - unisig_free_msg(msg); - if (m) - KB_FREEALL(m); - - return (err); -} Property changes on: head/sys/netatm/uni/unisig_msg.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_msg.h =================================================================== --- head/sys/netatm/uni/unisig_msg.h (revision 179307) +++ head/sys/netatm/uni/unisig_msg.h (nonexistent) @@ -1,953 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message formatting blocks - * - */ - -#ifndef _UNI_SIG_MSG_H -#define _UNI_SIG_MSG_H - -#define UNI_MSG_DISC_Q93B 0x09 -#define UNI_MSG_MIN_LEN 9 - -/* - * Values for Q.2931 message type. - */ -#define UNI_MSG_CALP 0x02 -#define UNI_MSG_CONN 0x07 -#define UNI_MSG_CACK 0x0F -#define UNI_MSG_SETU 0x05 -#define UNI_MSG_RLSE 0x4D -#define UNI_MSG_RLSC 0x5A -#define UNI_MSG_RSTR 0x46 -#define UNI_MSG_RSTA 0x4E -#define UNI_MSG_STAT 0x7D -#define UNI_MSG_SENQ 0x75 -#define UNI_MSG_ADDP 0x80 -#define UNI_MSG_ADPA 0x81 -#define UNI_MSG_ADPR 0x82 -#define UNI_MSG_DRPP 0x83 -#define UNI_MSG_DRPA 0x84 - - -/* - * Values for information element identifier. - */ -#define UNI_IE_CAUS 0x08 -#define UNI_IE_CLST 0x14 -#define UNI_IE_EPRF 0x54 -#define UNI_IE_EPST 0x55 -#define UNI_IE_AALP 0x58 -#define UNI_IE_CLRT 0x59 -#define UNI_IE_CNID 0x5A -#define UNI_IE_QOSP 0x5C -#define UNI_IE_BHLI 0x5D -#define UNI_IE_BBCP 0x5E -#define UNI_IE_BLLI 0x5F -#define UNI_IE_BLSH 0x60 -#define UNI_IE_BNSH 0x61 -#define UNI_IE_BSDC 0x62 -#define UNI_IE_BRPI 0x63 -#define UNI_IE_CGAD 0x6C -#define UNI_IE_CGSA 0x6D -#define UNI_IE_CDAD 0x70 -#define UNI_IE_CDSA 0x71 -#define UNI_IE_TRNT 0x78 -#define UNI_IE_RSTI 0x79 - -/* - * Masks for information element extension in bit 8 - */ -#define UNI_IE_EXT_BIT 0x80 -#define UNI_IE_EXT_MASK 0x7F - - -/* - * Signalling message in internal format. - */ -#define UNI_MSG_IE_CNT 22 - -struct unisig_msg { - u_int msg_call_ref; - u_char msg_type; - u_char msg_type_flag; - u_char msg_type_action; - int msg_length; - struct ie_generic *msg_ie_vec[UNI_MSG_IE_CNT]; -}; - -#define UNI_MSG_CALL_REF_RMT 0x800000 -#define UNI_MSG_CALL_REF_MASK 0x7FFFFF -#define UNI_MSG_CALL_REF_GLOBAL 0 -#define UNI_MSG_CALL_REF_DUMMY 0x7FFFFF - -#define EXTRACT_CREF(x) \ - ((x) & UNI_MSG_CALL_REF_RMT ? (x) & UNI_MSG_CALL_REF_MASK : (x) | UNI_MSG_CALL_REF_RMT) -#define GLOBAL_CREF(x) (((x) & UNI_MSG_CALL_REF_MASK) == UNI_MSG_CALL_REF_GLOBAL) -#define DUMMY_CREF(x) (((x) & UNI_MSG_CALL_REF_MASK) == UNI_MSG_CALL_REF_DUMMY) - -#define UNI_MSG_TYPE_FLAG_MASK 1 -#define UNI_MSG_TYPE_FLAG_SHIFT 4 - -#define UNI_MSG_TYPE_ACT_CLEAR 0 -#define UNI_MSG_TYPE_ACT_DISC 1 -#define UNI_MSG_TYPE_ACT_RPRT 2 -#define UNI_MSG_TYPE_ACT_RSVD 3 -#define UNI_MSG_TYPE_ACT_MASK 3 - -#define UNI_MSG_IE_AALP 0 -#define UNI_MSG_IE_CLRT 1 -#define UNI_MSG_IE_BBCP 2 -#define UNI_MSG_IE_BHLI 3 -#define UNI_MSG_IE_BLLI 4 -#define UNI_MSG_IE_CLST 5 -#define UNI_MSG_IE_CDAD 6 -#define UNI_MSG_IE_CDSA 7 -#define UNI_MSG_IE_CGAD 8 -#define UNI_MSG_IE_CGSA 9 -#define UNI_MSG_IE_CAUS 10 -#define UNI_MSG_IE_CNID 11 -#define UNI_MSG_IE_QOSP 12 -#define UNI_MSG_IE_BRPI 13 -#define UNI_MSG_IE_RSTI 14 -#define UNI_MSG_IE_BLSH 15 -#define UNI_MSG_IE_BNSH 16 -#define UNI_MSG_IE_BSDC 17 -#define UNI_MSG_IE_TRNT 18 -#define UNI_MSG_IE_EPRF 19 -#define UNI_MSG_IE_EPST 20 -#define UNI_MSG_IE_ERR 21 - -#define msg_ie_aalp msg_ie_vec[UNI_MSG_IE_AALP] -#define msg_ie_clrt msg_ie_vec[UNI_MSG_IE_CLRT] -#define msg_ie_bbcp msg_ie_vec[UNI_MSG_IE_BBCP] -#define msg_ie_bhli msg_ie_vec[UNI_MSG_IE_BHLI] -#define msg_ie_blli msg_ie_vec[UNI_MSG_IE_BLLI] -#define msg_ie_clst msg_ie_vec[UNI_MSG_IE_CLST] -#define msg_ie_cdad msg_ie_vec[UNI_MSG_IE_CDAD] -#define msg_ie_cdsa msg_ie_vec[UNI_MSG_IE_CDSA] -#define msg_ie_cgad msg_ie_vec[UNI_MSG_IE_CGAD] -#define msg_ie_cgsa msg_ie_vec[UNI_MSG_IE_CGSA] -#define msg_ie_caus msg_ie_vec[UNI_MSG_IE_CAUS] -#define msg_ie_cnid msg_ie_vec[UNI_MSG_IE_CNID] -#define msg_ie_qosp msg_ie_vec[UNI_MSG_IE_QOSP] -#define msg_ie_brpi msg_ie_vec[UNI_MSG_IE_BRPI] -#define msg_ie_rsti msg_ie_vec[UNI_MSG_IE_RSTI] -#define msg_ie_blsh msg_ie_vec[UNI_MSG_IE_BLSH] -#define msg_ie_bnsh msg_ie_vec[UNI_MSG_IE_BNSH] -#define msg_ie_bsdc msg_ie_vec[UNI_MSG_IE_BSDC] -#define msg_ie_trnt msg_ie_vec[UNI_MSG_IE_TRNT] -#define msg_ie_eprf msg_ie_vec[UNI_MSG_IE_EPRF] -#define msg_ie_epst msg_ie_vec[UNI_MSG_IE_EPST] -#define msg_ie_err msg_ie_vec[UNI_MSG_IE_ERR] - - -/* - * Information element header. - */ -struct ie_hdr { - u_char ie_hdr_ident; - u_char ie_hdr_coding; - u_char ie_hdr_flag; - u_char ie_hdr_action; - int ie_hdr_length; - int ie_hdr_err_cause; - struct ie_generic *ie_hdr_next; -}; - -#define UNI_IE_HDR_LEN 4 - -#define UNI_IE_CODE_CCITT 0 -#define UNI_IE_CODE_STD 3 -#define UNI_IE_CODE_MASK 3 -#define UNI_IE_CODE_SHIFT 5 - -#define UNI_IE_FLAG_MASK 1 -#define UNI_IE_FLAG_SHIFT 4 - -#define UNI_IE_ACT_CLEAR 0 -#define UNI_IE_ACT_DIS 1 -#define UNI_IE_ACT_RPRT 2 -#define UNI_IE_ACT_DMSGIGN 5 -#define UNI_IE_ACT_DMSGRPRT 6 -#define UNI_IE_ACT_MASK 7 - - -/* - * ATM AAL parameters information element in internal format. - */ -struct ie_aalp { - int8_t ie_aal_type; - union { - struct aal_type_1_parm { - u_char subtype; - u_char cbr_rate; - u_short multiplier; - u_char clock_recovery; - u_char error_correction; - u_char struct_data_tran; - u_char partial_cells; - } type_1; - struct aal_type_4_parm { - int32_t fwd_max_sdu; - int32_t bkwd_max_sdu; - int32_t mid_range; - u_char mode; - u_char sscs_type; - } type_4; - struct aal_type_5_parm { - int32_t fwd_max_sdu; - int32_t bkwd_max_sdu; - u_char mode; - u_char sscs_type; - } type_5; - struct user_aal_type { - u_char aal_info[4]; - } type_user; - } aal_u; -}; - -#define UNI_IE_AALP_AT_AAL1 1 -#define UNI_IE_AALP_AT_AAL3 3 -#define UNI_IE_AALP_AT_AAL5 5 -#define UNI_IE_AALP_AT_AALU 16 - -#define UNI_IE_AALP_A1_ST_NULL 0 -#define UNI_IE_AALP_A1_ST_VCE 1 -#define UNI_IE_AALP_A1_ST_SCE 2 -#define UNI_IE_AALP_A1_ST_ACE 3 -#define UNI_IE_AALP_A1_ST_HQA 4 -#define UNI_IE_AALP_A1_ST_VID 5 - -#define UNI_IE_AALP_A1_CB_64 1 -#define UNI_IE_AALP_A1_CB_DS1 4 -#define UNI_IE_AALP_A1_CB_DS2 5 -#define UNI_IE_AALP_A1_CB_32064 6 -#define UNI_IE_AALP_A1_CB_DS3 7 -#define UNI_IE_AALP_A1_CB_97728 8 -#define UNI_IE_AALP_A1_CB_E1 16 -#define UNI_IE_AALP_A1_CB_E2 17 -#define UNI_IE_AALP_A1_CB_E3 18 -#define UNI_IE_AALP_A1_CB_139264 19 -#define UNI_IE_AALP_A1_CB_N64 64 - -#define UNI_IE_AALP_A1_CR_NULL 0 -#define UNI_IE_AALP_A1_CR_SRTS 1 -#define UNI_IE_AALP_A1_CR_ACR 2 - -#define UNI_IE_AALP_A1_EC_NULL 0 -#define UNI_IE_AALP_A1_EC_FEC 1 - -#define UNI_IE_AALP_A1_SD_NULL 0 -#define UNI_IE_AALP_A1_SD_SDT 1 - -#define UNI_IE_AALP_A3_R_MASK 1023 -#define UNI_IE_AALP_A3_R_SHIFT 16 - -#define UNI_IE_AALP_A5_M_MSG 1 -#define UNI_IE_AALP_A5_M_STR 2 - -#define UNI_IE_AALP_A5_ST_NULL 0 -#define UNI_IE_AALP_A5_ST_AO 1 -#define UNI_IE_AALP_A5_ST_NAO 2 -#define UNI_IE_AALP_A5_ST_FR 4 - - -/* - * ATM user cell rate information element in internal format. - */ -struct ie_clrt { - int32_t ie_fwd_peak; - int32_t ie_bkwd_peak; - int32_t ie_fwd_peak_01; - int32_t ie_bkwd_peak_01; - int32_t ie_fwd_sust; - int32_t ie_bkwd_sust; - int32_t ie_fwd_sust_01; - int32_t ie_bkwd_sust_01; - int32_t ie_fwd_burst; - int32_t ie_bkwd_burst; - int32_t ie_fwd_burst_01; - int32_t ie_bkwd_burst_01; - int8_t ie_best_effort; - int8_t ie_tm_options; -}; - -#define UNI_IE_CLRT_FWD_PEAK_ID 130 -#define UNI_IE_CLRT_BKWD_PEAK_ID 131 -#define UNI_IE_CLRT_FWD_PEAK_01_ID 132 -#define UNI_IE_CLRT_BKWD_PEAK_01_ID 133 -#define UNI_IE_CLRT_FWD_SUST_ID 136 -#define UNI_IE_CLRT_BKWD_SUST_ID 137 -#define UNI_IE_CLRT_FWD_SUST_01_ID 144 -#define UNI_IE_CLRT_BKWD_SUST_01_ID 145 -#define UNI_IE_CLRT_FWD_BURST_ID 160 -#define UNI_IE_CLRT_BKWD_BURST_ID 161 -#define UNI_IE_CLRT_FWD_BURST_01_ID 176 -#define UNI_IE_CLRT_BKWD_BURST_01_ID 177 -#define UNI_IE_CLRT_BEST_EFFORT_ID 190 -#define UNI_IE_CLRT_TM_OPTIONS_ID 191 - -#define UNI_IE_CLRT_TM_FWD_TAG 0x01 -#define UNI_IE_CLRT_TM_BKWD_TAG 0x02 - - -/* - * Broadband bearer capability information element in internal format. - */ -struct ie_bbcp { - int8_t ie_bearer_class; - int8_t ie_traffic_type; - int8_t ie_timing_req; - int8_t ie_clipping; - int8_t ie_conn_config; -}; - - -#define UNI_IE_BBCP_BC_BCOB_A 1 -#define UNI_IE_BBCP_BC_BCOB_C 3 -#define UNI_IE_BBCP_BC_BCOB_X 16 -#define UNI_IE_BBCP_BC_MASK 0x1F - -#define UNI_IE_BBCP_TT_NIND 0 -#define UNI_IE_BBCP_TT_CBR 1 -#define UNI_IE_BBCP_TT_VBR 2 -#define UNI_IE_BBCP_TT_MASK 3 -#define UNI_IE_BBCP_TT_SHIFT 2 - -#define UNI_IE_BBCP_TR_NIND 0 -#define UNI_IE_BBCP_TR_EER 1 -#define UNI_IE_BBCP_TR_EENR 2 -#define UNI_IE_BBCP_TR_RSVD 3 -#define UNI_IE_BBCP_TR_MASK 3 - -#define UNI_IE_BBCP_SC_NSUS 0 -#define UNI_IE_BBCP_SC_SUS 1 -#define UNI_IE_BBCP_SC_MASK 3 -#define UNI_IE_BBCP_SC_SHIFT 5 - -#define UNI_IE_BBCP_CC_PP 0 -#define UNI_IE_BBCP_CC_PM 1 -#define UNI_IE_BBCP_CC_MASK 3 - - -/* - * Broadband high layer information information element in internal - * format. - */ -struct ie_bhli { - int8_t ie_type; - u_char ie_info[8]; -}; - -#define UNI_IE_BHLI_TYPE_ISO 0 -#define UNI_IE_BHLI_TYPE_USER 1 -#define UNI_IE_BHLI_TYPE_HLP 2 -#define UNI_IE_BHLI_TYPE_VSA 3 - -#define UNI_IE_BHLI_HLP_LEN 4 -#define UNI_IE_BHLI_VSA_LEN 7 - - -/* - * Broadband low-layer information information element in internal - * format. - */ -struct ie_blli { - int8_t ie_l1_id; - int8_t ie_l2_id; - int8_t ie_l2_mode; - int8_t ie_l2_q933_use; - int8_t ie_l2_window; - int8_t ie_l2_user_proto; - int8_t ie_l3_id; - int8_t ie_l3_mode; - int8_t ie_l3_packet_size; - int8_t ie_l3_window; - int8_t ie_l3_user_proto; - int16_t ie_l3_ipi; - int8_t ie_l3_snap_id; - u_char ie_l3_oui[3]; - u_char ie_l3_pid[2]; -}; - -#define UNI_IE_BLLI_L1_ID 1 -#define UNI_IE_BLLI_L2_ID 2 -#define UNI_IE_BLLI_L3_ID 3 -#define UNI_IE_BLLI_LID_MASK 3 -#define UNI_IE_BLLI_LID_SHIFT 5 -#define UNI_IE_BLLI_LP_MASK 31 - -#define UNI_IE_BLLI_L2P_ISO1745 1 -#define UNI_IE_BLLI_L2P_Q921 2 -#define UNI_IE_BLLI_L2P_X25L 6 -#define UNI_IE_BLLI_L2P_X25M 7 -#define UNI_IE_BLLI_L2P_LAPB 8 -#define UNI_IE_BLLI_L2P_HDLC1 9 -#define UNI_IE_BLLI_L2P_HDLC2 10 -#define UNI_IE_BLLI_L2P_HDLC3 11 -#define UNI_IE_BLLI_L2P_LLC 12 -#define UNI_IE_BLLI_L2P_X75 13 -#define UNI_IE_BLLI_L2P_Q922 14 -#define UNI_IE_BLLI_L2P_USER 16 -#define UNI_IE_BLLI_L2P_ISO7776 17 - -#define UNI_IE_BLLI_L2MODE_NORM 1 -#define UNI_IE_BLLI_L2MODE_EXT 2 -#define UNI_IE_BLLI_L2MODE_SHIFT 5 -#define UNI_IE_BLLI_L2MODE_MASK 3 - -#define UNI_IE_BLLI_Q933_ALT 0 - -#define UNI_IE_BLLI_L3P_X25 6 -#define UNI_IE_BLLI_L3P_ISO8208 7 -#define UNI_IE_BLLI_L3P_ISO8878 8 -#define UNI_IE_BLLI_L3P_ISO8473 9 -#define UNI_IE_BLLI_L3P_T70 10 -#define UNI_IE_BLLI_L3P_ISO9577 11 -#define UNI_IE_BLLI_L3P_USER 16 - -#define UNI_IE_BLLI_L3MODE_NORM 1 -#define UNI_IE_BLLI_L3MODE_EXT 2 -#define UNI_IE_BLLI_L3MODE_SHIFT 5 -#define UNI_IE_BLLI_L3MODE_MASK 3 - -#define UNI_IE_BLLI_L3PS_16 4 -#define UNI_IE_BLLI_L3PS_32 5 -#define UNI_IE_BLLI_L3PS_64 6 -#define UNI_IE_BLLI_L3PS_128 7 -#define UNI_IE_BLLI_L3PS_256 8 -#define UNI_IE_BLLI_L3PS_512 9 -#define UNI_IE_BLLI_L3PS_1024 10 -#define UNI_IE_BLLI_L3PS_2048 11 -#define UNI_IE_BLLI_L3PS_4096 12 -#define UNI_IE_BLLI_L3PS_MASK 15 - -#define UNI_IE_BLLI_L3IPI_SHIFT 6 -#define UNI_IE_BLLI_L3IPI_SNAP 0x80 - - -/* - * Call state information element in internal format. - */ -struct ie_clst { - int8_t ie_state; -}; - -#define UNI_IE_CLST_STATE_U0 0 -#define UNI_IE_CLST_STATE_U1 1 -#define UNI_IE_CLST_STATE_U3 3 -#define UNI_IE_CLST_STATE_U6 6 -#define UNI_IE_CLST_STATE_U8 8 -#define UNI_IE_CLST_STATE_U9 9 -#define UNI_IE_CLST_STATE_U10 10 -#define UNI_IE_CLST_STATE_U11 11 -#define UNI_IE_CLST_STATE_U12 12 - -#define UNI_IE_CLST_STATE_N0 0 -#define UNI_IE_CLST_STATE_N1 1 -#define UNI_IE_CLST_STATE_N3 3 -#define UNI_IE_CLST_STATE_N6 6 -#define UNI_IE_CLST_STATE_N8 8 -#define UNI_IE_CLST_STATE_N9 9 -#define UNI_IE_CLST_STATE_N10 10 -#define UNI_IE_CLST_STATE_N11 11 -#define UNI_IE_CLST_STATE_N12 12 - -#define UNI_IE_CLST_GLBL_REST0 0x00 -#define UNI_IE_CLST_GLBL_REST1 0x3d -#define UNI_IE_CLST_GLBL_REST2 0x3e - -#define UNI_IE_CLST_STATE_MASK 0x3f - - -/* - * Called party number information element in internal format. - */ -struct ie_cdad { - int8_t ie_type; - int8_t ie_plan; - Atm_addr ie_addr; -}; - -#define UNI_IE_CDAD_TYPE_UNK 0 -#define UNI_IE_CDAD_TYPE_INTL 1 -#define UNI_IE_CDAD_TYPE_MASK 7 -#define UNI_IE_CDAD_TYPE_SHIFT 4 - -#define UNI_IE_CDAD_PLAN_E164 1 -#define UNI_IE_CDAD_PLAN_NSAP 2 -#define UNI_IE_CDAD_PLAN_MASK 15 - - -/* - * Called party subaddress information element in internal format. - */ -struct ie_cdsa { - Atm_addr ie_addr; -}; - -#define UNI_IE_CDSA_TYPE_NSAP 0 -#define UNI_IE_CDSA_TYPE_AESA 1 -#define UNI_IE_CDSA_TYPE_MASK 7 -#define UNI_IE_CDSA_TYPE_SHIFT 4 - - -/* - * Calling party number information element in internal format. - */ -struct ie_cgad { - int8_t ie_type; - int8_t ie_plan; - int8_t ie_pres_ind; - int8_t ie_screen_ind; - Atm_addr ie_addr; -}; - -#define UNI_IE_CGAD_TYPE_UNK 0 -#define UNI_IE_CGAD_TYPE_INTL 1 -#define UNI_IE_CGAD_TYPE_MASK 7 -#define UNI_IE_CGAD_TYPE_SHIFT 4 - -#define UNI_IE_CGAD_PLAN_E164 1 -#define UNI_IE_CGAD_PLAN_NSAP 2 -#define UNI_IE_CGAD_PLAN_MASK 15 - -#define UNI_IE_CGAD_PRES_ALLOW 0 -#define UNI_IE_CGAD_PRES_RSTR 1 -#define UNI_IE_CGAD_PRES_NNA 2 -#define UNI_IE_CGAD_PRES_RSVD 3 -#define UNI_IE_CGAD_PRES_MASK 3 -#define UNI_IE_CGAD_PRES_SHIFT 5 - -#define UNI_IE_CGAD_SCR_UNS 0 -#define UNI_IE_CGAD_SCR_UVP 1 -#define UNI_IE_CGAD_SCR_UVF 2 -#define UNI_IE_CGAD_SCR_NET 3 -#define UNI_IE_CGAD_SCR_MASK 3 - - -/* - * Calling party subaddress information element in internal format. - */ -struct ie_cgsa { - Atm_addr ie_addr; -}; - -#define UNI_IE_CGSA_TYPE_NSAP 0 -#define UNI_IE_CGSA_TYPE_AESA 1 -#define UNI_IE_CGSA_TYPE_MASK 7 -#define UNI_IE_CGSA_TYPE_SHIFT 4 - - -/* - * Cause information element in internal format. - */ -#define UNI_IE_CAUS_MAX_ID 24 -#define UNI_IE_CAUS_MAX_QOS_SUB 24 -struct ie_caus { - int8_t ie_loc; - int8_t ie_cause; - int8_t ie_diag_len; - u_int8_t ie_diagnostic[24]; -}; - -#define UNI_IE_CAUS_LOC_USER 0 -#define UNI_IE_CAUS_LOC_PRI_LCL 1 -#define UNI_IE_CAUS_LOC_PUB_LCL 2 -#define UNI_IE_CAUS_LOC_TRANSIT 3 -#define UNI_IE_CAUS_LOC_PUB_RMT 4 -#define UNI_IE_CAUS_LOC_PRI_RMT 5 -#define UNI_IE_CAUS_LOC_INTL 7 -#define UNI_IE_CAUS_LOC_BEYOND 10 -#define UNI_IE_CAUS_LOC_MASK 15 - -#define UNI_IE_CAUS_UN_NS_SHIFT 3 -#define UNI_IE_CAUS_UN_NS_MASK 1 - -#define UNI_IE_CAUS_UN_NA_SHIFT 2 -#define UNI_IE_CAUS_UN_NA_MASK 1 - -#define UNI_IE_CAUS_UN_CAU_MASK 3 - -#define UNI_IE_CAUS_RR_USER 0 -#define UNI_IE_CAUS_RR_IE 1 -#define UNI_IE_CAUS_RR_INSUFF 2 -#define UNI_IE_CAUS_RR_SHIFT 2 -#define UNI_IE_CAUS_RR_MASK 31 - -#define UNI_IE_CAUS_RC_UNK 0 -#define UNI_IE_CAUS_RC_PERM 1 -#define UNI_IE_CAUS_RC_TRANS 2 -#define UNI_IE_CAUS_RC_MASK 3 - -/* - * Cause codes from UNI 3.0, section 5.4.5.15 - */ -#define UNI_IE_CAUS_UNO 1 /* Unallocated number */ -#define UNI_IE_CAUS_NOTROUTE 2 /* No route to transit net */ -#define UNI_IE_CAUS_NODROUTE 3 /* No route to destination */ -#define UNI_IE_CAUS_BAD_VCC 10 /* VPI/VCI unacceptable */ -#define UNI_IE_CAUS_NORM 16 /* Normal call clearing */ -#define UNI_IE_CAUS_BUSY 17 /* User busy */ -#define UNI_IE_CAUS_NORSP 18 /* No user responding */ -#define UNI_IE_CAUS_REJECT 21 /* Call rejected */ -#define UNI_IE_CAUS_CHANGED 22 /* Number changed */ -#define UNI_IE_CAUS_CLIR 23 /* User rejects CLIR */ -#define UNI_IE_CAUS_DORDER 27 /* Dest out of order */ -#define UNI_IE_CAUS_INVNO 28 /* Invalid number format */ -#define UNI_IE_CAUS_SENQ 30 /* Rsp to Status Enquiry */ -#define UNI_IE_CAUS_NORM_UNSP 31 /* Normal, unspecified */ -#define UNI_IE_CAUS_NA_VCC 35 /* VCC not available */ -#define UNI_IE_CAUS_ASSIGN_VCC 36 /* VPCI/VCI assignment failure */ -#define UNI_IE_CAUS_NORDER 38 /* Network out of order */ -#define UNI_IE_CAUS_TEMP 41 /* Temporary failure */ -#define UNI_IE_CAUS_DISCARD 43 /* Access info discarded */ -#define UNI_IE_CAUS_NO_VCC 45 /* No VPI/VCI available */ -#define UNI_IE_CAUS_UNAVAIL 47 /* Resource unavailable */ -#define UNI_IE_CAUS_NO_QOS 49 /* QoS unavailable */ -#define UNI_IE_CAUS_NO_CR 51 /* User cell rate not avail */ -#define UNI_IE_CAUS_NO_BC 57 /* Bearer capability not auth */ -#define UNI_IE_CAUS_NA_BC 58 /* Bearer capability n/a */ -#define UNI_IE_CAUS_SERVICE 63 /* Service or opt not avail */ -#define UNI_IE_CAUS_NI_BC 65 /* Bearer cap not implemented */ -#define UNI_IE_CAUS_COMB 73 /* Unsupported combination */ -#define UNI_IE_CAUS_CREF 81 /* Invalid call reference */ -#define UNI_IE_CAUS_CEXIST 82 /* Channel does not exist */ -#define UNI_IE_CAUS_IDEST 88 /* Incompatible destination */ -#define UNI_IE_CAUS_ENDPT 89 /* Invalid endpoint reference */ -#define UNI_IE_CAUS_TRNET 91 /* Invalid transit net */ -#define UNI_IE_CAUS_APPEND 92 /* Too many pending add party */ -#define UNI_IE_CAUS_UAAL 93 /* AAL parms can't be supp */ -#define UNI_IE_CAUS_MISSING 96 /* Mandatory IE missing */ -#define UNI_IE_CAUS_MTEXIST 97 /* Message type nonexistent */ -#define UNI_IE_CAUS_IEEXIST 99 /* IE type nonexistent */ -#define UNI_IE_CAUS_IECONTENT 100 /* IE content invalid */ -#define UNI_IE_CAUS_STATE 101 /* Message incomp with state */ -#define UNI_IE_CAUS_TIMER 102 /* Recovery on timer expire */ -#define UNI_IE_CAUS_LEN 104 /* Incorrect message length */ -#define UNI_IE_CAUS_PROTO 111 /* Protocol error */ - - -/* - * Connection identifier information element in internal format. - */ -struct ie_cnid { - int8_t ie_vp_sig; - int8_t ie_pref_excl; - u_short ie_vpci; - u_short ie_vci; -}; - -#define UNI_IE_CNID_VPSIG_MASK 3 -#define UNI_IE_CNID_VPSIG_SHIFT 3 -#define UNI_IE_CNID_PREX_MASK 7 - -#define UNI_IE_CNID_MIN_VCI 32 - - -/* - * Quality of service parameter information element in internal format. - */ -struct ie_qosp { - int8_t ie_fwd_class; - int8_t ie_bkwd_class; -}; - -#define UNI_IE_QOSP_FWD_CLASS_0 0 -#define UNI_IE_QOSP_FWD_CLASS_1 1 -#define UNI_IE_QOSP_FWD_CLASS_2 2 -#define UNI_IE_QOSP_FWD_CLASS_3 3 -#define UNI_IE_QOSP_FWD_CLASS_4 4 - -#define UNI_IE_QOSP_BKWD_CLASS_0 0 -#define UNI_IE_QOSP_BKWD_CLASS_1 1 -#define UNI_IE_QOSP_BKWD_CLASS_2 2 -#define UNI_IE_QOSP_BKWD_CLASS_3 3 -#define UNI_IE_QOSP_BKWD_CLASS_4 4 - - -/* - * Broadband repeat indicator information element in internal format. - */ -struct ie_brpi { - int8_t ie_ind; -}; - -#define UNI_IE_BRPI_PRI_LIST 2 -#define UNI_IE_BRPI_IND_MASK 15 - - -/* - * Restart indicator information element in internal format. - */ -struct ie_rsti { - int8_t ie_class; -}; - -#define UNI_IE_RSTI_IND_VC 0 -#define UNI_IE_RSTI_ALL_VC 2 -#define UNI_IE_RSTI_CLASS_MASK 3 - - -/* - * Broadband locking shift information element in internal format. - */ -struct ie_blsh { - int8_t ie_dummy; -}; - - -/* - * Broadband non-locking shift information element in internal format. - */ -struct ie_bnsh { - int8_t ie_dummy; -}; - - -/* - * Broadband sending complete information element in internal format. - */ -struct ie_bsdc { - int8_t ie_ind; -}; - -#define UNI_IE_BSDC_IND 0x21 - - -/* - * Transit net selection information element in internal format. - */ -struct ie_trnt { - int8_t ie_id_type; - int8_t ie_id_plan; - u_char ie_id_len; - u_char ie_id[4]; -}; - -#define UNI_IE_TRNT_IDT_MASK 7 -#define UNI_IE_TRNT_IDT_SHIFT 4 -#define UNI_IE_TRNT_IDP_MASK 15 - -#define UNI_IE_TRNT_IDT_NATL 2 -#define UNI_IE_TRNT_IDP_CIC 1 - - -/* - * Endpoint reference information element in internal format. - */ -struct ie_eprf { - int8_t ie_type; - int16_t ie_id; -}; - -#define UNI_IE_EPRF_LDI 0 - - -/* - * Endpoint state information element in internal format. - */ -struct ie_epst { - int8_t ie_state; -}; - -#define UNI_IE_EPST_NULL 0 -#define UNI_IE_EPST_API 1 -#define UNI_IE_EPST_APR 6 -#define UNI_IE_EPST_DPI 11 -#define UNI_IE_EPST_DPR 12 -#define UNI_IE_EPST_ACTIVE 10 -#define UNI_IE_EPST_STATE_MASK 0x3F - - -/* - * Generic information element - */ -struct ie_generic { - struct ie_hdr ie_hdr; - union { - struct ie_aalp ie_aalp; - struct ie_clrt ie_clrt; - struct ie_bbcp ie_bbcp; - struct ie_bhli ie_bhli; - struct ie_blli ie_blli; - struct ie_clst ie_clst; - struct ie_cdad ie_cdad; - struct ie_cdsa ie_cdsa; - struct ie_cgad ie_cgad; - struct ie_cgsa ie_cgsa; - struct ie_caus ie_caus; - struct ie_cnid ie_cnid; - struct ie_qosp ie_qosp; - struct ie_brpi ie_brpi; - struct ie_rsti ie_rsti; - struct ie_blsh ie_blsh; - struct ie_bnsh ie_bnsh; - struct ie_bsdc ie_bsdc; - struct ie_trnt ie_trnt; - struct ie_eprf ie_eprf; - struct ie_epst ie_epst; - } ie_u; -}; - -#define ie_ident ie_hdr.ie_hdr_ident -#define ie_coding ie_hdr.ie_hdr_coding -#define ie_flag ie_hdr.ie_hdr_flag -#define ie_action ie_hdr.ie_hdr_action -#define ie_length ie_hdr.ie_hdr_length -#define ie_err_cause ie_hdr.ie_hdr_err_cause -#define ie_next ie_hdr.ie_hdr_next - -#define ie_aalp_aal_type ie_u.ie_aalp.ie_aal_type -#define ie_aalp_1_subtype ie_u.ie_aalp.aal_u.type_1.subtype -#define ie_aalp_1_cbr_rate ie_u.ie_aalp.aal_u.type_1.cbr_rate -#define ie_aalp_1_multiplier ie_u.ie_aalp.aal_u.type_1.multiplier -#define ie_aalp_1_clock_recovery ie_u.ie_aalp.aal_u.type_1.clock_recovery -#define ie_aalp_1_error_correction ie_u.ie_aalp.aal_u.type_1.error_correction -#define ie_aalp_1_struct_data_tran ie_u.ie_aalp.aal_u.type_1.struct_data_tran -#define ie_aalp_1_partial_cells ie_u.ie_aalp.aal_u.type_1.partial_cells - -#define ie_aalp_4_fwd_max_sdu ie_u.ie_aalp.aal_u.type_4.fwd_max_sdu -#define ie_aalp_4_bkwd_max_sdu ie_u.ie_aalp.aal_u.type_4.bkwd_max_sdu -#define ie_aalp_4_mid_range ie_u.ie_aalp.aal_u.type_4.mid_range -#define ie_aalp_4_mode ie_u.ie_aalp.aal_u.type_4.mode -#define ie_aalp_4_sscs_type ie_u.ie_aalp.aal_u.type_4.sscs_type - -#define ie_aalp_5_fwd_max_sdu ie_u.ie_aalp.aal_u.type_5.fwd_max_sdu -#define ie_aalp_5_bkwd_max_sdu ie_u.ie_aalp.aal_u.type_5.bkwd_max_sdu -#define ie_aalp_5_mode ie_u.ie_aalp.aal_u.type_5.mode -#define ie_aalp_5_sscs_type ie_u.ie_aalp.aal_u.type_5.sscs_type -#define ie_aalp_user_info ie_u.ie_aalp.aal_u.type_user.aal_info - -#define ie_clrt_fwd_peak ie_u.ie_clrt.ie_fwd_peak -#define ie_clrt_bkwd_peak ie_u.ie_clrt.ie_bkwd_peak -#define ie_clrt_fwd_peak_01 ie_u.ie_clrt.ie_fwd_peak_01 -#define ie_clrt_bkwd_peak_01 ie_u.ie_clrt.ie_bkwd_peak_01 -#define ie_clrt_fwd_sust ie_u.ie_clrt.ie_fwd_sust -#define ie_clrt_bkwd_sust ie_u.ie_clrt.ie_bkwd_sust -#define ie_clrt_fwd_sust_01 ie_u.ie_clrt.ie_fwd_sust_01 -#define ie_clrt_bkwd_sust_01 ie_u.ie_clrt.ie_bkwd_sust_01 -#define ie_clrt_fwd_burst ie_u.ie_clrt.ie_fwd_burst -#define ie_clrt_bkwd_burst ie_u.ie_clrt.ie_bkwd_burst -#define ie_clrt_fwd_burst_01 ie_u.ie_clrt.ie_fwd_burst_01 -#define ie_clrt_bkwd_burst_01 ie_u.ie_clrt.ie_bkwd_burst_01 -#define ie_clrt_best_effort ie_u.ie_clrt.ie_best_effort -#define ie_clrt_tm_options ie_u.ie_clrt.ie_tm_options - -#define ie_bbcp_bearer_class ie_u.ie_bbcp.ie_bearer_class -#define ie_bbcp_traffic_type ie_u.ie_bbcp.ie_traffic_type -#define ie_bbcp_timing_req ie_u.ie_bbcp.ie_timing_req -#define ie_bbcp_clipping ie_u.ie_bbcp.ie_clipping -#define ie_bbcp_conn_config ie_u.ie_bbcp.ie_conn_config - -#define ie_bhli_type ie_u.ie_bhli.ie_type -#define ie_bhli_info ie_u.ie_bhli.ie_info - -#define ie_blli_l1_id ie_u.ie_blli.ie_l1_id -#define ie_blli_l2_id ie_u.ie_blli.ie_l2_id -#define ie_blli_l2_mode ie_u.ie_blli.ie_l2_mode -#define ie_blli_l2_q933_use ie_u.ie_blli.ie_l2_q933_use -#define ie_blli_l2_window ie_u.ie_blli.ie_l2_window -#define ie_blli_l2_user_proto ie_u.ie_blli.ie_l2_user_proto -#define ie_blli_l3_id ie_u.ie_blli.ie_l3_id -#define ie_blli_l3_mode ie_u.ie_blli.ie_l3_mode -#define ie_blli_l3_packet_size ie_u.ie_blli.ie_l3_packet_size -#define ie_blli_l3_window ie_u.ie_blli.ie_l3_window -#define ie_blli_l3_user_proto ie_u.ie_blli.ie_l3_user_proto -#define ie_blli_l3_ipi ie_u.ie_blli.ie_l3_ipi -#define ie_blli_l3_snap_id ie_u.ie_blli.ie_l3_snap_id -#define ie_blli_l3_oui ie_u.ie_blli.ie_l3_oui -#define ie_blli_l3_pid ie_u.ie_blli.ie_l3_pid - -#define ie_clst_state ie_u.ie_clst.ie_state - -#define ie_cdad_type ie_u.ie_cdad.ie_type -#define ie_cdad_plan ie_u.ie_cdad.ie_plan -#define ie_cdad_addr ie_u.ie_cdad.ie_addr - -#define ie_cdsa_addr ie_u.ie_cdsa.ie_addr - -#define ie_cgad_type ie_u.ie_cgad.ie_type -#define ie_cgad_plan ie_u.ie_cgad.ie_plan -#define ie_cgad_pres_ind ie_u.ie_cgad.ie_pres_ind -#define ie_cgad_screen_ind ie_u.ie_cgad.ie_screen_ind -#define ie_cgad_addr ie_u.ie_cgad.ie_addr - -#define ie_cgsa_addr ie_u.ie_cgsa.ie_addr - -#define ie_caus_loc ie_u.ie_caus.ie_loc -#define ie_caus_cause ie_u.ie_caus.ie_cause -#define ie_caus_diag_len ie_u.ie_caus.ie_diag_len -#define ie_caus_diagnostic ie_u.ie_caus.ie_diagnostic - -#define ie_cnid_vp_sig ie_u.ie_cnid.ie_vp_sig -#define ie_cnid_pref_excl ie_u.ie_cnid.ie_pref_excl -#define ie_cnid_vpci ie_u.ie_cnid.ie_vpci -#define ie_cnid_vci ie_u.ie_cnid.ie_vci - -#define ie_qosp_fwd_class ie_u.ie_qosp.ie_fwd_class -#define ie_qosp_bkwd_class ie_u.ie_qosp.ie_bkwd_class - -#define ie_brpi_ind ie_u.ie_brpi.ie_ind - -#define ie_rsti_class ie_u.ie_rsti.ie_class - -#define ie_bsdc_ind ie_u.ie_bsdc.ie_ind - -#define ie_trnt_id_type ie_u.ie_trnt.ie_id_type -#define ie_trnt_id_plan ie_u.ie_trnt.ie_id_plan -#define ie_trnt_id_len ie_u.ie_trnt.ie_id_len -#define ie_trnt_id ie_u.ie_trnt.ie_id - -#define ie_eprf_type ie_u.ie_eprf.ie_type -#define ie_eprf_id ie_u.ie_eprf.ie_id - -#define ie_epst_state ie_u.ie_epst.ie_state - -/* - * Macro to add an IE to the end of a list of IEs - */ -#define MSG_IE_ADD(m, i, ind) \ - if (m->msg_ie_vec[ind]) { \ - struct ie_generic *_iep = msg->msg_ie_vec[ind]; \ - while (_iep->ie_next) { \ - _iep = _iep->ie_next; \ - } \ - _iep->ie_next = i; \ - } else { \ - m->msg_ie_vec[ind] = i; \ - } - -#endif /* _UNI_SIG_MSG_H */ Property changes on: head/sys/netatm/uni/unisig_msg.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/q2110_sigaa.c =================================================================== --- head/sys/netatm/uni/q2110_sigaa.c (revision 179307) +++ head/sys/netatm/uni/q2110_sigaa.c (nonexistent) @@ -1,516 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.2110 - Process AA-signals (SAP_SSCOP) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static void sscop_resreq_ready(struct sscop *, intptr_t, intptr_t); -static void sscop_resrsp_inresyn(struct sscop *, intptr_t, intptr_t); -static void sscop_recrsp_recovrsp(struct sscop *, intptr_t, intptr_t); -static void sscop_recrsp_inrecov(struct sscop *, intptr_t, intptr_t); - - -/* - * Stack command state lookup tables - */ -/* SSCOP_INIT */ -static void (*sscop_init_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - sscop_init_inst, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - NULL /* SOS_TERM */ -}; - -/* SSCOP_TERM */ -static void (*sscop_term_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - sscop_term_all, /* SOS_INST */ - sscop_term_all, /* SOS_IDLE */ - sscop_term_all, /* SOS_OUTCONN */ - sscop_term_all, /* SOS_INCONN */ - sscop_term_all, /* SOS_OUTDISC */ - sscop_term_all, /* SOS_OUTRESYN */ - sscop_term_all, /* SOS_INRESYN */ - sscop_term_all, /* SOS_OUTRECOV */ - sscop_term_all, /* SOS_RECOVRSP */ - sscop_term_all, /* SOS_INRECOV */ - sscop_term_all, /* SOS_READY */ - sscop_term_all /* SOS_TERM */ -}; - -/* SSCOP_ESTABLISH_REQ */ -static void (*sscop_estreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - sscop_estreq_idle, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - sscop_estreq_idle, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_ESTABLISH_RSP */ -static void (*sscop_estrsp_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - sscop_estrsp_inconn, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RELEASE_REQ */ -static void (*sscop_relreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - sscop_relreq_outconn, /* SOS_OUTCONN */ - sscop_relreq_inconn, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - sscop_relreq_outconn, /* SOS_OUTRESYN */ - sscop_relreq_outconn, /* SOS_INRESYN */ - sscop_relreq_ready, /* SOS_OUTRECOV */ - sscop_relreq_outconn, /* SOS_RECOVRSP */ - sscop_relreq_outconn, /* SOS_INRECOV */ - sscop_relreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_DATA_REQ */ -static void (*sscop_datreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - sscop_aa_noop_1, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - sscop_datreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RESYNC_REQ */ -static void (*sscop_resreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - sscop_resreq_ready, /* SOS_OUTRECOV */ - sscop_resreq_ready, /* SOS_RECOVRSP */ - sscop_resreq_ready, /* SOS_INRECOV */ - sscop_resreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RESYNC_RSP */ -static void (*sscop_resrsp_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - sscop_resrsp_inresyn, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - sscop_aa_noop_0 /* SOS_TERM */ -}; - -/* SSCOP_RECOVER_RSP */ -static void (*sscop_recrsp_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - sscop_recrsp_recovrsp, /* SOS_RECOVRSP */ - sscop_recrsp_inrecov, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - sscop_aa_noop_0 /* SOS_TERM */ -}; - -/* SSCOP_UNITDATA_REQ */ -static void (*sscop_udtreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - sscop_udtreq_all, /* SOS_IDLE */ - sscop_udtreq_all, /* SOS_OUTCONN */ - sscop_udtreq_all, /* SOS_INCONN */ - sscop_udtreq_all, /* SOS_OUTDISC */ - sscop_udtreq_all, /* SOS_OUTRESYN */ - sscop_udtreq_all, /* SOS_INRESYN */ - sscop_udtreq_all, /* SOS_OUTRECOV */ - sscop_udtreq_all, /* SOS_RECOVRSP */ - sscop_udtreq_all, /* SOS_INRECOV */ - sscop_udtreq_all, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RETRIEVE_REQ */ -static void (*sscop_retreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_OUTRECOV */ - NULL, /* SOS_RECOVRSP */ - NULL, /* SOS_INRECOV */ - NULL, /* SOS_READY */ - NULL /* SOS_TERM */ -}; - - -/* - * Stack command lookup table - */ -void (*(*sscop_q2110_aatab[SSCOP_CMD_SIZE])) - (struct sscop *, intptr_t, intptr_t) = { - NULL, - sscop_init_tab, - sscop_term_tab, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - sscop_estreq_tab, - NULL, - sscop_estrsp_tab, - NULL, - sscop_relreq_tab, - NULL, - NULL, - sscop_datreq_tab, - NULL, - sscop_resreq_tab, - NULL, - sscop_resrsp_tab, - NULL, - NULL, - sscop_recrsp_tab, - sscop_udtreq_tab, - NULL, - sscop_retreq_tab, - NULL, - NULL -}; - - -/* - * SSCOP_RESYNC_REQ / SOS_READY Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_resreq_ready(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize receiver window - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - /* - * Send first RS PDU - */ - sop->so_connctl = 1; - SEQ_INCR(sop->so_sendconn, 1); - (void) sscop_send_rs(sop); - - /* - * Drain transmit and receive queues - */ - sscop_xmit_drain(sop); - sscop_rcvr_drain(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for RSAK - */ - sop->so_state = SOS_OUTRESYN; - - return; -} - - -/* - * SSCOP_RESYNC_RSP / SOS_INRESYN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 unused - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_resrsp_inresyn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Clear transmitter buffers - */ - q2110_clear_xmit(sop); - - /* - * Initialize state variables - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - q2110_init_state(sop); - - /* - * Send RSAK PDU - */ - (void) sscop_send_rsak(sop); - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * Back to data transfer state - */ - sop->so_state = SOS_READY; - - return; -} - - -/* - * SSCOP_RECOVER_RSP / SOS_RECOVRSP Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 unused - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_recrsp_recovrsp(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Clear transmitter buffers, if not done earlier - */ - if (sop->so_flags & SOF_NOCLRBUF) - q2110_clear_xmit(sop); - - /* - * Initialize state variables - */ - q2110_init_state(sop); - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * Back to data transfer state - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * SSCOP_RECOVER_RSP / SOS_INRECOV Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 unused - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_recrsp_inrecov(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Clear transmitter buffers, if not done earlier - */ - if (sop->so_flags & SOF_NOCLRBUF) - q2110_clear_xmit(sop); - - /* - * Initialize state variables - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - q2110_init_state(sop); - - /* - * Send ERAK PDU - */ - (void) sscop_send_erak(sop); - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * Back to data transfer state - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - Property changes on: head/sys/netatm/uni/q2110_sigaa.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscf_uni_lower.c =================================================================== --- head/sys/netatm/uni/sscf_uni_lower.c (revision 179307) +++ head/sys/netatm/uni/sscf_uni_lower.c (nonexistent) @@ -1,393 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCF UNI - SSCF_UNI SAP interface processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -extern uma_zone_t sscf_uni_zone; - -/* - * Local variables - */ -static struct sscop_parms sscf_uni_sscop_parms = { - 4096, /* sp_maxinfo */ - 4096, /* sp_maxuu */ - 4, /* sp_maxcc */ - 25, /* sp_maxpd */ - 1 * ATM_HZ, /* sp_timecc */ - 2 * ATM_HZ, /* sp_timekeep */ - 7 * ATM_HZ, /* sp_timeresp */ - 1 * ATM_HZ, /* sp_timepoll */ - 15 * ATM_HZ, /* sp_timeidle */ - 80 /* sp_rcvwin */ -}; - - -/* - * SSCF_UNI Lower Stack Command Handler - * - * This function will receive all of the stack commands issued from the - * layer above SSCF UNI (ie. Q.2931). - * - * Arguments: - * cmd stack command code - * tok session token - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscf_uni_lower(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - struct univcc *uvp = (struct univcc *)tok; - Atm_connvc *cvp = uvp->uv_connvc; - enum sscop_vers vers; - int err; - - ATM_DEBUG5("sscf_uni_lower: cmd=0x%x, uvp=%p, ustate=%d, arg1=%p, arg2=%p\n", - cmd, uvp, uvp->uv_ustate, (void *)arg1, (void *)arg2); - - switch (cmd) { - - case SSCF_UNI_INIT: - /* - * Validate state - */ - if (uvp->uv_ustate != UVU_INST) { - log(LOG_ERR, "sscf_uni_lower: SSCF_INIT in ustate=%d\n", - uvp->uv_ustate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - break; - } - - /* - * Validate UNI version - */ - if ((enum uni_vers)arg1 == UNI_VERS_3_0) - vers = SSCOP_VERS_QSAAL; - else if ((enum uni_vers)arg1 == UNI_VERS_3_1) - vers = SSCOP_VERS_Q2110; - else { - sscf_uni_abort(uvp, "sscf_uni: bad version\n"); - break; - } - uvp->uv_vers = (enum uni_vers)arg1; - - /* - * Make ourselves ready and pass on the INIT - */ - uvp->uv_ustate = UVU_RELEASED; - uvp->uv_lstate = UVL_IDLE; - - STACK_CALL(SSCOP_INIT, uvp->uv_lower, uvp->uv_tokl, cvp, - (int)vers, (size_t)&sscf_uni_sscop_parms, err); - if (err) { - /* - * Should never happen - */ - sscf_uni_abort(uvp, "sscf_uni: INIT failure\n"); - } - break; - - case SSCF_UNI_TERM: - /* - * Set termination states - */ - uvp->uv_ustate = UVU_TERM; - uvp->uv_lstate = UVL_TERM; - - /* - * Pass the TERM down the stack - */ - STACK_CALL(SSCOP_TERM, uvp->uv_lower, uvp->uv_tokl, cvp, - 0, 0, err); - if (err) { - /* - * Should never happen - */ - sscf_uni_abort(uvp, "sscf_uni: TERM failure\n"); - return; - } - uma_zfree(sscf_uni_zone, uvp); - sscf_uni_vccnt--; - break; - - case SSCF_UNI_ESTABLISH_REQ: - /* - * Validation based on user state - */ - switch (uvp->uv_ustate) { - - case UVU_RELEASED: - case UVU_PRELEASE: - /* - * Establishing a new connection - */ - uvp->uv_ustate = UVU_PACTIVE; - uvp->uv_lstate = UVL_OUTCONN; - STACK_CALL(SSCOP_ESTABLISH_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, SSCOP_BR_YES, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_ACTIVE: - /* - * Resynchronizing a connection - */ - uvp->uv_ustate = UVU_PACTIVE; - if (uvp->uv_vers == UNI_VERS_3_0) { - uvp->uv_lstate = UVL_OUTCONN; - STACK_CALL(SSCOP_ESTABLISH_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, SSCOP_BR_YES, err); - } else { - uvp->uv_lstate = UVL_OUTRESYN; - STACK_CALL(SSCOP_RESYNC_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, 0, err); - } - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_TERM: - /* Ignore */ - break; - - case UVU_INST: - case UVU_PACTIVE: - default: - log(LOG_ERR, "sscf_uni_lower: cmd=0x%x, ustate=%d\n", - cmd, uvp->uv_ustate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCF_UNI_RELEASE_REQ: - /* - * Validate re-establishment parameter - */ - switch (arg1) { - - case SSCF_UNI_ESTIND_YES: - uvp->uv_flags &= ~UVF_NOESTIND; - break; - - case SSCF_UNI_ESTIND_NO: - uvp->uv_flags |= UVF_NOESTIND; - break; - - default: - sscf_uni_abort(uvp, "sscf_uni: bad estind value\n"); - return; - } - - /* - * Validation based on user state - */ - switch (uvp->uv_ustate) { - - case UVU_RELEASED: - /* - * Releasing a non-existant connection - */ - STACK_CALL(SSCF_UNI_RELEASE_CNF, uvp->uv_upper, - uvp->uv_toku, cvp, - 0, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_PACTIVE: - case UVU_ACTIVE: - /* - * Releasing a connection - */ - uvp->uv_ustate = UVU_PRELEASE; - uvp->uv_lstate = UVL_OUTDISC; - STACK_CALL(SSCOP_RELEASE_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_TERM: - /* Ignore */ - break; - - case UVU_INST: - case UVU_PRELEASE: - default: - log(LOG_ERR, "sscf_uni_lower: cmd=0x%x, ustate=%d\n", - cmd, uvp->uv_ustate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCF_UNI_DATA_REQ: -#ifdef notdef - sscf_uni_pdu_print(uvp, (KBuffer *)arg1, "DATA_REQ"); -#endif - - /* - * Validation based on user state - */ - switch (uvp->uv_ustate) { - - case UVU_ACTIVE: - /* - * Send assured data on connection - */ - STACK_CALL(SSCOP_DATA_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - arg1, 0, err); - if (err) { - KB_FREEALL((KBuffer *)arg1); - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_RELEASED: - case UVU_TERM: - /* - * Release supplied buffers and ignore - */ - KB_FREEALL((KBuffer *)arg1); - break; - - case UVU_INST: - case UVU_PACTIVE: - case UVU_PRELEASE: - default: - KB_FREEALL((KBuffer *)arg1); - log(LOG_ERR, "sscf_uni_lower: cmd=0x%x, ustate=%d\n", - cmd, uvp->uv_ustate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCF_UNI_UNITDATA_REQ: -#ifdef notdef - sscf_uni_pdu_print(uvp, (KBuffer *)arg1, "UNITDATA_REQ"); -#endif - - /* - * Validation based on user state - */ - switch (uvp->uv_ustate) { - - case UVU_RELEASED: - case UVU_PACTIVE: - case UVU_PRELEASE: - case UVU_ACTIVE: - /* - * Send unassured data on connection - */ - STACK_CALL(SSCOP_UNITDATA_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - arg1, 0, err); - if (err) { - KB_FREEALL((KBuffer *)arg1); - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVU_TERM: - /* - * Release supplied buffers and ignore - */ - KB_FREEALL((KBuffer *)arg1); - break; - - case UVU_INST: - default: - KB_FREEALL((KBuffer *)arg1); - log(LOG_ERR, "sscf_uni_lower: cmd=0x%x, ustate=%d\n", - cmd, uvp->uv_ustate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - default: - log(LOG_ERR, "sscf_uni_lower: unknown cmd 0x%x, uvp=%p\n", - cmd, uvp); - } - - return; -} - Property changes on: head/sys/netatm/uni/sscf_uni_lower.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/qsaal1_subr.c =================================================================== --- head/sys/netatm/uni/qsaal1_subr.c (revision 179307) +++ head/sys/netatm/uni/qsaal1_subr.c (nonexistent) @@ -1,206 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.SAAL1 - Subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Re-establish a new SSCOP Connection - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -qsaal1_reestablish(sop) - struct sscop *sop; -{ - - /* - * Stop polling timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Note that we're reestablishing a connection - */ - sop->so_flags |= SOF_REESTAB; - - /* - * Send first BGN PDU - */ - sop->so_connctl = 1; - (void) sscop_send_bgn(sop, SSCOP_SOURCE_SSCOP); - - /* - * Reset transmit variables - */ - qsaal1_reset_xmit(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for BGAK - */ - sop->so_state = SOS_OUTCONN; - - return; -} - - -/* - * Reset connection's transmitter state - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -qsaal1_reset_xmit(sop) - struct sscop *sop; -{ - - /* - * Drain the transmission queues - */ - sscop_xmit_drain(sop); - - /* - * Reset transmit variables - */ - SEQ_SET(sop->so_send, 0); - SEQ_SET(sop->so_pollsend, 0); - SEQ_SET(sop->so_ack, 0); - SEQ_SET(sop->so_pollack, 0); - if (sop->so_state != SOS_INCONN) - SEQ_SET(sop->so_sendmax, 0); - sop->so_polldata = 0; - - return; -} - - -/* - * Reset connection's receiver state - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -qsaal1_reset_rcvr(sop) - struct sscop *sop; -{ - - /* - * Drain the receiver queues - */ - sscop_rcvr_drain(sop); - - /* - * Reset transmit variables - */ - SEQ_SET(sop->so_rcvnext, 0); - SEQ_SET(sop->so_rcvhigh, 0); - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - return; -} - - -/* - * Clear connection's connection data - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -qsaal1_clear_connection(sop) - struct sscop *sop; -{ - - /* - * Can we clear transmit buffers ?? - */ - if ((sop->so_flags & SOF_NOCLRBUF) == 0) { - /* - * Yes, drain the transmission queues - */ - sscop_xmit_drain(sop); - } - - /* - * Clear service required flag - */ - sop->so_flags &= ~SOF_XMITSRVC; - - /* - * Drain receive queue buffers - */ - sscop_rcvr_drain(sop); - - return; -} - Property changes on: head/sys/netatm/uni/qsaal1_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscf_uni_upper.c =================================================================== --- head/sys/netatm/uni/sscf_uni_upper.c (revision 179307) +++ head/sys/netatm/uni/sscf_uni_upper.c (nonexistent) @@ -1,634 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCF UNI - SSCOP SAP interface processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * SSCF_UNI Upper Stack Command Handler - * - * This function will receive all of the stack commands issued from the - * layer below SSCF UNI (ie. SSCOP). - * - * Arguments: - * cmd stack command code - * tok session token - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscf_uni_upper(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - struct univcc *uvp = (struct univcc *)tok; - Atm_connvc *cvp = uvp->uv_connvc; - int err; - - ATM_DEBUG5("sscf_uni_upper: cmd=0x%x, uvp=%p, lstate=%d, arg1=%p, arg2=%p\n", - cmd, uvp, uvp->uv_lstate, (void *)arg1, (void *)arg2); - - switch (cmd) { - - case SSCOP_ESTABLISH_IND: - /* - * We don't support SSCOP User-to-User data, so just - * get rid of any supplied to us - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_READY: - if (uvp->uv_vers != UNI_VERS_3_0) { - goto seqerr; - } - goto doestind; - - case UVL_IDLE: - /* - * Incoming connection establishment request - */ - - /* - * If user doesn't want any more incoming sessions - * accepted, then refuse request - */ - if (uvp->uv_flags & UVF_NOESTIND) { - STACK_CALL(SSCOP_RELEASE_REQ, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, - "sscf_uni: stack memory\n"); - return; - } - break; - } - -doestind: - /* - * Tell sscop we've accepted the new connection - */ - uvp->uv_lstate = UVL_READY; - STACK_CALL(SSCOP_ESTABLISH_RSP, uvp->uv_lower, - uvp->uv_tokl, cvp, - SSCOP_UU_NULL, SSCOP_BR_YES, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - - /* - * Now notify the user of the new connection - */ - uvp->uv_ustate = UVU_ACTIVE; - STACK_CALL(SSCF_UNI_ESTABLISH_IND, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - default: -seqerr: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_ESTABLISH_CNF: - /* - * We don't support SSCOP User-to-User data, so just - * get rid of any supplied to us - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_OUTCONN: - /* - * Outgoing connection establishment completed - */ - - /* - * Tell the user that the connection is established - */ - uvp->uv_ustate = UVU_ACTIVE; - uvp->uv_lstate = UVL_READY; - STACK_CALL(SSCF_UNI_ESTABLISH_CNF, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - case UVL_READY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RELEASE_IND: - /* - * We don't support SSCOP User-to-User data, so just - * get rid of any supplied to us - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_OUTCONN: - case UVL_OUTRESYN: - case UVL_READY: - /* - * Peer requesting connection termination - */ - - /* - * Notify the user that the connection - * has been terminated - */ - uvp->uv_ustate = UVU_RELEASED; - uvp->uv_lstate = UVL_IDLE; - STACK_CALL(SSCF_UNI_RELEASE_IND, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_INRESYN: - case UVL_RECOVERY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RELEASE_CNF: - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_OUTDISC: - /* - * Peer acknowledging connection termination - */ - - /* - * Notify the user that the connection - * termination is completed - */ - uvp->uv_ustate = UVU_RELEASED; - uvp->uv_lstate = UVL_IDLE; - STACK_CALL(SSCF_UNI_RELEASE_CNF, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - case UVL_READY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_DATA_IND: -#ifdef notdef - sscf_uni_pdu_print(uvp, (KBuffer *)arg1, "DATA_IND"); -#endif - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_READY: - /* - * Incoming assured data from peer - */ - - /* - * Pass the data up to the user - */ - STACK_CALL(SSCF_UNI_DATA_IND, uvp->uv_upper, - uvp->uv_toku, cvp, - arg1, 0, err); - if (err) { - KB_FREEALL((KBuffer *)arg1); - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - KB_FREEALL((KBuffer *)arg1); - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - default: - KB_FREEALL((KBuffer *)arg1); - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RESYNC_IND: - /* - * We don't support SSCOP User-to-User data, so just - * get rid of any supplied to us - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_READY: - /* - * Incoming connection resynchronization request - */ - - /* - * Send resynch acknowledgement to sscop - */ - STACK_CALL(SSCOP_RESYNC_RSP, uvp->uv_lower, - uvp->uv_tokl, cvp, - 0, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - - if (uvp->uv_vers != UNI_VERS_3_0) { - - /* - * Notify the user that the connection - * has been resynced - */ - STACK_CALL(SSCF_UNI_ESTABLISH_IND, - uvp->uv_upper, uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, - "sscf_uni: stack memory\n"); - return; - } - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RESYNC_CNF: - /* - * Not supported in version 3.0 - */ - if (uvp->uv_vers == UNI_VERS_3_0) { - sscf_uni_abort(uvp, - "sscf_uni: SSCOP_RESYNC_CNF in 3.0\n"); - return; - } - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_OUTRESYN: - /* - * Peer acknowledging connection resynchronization - */ - - /* - * Now notify the user that the connection - * has been resynced - */ - uvp->uv_ustate = UVU_ACTIVE; - uvp->uv_lstate = UVL_READY; - STACK_CALL(SSCF_UNI_ESTABLISH_CNF, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_INRESYN: - case UVL_RECOVERY: - case UVL_READY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RECOVER_IND: - /* - * Not supported in version 3.0 - */ - if (uvp->uv_vers == UNI_VERS_3_0) { - sscf_uni_abort(uvp, - "sscf_uni: SSCOP_RECOVER_IND in 3.0\n"); - return; - } - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_READY: - /* - * Recover connection due to internal problems - */ - - /* - * Send recovery acknowledgement to sscop - */ - STACK_CALL(SSCOP_RECOVER_RSP, uvp->uv_lower, - uvp->uv_tokl, cvp, - 0, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - - /* - * Now notify the user that the connection - * has been recovered - */ - STACK_CALL(SSCF_UNI_ESTABLISH_IND, uvp->uv_upper, - uvp->uv_toku, cvp, - SSCOP_UU_NULL, 0, err); - if (err) { - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - break; - - case UVL_INST: - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - default: - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_UNITDATA_IND: -#ifdef notdef - sscf_uni_pdu_print(uvp, (KBuffer *)arg1, "UNITDATA_IND"); -#endif - - /* - * Validation based on sscop state - */ - switch (uvp->uv_lstate) { - - case UVL_IDLE: - case UVL_OUTCONN: - case UVL_INCONN: - case UVL_OUTDISC: - case UVL_OUTRESYN: - case UVL_INRESYN: - case UVL_RECOVERY: - case UVL_READY: - /* - * Incoming unassured data from peer - */ - - /* - * Pass the data up to the user - */ - STACK_CALL(SSCF_UNI_UNITDATA_IND, uvp->uv_upper, - uvp->uv_toku, cvp, - arg1, 0, err); - if (err) { - KB_FREEALL((KBuffer *)arg1); - sscf_uni_abort(uvp, "sscf_uni: stack memory\n"); - return; - } - break; - - case UVL_TERM: - /* - * Ignoring everything - */ - KB_FREEALL((KBuffer *)arg1); - break; - - case UVL_INST: - default: - KB_FREEALL((KBuffer *)arg1); - log(LOG_ERR, "sscf_uni_upper: cmd=0x%x, lstate=%d\n", - cmd, uvp->uv_lstate); - sscf_uni_abort(uvp, "sscf_uni: sequence err\n"); - } - break; - - case SSCOP_RETRIEVE_IND: - case SSCOP_RETRIEVECMP_IND: - /* - * Not supported - */ - default: - log(LOG_ERR, "sscf_uni_upper: unknown cmd 0x%x, uvp=%p\n", - cmd, uvp); - } - - return; -} - Property changes on: head/sys/netatm/uni/sscf_uni_upper.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/qsaal1_sigcpcs.c =================================================================== --- head/sys/netatm/uni/qsaal1_sigcpcs.c (revision 179307) +++ head/sys/netatm/uni/qsaal1_sigcpcs.c (nonexistent) @@ -1,1552 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.SAAL1 - Process CPCS-signals (SSCOP PDUs) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static void sscop_bgn_outconn(struct sscop *, KBuffer *, caddr_t); -static void sscop_end_outresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_end_conresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_end_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_endak_outresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_outresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_rsak_conresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_sd_inresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_sd_conresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_sd_process(struct sscop *, KBuffer *, caddr_t, int); -static void sscop_sd_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_sdp_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_poll_inresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_poll_conresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_poll_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_stat_conresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_ustat_conresyn(struct sscop *, KBuffer *, caddr_t); - - -/* - * PDU type state lookup tables - */ -/* BGN PDU */ -static void (*sscop_bgn_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgn_idle, /* SOS_IDLE */ - sscop_bgn_outconn, /* SOS_OUTCONN */ - sscop_noop, /* SOS_INCONN */ - sscop_bgn_outdisc, /* SOS_OUTDISC */ - sscop_bgn_outresyn, /* SOS_OUTRESYN */ - sscop_bgn_inresyn, /* SOS_INRESYN */ - sscop_bgn_outresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_bgn_inresyn, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* BGAK PDU */ -static void (*sscop_bgak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgak_idle, /* SOS_IDLE */ - sscop_bgak_outconn, /* SOS_OUTCONN */ - sscop_bgak_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_bgak_error, /* SOS_OUTRESYN */ - sscop_bgak_error, /* SOS_INRESYN */ - sscop_bgak_error, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_noop, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* BGREJ PDU */ -static void (*sscop_bgrej_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgrej_error, /* SOS_IDLE */ - sscop_bgrej_outconn, /* SOS_OUTCONN */ - sscop_bgrej_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_bgrej_outresyn, /* SOS_OUTRESYN */ - sscop_bgrej_ready, /* SOS_INRESYN */ - sscop_bgrej_outresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_bgrej_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* END PDU */ -static void (*sscop_end_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_end_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_end_inconn, /* SOS_INCONN */ - sscop_end_outdisc, /* SOS_OUTDISC */ - sscop_end_outresyn, /* SOS_OUTRESYN */ - sscop_end_ready, /* SOS_INRESYN */ - sscop_end_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_end_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* ENDAK PDU */ -static void (*sscop_endak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_noop, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_endak_inconn, /* SOS_INCONN */ - sscop_endak_outdisc, /* SOS_OUTDISC */ - sscop_endak_outresyn, /* SOS_OUTRESYN */ - sscop_endak_ready, /* SOS_INRESYN */ - sscop_endak_outresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_endak_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* RS PDU */ -static void (*sscop_rs_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_rs_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_rs_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_rs_outresyn, /* SOS_OUTRESYN */ - sscop_noop, /* SOS_INRESYN */ - sscop_noop, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_rs_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* RSAK PDU */ -static void (*sscop_rsak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_rsak_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_rsak_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_rsak_outresyn, /* SOS_OUTRESYN */ - sscop_rsak_error, /* SOS_INRESYN */ - sscop_rsak_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_rsak_error, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* SD PDU */ -static void (*sscop_sd_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_sd_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_sd_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_sd_ready, /* SOS_OUTRESYN */ - sscop_sd_inresyn, /* SOS_INRESYN */ - sscop_sd_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_sd_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* SDP PDU */ -static void (*sscop_sdp_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_sd_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_sd_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_sdp_ready, /* SOS_OUTRESYN */ - sscop_sd_inresyn, /* SOS_INRESYN */ - sscop_sd_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_sdp_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* POLL PDU */ -static void (*sscop_poll_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_poll_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_poll_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_poll_ready, /* SOS_OUTRESYN */ - sscop_poll_inresyn, /* SOS_INRESYN */ - sscop_poll_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_poll_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* STAT PDU */ -static void (*sscop_stat_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_stat_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_stat_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_stat_ready, /* SOS_INRESYN */ - sscop_stat_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_stat_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* USTAT PDU */ -static void (*sscop_ustat_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_ustat_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_ustat_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_ustat_ready, /* SOS_INRESYN */ - sscop_ustat_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_ustat_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* UD PDU */ -static void (*sscop_ud_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_ud_all, /* SOS_IDLE */ - sscop_ud_all, /* SOS_OUTCONN */ - sscop_ud_all, /* SOS_INCONN */ - sscop_ud_all, /* SOS_OUTDISC */ - sscop_ud_all, /* SOS_OUTRESYN */ - sscop_ud_all, /* SOS_INRESYN */ - sscop_ud_all, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_ud_all, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* MD PDU */ -static void (*sscop_md_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_md_all, /* SOS_IDLE */ - sscop_md_all, /* SOS_OUTCONN */ - sscop_md_all, /* SOS_INCONN */ - sscop_md_all, /* SOS_OUTDISC */ - sscop_md_all, /* SOS_OUTRESYN */ - sscop_md_all, /* SOS_INRESYN */ - sscop_md_all, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_md_all, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - - -/* - * PDU type lookup table - */ -void (*(*sscop_qsaal_pdutab[])) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, - sscop_bgn_tab, - sscop_bgak_tab, - sscop_end_tab, - sscop_endak_tab, - sscop_rs_tab, - sscop_rsak_tab, - sscop_bgrej_tab, - sscop_sd_tab, - sscop_sdp_tab, - sscop_poll_tab, - sscop_stat_tab, - sscop_ustat_tab, - sscop_ud_tab, - sscop_md_tab, - NULL -}; - - -/* - * BGN PDU / SOS_OUTCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_bgn_outconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - /* - * Notify user of connection establishment - */ - if (sop->so_flags & SOF_REESTAB) { - KB_FREEALL(m); - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_bgn_outconn: stack memory\n"); - return; - } - sop->so_flags &= ~SOF_REESTAB; - } else { - STACK_CALL(SSCOP_ESTABLISH_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_bgn_outconn: stack memory\n"); - return; - } - } - - /* - * Return an ACK to peer - */ - (void) sscop_send_bgak(sop); - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Reset receiver variables - */ - qsaal1_reset_rcvr(sop); - - /* - * Start polling timer - */ - sscop_set_poll(sop); - - /* - * Start lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * OK, we're ready for data - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * END PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_end_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct end_pdu *ep = (struct end_pdu *)trlr; - int err, source; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Get Source value - */ - if (ep->end_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_end_outresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_end_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Free up buffers - */ - KB_FREEALL(m); - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_end_conresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_end_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct end_pdu *ep = (struct end_pdu *)trlr; - int err, source; - - /* - * Stop poll timer - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Stop lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = 0; - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Get Source value - */ - if (ep->end_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_end_ready: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * ENDAK PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_endak_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Report protocol error - */ - sscop_endak_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_endak_outresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * RS PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Notify user of resynchronization - */ - STACK_CALL(SSCOP_RESYNC_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_rs_outresyn: stack memory\n"); - return; - } - - /* - * Reset receiver state variables - */ - qsaal1_reset_rcvr(sop); - - /* - * Wait for both peer and user responses - */ - sop->so_state = SOS_CONRESYN; - - return; -} - - -/* - * RS PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Notify user of resynchronization - */ - STACK_CALL(SSCOP_RESYNC_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_rs_ready: stack memory\n"); - return; - } - - /* - * Reset receiver state variables - */ - qsaal1_reset_rcvr(sop); - - /* - * Wait for user response - */ - sop->so_state = SOS_INRESYN; - - return; -} - - -/* - * RSAK PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rsak_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Notify user of resynchronization completion - */ - STACK_CALL(SSCOP_RESYNC_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "sscop_rsak_conresyn: stack memory\n"); - return; - } - - /* - * Start the polling timer - */ - sscop_set_poll(sop); - - /* - * Start lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * Continue waiting for user response - */ - sop->so_state = SOS_INRESYN; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * SD PDU / SOS_INRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_sd_inresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop poll timer - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Stop lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = 0; - - /* - * Record error condition - */ - sscop_sd_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_sd_inresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * SD PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_sd_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Record error condition - */ - sscop_sd_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_sd_conresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * SD/SDP PDU Common Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU user data buffer chain - * trlr pointer to PDU trailer - * type PDU type (SD or SDP) - * - * Returns: - * none - * - */ -static void -sscop_sd_process(sop, m, trlr, type) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; - int type; -{ - struct sd_pdu *sp; - struct sdp_pdu *spp; - struct poll_pdu poll; - struct pdu_hdr *php; - KBuffer *n; - sscop_seq ns, nps; - int err, space; - - /* - * Get PDU sequence number(s) - */ - if (type == PT_SD) { - sp = (struct sd_pdu *)trlr; - SEQ_SET(ns, ntohl(sp->sd_ns)); - SEQ_SET(nps, 0); - } else { - spp = (struct sdp_pdu *)trlr; - SEQ_SET(ns, ntohl(spp->sdp_ns)); - SEQ_SET(nps, ntohl(spp->sdp_nps)); - } - - /* - * Ensure that the sequence number fits within the window - */ - if (SEQ_GEQ(ns, sop->so_rcvmax, sop->so_rcvnext)) { - KB_FREEALL(m); - return; - } - - /* - * If this is the next in-sequence PDU, hand it to user - */ - if (ns == sop->so_rcvnext) { - STACK_CALL(SSCOP_DATA_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, ns, err); - if (err) { - KB_FREEALL(m); - return; - } - - /* - * Bump next expected sequence number - */ - SEQ_INCR(sop->so_rcvnext, 1); - - /* - * Slide receive window down - */ - SEQ_INCR(sop->so_rcvmax, 1); - - /* - * Is this the highest sequence PDU we've received?? - */ - if (ns == sop->so_rcvhigh) { - /* - * Yes, bump the limit and exit - */ - sop->so_rcvhigh = sop->so_rcvnext; - if (type == PT_SDP) - goto dopoll; - return; - } - - /* - * This is a retransmitted PDU, so see if we have - * more in-sequence PDUs already queued up - */ - while ((php = sop->so_recv_hd) && - (php->ph_ns == sop->so_rcvnext)) { - - /* - * Yup we do, so remove next PDU from queue and - * pass it up to the user as well - */ - sop->so_recv_hd = php->ph_recv_lk; - if (sop->so_recv_hd == NULL) - sop->so_recv_tl = NULL; - STACK_CALL(SSCOP_DATA_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)php->ph_buf, - php->ph_ns, err); - if (err) { - /* - * Should never happen, but... - */ - KB_FREEALL(php->ph_buf); - sscop_abort(sop, - "sscop_sd_process: stack memory\n"); - return; - } - - /* - * Bump next expected sequence number - */ - SEQ_INCR(sop->so_rcvnext, 1); - - /* - * Slide receive window down - */ - SEQ_INCR(sop->so_rcvmax, 1); - } - - /* - * Finished with data...see if we need to poll - */ - if (type == PT_SDP) - goto dopoll; - return; - } - - /* - * We're gonna have to queue this PDU, so find space - * for the PDU header - */ - KB_HEADROOM(m, space); - - /* - * If there's not enough room in the received buffer, - * allocate & link a new buffer for the header - */ - if (space < sizeof(struct pdu_hdr)) { - - KB_ALLOC(n, sizeof(struct pdu_hdr), KB_F_NOWAIT, KB_T_HEADER); - if (n == NULL) { - KB_FREEALL(m); - return; - } - KB_HEADSET(n, sizeof(struct pdu_hdr)); - KB_LEN(n) = 0; - KB_LINKHEAD(n, m); - m = n; - } - - /* - * Build PDU header - * - * We can at least assume/require that the start of - * the user data is aligned. Also note that we don't - * include this header in the buffer len/offset fields. - */ - KB_DATASTART(m, php, struct pdu_hdr *); - php--; - php->ph_ns = ns; - php->ph_buf = m; - - /* - * Insert PDU into the receive queue - */ - if (sscop_recv_insert(sop, php)) { - /* - * Oops, a duplicate sequence number PDU is already on - * the queue, somethings wrong here. - */ - sscop_maa_error(sop, 'Q'); - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Reestablish a new connection - */ - qsaal1_reestablish(sop); - - return; - } - - /* - * Are we at the high-water mark?? - */ - if (ns == sop->so_rcvhigh) { - /* - * Yes, just bump the mark - */ - SEQ_INCR(sop->so_rcvhigh, 1); - - if (type == PT_SDP) - goto dopoll; - return; - } - - /* - * Are we beyond the high-water mark?? - */ - if (SEQ_GT(ns, sop->so_rcvhigh, sop->so_rcvnext)) { - /* - * Yes, then there's a missing PDU, so inform the transmitter - */ - if (type == PT_SD) - (void) sscop_send_ustat(sop, ns); - - /* - * Update high-water mark - */ - sop->so_rcvhigh = SEQ_ADD(ns, 1); - } - - if (type == PT_SD) - return; - -dopoll: - /* - * Do the "poll" part of an SDP PDU - */ - poll.poll_nps = htonl(nps); - poll.poll_ns = htonl((PT_POLL << PT_TYPE_SHIFT) | ns); - sscop_poll_ready(sop, NULL, (caddr_t)&poll); - return; -} - - -/* - * SD PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_sd_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - /* - * Just call common SD/SDP processor - */ - sscop_sd_process(sop, m, trlr, PT_SD); - - return; -} - - -/* - * SDP PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_sdp_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - /* - * Just call common SD/SDP processor - */ - sscop_sd_process(sop, m, trlr, PT_SDP); - - return; -} - - -/* - * POLL PDU / SOS_INRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_poll_inresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop poll timer - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Stop lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = 0; - - /* - * Report protocol error - */ - sscop_poll_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_poll_inresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * POLL PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_poll_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Record error condition - */ - sscop_poll_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_poll_conresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * POLL PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_poll_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct poll_pdu *pp = (struct poll_pdu *)trlr; - sscop_seq nps; - - pp->poll_ns = ntohl(pp->poll_ns); - - /* - * If the poll sequence number is less than highest number - * we've already seen, something's wrong - so attempt to - * reestablish a new connection. - */ - if (SEQ_LT(pp->poll_ns, sop->so_rcvhigh, sop->so_rcvnext)) { - /* - * Record error condition - */ - sscop_maa_error(sop, 'Q'); - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Reestablish a new connection - */ - qsaal1_reestablish(sop); - - return; - } - - /* - * Set a new "next highest" sequence number expected - */ - if (SEQ_LT(pp->poll_ns, sop->so_rcvmax, sop->so_rcvnext)) - SEQ_SET(sop->so_rcvhigh, pp->poll_ns); - else - sop->so_rcvhigh = sop->so_rcvmax; - - /* - * Return a STAT PDU to peer - */ - SEQ_SET(nps, ntohl(pp->poll_nps)); - KB_FREEALL(m); - (void) sscop_send_stat(sop, nps); - - return; -} - - -/* - * STAT PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_stat_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Record error condition - */ - sscop_stat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_stat_conresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * USTAT PDU / SOS_CONRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_ustat_conresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Record error condition - */ - sscop_ustat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "sscop_ustat_conresyn: stack memory\n"); - return; - } - - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - Property changes on: head/sys/netatm/uni/qsaal1_sigcpcs.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscf_uni.h =================================================================== --- head/sys/netatm/uni/sscf_uni.h (revision 179307) +++ head/sys/netatm/uni/sscf_uni.h (nonexistent) @@ -1,47 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCF UNI protocol definitions - * - */ - -#ifndef _UNI_SSCF_UNI_H -#define _UNI_SSCF_UNI_H - -/* - * SSCF_UNI API definitions - */ -#define SSCF_UNI_ESTIND_YES 1 /* Allow new ESTABLISH_IND */ -#define SSCF_UNI_ESTIND_NO 2 /* Disallow new ESTABLISH_IND */ - -#endif /* _UNI_SSCF_UNI_H */ Property changes on: head/sys/netatm/uni/sscf_uni.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_pdu.c =================================================================== --- head/sys/netatm/uni/sscop_pdu.c (revision 179307) +++ head/sys/netatm/uni/sscop_pdu.c (nonexistent) @@ -1,1244 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP - PDU subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static KBuffer * sscop_stat_init(struct sscop *); -static KBuffer * sscop_stat_add(sscop_seq, KBuffer *); -static int sscop_stat_end(struct sscop *, sscop_seq, - KBuffer *, KBuffer *); -static int sscop_recv_locate(struct sscop *, sscop_seq, - struct pdu_hdr **); - - -/* - * Build and send BGN PDU - * - * A BGN PDU will be constructed and passed down the protocol stack. - * The SSCOP-UU/N(UU) field is not supported. - * - * Arguments: - * sop pointer to sscop connection control block - * source originator of BGN PDU (Q.SAAL1 only) - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_bgn(sop, source) - struct sscop *sop; - int source; -{ - KBuffer *m; - struct bgn_pdu *bp; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct bgn_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct bgn_pdu))); - KB_LEN(m) = sizeof(struct bgn_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, bp, struct bgn_pdu *); - *(int *)&bp->bgn_rsvd[0] = 0; - if (sop->so_vers != SSCOP_VERS_QSAAL) - bp->bgn_nsq = sop->so_sendconn; - bp->bgn_nmr = - htonl((PT_BGN << PT_TYPE_SHIFT) | SEQ_VAL(sop->so_rcvmax)); - if ((sop->so_vers == SSCOP_VERS_QSAAL) && - (source == SSCOP_SOURCE_SSCOP)) - bp->bgn_type |= PT_SOURCE_SSCOP; - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send BGAK PDU - * - * A BGAK PDU will be constructed and passed down the protocol stack. - * The SSCOP-UU/N(UU) field is not supported. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_bgak(sop) - struct sscop *sop; -{ - KBuffer *m; - struct bgak_pdu *bp; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct bgak_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct bgak_pdu))); - KB_LEN(m) = sizeof(struct bgak_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, bp, struct bgak_pdu *); - bp->bgak_rsvd = 0; - bp->bgak_nmr = - htonl((PT_BGAK << PT_TYPE_SHIFT) | SEQ_VAL(sop->so_rcvmax)); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send BGREJ PDU - * - * A BGREJ PDU will be constructed and passed down the protocol stack. - * The SSCOP-UU/N(UU) field is not supported. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_bgrej(sop) - struct sscop *sop; -{ - KBuffer *m; - struct bgrej_pdu *bp; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct bgrej_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct bgrej_pdu))); - KB_LEN(m) = sizeof(struct bgrej_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, bp, struct bgrej_pdu *); - bp->bgrej_rsvd2 = 0; - *(u_int *)&bp->bgrej_type = htonl((PT_BGREJ << PT_TYPE_SHIFT) | 0); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send END PDU - * - * An END PDU will be constructed and passed down the protocol stack. - * The SSCOP-UU/N(UU) field is not supported. - * - * Arguments: - * sop pointer to sscop connection control block - * source originator of END PDU - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_end(sop, source) - struct sscop *sop; - int source; -{ - KBuffer *m; - struct end_pdu *ep; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct end_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct end_pdu))); - KB_LEN(m) = sizeof(struct end_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, ep, struct end_pdu *); - ep->end_rsvd2 = 0; - *(u_int *)&ep->end_type = htonl((PT_END << PT_TYPE_SHIFT) | 0); - if (source == SSCOP_SOURCE_SSCOP) { - ep->end_type |= PT_SOURCE_SSCOP; - sop->so_flags |= SOF_ENDSSCOP; - } else if (source == SSCOP_SOURCE_USER) - sop->so_flags &= ~SOF_ENDSSCOP; - else if ((source == SSCOP_SOURCE_LAST) && - (sop->so_flags & SOF_ENDSSCOP)) - ep->end_type |= PT_SOURCE_SSCOP; - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send ENDAK PDU - * - * An ENDAK PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_endak(sop) - struct sscop *sop; -{ - KBuffer *m; - struct endak_q2110_pdu *e2p; - struct endak_qsaal_pdu *esp; - int err, size; - - - /* - * Get size of PDU - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) - size = sizeof(struct endak_qsaal_pdu); - else - size = sizeof(struct endak_q2110_pdu); - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, size, KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, KB_BFRLEN(m) - size)); - KB_LEN(m) = size; - - /* - * Build PDU - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) { - KB_DATASTART(m, esp, struct endak_qsaal_pdu *); - *(u_int *)&esp->endak_type = - htonl((PT_ENDAK << PT_TYPE_SHIFT) | 0); - } else { - KB_DATASTART(m, e2p, struct endak_q2110_pdu *); - e2p->endak_rsvd2 = 0; - *(u_int *)&e2p->endak_type = - htonl((PT_ENDAK << PT_TYPE_SHIFT) | 0); - } - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send RS PDU - * - * A RS PDU will be constructed and passed down the protocol stack. - * The SSCOP-UU/N(UU) field is not supported. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_rs(sop) - struct sscop *sop; -{ - KBuffer *m; - struct rs_pdu *rp; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct rs_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct rs_pdu))); - KB_LEN(m) = sizeof(struct rs_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, rp, struct rs_pdu *); - *(int *)&rp->rs_rsvd[0] = 0; - if (sop->so_vers != SSCOP_VERS_QSAAL) { - rp->rs_nsq = sop->so_sendconn; - rp->rs_nmr = htonl((PT_RS << PT_TYPE_SHIFT) | - SEQ_VAL(sop->so_rcvmax)); - } else { - rp->rs_nmr = htonl((PT_RS << PT_TYPE_SHIFT) | 0); - } - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send RSAK PDU - * - * An RSAK PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_rsak(sop) - struct sscop *sop; -{ - KBuffer *m; - struct rsak_q2110_pdu *r2p; - struct rsak_qsaal_pdu *rsp; - int err, size; - - - /* - * Get size of PDU - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) - size = sizeof(struct rsak_qsaal_pdu); - else - size = sizeof(struct rsak_q2110_pdu); - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, size, KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, KB_BFRLEN(m) - size)); - KB_LEN(m) = size; - - /* - * Build PDU - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) { - KB_DATASTART(m, rsp, struct rsak_qsaal_pdu *); - *(u_int *)&rsp->rsaks_type = - htonl((PT_RSAK << PT_TYPE_SHIFT) | 0); - } else { - KB_DATASTART(m, r2p, struct rsak_q2110_pdu *); - r2p->rsak_rsvd = 0; - r2p->rsak_nmr = htonl((PT_RSAK << PT_TYPE_SHIFT) | - SEQ_VAL(sop->so_rcvmax)); - } - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send ER PDU - * - * An ER PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_er(sop) - struct sscop *sop; -{ - KBuffer *m; - struct er_pdu *ep; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct er_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct er_pdu))); - KB_LEN(m) = sizeof(struct er_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, ep, struct er_pdu *); - *(int *)&ep->er_rsvd[0] = 0; - ep->er_nsq = sop->so_sendconn; - ep->er_nmr = htonl((PT_ER << PT_TYPE_SHIFT) | SEQ_VAL(sop->so_rcvmax)); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send ERAK PDU - * - * An ERAK PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_erak(sop) - struct sscop *sop; -{ - KBuffer *m; - struct erak_pdu *ep; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct erak_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct erak_pdu))); - KB_LEN(m) = sizeof(struct erak_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, ep, struct erak_pdu *); - ep->erak_rsvd = 0; - ep->erak_nmr = htonl((PT_ERAK << PT_TYPE_SHIFT) | - SEQ_VAL(sop->so_rcvmax)); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send POLL PDU - * - * A POLL PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_poll(sop) - struct sscop *sop; -{ - KBuffer *m; - struct poll_pdu *pp; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct poll_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct poll_pdu))); - KB_LEN(m) = sizeof(struct poll_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, pp, struct poll_pdu *); - pp->poll_nps = htonl(SEQ_VAL(sop->so_pollsend)); - pp->poll_ns = htonl((PT_POLL << PT_TYPE_SHIFT) | SEQ_VAL(sop->so_send)); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * STAT PDU Construction - Initialize for new PDU - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * addr pointer to initialized buffer - * 0 unable to allocate buffer - * - */ -static KBuffer * -sscop_stat_init(sop) - struct sscop *sop; -{ - KBuffer *m; - -#define STAT_INIT_SIZE (sizeof(struct stat_pdu) + 2 * sizeof(sscop_seq)) - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, STAT_INIT_SIZE, KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (0); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, sop->so_headout < (KB_BFRLEN(m) - STAT_INIT_SIZE) ? - sop->so_headout : 0); - KB_LEN(m) = 0; - - return (m); -#undef STAT_INIT_SIZE -} - - -/* - * STAT PDU Construction - Add List Element - * - * Arguments: - * elem sequence number to add to list - * m pointer to current buffer - * - * Returns: - * addr pointer to current buffer (updated) - * 0 buffer allocation failure - * - */ -static KBuffer * -sscop_stat_add(elem, m) - sscop_seq elem; - KBuffer *m; -{ - KBuffer *n; - sscop_seq *sp; - int space; - - /* - * See if new element will fit in current buffer - */ - KB_TAILROOM(m, space); - if (space < sizeof(elem)) { - - /* - * Nope, so get another buffer - */ - KB_ALLOC(n, sizeof(elem), KB_F_NOWAIT, KB_T_DATA); - if (n == NULL) - return (0); - - /* - * Link in new buffer - */ - KB_LINK(n, m); - KB_LEN(n) = 0; - m = n; - } - - /* - * Add new element - */ - KB_DATAEND(m, sp, sscop_seq *); - *sp = htonl(elem); - KB_LEN(m) += sizeof (elem); - return (m); -} - - -/* - * STAT PDU Construction - Add Trailer and Send - * - * Arguments: - * sop pointer to sscop connection control block - * nps received poll sequence number (POLL.N(PS)) - * head pointer to head of buffer chain - * m pointer to current (last) buffer - * - * Returns: - * 0 STAT successfully sent - * else unable to send STAT or truncated STAT was sent - buffer freed - * - */ -static int -sscop_stat_end(sop, nps, head, m) - struct sscop *sop; - sscop_seq nps; - KBuffer *head; - KBuffer *m; -{ - struct stat_pdu *sp; - KBuffer *n; - int err, space, trunc = 0; - - /* - * See if PDU trailer will fit in current buffer - */ - KB_TAILROOM(m, space); - if (space < sizeof(struct stat_pdu)) { - - /* - * Doesn't fit, so get another buffer - */ - KB_ALLOC(n, sizeof(struct stat_pdu), KB_F_NOWAIT, KB_T_DATA); - if (n == NULL) { - /* - * Out of buffers - truncate elements and send - * what we can, but tell caller that we can't - * send any more segments. - */ - trunc = 1; - do { - KB_LEN(m) -= sizeof(sscop_seq); - space += sizeof(sscop_seq); - } while (space < sizeof(struct stat_pdu)); - } else { - /* - * Link in new buffer - */ - KB_LINK(n, m); - KB_LEN(n) = 0; - m = n; - } - } - - /* - * Build PDU trailer - */ - KB_DATAEND(m, sp, struct stat_pdu *); - sp->stat_nps = htonl(nps); - sp->stat_nmr = htonl(sop->so_rcvmax); - sp->stat_nr = htonl(sop->so_rcvnext); - sp->stat_type = PT_STAT; - KB_LEN(m) += sizeof(struct stat_pdu); - - /* - * Finally, send the STAT - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)head, 0, err); - - if (err) { - /* - * We lie about the STACK_CALL failing... - */ - KB_FREEALL(head); - } - - if (trunc) - return (1); - else - return (0); -} - - -/* - * Check for PDU in Receive Queue - * - * A receive queue will be searched for an SD PDU matching the requested - * sequence number. The caller must supply a pointer to the address of the - * PDU in the particular receive queue at which to begin the search. This - * function will update that pointer as it traverses the queue. - * - * Arguments: - * sop pointer to sscop connection control block - * seq sequence number of PDU to locate - * currp address of pointer to PDU in receive queue to start search - * - * Returns: - * 0 reqeusted PDU not in receive queue - * 1 requested PDU located in receive queue - * - */ -static int -sscop_recv_locate(sop, seq, currp) - struct sscop *sop; - sscop_seq seq; - struct pdu_hdr **currp; -{ - sscop_seq cs; - - /* - * Search queue until we know the answer - */ - while (1) { - /* - * If we're at the end of the queue, the PDU isn't there - */ - if (*currp == NULL) - return (0); - - /* - * Get the current PDU sequence number - */ - cs = (*currp)->ph_ns; - - /* - * See if we're at the requested PDU - */ - if (seq == cs) - return (1); - - /* - * If we're past the requested seq number, - * the PDU isn't there - */ - if (SEQ_LT(seq, cs, sop->so_rcvnext)) - return (0); - - /* - * Go to next PDU and keep looking - */ - *currp = (*currp)->ph_recv_lk; - } -} - - -/* - * Build and send STAT PDU - * - * A STAT PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * nps received poll sequence number (POLL.N(PS)) - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send complete pdu - * - */ -int -sscop_send_stat(sop, nps) - struct sscop *sop; - sscop_seq nps; -{ - KBuffer *head, *curr, *n; - struct pdu_hdr *rq = sop->so_recv_hd; - sscop_seq i; - sscop_seq vrh = sop->so_rcvhigh; - sscop_seq vrr = sop->so_rcvnext; - int len = 0; - - /* - * Initialize for start of STAT PDU - */ - head = sscop_stat_init(sop); - if (head == NULL) - return (1); - curr = head; - - /* - * Start with first PDU not yet received - */ - i = vrr; - - /* - * Keep looping until we get to last sent PDU - */ - while (i != vrh) { - - /* - * Find next missing PDU - */ - while (SEQ_LT(i, vrh, vrr) && sscop_recv_locate(sop, i, &rq)) { - SEQ_INCR(i, 1); - } - - /* - * Add odd (start of missing gap) STAT element - */ - n = sscop_stat_add(i, curr); - if (n == NULL) { - goto nobufs; - } - curr = n; - len++; - - /* - * Have we reached the last sent PDU sequence number?? - */ - if (i == vrh) { - /* - * Yes, then we're done, send STAT - */ - break; - } - - /* - * Have we reached the max STAT size yet?? - */ - if (len >= PDU_MAX_ELEM) { - /* - * Yes, send this STAT segment - */ - if (sscop_stat_end(sop, nps, head, curr)) { - return (1); - } - - /* - * Start a new segment - */ - head = sscop_stat_init(sop); - if (head == NULL) - return (1); - curr = head; - - /* - * Restart missing gap - */ - curr = sscop_stat_add(i, curr); - if (curr == NULL) { - KB_FREEALL(head); - return (1); - } - len = 1; - } - - /* - * Now find the end of the missing gap - */ - do { - SEQ_INCR(i, 1); - } while (SEQ_LT(i, vrh, vrr) && - (sscop_recv_locate(sop, i, &rq) == 0)); - - /* - * Add even (start of received gap) STAT element - */ - n = sscop_stat_add(i, curr); - if (n == NULL) { - goto nobufs; - } - curr = n; - len++; - } - - /* - * Finally, send the STAT PDU (or last STAT segment) - */ - if (sscop_stat_end(sop, nps, head, curr)) { - return (1); - } - - return (0); - -nobufs: - /* - * Send a truncated STAT PDU - */ - sscop_stat_end(sop, nps, head, curr); - - return (1); -} - - -/* - * Build and send USTAT PDU - * - * A USTAT PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * ns sequence number for second list element - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu - * - */ -int -sscop_send_ustat(sop, ns) - struct sscop *sop; - sscop_seq ns; -{ - KBuffer *m; - struct ustat_pdu *up; - int err; - - - /* - * Get buffer for PDU - */ - KB_ALLOCPKT(m, sizeof(struct ustat_pdu), KB_F_NOWAIT, KB_T_HEADER); - if (m == NULL) - return (1); - - /* - * Setup buffer controls - */ - KB_HEADSET(m, MIN(sop->so_headout, - KB_BFRLEN(m) - sizeof(struct ustat_pdu))); - KB_LEN(m) = sizeof(struct ustat_pdu); - - /* - * Build PDU - */ - KB_DATASTART(m, up, struct ustat_pdu *); - up->ustat_le1 = htonl(SEQ_VAL(sop->so_rcvhigh)); - up->ustat_le2 = htonl(SEQ_VAL(ns)); - up->ustat_nmr = htonl(SEQ_VAL(sop->so_rcvmax)); - up->ustat_nr = - htonl((PT_USTAT << PT_TYPE_SHIFT) | SEQ_VAL(sop->so_rcvnext)); - - /* - * Send PDU towards peer - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - - if (err) - KB_FREEALL(m); - - return (err); -} - - -/* - * Build and send UD PDU - * - * A UD PDU will be constructed and passed down the protocol stack. - * - * Arguments: - * sop pointer to sscop connection control block - * m pointer to user data buffer chain - * - * Returns: - * 0 PDU successfully built and passed down the stack - * else unable to build or send pdu (buffer released) - * - */ -int -sscop_send_ud(sop, m) - struct sscop *sop; - KBuffer *m; -{ - KBuffer *ml, *n; - int len = 0, err; - int pad, trlen, space; - u_char *cp; - - /* - * Count data and get to last buffer in chain - */ - for (ml = m; ; ml = KB_NEXT(ml)) { - len += KB_LEN(ml); - if (KB_NEXT(ml) == NULL) - break; - } - - /* - * Verify data length - */ - if (len > sop->so_parm.sp_maxinfo) { - KB_FREEALL(m); - sscop_abort(sop, "sscop: maximum unitdata size exceeded\n"); - return (1); - } - - /* - * Figure out how much padding we'll need - */ - pad = ((len + (PDU_PAD_ALIGN - 1)) & ~(PDU_PAD_ALIGN - 1)) - len; - trlen = pad + sizeof(struct ud_pdu); - - /* - * Get space for PDU trailer and padding - */ - KB_TAILROOM(ml, space); - if (space < trlen) { - /* - * Allocate & link buffer for pad and trailer - */ - KB_ALLOC(n, trlen, KB_F_NOWAIT, KB_T_HEADER); - if (n == NULL) - return (1); - - KB_LEN(n) = 0; - KB_LINK(n, ml); - ml = n; - } - - /* - * Build the PDU trailer - * - * Since we can't be sure of alignment in the buffers, we - * have to move this a byte at a time. - */ - KB_DATAEND(ml, cp, u_char *); - cp += pad; - *cp++ = (pad << PT_PAD_SHIFT) | PT_UD; - bzero(cp, 3); - KB_LEN(ml) += trlen; - - /* - * Now pass PDU down the stack - */ - STACK_CALL(CPCS_UNITDATA_INV, sop->so_lower, sop->so_tokl, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Print an SSCOP PDU - * - * Arguments: - * sop pointer to sscop connection control block - * m pointer to pdu buffer chain - * msg pointer to message string - * - * Returns: - * none - * - */ -void -sscop_pdu_print(const struct sscop *sop, const KBuffer *m, const char *msg) -{ - char buf[128]; - struct vccb *vcp; - - vcp = sop->so_connvc->cvc_vcc; - snprintf(buf, sizeof(buf), - "sscop %s: vcc=(%d,%d)\n", msg, vcp->vc_vpi, vcp->vc_vci); - atm_pdu_print(m, buf); -} Property changes on: head/sys/netatm/uni/sscop_pdu.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_vc_state.c =================================================================== --- head/sys/netatm/uni/unisig_vc_state.c (revision 179307) +++ head/sys/netatm/uni/unisig_vc_state.c (nonexistent) @@ -1,2248 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * VC state machine - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* - * Local functions - */ -static int unisig_vc_invalid(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act01(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act02(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act03(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act04(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act05(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act06(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act07(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act08(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act09(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act10(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act11(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act12(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act13(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act14(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act15(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act16(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act17(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act18(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act19(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act20(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act21(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act22(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act23(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act24(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act25(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act26(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act27(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act28(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act29(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act30(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_act31(struct unisig *, struct unisig_vccb *, - struct unisig_msg *); -static int unisig_vc_clear_call(struct unisig *, - struct unisig_vccb *, - struct unisig_msg *, - int); - - -/* - * State table - */ -static int unisig_vc_states[21][17] = { -/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */ -{ 0, 2, 99, 5, 99, 99, 0, 99, 12, 99, 0, 14, 0, 3, 0, 0, 0 }, -{ 29, 4, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 6, 99, 6, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 10, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 8, 17, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 7, 99, 15, 99, 99, 15, 99, 15, 99, 15, 16, 17, 0, 0, 0, 0 }, -{ 19, 3, 99, 3, 99, 99, 3, 99, 3, 99, 3, 13, 3, 0, 0, 0, 0 }, -{ 21, 21, 99, 21, 99, 99, 21, 99, 21, 99, 21, 21, 21, 0, 0, 0, 0 }, -{ 22, 22, 99, 22, 99, 99, 22, 99, 22, 99, 22, 22, 22, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 17, 99, 23, 17, 17, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 29, 17, 99, 17, 99, 99, 17, 99, 17, 99, 17, 17, 17, 0, 0, 0, 0 }, -{ 1, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99 }, -{ 99, 25, 99, 25, 99, 99, 9, 99, 25, 99, 25, 25, 25, 25, 31, 25, 25 }, -{ 99, 25, 99, 25, 99, 99, 11, 99, 25, 99, 25, 25, 25, 25, 19, 25, 25 }, -{ 99, 12, 99, 12, 99, 99, 25, 99, 12, 99, 12, 19, 19, 30, 19, 99, 99 }, -{ 99, 12, 99, 12, 99, 99, 12, 99, 12, 99, 12, 3, 3, 3, 24, 26, 26 }, -{ 99, 3, 99, 3, 99, 99, 30, 99, 3, 99, 18, 3, 3, 0, 19, 27, 19 }, -{ 99, 7, 99, 7, 99, 99, 30, 99, 7, 99, 19, 19, 19, 20, 19, 19, 28 } -}; - - -/* - * Action vector - * - * A given state, action pair selects an action number from the - * state table. This vector holds the address of the action routine - * for each action number. - */ -#define MAX_ACTION 32 -static int (*unisig_vc_act_vec[MAX_ACTION]) - (struct unisig *, struct unisig_vccb *, - struct unisig_msg *) = { - unisig_vc_invalid, - unisig_vc_act01, - unisig_vc_act02, - unisig_vc_act03, - unisig_vc_act04, - unisig_vc_act05, - unisig_vc_act06, - unisig_vc_act07, - unisig_vc_act08, - unisig_vc_act09, - unisig_vc_act10, - unisig_vc_act11, - unisig_vc_act12, - unisig_vc_act13, - unisig_vc_act14, - unisig_vc_act15, - unisig_vc_act16, - unisig_vc_act17, - unisig_vc_act18, - unisig_vc_act19, - unisig_vc_act20, - unisig_vc_act21, - unisig_vc_act22, - unisig_vc_act23, - unisig_vc_act24, - unisig_vc_act25, - unisig_vc_act26, - unisig_vc_act27, - unisig_vc_act28, - unisig_vc_act29, - unisig_vc_act30, - unisig_vc_act31 -}; - - -/* - * Process an event on a VC - * - * Arguments: - * usp pointer to the UNISIG instance - * uvp pointer to the VCCB for the affected VCC - * event a numeric indication of which event has occured - * msg pointer to a signalling message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -unisig_vc_state(usp, uvp, event, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - int event; - struct unisig_msg *msg; -{ - int action, rc, state; - - /* - * Select an action from the state table - */ - if (uvp) - state = uvp->uv_sstate; - else - state = UNI_NULL; - action = unisig_vc_states[event][state]; - if (action >= MAX_ACTION || action < 0) - panic("unisig_vc_state: invalid action\n"); - - /* - * Perform the requested action - */ - ATM_DEBUG4("unisig_vc_state: uvp=%p, state=%d, event=%d, action=%d\n", - uvp, state, event, action); - rc = unisig_vc_act_vec[action](usp, uvp, msg); - - return(rc); -} - - -/* - * VC state machine action 0 - * Unexpected action - log an error message - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection (may - be null) - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_invalid(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - log(LOG_ERR, "unisig_vc_state: unexpected action\n"); - return(EINVAL); -} - - -/* - * VC state machine action 1 - * Setup handler called - * - * Send SETUP, start timer T303, go to UNI_CALL_INITIATED state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act01(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Send the setup message - */ - rc = unisig_send_setup(usp, uvp); - if (rc) - return(rc); - - /* - * Set timer T303 - */ - uvp->uv_retry = 0; - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T303); - - /* - * Set the new state - */ - uvp->uv_sstate = UNI_CALL_INITIATED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} - - -/* - * VC state machine action 2 - * Timeout while waiting for CALL PROCEEDING or CONNECT - * - * If this is the second expiration, clear the call. Otherwise, - * retransmit the SETUP message and restart T303. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act02(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc = 0; - - if (uvp->uv_retry) { - /* - * Clear the call - */ - rc = unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NO_ROUTE_TO_DESTINATION); - } else { - uvp->uv_retry++; - (void) unisig_send_setup(usp, uvp); - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T303); - } - - return(rc); -} - - -/* - * VC state machine action 3 - * - * Clear the call internally - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act03(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc, cause; - - /* - * Set cause code - */ - if ((msg != NULL) && (msg->msg_ie_caus != NULL)) { - unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr, - msg->msg_ie_caus); - cause = T_ATM_ABSENT; - } else - cause = T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER; - - /* - * Clear the VCCB - */ - rc = unisig_clear_vcc(usp, uvp, cause); - - return(rc); -} - - -/* - * VC state machine action 4 - * Received CALL PROCEEDING - * - * Start timer T310, go to UNI_CALL_OUT_PROC - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act04(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int cause, rc, vpi, vci; - struct atm_pif *pip = usp->us_pif; - struct ie_generic *iep; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Make sure a Connection ID is part of the message - */ - if (msg->msg_ie_cnid) { - vpi = msg->msg_ie_cnid->ie_cnid_vpci; - vci = msg->msg_ie_cnid->ie_cnid_vci; - } else { - iep = uma_zalloc(unisig_ie_zone, M_WAITOK); - if (iep == NULL) - return (ENOMEM); - iep->ie_ident = UNI_IE_CNID; - iep->ie_err_cause = UNI_IE_CAUS_MISSING; - MSG_IE_ADD(msg, iep, UNI_MSG_IE_ERR); - cause = UNI_IE_CAUS_MISSING; - ATM_DEBUG0("unisig_vc_act04: no CNID in Call Proc\n"); - goto response04; - } - - /* - * Make sure we can handle the specified VPI and VCI - */ - if (vpi > pip->pif_maxvpi || vci > pip->pif_maxvci || - vci < UNI_IE_CNID_MIN_VCI) { - cause = UNI_IE_CAUS_BAD_VCC; - ATM_DEBUG0("unisig_vc_act04: VPI/VCI invalid\n"); - goto response04; - } - - /* - * Make sure the specified VPI and VCI are not in use - */ - if (unisig_find_vpvc(usp, vpi, vci, VCC_OUT)) { - cause = UNI_IE_CAUS_NA_VCC; - ATM_DEBUG0("unisig_vc_act04: VPI/VCI in use\n"); - goto response04; - } - - /* - * Start timer T310 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T310); - - /* - * Save the specified VPI and VCI - */ - uvp->uv_vpi = vpi; - uvp->uv_vci = vci; - - /* - * Set the state - */ - uvp->uv_sstate = UNI_CALL_OUT_PROC; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); - -response04: - /* - * Initiate call clearing - */ - rc = unisig_vc_clear_call(usp, uvp, msg, cause); - - return(rc); -} - - -/* - * VC state machine action 5 - * Timeout in UNI_CALL_OUT_PROC - * - * Clear call towards network - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act05(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - struct unisig_msg *rls_msg; - struct ie_generic *cause_ie; - - /* - * Send a RELEASE message - */ - rls_msg = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO); - if (rls_msg == NULL) - return(ENOMEM); - cause_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO); - if (cause_ie == NULL) { - uma_zfree(unisig_msg_zone, rls_msg); - return(ENOMEM); - } - - /* - * Fill out the RELEASE message - */ - rls_msg->msg_call_ref = uvp->uv_call_ref; - rls_msg->msg_type = UNI_MSG_RLSE; - rls_msg->msg_type_flag = 0; - rls_msg->msg_type_action = 0; - rls_msg->msg_ie_caus = cause_ie; - - /* - * Fill out the cause IE - */ - cause_ie->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - cause_ie->ie_caus_cause = UNI_IE_CAUS_TIMER; - bcopy("310", cause_ie->ie_caus_diagnostic, 3); - - /* - * Send the RELEASE message. - */ - rc = unisig_send_msg(usp, rls_msg); - unisig_free_msg(rls_msg); - - /* - * Start timer T308 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T308); - - /* - * Set the new state - */ - uvp->uv_sstate = UNI_RELEASE_REQUEST; - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(rc); -} - - -/* - * VC state machine action 6 - * Received CONNECT - * - * Send CONNECT ACK, go to UNI_ACTIVE state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act06(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int cause, rc, vci, vpi; - struct atm_pif *pip = usp->us_pif; - struct unisig_msg *cack_msg; - struct ie_generic *iep; - Atm_attributes *ap; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - ap = &uvp->uv_connvc->cvc_attr; - - /* - * See if a VPI/VCI is specified - */ - if (msg->msg_ie_cnid) { - /* - * Yes--VPI/VCI must be the first specification or must - * match what was specified before - */ - vpi = msg->msg_ie_cnid->ie_cnid_vpci; - vci = msg->msg_ie_cnid->ie_cnid_vci; - if ((uvp->uv_vpi || uvp->uv_vci) && - (vpi != uvp->uv_vpi || - vci != uvp->uv_vci)) { - cause = UNI_IE_CAUS_BAD_VCC; - ATM_DEBUG0("unisig_vc_act06: VPI/VCI invalid\n"); - goto response06; - } - - /* - * Specified VPI/VCI must be within range - */ - if (vpi > pip->pif_maxvpi || vci > pip->pif_maxvci || - vci < UNI_IE_CNID_MIN_VCI) { - cause = UNI_IE_CAUS_BAD_VCC; - ATM_DEBUG0("unisig_vc_act06: VPI/VCI invalid\n"); - goto response06; - } - uvp->uv_vpi = vpi; - uvp->uv_vci = vci; - } else { - /* - * No--VCI must have been specified earlier - * May be called from netisr - don't wait. - */ - if (!uvp->uv_vci) { - iep = uma_zalloc(unisig_ie_zone, M_NOWAIT); - if (iep == NULL) - return(ENOMEM); - iep->ie_ident = UNI_IE_CNID; - iep->ie_err_cause = UNI_IE_CAUS_MISSING; - MSG_IE_ADD(msg, iep, UNI_MSG_IE_ERR); - cause = UNI_IE_CAUS_MISSING; - ATM_DEBUG0("unisig_vc_act06: CNID missing\n"); - goto response06; - } - } - - /* - * Handle AAL parameters negotiation - */ - if (msg->msg_ie_aalp) { - struct ie_generic *aalp = msg->msg_ie_aalp; - - /* - * AAL parameters must have been sent in SETUP - */ - if ((ap->aal.tag != T_ATM_PRESENT) || - (ap->aal.type != aalp->ie_aalp_aal_type)) { - cause = UNI_IE_CAUS_IECONTENT; - goto response06; - } - - switch (aalp->ie_aalp_aal_type) { - - case UNI_IE_AALP_AT_AAL3: - /* - * Maximum SDU size negotiation - */ - if (aalp->ie_aalp_4_fwd_max_sdu == T_ATM_ABSENT) - break; - if ((ap->aal.v.aal4.forward_max_SDU_size < - aalp->ie_aalp_4_fwd_max_sdu) || - (ap->aal.v.aal4.backward_max_SDU_size < - aalp->ie_aalp_4_bkwd_max_sdu)) { - cause = UNI_IE_CAUS_IECONTENT; - goto response06; - } else { - ap->aal.v.aal4.forward_max_SDU_size = - aalp->ie_aalp_4_fwd_max_sdu; - ap->aal.v.aal4.backward_max_SDU_size = - aalp->ie_aalp_4_bkwd_max_sdu; - } - break; - - case UNI_IE_AALP_AT_AAL5: - /* - * Maximum SDU size negotiation - */ - if (aalp->ie_aalp_5_fwd_max_sdu == T_ATM_ABSENT) - break; - if ((ap->aal.v.aal5.forward_max_SDU_size < - aalp->ie_aalp_5_fwd_max_sdu) || - (ap->aal.v.aal5.backward_max_SDU_size < - aalp->ie_aalp_5_bkwd_max_sdu)) { - cause = UNI_IE_CAUS_IECONTENT; - goto response06; - } else { - ap->aal.v.aal5.forward_max_SDU_size = - aalp->ie_aalp_5_fwd_max_sdu; - ap->aal.v.aal5.backward_max_SDU_size = - aalp->ie_aalp_5_bkwd_max_sdu; - } - break; - } - } - - /* - * Get memory for a CONNECT ACK message - * May be called from netisr. - */ - cack_msg = uma_zalloc(unisig_msg_zone, M_NOWAIT); - if (cack_msg == NULL) - return(ENOMEM); - - /* - * Fill out the CONNECT ACK message - */ - cack_msg->msg_call_ref = uvp->uv_call_ref; - cack_msg->msg_type = UNI_MSG_CACK; - cack_msg->msg_type_flag = 0; - cack_msg->msg_type_action = 0; - - /* - * Send the CONNECT ACK message - */ - rc = unisig_send_msg(usp, cack_msg); - unisig_free_msg(cack_msg); - - /* - * Set the new state - */ - uvp->uv_sstate = UNI_ACTIVE; - uvp->uv_ustate = VCCU_OPEN; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Notify the user that the connection is now active - */ - atm_cm_connected(uvp->uv_connvc); - - return(0); - -response06: - /* - * Initiate call clearing - */ - rc = unisig_vc_clear_call(usp, uvp, msg, cause); - - return(rc); -} - - -/* - * VC state machine action 7 - * Abort routine called or signalling SAAL session reset while in - * one of the call setup states - * - * Clear the call, send RELEASE COMPLETE, notify the user. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act07(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Send a RELEASE COMPLETE message rejecting the connection - */ - rc = unisig_send_release_complete(usp, uvp, msg, - UNI_IE_CAUS_TEMP); - - /* - * Clear the call VCCB - */ - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Notify the user - */ - if ((msg != NULL) && (msg->msg_ie_caus != NULL)) - unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr, - msg->msg_ie_caus); - else - unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - atm_cm_cleared(uvp->uv_connvc); - - return(rc); -} - - -/* - * VC state machine action 8 - * Received SETUP - * - * Check call paramaters, notify user that a call has been received, - * set UNI_CALL_PRESENT state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act08(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int cause = 0, rc, vpi, vci; - struct atm_pif *pip = usp->us_pif; - struct atm_nif *nip; - Atm_addr_nsap *nap; - Atm_attributes attr; - - ATM_DEBUG3("unisig_vc_act08: usp=%p, uvp=%p, msg=%p\n", - usp, uvp, msg); - - /* - * Make sure that the called address is the right format - */ - if (msg->msg_ie_cdad->ie_cdad_plan != UNI_IE_CDAD_PLAN_NSAP) { - cause = UNI_IE_CAUS_IECONTENT; - ATM_DEBUG0("unisig_vc_act08: bad address format\n"); - goto response08; - } - - /* - * Make sure that the called address is ours - */ - nap = (Atm_addr_nsap *) msg->msg_ie_cdad->ie_cdad_addr.address; - if (bcmp(usp->us_addr.address, nap, /* XXX */ - sizeof(Atm_addr_nsap)-1)) { - cause = UNI_IE_CAUS_IECONTENT; - ATM_DEBUG0("unisig_vc_act08: address not mine\n"); - goto response08; - } - - /* - * Find the right NIF for the given selector byte - */ - nip = pip->pif_nif; - while (nip && nip->nif_sel != nap->aan_sel) { - nip = nip->nif_pnext; - } - if (!nip) { - cause = UNI_IE_CAUS_IECONTENT; - ATM_DEBUG0("unisig_vc_act08: bad selector byte\n"); - goto response08; - } - - /* - * See if we recognize the specified AAL - */ - if (msg->msg_ie_aalp->ie_aalp_aal_type != UNI_IE_AALP_AT_AAL3 && - msg->msg_ie_aalp->ie_aalp_aal_type != - UNI_IE_AALP_AT_AAL5) { - cause = UNI_IE_CAUS_UAAL; - ATM_DEBUG0("unisig_vc_act08: bad AAL\n"); - goto response08; - } - - /* - * Should verify that we can handle requested - * connection QOS - */ - - /* - * Make sure the specified VPI/VCI is valid - */ - vpi = msg->msg_ie_cnid->ie_cnid_vpci; - vci = msg->msg_ie_cnid->ie_cnid_vci; - if (vpi > pip->pif_maxvpi || - vci > pip->pif_maxvci || - vci < UNI_IE_CNID_MIN_VCI) { - cause = UNI_IE_CAUS_BAD_VCC; - ATM_DEBUG0("unisig_vc_act08: VPI/VCI invalid\n"); - goto response08; - } - - /* - * Make sure the specified VPI/VCI isn't in use already - */ - if (unisig_find_vpvc(usp, vpi, vci, VCC_IN)) { - cause = UNI_IE_CAUS_NA_VCC; - ATM_DEBUG0("unisig_vc_act08: VPI/VCI in use\n"); - goto response08; - } - - /* - * Make sure it's a point-to-point connection - */ - if (msg->msg_ie_bbcp->ie_bbcp_conn_config != - UNI_IE_BBCP_CC_PP) { - cause = UNI_IE_CAUS_NI_BC; - ATM_DEBUG0("unisig_vc_act08: conn not pt-pt\n"); - goto response08; - } - - /* - * Fill in the VCCB fields that we can at this point - */ - uvp->uv_type = VCC_SVC | VCC_IN | VCC_OUT; - uvp->uv_proto = pip->pif_sigmgr->sm_proto; - uvp->uv_sstate = UNI_CALL_PRESENT; - uvp->uv_ustate = VCCU_POPEN; - uvp->uv_pif = pip; - uvp->uv_nif = nip; - uvp->uv_vpi = msg->msg_ie_cnid->ie_cnid_vpci; - uvp->uv_vci = msg->msg_ie_cnid->ie_cnid_vci; - uvp->uv_tstamp = time_second; - - /* - * Copy the connection attributes from the SETUP message - * to an attribute block - */ - bzero(&attr, sizeof(attr)); - attr.nif = nip; - attr.aal.tag = T_ATM_ABSENT; - attr.traffic.tag = T_ATM_ABSENT; - attr.bearer.tag = T_ATM_ABSENT; - attr.bhli.tag = T_ATM_ABSENT; - attr.blli.tag_l2 = T_ATM_ABSENT; - attr.blli.tag_l3 = T_ATM_ABSENT; - attr.llc.tag = T_ATM_ABSENT; - attr.called.tag = T_ATM_ABSENT; - attr.calling.tag = T_ATM_ABSENT; - attr.qos.tag = T_ATM_ABSENT; - attr.transit.tag = T_ATM_ABSENT; - attr.cause.tag = T_ATM_ABSENT; - unisig_save_attrs(usp, msg, &attr); - - /* - * Notify the connection manager of the new VCC - */ - ATM_DEBUG0("unisig_vc_act08: notifying user of connection\n"); - rc = atm_cm_incoming((struct vccb *)uvp, &attr); - if (rc) - goto response08; - - /* - * Wait for the connection recipient to issue an accept - * or reject - */ - return(0); - -response08: - ATM_DEBUG1("unisig_vc_act08: reject with cause=%d\n", cause); - - /* - * Clear the VCCB state - */ - uvp->uv_sstate = UNI_NULL; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Some problem was detected with the request. Send a Q.2931 - * message rejecting the connection. - */ - rc = unisig_send_release_complete(usp, uvp, msg, cause); - - return(rc); -} - - -/* - * VC state machine action 9 - * Accept routine called by user - * - * Send CONNECT, start timer T313, go to UNI_CONNECT_REQUEST state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act09(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - struct unisig_msg *conn_msg; - - /* may be called from timeout - don't wait */ - conn_msg = uma_zalloc(unisig_msg_zone, M_NOWAIT); - if (conn_msg == NULL) - return(ENOMEM); - - /* - * Fill out the response - */ - conn_msg->msg_call_ref = uvp->uv_call_ref; - conn_msg->msg_type = UNI_MSG_CONN; - conn_msg->msg_type_flag = 0; - conn_msg->msg_type_action = 0; - - /* - * Send the CONNECT message. If the send fails, the other - * side will eventually time out and close the connection. - */ - rc = unisig_send_msg(usp, conn_msg); - unisig_free_msg(conn_msg); - if (rc) { - return(rc); - } - - /* - * Start timer T313 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T313); - - /* - * Set the new state - */ - uvp->uv_sstate = UNI_CONNECT_REQUEST; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} - - -/* - * VC state machine action 10 - * Received CONNECT ACK - * - * Go to UNI_ACTIVE state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act10(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Set the state - */ - uvp->uv_sstate = UNI_ACTIVE; - uvp->uv_ustate = VCCU_OPEN; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Notify the user that the call is up - */ - atm_cm_connected(uvp->uv_connvc); - - return (0); -} - - -/* - * VC state machine action 11 - * Reject handler called - * - * Send RELEASE COMPLETE, clear the call - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act11(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc, cause; - - /* - * Send generic cause code if one is not already set - */ - if (uvp->uv_connvc->cvc_attr.cause.tag == T_ATM_PRESENT) - cause = T_ATM_ABSENT; - else - cause = T_ATM_CAUSE_CALL_REJECTED; - - /* - * Send a RELEASE COMPLETE message - */ - rc = unisig_send_release_complete(usp, uvp, msg, cause); - - /* - * Clear the call VCCB - */ - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(rc); -} - - -/* - * VC state machine action 12 - * Release or abort routine called - * - * Send RELEASE, start timer T308, go to UNI_RELEASE_REQUEST state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act12(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Send the RELEASE message - */ - rc = unisig_vc_clear_call(usp, uvp, (struct unisig_msg *)NULL, - T_ATM_ABSENT); - - return(rc); -} - - -/* - * VC state machine action 13 - * RELEASE COMPLETE received - * - * Clear the call - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act13(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Set the state - */ - uvp->uv_sstate = UNI_FREE; - if (uvp->uv_ustate != VCCU_ABORT) - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Notify the user that the call is now closed - */ - if (msg->msg_ie_caus != NULL) - unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr, - msg->msg_ie_caus); - atm_cm_cleared(uvp->uv_connvc); - - return(0); -} - - -/* - * VC state machine action 14 - * Timer expired while waiting for RELEASE COMPLETE - * - * If this is the second expiration, just clear the call. Otherwise, - * retransmit the RELEASE message and restart timer T308. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act14(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Check the retry count - */ - if (uvp->uv_retry) { - /* - * Clear the connection - */ - rc = unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - } else { - /* - * Increment the retry count - */ - uvp->uv_retry++; - - /* - * Resend the RELEASE message - */ - rc = unisig_send_release(usp, uvp, - (struct unisig_msg *)0, T_ATM_ABSENT); - if (rc) - return(rc); - - /* - * Restart timer T308 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T308); - } - - return(0); -} - - -/* - * VC state machine action 15 - * RELEASE received in UNI_ACTIVE state - * - * Send RELEASE COMPLETE, go to UNI_FREE, notify the user - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act15(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int cause, rc; - struct ie_generic *iep; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * If there was no Cause IE, flag an error - */ - if (!msg->msg_ie_caus) { - cause = UNI_IE_CAUS_MISSING; - for (iep=msg->msg_ie_err; iep; iep=iep->ie_next) { - if (iep->ie_ident == UNI_IE_CAUS && - iep->ie_err_cause == - UNI_IE_CAUS_IECONTENT) { - cause = UNI_IE_CAUS_IECONTENT; - } - } - if (cause == UNI_IE_CAUS_MISSING) { - iep = uma_zalloc(unisig_ie_zone, M_WAITOK); - if (iep == NULL) - return(ENOMEM); - iep->ie_ident = UNI_IE_CNID; - iep->ie_err_cause = UNI_IE_CAUS_MISSING; - MSG_IE_ADD(msg, iep, UNI_MSG_IE_ERR); - } - } else { - cause = UNI_IE_CAUS_NORM_UNSP; - } - - /* - * Send a RELEASE COMPLETE message - */ - rc = unisig_send_release_complete(usp, uvp, msg, cause); - - /* - * Set the state - */ - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - /* - * Notify the user that the call is cleared - */ - if (msg->msg_ie_caus != NULL) - unisig_cause_attr_from_ie(&uvp->uv_connvc->cvc_attr, - msg->msg_ie_caus); - else - unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, - T_ATM_CAUSE_UNSPECIFIED_NORMAL); - atm_cm_cleared(uvp->uv_connvc); - - return(rc); -} - - -/* - * VC state machine action 16 - * RELEASE received in UNI_RELEASE_REQUEST state - * - * Clear the call - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act16(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Clear the VCCB - */ - rc = unisig_clear_vcc(usp, uvp, T_ATM_ABSENT); - - return(rc); -} - - -/* - * VC state machine action 17 - * Protocol error - * - * Send a STATUS message with cause 101, "message not compatible with - * call state" - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act17(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - ATM_DEBUG3("unisig_vc_perror: usp=%p, uvp=%p, msg=%p\n", - usp, uvp, msg); - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Send a STATUS message - */ - rc = unisig_send_status(usp, uvp, msg, UNI_IE_CAUS_STATE); - - return(rc ? rc : EINVAL); -} - - -/* - * VC state machine action 18 - * Signalling AAL connection has been lost - * - * Start timer T309. If the timer expires before the SAAL connection - * comes back, the VCC will be cleared. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act18(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Start timer T309 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T309); - - /* - * Set new state - */ - uvp->uv_sstate = UNI_SSCF_RECOV; - - return(0); -} - - -/* - * VC state machine action 19 - * Ignore the event - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act19(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - return(0); -} - - -/* - * VC state machine action 20 - * SSCF establish indication in UNI_SSCF_RECOV state -- signalling - * AAL has come up after an outage - * - * Send STATUS ENQ to make sure we're in compatible state with other end - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act20(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - struct unisig_msg *stat_msg; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Get memory for a STATUS ENQUIRY message - * May be called from netisr - don't wait. - */ - stat_msg = uma_zalloc(unisig_msg_zone, M_NOWAIT); - if (stat_msg == NULL) - return(ENOMEM); - - /* - * Fill out the message - */ - stat_msg->msg_call_ref = uvp->uv_call_ref; - stat_msg->msg_type = UNI_MSG_SENQ; - stat_msg->msg_type_flag = 0; - stat_msg->msg_type_action = 0; - - /* - * Send the STATUS ENQUIRY message - */ - rc = unisig_send_msg(usp, stat_msg); - unisig_free_msg(stat_msg); - - /* - * Return to active state - */ - uvp->uv_sstate = UNI_ACTIVE; - - return(rc); -} - - -/* - * VC state machine action 21 - * STATUS received - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection (may - * be NULL) - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act21(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int cause, rc; - - /* - * Ignore a STATUS message with the global call reference - */ - if (GLOBAL_CREF(msg->msg_call_ref)) { - return(0); - } - - /* - * If the network thinks we're in NULL state, clear the VCC - */ - if (msg->msg_ie_clst->ie_clst_state == UNI_NULL) { - if (uvp) { - (void)unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER); - } - return(0); - } - - /* - * If we are in NULL state, send a RELEASE COMPLETE - */ - if (!uvp || (uvp->uv_sstate == UNI_FREE) || - (uvp->uv_sstate == UNI_NULL)) { - rc = unisig_send_release_complete(usp, - uvp, msg, UNI_IE_CAUS_STATE); - return(rc); - } - - /* - * If the reported state doesn't match our state, close the VCC - * unless we're in UNI_RELEASE_REQUEST or UNI_RELEASE_IND - */ - if (msg->msg_ie_clst->ie_clst_state != uvp->uv_sstate) { - if (uvp->uv_sstate == UNI_RELEASE_REQUEST || - uvp->uv_sstate == UNI_RELEASE_IND) { - return(0); - } - rc = unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_MESSAGE_INCOMPATIBLE_WITH_CALL_STATE); - } - - /* - * States match, check for an error on one of our messages - */ - cause = msg->msg_ie_caus->ie_caus_cause; - if (cause == UNI_IE_CAUS_MISSING || - cause == UNI_IE_CAUS_MTEXIST || - cause == UNI_IE_CAUS_IEEXIST || - cause == UNI_IE_CAUS_IECONTENT || - cause == UNI_IE_CAUS_STATE) { - ATM_DEBUG2("unisig_vc_act21: error %d on message 0x%x\n", - cause, - msg->msg_ie_caus->ie_caus_diagnostic[0]); - if (uvp) { - (void)unisig_clear_vcc(usp, uvp, cause); - } - } - - return(0); -} - - -/* - * VC state machine action 22 - * Received STATUS ENQ - * - * Send STATUS with cause 30 "response to STATUS ENQUIRY" and - * current state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection (may - * be NULL) - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act22(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - struct unisig_msg *status; - struct ie_generic *callst_ie, *cause_ie; - - ATM_DEBUG3("unisig_vc_perror: usp=%p, uvp=%p, msg=%p\n", - usp, uvp, msg); - - /* - * Get memory for a STATUS message - */ - status = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO); - if (status == NULL) - return(ENOMEM); - callst_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO); - if (callst_ie == NULL) { - uma_zfree(unisig_msg_zone, status); - return(ENOMEM); - } - cause_ie = uma_zalloc(unisig_ie_zone, M_WAITOK | M_ZERO); - if (cause_ie == NULL) { - uma_zfree(unisig_msg_zone, status); - uma_zfree(unisig_ie_zone, callst_ie); - return(ENOMEM); - } - - /* - * Fill out the response - */ - if (uvp) { - status->msg_call_ref = uvp->uv_call_ref; - } else if (msg) { - if (msg->msg_call_ref & UNI_MSG_CALL_REF_RMT) - status->msg_call_ref = msg->msg_call_ref & - UNI_MSG_CALL_REF_MASK; - else - status->msg_call_ref = msg->msg_call_ref | - UNI_MSG_CALL_REF_RMT; - } else { - status->msg_call_ref = UNI_MSG_CALL_REF_GLOBAL; - } - status->msg_type = UNI_MSG_STAT; - status->msg_type_flag = 0; - status->msg_type_action = 0; - status->msg_ie_clst = callst_ie; - status->msg_ie_caus = cause_ie; - - /* - * Fill out the call state IE - */ - callst_ie->ie_ident = UNI_IE_CLST; - callst_ie->ie_coding = 0; - callst_ie->ie_flag = 0; - callst_ie->ie_action = 0; - if (uvp) { - switch(uvp->uv_sstate) { - case UNI_FREE: - callst_ie->ie_clst_state = UNI_NULL; - break; - default: - callst_ie->ie_clst_state = uvp->uv_sstate; - } - } else { - callst_ie->ie_clst_state = UNI_NULL; - } - - /* - * Fill out the cause IE - */ - cause_ie->ie_ident = UNI_IE_CAUS; - cause_ie->ie_coding = 0; - cause_ie->ie_flag = 0; - cause_ie->ie_action = 0; - cause_ie->ie_caus_loc = UNI_IE_CAUS_LOC_USER; - cause_ie->ie_caus_cause = UNI_IE_CAUS_SENQ; - - /* - * Send the STATUS message - */ - rc = unisig_send_msg(usp, status); - unisig_free_msg(status); - return(rc); -} - - -/* - * VC state machine action 23 - * Received ADD PARTY - * - * We don't support multipoint connections, so send an ADD PARTY REJECT - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act23(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - struct unisig_msg *apr_msg; - - /* - * Get memory for the ADD PARTY REJECT message - */ - apr_msg = uma_zalloc(unisig_msg_zone, M_WAITOK | M_ZERO); - if (apr_msg == NULL) - return(ENOMEM); - - /* - * Fill out the message - */ - if (msg->msg_call_ref & UNI_MSG_CALL_REF_RMT) - apr_msg->msg_call_ref = msg->msg_call_ref & - UNI_MSG_CALL_REF_MASK; - else - apr_msg->msg_call_ref = msg->msg_call_ref | - UNI_MSG_CALL_REF_RMT; - apr_msg->msg_type = UNI_MSG_ADPR; - apr_msg->msg_type_flag = 0; - apr_msg->msg_type_action = 0; - - /* - * Use the endpoint reference IE from the received message - */ - apr_msg->msg_ie_eprf = msg->msg_ie_eprf; - - /* - * Send the ADD PARTY REJECT message - */ - rc = unisig_send_msg(usp, apr_msg); - apr_msg->msg_ie_eprf = NULL; - unisig_free_msg(apr_msg); - - return(rc); -} - - -/* - * VC state machine action 24 - * User error - * - * Return EALREADY - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act24(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - return(EALREADY); -} - - -/* - * VC state machine action 25 - * User error - * - * Return EINVAL - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act25(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - return(EINVAL); -} - - -/* - * VC state machine action 26 - * PVC abort - * - * The abort handler was called to abort a PVC. Clear the VCCB and - * notify the user. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act26(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Close the VCCB - */ - rc = unisig_close_vcc(usp, uvp); - if (rc) - return(rc); - - /* - * Notify the user - */ - if (uvp->uv_connvc->cvc_attr.cause.tag != T_ATM_PRESENT) - unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - - atm_cm_cleared(uvp->uv_connvc); - - return(0); -} - - -/* - * VC state machine action 27 - * Signalling AAL failure - * - * Change PVC state to UNI_PVC_ACT_DOWN. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act27(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Set the state - */ - uvp->uv_sstate = UNI_PVC_ACT_DOWN; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} - - -/* - * VC state machine action 28 - * Signalling AAL established - * - * Set PVC state to UNI_PVC_ACTIVE. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act28(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Set the state - */ - uvp->uv_sstate = UNI_PVC_ACTIVE; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} - - -/* - * VC state machine action 29 - * Protocol error - * - * Send a RELEASE COMPLETE message with cause 81, "invalid call - * reference value" - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection (may - * be NULL) - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act29(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - int rc; - - /* - * Send a RELEASE COMPLETE message - */ - rc = unisig_send_release_complete(usp, uvp, msg, - UNI_IE_CAUS_CREF); - - return(rc); -} - - -/* - * VC state machine action 30 - * Release routine called while SSCF session down, or SSCF session - * reset or lost while in UNI_CALL_PRESENT - * - * Go to UNI_FREE state - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act30(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - /* - * Clear any running timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Clear the call state - */ - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} - - -/* - * VC state machine action 31 - * Accept handler called in UNI_FREE state. - * - * The call was in UNI_CALL_PRESENT state when it was closed because - * of an SSCF failure. Return an error indication. The accept - * handler will free the VCCB and return the proper code to the - * caller. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to a UNISIG message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_act31(usp, uvp, msg) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; -{ - return(ENETDOWN); -} - - -/* - * Initiate clearing a call by sending a RELEASE message. - * - * Arguments: - * usp pointer to protocol instance block - * uvp pointer to the VCCB for the affected connection - * msg pointer to UNI signalling message that the RELEASE - * responds to (may be NULL) - * cause the reason for clearing the call; a value of - * T_ATM_ABSENT indicates that the cause code is - * in the VCC's ATM attributes block - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -unisig_vc_clear_call(usp, uvp, msg, cause) - struct unisig *usp; - struct unisig_vccb *uvp; - struct unisig_msg *msg; - int cause; -{ - int rc; - - /* - * Clear the retry count - */ - uvp->uv_retry = 0; - - /* - * Make sure the ATM attributes block has a valid cause code, - * if needed - */ - if (cause == T_ATM_ABSENT && - uvp->uv_connvc->cvc_attr.cause.tag != - T_ATM_PRESENT) { - uvp->uv_connvc->cvc_attr.cause.tag = T_ATM_PRESENT; - uvp->uv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - uvp->uv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - uvp->uv_connvc->cvc_attr.cause.v.cause_value = - usp->us_proto == ATM_SIG_UNI30 ? - T_ATM_CAUSE_UNSPECIFIED_NORMAL : - T_ATM_CAUSE_NORMAL_CALL_CLEARING; - } - - /* - * Send a RELEASE message - */ - rc = unisig_send_release(usp, uvp, msg, cause); - if (rc) - return(rc); - - /* - * Start timer T308 - */ - UNISIG_VC_TIMER((struct vccb *) uvp, UNI_T308); - - /* - * Set the VCCB state - */ - uvp->uv_sstate = UNI_RELEASE_REQUEST; - if (uvp->uv_ustate != VCCU_ABORT) - uvp->uv_ustate = VCCU_CLOSED; - - /* - * Mark the time - */ - uvp->uv_tstamp = time_second; - - return(0); -} Property changes on: head/sys/netatm/uni/unisig_vc_state.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_misc.h =================================================================== --- head/sys/netatm/uni/sscop_misc.h (revision 179307) +++ head/sys/netatm/uni/sscop_misc.h (nonexistent) @@ -1,97 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP miscellaneous definitions - * - */ - -#ifndef _UNI_SSCOP_MISC_H -#define _UNI_SSCOP_MISC_H - -/* - * SSCOP command definitions - */ -#define SSCOP_CMD_MIN SSCOP_INIT /* Minimum SSCOP CMD value */ -#define SSCOP_CMD_MAX SSCOP_RETRIEVECMP_IND /* Maximum SSCOP CMD value */ -#define SSCOP_CMD_SIZE 36 /* Size of command lookup table */ - - -/* - * Management Errors - */ -#define MAA_ERROR_MIN 'A' -#define MAA_ERROR_MAX 'X' -#define MAA_ERROR_INVAL (MAA_ERROR_MAX + 1) -#define MAA_ERROR_COUNT (MAA_ERROR_MAX - MAA_ERROR_MIN + 2) - - -/* - * SSCOP Sequence Numbers - * - * SSCOP sequence numbers are 24 bit integers using modulo arithmetic. - * The macros below must be used to modify and compare such numbers. - * Comparison of sequence numbers is always relative to some base number (b). - */ -typedef u_int sscop_seq; - -#define SEQ_MOD 0xffffff -#define SEQ_VAL(v) ((v) & SEQ_MOD) -#define SEQ_SET(s,v) ((s) = SEQ_VAL(v)) -#define SEQ_ADD(s,v) (SEQ_VAL((s) + (v))) -#define SEQ_SUB(s,v) (SEQ_VAL((s) - (v))) -#define SEQ_INCR(s,v) ((s) = SEQ_VAL((s) + (v))) -#define SEQ_DECR(s,v) ((s) = SEQ_VAL((s) - (v))) -#define SEQ_EQ(x,y) (SEQ_VAL(x) == SEQ_VAL(y)) -#define SEQ_NEQ(x,y) (SEQ_VAL(x) != SEQ_VAL(y)) -#define SEQ_LT(x,y,b) (SEQ_VAL((x) - (b)) < SEQ_VAL((y) - (b))) -#define SEQ_LEQ(x,y,b) (SEQ_VAL((x) - (b)) <= SEQ_VAL((y) - (b))) -#define SEQ_GT(x,y,b) (SEQ_VAL((x) - (b)) > SEQ_VAL((y) - (b))) -#define SEQ_GEQ(x,y,b) (SEQ_VAL((x) - (b)) >= SEQ_VAL((y) - (b))) - - -/* - * SSCOP Timers - * - * All of the SSCOP timer fields are maintained in terms of clock ticks. - * The timers tick 2 times per second. - */ -#define SSCOP_HZ 2 /* SSCOP ticks per second */ - -#define SSCOP_T_NUM 4 /* Number of timers per connection */ - -#define SSCOP_T_POLL 0 /* Timer_POLL / Timer_KEEP-ALIVE */ -#define SSCOP_T_NORESP 1 /* Timer_NO-RESPONSE */ -#define SSCOP_T_CC 2 /* Timer_CC */ -#define SSCOP_T_IDLE 3 /* Timer_IDLE */ - -#endif /* _UNI_SSCOP_MISC_H */ Property changes on: head/sys/netatm/uni/sscop_misc.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uni_load.c =================================================================== --- head/sys/netatm/uni/uni_load.c (revision 179307) +++ head/sys/netatm/uni/uni_load.c (nonexistent) @@ -1,377 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * Loadable kernel module support - */ - -#include -__FBSDID("$FreeBSD$"); - -#ifndef ATM_UNI_MODULE -#include "opt_atm.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * External functions - */ -int sscop_start(void); -int sscop_stop(void); -int sscf_uni_start(void); -int sscf_uni_stop(void); -int uniip_start(void); -int uniip_stop(void); -int unisig_start(void); -int unisig_stop(void); - -/* - * Local functions - */ -static int uni_start(void); -static int uni_stop(void); - - -/* - * Initialize uni processing - * - * This will be called during module loading. We just notify all of our - * sub-services to initialize. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -static int -uni_start() -{ - int err; - - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - log(LOG_ERR, "version mismatch: uni=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version)); - return (EINVAL); - } - - /* - * Initialize uni sub-services - */ - err = sscop_start(); - if (err) - goto done; - - err = sscf_uni_start(); - if (err) - goto done; - - err = unisig_start(); - if (err) - goto done; - - err = uniip_start(); - if (err) - goto done; - -done: - return (err); -} - - -/* - * Halt uni processing - * - * This will be called just prior to unloading the module from - * memory. All sub-services will be notified of the termination. - * - * Arguments: - * none - * - * Returns: - * 0 shutdown was successful - * errno shutdown failed - reason indicated - * - */ -static int -uni_stop() -{ - int err, s = splnet(); - - /* - * Terminate uni sub-services - */ - err = uniip_stop(); - if (err) - goto done; - - err = unisig_stop(); - if (err) - goto done; - - err = sscf_uni_stop(); - if (err) - goto done; - - err = sscop_stop(); - if (err) - goto done; - -done: - (void) splx(s); - return (err); -} - - -#ifdef ATM_UNI_MODULE -/* - ******************************************************************* - * - * Loadable Module Support - * - ******************************************************************* - */ -static int uni_doload(void); -static int uni_dounload(void); - -/* - * Generic module load processing - * - * This function is called by an OS-specific function when this - * module is being loaded. - * - * Arguments: - * none - * - * Returns: - * 0 load was successful - * errno load failed - reason indicated - * - */ -static int -uni_doload() -{ - int err = 0; - - /* - * Start us up - */ - err = uni_start(); - if (err) - /* Problems, clean up */ - (void)uni_stop(); - - return (err); -} - - -/* - * Generic module unload processing - * - * This function is called by an OS-specific function when this - * module is being unloaded. - * - * Arguments: - * none - * - * Returns: - * 0 unload was successful - * errno unload failed - reason indicated - * - */ -static int -uni_dounload() -{ - int err = 0; - - /* - * OK, try to clean up our mess - */ - err = uni_stop(); - - return (err); -} - - - - -#include -#include -#include - -/* - * Loadable miscellaneous module description - */ -MOD_MISC(uni); - - -/* - * Loadable module support "load" entry point - * - * This is the routine called by the lkm driver whenever the - * modload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -uni_load(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(uni_doload()); -} - - -/* - * Loadable module support "unload" entry point - * - * This is the routine called by the lkm driver whenever the - * modunload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -uni_unload(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(uni_dounload()); -} - - -/* - * Loadable module support entry point - * - * This is the routine called by the lkm driver for all loadable module - * functions for this driver. This routine name must be specified - * on the modload(1) command. This routine will be called whenever the - * modload(1), modunload(1) or modstat(1) commands are issued for this - * module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * ver lkm version - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -int -uni_mod(lkmtp, cmd, ver) - struct lkm_table *lkmtp; - int cmd; - int ver; -{ - MOD_DISPATCH(uni, lkmtp, cmd, ver, - uni_load, uni_unload, lkm_nullcmd); -} - -#else /* !ATM_UNI_MODULE */ - -/* - ******************************************************************* - * - * Kernel Compiled Module Support - * - ******************************************************************* - */ -static void uni_doload(void *); - -SYSINIT(atmuni, SI_SUB_PROTO_END, SI_ORDER_ANY, uni_doload, NULL); - -/* - * Kernel initialization - * - * Arguments: - * arg Not used - * - * Returns: - * none - * - */ -static void -uni_doload(void *arg) -{ - int err = 0; - - /* - * Start us up - */ - err = uni_start(); - if (err) { - /* Problems, clean up */ - (void)uni_stop(); - - log(LOG_ERR, "ATM UNI unable to initialize (%d)!!\n", err); - } - return; -} -#endif /* ATM_UNI_MODULE */ - Property changes on: head/sys/netatm/uni/uni_load.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_pdu.h =================================================================== --- head/sys/netatm/uni/sscop_pdu.h (revision 179307) +++ head/sys/netatm/uni/sscop_pdu.h (nonexistent) @@ -1,317 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP Protocol Data Unit (PDU) definitions - * - */ - -#ifndef _UNI_SSCOP_PDU_H -#define _UNI_SSCOP_PDU_H - -/* - * SSCOP PDU Constants - */ -#define PDU_MIN_LEN 4 /* Minimum PDU length */ -#define PDU_LEN_MASK 3 /* PDU length must be 32-bit aligned */ -#define PDU_ADDR_MASK 3 /* PDUs must be 32-bit aligned */ -#define PDU_SEQ_MASK 0x00ffffff /* Mask for 24-bit sequence values */ -#define PDU_MAX_INFO 65528 /* Maximum length of PDU info field */ -#define PDU_MAX_UU 65524 /* Maximum length of SSCOP-UU field */ -#define PDU_MAX_STAT 65520 /* Maximum length of STAT list */ -#define PDU_MAX_ELEM 67 /* Maximum elements sent in STAT */ -#define PDU_PAD_ALIGN 4 /* I-field padding alignment */ - - -/* - * PDU Queueing Header - * - * There will be a queueing header tacked on to the front of each - * buffer chain that is placed on any of the sscop SD PDU queues (not - * including the SD transmission queue). Note that this header will - * not be included in the buffer data length/offset fields. - */ -struct pdu_hdr { - union { - struct pdu_hdr *phu_pack_lk; /* Pending ack queue link */ - struct pdu_hdr *phu_recv_lk; /* Receive queue link */ - } ph_u; - struct pdu_hdr *ph_rexmit_lk; /* Retranmit queue link */ - sscop_seq ph_ns; /* SD.N(S) - SD's sequence number */ - sscop_seq ph_nps; /* SD.N(PS) - SD's poll sequence */ - KBuffer *ph_buf; /* Pointer to containing buffer */ -}; -#define ph_pack_lk ph_u.phu_pack_lk -#define ph_recv_lk ph_u.phu_recv_lk - - -/* - * SSCOP PDU formats - * - * N.B. - all SSCOP PDUs are trailer oriented (don't ask me...) - */ - -/* - * PDU Type Fields - */ -#define PT_PAD_MASK 0xc0 /* Pad length mask */ -#define PT_PAD_SHIFT 6 /* Pad byte shift count */ -#define PT_SOURCE_SSCOP 0x10 /* Source = SSCOP */ -#define PT_TYPE_MASK 0x0f /* Type mask */ -#define PT_TYPE_MAX 0x0f /* Maximum pdu type */ -#define PT_TYPE_SHIFT 24 /* Type word shift count */ - -#define PT_BGN 0x01 /* Begin */ -#define PT_BGAK 0x02 /* Begin Acknowledge */ -#define PT_BGREJ 0x07 /* Begin Reject */ -#define PT_END 0x03 /* End */ -#define PT_ENDAK 0x04 /* End Acknowledge */ -#define PT_RS 0x05 /* Resynchronization */ -#define PT_RSAK 0x06 /* Resynchronization Acknowledge */ -#define PT_ER 0x09 /* Error Recovery */ -#define PT_ERAK 0x0f /* Error Recovery Acknowledge */ -#define PT_SD 0x08 /* Sequenced Data */ -#define PT_SDP 0x09 /* Sequenced Data with Poll */ -#define PT_POLL 0x0a /* Status Request */ -#define PT_STAT 0x0b /* Solicited Status Response */ -#define PT_USTAT 0x0c /* Unsolicited Status Response */ -#define PT_UD 0x0d /* Unnumbered Data */ -#define PT_MD 0x0e /* Management Data */ - -/* - * Begin PDU - */ -struct bgn_pdu { - u_char bgn_rsvd[3]; /* Reserved */ - u_char bgn_nsq; /* N(SQ) */ - union { - u_char bgnu_type; /* PDU type, etc */ - sscop_seq bgnu_nmr; /* N(MR) */ - } bgn_u; -}; -#define bgn_type bgn_u.bgnu_type -#define bgn_nmr bgn_u.bgnu_nmr - -/* - * Begin Acknowledge PDU - */ -struct bgak_pdu { - int bgak_rsvd; /* Reserved */ - union { - u_char bgaku_type; /* PDU type, etc */ - sscop_seq bgaku_nmr; /* N(MR) */ - } bgak_u; -}; -#define bgak_type bgak_u.bgaku_type -#define bgak_nmr bgak_u.bgaku_nmr - -/* - * Begin Reject PDU - */ -struct bgrej_pdu { - int bgrej_rsvd2; /* Reserved */ - u_char bgrej_type; /* PDU type, etc */ - u_char bgrej_rsvd1[3]; /* Reserved */ -}; - -/* - * End PDU - */ -struct end_pdu { - int end_rsvd2; /* Reserved */ - u_char end_type; /* PDU type, etc */ - u_char end_rsvd1[3]; /* Reserved */ -}; - -/* - * End Acknowledge PDU (Q.2110) - */ -struct endak_q2110_pdu { - int endak_rsvd2; /* Reserved */ - u_char endak_type; /* PDU type, etc */ - u_char endak_rsvd1[3]; /* Reserved */ -}; - -/* - * End Acknowledge PDU (Q.SAAL) - */ -struct endak_qsaal_pdu { - u_char endak_type; /* PDU type, etc */ - u_char endak_rsvd[3]; /* Reserved */ -}; - -/* - * Resynchronization PDU - */ -struct rs_pdu { - char rs_rsvd[3]; /* Reserved */ - u_char rs_nsq; /* N(SQ) */ - union { - u_char rsu_type; /* PDU type, etc */ - sscop_seq rsu_nmr; /* N(MR) */ - } rs_u; -}; -#define rs_type rs_u.rsu_type -#define rs_nmr rs_u.rsu_nmr - -/* - * Resynchronization Acknowledge PDU (Q.2110) - */ -struct rsak_q2110_pdu { - int rsak_rsvd; /* Reserved */ - union { - u_char rsaku_type; /* PDU type, etc */ - sscop_seq rsaku_nmr; /* N(MR) */ - } rsak_u; -}; -#define rsak2_type rsak_u.rsaku_type -#define rsak_nmr rsak_u.rsaku_nmr - -/* - * Resynchronization Acknowledge PDU (Q.SAAL) - */ -struct rsak_qsaal_pdu { - u_char rsaks_type; /* PDU type, etc */ - u_char rsak_rsvd[3]; /* Reserved */ -}; - -/* - * Error Recovery PDU - */ -struct er_pdu { - char er_rsvd[3]; /* Reserved */ - u_char er_nsq; /* N(SQ) */ - union { - u_char eru_type; /* PDU type, etc */ - sscop_seq eru_nmr; /* N(MR) */ - } er_u; -}; -#define er_type er_u.eru_type -#define er_nmr er_u.eru_nmr - -/* - * Error Recovery Acknowledge PDU - */ -struct erak_pdu { - int erak_rsvd; /* Reserved */ - union { - u_char eraku_type; /* PDU type, etc */ - sscop_seq eraku_nmr; /* N(MR) */ - } erak_u; -}; -#define erak_type erak_u.eraku_type -#define erak_nmr erak_u.eraku_nmr - -/* - * Sequenced Data PDU - */ -struct sd_pdu { - union { - u_char sdu_type; /* PDU type, etc */ - sscop_seq sdu_ns; /* N(S) */ - } sd_u; -}; -#define sd_type sd_u.sdu_type -#define sd_ns sd_u.sdu_ns - -/* - * Sequenced Data with Poll PDU - */ -struct sdp_pdu { - sscop_seq sdp_nps; /* N(PS) */ - union { - u_char sdpu_type; /* PDU type, etc */ - sscop_seq sdpu_ns; /* N(S) */ - } sdp_u; -}; -#define sdp_type sdp_u.sdpu_type -#define sdp_ns sdp_u.sdpu_ns - -/* - * Poll PDU - */ -struct poll_pdu { - sscop_seq poll_nps; /* N(PS) */ - union { - u_char pollu_type; /* PDU type, etc */ - sscop_seq pollu_ns; /* N(S) */ - } poll_u; -}; -#define poll_type poll_u.pollu_type -#define poll_ns poll_u.pollu_ns - -/* - * Solicited Status PDU - */ -struct stat_pdu { - sscop_seq stat_nps; /* N(PS) */ - sscop_seq stat_nmr; /* N(MR) */ - union { - u_char statu_type; /* PDU type, etc */ - sscop_seq statu_nr; /* N(R) */ - } stat_u; -}; -#define stat_type stat_u.statu_type -#define stat_nr stat_u.statu_nr - -/* - * Unsolicited Status PDU - */ -struct ustat_pdu { - sscop_seq ustat_le1; /* List element 1 */ - sscop_seq ustat_le2; /* List element 2 */ - sscop_seq ustat_nmr; /* N(MR) */ - union { - u_char ustatu_type; /* PDU type, etc */ - sscop_seq ustatu_nr; /* N(R) */ - } ustat_u; -}; -#define ustat_type ustat_u.ustatu_type -#define ustat_nr ustat_u.ustatu_nr - -/* - * Unit Data PDU - */ -struct ud_pdu { - u_char ud_type; /* PDU type, etc */ - u_char ud_rsvd[3]; /* Reserved */ -}; - -/* - * Management Data PDU - */ -struct md_pdu { - u_char md_type; /* PDU type, etc */ - u_char md_rsvd[3]; /* Reserved */ -}; - -#endif /* _UNI_SSCOP_PDU_H */ Property changes on: head/sys/netatm/uni/sscop_pdu.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_timer.c =================================================================== --- head/sys/netatm/uni/sscop_timer.c (revision 179307) +++ head/sys/netatm/uni/sscop_timer.c (nonexistent) @@ -1,584 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP - Timer processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static void sscop_poll_expire(struct sscop *); -static void sscop_noresponse_expire(struct sscop *); -static void sscop_cc_expire(struct sscop *); -static void sscop_idle_expire(struct sscop *); - -/* - * Local variables - */ -static void (*sscop_expired[SSCOP_T_NUM])(struct sscop *) = { - sscop_poll_expire, - sscop_noresponse_expire, - sscop_cc_expire, - sscop_idle_expire -}; - - -/* - * Process an SSCOP timer tick - * - * This function is called SSCOP_HZ times a second in order to update - * all of the sscop connection timers. The sscop expiration function - * will be called to process all timer expirations. - * - * Called at splnet. - * - * Arguments: - * tip pointer to sscop timer control block - * - * Returns: - * none - * - */ -void -sscop_timeout(tip) - struct atm_time *tip; -{ - struct sscop *sop, **sprev; - int i; - - - /* - * Schedule next timeout - */ - atm_timeout(&sscop_timer, ATM_HZ/SSCOP_HZ, sscop_timeout); - - /* - * Run through all connections, updating each active timer. - * If an expired timer is found, notify that entry. - */ - sprev = &sscop_head; - while ((sop = *sprev) != NULL) { - - /* - * Check out each timer - */ - for (i =0; i < SSCOP_T_NUM; i++) { - - /* - * Decrement timer if it's active - */ - if (sop->so_timer[i] && (--sop->so_timer[i] == 0)) { - -#ifdef DIAGNOSTIC - { - static char *tn[] = { - "POLL", - "NORESPONSE", - "CC", - "IDLE" - }; - ATM_DEBUG3("sscop_timer: %s expired, sop=%p, state=%d\n", - tn[i], sop, sop->so_state); - } -#endif - - /* - * Expired timer - process it - */ - (*sscop_expired[i])(sop); - - /* - * Make sure connection still exists - */ - if (*sprev != sop) - break; - } - } - - /* - * Update previous pointer if current control - * block wasn't deleted - */ - if (*sprev == sop) - sprev = &sop->so_next; - } -} - - -/* - * Process an SSCOP Timer_POLL expiration - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * none - * - */ -static void -sscop_poll_expire(sop) - struct sscop *sop; -{ - - /* - * Validate current state - */ - if ((sop->so_state != SOS_READY) && - ((sop->so_state != SOS_INRESYN) || - (sop->so_vers != SSCOP_VERS_QSAAL))) { - log(LOG_ERR, "sscop: invalid %s state: sop=%p, state=%d\n", - "Timer_POLL", sop, sop->so_state); - return; - } - - /* - * Send next poll along its way - */ - SEQ_INCR(sop->so_pollsend, 1); - (void) sscop_send_poll(sop); - - /* - * Reset data counter for this poll cycle - */ - sop->so_polldata = 0; - - /* - * Reset polling timer - */ - sscop_set_poll(sop); - - return; -} - - -/* - * Process an SSCOP Timer_IDLE expiration - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * none - * - */ -static void -sscop_idle_expire(sop) - struct sscop *sop; -{ - - /* - * Timer_IDLE only valid in READY state - */ - if (sop->so_state != SOS_READY) { - log(LOG_ERR, "sscop: invalid %s state: sop=%p, state=%d\n", - "Timer_IDLE", sop, sop->so_state); - return; - } - - /* - * Send next poll along its way - */ - SEQ_INCR(sop->so_pollsend, 1); - (void) sscop_send_poll(sop); - - /* - * Reset data counter for this poll cycle - */ - sop->so_polldata = 0; - - /* - * Start NO-RESPONSE timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * Reset polling timer - */ - sscop_set_poll(sop); - - return; -} - - -/* - * Process an SSCOP Timer_NORESPONSE expiration - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * none - * - */ -static void -sscop_noresponse_expire(sop) - struct sscop *sop; -{ - int err; - - /* - * Validate current state - */ - if ((sop->so_state != SOS_READY) && - ((sop->so_state != SOS_INRESYN) || - (sop->so_vers != SSCOP_VERS_QSAAL))) { - log(LOG_ERR, "sscop: invalid %s state: sop=%p, state=%d\n", - "Timer_NORESPONSE", sop, sop->so_state); - return; - } - - /* - * Peer seems to be dead, so terminate session - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, - sop->so_toku, sop->so_connvc, - SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - /* - * Error, force retry - */ - sop->so_timer[SSCOP_T_NORESP] = 1; - return; - } - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Notify peer of termination - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Report peer's failure - */ - sscop_maa_error(sop, 'P'); - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - else - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - - /* - * Return to IDLE state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * Process an SSCOP Timer_CC expiration - * - * Arguments: - * sop pointer to sscop connection control block - * - * Returns: - * none - * - */ -static void -sscop_cc_expire(sop) - struct sscop *sop; -{ - int err; - - /* - * Process timeout based on protocol state - */ - switch (sop->so_state) { - - case SOS_OUTCONN: - /* - * No response to our BGN yet - */ - if (sop->so_connctl < sop->so_parm.sp_maxcc) { - - /* - * Send another BGN PDU - */ - sop->so_connctl++; - (void) sscop_send_bgn(sop, SSCOP_SOURCE_USER); - - /* - * Restart retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - } else { - - /* - * Retransmit limit exceeded, terminate session - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, - sop->so_toku, sop->so_connvc, - SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - /* - * Error, force retry - */ - sop->so_timer[SSCOP_T_CC] = 1; - break; - } - - /* - * Notify peer of termination - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Report establishment failure - */ - sscop_maa_error(sop, 'O'); - - /* - * Clear reestablishment flag - */ - sop->so_flags &= ~SOF_REESTAB; - - /* - * Return to IDLE state - */ - sop->so_state = SOS_IDLE; - } - break; - - case SOS_OUTDISC: - /* - * No response to our END yet - */ - if (sop->so_connctl < sop->so_parm.sp_maxcc) { - - /* - * Send another END PDU - */ - sop->so_connctl++; - (void) sscop_send_end(sop, SSCOP_SOURCE_LAST); - - /* - * Restart retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - } else { - - /* - * Retransmit limit exceeded, force session termination - */ - STACK_CALL(SSCOP_RELEASE_CNF, sop->so_upper, - sop->so_toku, sop->so_connvc, 0, 0, err); - if (err) { - /* - * Error, force retry - */ - sop->so_timer[SSCOP_T_CC] = 1; - break; - } - - /* - * Report establishment failure - */ - sscop_maa_error(sop, 'O'); - - /* - * Return to IDLE state - */ - sop->so_state = SOS_IDLE; - } - break; - - case SOS_OUTRESYN: -rexmitrs: - /* - * No response to our RS yet - */ - if (sop->so_connctl < sop->so_parm.sp_maxcc) { - - /* - * Send another RS PDU - */ - sop->so_connctl++; - (void) sscop_send_rs(sop); - - /* - * Restart retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - } else { - - /* - * Retransmit limit exceeded, terminate session - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, - sop->so_toku, sop->so_connvc, - SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - /* - * Error, force retry - */ - sop->so_timer[SSCOP_T_CC] = 1; - break; - } - - /* - * Notify peer of termination - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Report establishment failure - */ - sscop_maa_error(sop, 'O'); - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - - /* - * Return to IDLE state - */ - sop->so_state = SOS_IDLE; - } - break; - - case SOS_CONRESYN: /* Q.SAAL1 */ -#if (SOS_OUTRECOV != SOS_CONRESYN) - case SOS_OUTRECOV: /* Q.2110 */ -#endif - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Handle timeout for SOS_CONRESYN - */ - goto rexmitrs; - } - - /* - * Handle timeout for SOS_OUTRECOV - */ - - /* - * No response to our ER yet - */ - if (sop->so_connctl < sop->so_parm.sp_maxcc) { - - /* - * Send another ER PDU - */ - sop->so_connctl++; - (void) sscop_send_er(sop); - - /* - * Restart retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - } else { - - /* - * Retransmit limit exceeded, terminate session - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, - sop->so_toku, sop->so_connvc, - SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - /* - * Error, force retry - */ - sop->so_timer[SSCOP_T_CC] = 1; - break; - } - - /* - * Notify peer of termination - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Report establishment failure - */ - sscop_maa_error(sop, 'O'); - - /* - * Clear receiver buffer - */ - sscop_rcvr_drain(sop); - - /* - * Return to IDLE state - */ - sop->so_state = SOS_IDLE; - } - break; - - default: - log(LOG_ERR, "sscop: invalid %s state: sop=%p, state=%d\n", - "Timer_CC", sop, sop->so_state); - } -} - Property changes on: head/sys/netatm/uni/sscop_timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_if.c =================================================================== --- head/sys/netatm/uni/unisig_if.c (revision 179307) +++ head/sys/netatm/uni/unisig_if.c (nonexistent) @@ -1,1026 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * System interface module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include - -/* - * Global variables - */ -uma_zone_t unisig_vc_zone; -uma_zone_t unisig_msg_zone; -uma_zone_t unisig_ie_zone; - -/* - * Local functions - */ -static int unisig_attach(struct sigmgr *, struct atm_pif *); -static int unisig_detach(struct atm_pif *); -static int unisig_setup(Atm_connvc *, int *); -static int unisig_release(struct vccb *, int *); -static int unisig_accept(struct vccb *, int *); -static int unisig_reject(struct vccb *, int *); -static int unisig_abort(struct vccb *); -static int unisig_ioctl(int, caddr_t, caddr_t); - - -/* - * Local variables - */ -static struct sigmgr unisig_mgr30 = { - NULL, - ATM_SIG_UNI30, - NULL, - unisig_attach, - unisig_detach, - unisig_setup, - unisig_accept, - unisig_reject, - unisig_release, - unisig_free, - unisig_ioctl -}; - -static struct sigmgr unisig_mgr31 = { - NULL, - ATM_SIG_UNI31, - NULL, - unisig_attach, - unisig_detach, - unisig_setup, - unisig_accept, - unisig_reject, - unisig_release, - unisig_free, - unisig_ioctl -}; - - -/* - * Initialize UNISIG processing - * - * This will be called during module loading. We'll just register - * the UNISIG protocol descriptor and wait for a UNISIG ATM interface - * to come online. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -int -unisig_start() -{ - int err = 0; - - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - log(LOG_ERR, "version mismatch: unisig=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), - ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), - ATM_VERS_MIN(atm_version)); - return (EINVAL); - } - - /* - * Atleast ensure the versioning prior to creating our - * UMA zone. - */ - unisig_vc_zone = uma_zcreate("unisig vcc", sizeof(struct unisig_vccb), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (unisig_vc_zone == NULL) - panic("unisig_start: uma_zcreate failed to create vcc zone"); - unisig_msg_zone = uma_zcreate("unisig msg", sizeof(struct unisig_msg), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (unisig_msg_zone == NULL) - panic("unisig_start: uma_zcreate failed to create msg zone"); - unisig_ie_zone = uma_zcreate("unisig ie", sizeof(struct ie_generic), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (unisig_ie_zone == NULL) - panic("unisig_start: uma_zcreate failed to create ie zone"); - - /* - * Register ourselves with system - */ - err = atm_sigmgr_register(&unisig_mgr30); - if (err) - goto done; - - err = atm_sigmgr_register(&unisig_mgr31); - -done: - return (err); -} - - -/* - * Halt UNISIG processing - * - * This should be called just prior to unloading the module from - * memory. All UNISIG interfaces must be deregistered before the - * protocol can be shutdown. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -int -unisig_stop() -{ - int err = 0; - int s = splnet(); - - - /* - * Any protocol instances still registered? - */ - if ((unisig_mgr30.sm_prinst != NULL) || - (unisig_mgr31.sm_prinst != NULL)) { - - /* Yes, can't stop now */ - err = EBUSY; - goto done; - } - - /* - * De-register from system - */ - (void) atm_sigmgr_deregister(&unisig_mgr30); - (void) atm_sigmgr_deregister(&unisig_mgr31); - - /* - * Free up our storage pools - */ - uma_zdestroy(unisig_vc_zone); - uma_zdestroy(unisig_msg_zone); - uma_zdestroy(unisig_ie_zone); -done: - (void)splx(s); - return (err); -} - - -/* - * Attach a UNISIG-controlled interface - * - * Each ATM physical interface must be attached with the signalling - * manager for the interface's signalling protocol (via the - * atm_sigmgr_attach function). This function will handle the - * attachment for UNISIG-controlled interfaces. A new UNISIG protocol - * instance will be created and then we'll just sit around waiting for - * status or connection requests. - * - * Function must be called at splnet. - * - * Arguments: - * smp pointer to UNISIG signalling manager control block - * pip pointer to ATM physical interface control block - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -static int -unisig_attach(smp, pip) - struct sigmgr *smp; - struct atm_pif *pip; -{ - int err = 0, s; - struct unisig *usp = NULL; - - ATM_DEBUG2("unisig_attach: smp=%p, pip=%p\n", smp, pip); - - /* - * Allocate UNISIG protocol instance control block - */ - usp = malloc(sizeof(struct unisig), M_DEVBUF, M_NOWAIT | M_ZERO); - if (usp == NULL) { - err = ENOMEM; - goto done; - } - /* - * Set state in UNISIG protocol instance control block - */ - usp->us_state = UNISIG_NULL; - usp->us_proto = smp->sm_proto; - - /* - * Set initial call reference allocation value - */ - usp->us_cref = 1; - - /* - * Link instance into manager's chain - */ - LINK2TAIL((struct siginst *)usp, struct siginst, smp->sm_prinst, - si_next); - - /* - * Link in interface - */ - usp->us_pif = pip; - s = splimp(); - pip->pif_sigmgr = smp; - pip->pif_siginst = (struct siginst *) usp; - (void) splx(s); - - /* - * Clear our ATM address. The address will be set by user - * command or by registration via ILMI. - */ - usp->us_addr.address_format = T_ATM_ABSENT; - usp->us_addr.address_length = 0; - usp->us_subaddr.address_format = T_ATM_ABSENT; - usp->us_subaddr.address_length = 0; - - /* - * Set pointer to IP - */ - usp->us_ipserv = &uniip_ipserv; - - /* - * Kick-start the UNISIG protocol - */ - UNISIG_TIMER(usp, 0); - - /* - * Log the fact that we've attached - */ - log(LOG_INFO, "unisig: attached to interface %s%d\n", - pip->pif_name, pip->pif_unit); - -done: - /* - * Reset our work if attach fails - */ - if (err) { - if (usp) { - UNISIG_CANCEL(usp); - UNLINK((struct siginst *)usp, struct siginst, - smp->sm_prinst, si_next); - free(usp, M_DEVBUF); - } - s = splimp(); - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - (void) splx(s); - } - - return (err); -} - - -/* - * Detach a UNISIG-controlled interface - * - * Each ATM physical interface may be detached from its signalling - * manager (via the atm_sigmgr_detach function). This function will - * handle the detachment for all UNISIG-controlled interfaces. All - * circuits will be immediately terminated. - * - * Function must be called at splnet. - * - * Arguments: - * pip pointer to ATM physical interface control block - * - * Returns: - * 0 detach successful - * errno detach failed - reason indicated - * - */ -static int -unisig_detach(pip) - struct atm_pif *pip; -{ - struct unisig *usp; - int err; - - ATM_DEBUG1("unisig_detach: pip=%p\n", pip); - - /* - * Get UNISIG protocol instance - */ - usp = (struct unisig *)pip->pif_siginst; - - /* - * Return an error if we're already detaching - */ - if (usp->us_state == UNISIG_DETACH) { - return(EALREADY); - } - - /* - * Pass the detach event to the signalling manager - * state machine - */ - err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_DETACH, - (KBuffer *)0); - - /* - * Log the fact that we've detached - */ - if (!err) - log(LOG_INFO, "unisig: detached from interface %s%d\n", - pip->pif_name, pip->pif_unit); - - return (0); -} - - -/* - * Open a UNISIG ATM Connection - * - * All service user requests to open a VC connection (via - * atm_open_connection) over an ATM interface attached to the UNISIG - * signalling manager are handled here. - * - * Function will be called at splnet. - * - * Arguments: - * cvp pointer to user's requested connection parameters - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection establishment is in progress - * CALL_FAILED connection establishment failed - * CALL_CONNECTED connection has been successfully established - * - */ -static int -unisig_setup(cvp, errp) - Atm_connvc *cvp; - int *errp; -{ - struct atm_pif *pip = cvp->cvc_attr.nif->nif_pif; - struct unisig *usp = (struct unisig *)pip->pif_siginst; - int rc = 0; - - ATM_DEBUG1("unisig_setup: cvp=%p\n", cvp); - - /* - * Intialize the returned error code - */ - *errp = 0; - - /* - * Open the connection - */ - switch (cvp->cvc_attr.called.addr.address_format) { - case T_ATM_PVC_ADDR: - /* - * Create a PVC - */ - *errp = unisig_open_vcc(usp, cvp); - rc = (*errp ? CALL_FAILED : CALL_CONNECTED); - break; - - case T_ATM_ENDSYS_ADDR: - case T_ATM_E164_ADDR: - - /* - * Create an SVC - */ - *errp = unisig_open_vcc(usp, cvp); - rc = (*errp ? CALL_FAILED : CALL_PROCEEDING); - break; - - default: - *errp = EPROTONOSUPPORT; - rc = CALL_FAILED; - } - - return (rc); -} - - -/* - * Close a UNISIG ATM Connection - * - * All service user requests to terminate a previously open VC - * connection (via the atm_close_connection function), which is running - * over an interface attached to the UNISIG signalling manager, are - * handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection termination is in progress - * CALL_FAILED connection termination failed - * CALL_CLEARED connection has been successfully terminated - * - */ -static int -unisig_release(vcp, errp) - struct vccb *vcp; - int *errp; -{ - int rc = 0; - struct atm_pif *pip = vcp->vc_pif; - struct unisig *usp = (struct unisig *)pip->pif_siginst; - - ATM_DEBUG1("unisig_release: vcp=%p\n", vcp); - - /* - * Initialize returned error code - */ - *errp = 0; - - /* - * Validate the connection type (PVC or SVC) - */ - if (!(vcp->vc_type & (VCC_PVC | VCC_SVC))) { - *errp = EPROTONOSUPPORT; - return(CALL_FAILED); - } - - /* - * Close the VCCB - */ - *errp = unisig_close_vcc(usp, (struct unisig_vccb *)vcp); - - /* - * Set the return code - */ - if (*errp) { - rc = CALL_FAILED; - } else if (vcp->vc_sstate == UNI_NULL || - vcp->vc_sstate == UNI_FREE) { - rc = CALL_CLEARED; - } else { - rc = CALL_PROCEEDING; - } - - return (rc); -} - - -/* - * Accept a UNISIG Open from a remote host - * - * A user calls this routine (via the atm_accept_call function) - * after it is notified that an open request was received for it. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to user's VCCB - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection establishment is in progress - * CALL_FAILED connection establishment failed - * CALL_CONNECTED connection has been successfully established - * - */ -static int -unisig_accept(vcp, errp) - struct vccb *vcp; - int *errp; -{ - struct unisig_vccb *uvp = (struct unisig_vccb *)vcp; - struct atm_pif *pip = uvp->uv_pif; - struct unisig *usp = (struct unisig *)pip->pif_siginst; - - ATM_DEBUG1("unisig_accept: vcp=%p\n", vcp); - - /* - * Initialize the returned error code - */ - *errp = 0; - - /* - * Return an error if we're detaching - */ - if (usp->us_state == UNISIG_DETACH) { - *errp = ENETDOWN; - goto free; - } - - /* - * Return an error if we lost the connection - */ - if (uvp->uv_sstate == UNI_FREE) { - *errp = ENETDOWN; - goto free; - } - - /* - * Pass the acceptance to the VC state machine - */ - *errp = unisig_vc_state(usp, uvp, UNI_VC_ACCEPT_CALL, - (struct unisig_msg *) 0); - if (*errp) - goto failed; - - return(CALL_PROCEEDING); - -failed: - /* - * On error, free the VCCB and return CALL_FAILED - */ - -free: - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - DEQUEUE(uvp, struct unisig_vccb, uv_sigelem, usp->us_vccq); - unisig_free((struct vccb *)uvp); - - return(CALL_FAILED); -} - - -/* - * Reject a UNISIG Open from a remote host - * - * A user calls this routine (via the atm_reject_call function) - * after it is notified that an open request was received for it. - * - * Function will be called at splnet. - * - * Arguments: - * uvp pointer to user's VCCB - * errp pointer to an int for extended error information - * - * Returns: - * CALL_CLEARED call request rejected - * CALL_FAILED call rejection failed - * - */ -static int -unisig_reject(vcp, errp) - struct vccb *vcp; - int *errp; -{ - struct unisig_vccb *uvp = (struct unisig_vccb *)vcp; - struct atm_pif *pip = uvp->uv_pif; - struct unisig *usp = (struct unisig *)pip->pif_siginst; - - ATM_DEBUG1("unisig_reject: uvp=%p\n", uvp); - - /* - * Initialize the returned error code - */ - *errp = 0; - - - /* - * Return an error if we're detaching - */ - if (usp->us_state == UNISIG_DETACH) { - *errp = ENETDOWN; - goto failed; - } - - /* - * Call the VC state machine - */ - *errp = unisig_vc_state(usp, uvp, UNI_VC_REJECT_CALL, - (struct unisig_msg *) 0); - if (*errp) - goto failed; - - return(CALL_CLEARED); - -failed: - /* - * On error, free the VCCB and return CALL_FAILED - */ - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - DEQUEUE(uvp, struct unisig_vccb, uv_sigelem, usp->us_vccq); - (void) unisig_free((struct vccb *)uvp); - return(CALL_FAILED); -} - - -/* - * Abort a UNISIG ATM Connection - * - * All (non-user) requests to abort a previously open VC connection (via - * the atm_abort_connection function), which is running over an - * interface attached to the UNISIG signalling manager, are handled here. - * The VCC owner will be notified of the request, in order to initiate - * termination of the connection. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * - * Returns: - * 0 connection release was successful - * errno connection release failed - reason indicated - * - */ -static int -unisig_abort(vcp) - struct vccb *vcp; -{ - - ATM_DEBUG1("unisig_abort: vcp=%p\n", vcp); - - /* - * Only abort once - */ - if (vcp->vc_ustate == VCCU_ABORT) { - return (EALREADY); - } - - /* - * Cancel any timer that might be running - */ - UNISIG_VC_CANCEL(vcp); - - /* - * Set immediate timer to schedule connection termination - */ - vcp->vc_ustate = VCCU_ABORT; - UNISIG_VC_TIMER(vcp, 0); - - return (0); -} - - -/* - * Free UNISIG ATM connection resources - * - * All service user requests to free the resources of a closed VCC - * connection (via the atm_free_connection function), which is running - * over an interface attached to the UNISIG signalling manager, are - *handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * - * Returns: - * 0 connection free was successful - * errno connection free failed - reason indicated - * - */ -int -unisig_free(vcp) - struct vccb *vcp; -{ - struct atm_pif *pip = vcp->vc_pif; - struct unisig *usp = (struct unisig *)pip->pif_siginst; - - ATM_DEBUG1("unisig_free: vcp = %p\n", vcp); - - /* - * Make sure VCC has been closed - */ - if ((vcp->vc_ustate != VCCU_CLOSED && - vcp->vc_ustate != VCCU_ABORT) || - vcp->vc_sstate != UNI_FREE) { - ATM_DEBUG2("unisig_free: bad state, sstate=%d, ustate=%d\n", - vcp->vc_sstate, vcp->vc_ustate); - return(EEXIST); - } - - /* - * Remove VCCB from protocol queue - */ - DEQUEUE(vcp, struct vccb, vc_sigelem, usp->us_vccq); - - /* - * Free VCCB storage - */ - vcp->vc_ustate = VCCU_NULL; - vcp->vc_sstate = UNI_NULL; - uma_zfree(unisig_vc_zone, vcp); - - /* - * If we're detaching and this was the last VCC queued, - * get rid of the protocol instance - */ - if ((usp->us_state == UNISIG_DETACH) && - (Q_HEAD(usp->us_vccq, struct vccb) == NULL)) { - struct sigmgr *smp = pip->pif_sigmgr; - int s = splimp(); - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - (void) splx(s); - - UNLINK((struct siginst *)usp, struct siginst, - smp->sm_prinst, si_next); - free(usp, M_DEVBUF); - } - - return (0); -} - - -/* - * UNISIG IOCTL support - * - * Function will be called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -static int -unisig_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmdelreq *adp; - struct atminfreq *aip; - struct atmsetreq *asp; - struct unisig *usp; - struct unisig_vccb *uvp; - struct air_vcc_rsp rsp; - struct atm_pif *pip; - Atm_connection *cop; - u_int vpi, vci; - int err = 0, i; - size_t buf_len; - caddr_t buf_addr; - - ATM_DEBUG1("unisig_ioctl: code=%d\n", code); - - switch (code) { - - case AIOCS_DEL_PVC: - case AIOCS_DEL_SVC: - /* - * Delete a VCC - */ - adp = (struct atmdelreq *)data; - usp = (struct unisig *)arg1; - - /* - * Don't let a user close the UNISIG signalling VC - */ - vpi = adp->adr_pvc_vpi; - vci = adp->adr_pvc_vci; - if ((vpi == UNISIG_SIG_VPI && vci == UNISIG_SIG_VCI)) - return(EINVAL); - - /* - * Find requested VCC - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem)) { - if ((uvp->uv_vpi == vpi) && (uvp->uv_vci == vci)) - break; - } - if (uvp == NULL) - return (ENOENT); - - /* - * Check VCC type - */ - switch (code) { - case AIOCS_DEL_PVC: - if (!(uvp->uv_type & VCC_PVC)) { - return(EINVAL); - } - break; - case AIOCS_DEL_SVC: - if (!(uvp->uv_type & VCC_SVC)) { - return(EINVAL); - } - break; - } - - /* - * Schedule VCC termination - */ - unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, - T_ATM_CAUSE_UNSPECIFIED_NORMAL); - err = unisig_abort((struct vccb *)uvp); - break; - - case AIOCS_INF_VCC: - /* - * Return VCC information - */ - aip = (struct atminfreq *)data; - usp = (struct unisig *)arg1; - - buf_addr = aip->air_buf_addr; - buf_len = aip->air_buf_len; - - /* - * Loop through the VCC queue - */ - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem)) { - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(rsp)) { - err = ENOSPC; - break; - } - - /* - * Fill out the response struct for the VCC - */ - (void) snprintf(rsp.avp_intf, - sizeof(rsp.avp_intf), "%s%d", - usp->us_pif->pif_name, - usp->us_pif->pif_unit); - rsp.avp_vpi = uvp->uv_vpi; - rsp.avp_vci = uvp->uv_vci; - rsp.avp_type = uvp->uv_type; - rsp.avp_aal = uvp->uv_connvc->cvc_attr.aal.type; - rsp.avp_sig_proto = uvp->uv_proto; - cop = uvp->uv_connvc->cvc_conn; - if (cop) - rsp.avp_encaps = cop->co_mpx; - else - rsp.avp_encaps = 0; - rsp.avp_state = uvp->uv_sstate; - if (uvp->uv_connvc->cvc_flags & CVCF_CALLER) { - rsp.avp_daddr = uvp->uv_connvc->cvc_attr.called.addr; - } else { - rsp.avp_daddr = uvp->uv_connvc->cvc_attr.calling.addr; - } - rsp.avp_dsubaddr.address_format = T_ATM_ABSENT; - rsp.avp_dsubaddr.address_length = 0; - rsp.avp_ipdus = uvp->uv_ipdus; - rsp.avp_opdus = uvp->uv_opdus; - rsp.avp_ibytes = uvp->uv_ibytes; - rsp.avp_obytes = uvp->uv_obytes; - rsp.avp_ierrors = uvp->uv_ierrors; - rsp.avp_oerrors = uvp->uv_oerrors; - rsp.avp_tstamp = uvp->uv_tstamp; - bzero(rsp.avp_owners, - sizeof(rsp.avp_owners)); - for (i = 0; cop && i < sizeof(rsp.avp_owners); - cop = cop->co_next, - i += T_ATM_APP_NAME_LEN+1) { - strncpy(&rsp.avp_owners[i], - cop->co_endpt->ep_getname(cop->co_toku), - T_ATM_APP_NAME_LEN); - } - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&rsp, buf_addr, - sizeof(rsp))) != 0) - break; - buf_addr += sizeof(rsp); - buf_len -= sizeof(rsp); - } - - /* - * Update the buffer pointer and length - */ - aip->air_buf_addr = buf_addr; - aip->air_buf_len = buf_len; - break; - - case AIOCS_INF_ARP: - case AIOCS_INF_ASV: - case AIOCS_SET_ASV: - /* - * Get ARP table information or get/set ARP server address - */ - err = uniarp_ioctl(code, data, arg1); - break; - - case AIOCS_SET_PRF: - /* - * Set NSAP prefix - */ - asp = (struct atmsetreq *)data; - usp = (struct unisig *)arg1; - pip = usp->us_pif; - if (usp->us_addr.address_format != T_ATM_ABSENT) { - if (bcmp(asp->asr_prf_pref, usp->us_addr.address, - sizeof(asp->asr_prf_pref)) != 0) - err = EALREADY; - break; - } - usp->us_addr.address_format = T_ATM_ENDSYS_ADDR; - usp->us_addr.address_length = sizeof(Atm_addr_nsap); - bcopy(&pip->pif_macaddr, - ((Atm_addr_nsap *)usp->us_addr.address)->aan_esi, - sizeof(pip->pif_macaddr)); - bcopy((caddr_t) asp->asr_prf_pref, - &((Atm_addr_nsap *)usp->us_addr.address)->aan_afi, - sizeof(asp->asr_prf_pref)); - log(LOG_INFO, "uni: set address %s on interface %s\n", - unisig_addr_print(&usp->us_addr), - asp->asr_prf_intf); - - /* - * Pass event to signalling manager state machine - */ - err = unisig_sigmgr_state(usp, UNISIG_SIGMGR_ADDR_SET, - (KBuffer *) NULL); - - /* - * Clean up if there was an error - */ - if (err) { - usp->us_addr.address_format = T_ATM_ABSENT; - usp->us_addr.address_length = 0; - break; - } - - /* - * Inform ARP code of new address - */ - uniarp_ifaddr((struct siginst *)usp); - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} Property changes on: head/sys/netatm/uni/unisig_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_encode.c =================================================================== --- head/sys/netatm/uni/unisig_encode.c (revision 179307) +++ head/sys/netatm/uni/unisig_encode.c (nonexistent) @@ -1,1693 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message formatting module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static int usf_enc_ie(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_aalp(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_clrt(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_bbcp(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_bhli(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_blli(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_clst(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_cdad(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_cdsa(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_cgad(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_cgsa(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_caus(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_cnid(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_qosp(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_brpi(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_rsti(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_bsdc(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_trnt(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_uimp(struct usfmt *, struct ie_generic *); -static int usf_enc_ie_ident(struct usfmt *, struct ie_generic *, - struct ie_decode_tbl *); -static int usf_enc_atm_addr(struct usfmt *, Atm_addr *); - - -/* - * Local variables - */ -static struct { - u_char ident; /* IE identifier */ - int (*encode)(struct usfmt *, struct ie_generic *); - /* Encoding function */ -} ie_table[] = { - { UNI_IE_AALP, usf_enc_ie_aalp }, - { UNI_IE_CLRT, usf_enc_ie_clrt }, - { UNI_IE_BBCP, usf_enc_ie_bbcp }, - { UNI_IE_BHLI, usf_enc_ie_bhli }, - { UNI_IE_BLLI, usf_enc_ie_blli }, - { UNI_IE_CLST, usf_enc_ie_clst }, - { UNI_IE_CDAD, usf_enc_ie_cdad }, - { UNI_IE_CDSA, usf_enc_ie_cdsa }, - { UNI_IE_CGAD, usf_enc_ie_cgad }, - { UNI_IE_CGSA, usf_enc_ie_cgsa }, - { UNI_IE_CAUS, usf_enc_ie_caus }, - { UNI_IE_CNID, usf_enc_ie_cnid }, - { UNI_IE_QOSP, usf_enc_ie_qosp }, - { UNI_IE_BRPI, usf_enc_ie_brpi }, - { UNI_IE_RSTI, usf_enc_ie_rsti }, - { UNI_IE_BLSH, usf_enc_ie_uimp }, - { UNI_IE_BNSH, usf_enc_ie_uimp }, - { UNI_IE_BSDC, usf_enc_ie_bsdc }, - { UNI_IE_TRNT, usf_enc_ie_trnt }, - { UNI_IE_EPRF, usf_enc_ie_uimp }, - { UNI_IE_EPST, usf_enc_ie_uimp }, - { 0, 0 } -}; - -extern struct ie_decode_tbl ie_aal1_tbl[]; -extern struct ie_decode_tbl ie_aal4_tbl_30[]; -extern struct ie_decode_tbl ie_aal4_tbl_31[]; -extern struct ie_decode_tbl ie_aal5_tbl_30[]; -extern struct ie_decode_tbl ie_aal5_tbl_31[]; -extern struct ie_decode_tbl ie_clrt_tbl[]; - - -/* - * Encode a UNI signalling message - * - * Arguments: - * usf pointer to a unisig formatting structure - * msg pointer to a signalling message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_enc_msg(usf, msg) - struct usfmt *usf; - struct unisig_msg *msg; -{ - int i, len, rc; - u_char c; - u_char *lp0, *lp1; - struct ie_generic *ie; - - union { - short s; - u_char sb[sizeof(short)]; - } su; - - ATM_DEBUG2("usf_enc_msg: usf=%p, msg=%p\n", - usf, msg); - - /* - * Encode the protocol discriminator - */ - c = UNI_MSG_DISC_Q93B; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the call reference length - */ - c = 3; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the call reference - */ - rc = usf_int3(usf, &msg->msg_call_ref); - if (rc) - return(rc); - - /* - * Encode the message type - */ - rc = usf_byte(usf, &msg->msg_type); - if (rc) - return(rc); - - /* - * Encode the message type extension - */ - c = ((msg->msg_type_flag & UNI_MSG_TYPE_FLAG_MASK) << - UNI_MSG_TYPE_FLAG_SHIFT) + - (msg->msg_type_action & UNI_MSG_TYPE_ACT_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Save the location of the message length and encode a length - * of zero for now. We'll fix the length up at the end. - */ - su.s = 0; - rc = usf_byte_mark(usf, &su.sb[sizeof(short)-2], &lp0); - if (rc) - return(rc); - rc = usf_byte_mark(usf, &su.sb[sizeof(short)-1], &lp1); - if (rc) - return(rc); - - /* - * Process information elements - */ - len = 0; - for (i=0; imsg_ie_vec[i]; - while (ie) { - rc = usf_enc_ie(usf, ie); - if (rc) - return(rc); - len += (ie->ie_length + UNI_IE_HDR_LEN); - ie = ie->ie_next; - } - } - - /* - * Fix the message length in the encoded message - */ - su.s = htons((u_short)len); - *lp0 = su.sb[sizeof(short)-2]; - *lp1 = su.sb[sizeof(short)-1]; - - return(0); -} - - -/* - * Encode an information element - * - * Arguments: - * usf pointer to a UNISIG formatting structure - * msg pointer to a UNISIG message structure - * ie pointer to a generic IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_char c; - u_char *lp0, *lp1; - - union { - short s; - u_char sb[sizeof(short)]; - } su; - - ATM_DEBUG2("usf_enc_ie: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the IE identifier - */ - rc = usf_byte(usf, &ie->ie_ident); - if (rc) - return(rc); - - /* - * Encode the extended type - */ - c = ((ie->ie_coding & UNI_IE_CODE_MASK) << UNI_IE_CODE_SHIFT) + - ((ie->ie_flag & UNI_IE_FLAG_MASK) << - UNI_IE_FLAG_SHIFT) + - (ie->ie_action & UNI_IE_ACT_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Mark the current location in the output stream. Encode a - * length of zero for now; we'll come back and fix it up at - * the end. - */ - su.s = 0; - rc = usf_byte_mark(usf, &su.sb[sizeof(short)-2], &lp0); - if (rc) - return(rc); - rc = usf_byte_mark(usf, &su.sb[sizeof(short)-1], &lp1); - if (rc) - return(rc); - - /* - * Look up the information element in the table - */ - for (i=0; (ie->ie_ident != ie_table[i].ident) && - (ie_table[i].encode != NULL); i++) { - } - if (ie_table[i].encode == NULL) { - /* - * Unrecognized IE - */ - return(EINVAL); - } - - /* - * Process the IE by calling the function indicated - * in the IE table - */ - rc = ie_table[i].encode(usf, ie); - if (rc) - return(rc); - - /* - * Set the length in the output stream - */ - su.s = htons((u_short)ie->ie_length); - *lp0 = su.sb[sizeof(short)-2]; - *lp1 = su.sb[sizeof(short)-1]; - - return(0); -} - - -/* - * Encode an AAL parameters information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to an AAL parms IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_aalp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc = 0; - - ATM_DEBUG2("usf_enc_ie_aalp: usf=%p, ie=%p\n", - usf, ie); - - ie->ie_length = 0; - - /* - * Encode the AAL type - */ - if (ie->ie_aalp_aal_type == T_ATM_ABSENT) - return(0); - rc = usf_byte(usf, &ie->ie_aalp_aal_type); - if (rc) - return(rc); - - /* - * Process based on AAL type - */ - switch (ie->ie_aalp_aal_type) { - case UNI_IE_AALP_AT_AAL1: - rc = usf_enc_ie_ident(usf, ie, ie_aal1_tbl); - break; - case UNI_IE_AALP_AT_AAL3: - if (usf->usf_sig->us_proto == ATM_SIG_UNI30) - rc = usf_enc_ie_ident(usf, ie, ie_aal4_tbl_30); - else - rc = usf_enc_ie_ident(usf, ie, ie_aal4_tbl_31); - break; - case UNI_IE_AALP_AT_AAL5: - if (usf->usf_sig->us_proto == ATM_SIG_UNI30) - rc = usf_enc_ie_ident(usf, ie, ie_aal5_tbl_30); - else - rc = usf_enc_ie_ident(usf, ie, ie_aal5_tbl_31); - break; - case UNI_IE_AALP_AT_AALU: - /* - * Encode the user data - */ - i = 0; - while (i < sizeof(ie->ie_aalp_user_info)) { - rc = usf_byte(usf, &ie->ie_aalp_user_info[i]); - if (rc) - break; - i++; - ie->ie_length++; - } - break; - default: - return(EINVAL); - } - - ie->ie_length++; - return(rc); -} - - -/* - * Encode a user cell rate information element - * - * This routine just encodes the parameters required for best - * effort service. - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_clrt(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - - ATM_DEBUG2("usf_enc_ie_clrt: usf=%p, ie=%p\n", - usf, ie); - -#ifdef NOTDEF - /* - * Encode Peak Cell Rate Forward CLP = 0 + 1 - */ - c = UNI_IE_CLRT_FWD_PEAK_01_ID; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - rc = usf_int3(usf, &ie->ie_clrt_fwd_peak_01); - if (rc) - return(rc); - - /* - * Encode Peak Cell Rate Backward CLP = 0 + 1 - */ - c = UNI_IE_CLRT_BKWD_PEAK_01_ID; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - rc = usf_int3(usf, &ie->ie_clrt_bkwd_peak_01); - if (rc) - return(rc); - - /* - * Encode Best Effort Flag - */ - c = UNI_IE_CLRT_BEST_EFFORT_ID; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Set IE length - */ - ie->ie_length = 9; -#endif - - /* - * Encode the user cell rate IE using the table - */ - ie->ie_length = 0; - rc = usf_enc_ie_ident(usf, ie, ie_clrt_tbl); - - return(rc); -} - - -/* - * Encode a broadband bearer capability information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_bbcp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_bbcp: usf=%p, ie=%p\n", - usf, ie); - - ie->ie_length = 0; - - /* - * Encode the broadband bearer class - */ - if (ie->ie_bbcp_bearer_class == T_ATM_ABSENT) - return(0); - c = ie->ie_bbcp_bearer_class & UNI_IE_BBCP_BC_MASK; - if (ie->ie_bbcp_bearer_class != UNI_IE_BBCP_BC_BCOB_X) - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * If the broadband bearer class was X, the next - * byte has the traffic type and timing requirements - */ - if (ie->ie_bbcp_bearer_class == UNI_IE_BBCP_BC_BCOB_X) { - c = ((ie->ie_bbcp_traffic_type & UNI_IE_BBCP_TT_MASK) << - UNI_IE_BBCP_TT_SHIFT) + - (ie->ie_bbcp_timing_req & - UNI_IE_BBCP_TR_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - - /* - * Encode the clipping and user plane connection configuration - */ - c = ((ie->ie_bbcp_clipping & UNI_IE_BBCP_SC_MASK) << - UNI_IE_BBCP_SC_SHIFT) + - (ie->ie_bbcp_conn_config & - UNI_IE_BBCP_CC_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - return(0); -} - - -/* - * Encode a broadband high layer information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_bhli(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_int type; - - ATM_DEBUG2("usf_enc_ie_bhli: usf=%p, ie=%p\n", - usf, ie); - - ie->ie_length = 0; - - /* - * Encode the high layer information type - */ - if (ie->ie_bhli_type == T_ATM_ABSENT) - return(0); - type = ie->ie_bhli_type | UNI_IE_EXT_BIT; - rc = usf_ext(usf, &type); - if (rc) - return(rc); - ie->ie_length++; - - /* - * What comes next depends on the type - */ - switch (ie->ie_bhli_type) { - case UNI_IE_BHLI_TYPE_ISO: - case UNI_IE_BHLI_TYPE_USER: - /* - * ISO or user-specified parameters -- take the - * length of information from the IE length - */ - for (i=0; iie_length-1; i++) { - rc = usf_byte(usf, &ie->ie_bhli_info[i]); - if (rc) - return(rc); - ie->ie_length++; - } - break; - case UNI_IE_BHLI_TYPE_HLP: - /* - * Make sure the IE is long enough for the high - * layer profile information, then get it - */ - if (usf->usf_sig->us_proto != ATM_SIG_UNI30) - return (EINVAL); - for (i=0; iie_bhli_info[i]); - if (rc) - return(rc); - ie->ie_length++; - } - break; - case UNI_IE_BHLI_TYPE_VSA: - /* - * Make sure the IE is long enough for the vendor- - * specific application information, then get it - */ - for (i=0; iie_bhli_info[i]); - if (rc) - return(rc); - ie->ie_length++; - } - break; - default: - return(EINVAL); - } - - return(0); -} - - -/* - * Encode a broadband low layer information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_blli(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - int rc; - u_int ipi; - - ATM_DEBUG2("usf_enc_ie_blli: usf=%p, ie=%p\n", - usf, ie); - - ie->ie_length = 0; - - /* - * Encode paramteters for whichever protocol layers the - * user specified - */ - - /* - * Layer 1 information - */ - if (ie->ie_blli_l1_id && ie->ie_blli_l1_id != T_ATM_ABSENT) { - c = (UNI_IE_BLLI_L1_ID << UNI_IE_BLLI_LID_SHIFT) + - (ie->ie_blli_l1_id & - UNI_IE_BLLI_LP_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - - /* - * Layer 2 information - */ - if (ie->ie_blli_l2_id && ie->ie_blli_l2_id != T_ATM_ABSENT) { - c = (UNI_IE_BLLI_L2_ID << UNI_IE_BLLI_LID_SHIFT) + - (ie->ie_blli_l2_id & - UNI_IE_BLLI_LP_MASK); - - switch (ie->ie_blli_l2_id) { - case UNI_IE_BLLI_L2P_X25L: - case UNI_IE_BLLI_L2P_X25M: - case UNI_IE_BLLI_L2P_HDLC1: - case UNI_IE_BLLI_L2P_HDLC2: - case UNI_IE_BLLI_L2P_HDLC3: - case UNI_IE_BLLI_L2P_Q922: - case UNI_IE_BLLI_L2P_ISO7776: - /* - * Write the Layer 2 type - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode the Layer 2 mode - */ - if (ie->ie_blli_l2_mode) { - c = (ie->ie_blli_l2_mode & - UNI_IE_BLLI_L2MODE_MASK) << - UNI_IE_BLLI_L2MODE_SHIFT; - if (!ie->ie_blli_l2_window) - c |= UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - - /* - * Encode the Layer 2 window size - */ - if (ie->ie_blli_l2_window) { - c = (ie->ie_blli_l2_window & - UNI_IE_EXT_MASK) + - UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - break; - case UNI_IE_BLLI_L2P_USER: - /* - * Write the Layer 2 type - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode the user-specified layer 2 info - */ - c = (ie->ie_blli_l2_user_proto & - UNI_IE_EXT_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - break; - default: - /* - * Write the Layer 2 type - */ - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - break; - } - } - - /* - * Layer 3 information - */ - if (ie->ie_blli_l3_id && ie->ie_blli_l3_id != T_ATM_ABSENT) { - /* - * Encode the layer 3 protocol ID - */ - c = (UNI_IE_BLLI_L3_ID << UNI_IE_BLLI_LID_SHIFT) + - (ie->ie_blli_l3_id & - UNI_IE_BLLI_LP_MASK); - - /* - * Process other fields based on protocol ID - */ - switch(ie->ie_blli_l3_id) { - case UNI_IE_BLLI_L3P_X25: - case UNI_IE_BLLI_L3P_ISO8208: - case UNI_IE_BLLI_L3P_ISO8878: - /* - * Write the protocol ID - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - if (ie->ie_blli_l3_mode || - ie->ie_blli_l3_packet_size || - ie->ie_blli_l3_window) { - c = (ie->ie_blli_l3_mode & - UNI_IE_BLLI_L3MODE_MASK) << - UNI_IE_BLLI_L3MODE_SHIFT; - if (!ie->ie_blli_l3_packet_size && - !ie->ie_blli_l3_window) - c |= UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - - if (ie->ie_blli_l3_packet_size || - ie->ie_blli_l3_window) { - c = ie->ie_blli_l3_packet_size & - UNI_IE_BLLI_L3PS_MASK; - if (!ie->ie_blli_l3_window) - c |= UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - - if (ie->ie_blli_l3_window) { - c = (ie->ie_blli_l3_window & - UNI_IE_EXT_MASK) + - UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - } - break; - case UNI_IE_BLLI_L3P_USER: - /* - * Write the protocol ID - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode the user-specified protocol info - */ - c = (ie->ie_blli_l3_user_proto & - UNI_IE_EXT_MASK) + - UNI_IE_EXT_BIT; - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - break; - case UNI_IE_BLLI_L3P_ISO9577: - /* - * Write the protocol ID - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode the IPI - */ - ipi = ie->ie_blli_l3_ipi << - UNI_IE_BLLI_L3IPI_SHIFT; - rc = usf_ext(usf, &ipi); - if (rc) - return(rc); - ie->ie_length += 2; - - if (ie->ie_blli_l3_ipi == - UNI_IE_BLLI_L3IPI_SNAP) { - c = UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[0]); - if (rc) - return(rc); - - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[1]); - if (rc) - return(rc); - - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[2]); - if (rc) - return(rc); - - rc = usf_byte(usf, - &ie->ie_blli_l3_pid[0]); - if (rc) - return(rc); - - rc = usf_byte(usf, - &ie->ie_blli_l3_pid[1]); - if (rc) - return(rc); - - ie->ie_length += 6; - } - break; - default: - /* - * Write the layer 3 protocol ID - */ - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - break; - } - } - - return(0); -} - - -/* - * Encode a call state information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_clst(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_clst: usf=%p, ie=%p\n", - usf, ie); - - c = ie->ie_clst_state & UNI_IE_CLST_STATE_MASK; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length = 1; - - return(0); -} - - -/* - * Encode a called party number information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_cdad(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - int rc; - - ATM_DEBUG2("usf_enc_ie_cdad: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the numbering plan - */ - switch(ie->ie_cdad_addr.address_format) { - case T_ATM_E164_ADDR: - c = UNI_IE_CDAD_PLAN_E164 + - (UNI_IE_CDAD_TYPE_INTL - << UNI_IE_CDAD_TYPE_SHIFT); - ie->ie_length = sizeof(Atm_addr_e164) + 1; - break; - case T_ATM_ENDSYS_ADDR: - c = UNI_IE_CDAD_PLAN_NSAP + - (UNI_IE_CDAD_TYPE_UNK - << UNI_IE_CDAD_TYPE_SHIFT); - ie->ie_length = sizeof(Atm_addr_nsap) + 1; - break; - default: - return(EINVAL); - } - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the ATM address - */ - rc = usf_enc_atm_addr(usf, &ie->ie_cdad_addr); - - return(rc); -} - - -/* - * Encode a called party subaddress information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_cdsa(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - int rc; - - /* - * Encode the subaddress type - */ - switch(ie->ie_cdsa_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - c = UNI_IE_CDSA_TYPE_AESA << UNI_IE_CDSA_TYPE_SHIFT; - ie->ie_length = sizeof(Atm_addr_nsap) + 1; - break; - default: - return(EINVAL); - } - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the ATM address - */ - rc = usf_enc_atm_addr(usf, &ie->ie_cdsa_addr); - - return(rc); -} - - -/* - * Encode a calling party number information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_cgad(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - int rc; - - ATM_DEBUG2("usf_enc_ie_cgad: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the numbering plan - */ - switch(ie->ie_cgad_addr.address_format) { - case T_ATM_E164_ADDR: - c = UNI_IE_CGAD_PLAN_E164 + - (UNI_IE_CGAD_TYPE_INTL - << UNI_IE_CGAD_TYPE_SHIFT) + - UNI_IE_EXT_BIT; - ie->ie_length = sizeof(Atm_addr_e164) + 1; - break; - case T_ATM_ENDSYS_ADDR: - c = UNI_IE_CGAD_PLAN_NSAP + - (UNI_IE_CGAD_TYPE_UNK - << UNI_IE_CGAD_TYPE_SHIFT) + - UNI_IE_EXT_BIT; - ie->ie_length = sizeof(Atm_addr_nsap) + 1; - break; - default: - return(EINVAL); - } - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the presentation and screening indicators - */ -#ifdef NOTDEF - c = ((ie->ie_cgad_pres_ind & UNI_IE_CGAD_PRES_MASK) - << UNI_IE_CGAD_PRES_SHIFT) + - (ie->ie_cgad_screen_ind & - UNI_IE_CGAD_SCR_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); -#endif - - - /* - * Encode the ATM address - */ - rc = usf_enc_atm_addr(usf, &ie->ie_cgad_addr); - - return(rc); -} - - -/* - * Encode a calling party subaddress information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_cgsa(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - int rc; - - /* - * Encode the subaddress type - */ - switch(ie->ie_cgsa_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - c = UNI_IE_CGSA_TYPE_AESA << UNI_IE_CGSA_TYPE_SHIFT; - ie->ie_length = sizeof(Atm_addr_nsap) + 1; - break; - default: - return(EINVAL); - } - c |= UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Encode the ATM address - */ - rc = usf_enc_atm_addr(usf, &ie->ie_cgsa_addr); - - return(rc); -} - - -/* - * Encode a cause information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_caus(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_caus: usf=%p, ie=%p\n", - usf, ie); - - ie->ie_length = 0; - - /* - * Encode the cause location - */ - c = (ie->ie_caus_loc & UNI_IE_CAUS_LOC_MASK) | UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode the cause value - */ - c = ie->ie_caus_cause | UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length++; - - /* - * Encode any included diagnostics - */ - for (i = 0; i < ie->ie_caus_diag_len && - i < sizeof(ie->ie_caus_diagnostic); - i++) { - rc = usf_byte(usf, &ie->ie_caus_diagnostic[i]); - if (rc) - return(rc); - ie->ie_length++; - } - - return(0); -} - - -/* - * Encode a conection identifier information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_cnid(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_cnid: usf=%p, ie=%p\n", - usf, ie); - - c = ((ie->ie_cnid_vp_sig & UNI_IE_CNID_VPSIG_MASK) - << UNI_IE_CNID_VPSIG_SHIFT) + - (ie->ie_cnid_pref_excl & UNI_IE_CNID_PREX_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - rc = usf_short(usf, &ie->ie_cnid_vpci); - if (rc) - return(rc); - rc = usf_short(usf, &ie->ie_cnid_vci); - if (rc) - return(rc); - - ie->ie_length = 5; - return(0); -} - - -/* - * Encode a quality of service parameters information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_qosp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - - ATM_DEBUG2("usf_enc_ie_qosp: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode forward QoS class - */ - if (ie->ie_qosp_fwd_class == T_ATM_ABSENT || - ie->ie_qosp_bkwd_class == T_ATM_ABSENT) - return(0); - rc = usf_byte(usf, &ie->ie_qosp_fwd_class); - if (rc) - return(rc); - - /* - * Encode backward QoS class - */ - rc = usf_byte(usf, &ie->ie_qosp_bkwd_class); - - ie->ie_length = 2; - return(rc); -} - - -/* - * Encode a broadband repeat indicator information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_brpi(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_brpi: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the repeat indicator - */ - c = ie->ie_brpi_ind + UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - - return(rc); -} - - -/* - * Encode a restart indicator information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_rsti(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_rsti: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the restart class - */ - c = (ie->ie_rsti_class & UNI_IE_RSTI_CLASS_MASK) | - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - ie->ie_length = 1; - - return(rc); -} - - -/* - * Encode a broadband sending complete information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a broadband sending complete IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_bsdc(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_bsdc: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the sending complete indicator - */ - c = UNI_IE_BSDC_IND | UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - ie->ie_length = 1; - - return(rc); -} - - -/* - * Encode a transit network selection information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a transit network selection rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_trnt(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_char c; - - ATM_DEBUG2("usf_enc_ie_trnt: usf=%p, ie=%p\n", - usf, ie); - - /* - * Encode the sending complete indicator - */ - c = ((ie->ie_trnt_id_type & UNI_IE_TRNT_IDT_MASK) << - UNI_IE_TRNT_IDT_SHIFT) + - (ie->ie_trnt_id_plan & UNI_IE_TRNT_IDP_MASK) + - UNI_IE_EXT_BIT; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_length = 1; - - /* - * Encode the network identification - */ - for (i=0; iie_trnt_id_len; i++) { - rc = usf_byte(usf, &ie->ie_trnt_id[i]); - if (rc) - return(rc); - ie->ie_length++; - } - - return(rc); -} - - -/* - * Encode an unsupported IE type - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to an IE structure - * - * Returns: - * 0 success - * - */ -static int -usf_enc_ie_uimp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - return(0); -} - - -/* - * Encode an information element using field identifiers - * - * The AAL parameters and ATM user cell rate IEs are formatted - * with a one-byte identifier preceding each field. The routine - * encodes these IEs by using a table which relates the field - * identifiers with the fields in the appropriate IE structure. - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * tbl pointer to an IE decoding table - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_ie_ident(usf, ie, tbl) - struct usfmt *usf; - struct ie_generic *ie; - struct ie_decode_tbl *tbl; -{ - int i, len, rc; - char *cp; - u_int8_t cv; - u_int16_t sv; - u_int32_t iv; - - ATM_DEBUG3("usf_enc_ie_ident: usf=%p, ie=%p, tbl=%p\n", - usf, ie, tbl); - - /* - * Scan through the IE table - */ - len = 0; - for (i=0; tbl[i].ident; i++) { - /* - * Check whether to send the field - */ - cp = (char *) ((intptr_t)ie + tbl[i].f_offs); - if (tbl[i].len == 0) { - if ((*cp == T_NO || *(int8_t *)cp == T_ATM_ABSENT)) - continue; - } else { - switch (tbl[i].f_size) { - case 1: - if (*(int8_t *)cp == T_ATM_ABSENT) - continue; - break; - case 2: - if (*(int16_t *)cp == T_ATM_ABSENT) - continue; - break; - case 4: - if (*(int32_t *)cp == T_ATM_ABSENT) - continue; - break; - default: -badtbl: - log(LOG_ERR, - "uni encode: id=%d,len=%d,off=%d,size=%d\n", - tbl[i].ident, tbl[i].len, - tbl[i].f_offs, tbl[i].f_size); - return (EFAULT); - } - } - - /* - * Encode the field identifier - */ - rc = usf_byte(usf, &tbl[i].ident); - if (rc) - return(rc); - len++; - - /* - * Encode the field value - */ - switch (tbl[i].len) { - case 0: - break; - case 1: - switch (tbl[i].f_size) { - case 1: - cv = *(u_int8_t *)cp; - break; - case 2: - cv = *(u_int16_t *)cp; - break; - case 4: - cv = *(u_int32_t *)cp; - break; - default: - goto badtbl; - } - rc = usf_byte(usf, &cv); - break; - - case 2: - switch (tbl[i].f_size) { - case 2: - sv = *(u_int16_t *)cp; - break; - case 4: - sv = *(u_int32_t *)cp; - break; - default: - goto badtbl; - } - rc = usf_short(usf, &sv); - break; - - case 3: - switch (tbl[i].f_size) { - case 4: - iv = *(u_int32_t *)cp; - break; - default: - goto badtbl; - } - rc = usf_int3(usf, &iv); - break; - - case 4: - switch (tbl[i].f_size) { - case 4: - iv = *(u_int32_t *)cp; - break; - default: - goto badtbl; - } - rc = usf_int(usf, &iv); - break; - - default: - goto badtbl; - } - - len += tbl[i].len; - - if (rc) - return(rc); - } - - ie->ie_length = len; - return(0); -} - - -/* - * Encode an ATM address - * - * Arguments: - * usf pointer to a unisig formatting structure - * addr pointer to an ATM address structure. The address - * type must already be set correctly. - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_enc_atm_addr(usf, addr) - struct usfmt *usf; - Atm_addr *addr; -{ - int len, rc; - u_char *cp; - - /* - * Check the address type - */ - switch (addr->address_format) { - case T_ATM_E164_ADDR: - cp = (u_char *) addr->address; - len = sizeof(Atm_addr_e164); - break; - case T_ATM_ENDSYS_ADDR: - cp = (u_char *) addr->address; - len = sizeof(Atm_addr_nsap); - break; - default: - return(EINVAL); - } - - /* - * Get the address bytes - */ - while (len) { - rc = usf_byte(usf, cp); - if (rc) - return(rc); - len--; - cp++; - } - - return(0); -} Property changes on: head/sys/netatm/uni/unisig_encode.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniip_var.h =================================================================== --- head/sys/netatm/uni/uniip_var.h (revision 179307) +++ head/sys/netatm/uni/uniip_var.h (nonexistent) @@ -1,318 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * IP interface control blocks - * - */ - -#ifndef _UNI_UNIIP_VAR_H -#define _UNI_UNIIP_VAR_H - -#ifdef _KERNEL -/* - * UNI IP network interface structure. There will be one such structure for - * each IP network interface attached via a UNI signalling instance. - */ -struct uniip { - struct uniip *uip_next; /* Next attached IP interface */ - struct ip_nif *uip_ipnif; /* IP network interface */ - u_char uip_flags; /* Interface flags (see below) */ - - /* ATMARP (RFC1577) */ - u_char uip_arpstate; /* ARP interface state (see below) */ - struct arpmap uip_arpsvrmap; /* ATMARP server map info */ - struct ipvcc *uip_arpsvrvcc; /* ATMARP server's VCC */ - u_int uip_nprefix; /* Count of IP prefixes (server only) */ - struct uniarp_prf *uip_prefix; /* Array of IP prefixes (server only) */ - struct atm_time uip_arptime; /* ARP timer controls */ -}; -#define uip_arpsvrip uip_arpsvrmap.am_dstip -#define uip_arpsvratm uip_arpsvrmap.am_dstatm -#define uip_arpsvrsub uip_arpsvrmap.am_dstatmsub -#endif /* _KERNEL */ - -/* - * UNI Interface Flags - */ -#define UIF_IFADDR 0x01 /* Interface address is set */ - -/* - * UNI ARP Interface States - */ -#define UIAS_NOTCONF 1 /* Not configured */ -#define UIAS_SERVER_ACTIVE 2 /* Server - active */ -#define UIAS_CLIENT_PADDR 3 /* Client - pending ATM address */ -#define UIAS_CLIENT_POPEN 4 /* Client - pending server vcc open */ -#define UIAS_CLIENT_REGISTER 5 /* Client - registering with server */ -#define UIAS_CLIENT_ACTIVE 6 /* Client - active */ - - -#ifdef _KERNEL -/* - * Structure for allowable IP prefixes for ATMARP server registration - */ -struct uniarp_prf { - struct in_addr upf_addr; /* Prefix address */ - struct in_addr upf_mask; /* Prefix mask */ -}; - - -/* - * UNI ARP protocol constants - */ -#define UNIARP_AGING (60 * ATM_HZ) /* Aging timer tick */ -#define UNIARP_HASHSIZ 19 /* Hash table size */ -#define UNIARP_REGIS_REFRESH (15 * 60 * ATM_HZ) - /* Client registration refresh timer */ -#define UNIARP_REGIS_RETRY (60 * ATM_HZ) - /* Client registration retry timer */ -#define UNIARP_ARP_RETRY (3 * ATM_HZ) /* ARP command retry timer */ -#define UNIARP_CLIENT_AGE 12 /* Client validation timeout */ -#define UNIARP_CLIENT_RETRY 3 /* Client validation retrys */ -#define UNIARP_SERVER_AGE 17 /* Server validation timeout */ -#define UNIARP_SERVER_RETRY 3 /* Server validation retrys */ -#define UNIARP_RETRY_AGE 1 /* Retry timeout */ -#define UNIARP_REVALID_AGE 2 /* Revalidation timeout */ -#define UNIARP_MIN_REFRESH 10 /* Minimum entry refresh time */ - - -/* - * Structure for ATMARP mappings. Each of these structures will contain - * IP address to ATM hardware address mappings. There will be one such - * structure for each IP address and for each unresolved ATM address - * currently in use. - */ -struct uniarp { - struct arpmap ua_arpmap; /* Common entry header */ - struct uniip *ua_intf; /* Interface where we learned answer */ - struct uniarp *ua_next; /* Hash chain link */ - u_char ua_flags; /* Flags (see below) */ - u_char ua_origin; /* Source of mapping (see below) */ - u_char ua_retry; /* Retry counter */ - u_char ua_aging; /* Aging timeout value (minutes) */ - struct ipvcc *ua_ivp; /* Head of IP VCC chain */ - struct atm_time ua_time; /* Timer controls */ -}; -#define ua_dstip ua_arpmap.am_dstip -#define ua_dstatm ua_arpmap.am_dstatm -#define ua_dstatmsub ua_arpmap.am_dstatmsub -#endif /* _KERNEL */ - -/* - * UNIARP Entry Flags - */ -#define UAF_VALID ARPF_VALID /* Entry is valid */ -#define UAF_REFRESH ARPF_REFRESH /* Entry has been refreshed */ -#define UAF_LOCKED 0x04 /* Entry is locked */ -#define UAF_USED 0x08 /* Entry has been used recently */ - -/* - * UNIARP Entry Origin - * - * The origin values are ranked according to the source precedence. - * Larger values are more preferred. - */ -#define UAO_LOCAL 100 /* Local address */ -#define UAO_PERM ARP_ORIG_PERM /* Permanently installed */ -#define UAO_REGISTER 40 /* Learned via client registration */ -#define UAO_SCSP 30 /* Learned via SCSP */ -#define UAO_LOOKUP 20 /* Learned via server lookup */ -#define UAO_PEER_RSP 15 /* Learned from peer - inarp rsp */ -#define UAO_PEER_REQ 10 /* Learned from peer - inarp req */ - -/* - * ATMARP/InATMARP Packet Format - */ -struct atmarp_hdr { - u_short ah_hrd; /* Hardware type (see below) */ - u_short ah_pro; /* Protocol type */ - u_char ah_shtl; /* Type/len of source ATM address */ - u_char ah_sstl; /* Type/len of source ATM subaddress */ - u_short ah_op; /* Operation code (see below) */ - u_char ah_spln; /* Length of source protocol address */ - u_char ah_thtl; /* Type/len of target ATM address */ - u_char ah_tstl; /* Type/len of target ATM subaddress */ - u_char ah_tpln; /* Length of target protocol address */ -#ifdef notdef - /* Variable size fields */ - u_char ah_sha[]; /* Source ATM address */ - u_char ah_ssa[]; /* Source ATM subaddress */ - u_char ah_spa[]; /* Source protocol address */ - u_char ah_tha[]; /* Target ATM subaddress */ - u_char ah_tsa[]; /* Target ATM address */ - u_char ah_tpa[]; /* Target protocol subaddress */ -#endif -}; - -/* - * Hardware types - */ -#define ARP_ATMFORUM 19 - -/* - * Operation types - */ -#define ARP_REQUEST 1 /* ATMARP request */ -#define ARP_REPLY 2 /* ATMARP response */ -#define INARP_REQUEST 8 /* InATMARP request */ -#define INARP_REPLY 9 /* InATMARP response */ -#define ARP_NAK 10 /* ATMARP negative ack */ - -/* - * Type/length fields - */ -#define ARP_TL_TMASK 0x40 /* Type mask */ -#define ARP_TL_NSAPA 0x00 /* Type = ATM Forum NSAPA */ -#define ARP_TL_E164 0x40 /* Type = E.164 */ -#define ARP_TL_LMASK 0x3f /* Length mask */ - - -#ifdef _KERNEL -/* - * Timer macros - */ -#define UNIIP_ARP_TIMER(s, t) atm_timeout(&(s)->uip_arptime, (t), uniarp_iftimeout) -#define UNIIP_ARP_CANCEL(s) atm_untimeout(&(s)->uip_arptime) -#define UNIARP_TIMER(s, t) atm_timeout(&(s)->ua_time, (t), uniarp_timeout) -#define UNIARP_CANCEL(s) atm_untimeout(&(s)->ua_time) - - -/* - * Macros for manipulating UNIARP tables and entries - */ -#define UNIARP_HASH(ip) ((u_long)(ip) % UNIARP_HASHSIZ) - -#define UNIARP_ADD(ua) \ -{ \ - struct uniarp **h; \ - h = &uniarp_arptab[UNIARP_HASH((ua)->ua_dstip.s_addr)]; \ - LINK2TAIL((ua), struct uniarp, *h, ua_next); \ -} - -#define UNIARP_DELETE(ua) \ -{ \ - struct uniarp **h; \ - h = &uniarp_arptab[UNIARP_HASH((ua)->ua_dstip.s_addr)]; \ - UNLINK((ua), struct uniarp, *h, ua_next); \ -} - -#define UNIARP_LOOKUP(ip, ua) \ -{ \ - for ((ua) = uniarp_arptab[UNIARP_HASH(ip)]; \ - (ua); (ua) = (ua)->ua_next) { \ - if ((ua)->ua_dstip.s_addr == (ip)) \ - break; \ - } \ -} - - -/* - * Global UNIARP Statistics - */ -struct uniarp_stat { - u_long uas_rcvdrop; /* Input packets dropped */ -}; - - -/* - * External variables - */ -extern struct uniip *uniip_head; -extern struct ip_serv uniip_ipserv; -extern struct uniarp *uniarp_arptab[]; -extern struct uniarp *uniarp_nomaptab; -extern struct uniarp *uniarp_pvctab; -extern uma_zone_t uniarp_zone; -extern struct atm_time uniarp_timer; -extern int uniarp_print; -extern Atm_endpoint uniarp_endpt; -extern struct uniarp_stat uniarp_stat; - - -/* - * Global function declarations - */ - /* uniarp.c */ -int uniarp_start(void); -void uniarp_stop(void); -void uniarp_ipact(struct uniip *); -void uniarp_ipdact(struct uniip *); -void uniarp_ifaddr(struct siginst *); -void uniarp_iftimeout(struct atm_time *); -int uniarp_ioctl(int, caddr_t, caddr_t); -caddr_t uniarp_getname(void *); - - /* uniarp_cache.c */ -int uniarp_cache_svc(struct uniip *, struct in_addr *, - Atm_addr *, Atm_addr *, u_int); -void uniarp_cache_pvc(struct ipvcc *, struct in_addr *, - Atm_addr *, Atm_addr *); -int uniarp_validate_ip(struct uniip *, struct in_addr *, u_int); - - /* uniarp_input.c */ -void uniarp_cpcs_data(void *, KBuffer *); -void uniarp_pdu_print(const struct ipvcc *, - const KBuffer *, const char *); - - /* uniarp_output.c */ -int uniarp_arp_req(struct uniip *, struct in_addr *); -int uniarp_arp_rsp(struct uniip *, struct arpmap *, - struct in_addr *, Atm_addr *, - Atm_addr *, struct ipvcc *); -int uniarp_arp_nak(struct uniip *, KBuffer *, struct ipvcc *); -int uniarp_inarp_req(struct uniip *, Atm_addr *, - Atm_addr *, struct ipvcc *); -int uniarp_inarp_rsp(struct uniip *, struct in_addr *, - Atm_addr *, Atm_addr *, struct ipvcc *); - - /* uniarp_timer.c */ -void uniarp_timeout(struct atm_time *); -void uniarp_aging(struct atm_time *); - - /* uniarp_vcm.c */ -int uniarp_pvcopen(struct ipvcc *); -int uniarp_svcout(struct ipvcc *, struct in_addr *); -int uniarp_svcin(struct ipvcc *, Atm_addr *, Atm_addr *); -int uniarp_svcactive(struct ipvcc *); -void uniarp_vcclose(struct ipvcc *); -void uniarp_connected(void *); -void uniarp_cleared(void *, struct t_atm_cause *); - - /* uniip.c */ -int uniip_start(void); -int uniip_stop(void); - - -#endif /* _KERNEL */ - -#endif /* _UNI_UNIIP_VAR_H */ Property changes on: head/sys/netatm/uni/uniip_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp_output.c =================================================================== --- head/sys/netatm/uni/uniarp_output.c (revision 179307) +++ head/sys/netatm/uni/uniarp_output.c (nonexistent) @@ -1,810 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - Output packet processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Issue an ATMARP Request PDU - * - * Arguments: - * uip pointer to IP interface - * tip pointer to target IP address - * - * Returns: - * 0 PDU was successfully sent - * else unable to send PDU - * - */ -int -uniarp_arp_req(uip, tip) - struct uniip *uip; - struct in_addr *tip; -{ - KBuffer *m; - struct atmarp_hdr *ahp; - struct atm_nif *nip; - struct ip_nif *inp; - struct ipvcc *ivp; - struct siginst *sip; - char *cp; - int len, err; - - inp = uip->uip_ipnif; - nip = inp->inf_nif; - sip = inp->inf_nif->nif_pif->pif_siginst; - - /* - * Figure out how long pdu is going to be - */ - len = sizeof(struct atmarp_hdr) + (2 * sizeof(struct in_addr)); - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - len += sip->si_addr.address_length; - break; - - case T_ATM_E164_ADDR: - len += sip->si_addr.address_length; - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) - len += sip->si_subaddr.address_length; - break; - } - - /* - * Get a buffer for pdu - */ - KB_ALLOCPKT(m, len, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return (1); - - /* - * Place aligned pdu at end of buffer - */ - KB_TAILALIGN(m, len); - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Setup variable fields pointer - */ - cp = (char *)ahp + sizeof(struct atmarp_hdr); - - /* - * Build fields - */ - ahp->ah_hrd = htons(ARP_ATMFORUM); - ahp->ah_pro = htons(ETHERTYPE_IP); - len = sip->si_addr.address_length; - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_shtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - - ahp->ah_sstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_shtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len); - cp += len; - - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) { - len = sip->si_subaddr.address_length; - ahp->ah_sstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_ssa */ - bcopy(sip->si_subaddr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - } else - ahp->ah_sstl = 0; - break; - - default: - ahp->ah_shtl = 0; - ahp->ah_sstl = 0; - } - - ahp->ah_op = htons(ARP_REQUEST); - ahp->ah_spln = sizeof(struct in_addr); - - /* ah_spa */ - bcopy((caddr_t)&(IA_SIN(inp->inf_addr)->sin_addr), cp, - sizeof(struct in_addr)); - cp += sizeof(struct in_addr); - - ahp->ah_thtl = 0; - ahp->ah_tstl = 0; - - ahp->ah_tpln = sizeof(struct in_addr); - - /* ah_tpa */ - bcopy((caddr_t)tip, cp, sizeof(struct in_addr)); - - /* - * Finally, send the pdu to the ATMARP server - */ - ivp = uip->uip_arpsvrvcc; - if (uniarp_print) - uniarp_pdu_print(ivp, m, "send"); - err = atm_cm_cpcs_data(ivp->iv_arpconn, m); - if (err) { - /* - * Didn't make it - */ - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Issue an ATMARP Response PDU - * - * Arguments: - * uip pointer to IP interface - * amp pointer to source map entry - * tip pointer to target IP address - * tatm pointer to target ATM address - * tsub pointer to target ATM subaddress - * ivp pointer to vcc over which to send pdu - * - * Returns: - * 0 PDU was successfully sent - * else unable to send PDU - * - */ -int -uniarp_arp_rsp(uip, amp, tip, tatm, tsub, ivp) - struct uniip *uip; - struct arpmap *amp; - struct in_addr *tip; - Atm_addr *tatm; - Atm_addr *tsub; - struct ipvcc *ivp; -{ - KBuffer *m; - struct atmarp_hdr *ahp; - char *cp; - int len, err; - - /* - * Figure out how long pdu is going to be - */ - len = sizeof(struct atmarp_hdr) + (2 * sizeof(struct in_addr)); - switch (amp->am_dstatm.address_format) { - case T_ATM_ENDSYS_ADDR: - len += amp->am_dstatm.address_length; - break; - - case T_ATM_E164_ADDR: - len += amp->am_dstatm.address_length; - if (amp->am_dstatmsub.address_format == T_ATM_ENDSYS_ADDR) - len += amp->am_dstatmsub.address_length; - break; - } - - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - len += tatm->address_length; - break; - - case T_ATM_E164_ADDR: - len += tatm->address_length; - if (tsub->address_format == T_ATM_ENDSYS_ADDR) - len += tsub->address_length; - break; - } - - /* - * Get a buffer for pdu - */ - KB_ALLOCPKT(m, len, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return (1); - - /* - * Place aligned pdu at end of buffer - */ - KB_TAILALIGN(m, len); - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Setup variable fields pointer - */ - cp = (char *)ahp + sizeof(struct atmarp_hdr); - - /* - * Build fields - */ - ahp->ah_hrd = htons(ARP_ATMFORUM); - ahp->ah_pro = htons(ETHERTYPE_IP); - len = amp->am_dstatm.address_length; - switch (amp->am_dstatm.address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_shtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(amp->am_dstatm.address, cp, len); - cp += len; - - ahp->ah_sstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_shtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(amp->am_dstatm.address, cp, len); - cp += len; - - if (amp->am_dstatmsub.address_format == T_ATM_ENDSYS_ADDR) { - len = amp->am_dstatmsub.address_length; - ahp->ah_sstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_ssa */ - bcopy(amp->am_dstatmsub.address, cp, len); - cp += len; - } else - ahp->ah_sstl = 0; - break; - - default: - ahp->ah_shtl = 0; - ahp->ah_sstl = 0; - } - - ahp->ah_op = htons(ARP_REPLY); - ahp->ah_spln = sizeof(struct in_addr); - - /* ah_spa */ - bcopy((caddr_t)&->am_dstip, cp, sizeof(struct in_addr)); - cp += sizeof(struct in_addr); - - len = tatm->address_length; - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_thtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - ahp->ah_tstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_thtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - if (tsub->address_format == T_ATM_ENDSYS_ADDR) { - len = tsub->address_length; - ahp->ah_tstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tsa */ - bcopy(tsub->address, cp, len); - cp += len; - } else - ahp->ah_tstl = 0; - break; - - default: - ahp->ah_thtl = 0; - ahp->ah_tstl = 0; - } - - ahp->ah_tpln = sizeof(struct in_addr); - - /* ah_tpa */ - bcopy((caddr_t)tip, cp, sizeof(struct in_addr)); - - /* - * Finally, send the pdu to the vcc peer - */ - if (uniarp_print) - uniarp_pdu_print(ivp, m, "send"); - err = atm_cm_cpcs_data(ivp->iv_arpconn, m); - if (err) { - /* - * Didn't make it - */ - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Issue an ATMARP NAK PDU - * - * Arguments: - * uip pointer to IP interface - * m pointer to ATMARP_REQ buffer chain - * ivp pointer to vcc over which to send pdu - * - * Returns: - * 0 PDU was successfully sent - * else unable to send PDU - * - */ -int -uniarp_arp_nak(uip, m, ivp) - struct uniip *uip; - KBuffer *m; - struct ipvcc *ivp; -{ - struct atmarp_hdr *ahp; - int err; - - /* - * Get the fixed fields together - */ - if (KB_LEN(m) < sizeof(struct atmarp_hdr)) { - KB_PULLUP(m, sizeof(struct atmarp_hdr), m); - if (m == NULL) - return (1); - } - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Set new op-code - */ - ahp->ah_op = htons(ARP_NAK); - - /* - * Finally, send the pdu to the vcc peer - */ - if (uniarp_print) - uniarp_pdu_print(ivp, m, "send"); - err = atm_cm_cpcs_data(ivp->iv_arpconn, m); - if (err) { - /* - * Didn't make it - */ - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Issue an InATMARP Request PDU - * - * Arguments: - * uip pointer to IP interface - * tatm pointer to target ATM address - * tsub pointer to target ATM subaddress - * ivp pointer to vcc over which to send pdu - * - * Returns: - * 0 PDU was successfully sent - * else unable to send PDU - * - */ -int -uniarp_inarp_req(uip, tatm, tsub, ivp) - struct uniip *uip; - Atm_addr *tatm; - Atm_addr *tsub; - struct ipvcc *ivp; -{ - KBuffer *m; - struct atmarp_hdr *ahp; - struct atm_nif *nip; - struct ip_nif *inp; - struct siginst *sip; - char *cp; - int len, err; - - inp = uip->uip_ipnif; - nip = inp->inf_nif; - sip = inp->inf_nif->nif_pif->pif_siginst; - - /* - * Figure out how long pdu is going to be - */ - len = sizeof(struct atmarp_hdr) + sizeof(struct in_addr); - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - len += sip->si_addr.address_length; - break; - - case T_ATM_E164_ADDR: - len += sip->si_addr.address_length; - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) - len += sip->si_subaddr.address_length; - break; - } - - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - len += tatm->address_length; - break; - - case T_ATM_E164_ADDR: - len += tatm->address_length; - if (tsub->address_format == T_ATM_ENDSYS_ADDR) - len += tsub->address_length; - break; - } - - /* - * Get a buffer for pdu - */ - KB_ALLOCPKT(m, len, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return (1); - - /* - * Place aligned pdu at end of buffer - */ - KB_TAILALIGN(m, len); - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Setup variable fields pointer - */ - cp = (char *)ahp + sizeof(struct atmarp_hdr); - - /* - * Build fields - */ - ahp->ah_hrd = htons(ARP_ATMFORUM); - ahp->ah_pro = htons(ETHERTYPE_IP); - len = sip->si_addr.address_length; - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_shtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - - ahp->ah_sstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_shtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len); - cp += len; - - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) { - len = sip->si_subaddr.address_length; - ahp->ah_sstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_ssa */ - bcopy(sip->si_subaddr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - } else - ahp->ah_sstl = 0; - break; - - default: - ahp->ah_shtl = 0; - ahp->ah_sstl = 0; - } - - ahp->ah_op = htons(INARP_REQUEST); - ahp->ah_spln = sizeof(struct in_addr); - - /* ah_spa */ - bcopy((caddr_t)&(IA_SIN(inp->inf_addr)->sin_addr), cp, - sizeof(struct in_addr)); - cp += sizeof(struct in_addr); - - len = tatm->address_length; - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_thtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - ahp->ah_tstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_thtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - if (tsub->address_format == T_ATM_ENDSYS_ADDR) { - len = tsub->address_length; - ahp->ah_tstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tsa */ - bcopy(tsub->address, cp, len); - cp += len; - } else - ahp->ah_tstl = 0; - break; - - default: - ahp->ah_thtl = 0; - ahp->ah_tstl = 0; - } - - ahp->ah_tpln = 0; - - /* - * Finally, send the pdu to the vcc peer - */ - if (uniarp_print) - uniarp_pdu_print(ivp, m, "send"); - err = atm_cm_cpcs_data(ivp->iv_arpconn, m); - if (err) { - /* - * Didn't make it - */ - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Issue an InATMARP Response PDU - * - * Arguments: - * uip pointer to IP interface - * tip pointer to target IP address - * tatm pointer to target ATM address - * tsub pointer to target ATM subaddress - * ivp pointer to vcc over which to send pdu - * - * Returns: - * 0 PDU was successfully sent - * else unable to send PDU - * - */ -int -uniarp_inarp_rsp(uip, tip, tatm, tsub, ivp) - struct uniip *uip; - struct in_addr *tip; - Atm_addr *tatm; - Atm_addr *tsub; - struct ipvcc *ivp; -{ - KBuffer *m; - struct atmarp_hdr *ahp; - struct atm_nif *nip; - struct ip_nif *inp; - struct siginst *sip; - char *cp; - int len, err; - - inp = uip->uip_ipnif; - nip = inp->inf_nif; - sip = inp->inf_nif->nif_pif->pif_siginst; - - /* - * Figure out how long pdu is going to be - */ - len = sizeof(struct atmarp_hdr) + (2 * sizeof(struct in_addr)); - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - len += sip->si_addr.address_length; - break; - - case T_ATM_E164_ADDR: - len += sip->si_addr.address_length; - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) - len += sip->si_subaddr.address_length; - break; - } - - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - len += tatm->address_length; - break; - - case T_ATM_E164_ADDR: - len += tatm->address_length; - if (tsub->address_format == T_ATM_ENDSYS_ADDR) - len += tsub->address_length; - break; - } - - /* - * Get a buffer for pdu - */ - KB_ALLOCPKT(m, len, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return (1); - - /* - * Place aligned pdu at end of buffer - */ - KB_TAILALIGN(m, len); - KB_DATASTART(m, ahp, struct atmarp_hdr *); - - /* - * Setup variable fields pointer - */ - cp = (char *)ahp + sizeof(struct atmarp_hdr); - - /* - * Build fields - */ - ahp->ah_hrd = htons(ARP_ATMFORUM); - ahp->ah_pro = htons(ETHERTYPE_IP); - len = sip->si_addr.address_length; - switch (sip->si_addr.address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_shtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - - ahp->ah_sstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_shtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_sha */ - bcopy(sip->si_addr.address, cp, len); - cp += len; - - if (sip->si_subaddr.address_format == T_ATM_ENDSYS_ADDR) { - len = sip->si_subaddr.address_length; - ahp->ah_sstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_ssa */ - bcopy(sip->si_subaddr.address, cp, len - 1); - ((struct atm_addr_nsap *)cp)->aan_sel = nip->nif_sel; - cp += len; - } else - ahp->ah_sstl = 0; - break; - - default: - ahp->ah_shtl = 0; - ahp->ah_sstl = 0; - } - - ahp->ah_op = htons(INARP_REPLY); - ahp->ah_spln = sizeof(struct in_addr); - - /* ah_spa */ - bcopy((caddr_t)&(IA_SIN(inp->inf_addr)->sin_addr), cp, - sizeof(struct in_addr)); - cp += sizeof(struct in_addr); - - len = tatm->address_length; - switch (tatm->address_format) { - case T_ATM_ENDSYS_ADDR: - ahp->ah_thtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - ahp->ah_tstl = 0; - break; - - case T_ATM_E164_ADDR: - ahp->ah_thtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* ah_tha */ - bcopy(tatm->address, cp, len); - cp += len; - - if (tsub->address_format == T_ATM_ENDSYS_ADDR) { - len = tsub->address_length; - ahp->ah_tstl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* ah_tsa */ - bcopy(tsub->address, cp, len); - cp += len; - } else - ahp->ah_tstl = 0; - break; - - default: - ahp->ah_thtl = 0; - ahp->ah_tstl = 0; - } - - ahp->ah_tpln = sizeof(struct in_addr); - - /* ah_tpa */ - bcopy((caddr_t)tip, cp, sizeof(struct in_addr)); - - /* - * Finally, send the pdu to the vcc peer - */ - if (uniarp_print) - uniarp_pdu_print(ivp, m, "send"); - err = atm_cm_cpcs_data(ivp->iv_arpconn, m); - if (err) { - /* - * Didn't make it - */ - KB_FREEALL(m); - return (1); - } - - return (0); -} - Property changes on: head/sys/netatm/uni/uniarp_output.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_lower.c =================================================================== --- head/sys/netatm/uni/sscop_lower.c (revision 179307) +++ head/sys/netatm/uni/sscop_lower.c (nonexistent) @@ -1,357 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP - SSCOP SAP interface processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local variables - */ -/* - * Stack commands with arg1 containing a buffer pointer - */ -static u_char sscop_buf1[] = { - 0, - 0, /* SSCOP_INIT */ - 0, /* SSCOP_TERM */ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, /* SSCOP_ESTABLISH_REQ */ - 0, - 1, /* SSCOP_ESTABLISH_RSP */ - 0, - 1, /* SSCOP_RELEASE_REQ */ - 0, - 0, - 1, /* SSCOP_DATA_REQ */ - 0, - 1, /* SSCOP_RESYNC_REQ */ - 0, - 0, /* SSCOP_RESYNC_RSP */ - 0, - 0, - 0, /* SSCOP_RECOVER_RSP */ - 1, /* SSCOP_UNITDATA_REQ */ - 0, - 0, /* SSCOP_RETRIEVE_REQ */ - 0, - 0 -}; - - -/* - * SSCOP Lower Stack Command Handler - * - * This function will receive all of the stack commands issued from the - * layer above SSCOP (ie. using the SSCOP SAP). The appropriate processing - * function will be determined based on the received stack command and the - * current sscop control block state. - * - * Arguments: - * cmd stack command code - * tok session token - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscop_lower(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - struct sscop *sop = (struct sscop *)tok; - void (**stab)(struct sscop *, intptr_t, intptr_t); - void (*func)(struct sscop *, intptr_t, intptr_t); - int val; - - ATM_DEBUG5("sscop_lower: cmd=0x%x, sop=%p, state=%d, arg1=%p, arg2=%p\n", - cmd, sop, sop->so_state, (void *)arg1, (void *)arg2); - - /* - * Validate stack command - */ - val = cmd & STKCMD_VAL_MASK; - if (((u_int)cmd < (u_int)SSCOP_CMD_MIN) || - ((u_int)cmd > (u_int)SSCOP_CMD_MAX) || - ((stab = (sop->so_vers == SSCOP_VERS_QSAAL ? - sscop_qsaal_aatab[val] : - sscop_q2110_aatab[val])) == NULL)) { - log(LOG_ERR, "sscop_lower: unknown cmd 0x%x, sop=%p\n", - cmd, sop); - return; - } - - /* - * Validate sscop state - */ - if (sop->so_state > SOS_MAXSTATE) { - log(LOG_ERR, "sscop_lower: invalid state sop=%p, state=%d\n", - sop, sop->so_state); - /* - * Release possible buffer - */ - if (sscop_buf1[val]) { - if (arg1) - KB_FREEALL((KBuffer *)arg1); - } - return; - } - - /* - * Validate command/state combination - */ - func = stab[sop->so_state]; - if (func == NULL) { - log(LOG_ERR, - "sscop_lower: invalid cmd/state: sop=%p, cmd=0x%x, state=%d\n", - sop, cmd, sop->so_state); - /* - * Release possible buffer - */ - if (sscop_buf1[val]) { - if (arg1) - KB_FREEALL((KBuffer *)arg1); - } - return; - } - - /* - * Call event processing function - */ - (*func)(sop, arg1, arg2); - - return; -} - - -/* - * No-op Processor (no buffers) - * - * Arguments: - * sop pointer to sscop connection block - * arg1 command-specific argument - * arg2 command-specific argument - * - * Returns: - * none - * - */ -void -sscop_aa_noop_0(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - /* - * Nothing to do - */ - return; -} - - -/* - * No-op Processor (arg1 == buffer) - * - * Arguments: - * sop pointer to sscop connection block - * arg1 command-specific argument (buffer pointer) - * arg2 command-specific argument - * - * Returns: - * none - * - */ -void -sscop_aa_noop_1(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Just free buffer chain - */ - if (arg1) - KB_FREEALL((KBuffer *)arg1); - - return; -} - - -/* - * SSCOP_INIT / SOS_INST Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscop_init_inst(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - int err; - - /* - * Make ourselves ready and pass on the INIT - */ - sop->so_state = SOS_IDLE; - - /* - * Validate SSCOP version to use - */ - switch ((enum sscop_vers)arg1) { - case SSCOP_VERS_QSAAL: - break; - - case SSCOP_VERS_Q2110: - break; - - default: - sscop_abort(sop, "sscop: bad version\n"); - return; - } - sop->so_vers = (enum sscop_vers)arg1; - - /* - * Copy SSCOP connection parameters to use - */ - sop->so_parm = *(struct sscop_parms *)arg2; - - /* - * Initialize lower layers - */ - STACK_CALL(CPCS_INIT, sop->so_lower, sop->so_tokl, sop->so_connvc, - 0, 0, err); - if (err) { - /* - * Should never happen - */ - sscop_abort(sop, "sscop: INIT failure\n"); - return; - } - return; -} - - -/* - * SSCOP_TERM / SOS_* Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscop_term_all(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - int err; - - /* - * Set termination state - */ - sop->so_state = SOS_TERM; - - /* - * Pass the TERM down the stack - */ - STACK_CALL(CPCS_TERM, sop->so_lower, sop->so_tokl, sop->so_connvc, - 0, 0, err); - if (err) { - /* - * Should never happen - */ - sscop_abort(sop, "sscop: TERM failure\n"); - return; - } - - /* - * Unlink and free the connection block - */ - UNLINK(sop, struct sscop, sscop_head, so_next); - uma_zfree(sscop_zone, sop); - sscop_vccnt--; - return; -} - Property changes on: head/sys/netatm/uni/sscop_lower.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscf_uni_var.h =================================================================== --- head/sys/netatm/uni/sscf_uni_var.h (revision 179307) +++ head/sys/netatm/uni/sscf_uni_var.h (nonexistent) @@ -1,115 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCF UNI protocol control blocks - * - */ - -#ifndef _UNI_SSCF_UNI_VAR_H -#define _UNI_SSCF_UNI_VAR_H - -/* - * Structure containing information for each SSCF UNI connection. - */ -struct univcc { - u_char uv_ustate; /* SSCF-User state (see below) */ - u_char uv_lstate; /* SSCF-SSCOP state (see below) */ - u_short uv_flags; /* Connection flags (see below) */ - enum uni_vers uv_vers; /* UNI version */ - - /* Stack variables */ - Atm_connvc *uv_connvc; /* Connection vcc for this stack */ - void *uv_toku; /* Stack upper layer's token */ - void *uv_tokl; /* Stack lower layer's token */ - void (*uv_upper) /* Stack upper layer's interface */ - (int, void *, intptr_t, intptr_t); - void (*uv_lower) /* Stack lower layer's interface */ - (int, void *, intptr_t, intptr_t); -}; - -/* - * SSCF to SAAL User (Q.2931) Interface States - */ -#define UVU_INST 0 /* Instantiated, waiting for INIT */ -#define UVU_RELEASED 1 /* Connection released */ -#define UVU_PACTIVE 2 /* Awaiting connection establishment */ -#define UVU_PRELEASE 3 /* Awaiting connection release */ -#define UVU_ACTIVE 4 /* Connection established */ -#define UVU_TERM 5 /* Waiting for TERM */ - -/* - * SSCF to SSCOP Interface States - */ -#define UVL_INST 0 /* Instantiated, waiting for INIT */ -#define UVL_IDLE 1 /* Idle */ -#define UVL_OUTCONN 2 /* Outgoing connection pending */ -#define UVL_INCONN 3 /* Incoming connection pending */ -#define UVL_OUTDISC 4 /* Outgoing disconnection pending */ -#define UVL_OUTRESYN 5 /* Outgoing resynchronization pending */ -#define UVL_INRESYN 6 /* Incoming resynchornization pending */ -#define UVL_RECOVERY 8 /* Recovery pending */ -#define UVL_READY 10 /* Data transfer ready */ -#define UVL_TERM 11 /* Waiting for TERM */ - -/* - * Connection Flags - */ -#define UVF_NOESTIND 0x0001 /* Don't process ESTABLISH_IND */ - - -#ifdef _KERNEL -/* - * Global function declarations - */ - /* sscf_uni.c */ -int sscf_uni_start(void); -int sscf_uni_stop(void); -void sscf_uni_abort(struct univcc *, char *); -void sscf_uni_pdu_print(const struct univcc *, - const KBuffer *, const char *); - - /* sscf_uni_lower.c */ -void sscf_uni_lower(int, void *, intptr_t, intptr_t); - - /* sscf_uni_upper.c */ -void sscf_uni_upper(int, void *, intptr_t, intptr_t); - - -/* - * External variables - */ -extern int sscf_uni_vccnt; - -#endif /* _KERNEL */ - -#endif /* _UNI_SSCF_UNI_VAR_H */ Property changes on: head/sys/netatm/uni/sscf_uni_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop.c =================================================================== --- head/sys/netatm/uni/sscop.c (revision 179307) +++ head/sys/netatm/uni/sscop.c (nonexistent) @@ -1,410 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * Service Specific Connection Oriented Protocol (SSCOP) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -/* - * Global variables - */ -int sscop_vccnt = 0; - -struct sscop *sscop_head = NULL; - -struct sscop_stat sscop_stat = {0}; - -struct atm_time sscop_timer = {0, 0}; - -uma_zone_t sscop_zone; - -/* - * Local functions - */ -static int sscop_inst(struct stack_defn **, Atm_connvc *); - - -/* - * Local variables - */ -static struct stack_defn sscop_service = { - NULL, - SAP_SSCOP, - 0, - sscop_inst, - sscop_lower, - sscop_upper, - 0 -}; - -static struct t_atm_cause sscop_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_TEMPORARY_FAILURE, - {0, 0, 0, 0} -}; - -static u_char sscop_maa_log[MAA_ERROR_COUNT] = { - 1, /* A */ - 1, /* B */ - 1, /* C */ - 1, /* D */ - 1, /* E */ - 1, /* F */ - 1, /* G */ - 1, /* H */ - 1, /* I */ - 1, /* J */ - 1, /* K */ - 1, /* L */ - 1, /* M */ - 0, /* N */ - 0, /* O */ - 0, /* P */ - 1, /* Q */ - 1, /* R */ - 1, /* S */ - 1, /* T */ - 1, /* U */ - 0, /* V */ - 0, /* W */ - 0, /* X */ - 1 /* INVAL */ -}; - - -/* - * Initialize SSCOP processing - * - * This will be called during module loading. We will register our stack - * service and wait for someone to talk to us. - * - * Arguments: - * none - * - * Returns: - * 0 initialization was successful - * errno initialization failed - reason indicated - * - */ -int -sscop_start() -{ - int err = 0; - - sscop_zone = uma_zcreate("sscop", sizeof(struct sscop), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); - if (sscop_zone == NULL) - panic("sscop_start: uma_zcreate"); - - /* - * Register stack service - */ - if ((err = atm_stack_register(&sscop_service)) != 0) - goto done; - - /* - * Start up timer - */ - atm_timeout(&sscop_timer, ATM_HZ/SSCOP_HZ, sscop_timeout); - -done: - return (err); -} - - -/* - * Terminate SSCOP processing - * - * This will be called just prior to unloading the module from memory. All - * signalling instances should have been terminated by now, so we just free - * up all of our resources. - * - * Called at splnet. - * - * Arguments: - * none - * - * Returns: - * 0 termination was successful - * errno termination failed - reason indicated - * - */ -int -sscop_stop() -{ - int err = 0; - - /* - * Any connections still exist?? If so, we can't bail just yet. - */ - if (sscop_vccnt) - return (EBUSY); - - /* - * Stop our timer - */ - (void)atm_untimeout(&sscop_timer); - - /* - * Deregister the stack service - */ - (void)atm_stack_deregister(&sscop_service); - uma_zdestroy(sscop_zone); - return (err); -} - - -/* - * SSCOP Stack Instantiation - * - * Called at splnet. - * - * Arguments: - * ssp pointer to array of stack definition pointers for connection - * ssp[0] points to upper layer's stack service definition - * ssp[1] points to this layer's stack service definition - * ssp[2] points to lower layer's stack service definition - * cvp pointer to connection vcc for this stack - * - * Returns: - * 0 instantiation successful - * errno instantiation failed - reason indicated - * - */ -static int -sscop_inst(ssp, cvp) - struct stack_defn **ssp; - Atm_connvc *cvp; -{ - struct stack_defn *sdp_up = ssp[0], - *sdp_me = ssp[1], - *sdp_low = ssp[2]; - struct sscop *sop; - int err; - - ATM_DEBUG2("sscop_inst: ssp=%p, cvp=%p\n", ssp, cvp); - - /* - * Validate lower SAP - */ - if ((sdp_low->sd_sap & SAP_CLASS_MASK) != SAP_CPCS) - return (EINVAL); - - /* - * Allocate our control block - */ - sop = uma_zalloc(sscop_zone, M_WAITOK); - if (sop == NULL) - return (ENOMEM); - - sop->so_state = SOS_INST; - sop->so_connvc = cvp; - sop->so_toku = sdp_up->sd_toku; - sop->so_upper = sdp_up->sd_upper; - - /* - * Store my token into service definition - */ - sdp_me->sd_toku = sop; - - /* - * Update and save input buffer headroom - */ - HEADIN(cvp, sizeof(struct pdu_hdr), 0); - /* sop->so_headin = cvp->cvc_attr.headin; */ - - /* - * Pass instantiation down the stack - */ - err = sdp_low->sd_inst(ssp + 1, cvp); - if (err) { - /* - * Lower layer instantiation failed, free our resources - */ - uma_zfree(sscop_zone, sop); - return (err); - } - - /* - * Link in connection block - */ - LINK2TAIL(sop, struct sscop, sscop_head, so_next); - sscop_vccnt++; - sscop_stat.sos_connects++; - - /* - * Save and update output buffer headroom - */ - sop->so_headout = cvp->cvc_attr.headout; - HEADOUT(cvp, sizeof(struct pdu_hdr), 0); - - /* - * Save lower layer's interface info - */ - sop->so_lower = sdp_low->sd_lower; - sop->so_tokl = sdp_low->sd_toku; - - /* - * Initialize version (until INIT received) - */ - sop->so_vers = SSCOP_VERS_Q2110; - - return (0); -} - - -/* - * Report Management Error - * - * Called to report an error to the layer management entity. - * - * Arguments: - * sop pointer to sscop control block - * code error code - * - * Returns: - * none - * - */ -void -sscop_maa_error(sop, code) - struct sscop *sop; - int code; -{ - int i; - - /* - * Validate error code - */ - if ((code < MAA_ERROR_MIN) || - (code > MAA_ERROR_MAX)) - code = MAA_ERROR_INVAL; - i = code - MAA_ERROR_MIN; - - /* - * Bump statistics counters - */ - sscop_stat.sos_maa_error[i]++; - - /* - * Log error message - */ - if (sscop_maa_log[i] != 0) { - struct vccb *vcp = sop->so_connvc->cvc_vcc; - struct atm_pif *pip = vcp->vc_pif; - - log(LOG_ERR, - "sscop_maa_error: intf=%s%d vpi=%d vci=%d code=%c state=%d\n", - pip->pif_name, pip->pif_unit, - vcp->vc_vpi, vcp->vc_vci, code, sop->so_state); - } -} - - -/* - * Abort an SSCOP connection - * - * Called when an unrecoverable or "should never happen" error occurs. - * We log a message, send an END PDU to our peer and request the signalling - * manager to abort the connection. - * - * Arguments: - * sop pointer to sscop control block - * msg pointer to error message - * - * Returns: - * none - * - */ -void -sscop_abort(sop, msg) - struct sscop *sop; - char *msg; -{ - Atm_connvc *cvp = sop->so_connvc; - - /* - * Log and count error - */ - log(LOG_ERR, "%s", msg); - sscop_stat.sos_aborts++; - - /* - * Send an END PDU as a courtesy to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Set termination state - */ - sop->so_state = SOS_TERM; - - /* - * Flush all of our queues - */ - sscop_xmit_drain(sop); - sscop_rcvr_drain(sop); - - /* - * Tell Connection Manager to abort this connection - */ - (void) atm_cm_abort(cvp, &sscop_cause); -} - Property changes on: head/sys/netatm/uni/sscop.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/qsaal1_sigaa.c =================================================================== --- head/sys/netatm/uni/qsaal1_sigaa.c (revision 179307) +++ head/sys/netatm/uni/qsaal1_sigaa.c (nonexistent) @@ -1,518 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.SAAL1 - Process AA-signals (SAP_SSCOP) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static void sscop_estreq_ready(struct sscop *, intptr_t, intptr_t); -static void sscop_datreq_outconn(struct sscop *, intptr_t, intptr_t); -static void sscop_resreq_ready(struct sscop *, intptr_t, intptr_t); -static void sscop_resrsp_inresyn(struct sscop *, intptr_t, intptr_t); -static void sscop_resrsp_conresyn(struct sscop *, intptr_t, intptr_t); - - -/* - * Stack command state lookup tables - */ -/* SSCOP_INIT */ -static void (*sscop_init_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - sscop_init_inst, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - NULL, /* SOS_READY */ - NULL /* SOS_TERM */ -}; - -/* SSCOP_TERM */ -static void (*sscop_term_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - sscop_term_all, /* SOS_INST */ - sscop_term_all, /* SOS_IDLE */ - sscop_term_all, /* SOS_OUTCONN */ - sscop_term_all, /* SOS_INCONN */ - sscop_term_all, /* SOS_OUTDISC */ - sscop_term_all, /* SOS_OUTRESYN */ - sscop_term_all, /* SOS_INRESYN */ - sscop_term_all, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_term_all, /* SOS_READY */ - sscop_term_all /* SOS_TERM */ -}; - -/* SSCOP_ESTABLISH_REQ */ -static void (*sscop_estreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - sscop_estreq_idle, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - sscop_estreq_ready, /* SOS_OUTDISC */ - sscop_estreq_ready, /* SOS_OUTRESYN */ - sscop_estreq_ready, /* SOS_INRESYN */ - sscop_estreq_ready, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_estreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_ESTABLISH_RSP */ -static void (*sscop_estrsp_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - sscop_estrsp_inconn, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_aa_noop_1, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RELEASE_REQ */ -static void (*sscop_relreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - sscop_relreq_outconn, /* SOS_OUTCONN */ - sscop_relreq_inconn, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - sscop_relreq_outconn, /* SOS_OUTRESYN */ - sscop_relreq_ready, /* SOS_INRESYN */ - sscop_relreq_outconn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_relreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_DATA_REQ */ -static void (*sscop_datreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - sscop_datreq_outconn, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - sscop_datreq_ready, /* SOS_INRESYN */ - NULL, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_datreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RESYNC_REQ */ -static void (*sscop_resreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - NULL, /* SOS_INRESYN */ - NULL, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_resreq_ready, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - -/* SSCOP_RESYNC_RSP */ -static void (*sscop_resrsp_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - NULL, /* SOS_IDLE */ - NULL, /* SOS_OUTCONN */ - NULL, /* SOS_INCONN */ - NULL, /* SOS_OUTDISC */ - NULL, /* SOS_OUTRESYN */ - sscop_resrsp_inresyn, /* SOS_INRESYN */ - sscop_resrsp_conresyn, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - NULL, /* SOS_READY */ - sscop_aa_noop_0 /* SOS_TERM */ -}; - -/* SSCOP_UNITDATA_REQ */ -static void (*sscop_udtreq_tab[SOS_NUMSTATES]) - (struct sscop *, intptr_t, intptr_t) = { - NULL, /* SOS_INST */ - sscop_udtreq_all, /* SOS_IDLE */ - sscop_udtreq_all, /* SOS_OUTCONN */ - sscop_udtreq_all, /* SOS_INCONN */ - sscop_udtreq_all, /* SOS_OUTDISC */ - sscop_udtreq_all, /* SOS_OUTRESYN */ - sscop_udtreq_all, /* SOS_INRESYN */ - sscop_udtreq_all, /* SOS_CONRESYN */ - NULL, /* invalid */ - NULL, /* invalid */ - sscop_udtreq_all, /* SOS_READY */ - sscop_aa_noop_1 /* SOS_TERM */ -}; - - -/* - * Stack command lookup table - */ -void (*(*sscop_qsaal_aatab[SSCOP_CMD_SIZE])) - (struct sscop *, intptr_t, intptr_t) = { - NULL, - sscop_init_tab, - sscop_term_tab, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - sscop_estreq_tab, - NULL, - sscop_estrsp_tab, - NULL, - sscop_relreq_tab, - NULL, - NULL, - sscop_datreq_tab, - NULL, - sscop_resreq_tab, - NULL, - sscop_resrsp_tab, - NULL, - NULL, - NULL, - sscop_udtreq_tab, - NULL, - NULL, - NULL, - NULL -}; - - -/* - * SSCOP_ESTABLISH_REQ / SOS_READY Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 buffer release parameter - * - * Returns: - * none - * - */ -static void -sscop_estreq_ready(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * We currently only support BR=YES - */ - if (arg2 != SSCOP_BR_YES) { - sscop_abort(sop, "sscop: BR != YES\n"); - return; - } - - /* - * Stop poll timer - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Stop lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = 0; - - /* - * Initialize receiver window - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - /* - * Send first BGN PDU - */ - sop->so_connctl = 1; - (void) sscop_send_bgn(sop, SSCOP_SOURCE_USER); - - /* - * Reset transmitter state - */ - qsaal1_reset_xmit(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for BGAK - */ - sop->so_state = SOS_OUTCONN; - - return; -} - - -/* - * SSCOP_DATA_REQ / SOS_OUTCONN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing assured user data - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_datreq_outconn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - KBuffer *m = (KBuffer *)arg1; - - /* - * We must have a buffer (even if it contains no data) - */ - if (m == NULL) { - sscop_abort(sop, "sscop_datreq_outconn: no buffer\n"); - return; - } - - /* - * Only accept data here if in the middle of an SSCOP-initiated - * session reestablishment - */ - if ((sop->so_flags & SOF_REESTAB) == 0) { - KB_FREEALL(m); - sscop_abort(sop, "sscop_datreq_outconn: data not allowed\n"); - return; - } - - /* - * Place data at end of transmission queue - */ - KB_QNEXT(m) = NULL; - if (sop->so_xmit_hd == NULL) - sop->so_xmit_hd = m; - else - KB_QNEXT(sop->so_xmit_tl) = m; - sop->so_xmit_tl = m; - - /* - * Note that the transmit queues need to be serviced - */ - sop->so_flags |= SOF_XMITSRVC; - - return; -} - - -/* - * SSCOP_RESYNC_REQ / SOS_READY Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 pointer to buffer containing SSCOP-UU data - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_resreq_ready(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * We don't support SSCOP-UU data - */ - if (arg1 != SSCOP_UU_NULL) - KB_FREEALL((KBuffer *)arg1); - - /* - * Stop poll timer - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Stop lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = 0; - - /* - * Send first RS PDU - */ - sop->so_connctl = 1; - (void) sscop_send_rs(sop); - - /* - * Reset transmitter state - */ - qsaal1_reset_xmit(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Wait for RSAK - */ - sop->so_state = SOS_OUTRESYN; - - return; -} - - -/* - * SSCOP_RESYNC_RSP / SOS_INRESYN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 unused - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_resrsp_inresyn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Send RSAK PDU - */ - (void) sscop_send_rsak(sop); - - /* - * Back to data transfer state - */ - sop->so_state = SOS_READY; - - return; -} - - -/* - * SSCOP_RESYNC_RSP / SOS_CONRESYN Command Processor - * - * Arguments: - * sop pointer to sscop connection block - * arg1 unused - * arg2 unused - * - * Returns: - * none - * - */ -static void -sscop_resrsp_conresyn(sop, arg1, arg2) - struct sscop *sop; - intptr_t arg1; - intptr_t arg2; -{ - - /* - * Send RSAK PDU - */ - (void) sscop_send_rsak(sop); - - /* - * Back to waiting for peer's RSAK - */ - sop->so_state = SOS_OUTRESYN; - - return; -} - Property changes on: head/sys/netatm/uni/qsaal1_sigaa.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig.h =================================================================== --- head/sys/netatm/uni/unisig.h (revision 179307) +++ head/sys/netatm/uni/unisig.h (nonexistent) @@ -1,49 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Protocol control blocks - * - */ - -#ifndef _UNISIG_H -#define _UNISIG_H - -/* - * ATM Forum UNI 3.0/3.1 Signalling - */ -#define UNISIG_SIG_VPI 0 /* Signalling VPI */ -#define UNISIG_SIG_VCI 5 /* Signalling VCI */ - -#define STACK_SSCF "uni_sscf" - -#endif /* _UNISIG_H */ Property changes on: head/sys/netatm/uni/unisig.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop.h =================================================================== --- head/sys/netatm/uni/sscop.h (revision 179307) +++ head/sys/netatm/uni/sscop.h (nonexistent) @@ -1,80 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP protocol definitions - * - */ - -#ifndef _UNI_SSCOP_H -#define _UNI_SSCOP_H - -/* - * SSCOP Version - */ -enum sscop_vers { - SSCOP_VERS_QSAAL, /* Version = Q.SAAL1 */ - SSCOP_VERS_Q2110 /* Version = Q.2110 */ -}; - - -/* - * SSCOP API definitions - */ -#define SSCOP_UU_NULL 0 /* User-to-User Info = null */ -#define SSCOP_RN_TOTAL -1 /* Retrieval Number = Total */ -#define SSCOP_RN_UNKNOWN -2 /* Retrieval Number = Unknown */ -#define SSCOP_BR_YES 1 /* Buffer Release = Yes */ -#define SSCOP_BR_NO 2 /* Buffer Release = No */ -#define SSCOP_SOURCE_SSCOP 1 /* Source = SSCOP */ -#define SSCOP_SOURCE_USER 2 /* Source = User */ -#define SSCOP_SOURCE_LAST 3 /* Source = from last END */ - - -/* - * Connection parameters for an SSCOP entity. - * Passed via an SSCOP_INIT stack call argument. - */ -struct sscop_parms { - u_short sp_maxinfo; /* k - max information field size */ - u_short sp_maxuu; /* j - max SSCOP-UU field size */ - short sp_maxcc; /* MaxCC - max value of VT(CC) */ - short sp_maxpd; /* MaxPD - max value of VT(PD) */ - u_short sp_timecc; /* Timer_CC value (ticks) */ - u_short sp_timekeep; /* Timer_KEEPALIVE value (ticks) */ - u_short sp_timeresp; /* Timer_NO-RESPONSE value (ticks) */ - u_short sp_timepoll; /* Timer_POLL value (ticks) */ - u_short sp_timeidle; /* Timer_IDLE value (ticks) */ - short sp_rcvwin; /* Receiver window size */ -}; - -#endif /* _UNI_SSCOP_H */ Property changes on: head/sys/netatm/uni/sscop.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/q2110_subr.c =================================================================== --- head/sys/netatm/uni/q2110_subr.c (revision 179307) +++ head/sys/netatm/uni/q2110_subr.c (nonexistent) @@ -1,239 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.2110 - Subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Conditionally Clear Transmission Queues - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_clear_xmit(sop) - struct sscop *sop; -{ - /* - * Only clear queues if 'Clear Buffers' == No - */ - if (sop->so_flags & SOF_NOCLRBUF) - sscop_xmit_drain(sop); -} - - -/* - * Initialize Data Transfer State Variables - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_init_state(sop) - struct sscop *sop; -{ - /* - * Initialize for entry into Data Transfer Ready state - */ - sop->so_send = 0; - sop->so_pollsend = 0; - sop->so_ack = 0; - sop->so_pollack = 1; - sop->so_polldata = 0; - sop->so_rcvhigh = 0; - sop->so_rcvnext = 0; -} - - -/* - * Prepare Queues for Data Retrieval - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_prep_retrieve(sop) - struct sscop *sop; -{ - /* - * If 'Clear Buffers' == No, just clear retransmit queue, - * else clear all transmission queues - */ - if (sop->so_flags & SOF_NOCLRBUF) { - sop->so_rexmit_hd = NULL; - sop->so_rexmit_tl = NULL; - } else - sscop_xmit_drain(sop); - - /* - * Clear receiver queue - */ - sscop_rcvr_drain(sop); -} - - -/* - * Prepare Queues for Error Recovery - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_prep_recovery(sop) - struct sscop *sop; -{ - /* - * If 'Clear Buffers' == No, just clear retransmit queue, - * else clear all transmission queues - */ - if (sop->so_flags & SOF_NOCLRBUF) { - sop->so_rexmit_hd = NULL; - sop->so_rexmit_tl = NULL; - } else - sscop_xmit_drain(sop); -} - - -/* - * Conditionally Deliver Received Data to User - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_deliver_data(sop) - struct sscop *sop; -{ - /* - * If 'Clear Buffers' == No, give data to user - */ - if (sop->so_flags & SOF_NOCLRBUF) { - /* - * We don't support 'Clear Buffers' == No, so don't bother - */ - } - - /* - * Clear receiver queue - */ - sscop_rcvr_drain(sop); -} - - -/* - * Enter Connection Recovery Mode - * - * Arguments: - * sop pointer to sscop connection block - * - * Returns: - * none - * - */ -void -q2110_error_recovery(sop) - struct sscop *sop; -{ - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize receiver window - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - /* - * Send first ER PDU - */ - sop->so_connctl = 1; - SEQ_INCR(sop->so_sendconn, 1); - (void) sscop_send_er(sop); - - /* - * Set retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = sop->so_parm.sp_timecc; - - /* - * Clear out appropriate queues - */ - q2110_prep_recovery(sop); - - /* - * Wait for ERAK - */ - sop->so_state = SOS_OUTRECOV; - - return; -} - Property changes on: head/sys/netatm/uni/q2110_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_util.c =================================================================== --- head/sys/netatm/uni/unisig_util.c (revision 179307) +++ head/sys/netatm/uni/unisig_util.c (nonexistent) @@ -1,401 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Protocol processing module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* - * Free a UNISIG signalling message - * - * Free the passed message and any IEs that are attached to it - * - * Arguments: - * msg pointer to UNISIG protocol instance - * - * Returns: - * none - * - */ -void -unisig_free_msg(msg) - struct unisig_msg *msg; -{ - int i; - struct ie_generic *ie, *ienxt; - - ATM_DEBUG1("unisig_free_msg: msg=%p\n", msg); - - /* - * First free all the IEs - */ - for (i=0; imsg_ie_vec[i]; - while (ie) { - ienxt = ie->ie_next; - uma_zfree(unisig_ie_zone, ie); - ie = ienxt; - } - } - - /* - * Finally, free the message structure itself - */ - uma_zfree(unisig_msg_zone, msg); -} - -/* - * Verify a VCCB - * - * Search UNISIG's VCCB queue to verify that a VCCB belongs to UNISIG. - * - * Arguments: - * usp pointer to UNISIG protocol instance - * svp pointer to a VCCB - * - * Returns: - * TRUE the VCCB belongs to UNISIG - * FALSE the VCCB doesn't belong to UNISIG - * - */ -int -unisig_verify_vccb(usp, uvp) - struct unisig *usp; - struct unisig_vccb *uvp; - -{ - struct unisig_vccb *utp, *uvnext; - - for (utp = Q_HEAD(usp->us_vccq, struct unisig_vccb); - utp; utp = uvnext){ - uvnext = Q_NEXT(utp, struct unisig_vccb, uv_sigelem); - if (uvp == utp) { - return(TRUE); - } - } - return(FALSE); -} - - -/* - * Find a connection - * - * Find a VCCB given the call reference - * - * Arguments: - * usp pointer to UNISIG protocol instance - * cref the call reference to search for - * - * Returns: - * 0 there is no such VCCB - * uvp the address of the VCCB - * - */ -struct unisig_vccb * -unisig_find_conn(usp, cref) - struct unisig *usp; - u_int cref; - -{ - struct unisig_vccb *uvp, *uvnext; - - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp = uvnext){ - uvnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - if (uvp->uv_call_ref == cref) - break; - } - return(uvp); -} - - -/* - * Find a VCCB - * - * Find a VCCB given the VPI and VCI. - * - * Arguments: - * usp pointer to UNISIG protocol instance - * vpi the VPI to search for - * vci the VCI to search for - * dir the direction of the VCC (VCC_IN, VCC_OUT, or both). - * If dir is set to zero, return the address of any VCCB - * with the given VPI/VCI, regardless of direction. - * - * Returns: - * 0 there is no such VCCB - * uvp the address of the VCCB - * - */ -struct unisig_vccb * -unisig_find_vpvc(usp, vpi, vci, dir) - struct unisig *usp; - int vpi, vci; - u_char dir; - -{ - struct unisig_vccb *uvp, *uvnext; - - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp = uvnext){ - uvnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - if (uvp->uv_vpi == vpi && - uvp->uv_vci == vci && - (uvp->uv_type & dir) == dir) - break; - } - return(uvp); -} - - -/* - * Allocate a call reference value - * - * Arguments: - * usp pointer to UNISIG protocol instance - * - * Returns: - * 0 call reference not available - * cref the call reference value - * - */ -int -unisig_alloc_call_ref(usp) - struct unisig *usp; - -{ - int cref; - - /* - * Get the next call reference value - */ - cref = usp->us_cref; - - /* - * Make sure it hasn't got too large - */ - if (cref >= UNI_MSG_CALL_REF_DUMMY) { - /* XXX */ - log(LOG_ERR, "uni: call reference limit reached\n"); - return(0); - } - - /* - * Bump the call reference value - */ - usp->us_cref++; - - return(cref); -} - - -/* - * Print an ATM address - * - * Convert an ATM address into an ASCII string suitable for printing. - * - * Arguments: - * p pointer to an ATM address - * - * Returns: - * the address of a string with the ASCII representation of the - * address. This routine returns the address of a statically- - * allocated buffer, so if repeated calls to this routine are made, - * each call will destroy the result of the previous call. - * - */ -char * -unisig_addr_print(p) - Atm_addr *p; -{ - int i; - char *fp, *op, t_buff[16]; - u_char *cp; - static char strbuff[256]; - - static char nf_DCC[] = "0xX.XX.X.XXX.XX.XX.XX.XXXXXX.X"; - static char nf_ICD[] = "0xX.XX.X.XXX.XX.XX.XX.XXXXXX.X"; - static char nf_E164[] = "0xX.XXXXXXXX.XX.XX.XXXXXX.X"; - - union { - int w; - char c[4]; - } u1, u2; - - /* - * Clear the print buffer - */ - bzero(strbuff, sizeof(strbuff)); - - /* - * Select appropriate printing format - */ - switch(p->address_format) { - case T_ATM_ENDSYS_ADDR: - /* - * Select format by NSAP type - */ - switch(((Atm_addr_nsap *)p->address)->aan_afi) { - default: - case AFI_DCC: - fp = nf_DCC; - break; - case AFI_ICD: - fp = nf_ICD; - break; - case AFI_E164: - fp = nf_E164; - break; - } - - /* - * Loop through the format string, converting the NSAP - * to ASCII - */ - cp = (u_char *) p->address; - op = strbuff; - while (*fp) { - if (*fp == 'X') { - /* - * If format character is an 'X', put a - * two-digit hex representation of the - * NSAP byte in the output buffer - */ - snprintf(t_buff, sizeof(t_buff), - "%x", *cp + 512); - strcpy(op, &t_buff[strlen(t_buff)-2]); - op++; op++; - cp++; - } else { - /* - * If format character isn't an 'X', - * just copy it to the output buffer - */ - *op = *fp; - op++; - } - fp++; - } - - break; - - case T_ATM_E164_ADDR: - /* - * Print the IA5 characters of the E.164 address - */ - for(i=0; iaddress_length; i++) { - snprintf(strbuff + strlen(strbuff), - sizeof(strbuff) - strlen(strbuff), "%c", - ((Atm_addr_e164 *)p->address)->aae_addr[i]); - } - break; - - case T_ATM_SPANS_ADDR: - /* - * Get address into integers - */ - u1.c[0] = ((Atm_addr_spans *)p->address)->aas_addr[0]; - u1.c[1] = ((Atm_addr_spans *)p->address)->aas_addr[1]; - u1.c[2] = ((Atm_addr_spans *)p->address)->aas_addr[2]; - u1.c[3] = ((Atm_addr_spans *)p->address)->aas_addr[3]; - u2.c[0] = ((Atm_addr_spans *)p->address)->aas_addr[4]; - u2.c[1] = ((Atm_addr_spans *)p->address)->aas_addr[5]; - u2.c[2] = ((Atm_addr_spans *)p->address)->aas_addr[6]; - u2.c[3] = ((Atm_addr_spans *)p->address)->aas_addr[7]; - - /* - * Print the address as two words xxxxx.yyyyyyyy - */ - snprintf(strbuff, sizeof(strbuff), "%x.%x", u1.w, u2.w); - break; - - case T_ATM_ABSENT: - default: - strcpy(strbuff, "-"); - } - - return(strbuff); -} - - -/* - * Print the contents of a message buffer chain - * - * Arguments: - * m pointer to a buffer - * - * Returns: - * none - * - */ -void -unisig_print_mbuf(m) - KBuffer *m; -{ - int i; - caddr_t cp; - - printf("unisig_print_mbuf:\n"); - while (m) { - KB_DATASTART(m, cp, caddr_t); - for (i = 0; i < KB_LEN(m); i++) { - if (i == 0) - printf(" bfr=%p: ", m); - printf("%x ", (u_char)*cp++); - } - printf("\n"); - m = KB_NEXT(m); - } -} Property changes on: head/sys/netatm/uni/unisig_util.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp_cache.c =================================================================== --- head/sys/netatm/uni/uniarp_cache.c (revision 179307) +++ head/sys/netatm/uni/uniarp_cache.c (nonexistent) @@ -1,436 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - ARP cache processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Add data to the arp table cache - * - * Called at splnet. - * - * Arguments: - * uip pointer to UNI IP interface - * ip pointer to IP address structure - * atm pointer to ATM address structure - * atmsub pointer to ATM subaddress structure - * origin source of arp information - * - * Returns: - * 0 cache successfully updated - * else updated failed - reason indicated - * - */ -int -uniarp_cache_svc(uip, ip, atm, atmsub, origin) - struct uniip *uip; - struct in_addr *ip; - Atm_addr *atm; - Atm_addr *atmsub; - u_int origin; -{ - struct ip_nif *inp; - struct ipvcc *ivp, *inext, *itail; - struct uniarp *nouap, *ipuap; - char abuf[64]; - -#ifdef DIAGNOSTIC - strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf)); - abuf[sizeof(abuf) - 1] = 0; - ATM_DEBUG4("cache_svc: ip=%s, atm=(%s,%s), origin=%d\n", - inet_ntoa(*ip), unisig_addr_print(atm), abuf, origin); -#endif - - /* - * Get interface info - */ - inp = uip->uip_ipnif; - - /* - * Find both cached entry and 'nomap' entries for this data. - */ - UNIARP_LOOKUP(ip->s_addr, ipuap); - for (nouap = uniarp_nomaptab; nouap; nouap = nouap->ua_next) { - if (ATM_ADDR_EQUAL(atm, &nouap->ua_dstatm) && - ATM_ADDR_EQUAL(atmsub, &nouap->ua_dstatmsub) && - (nouap->ua_intf == uip)) - break; - } - - /* - * If there aren't any entries yet, create one - * May be called from netisr - don't wait. - */ - if ((ipuap == NULL) && (nouap == NULL)) { - ipuap = uma_zalloc(uniarp_zone, M_NOWAIT); - if (ipuap == NULL) - return (ENOMEM); - ipuap->ua_dstip.s_addr = ip->s_addr; - ipuap->ua_dstatm.address_format = T_ATM_ABSENT; - ipuap->ua_dstatmsub.address_format = T_ATM_ABSENT; - ipuap->ua_intf = uip; - UNIARP_ADD(ipuap); - } - - /* - * If there's no cached mapping, then make the 'nomap' entry - * the new cached entry. - */ - if (ipuap == NULL) { - UNLINK(nouap, struct uniarp, uniarp_nomaptab, ua_next); - nouap->ua_dstip.s_addr = ip->s_addr; - ipuap = nouap; - nouap = NULL; - UNIARP_ADD(ipuap); - } - - /* - * We need to check the consistency of the new data with any - * cached data. So taking the easy case first, if there isn't - * an ATM address in the cache then we can skip all these checks. - */ - if (ipuap->ua_dstatm.address_format != T_ATM_ABSENT) { - /* - * See if the new data conflicts with what's in the cache - */ - if (ATM_ADDR_EQUAL(atm, &ipuap->ua_dstatm) && - ATM_ADDR_EQUAL(atmsub, &ipuap->ua_dstatmsub) && - (uip == ipuap->ua_intf)) { - /* - * No conflicts here - */ - goto dataok; - } - - /* - * Data conflict...how we deal with this depends on - * the origins of the conflicting data - */ - if (origin == ipuap->ua_origin) { - /* - * The new data has equal precedence - if there are - * any VCCs using this entry, then we reject this - * "duplicate IP address" update. - */ - if (ipuap->ua_ivp != NULL) { - strncpy(abuf, unisig_addr_print(atmsub), - sizeof(abuf)); - abuf[sizeof(abuf) - 1] = 0; - log(LOG_WARNING, - "uniarp: duplicate IP address %s from %s,%s\n", - inet_ntoa(*ip), unisig_addr_print(atm), - abuf); - return (EACCES); - } - - } else if (origin > ipuap->ua_origin) { - /* - * New data's origin has higher precedence, - * so accept the new mapping and notify IP/ATM - * that a mapping change has occurred. IP/ATM will - * close any VCC's which aren't waiting for this map. - */ - ipuap->ua_flags |= UAF_LOCKED; - for (ivp = ipuap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_CHANGED); - } - ipuap->ua_flags &= ~UAF_LOCKED; - } else { - /* - * New data is of lesser origin precedence, - * so we just reject the update attempt. - */ - return (EACCES); - } - - strncpy(abuf, unisig_addr_print(atmsub), sizeof(abuf)); - abuf[sizeof(abuf) - 1] = 0; - log(LOG_WARNING, - "uniarp: ATM address for %s changed to %s,%s\n", - inet_ntoa(*ip), unisig_addr_print(atm), abuf); - } - - /* - * Update the cache entry with the new data - */ - ATM_ADDR_COPY(atm, &ipuap->ua_dstatm); - ATM_ADDR_COPY(atmsub, &ipuap->ua_dstatmsub); - ipuap->ua_intf = uip; - -dataok: - /* - * Update cache data origin - */ - ipuap->ua_origin = MAX(ipuap->ua_origin, origin); - - /* - * Ok, now act on this new/updated cache data - */ - ipuap->ua_flags |= UAF_LOCKED; - - /* - * Save pointer to last VCC currently on cached entry chain that - * will need to be notified of the map becoming valid - */ - itail = NULL; - if ((ipuap->ua_flags & UAF_VALID) == 0) { - - for (itail = ipuap->ua_ivp; itail && itail->iv_arpnext; - itail = itail->iv_arpnext) { - } - } - - /* - * If there was a 'nomap' entry for this mapping, then we need to - * announce the new mapping to them first. - */ - if (nouap) { - - /* - * Move the VCCs from this entry to the cache entry and - * let them know there's a valid mapping now - */ - for (ivp = nouap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - - UNLINK(ivp, struct ipvcc, nouap->ua_ivp, iv_arpnext); - - LINK2TAIL(ivp, struct ipvcc, ipuap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)ipuap; - - (*inp->inf_arpnotify)(ivp, MAP_VALID); - } - - /* - * Unlink and free the 'nomap' entry - */ - UNLINK(nouap, struct uniarp, uniarp_nomaptab, ua_next); - UNIARP_CANCEL(nouap); - uma_zfree(uniarp_zone, nouap); - } - - /* - * Now, if this entry wasn't valid, notify the remaining VCCs - */ - if (itail) { - - for (ivp = ipuap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_VALID); - if (ivp == itail) - break; - } - } - ipuap->ua_flags &= ~UAF_LOCKED; - - /* - * We now have a valid cache entry, so cancel any retry timer - * and reset the aging timeout - */ - UNIARP_CANCEL(ipuap); - if ((ipuap->ua_origin == UAO_REGISTER) && (origin != UAO_REGISTER)) { - if (((ipuap->ua_flags & UAF_VALID) == 0) || - (ipuap->ua_aging <= - UNIARP_SERVER_AGE - UNIARP_MIN_REFRESH)) { - ipuap->ua_flags |= UAF_REFRESH; - ipuap->ua_aging = UNIARP_SERVER_AGE; - ipuap->ua_retry = UNIARP_SERVER_RETRY; - } - } else { - if (uip->uip_arpstate == UIAS_SERVER_ACTIVE) { - ipuap->ua_aging = UNIARP_SERVER_AGE; - ipuap->ua_retry = UNIARP_SERVER_RETRY; - } else { - ipuap->ua_aging = UNIARP_CLIENT_AGE; - ipuap->ua_retry = UNIARP_CLIENT_RETRY; - } - ipuap->ua_flags |= UAF_REFRESH; - } - ipuap->ua_flags |= UAF_VALID; - ipuap->ua_flags &= ~UAF_USED; - return (0); -} - - -/* - * Process ARP data from a PVC - * - * The arp table cache is never updated with PVC information. - * - * Called at splnet. - * - * Arguments: - * ivp pointer to input PVC's IPVCC control block - * ip pointer to IP address structure - * atm pointer to ATM address structure - * atmsub pointer to ATM subaddress structure - * - * Returns: - * none - * - */ -void -uniarp_cache_pvc(ivp, ip, atm, atmsub) - struct ipvcc *ivp; - struct in_addr *ip; - Atm_addr *atm; - Atm_addr *atmsub; -{ - struct ip_nif *inp; - struct uniarp *uap; - -#ifdef DIAGNOSTIC - char buf[64]; - int vpi = 0, vci = 0; - - if ((ivp->iv_conn) && (ivp->iv_conn->co_connvc)) { - vpi = ivp->iv_conn->co_connvc->cvc_vcc->vc_vpi; - vci = ivp->iv_conn->co_connvc->cvc_vcc->vc_vci; - } - strncpy(buf, unisig_addr_print(atmsub), sizeof(buf)); - buf[sizeof(buf) - 1] = 0; - ATM_DEBUG5("cache_pvc: vcc=(%d,%d), ip=%s, atm=(%s,%s)\n", - vpi, vci, inet_ntoa(*ip), unisig_addr_print(atm), buf); -#endif - - /* - * Get PVC info - */ - inp = ivp->iv_ipnif; - uap = (struct uniarp *)ivp->iv_arpent; - - /* - * See if IP address for PVC has changed - */ - if (uap->ua_dstip.s_addr != ip->s_addr) { - if (uap->ua_dstip.s_addr != 0) - (*inp->inf_arpnotify)(ivp, MAP_CHANGED); - uap->ua_dstip.s_addr = ip->s_addr; - } - - /* - * Let IP/ATM know if address has become valid - */ - if ((uap->ua_flags & UAF_VALID) == 0) - (*inp->inf_arpnotify)(ivp, MAP_VALID); - uap->ua_flags |= UAF_VALID; - uap->ua_aging = UNIARP_CLIENT_AGE; - uap->ua_retry = UNIARP_CLIENT_RETRY; - - /* - * Save ATM addresses just for debugging - */ - ATM_ADDR_COPY(atm, &uap->ua_dstatm); - ATM_ADDR_COPY(atmsub, &uap->ua_dstatmsub); - - return; -} - - -/* - * Validate IP address - * - * Arguments: - * uip pointer to UNI IP interface - * ip pointer to IP address structure - * origin source of arp information - * - * Returns: - * 0 IP address is acceptable - * else invalid IP address - * - */ -int -uniarp_validate_ip(uip, ip, origin) - struct uniip *uip; - struct in_addr *ip; - u_int origin; -{ - struct uniarp_prf *upp; - u_int i; - - - /* - * Can't be multicast or broadcast address - */ - if (IN_MULTICAST(ntohl(ip->s_addr)) || - in_broadcast(*ip, ANIF2IFP(uip->uip_ipnif->inf_nif))) - return (1); - - /* - * For ATMARP registration information (including SCSP data), - * the address must be allowed by the interface's prefix list. - */ - if ((origin == UAO_REGISTER) || (origin == UAO_SCSP)) { - for (i = uip->uip_nprefix, upp = uip->uip_prefix; - i; i--, upp++) { - if ((ip->s_addr & upp->upf_mask.s_addr) == - upp->upf_addr.s_addr) - break; - } - if (i == 0) - return (1); - } - - return (0); -} - Property changes on: head/sys/netatm/uni/uniarp_cache.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_sigcpcs.c =================================================================== --- head/sys/netatm/uni/sscop_sigcpcs.c (revision 179307) +++ head/sys/netatm/uni/sscop_sigcpcs.c (nonexistent) @@ -1,2319 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP Common - Process CPCS-signals (SSCOP PDUs) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * No-op Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_noop(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - /* - * Just free PDU - */ - KB_FREEALL(m); - - return; -} - - -/* - * BGN PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgn_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err, source; - - if (sop->so_vers == SSCOP_VERS_Q2110) { - /* - * "Power-up Robustness" option - * - * Accept BGN regardless of BGN.N(SQ) - */ - sop->so_rcvconn = bp->bgn_nsq; - - } else { - /* - * If retransmitted BGN, reject it - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - (void) sscop_send_bgrej(sop); - return; - } - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Get Source value - */ - if (bp->bgn_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Reset receiver state variables - */ - qsaal1_reset_rcvr(sop); - } else - source = 0; - - /* - * Set initial transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - /* - * Pass connection request up to user - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user's response - */ - sop->so_state = SOS_INCONN; - - return; -} - - -/* - * BGN PDU / SOS_OUTDISC Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgn_outdisc(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err, source; - - /* - * If retransmitted BGN, ACK it and send new END - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - (void) sscop_send_bgak(sop); - (void) sscop_send_end(sop, SSCOP_SOURCE_LAST); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Get Source value - */ - if (bp->bgn_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Reset receiver variables - */ - qsaal1_reset_rcvr(sop); - - } else - source = 0; - - /* - * Tell user about incoming connection - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user's response - */ - sop->so_state = SOS_INCONN; - - return; -} - - -/* - * BGN PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgn_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err, source; - - /* - * If retransmitted BGN, ACK it and send new RS - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - (void) sscop_send_bgak(sop); - (void) sscop_send_rs(sop); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Get (possible) Source value - */ - if (bp->bgn_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Reset receiver variables - */ - qsaal1_reset_rcvr(sop); - - } else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Now tell user of a "new" incoming connection - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user's response - */ - sop->so_state = SOS_INCONN; - - return; -} - - -/* - * BGN PDU / SOS_INRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgn_inresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err, source; - - /* - * If retransmitted BGN, oops - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - sscop_maa_error(sop, 'B'); - return; - } - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Get (possible) Source value - */ - if (bp->bgn_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Reset receiver variables - */ - qsaal1_reset_rcvr(sop); - - } else { - /* - * Stop possible retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Drain receiver queues - */ - sscop_rcvr_drain(sop); - - /* - * Tell user current connection has been released - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_USER, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - source = 0; - } - - /* - * Tell user of incoming connection - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user's response - */ - sop->so_state = SOS_INCONN; - - return; -} - - -/* - * BGAK PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgak_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'C'); - KB_FREEALL(m); - - return; -} - - -/* - * BGAK PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgak_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_bgak_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * BGAK PDU / SOS_OUTCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgak_outconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgak_pdu *bp = (struct bgak_pdu *)trlr; - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgak_nmr)); - - /* - * Notify user of connection establishment - */ - if (sop->so_flags & SOF_REESTAB) { - KB_FREEALL(m); - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - sop->so_flags &= ~SOF_REESTAB; - } else { - STACK_CALL(SSCOP_ESTABLISH_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Reset receiver variables - */ - qsaal1_reset_rcvr(sop); - - /* - * Start polling timer - */ - sscop_set_poll(sop); - - /* - * Start lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - } else { - /* - * Initialize state variables - */ - q2110_init_state(sop); - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - } - - /* - * OK, we're ready for data - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * BGREJ PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgrej_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'D'); - KB_FREEALL(m); - return; -} - - -/* - * BGREJ PDU / SOS_OUTCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgrej_outconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int source, err; - intptr_t uu; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Clear reestablishment flag - */ - sop->so_flags &= ~SOF_REESTAB; - - KB_FREEALL(m); - m = NULL; - uu = SSCOP_UU_NULL; - source = SSCOP_SOURCE_SSCOP; - } else { - uu = (intptr_t)m; - source = SSCOP_SOURCE_USER; - } - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, uu, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * BGREJ PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgrej_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Report protocol error - */ - sscop_bgrej_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * BGREJ PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgrej_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Report protocol error - */ - sscop_bgrej_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * BGREJ PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_bgrej_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Report protocol error - */ - sscop_bgrej_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - } else { - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_end_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Return an ENDAK to peer - */ - (void) sscop_send_endak(sop); - - return; -} - - -/* - * END PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_end_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct end_pdu *ep = (struct end_pdu *)trlr; - int err, source; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Get Source value - */ - if (ep->end_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_OUTDISC Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_end_outdisc(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Release buffers - */ - KB_FREEALL(m); - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * ENDAK PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_endak_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'F'); - KB_FREEALL(m); - - return; -} - - -/* - * ENDAK PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_endak_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Report protocol error - */ - sscop_endak_error(sop, m, trlr); - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * ENDAK PDU / SOS_OUTDISC Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_endak_outdisc(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Release buffers - */ - KB_FREEALL(m); - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * ENDAK PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_endak_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Report protocol error - */ - sscop_endak_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Clear connection data - */ - qsaal1_clear_connection(sop); - } else { - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - } - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * RS PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_rs_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'J'); - KB_FREEALL(m); - - return; -} - - -/* - * RS PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_rs_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Report error condition - */ - sscop_rs_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - return; -} - - -/* - * RSAK PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_rsak_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'K'); - KB_FREEALL(m); - - return; -} - - -/* - * RSAK PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_rsak_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Report error condition - */ - sscop_rsak_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * RSAK PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_rsak_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct rsak_q2110_pdu *rp = (struct rsak_q2110_pdu *)trlr; - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Notify user of resynchronization completion - */ - STACK_CALL(SSCOP_RESYNC_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) { - /* - * Start the polling timer - */ - sscop_set_poll(sop); - - /* - * Start lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - } else { - /* - * Initialize state variables - */ - SEQ_SET(sop->so_sendmax, ntohl(rp->rsak_nmr)); - q2110_init_state(sop); - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - } - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Now go back to data transfer state - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * SD PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_sd_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'A'); - KB_FREEALL(m); - - return; -} - - -/* - * SD PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_sd_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_sd_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * SD PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_sd_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Record error condition - */ - sscop_sd_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * POLL PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_poll_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'G'); - KB_FREEALL(m); - - return; -} - - -/* - * POLL PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_poll_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Report error condition - */ - sscop_poll_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * POLL PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_poll_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Record error condition - */ - sscop_poll_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * STAT PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_stat_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'H'); - KB_FREEALL(m); - - return; -} - - -/* - * STAT PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_stat_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Report error condition - */ - sscop_stat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * STAT PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_stat_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Record error condition - */ - sscop_stat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * STAT PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_stat_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct stat_pdu *sp = (struct stat_pdu *)trlr; - struct pdu_hdr *php; - KBuffer *m0 = m; - sscop_seq seq1, seq2, opa; - int cnt = 0; - - sp->stat_nps = ntohl(sp->stat_nps); - sp->stat_nmr = ntohl(sp->stat_nmr); - sp->stat_nr = ntohl(sp->stat_nr); - - /* - * Validate peer's received poll sequence number - */ - if (SEQ_GT(sop->so_pollack, sp->stat_nps, sop->so_pollack) || - SEQ_GT(sp->stat_nps, sop->so_pollsend, sop->so_pollack)) { - /* - * Bad poll sequence number - */ - sscop_maa_error(sop, 'R'); - goto goterr; - } - - /* - * Validate peer's current receive data sequence number - */ - if (SEQ_GT(sop->so_ack, sp->stat_nr, sop->so_ack) || - SEQ_GT(sp->stat_nr, sop->so_send, sop->so_ack)) { - /* - * Bad data sequence number - */ - sscop_maa_error(sop, 'S'); - goto goterr; - } - - /* - * Free acknowledged PDUs - */ - for (seq1 = sop->so_ack, SEQ_SET(seq2, sp->stat_nr); - SEQ_LT(seq1, seq2, sop->so_ack); - SEQ_INCR(seq1, 1)) { - sscop_pack_free(sop, seq1); - } - - /* - * Update transmit state variables - */ - opa = sop->so_pollack; - sop->so_ack = seq2; - SEQ_SET(sop->so_pollack, sp->stat_nps); - SEQ_SET(sop->so_sendmax, sp->stat_nmr); - - /* - * Get first element in STAT list - */ - while (m && (KB_LEN(m) == 0)) - m = KB_NEXT(m); - if (m == NULL) - goto done; - m = sscop_stat_getelem(m, &seq1); - - /* - * Make sure there's a second element too - */ - if (m == NULL) - goto done; - - /* - * Validate first element (start of missing pdus) - */ - if (SEQ_GT(sop->so_ack, seq1, sop->so_ack) || - SEQ_GEQ(seq1, sop->so_send, sop->so_ack)) { - /* - * Bad element sequence number - */ - sscop_maa_error(sop, 'S'); - goto goterr; - } - - /* - * Loop thru all STAT elements in list - */ - while (m) { - /* - * Get next even element (start of received pdus) - */ - m = sscop_stat_getelem(m, &seq2); - - /* - * Validate seqence number - */ - if (SEQ_GEQ(seq1, seq2, sop->so_ack) || - SEQ_GT(seq2, sop->so_send, sop->so_ack)) { - /* - * Bad element sequence number - */ - sscop_maa_error(sop, 'S'); - goto goterr; - } - - /* - * Process each missing sequence number in this gap - */ - while (SEQ_LT(seq1, seq2, sop->so_ack)) { - /* - * Find corresponding SD PDU on pending ack queue - */ - php = sscop_pack_locate(sop, seq1); - if (php == NULL) { - sscop_maa_error(sop, 'S'); - goto goterr; - } - - /* - * Retransmit this SD PDU only if it was last sent - * during an earlier poll sequence and it's not - * already scheduled for retranmission. - */ - if (SEQ_LT(php->ph_nps, sp->stat_nps, opa) && - (php->ph_rexmit_lk == NULL) && - (sop->so_rexmit_tl != php)) { - /* - * Put PDU on retransmit queue and schedule - * transmit servicing - */ - sscop_rexmit_insert(sop, php); - sop->so_flags |= SOF_XMITSRVC; - cnt++; - } - - /* - * Bump to next sequence number - */ - SEQ_INCR(seq1, 1); - } - - /* - * Now process series of acknowledged PDUs - * - * Get next odd element (start of missing pdus), - * but make sure there is one and that it's valid - */ - if (m == NULL) - goto done; - m = sscop_stat_getelem(m, &seq2); - if (SEQ_GEQ(seq1, seq2, sop->so_ack) || - SEQ_GT(seq2, sop->so_send, sop->so_ack)) { - /* - * Bad element sequence number - */ - sscop_maa_error(sop, 'S'); - goto goterr; - } - - /* - * Process each acked sequence number - */ - while (SEQ_LT(seq1, seq2, sop->so_ack)) { - /* - * Can we clear transmit buffers ?? - */ - if ((sop->so_flags & SOF_NOCLRBUF) == 0) { - /* - * Yes, free acked buffers - */ - sscop_pack_free(sop, seq1); - } - - /* - * Bump to next sequence number - */ - SEQ_INCR(seq1, 1); - } - } - -done: - /* - * Free PDU buffer chain - */ - KB_FREEALL(m0); - - /* - * Report retransmitted PDUs - */ - if (cnt) - sscop_maa_error(sop, 'V'); - - /* - * Record transmit window closed transitions - */ - if (SEQ_LT(sop->so_send, sop->so_sendmax, sop->so_ack)) { - if (sop->so_flags & SOF_NOCREDIT) { - sop->so_flags &= ~SOF_NOCREDIT; - sscop_maa_error(sop, 'X'); - } - } else { - if ((sop->so_flags & SOF_NOCREDIT) == 0) { - sop->so_flags |= SOF_NOCREDIT; - sscop_maa_error(sop, 'W'); - } - } - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Restart lost poll/stat timer - */ - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - else { - /* - * Determine new polling phase - */ - if ((sop->so_timer[SSCOP_T_POLL] != 0) && - ((sop->so_flags & SOF_KEEPALIVE) == 0)) { - /* - * Remain in active phase - reset NO-RESPONSE timer - */ - sop->so_timer[SSCOP_T_NORESP] = - sop->so_parm.sp_timeresp; - - } else if (sop->so_timer[SSCOP_T_IDLE] == 0) { - /* - * Go from transient to idle phase - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = sop->so_parm.sp_timeidle; - } - } - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; - -goterr: - /* - * Protocol/parameter error encountered - */ - - /* - * Free PDU buffer chain - */ - KB_FREEALL(m0); - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Reestablish a new connection - */ - qsaal1_reestablish(sop); - else - /* - * Initiate error recovery - */ - q2110_error_recovery(sop); - - return; -} - - -/* - * USTAT PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_ustat_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'I'); - KB_FREEALL(m); - - return; -} - - -/* - * USTAT PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_ustat_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Report error condition - */ - sscop_ustat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - return; -} - - -/* - * USTAT PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_ustat_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Record error condition - */ - sscop_ustat_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Go back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * USTAT PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_ustat_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct ustat_pdu *up = (struct ustat_pdu *)trlr; - struct pdu_hdr *php; - sscop_seq seq1, seq2; - - up->ustat_nmr = ntohl(up->ustat_nmr); - up->ustat_nr = ntohl(up->ustat_nr); - - /* - * Validate peer's current receive data sequence number - */ - if (SEQ_GT(sop->so_ack, up->ustat_nr, sop->so_ack) || - SEQ_GEQ(up->ustat_nr, sop->so_send, sop->so_ack)) { - /* - * Bad data sequence number - */ - goto goterr; - } - - /* - * Free acknowledged PDUs - */ - for (seq1 = sop->so_ack, SEQ_SET(seq2, up->ustat_nr); - SEQ_LT(seq1, seq2, sop->so_ack); - SEQ_INCR(seq1, 1)) { - sscop_pack_free(sop, seq1); - } - - /* - * Update transmit state variables - */ - sop->so_ack = seq2; - SEQ_SET(sop->so_sendmax, up->ustat_nmr); - - /* - * Get USTAT list elements - */ - SEQ_SET(seq1, ntohl(up->ustat_le1)); - SEQ_SET(seq2, ntohl(up->ustat_le2)); - - /* - * Validate elements - */ - if (SEQ_GT(sop->so_ack, seq1, sop->so_ack) || - SEQ_GEQ(seq1, seq2, sop->so_ack) || - SEQ_GEQ(seq2, sop->so_send, sop->so_ack)) { - /* - * Bad element sequence number - */ - goto goterr; - } - - /* - * Process each missing sequence number in this gap - */ - while (SEQ_LT(seq1, seq2, sop->so_ack)) { - /* - * Find corresponding SD PDU on pending ack queue - */ - php = sscop_pack_locate(sop, seq1); - if (php == NULL) { - goto goterr; - } - - /* - * Retransmit this SD PDU if it's not - * already scheduled for retranmission. - */ - if ((php->ph_rexmit_lk == NULL) && - (sop->so_rexmit_tl != php)) { - /* - * Put PDU on retransmit queue and schedule - * transmit servicing - */ - sscop_rexmit_insert(sop, php); - sop->so_flags |= SOF_XMITSRVC; - } - - /* - * Bump to next sequence number - */ - SEQ_INCR(seq1, 1); - } - - /* - * Report retransmitted PDUs - */ - sscop_maa_error(sop, 'V'); - - /* - * Free PDU buffer chain - */ - KB_FREEALL(m); - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; - -goterr: - /* - * Protocol/parameter error encountered - */ - sscop_maa_error(sop, 'T'); - - /* - * Free PDU buffer chain - */ - KB_FREEALL(m); - - if (sop->so_vers == SSCOP_VERS_QSAAL) - /* - * Reestablish a new connection - */ - qsaal1_reestablish(sop); - else - /* - * Initiate error recovery - */ - q2110_error_recovery(sop); - - return; -} - - -/* - * UD PDU / SOS_* Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_ud_all(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Pass data up to user - */ - STACK_CALL(SSCOP_UNITDATA_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) - KB_FREEALL(m); - return; -} - - -/* - * MD PDU / SOS_* Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -void -sscop_md_all(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * We don't support MD PDUs - */ - KB_FREEALL(m); - return; -} - Property changes on: head/sys/netatm/uni/sscop_sigcpcs.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uni.h =================================================================== --- head/sys/netatm/uni/uni.h (revision 179307) +++ head/sys/netatm/uni/uni.h (nonexistent) @@ -1,50 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * Protocol definitions - * - */ - -#ifndef _UNI_UNI_H -#define _UNI_UNI_H - -/* - * UNI Version - */ -enum uni_vers { - UNI_VERS_3_0, - UNI_VERS_3_1, - UNI_VERS_4_0 -}; - -#endif /* _UNI_UNI_H */ Property changes on: head/sys/netatm/uni/uni.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp.c =================================================================== --- head/sys/netatm/uni/uniarp.c (revision 179307) +++ head/sys/netatm/uni/uniarp.c (nonexistent) @@ -1,1261 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -/* - * Global variables - */ -struct uniarp *uniarp_arptab[UNIARP_HASHSIZ] = {NULL}; -struct uniarp *uniarp_nomaptab = NULL; -struct uniarp *uniarp_pvctab = NULL; -struct atm_time uniarp_timer = {0, 0}; /* Aging timer */ -struct uniarp_stat uniarp_stat = {0}; - -/* - * net.harp.uni.uniarp_print - */ -int uniarp_print = 0; -SYSCTL_INT(_net_harp_uni, OID_AUTO, uniarp_print, CTLFLAG_RW, - &uniarp_print, 0, "dump UNI/ARP messages"); - -Atm_endpoint uniarp_endpt = { - NULL, - ENDPT_ATMARP, - uniarp_ioctl, - uniarp_getname, - uniarp_connected, - uniarp_cleared, - NULL, - NULL, - NULL, - NULL, - uniarp_cpcs_data, - NULL, - NULL, - NULL, - NULL -}; - -uma_zone_t uniarp_zone; - - -/* - * Local variables - */ -static void uniarp_server_mode(struct uniip *); -static void uniarp_client_mode(struct uniip *, Atm_addr *); - - -/* - * Process module loading notification - * - * Called whenever the uni module is initializing. - * - * Arguments: - * none - * - * Returns: - * 0 initialization successful - * errno initialization failed - reason indicated - * - */ -int -uniarp_start() -{ - int err; - - uniarp_zone = uma_zcreate("uni arp", sizeof(struct uniarp), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); - if (uniarp_zone == NULL) - panic("uniarp_start: uma_zcreate"); - - /* - * Register our endpoint - */ - err = atm_endpoint_register(&uniarp_endpt); - return (err); -} - - -/* - * Process module unloading notification - * - * Called whenever the uni module is about to be unloaded. All signalling - * instances will have been previously detached. All uniarp resources - * must be freed now. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -uniarp_stop() -{ - int i; - - /* - * Make sure the arp table is empty - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - if (uniarp_arptab[i] != NULL) - panic("uniarp_stop: arp table not empty"); - } - - /* - * Cancel timers - */ - (void) atm_untimeout(&uniarp_timer); - - /* - * De-register ourselves - */ - (void) atm_endpoint_deregister(&uniarp_endpt); - - /* - * Free our storage pools - */ - uma_zdestroy(uniarp_zone); -} - - -/* - * Process IP Network Interface Activation - * - * Called whenever an IP network interface becomes active. - * - * Called at splnet. - * - * Arguments: - * uip pointer to UNI IP interface - * - * Returns: - * none - * - */ -void -uniarp_ipact(uip) - struct uniip *uip; -{ - struct unisig *usp; - - ATM_DEBUG1("uniarp_ipact: uip=%p\n", uip); - - /* - * Set initial state - */ - uip->uip_arpstate = UIAS_NOTCONF; - uip->uip_arpsvratm.address_format = T_ATM_ABSENT; - uip->uip_arpsvratm.address_length = 0; - uip->uip_arpsvrsub.address_format = T_ATM_ABSENT; - uip->uip_arpsvrsub.address_length = 0; - - usp = (struct unisig *)uip->uip_ipnif->inf_nif->nif_pif->pif_siginst; - if (usp->us_addr.address_format != T_ATM_ABSENT) - uip->uip_flags |= UIF_IFADDR; - - /* - * Make sure aging timer is running - */ - if ((uniarp_timer.ti_flag & TIF_QUEUED) == 0) - atm_timeout(&uniarp_timer, UNIARP_AGING, uniarp_aging); - - return; -} - - -/* - * Process IP Network Interface Deactivation - * - * Called whenever an IP network interface becomes inactive. All VCCs - * for this interface should already have been closed. - * - * Called at splnet. - * - * Arguments: - * uip pointer to UNI IP interface - * - * Returns: - * none - * - */ -void -uniarp_ipdact(uip) - struct uniip *uip; -{ - struct uniarp *uap, *unext; - int i; - - ATM_DEBUG1("uniarp_ipdact: uip=%p\n", uip); - - /* - * Delete all interface entries - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_intf != uip) - continue; - - /* - * All VCCs should (better) be gone by now - */ - if (uap->ua_ivp) - panic("uniarp_ipdact: entry not empty"); - - /* - * Clean up any loose ends - */ - UNIARP_CANCEL(uap); - - /* - * Delete entry from arp table and free entry - */ - UNIARP_DELETE(uap); - uma_zfree(uniarp_zone, uap); - } - } - - /* - * Clean up 'nomap' table - */ - for (uap = uniarp_nomaptab; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_intf != uip) - continue; - - /* - * All VCCs should (better) be gone by now - */ - if (uap->ua_ivp) - panic("uniarp_ipdact: entry not empty"); - - /* - * Clean up any loose ends - */ - UNIARP_CANCEL(uap); - - /* - * Delete entry from 'no map' table and free entry - */ - UNLINK(uap, struct uniarp, uniarp_nomaptab, ua_next); - uma_zfree(uniarp_zone, uap); - } - - /* - * Also clean up pvc table - */ - for (uap = uniarp_pvctab; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_intf != uip) - continue; - - /* - * All PVCs should (better) be gone by now - */ - panic("uniarp_ipdact: pvc table not empty"); - } - - /* - * Cancel arp interface timer - */ - UNIIP_ARP_CANCEL(uip); - - /* - * Stop aging timer if this is the last active interface - */ - if (uniip_head == uip && uip->uip_next == NULL) - (void) atm_untimeout(&uniarp_timer); -} - - -/* - * Process Interface ATM Address Change - * - * This function is called whenever the ATM address for a physical - * interface is set/changed. - * - * Called at splnet. - * - * Arguments: - * sip pointer to interface's UNI signalling instance - * - * Returns: - * none - * - */ -void -uniarp_ifaddr(sip) - struct siginst *sip; -{ - struct atm_nif *nip; - struct uniip *uip; - - ATM_DEBUG1("uniarp_ifaddr: sip=%p\n", sip); - - /* - * We've got to handle this for every network interface - */ - for (nip = sip->si_pif->pif_nif; nip; nip = nip->nif_pnext) { - - /* - * Find our control blocks - */ - for (uip = uniip_head; uip; uip = uip->uip_next) { - if (uip->uip_ipnif->inf_nif == nip) - break; - } - if (uip == NULL) - continue; - - /* - * We don't support changing prefix (yet) - */ - if (uip->uip_flags & UIF_IFADDR) { - log(LOG_ERR, "uniarp_ifaddr: change not supported\n"); - continue; - } - - /* - * Note that address has been set and figure out what - * to do next - */ - uip->uip_flags |= UIF_IFADDR; - - if (uip->uip_arpstate == UIAS_CLIENT_PADDR) { - /* - * This is what we're waiting for - */ - uniarp_client_mode(uip, NULL); - } else if (uip->uip_arpstate == UIAS_SERVER_ACTIVE) { - /* - * Set new local arpserver atm address - */ - ATM_ADDR_SEL_COPY(&sip->si_addr, nip->nif_sel, - &uip->uip_arpsvratm); - } - } - - return; -} - - -/* - * Set ATMARP Server Mode - * - * This function is called to configure the local node to become the - * ATMARP server for the specified LIS. - * - * Called at splnet. - * - * Arguments: - * uip pointer to UNI IP interface - * - * Returns: - * none - * - */ -static void -uniarp_server_mode(uip) - struct uniip *uip; -{ - struct ip_nif *inp; - struct atm_nif *nip; - struct siginst *sgp; - struct ipvcc *ivp, *inext; - struct uniarp *uap, *unext; - int i; - - ATM_DEBUG1("uniarp_server_mode: uip=%p\n", uip); - - /* - * Handle client/server mode changes first - */ - switch (uip->uip_arpstate) { - - case UIAS_NOTCONF: - case UIAS_SERVER_ACTIVE: - case UIAS_CLIENT_PADDR: - /* - * Nothing to undo - */ - break; - - case UIAS_CLIENT_POPEN: - /* - * We're becoming the server, so kill the pending connection - */ - UNIIP_ARP_CANCEL(uip); - if ((ivp = uip->uip_arpsvrvcc) != NULL) { - ivp->iv_flags &= ~IVF_NOIDLE; - uip->uip_arpsvrvcc = NULL; - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_FAILED); - } - break; - - case UIAS_CLIENT_REGISTER: - case UIAS_CLIENT_ACTIVE: - /* - * We're becoming the server, but leave existing VCC as a - * "normal" IP VCC - */ - UNIIP_ARP_CANCEL(uip); - ivp = uip->uip_arpsvrvcc; - ivp->iv_flags &= ~IVF_NOIDLE; - uip->uip_arpsvrvcc = NULL; - break; - } - - /* - * Revalidate status for all arp entries on this interface - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_intf != uip) - continue; - - if (uap->ua_origin >= UAO_PERM) - continue; - - if (uap->ua_origin >= UAO_SCSP) { - if (uniarp_validate_ip(uip, &uap->ua_dstip, - uap->ua_origin) == 0) - continue; - } - - if (uap->ua_ivp == NULL) { - UNIARP_CANCEL(uap); - UNIARP_DELETE(uap); - uma_zfree(uniarp_zone, uap); - continue; - } - - if (uap->ua_flags & UAF_VALID) { - uap->ua_flags |= UAF_LOCKED; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify) - (ivp, MAP_INVALID); - } - uap->ua_flags &= ~(UAF_LOCKED | UAF_VALID); - } - uap->ua_aging = 1; - uap->ua_origin = 0; - } - } - - /* - * OK, now let's make ourselves the server - */ - inp = uip->uip_ipnif; - nip = inp->inf_nif; - sgp = nip->nif_pif->pif_siginst; - ATM_ADDR_SEL_COPY(&sgp->si_addr, nip->nif_sel, &uip->uip_arpsvratm); - uip->uip_arpsvrip = IA_SIN(inp->inf_addr)->sin_addr; - uip->uip_arpstate = UIAS_SERVER_ACTIVE; - return; -} - - -/* - * Set ATMARP Client Mode - * - * This function is called to configure the local node to be an ATMARP - * client on the specified LIS using the specified ATMARP server. - * - * Called at splnet. - * - * Arguments: - * uip pointer to UNI IP interface - * aap pointer to the ATMARP server's ATM address - * - * Returns: - * none - * - */ -static void -uniarp_client_mode(uip, aap) - struct uniip *uip; - Atm_addr *aap; -{ - struct ip_nif *inp = uip->uip_ipnif; - struct uniarp *uap, *unext; - struct ipvcc *ivp, *inext; - int i; - - ATM_DEBUG2("uniarp_client_mode: uip=%p, atm=(%s,-)\n", - uip, aap ? unisig_addr_print(aap): "-"); - - /* - * Handle client/server mode changes first - */ - switch (uip->uip_arpstate) { - - case UIAS_NOTCONF: - case UIAS_CLIENT_PADDR: - /* - * Nothing to undo - */ - break; - - case UIAS_CLIENT_POPEN: - /* - * If this is this a timeout retry, just go do it - */ - if (aap == NULL) - break; - - /* - * If this isn't really a different arpserver, we're done - */ - if (ATM_ADDR_EQUAL(aap, &uip->uip_arpsvratm)) - return; - - /* - * We're changing servers, so kill the pending connection - */ - UNIIP_ARP_CANCEL(uip); - if ((ivp = uip->uip_arpsvrvcc) != NULL) { - ivp->iv_flags &= ~IVF_NOIDLE; - uip->uip_arpsvrvcc = NULL; - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_FAILED); - } - break; - - case UIAS_CLIENT_REGISTER: - case UIAS_CLIENT_ACTIVE: - /* - * If this isn't really a different arpserver, we're done - */ - if (ATM_ADDR_EQUAL(aap, &uip->uip_arpsvratm)) - return; - - /* - * We're changing servers, but leave existing VCC as a - * "normal" IP VCC - */ - UNIIP_ARP_CANCEL(uip); - ivp = uip->uip_arpsvrvcc; - ivp->iv_flags &= ~IVF_NOIDLE; - uip->uip_arpsvrvcc = NULL; - break; - - case UIAS_SERVER_ACTIVE: - /* - * We're changing from server mode, so... - * - * Reset valid/authoritative status for all arp entries - * on this interface - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_intf != uip) - continue; - - if (uap->ua_origin >= UAO_PERM) - continue; - - if (uap->ua_ivp == NULL) { - UNIARP_CANCEL(uap); - UNIARP_DELETE(uap); - uma_zfree(uniarp_zone, uap); - continue; - } - - if (uap->ua_flags & UAF_VALID) { - uap->ua_flags |= UAF_LOCKED; - for (ivp = uap->ua_ivp; ivp; - ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify) - (ivp, MAP_INVALID); - } - uap->ua_flags &= - ~(UAF_LOCKED | UAF_VALID); - } - uap->ua_aging = 1; - uap->ua_origin = 0; - } - } - uip->uip_arpsvratm.address_format = T_ATM_ABSENT; - uip->uip_arpsvratm.address_length = 0; - uip->uip_arpsvrsub.address_format = T_ATM_ABSENT; - uip->uip_arpsvrsub.address_length = 0; - uip->uip_arpsvrip.s_addr = 0; - break; - } - - /* - * Save the arp server address, if supplied now - */ - if (aap) - ATM_ADDR_COPY(aap, &uip->uip_arpsvratm); - - /* - * If the interface's ATM address isn't set yet, then we - * can't do much until it is - */ - if ((uip->uip_flags & UIF_IFADDR) == 0) { - uip->uip_arpstate = UIAS_CLIENT_PADDR; - return; - } - - /* - * Just to keep things simple, if we already have (or are trying to - * setup) any SVCs to our new server, kill the connections so we can - * open a "fresh" SVC for the arpserver connection. - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = unext) { - unext = uap->ua_next; - - if (ATM_ADDR_EQUAL(&uip->uip_arpsvratm, - &uap->ua_dstatm) && - ATM_ADDR_EQUAL(&uip->uip_arpsvrsub, - &uap->ua_dstatmsub)) { - uap->ua_flags &= ~UAF_VALID; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_FAILED); - } - } - } - } - for (uap = uniarp_nomaptab; uap; uap = unext) { - unext = uap->ua_next; - - if (ATM_ADDR_EQUAL(&uip->uip_arpsvratm, &uap->ua_dstatm) && - ATM_ADDR_EQUAL(&uip->uip_arpsvrsub, &uap->ua_dstatmsub)) { - uap->ua_flags &= ~UAF_VALID; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_FAILED); - } - } - } - - /* - * Now, get an arp entry for the server connection - * May be called from timeout - don't wait. - */ - uip->uip_arpstate = UIAS_CLIENT_POPEN; - uap = uma_zalloc(uniarp_zone, M_NOWAIT | M_ZERO); - if (uap == NULL) { - UNIIP_ARP_TIMER(uip, 1 * ATM_HZ); - return; - } - - /* - * Next, initiate an SVC to the server - */ - if ((*inp->inf_createsvc)(ANIF2IFP(inp->inf_nif), AF_ATM, - (caddr_t)&uip->uip_arpsvratm, &ivp)) { - uma_zfree(uniarp_zone, uap); - UNIIP_ARP_TIMER(uip, 1 * ATM_HZ); - return; - } - - /* - * Finally, get everything set up and wait for the SVC - * connection to complete - */ - uip->uip_arpsvrvcc = ivp; - ivp->iv_flags |= IVF_NOIDLE; - - ATM_ADDR_COPY(&uip->uip_arpsvratm, &uap->ua_dstatm); - ATM_ADDR_COPY(&uip->uip_arpsvrsub, &uap->ua_dstatmsub); - uap->ua_intf = uip; - - LINK2TAIL(ivp, struct ipvcc, uap->ua_ivp, iv_arpnext); - ivp->iv_arpent = (struct arpmap *)uap; - - LINK2TAIL(uap, struct uniarp, uniarp_nomaptab, ua_next); - - return; -} - - -/* - * Process a UNI ARP interface timeout - * - * Called when a previously scheduled uniip arp interface timer expires. - * Processing will be based on the current uniip arp state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to uniip arp timer control block - * - * Returns: - * none - * - */ -void -uniarp_iftimeout(tip) - struct atm_time *tip; -{ - struct ip_nif *inp; - struct uniip *uip; - - - /* - * Back-off to uniip control block - */ - uip = (struct uniip *) - ((caddr_t)tip - offsetof(struct uniip, uip_arptime)); - - ATM_DEBUG2("uniarp_iftimeout: uip=%p, state=%d\n", uip, - uip->uip_arpstate); - - /* - * Process timeout based on protocol state - */ - switch (uip->uip_arpstate) { - - case UIAS_CLIENT_POPEN: - /* - * Retry opening arp server connection - */ - uniarp_client_mode(uip, NULL); - break; - - case UIAS_CLIENT_REGISTER: - /* - * Resend registration request - */ - inp = uip->uip_ipnif; - (void) uniarp_arp_req(uip, &(IA_SIN(inp->inf_addr)->sin_addr)); - - /* - * Restart timer - */ - UNIIP_ARP_TIMER(uip, 2 * ATM_HZ); - - break; - - case UIAS_CLIENT_ACTIVE: - /* - * Refresh our registration - */ - inp = uip->uip_ipnif; - (void) uniarp_arp_req(uip, &(IA_SIN(inp->inf_addr)->sin_addr)); - - /* - * Restart timer - */ - UNIIP_ARP_TIMER(uip, UNIARP_REGIS_RETRY); - - break; - - default: - log(LOG_ERR, "uniarp_iftimeout: invalid state %d\n", - uip->uip_arpstate); - } -} - - -/* - * UNI ARP IOCTL support - * - * Function will be called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -int -uniarp_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmaddreq *aap; - struct atmdelreq *adp; - struct atmsetreq *asp; - struct atminfreq *aip; - struct air_arp_rsp aar; - struct air_asrv_rsp asr; - struct atm_pif *pip; - struct atm_nif *nip; - struct ipvcc *ivp, *inext; - struct uniip *uip; - struct uniarp *uap; - struct unisig *usp; - struct in_addr ip; - Atm_addr atmsub; - u_long dst; - int err = 0; - size_t buf_len, tlen; - u_int i; - caddr_t buf_addr; - - switch (code) { - - case AIOCS_ADD_ARP: - /* - * Add a permanent ARP mapping - */ - aap = (struct atmaddreq *)data; - uip = (struct uniip *)arg1; - if (aap->aar_arp_addr.address_format != T_ATM_ENDSYS_ADDR) { - err = EINVAL; - break; - } - atmsub.address_format = T_ATM_ABSENT; - atmsub.address_length = 0; - ip = SATOSIN(&aap->aar_arp_dst)->sin_addr; - - /* - * Validate IP address - */ - if (uniarp_validate_ip(uip, &ip, aap->aar_arp_origin) != 0) { - err = EADDRNOTAVAIL; - break; - } - - /* - * Add an entry to the cache - */ - err = uniarp_cache_svc(uip, &ip, &aap->aar_arp_addr, - &atmsub, aap->aar_arp_origin); - break; - - case AIOCS_DEL_ARP: - /* - * Delete an ARP mapping - */ - adp = (struct atmdelreq *)data; - uip = (struct uniip *)arg1; - ip = SATOSIN(&adp->adr_arp_dst)->sin_addr; - - /* - * Now find the entry to be deleted - */ - UNIARP_LOOKUP(ip.s_addr, uap); - if (uap == NULL) { - err = ENOENT; - break; - } - - /* - * Notify all VCCs using this entry that they must finish - * up now. - */ - uap->ua_flags |= UAF_LOCKED; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_FAILED); - } - - /* - * Now free up the entry - */ - UNIARP_CANCEL(uap); - UNIARP_DELETE(uap); - uma_zfree(uniarp_zone, uap); - break; - - case AIOCS_SET_ASV: - /* - * Set interface ARP server address - */ - asp = (struct atmsetreq *)data; - for (uip = uniip_head; uip; uip = uip->uip_next) { - if (uip->uip_ipnif->inf_nif == (struct atm_nif *)arg1) - break; - } - if (uip == NULL) { - err = ENOPROTOOPT; - break; - } - - /* - * Check for our own address - */ - usp = (struct unisig *) - uip->uip_ipnif->inf_nif->nif_pif->pif_siginst; - if (ATM_ADDR_EQUAL(&asp->asr_arp_addr, &usp->us_addr)) { - asp->asr_arp_addr.address_format = T_ATM_ABSENT; - } - - /* - * If we're going into server mode, make sure we can get - * the memory for the prefix list before continuing - */ - if (asp->asr_arp_addr.address_format == T_ATM_ABSENT) { - i = asp->asr_arp_plen / sizeof(struct uniarp_prf); - if (i == 0) { - err = EINVAL; - break; - } - buf_len = i * sizeof(struct uniarp_prf); - buf_addr = malloc(buf_len, M_DEVBUF, M_NOWAIT); - if (buf_addr == NULL) { - err = ENOMEM; - break; - } - err = copyin(asp->asr_arp_pbuf, buf_addr, buf_len); - if (err) { - free(buf_addr, M_DEVBUF); - break; - } - } else { - /* Silence the compiler */ - i = 0; - buf_addr = NULL; - } - - /* - * Free any existing prefix address list - */ - if (uip->uip_prefix != NULL) { - free(uip->uip_prefix, M_DEVBUF); - uip->uip_prefix = NULL; - uip->uip_nprefix = 0; - } - - if (asp->asr_arp_addr.address_format == T_ATM_ABSENT) { - /* - * Set ATMARP server mode - */ - uip->uip_prefix = (struct uniarp_prf *)buf_addr; - uip->uip_nprefix = i; - uniarp_server_mode(uip); - } else - /* - * Set ATMARP client mode - */ - uniarp_client_mode(uip, &asp->asr_arp_addr); - break; - - case AIOCS_INF_ARP: - /* - * Get ARP table information - */ - aip = (struct atminfreq *)data; - - if (aip->air_arp_addr.sa_family != AF_INET) - break; - dst = SATOSIN(&aip->air_arp_addr)->sin_addr.s_addr; - - buf_addr = aip->air_buf_addr; - buf_len = aip->air_buf_len; - - pip = ((struct siginst *)arg1)->si_pif; - - /* - * Run through entire arp table - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = uap->ua_next) { - /* - * We only want valid entries learned - * from the supplied interface. - */ - nip = uap->ua_intf->uip_ipnif->inf_nif; - if (nip->nif_pif != pip) - continue; - if ((dst != INADDR_ANY) && - (dst != uap->ua_dstip.s_addr)) - continue; - - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(aar)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - SATOSIN(&aar.aap_arp_addr)->sin_family = - AF_INET; - SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr = - uap->ua_dstip.s_addr; - strlcpy(aar.aap_intf, ANIF2IFP(nip)->if_xname, - sizeof(aar.aap_intf)); - aar.aap_flags = uap->ua_flags; - aar.aap_origin = uap->ua_origin; - if (uap->ua_flags & UAF_VALID) - aar.aap_age = uap->ua_aging + - uap->ua_retry * UNIARP_RETRY_AGE; - else - aar.aap_age = 0; - ATM_ADDR_COPY(&uap->ua_dstatm, &aar.aap_addr); - ATM_ADDR_COPY(&uap->ua_dstatmsub, - &aar.aap_subaddr); - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&aar, buf_addr, - sizeof(aar))) != 0) - break; - buf_addr += sizeof(aar); - buf_len -= sizeof(aar); - } - if (err) - break; - } - - /* - * Now go through the 'nomap' table - */ - if (err || (dst != INADDR_ANY)) - goto updbuf; - for (uap = uniarp_nomaptab; uap; uap = uap->ua_next) { - /* - * We only want valid entries learned - * from the supplied interface. - */ - nip = uap->ua_intf->uip_ipnif->inf_nif; - if (nip->nif_pif != pip) - continue; - - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(aar)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - SATOSIN(&aar.aap_arp_addr)->sin_family = AF_INET; - SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr = 0; - strlcpy(aar.aap_intf, ANIF2IFP(nip)->if_xname, - sizeof(aar.aap_intf)); - aar.aap_flags = 0; - aar.aap_origin = uap->ua_origin; - aar.aap_age = 0; - ATM_ADDR_COPY(&uap->ua_dstatm, &aar.aap_addr); - ATM_ADDR_COPY(&uap->ua_dstatmsub, - &aar.aap_subaddr); - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&aar, buf_addr, - sizeof(aar))) != 0) - break; - buf_addr += sizeof(aar); - buf_len -= sizeof(aar); - } - -updbuf: - /* - * Update the buffer pointer and length - */ - aip->air_buf_addr = buf_addr; - aip->air_buf_len = buf_len; - - /* - * If the user wants the refresh status reset and no - * errors have been encountered, then do the reset - */ - if ((err == 0) && (aip->air_arp_flags & ARP_RESET_REF)) { - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; - uap = uap->ua_next) { - /* - * We only want valid entries learned - * from the supplied interface. - */ - nip = uap->ua_intf->uip_ipnif->inf_nif; - if (nip->nif_pif != pip) - continue; - if ((dst != INADDR_ANY) && - (dst != uap->ua_dstip.s_addr)) - continue; - - /* - * Reset refresh flag - */ - uap->ua_flags &= ~UAF_REFRESH; - } - } - } - break; - - case AIOCS_INF_ASV: - /* - * Get ARP server information - */ - aip = (struct atminfreq *)data; - nip = (struct atm_nif *)arg1; - - buf_addr = aip->air_buf_addr; - buf_len = aip->air_buf_len; - - for (uip = uniip_head; uip; uip = uip->uip_next) { - - if (uip->uip_ipnif->inf_nif != nip) - continue; - - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(asr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - strlcpy(asr.asp_intf, ANIF2IFP(nip)->if_xname, - sizeof(asr.asp_intf)); - asr.asp_state = uip->uip_arpstate; - if (uip->uip_arpstate == UIAS_SERVER_ACTIVE) { - asr.asp_addr.address_format = T_ATM_ABSENT; - asr.asp_addr.address_length = 0; - } else { - ATM_ADDR_COPY(&uip->uip_arpsvratm, - &asr.asp_addr); - } - asr.asp_subaddr.address_format = T_ATM_ABSENT; - asr.asp_subaddr.address_length = 0; - asr.asp_nprefix = uip->uip_nprefix; - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&asr, buf_addr, sizeof(asr))) != 0) - break; - buf_addr += sizeof(asr); - buf_len -= sizeof(asr); - - /* - * Copy the prefix list into the user's buffer - */ - if (uip->uip_nprefix) { - tlen = uip->uip_nprefix * - sizeof(struct uniarp_prf); - if (buf_len < tlen) { - err = ENOSPC; - break; - } - err = copyout(uip->uip_prefix, buf_addr, tlen); - if (err != 0) - break; - buf_addr += tlen; - buf_len -= tlen; - } - } - - /* - * Update the buffer pointer and length - */ - aip->air_buf_addr = buf_addr; - aip->air_buf_len = buf_len; - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} - - -/* - * Get Connection's Application/Owner Name - * - * Arguments: - * tok uniarp connection token (pointer to ipvcc) - * - * Returns: - * addr pointer to string containing our name - * - */ -caddr_t -uniarp_getname(tok) - void *tok; -{ - return ("ATMARP"); -} - Property changes on: head/sys/netatm/uni/uniarp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_subr.c =================================================================== --- head/sys/netatm/uni/unisig_subr.c (revision 179307) +++ head/sys/netatm/uni/unisig_subr.c (nonexistent) @@ -1,1323 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/* - * External variables - */ -extern struct ie_aalp ie_aalp_absent; -extern struct ie_clrt ie_clrt_absent; -extern struct ie_bbcp ie_bbcp_absent; -extern struct ie_bhli ie_bhli_absent; -extern struct ie_blli ie_blli_absent; -extern struct ie_clst ie_clst_absent; -extern struct ie_cdad ie_cdad_absent; -extern struct ie_cdsa ie_cdsa_absent; -extern struct ie_cgad ie_cgad_absent; -extern struct ie_cgsa ie_cgsa_absent; -extern struct ie_caus ie_caus_absent; -extern struct ie_cnid ie_cnid_absent; -extern struct ie_qosp ie_qosp_absent; -extern struct ie_brpi ie_brpi_absent; -extern struct ie_rsti ie_rsti_absent; -extern struct ie_blsh ie_blsh_absent; -extern struct ie_bnsh ie_bnsh_absent; -extern struct ie_bsdc ie_bsdc_absent; -extern struct ie_trnt ie_trnt_absent; -extern struct ie_eprf ie_eprf_absent; -extern struct ie_epst ie_epst_absent; - - -/* - * Set a User Location cause code in an ATM attribute block - * - * Arguments: - * aap pointer to attribute block - * cause cause code - * - * Returns: - * none - * - */ -void -unisig_cause_attr_from_user(aap, cause) - Atm_attributes *aap; - int cause; -{ - if (cause == T_ATM_ABSENT) - return; - - /* - * Set the fields in the attribute block - */ - aap->cause.tag = T_ATM_PRESENT; - aap->cause.v.coding_standard = T_ATM_ITU_CODING; - aap->cause.v.location = T_ATM_LOC_USER; - aap->cause.v.cause_value = cause; - bzero(aap->cause.v.diagnostics, - sizeof(aap->cause.v.diagnostics)); -} - - -/* - * Set a cause code in an ATM attribute block from a Cause IE - * - * Arguments: - * aap pointer to attribute block - * iep pointer to Cause IE - * - * Returns: - * none - * - */ -void -unisig_cause_attr_from_ie(aap, iep) - Atm_attributes *aap; - struct ie_generic *iep; -{ - /* - * Set the fields in the attribute block - */ - aap->cause.tag = T_ATM_PRESENT; - aap->cause.v.coding_standard = iep->ie_coding; - aap->cause.v.location = iep->ie_caus_loc; - aap->cause.v.cause_value = iep->ie_caus_cause; - bzero(aap->cause.v.diagnostics, sizeof(aap->cause.v.diagnostics)); - bcopy(iep->ie_caus_diagnostic, aap->cause.v.diagnostics, - MIN(sizeof(aap->cause.v.diagnostics), iep->ie_caus_diag_len)); -} - - -/* - * Open a UNI VCC - * - * Called when a user wants to open a VC. This function will construct - * a VCCB and, if we are opening an SVC, call the Q.2931 VC state - * machine. The user will have to wait for a notify event to be sure - * the SVC is fully open. - * - * Must be called at splnet. - * - * Arguments: - * usp pointer to UNISIG protocol instance - * cvp pointer to connection parameters for the VCC - * - * Returns: - * 0 VCC creation successful - * errno VCC setup failed - reason indicated - * - */ -int -unisig_open_vcc(usp, cvp) - struct unisig *usp; - Atm_connvc *cvp; -{ - struct atm_pif *pip = usp->us_pif; - struct unisig_vccb *uvp; - Atm_addr_pvc *pvp; - int err, pvc; - - ATM_DEBUG2("unisig_open_vcc: usp=%p, cvp=%p\n", usp, cvp); - - /* - * Validate user parameters. AAL and encapsulation are - * checked by the connection manager - */ - - /* - * Check called party address(es) - */ - if(cvp->cvc_attr.called.tag != T_ATM_PRESENT || - cvp->cvc_attr.called.addr.address_format == - T_ATM_ABSENT) { - return(EINVAL); - } - switch (cvp->cvc_attr.called.addr.address_format) { - case T_ATM_PVC_ADDR: - /* - * Make sure VPI/VCI is valid - */ - pvc = 1; - pvp = (Atm_addr_pvc *)cvp->cvc_attr.called.addr.address; - if ((ATM_PVC_GET_VPI(pvp) > pip->pif_maxvpi) || - (ATM_PVC_GET_VCI(pvp) == 0) || - (ATM_PVC_GET_VCI(pvp) > pip->pif_maxvci)) { - return(ERANGE); - } - - /* - * Make sure VPI/VCI is not already in use - */ - if (unisig_find_vpvc(usp, - ATM_PVC_GET_VPI(pvp), - ATM_PVC_GET_VCI(pvp), 0)) { - return(EEXIST); - } - ATM_DEBUG2("unisig_open_vcc: VPI.VCI=%d.%d\n", - ATM_PVC_GET_VPI(pvp), - ATM_PVC_GET_VCI(pvp)); - break; - - case T_ATM_ENDSYS_ADDR: - /* - * Check signalling state - */ - pvc = 0; - pvp = NULL; - if (usp->us_state != UNISIG_ACTIVE) { - return(ENETDOWN); - } - - /* - * Make sure there's no subaddress - */ - if (cvp->cvc_attr.called.subaddr.address_format != - T_ATM_ABSENT) { - return(EINVAL); - } - break; - - case T_ATM_E164_ADDR: - /* - * Check signalling state - */ - pvc = 0; - pvp = NULL; - if (usp->us_state != UNISIG_ACTIVE) { - return(ENETDOWN); - } - - /* - * Check destination address format - */ - if (cvp->cvc_attr.called.subaddr.address_format != - T_ATM_ENDSYS_ADDR && - cvp->cvc_attr.called.subaddr.address_format != - T_ATM_ABSENT) { - return(EINVAL); - } - break; - - default: - return(EPROTONOSUPPORT); - } - - /* - * Check that this is for the same interface UNISIG uses - */ - if (!cvp->cvc_attr.nif || - cvp->cvc_attr.nif->nif_pif != usp->us_pif) { - return(EINVAL); - } - - /* - * Allocate control block for VCC - * May be called from timeout - don't wait. - */ - uvp = uma_zalloc(unisig_vc_zone, M_NOWAIT | M_ZERO); - if (uvp == NULL) { - return(ENOMEM); - } - - /* - * Fill in VCCB - */ - if (pvc) { - uvp->uv_type = VCC_PVC | VCC_IN | VCC_OUT; - uvp->uv_vpi = ATM_PVC_GET_VPI(pvp); - uvp->uv_vci = ATM_PVC_GET_VCI(pvp); - uvp->uv_sstate = (usp->us_state == UNISIG_ACTIVE ? - UNI_PVC_ACTIVE : UNI_PVC_ACT_DOWN); - uvp->uv_ustate = VCCU_OPEN; - } else { - uvp->uv_type = VCC_SVC | VCC_IN | VCC_OUT; - uvp->uv_sstate = UNI_NULL; - uvp->uv_ustate = VCCU_POPEN; - } - uvp->uv_proto = usp->us_pif->pif_sigmgr->sm_proto; - uvp->uv_pif = usp->us_pif; - uvp->uv_nif = cvp->cvc_attr.nif; - uvp->uv_connvc = cvp; - uvp->uv_tstamp = time_second; - - /* - * Put VCCB on UNISIG queue - */ - ENQUEUE(uvp, struct unisig_vccb, uv_sigelem, usp->us_vccq); - - /* - * Call the VC state machine if this is an SVC - */ - if (!pvc) { - err = unisig_vc_state(usp, uvp, UNI_VC_SETUP_CALL, - (struct unisig_msg *) 0); - if (err) { - /* - * On error, delete the VCCB - */ - DEQUEUE(uvp, struct unisig_vccb, uv_sigelem, - usp->us_vccq); - uma_zfree(unisig_vc_zone, uvp); - return(err); - } - } - - /* - * Link VCCB to VCC connection block - */ - cvp->cvc_vcc = (struct vccb *) uvp; - - return(0); -} - - -/* - * Close a UNISIG VCC - * - * Called when a user wants to close a VCC. This function will clean - * up the VCCB and, for an SVC, send a close request. - * - * Must be called at splnet. - * - * Arguments: - * usp pointer to UNISIG protocol instance - * uvp pointer to VCCB for the VCC to be closed - * - * Returns: - * 0 VCC is now closed - * errno error encountered - */ -int -unisig_close_vcc(usp, uvp) - struct unisig *usp; - struct unisig_vccb *uvp; -{ - int err = 0; - - ATM_DEBUG2("unisig_close_vcc: uvp=%p, state=%d\n", uvp, - uvp->uv_sstate); - - /* - * Check that this is for the same interface UNISIG uses - */ - if (uvp->uv_pif != usp->us_pif) { - return (EINVAL); - } - - /* - * Mark the close time. - */ - uvp->uv_tstamp = time_second; - - /* - * Process based on the connection type - */ - if (uvp->uv_type & VCC_PVC) { - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - } else if (uvp->uv_type & VCC_SVC) { - /* - * Call the VC state machine - */ - uvp->uv_ustate = VCCU_CLOSED; - err = unisig_vc_state(usp, uvp, UNI_VC_RELEASE_CALL, - (struct unisig_msg *) 0); - } - - /* - * Wait for user to free resources - */ - return(err); -} - - -/* - * Clear a UNISIG VCC - * - * Called to internally clear a VCC. No external protocol is - * initiated, the VCC is just closed and the owner is notified. - * - * Must be called at splnet. - * - * Arguments: - * usp pointer to UNISIG protocol instance - * uvp pointer to VCCB for the VCC to be closed - * cause cause code giving the reason for the close - * - * Returns: - * 0 VCC is closed - * errno error encountered - */ -int -unisig_clear_vcc(usp, uvp, cause) - struct unisig *usp; - struct unisig_vccb *uvp; - int cause; -{ - u_char outstate; - - ATM_DEBUG3("unisig_clear_vcc: uvp=%p, state=%d, cause=%d\n", - uvp, uvp->uv_sstate, cause); - - /* - * Check that this is for the same interface UNISIG uses - */ - if (uvp->uv_pif != usp->us_pif) { - return (EINVAL); - } - - /* - * Kill any possible timer - */ - UNISIG_VC_CANCEL((struct vccb *) uvp); - - /* - * Mark the close time. - */ - uvp->uv_tstamp = time_second; - - /* - * Close the VCC and notify the user - */ - outstate = uvp->uv_sstate; - uvp->uv_sstate = UNI_FREE; - uvp->uv_ustate = VCCU_CLOSED; - if (outstate == UNI_ACTIVE || - outstate == UNI_CALL_INITIATED || - outstate == UNI_CALL_OUT_PROC || - outstate == UNI_CONNECT_REQUEST || - outstate == UNI_RELEASE_REQUEST || - outstate == UNI_RELEASE_IND || - outstate == UNI_SSCF_RECOV || - outstate == UNI_PVC_ACT_DOWN || - outstate == UNI_PVC_ACTIVE) { - unisig_cause_attr_from_user(&uvp->uv_connvc->cvc_attr, cause); - atm_cm_cleared(uvp->uv_connvc); - } - - /* - * Wait for user to free resources - */ - return(0); -} - - -#ifdef NOTDEF -/* - * Reset the switch state - * - * Arguments: - * usp pointer to UNISIG protocol instance - * - * Returns: - * none - * - */ -void -unisig_switch_reset(usp, cause) - struct unisig *usp; - int cause; -{ - int s; - struct unisig_vccb *uvp, *vnext; - - ATM_DEBUG2("unisig_switch_reset: usp=%p, cause=%d\n", - usp, cause); - - /* - * Terminate all of our VCCs - */ - s = splnet(); - for (uvp = Q_HEAD(usp->us_vccq, struct unisig_vccb); uvp; - uvp = vnext) { - vnext = Q_NEXT(uvp, struct unisig_vccb, uv_sigelem); - - if (uvp->uv_type & VCC_SVC) { - /* - * Close the SVC and notify the owner - */ - (void)unisig_clear_vcc(usp, uvp, - T_ATM_CAUSE_NORMAL_CALL_CLEARING); - } else if (uvp->uv_type & VCC_PVC) { - /* - * Notify PVC owner of the state change - */ - switch(cause) { - case UNI_DOWN: - uvp->uv_sstate = UNI_PVC_ACT_DOWN; - break; - case UNI_UP: - uvp->uv_sstate = UNI_PVC_ACTIVE; - break; - } - atm_cm_cleared(uvp->uv_connvc, cause); - } else { - log(LOG_ERR, "unisig: invalid VCC type: vccb=%p, type=%d\n", - uvp, uvp->uv_type); - } - } - (void) splx(s); -} -#endif - - -/* - * Copy connection parameters from UNI 3.0 message IEs into - * an attribute block - * - * Arguments: - * usp pointer to UNISIG protocol instance - * msg pointer to the SETUP message - * ap pointer to the attribute block - * - * Returns: - * none - * - */ -void -unisig_save_attrs(usp, msg, ap) - struct unisig *usp; - struct unisig_msg *msg; - Atm_attributes *ap; -{ - /* - * Sanity check - */ - if (!msg || !ap) - return; - - /* - * Save the AAL parameters (AAL 3/4 and AAL 5 only) - */ - if (msg->msg_ie_aalp) { - struct ie_generic *aalp = msg->msg_ie_aalp; - - switch(msg->msg_ie_aalp->ie_aalp_aal_type) { - case UNI_IE_AALP_AT_AAL3: - ap->aal.tag = T_ATM_PRESENT; - ap->aal.type = - msg->msg_ie_aalp->ie_aalp_aal_type; - ap->aal.v.aal4.forward_max_SDU_size = - msg->msg_ie_aalp->ie_aalp_4_fwd_max_sdu; - ap->aal.v.aal4.backward_max_SDU_size = - msg->msg_ie_aalp->ie_aalp_4_bkwd_max_sdu; - ap->aal.v.aal4.SSCS_type = - msg->msg_ie_aalp->ie_aalp_4_sscs_type; - if (aalp->ie_aalp_4_mid_range == T_ATM_ABSENT) { - ap->aal.v.aal4.mid_low = T_ATM_ABSENT; - ap->aal.v.aal4.mid_high = T_ATM_ABSENT; - } else { - if (usp->us_proto == ATM_SIG_UNI30) { - ap->aal.v.aal4.mid_low = 0; - ap->aal.v.aal4.mid_high = - aalp->ie_aalp_4_mid_range - & UNI_IE_AALP_A3_R_MASK; - } else { - ap->aal.v.aal4.mid_low = - (aalp->ie_aalp_4_mid_range >> - UNI_IE_AALP_A3_R_SHIFT) - & UNI_IE_AALP_A3_R_MASK; - ap->aal.v.aal4.mid_high = - aalp->ie_aalp_4_mid_range - & UNI_IE_AALP_A3_R_MASK; - } - } - break; - case UNI_IE_AALP_AT_AAL5: - ap->aal.tag = T_ATM_PRESENT; - ap->aal.type = - msg->msg_ie_aalp->ie_aalp_aal_type; - ap->aal.v.aal5.forward_max_SDU_size = - msg->msg_ie_aalp->ie_aalp_5_fwd_max_sdu; - ap->aal.v.aal5.backward_max_SDU_size = - msg->msg_ie_aalp->ie_aalp_5_bkwd_max_sdu; - ap->aal.v.aal5.SSCS_type = - msg->msg_ie_aalp->ie_aalp_5_sscs_type; - break; - } - } - - /* - * Save traffic descriptor attributes - */ - if (msg->msg_ie_clrt) { - ap->traffic.tag = T_ATM_PRESENT; - ap->traffic.v.forward.PCR_high_priority = - msg->msg_ie_clrt->ie_clrt_fwd_peak; - ap->traffic.v.forward.PCR_all_traffic = - msg->msg_ie_clrt->ie_clrt_fwd_peak_01; - ap->traffic.v.forward.SCR_high_priority = - msg->msg_ie_clrt->ie_clrt_fwd_sust; - ap->traffic.v.forward.SCR_all_traffic = - msg->msg_ie_clrt->ie_clrt_fwd_sust_01; - ap->traffic.v.forward.MBS_high_priority = - msg->msg_ie_clrt->ie_clrt_fwd_burst; - ap->traffic.v.forward.MBS_all_traffic = - msg->msg_ie_clrt->ie_clrt_fwd_burst_01; - ap->traffic.v.backward.PCR_high_priority = - msg->msg_ie_clrt->ie_clrt_bkwd_peak; - ap->traffic.v.backward.PCR_all_traffic = - msg->msg_ie_clrt->ie_clrt_bkwd_peak_01; - ap->traffic.v.backward.SCR_high_priority = - msg->msg_ie_clrt->ie_clrt_bkwd_sust; - ap->traffic.v.backward.SCR_all_traffic = - msg->msg_ie_clrt->ie_clrt_bkwd_sust_01; - ap->traffic.v.backward.MBS_high_priority = - msg->msg_ie_clrt->ie_clrt_bkwd_burst; - ap->traffic.v.backward.MBS_all_traffic = - msg->msg_ie_clrt->ie_clrt_bkwd_burst_01; - ap->traffic.v.best_effort = - msg->msg_ie_clrt->ie_clrt_best_effort; - if (msg->msg_ie_clrt->ie_clrt_tm_options == - T_ATM_ABSENT) { - ap->traffic.v.forward.tagging = T_NO; - ap->traffic.v.backward.tagging = T_NO; - } else { - ap->traffic.v.forward.tagging = - (msg->msg_ie_clrt->ie_clrt_tm_options & - UNI_IE_CLRT_TM_FWD_TAG) != 0; - ap->traffic.v.backward.tagging = - (msg->msg_ie_clrt->ie_clrt_tm_options & - UNI_IE_CLRT_TM_BKWD_TAG) != 0; - } - } - - /* - * Save broadband bearer attributes - */ - if (msg->msg_ie_bbcp) { - ap->bearer.tag = T_ATM_PRESENT; - ap->bearer.v.bearer_class = - msg->msg_ie_bbcp->ie_bbcp_bearer_class; - ap->bearer.v.traffic_type = - msg->msg_ie_bbcp->ie_bbcp_traffic_type; - ap->bearer.v.timing_requirements = - msg->msg_ie_bbcp->ie_bbcp_timing_req; - ap->bearer.v.clipping_susceptibility = - msg->msg_ie_bbcp->ie_bbcp_clipping; - ap->bearer.v.connection_configuration = - msg->msg_ie_bbcp->ie_bbcp_conn_config; - } - - /* - * Save broadband high layer attributes - */ - if (msg->msg_ie_bhli) { - ap->bhli.tag = T_ATM_PRESENT; - ap->bhli.v.ID_type = msg->msg_ie_bhli->ie_bhli_type; - switch(ap->bhli.v.ID_type) { - case T_ATM_ISO_APP_ID: - bcopy(msg->msg_ie_bhli->ie_bhli_info, - ap->bhli.v.ID.ISO_ID, - sizeof(ap->bhli.v.ID.ISO_ID)); - break; - case T_ATM_USER_APP_ID: - bcopy(msg->msg_ie_bhli->ie_bhli_info, - ap->bhli.v.ID.user_defined_ID, - sizeof(ap->bhli.v.ID.user_defined_ID)); - break; - case T_ATM_VENDOR_APP_ID: - bcopy(msg->msg_ie_bhli->ie_bhli_info, - ap->bhli.v.ID.vendor_ID.OUI, - sizeof(ap->bhli.v.ID.vendor_ID.OUI)); - bcopy(&msg->msg_ie_bhli->ie_bhli_info[sizeof(ap->bhli.v.ID.vendor_ID.OUI)-1], - ap->bhli.v.ID.vendor_ID.app_ID, - sizeof(ap->bhli.v.ID.vendor_ID.app_ID)); - break; - } - } - - /* - * Save Broadband low layer, user layer 2 and 3 attributes - */ - if (msg->msg_ie_blli) { - /* - * Layer 2 parameters - */ - switch(msg->msg_ie_blli->ie_blli_l2_id) { - case UNI_IE_BLLI_L2P_ISO1745: - case UNI_IE_BLLI_L2P_Q921: - case UNI_IE_BLLI_L2P_X25L: - case UNI_IE_BLLI_L2P_X25M: - case UNI_IE_BLLI_L2P_LAPB: - case UNI_IE_BLLI_L2P_HDLC1: - case UNI_IE_BLLI_L2P_HDLC2: - case UNI_IE_BLLI_L2P_HDLC3: - case UNI_IE_BLLI_L2P_LLC: - case UNI_IE_BLLI_L2P_X75: - case UNI_IE_BLLI_L2P_Q922: - case UNI_IE_BLLI_L2P_ISO7776: - ap->blli.tag_l2 = T_ATM_PRESENT; - ap->blli.v.layer_2_protocol.ID_type = - T_ATM_SIMPLE_ID; - ap->blli.v.layer_2_protocol.ID.simple_ID = - msg->msg_ie_blli->ie_blli_l2_id; - break; - case UNI_IE_BLLI_L2P_USER: - ap->blli.tag_l2 = T_ATM_PRESENT; - ap->blli.v.layer_2_protocol.ID_type = - T_ATM_USER_ID; - ap->blli.v.layer_2_protocol.ID.user_defined_ID = - msg->msg_ie_blli->ie_blli_l2_user_proto; - break; - default: - ap->blli.tag_l2 = T_ATM_ABSENT; - } - if (ap->blli.tag_l2 == T_ATM_PRESENT) { - ap->blli.v.layer_2_protocol.mode = - msg->msg_ie_blli->ie_blli_l2_mode; - ap->blli.v.layer_2_protocol.window_size = - msg->msg_ie_blli->ie_blli_l2_window; - } - - /* - * Layer 3 parameters - */ - switch(msg->msg_ie_blli->ie_blli_l3_id) { - case UNI_IE_BLLI_L3P_X25: - case UNI_IE_BLLI_L3P_ISO8208: - case UNI_IE_BLLI_L3P_ISO8878: - case UNI_IE_BLLI_L3P_ISO8473: - case UNI_IE_BLLI_L3P_T70: - ap->blli.tag_l3 = T_ATM_PRESENT; - ap->blli.v.layer_3_protocol.ID_type = - T_ATM_SIMPLE_ID; - ap->blli.v.layer_3_protocol.ID.simple_ID = - msg->msg_ie_blli->ie_blli_l3_id; - break; - case UNI_IE_BLLI_L3P_ISO9577: - ap->blli.tag_l3 = T_ATM_PRESENT; - ap->blli.v.layer_3_protocol.ID_type = - T_ATM_SIMPLE_ID; - ap->blli.v.layer_3_protocol.ID.simple_ID = - msg->msg_ie_blli->ie_blli_l3_id; - if (msg->msg_ie_blli->ie_blli_l3_ipi == - UNI_IE_BLLI_L3IPI_SNAP) { - bcopy(msg->msg_ie_blli->ie_blli_l3_oui, - ap->blli.v.layer_3_protocol.ID.SNAP_ID.OUI, - sizeof(ap->blli.v.layer_3_protocol.ID.SNAP_ID.OUI)); - bcopy(msg->msg_ie_blli->ie_blli_l3_pid, - ap->blli.v.layer_3_protocol.ID.SNAP_ID.PID, - sizeof(ap->blli.v.layer_3_protocol.ID.SNAP_ID.PID)); - } else { - ap->blli.v.layer_3_protocol.ID.IPI_ID = - msg->msg_ie_blli->ie_blli_l3_ipi; - } - break; - case UNI_IE_BLLI_L3P_USER: - ap->blli.tag_l3 = T_ATM_PRESENT; - ap->blli.v.layer_3_protocol.ID_type = - T_ATM_USER_ID; - ap->blli.v.layer_3_protocol.ID.user_defined_ID = - msg->msg_ie_blli->ie_blli_l3_user_proto; - break; - default: - ap->blli.tag_l3 = T_ATM_ABSENT; - } - if (ap->blli.tag_l3 == T_ATM_PRESENT) { - ap->blli.v.layer_3_protocol.mode = - msg->msg_ie_blli->ie_blli_l3_mode; - ap->blli.v.layer_3_protocol.packet_size = - msg->msg_ie_blli->ie_blli_l3_packet_size; - ap->blli.v.layer_3_protocol.window_size = - msg->msg_ie_blli->ie_blli_l3_window; - } - } - - /* - * Save the called party address and subaddress - */ - if (msg->msg_ie_cdad) { - ap->called.tag = T_ATM_PRESENT; - ATM_ADDR_COPY(&msg->msg_ie_cdad->ie_cdad_addr, - &ap->called.addr); - ap->called.subaddr.address_format = T_ATM_ABSENT; - ap->called.subaddr.address_length = 0; - } - if (msg->msg_ie_cdsa) { - ATM_ADDR_COPY(&msg->msg_ie_cdsa->ie_cdsa_addr, - &ap->called.subaddr); - } - - /* - * Save the calling party address and subaddress - */ - if (msg->msg_ie_cgad) { - ap->calling.tag = T_ATM_PRESENT; - ATM_ADDR_COPY(&msg->msg_ie_cgad->ie_cgad_addr, - &ap->calling.addr); - ap->calling.subaddr.address_format = T_ATM_ABSENT; - ap->calling.subaddr.address_length = 0; - } - - if (msg->msg_ie_cgsa) { - ATM_ADDR_COPY(&msg->msg_ie_cgsa->ie_cgsa_addr, - &ap->calling.subaddr); - } - - /* - * Save quality of service attributes - */ - if (msg->msg_ie_qosp) { - ap->qos.tag = T_ATM_PRESENT; - ap->qos.v.coding_standard = msg->msg_ie_qosp->ie_coding; - ap->qos.v.forward.qos_class = msg->msg_ie_qosp->ie_qosp_fwd_class; - ap->qos.v.forward.qos_class = - msg->msg_ie_qosp->ie_qosp_bkwd_class; - } - - /* - * Save transit network attributes - */ - if (msg->msg_ie_trnt) { - ap->transit.tag = T_ATM_PRESENT; - ap->transit.v.length = - MIN(msg->msg_ie_trnt->ie_trnt_id_len, - sizeof(ap->transit.v.network_id)); - bcopy(msg->msg_ie_trnt->ie_trnt_id, - ap->transit.v.network_id, - ap->transit.v.length); - } - - /* - * Save cause code - */ - if (msg->msg_ie_caus) { - ap->cause.tag = T_ATM_PRESENT; - ap->cause.v.coding_standard = - msg->msg_ie_caus->ie_coding; - ap->cause.v.location = - msg->msg_ie_caus->ie_caus_loc; - ap->cause.v.cause_value = - msg->msg_ie_caus->ie_caus_cause; - bzero(ap->cause.v.diagnostics, - sizeof(ap->cause.v.diagnostics)); -#ifdef NOTDEF - bcopy(msg->msg_ie_caus->ie_caus_diagnostic, - ap->transit.v.diagnostics, - MIN(sizeof(ap->transit.v.diagnostics), - msg->msg_ie_caus->ie_caus_diag_len)); -#endif - } -} - - -/* - * Copy connection parameters from an attribute block into - * UNI 3.0 message IEs - * - * Arguments: - * usp pointer to UNISIG protocol instance - * msg pointer to the SETUP message - * ap pointer to the attribute block - * - * Returns: - * 0 everything OK - * else error encountered - * - * May be called from timeout so make allocations non-waiting - */ -int -unisig_set_attrs(usp, msg, ap) - struct unisig *usp; - struct unisig_msg *msg; - Atm_attributes *ap; -{ - int err = 0; - - /* - * Sanity check - */ - if (!msg || !ap) - return(EINVAL); - - /* - * Set the AAL parameters (AAL 3/4 and AAL 5 only) - */ - if (ap->aal.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_aalp) { - msg->msg_ie_aalp = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_aalp == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_aalp_absent, - &msg->msg_ie_aalp->ie_u.ie_aalp, - sizeof(ie_aalp_absent)); - msg->msg_ie_aalp->ie_ident = UNI_IE_AALP; - msg->msg_ie_aalp->ie_aalp_aal_type = ap->aal.type; - switch(ap->aal.type) { - case ATM_AAL3_4: - msg->msg_ie_aalp->ie_aalp_4_fwd_max_sdu = - ap->aal.v.aal4.forward_max_SDU_size; - msg->msg_ie_aalp->ie_aalp_4_bkwd_max_sdu = - ap->aal.v.aal4.backward_max_SDU_size; - msg->msg_ie_aalp->ie_aalp_4_mode = UNI_IE_AALP_A5_M_MSG; - msg->msg_ie_aalp->ie_aalp_4_sscs_type = - ap->aal.v.aal4.SSCS_type; - if (ap->aal.v.aal4.mid_low == T_ATM_ABSENT) { - msg->msg_ie_aalp->ie_aalp_4_mid_range = - T_ATM_ABSENT; - } else { - if (usp->us_proto == ATM_SIG_UNI30) { - msg->msg_ie_aalp->ie_aalp_4_mid_range = - ap->aal.v.aal4.mid_high & - UNI_IE_AALP_A3_R_MASK; - } else { - msg->msg_ie_aalp->ie_aalp_4_mid_range = - ((ap->aal.v.aal4.mid_low & - UNI_IE_AALP_A3_R_MASK) - << UNI_IE_AALP_A3_R_SHIFT) - | - (ap->aal.v.aal4.mid_high & - UNI_IE_AALP_A3_R_MASK); - } - } - break; - case ATM_AAL5: - msg->msg_ie_aalp->ie_aalp_5_fwd_max_sdu = - ap->aal.v.aal5.forward_max_SDU_size; - msg->msg_ie_aalp->ie_aalp_5_bkwd_max_sdu = - ap->aal.v.aal5.backward_max_SDU_size; - msg->msg_ie_aalp->ie_aalp_5_mode = - UNI_IE_AALP_A5_M_MSG; - msg->msg_ie_aalp->ie_aalp_5_sscs_type = - ap->aal.v.aal5.SSCS_type; - break; - } - } - - /* - * Set traffic descriptor attributes - */ - if (ap->traffic.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_clrt) { - msg->msg_ie_clrt = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_clrt == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_clrt_absent, - &msg->msg_ie_clrt->ie_u.ie_clrt, - sizeof(ie_clrt_absent)); - msg->msg_ie_clrt->ie_ident = UNI_IE_CLRT; - msg->msg_ie_clrt->ie_clrt_fwd_peak = - ap->traffic.v.forward.PCR_high_priority; - msg->msg_ie_clrt->ie_clrt_fwd_peak_01 = - ap->traffic.v.forward.PCR_all_traffic; - msg->msg_ie_clrt->ie_clrt_fwd_sust = - ap->traffic.v.forward.SCR_high_priority; - msg->msg_ie_clrt->ie_clrt_fwd_sust_01 = - ap->traffic.v.forward.SCR_all_traffic; - msg->msg_ie_clrt->ie_clrt_fwd_burst = - ap->traffic.v.forward.MBS_high_priority; - msg->msg_ie_clrt->ie_clrt_fwd_burst_01 = - ap->traffic.v.forward.MBS_all_traffic; - msg->msg_ie_clrt->ie_clrt_bkwd_peak = - ap->traffic.v.backward.PCR_high_priority; - msg->msg_ie_clrt->ie_clrt_bkwd_peak_01 = - ap->traffic.v.backward.PCR_all_traffic; - msg->msg_ie_clrt->ie_clrt_bkwd_sust = - ap->traffic.v.backward.SCR_high_priority; - msg->msg_ie_clrt->ie_clrt_bkwd_sust_01 = - ap->traffic.v.backward.SCR_all_traffic; - msg->msg_ie_clrt->ie_clrt_bkwd_burst = - ap->traffic.v.backward.MBS_high_priority; - msg->msg_ie_clrt->ie_clrt_bkwd_burst_01 = - ap->traffic.v.backward.MBS_all_traffic; - msg->msg_ie_clrt->ie_clrt_best_effort = - ap->traffic.v.best_effort; - msg->msg_ie_clrt->ie_clrt_tm_options = 0; - if (ap->traffic.v.forward.tagging) { - msg->msg_ie_clrt->ie_clrt_tm_options |= - UNI_IE_CLRT_TM_FWD_TAG; - } - if (ap->traffic.v.backward.tagging) { - msg->msg_ie_clrt->ie_clrt_tm_options |= - UNI_IE_CLRT_TM_BKWD_TAG; - } - if (msg->msg_ie_clrt->ie_clrt_tm_options == 0) { - msg->msg_ie_clrt->ie_clrt_tm_options = - T_ATM_ABSENT; - } - } - - /* - * Set broadband bearer attributes - */ - if (ap->bearer.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_bbcp) { - msg->msg_ie_bbcp = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_bbcp == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_bbcp_absent, - &msg->msg_ie_bbcp->ie_u.ie_bbcp, - sizeof(ie_bbcp_absent)); - msg->msg_ie_bbcp->ie_ident = UNI_IE_BBCP; - msg->msg_ie_bbcp->ie_bbcp_bearer_class = - ap->bearer.v.bearer_class; - msg->msg_ie_bbcp->ie_bbcp_traffic_type = - ap->bearer.v.traffic_type; - msg->msg_ie_bbcp->ie_bbcp_timing_req = - ap->bearer.v.timing_requirements; - msg->msg_ie_bbcp->ie_bbcp_clipping = - ap->bearer.v.clipping_susceptibility; - msg->msg_ie_bbcp->ie_bbcp_conn_config = - ap->bearer.v.connection_configuration; - } - - /* - * Set broadband high layer attributes - */ - if (ap->bhli.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_bhli) { - msg->msg_ie_bhli = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_bhli == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_bhli_absent, - &msg->msg_ie_bhli->ie_u.ie_bhli, - sizeof(ie_bhli_absent)); - msg->msg_ie_bhli->ie_ident = UNI_IE_BHLI; - msg->msg_ie_bhli->ie_bhli_type = ap->bhli.v.ID_type; - switch (ap->bhli.v.ID_type) { - case T_ATM_ISO_APP_ID: - bcopy(ap->bhli.v.ID.ISO_ID, - msg->msg_ie_bhli->ie_bhli_info, - sizeof(ap->bhli.v.ID.ISO_ID)); - break; - case T_ATM_USER_APP_ID: - bcopy(ap->bhli.v.ID.user_defined_ID, - msg->msg_ie_bhli->ie_bhli_info, - sizeof(ap->bhli.v.ID.user_defined_ID)); - break; - case T_ATM_VENDOR_APP_ID: - bcopy(ap->bhli.v.ID.vendor_ID.OUI, - msg->msg_ie_bhli->ie_bhli_info, - sizeof(ap->bhli.v.ID.vendor_ID.OUI)); - bcopy(ap->bhli.v.ID.vendor_ID.app_ID, - &msg->msg_ie_bhli->ie_bhli_info[sizeof(ap->bhli.v.ID.vendor_ID.OUI)-1], - sizeof(ap->bhli.v.ID.vendor_ID.app_ID)); - break; - } - } - - /* - * Set Broadband low layer, user layer 2 and 3 attributes - */ - if (ap->blli.tag_l2 == T_ATM_PRESENT || - ap->blli.tag_l3 == T_ATM_PRESENT) { - if (!msg->msg_ie_blli) { - msg->msg_ie_blli = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_blli == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_blli_absent, - &msg->msg_ie_blli->ie_u.ie_blli, - sizeof(ie_blli_absent)); - msg->msg_ie_blli->ie_ident = UNI_IE_BLLI; - - if (ap->blli.tag_l2 == T_ATM_PRESENT) { - switch(ap->blli.v.layer_2_protocol.ID_type) { - case T_ATM_SIMPLE_ID: - msg->msg_ie_blli->ie_blli_l2_id = - ap->blli.v.layer_2_protocol.ID.simple_ID; - break; - case T_ATM_USER_ID: - msg->msg_ie_blli->ie_blli_l2_id = - UNI_IE_BLLI_L2P_USER; - msg->msg_ie_blli->ie_blli_l2_user_proto = - ap->blli.v.layer_2_protocol.ID.user_defined_ID; - break; - } - if (ap->blli.v.layer_2_protocol.ID_type != - T_ATM_ABSENT) { - msg->msg_ie_blli->ie_blli_l2_mode = - ap->blli.v.layer_2_protocol.mode; - msg->msg_ie_blli->ie_blli_l2_window = - ap->blli.v.layer_2_protocol.window_size; - } - } - - if (ap->blli.tag_l3 == T_ATM_PRESENT) { - switch (ap->blli.v.layer_3_protocol.ID_type) { - case T_ATM_SIMPLE_ID: - msg->msg_ie_blli->ie_blli_l3_id = - ap->blli.v.layer_3_protocol.ID.simple_ID; - break; - - case T_ATM_IPI_ID: - msg->msg_ie_blli->ie_blli_l3_id = - UNI_IE_BLLI_L3P_ISO9577; - msg->msg_ie_blli->ie_blli_l3_ipi = - ap->blli.v.layer_3_protocol.ID.IPI_ID; - break; - - case T_ATM_SNAP_ID: - msg->msg_ie_blli->ie_blli_l3_id = - UNI_IE_BLLI_L3P_ISO9577; - msg->msg_ie_blli->ie_blli_l3_ipi = - UNI_IE_BLLI_L3IPI_SNAP; - bcopy(ap->blli.v.layer_3_protocol.ID.SNAP_ID.OUI, - msg->msg_ie_blli->ie_blli_l3_oui, - sizeof(msg->msg_ie_blli->ie_blli_l3_oui)); - bcopy(ap->blli.v.layer_3_protocol.ID.SNAP_ID.PID, - msg->msg_ie_blli->ie_blli_l3_pid, - sizeof(msg->msg_ie_blli->ie_blli_l3_pid)); - break; - - case T_ATM_USER_ID: - msg->msg_ie_blli->ie_blli_l3_id = - UNI_IE_BLLI_L3P_USER; - msg->msg_ie_blli->ie_blli_l3_user_proto = - ap->blli.v.layer_3_protocol.ID.user_defined_ID; - break; - } - if (ap->blli.v.layer_3_protocol.ID_type - != T_ATM_ABSENT) { - msg->msg_ie_blli->ie_blli_l3_mode = - ap->blli.v.layer_3_protocol.mode; - msg->msg_ie_blli->ie_blli_l3_packet_size = - ap->blli.v.layer_3_protocol.packet_size; - msg->msg_ie_blli->ie_blli_l3_window = - ap->blli.v.layer_3_protocol.window_size; - } - } - } - - /* - * Set the called party address and subaddress - */ - if (ap->called.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_cdad) { - msg->msg_ie_cdad = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_cdad == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_cdad_absent, - &msg->msg_ie_cdad->ie_u.ie_cdad, - sizeof(ie_cdad_absent)); - msg->msg_ie_cdad->ie_ident = UNI_IE_CDAD; - ATM_ADDR_COPY(&ap->called.addr, - &msg->msg_ie_cdad->ie_cdad_addr); - - if (ap->called.subaddr.address_format != T_ATM_ABSENT) { - if (!msg->msg_ie_cdsa) { - msg->msg_ie_cdsa = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_cdsa == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_cdsa_absent, - &msg->msg_ie_cdsa->ie_u.ie_cdsa, - sizeof(ie_cdsa_absent)); - msg->msg_ie_cdsa->ie_ident = UNI_IE_CDSA; - ATM_ADDR_COPY(&ap->called.subaddr, - &msg->msg_ie_cdsa->ie_cdsa_addr); - } - } - - /* - * Set the calling party address and subaddress - */ - - if (ap->calling.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_cgad) { - msg->msg_ie_cgad = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_cgad == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_cgad_absent, - &msg->msg_ie_cgad->ie_u.ie_cgad, - sizeof(ie_cgad_absent)); - msg->msg_ie_cgad->ie_ident = UNI_IE_CGAD; - ATM_ADDR_COPY(&ap->calling.addr, - &msg->msg_ie_cgad->ie_cgad_addr); - - if (ap->calling.subaddr.address_format != - T_ATM_ABSENT) { - if (!msg->msg_ie_cgsa) { - msg->msg_ie_cgsa = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_cgsa == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_cgsa_absent, - &msg->msg_ie_cgsa->ie_u.ie_cgsa, - sizeof(ie_cgsa_absent)); - msg->msg_ie_cgsa->ie_ident = UNI_IE_CGSA; - ATM_ADDR_COPY(&ap->calling.subaddr, - &msg->msg_ie_cgsa->ie_cgsa_addr); - } - } - - /* - * Set quality of service attributes - */ - if (ap->qos.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_qosp) { - msg->msg_ie_qosp = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_qosp == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_qosp_absent, - &msg->msg_ie_qosp->ie_u.ie_qosp, - sizeof(ie_qosp_absent)); - msg->msg_ie_qosp->ie_ident = UNI_IE_QOSP; - if (usp->us_proto == ATM_SIG_UNI30) - msg->msg_ie_qosp->ie_coding = UNI_IE_CODE_STD; - else if ((ap->qos.v.forward.qos_class == - T_ATM_QOS_CLASS_0) || - (ap->qos.v.backward.qos_class == - T_ATM_QOS_CLASS_0)) - msg->msg_ie_qosp->ie_coding = UNI_IE_CODE_CCITT; - else - msg->msg_ie_qosp->ie_coding = ap->qos.v.coding_standard; - msg->msg_ie_qosp->ie_qosp_fwd_class = - ap->qos.v.forward.qos_class; - msg->msg_ie_qosp->ie_qosp_bkwd_class = - ap->qos.v.backward.qos_class; - } - - /* - * Set transit network attributes - */ - if (ap->transit.tag == T_ATM_PRESENT && - ap->transit.v.length != 0) { - if (!msg->msg_ie_trnt) { - msg->msg_ie_trnt = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_trnt == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_trnt_absent, - &msg->msg_ie_trnt->ie_u.ie_trnt, - sizeof(ie_trnt_absent)); - msg->msg_ie_trnt->ie_ident = UNI_IE_TRNT; - msg->msg_ie_trnt->ie_trnt_id_type = - UNI_IE_TRNT_IDT_NATL; - msg->msg_ie_trnt->ie_trnt_id_plan = - UNI_IE_TRNT_IDP_CIC; - bcopy(ap->transit.v.network_id, - msg->msg_ie_trnt->ie_trnt_id, - ap->transit.v.length); - } - - /* - * Set cause code - */ - if (ap->cause.tag == T_ATM_PRESENT) { - if (!msg->msg_ie_caus) { - msg->msg_ie_caus = uma_zalloc(unisig_ie_zone, - M_NOWAIT | M_ZERO); - if (msg->msg_ie_caus == NULL) { - err = ENOMEM; - goto done; - } - } - bcopy(&ie_caus_absent, - &msg->msg_ie_caus->ie_u.ie_caus, - sizeof(ie_caus_absent)); - msg->msg_ie_caus->ie_ident = UNI_IE_CAUS; - msg->msg_ie_caus->ie_coding = - ap->cause.v.coding_standard; - msg->msg_ie_caus->ie_caus_loc = - ap->cause.v.location; - msg->msg_ie_caus->ie_caus_cause = - ap->cause.v.cause_value; - - /* - * Don't copy the diagnostics from the attribute - * block, as there's no way to tell how much of - * the diagnostic field is relevant - */ - msg->msg_ie_caus->ie_caus_diag_len = 0; - } - -done: - return(err); -} Property changes on: head/sys/netatm/uni/unisig_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_decode.c =================================================================== --- head/sys/netatm/uni/unisig_decode.c (revision 179307) +++ head/sys/netatm/uni/unisig_decode.c (nonexistent) @@ -1,2486 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message formatting module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define ALLOC_IE(ie) do { \ - (ie) = uma_zalloc(unisig_ie_zone, M_NOWAIT | M_ZERO); \ - if ((ie) == NULL) \ - return (ENOMEM); \ -} while (0) - -/* - * Local functions - */ -static int usf_dec_ie(struct usfmt *, struct unisig_msg *, struct ie_generic *); -static int usf_dec_ie_hdr(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_aalp(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_clrt(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_bbcp(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_bhli(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_blli(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_clst(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_cdad(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_cdsa(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_cgad(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_cgsa(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_caus(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_cnid(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_qosp(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_brpi(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_rsti(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_bsdc(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_trnt(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_uimp(struct usfmt *, struct ie_generic *); -static int usf_dec_ie_ident(struct usfmt *, struct ie_generic *, - struct ie_decode_tbl *); -static int usf_dec_atm_addr(struct usfmt *, Atm_addr *, int); - - -/* - * Table associating IE type with IE vector index - */ -u_char unisig_ie_ident_vec[] = { - UNI_IE_AALP, - UNI_IE_CLRT, - UNI_IE_BBCP, - UNI_IE_BHLI, - UNI_IE_BLLI, - UNI_IE_CLST, - UNI_IE_CDAD, - UNI_IE_CDSA, - UNI_IE_CGAD, - UNI_IE_CGSA, - UNI_IE_CAUS, - UNI_IE_CNID, - UNI_IE_QOSP, - UNI_IE_BRPI, - UNI_IE_RSTI, - UNI_IE_BLSH, - UNI_IE_BNSH, - UNI_IE_BSDC, - UNI_IE_TRNT, - UNI_IE_EPRF, - UNI_IE_EPST -}; - - -/* - * Tables specifying which IEs are mandatory, optional, and - * not allowed for each Q.2931 message type - */ -static u_char uni_calp_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_OPT, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_OPT, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_conn_ie_tbl[] = { - IE_OPT, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_OPT, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_OPT, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_OPT, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_cack_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_NA, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_setu_ie_tbl[] = { - IE_MAND, /* ATM AAL Parameters (not required by - UNI 3.0) */ - IE_MAND, /* ATM User Cell Rate */ - IE_MAND, /* Broadband Bearer Capability */ - IE_OPT, /* Broadband High Layer Information */ - IE_MAND, /* Broadband Low Layer Information (not required by UNI 3.0 */ - IE_NA, /* Call State */ - IE_MAND, /* Called Party Number */ - IE_OPT, /* Called Party Subaddress */ - IE_OPT, /* Calling Party Number */ - IE_OPT, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_MAND, /* Connection Identifier */ - IE_MAND, /* Quality of Service Parameters */ - IE_OPT, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_OPT, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_OPT, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_rlse_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_MAND, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_NA, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_rlsc_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_MAND, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_NA, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_rstr_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_OPT, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_MAND, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_NA, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_rsta_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_OPT, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_MAND, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_NA, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_stat_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_MAND, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_MAND, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_OPT, /* Endpoint Reference */ - IE_OPT /* Endpoint State */ -}; - -static u_char uni_senq_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_OPT, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_addp_ie_tbl[] = { - IE_OPT, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_OPT, /* Broadband High Layer Information */ - IE_OPT, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_MAND, /* Called Party Number */ - IE_OPT, /* Called Party Subaddress */ - IE_OPT, /* Calling Party Number */ - IE_OPT, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_OPT, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_MAND, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_adpa_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_NA, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_MAND, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_adpr_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_MAND, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_MAND, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_drpp_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_MAND, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_MAND, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -static u_char uni_drpa_ie_tbl[] = { - IE_NA, /* ATM AAL Parameters */ - IE_NA, /* ATM User Cell Rate */ - IE_NA, /* Broadband Bearer Capability */ - IE_NA, /* Broadband High Layer Information */ - IE_NA, /* Broadband Low Layer Information */ - IE_NA, /* Call State */ - IE_NA, /* Called Party Number */ - IE_NA, /* Called Party Subaddress */ - IE_NA, /* Calling Party Number */ - IE_NA, /* Calling Party Subaddress */ - IE_OPT, /* Cause */ - IE_NA, /* Connection Identifier */ - IE_NA, /* Quality of Service Parameters */ - IE_NA, /* Broadband Repeat Indicator */ - IE_NA, /* Restart Indicator */ - IE_NA, /* Broadband Locking Shift */ - IE_NA, /* Broadband Non-locking Shift */ - IE_NA, /* Broadband Sending Complete */ - IE_NA, /* Transit Net */ - IE_MAND, /* Endpoint Reference */ - IE_NA /* Endpoint State */ -}; - -/* - * Table of Q.2931 message types - */ -static struct { - u_char msg_type; - u_char *msg_ie_tbl; -} uni_msg_types[] = { - { UNI_MSG_CALP, uni_calp_ie_tbl }, - { UNI_MSG_CONN, uni_conn_ie_tbl }, - { UNI_MSG_CACK, uni_cack_ie_tbl }, - { UNI_MSG_SETU, uni_setu_ie_tbl }, - { UNI_MSG_RLSE, uni_rlse_ie_tbl }, - { UNI_MSG_RLSC, uni_rlsc_ie_tbl }, - { UNI_MSG_RSTR, uni_rstr_ie_tbl }, - { UNI_MSG_RSTA, uni_rsta_ie_tbl }, - { UNI_MSG_STAT, uni_stat_ie_tbl }, - { UNI_MSG_SENQ, uni_senq_ie_tbl }, - { UNI_MSG_ADDP, uni_addp_ie_tbl }, - { UNI_MSG_ADPA, uni_adpa_ie_tbl }, - { UNI_MSG_ADPR, uni_adpr_ie_tbl }, - { UNI_MSG_DRPP, uni_drpp_ie_tbl }, - { UNI_MSG_DRPA, uni_drpa_ie_tbl }, -}; - - -/* - * Table of information elements - */ -static struct ie_ent ie_table[] = { - { UNI_IE_AALP, 5, 16, UNI_MSG_IE_AALP, usf_dec_ie_aalp }, - { UNI_IE_CLRT, 0, 26, UNI_MSG_IE_CLRT, usf_dec_ie_clrt }, - { UNI_IE_BBCP, 2, 3, UNI_MSG_IE_BBCP, usf_dec_ie_bbcp }, - { UNI_IE_BHLI, 1, 9, UNI_MSG_IE_BHLI, usf_dec_ie_bhli }, - { UNI_IE_BLLI, 0, 13, UNI_MSG_IE_BLLI, usf_dec_ie_blli }, - { UNI_IE_CLST, 1, 1, UNI_MSG_IE_CLST, usf_dec_ie_clst }, - { UNI_IE_CDAD, 1, 21, UNI_MSG_IE_CDAD, usf_dec_ie_cdad }, - { UNI_IE_CDSA, 1, 21, UNI_MSG_IE_CDSA, usf_dec_ie_cdsa }, - { UNI_IE_CGAD, 1, 22, UNI_MSG_IE_CGAD, usf_dec_ie_cgad }, - { UNI_IE_CGSA, 1, 21, UNI_MSG_IE_CGSA, usf_dec_ie_cgsa }, - { UNI_IE_CAUS, 2, 30, UNI_MSG_IE_CAUS, usf_dec_ie_caus }, - { UNI_IE_CNID, 5, 5, UNI_MSG_IE_CNID, usf_dec_ie_cnid }, - { UNI_IE_QOSP, 2, 2, UNI_MSG_IE_QOSP, usf_dec_ie_qosp }, - { UNI_IE_BRPI, 1, 1, UNI_MSG_IE_BRPI, usf_dec_ie_brpi }, - { UNI_IE_RSTI, 1, 1, UNI_MSG_IE_RSTI, usf_dec_ie_rsti }, - { UNI_IE_BLSH, 1, 1, UNI_MSG_IE_ERR, usf_dec_ie_uimp }, - { UNI_IE_BNSH, 1, 1, UNI_MSG_IE_ERR, usf_dec_ie_uimp }, - { UNI_IE_BSDC, 1, 1, UNI_MSG_IE_BSDC, usf_dec_ie_bsdc }, - { UNI_IE_TRNT, 1, 5, UNI_MSG_IE_TRNT, usf_dec_ie_trnt }, - { UNI_IE_EPRF, 3, 3, UNI_MSG_IE_ERR, usf_dec_ie_uimp }, - { UNI_IE_EPST, 1, 1, UNI_MSG_IE_ERR, usf_dec_ie_uimp }, - { 0, 0, 0, 0, 0 } -}; - -/* - * Decoding table for AAL 1 - */ -struct ie_decode_tbl ie_aal1_tbl[] = { - { 133, 1, IE_OFF_SIZE(ie_aalp_1_subtype) }, - { 134, 1, IE_OFF_SIZE(ie_aalp_1_cbr_rate) }, - { 135, 2, IE_OFF_SIZE(ie_aalp_1_multiplier) }, - { 136, 1, IE_OFF_SIZE(ie_aalp_1_clock_recovery) }, - { 137, 1, IE_OFF_SIZE(ie_aalp_1_error_correction) }, - { 138, 1, IE_OFF_SIZE(ie_aalp_1_struct_data_tran) }, - { 139, 1, IE_OFF_SIZE(ie_aalp_1_partial_cells) }, - { 0, 0, 0, 0 } -}; - -/* - * Decoding table for AAL 3/4 - */ -struct ie_decode_tbl ie_aal4_tbl_30[] = { - { 140, 2, IE_OFF_SIZE(ie_aalp_4_fwd_max_sdu) }, - { 129, 2, IE_OFF_SIZE(ie_aalp_4_bkwd_max_sdu) }, - { 130, 2, IE_OFF_SIZE(ie_aalp_4_mid_range) }, - { 131, 1, IE_OFF_SIZE(ie_aalp_4_mode) }, - { 132, 1, IE_OFF_SIZE(ie_aalp_4_sscs_type) }, - { 0, 0, 0, 0 } -}; -struct ie_decode_tbl ie_aal4_tbl_31[] = { - { 140, 2, IE_OFF_SIZE(ie_aalp_4_fwd_max_sdu) }, - { 129, 2, IE_OFF_SIZE(ie_aalp_4_bkwd_max_sdu) }, - { 130, 4, IE_OFF_SIZE(ie_aalp_4_mid_range) }, - { 132, 1, IE_OFF_SIZE(ie_aalp_4_sscs_type) }, - { 0, 0, 0, 0 } -}; - -/* - * Decoding table for AAL 5 - */ -struct ie_decode_tbl ie_aal5_tbl_30[] = { - { 140, 2, IE_OFF_SIZE(ie_aalp_5_fwd_max_sdu) }, - { 129, 2, IE_OFF_SIZE(ie_aalp_5_bkwd_max_sdu) }, - { 131, 1, IE_OFF_SIZE(ie_aalp_5_mode) }, - { 132, 1, IE_OFF_SIZE(ie_aalp_5_sscs_type) }, - { 0, 0, 0, 0 } -}; -struct ie_decode_tbl ie_aal5_tbl_31[] = { - { 140, 2, IE_OFF_SIZE(ie_aalp_5_fwd_max_sdu) }, - { 129, 2, IE_OFF_SIZE(ie_aalp_5_bkwd_max_sdu) }, - { 132, 1, IE_OFF_SIZE(ie_aalp_5_sscs_type) }, - { 0, 0, 0, 0 } -}; - -/* - * Decoding table for ATM user cell rate - */ -struct ie_decode_tbl ie_clrt_tbl[] = { - {UNI_IE_CLRT_FWD_PEAK_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_peak)}, - {UNI_IE_CLRT_BKWD_PEAK_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_peak)}, - {UNI_IE_CLRT_FWD_PEAK_01_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_peak_01)}, - {UNI_IE_CLRT_BKWD_PEAK_01_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_peak_01)}, - {UNI_IE_CLRT_FWD_SUST_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_sust)}, - {UNI_IE_CLRT_BKWD_SUST_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_sust)}, - {UNI_IE_CLRT_FWD_SUST_01_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_sust_01)}, - {UNI_IE_CLRT_BKWD_SUST_01_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_sust_01)}, - {UNI_IE_CLRT_FWD_BURST_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_burst)}, - {UNI_IE_CLRT_BKWD_BURST_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_burst)}, - {UNI_IE_CLRT_FWD_BURST_01_ID, 3, IE_OFF_SIZE(ie_clrt_fwd_burst_01)}, - {UNI_IE_CLRT_BKWD_BURST_01_ID, 3, IE_OFF_SIZE(ie_clrt_bkwd_burst_01)}, - {UNI_IE_CLRT_BEST_EFFORT_ID, 0, IE_OFF_SIZE(ie_clrt_best_effort)}, - {UNI_IE_CLRT_TM_OPTIONS_ID, 1, IE_OFF_SIZE(ie_clrt_tm_options)}, - {0, 0, 0, 0 } -}; - -/* - * IEs initialized to empty values - */ -struct ie_aalp ie_aalp_absent = { - T_ATM_ABSENT -}; - -struct ie_clrt ie_clrt_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT -}; - -struct ie_bbcp ie_bbcp_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT -}; - -struct ie_bhli ie_bhli_absent = { - T_ATM_ABSENT, - { 0, 0, 0, 0, 0, 0, 0, 0 } -}; - -struct ie_blli ie_blli_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - { 0, 0, 0 }, - { 0, 0 } -}; - -struct ie_clst ie_clst_absent = { - T_ATM_ABSENT -}; - -struct ie_cdad ie_cdad_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - { T_ATM_ABSENT, 0 } -}; - -struct ie_cdsa ie_cdsa_absent = { - { T_ATM_ABSENT, 0 } -}; - -struct ie_cgad ie_cgad_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - { T_ATM_ABSENT, 0 } -}; - -struct ie_cgsa ie_cgsa_absent = { - { T_ATM_ABSENT, 0 } -}; - -struct ie_caus ie_caus_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - 0 -}; - -struct ie_cnid ie_cnid_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT -}; - -struct ie_qosp ie_qosp_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT -}; - -struct ie_brpi ie_brpi_absent = { - T_ATM_ABSENT -}; - -struct ie_rsti ie_rsti_absent = { - T_ATM_ABSENT -}; - -struct ie_blsh ie_blsh_absent = { - T_ATM_ABSENT -}; - -struct ie_bnsh ie_bnsh_absent = { - T_ATM_ABSENT -}; - -struct ie_bsdc ie_bsdc_absent = { - T_ATM_ABSENT -}; - -struct ie_trnt ie_trnt_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT, - 0 -}; - -struct ie_eprf ie_eprf_absent = { - T_ATM_ABSENT, - T_ATM_ABSENT -}; - -struct ie_epst ie_epst_absent = { - T_ATM_ABSENT -}; - - -/* - * Decode a UNI signalling message - * - * Arguments: - * usf pointer to a unisig formatting structure - * msg pointer to a signalling message structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_dec_msg(usf, msg) - struct usfmt *usf; - struct unisig_msg *msg; -{ - int i, len, rc; - short s; - u_char c, *ie_tbl; - struct ie_generic *ie; - - ATM_DEBUG2("usf_dec_msg: usf=%p, msg=%p\n", usf, msg); - - /* - * Check the total message length - */ - if (usf_count(usf) < UNI_MSG_MIN_LEN) { - return(EIO); - } - - /* - * Get and check the protocol discriminator - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - if (c != UNI_MSG_DISC_Q93B) - return(EIO); - - /* - * Get and check the call reference length - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - if (c != 3) - return(EIO); - - /* - * Get the call reference - */ - rc = usf_int3(usf, &msg->msg_call_ref); - if (rc) - return(rc); - - /* - * Get the message type - */ - rc = usf_byte(usf, &msg->msg_type); - if (rc) - return(rc); - - /* - * Get the message type extension - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - msg->msg_type_flag = (c >> UNI_MSG_TYPE_FLAG_SHIFT) & - UNI_MSG_TYPE_FLAG_MASK; - msg->msg_type_action = c & UNI_MSG_TYPE_ACT_MASK; - - /* - * Get the message length and make sure we actually have - * enough data for the whole message - */ - rc = usf_short(usf, &s); - if (rc) - return(rc); - msg->msg_length = s; - if (usf_count(usf) != msg->msg_length) { - return(EMSGSIZE); - } - - /* - * Process information elements - */ - len = msg->msg_length; - while (len) { - ALLOC_IE(ie); - rc = usf_dec_ie(usf, msg, ie); - if (rc) { - uma_zfree(unisig_ie_zone, ie); - return(rc); - } - len -= (ie->ie_length + UNI_IE_HDR_LEN); - } - - /* - * Make sure that mandatory IEs are included and - * unwanted ones aren't - */ - for (i=0; msg->msg_type!=uni_msg_types[i].msg_type && - uni_msg_types[i].msg_type!=0; i++) { - } - if (!uni_msg_types[i].msg_ie_tbl) - goto done; - - /* - * If the message type is in the table, check the IEs. - * If it isn't, the receive routine will catch the error. - */ - ie_tbl = uni_msg_types[i].msg_ie_tbl; - for (i=0; imsg_ie_vec[i]) { - /* - * Mandatory IE missing - */ - ALLOC_IE(ie); - ie->ie_ident = unisig_ie_ident_vec[i]; - ie->ie_err_cause = UNI_IE_CAUS_MISSING; - MSG_IE_ADD(msg, ie, UNI_MSG_IE_ERR); - } - break; - case IE_NA: - if (msg->msg_ie_vec[i]) { - /* - * Disallowed IE present - */ - ie = msg->msg_ie_vec[i]; - msg->msg_ie_vec[i] = - (struct ie_generic *) 0; - MSG_IE_ADD(msg, ie, UNI_MSG_IE_ERR); - while (ie) { - ie->ie_err_cause = - UNI_IE_CAUS_IEEXIST; - ie = ie->ie_next; - } - } - break; - case IE_OPT: - break; - } - } - -done: - return(0); -} - - -/* - * Decode an information element - * - * This routine will be called repeatedly as long as there are - * information elements left to be decoded. It will decode the - * first part of the IE, look its type up in a table, and call - * the appropriate routine to decode the rest. After an IE is - * successfully decoded, it is linked into the UNI signalling - * message structure. If an error is discovered, the IE is linked - * into the IE error chain and an error cause is set in the header. - * - * Arguments: - * usf pointer to a UNISIG formatting structure - * msg pointer to a UNISIG message structure - * ie pointer to a generic IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie(usf, msg, ie) - struct usfmt *usf; - struct unisig_msg *msg; - struct ie_generic *ie; -{ - int i, ie_index, rc; - - /* - * Decode the IE header (identifier, instruction field, - * and length) - */ - rc = usf_dec_ie_hdr(usf, ie); - if (rc) - return(rc); - /* - * Ignore the IE if it is of zero length. - */ - if (!ie->ie_length) { - uma_zfree(unisig_ie_zone, ie); - return(0); - } - - /* - * Look up the information element in the table - */ - for (i=0; (ie->ie_ident != ie_table[i].ident) && - (ie_table[i].decode != NULL); i++) { - } - if (ie_table[i].decode == NULL) { - /* - * Unrecognized IE - */ - ie_index = UNI_MSG_IE_ERR; - } else { - ie_index = ie_table[i].p_idx; - } - - /* - * Check for unimplemented or unrecognized IEs - */ - if (ie_index == UNI_MSG_IE_ERR) { - ie->ie_err_cause = UNI_IE_CAUS_IEEXIST; - - /* - * Skip over the invalid IE - */ - rc = usf_dec_ie_uimp(usf, ie); - if (rc) - return(rc); - goto done; - } - - /* - * Check the length against the IE table - */ - if (ie->ie_length < ie_table[i].min_len || - ie->ie_length > ie_table[i].max_len) { - ie_index = UNI_MSG_IE_ERR; - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - - /* - * Skip over the invalid IE - */ - rc = usf_dec_ie_uimp(usf, ie); - if (rc) - return(rc); - goto done; - } - - /* - * Process the IE by calling the function indicated - * in the IE table - */ - rc = ie_table[i].decode(usf, ie); - if (rc) - return(rc); - - /* - * Link the IE into the signalling message - */ -done: - if (ie->ie_err_cause) { - ie_index = UNI_MSG_IE_ERR; - } - MSG_IE_ADD(msg, ie, ie_index); - - return(0); -} - - -/* - * Decode an information element header - * - * Arguments: - * usf pointer to a UNISIG formatting structure - * ie pointer to a generic IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_hdr(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c; - short s; - int rc; - - /* - * Get the IE identifier - */ - rc = usf_byte(usf, &ie->ie_ident); - if (rc) - return(rc); - - /* - * Get the extended type - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_coding = (c >> UNI_IE_CODE_SHIFT) & UNI_IE_CODE_MASK; - ie->ie_flag = (c >> UNI_IE_FLAG_SHIFT) & UNI_IE_FLAG_MASK; - ie->ie_action = c & UNI_IE_ACT_MASK; - - /* - * Get the length. - */ - rc = usf_short(usf, &s); - if (rc) - return(rc); - ie->ie_length = s; - - return(0); -} - - -/* - * Decode an AAL parameters information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to an AAL parms IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_aalp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc = 0; - - /* - * Clear the IE - */ - bcopy(&ie_aalp_absent, &ie->ie_u.ie_aalp, - sizeof(ie_aalp_absent)); - - /* - * Get the AAL type - */ - rc = usf_byte(usf, &ie->ie_aalp_aal_type); - if (rc) - return(rc); - - /* - * Subtract the length of the AAL type from the total. - * It will be readjusted after usf_dec_ie_ident is finished. - */ - ie->ie_length--; - - /* - * Process based on AAL type - */ - switch (ie->ie_aalp_aal_type) { - case UNI_IE_AALP_AT_AAL1: - /* - * Clear the AAL 1 subparameters - */ - ie->ie_aalp_1_subtype = T_ATM_ABSENT; - ie->ie_aalp_1_cbr_rate = T_ATM_ABSENT; - ie->ie_aalp_1_multiplier = T_ATM_ABSENT; - ie->ie_aalp_1_clock_recovery = T_ATM_ABSENT; - ie->ie_aalp_1_error_correction = T_ATM_ABSENT; - ie->ie_aalp_1_struct_data_tran = T_ATM_ABSENT; - ie->ie_aalp_1_partial_cells = T_ATM_ABSENT; - - /* - * Parse the AAL fields based on their IDs - */ - rc = usf_dec_ie_ident(usf, ie, ie_aal1_tbl); - break; - case UNI_IE_AALP_AT_AAL3: - /* - * Clear the AAL 3/4 subparameters - */ - ie->ie_aalp_4_fwd_max_sdu = T_ATM_ABSENT; - ie->ie_aalp_4_bkwd_max_sdu = T_ATM_ABSENT; - ie->ie_aalp_4_mid_range = T_ATM_ABSENT; - ie->ie_aalp_4_mode = T_ATM_ABSENT; - ie->ie_aalp_4_sscs_type = T_ATM_ABSENT; - - /* - * Parse the AAL fields based on their IDs - */ - if (usf->usf_sig->us_proto == ATM_SIG_UNI30) - rc = usf_dec_ie_ident(usf, ie, ie_aal4_tbl_30); - else - rc = usf_dec_ie_ident(usf, ie, ie_aal4_tbl_31); - - /* - * If either forward or backward maximum SDU - * size is specified, the other must also be - * specified. - */ - if ((ie->ie_aalp_4_fwd_max_sdu != T_ATM_ABSENT && - ie->ie_aalp_4_bkwd_max_sdu == T_ATM_ABSENT) || - (ie->ie_aalp_4_fwd_max_sdu == T_ATM_ABSENT && - ie->ie_aalp_4_bkwd_max_sdu != T_ATM_ABSENT)) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - } - break; - case UNI_IE_AALP_AT_AAL5: - /* - * Clear the AAL 5 subparameters - */ - ie->ie_aalp_5_fwd_max_sdu = T_ATM_ABSENT; - ie->ie_aalp_5_bkwd_max_sdu = T_ATM_ABSENT; - ie->ie_aalp_5_mode = T_ATM_ABSENT; - ie->ie_aalp_5_sscs_type = T_ATM_ABSENT; - - /* - * Parse the AAL fields based on their IDs - */ - if (usf->usf_sig->us_proto == ATM_SIG_UNI30) - rc = usf_dec_ie_ident(usf, ie, ie_aal5_tbl_30); - else - rc = usf_dec_ie_ident(usf, ie, ie_aal5_tbl_31); - - /* - * If either forward or backward maximum SDU - * size is specified, the other must also be - * specified. - */ - if ((ie->ie_aalp_5_fwd_max_sdu != T_ATM_ABSENT && - ie->ie_aalp_5_bkwd_max_sdu == T_ATM_ABSENT) || - (ie->ie_aalp_5_fwd_max_sdu == T_ATM_ABSENT && - ie->ie_aalp_5_bkwd_max_sdu != T_ATM_ABSENT)) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - } - break; - case UNI_IE_AALP_AT_AALU: - /* - * Check user parameter length - */ - if (ie->ie_length > - sizeof(ie->ie_aalp_user_info) + - 1) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - } - - /* - * Get the user data - */ - i = 0; - while (i < ie->ie_length - 2) { - rc = usf_byte(usf, &ie->ie_aalp_user_info[i]); - if (rc) - break; - i++; - } - break; - default: - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - } - ie->ie_length++; - - return(rc); -} - - -/* - * Decode a user cell rate information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_clrt(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - - /* - * Clear the IE - */ - bcopy(&ie_clrt_absent, &ie->ie_u.ie_clrt, - sizeof(ie_clrt_absent)); - - /* - * Parse the IE using field identifiers - */ - rc = usf_dec_ie_ident(usf, ie, ie_clrt_tbl); - return(rc); -} - - -/* - * Decode a broadband bearer capability information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_bbcp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_bbcp_absent, &ie->ie_u.ie_bbcp, - sizeof(ie_bbcp_absent)); - - /* - * Get the broadband bearer class - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_bbcp_bearer_class = c & UNI_IE_BBCP_BC_MASK; - - /* - * If the broadband bearer class was X, the next - * byte has the traffic type and timing requirements - */ - if (ie->ie_bbcp_bearer_class == UNI_IE_BBCP_BC_BCOB_X && - !(c & UNI_IE_EXT_BIT)) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_bbcp_traffic_type = (c >> UNI_IE_BBCP_TT_SHIFT) & - UNI_IE_BBCP_TT_MASK; - ie->ie_bbcp_timing_req = c & UNI_IE_BBCP_TR_MASK; - } - - /* - * Get the clipping and user plane connection configuration - */ - if (c & UNI_IE_EXT_BIT) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_bbcp_clipping = (c >> UNI_IE_BBCP_SC_SHIFT) & - UNI_IE_BBCP_SC_MASK; - ie->ie_bbcp_conn_config = c & UNI_IE_BBCP_CC_MASK; - } - - return(0); -} - - -/* - * Decode a broadband high layer information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_bhli(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_bhli_absent, &ie->ie_u.ie_bhli, - sizeof(ie_bhli_absent)); - - /* - * Get the high layer information type - */ - rc = usf_ext(usf, &i); - ie->ie_bhli_type = i & UNI_IE_EXT_MASK; - if (rc) - return(rc); - - /* - * What comes next depends on the type - */ - switch (ie->ie_bhli_type) { - case UNI_IE_BHLI_TYPE_ISO: - case UNI_IE_BHLI_TYPE_USER: - /* - * ISO or user-specified parameters -- take the - * length of information from the IE length - */ - for (i=0; iie_length-1; i++) { - rc = usf_byte(usf, &ie->ie_bhli_info[i]); - if (rc) - return(rc); - } - break; - case UNI_IE_BHLI_TYPE_HLP: - /* - * Make sure the IE is long enough for the high - * layer profile information, then get it - */ - if (usf->usf_sig->us_proto != ATM_SIG_UNI30) - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - if (ie->ie_length < UNI_IE_BHLI_HLP_LEN+1) - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - for (i=0; iie_length && - iie_bhli_info[i]); - if (rc) - return(rc); - } - break; - case UNI_IE_BHLI_TYPE_VSA: - /* - * Make sure the IE is long enough for the vendor- - * specific application information, then get it - */ - if (ie->ie_length < UNI_IE_BHLI_VSA_LEN+1) - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - for (i=0; iie_length && - iie_bhli_info[i]); - if (rc) - return(rc); - } - break; - default: - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - for (i=0; iie_length; i++) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - } - } - - return(0); -} - - -/* - * Decode a broadband low layer information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_blli(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - u_char c, id; - int bc, i, rc; - u_int ipi; - - /* - * Clear the IE - */ - bcopy(&ie_blli_absent, &ie->ie_u.ie_blli, - sizeof(ie_blli_absent)); - - /* - * Get paramteters for the protocol layers as long as - * there is still information left in the IE - */ - bc = ie->ie_length; - while (bc) { - /* - * Get the type and process based on what it is - */ - rc = usf_byte(usf, &id); - if (rc) - return(rc); - switch (((id & UNI_IE_EXT_MASK) >> - UNI_IE_BLLI_LID_SHIFT) & - UNI_IE_BLLI_LID_MASK) { - case UNI_IE_BLLI_L1_ID: - /* - * Layer 1 info - */ - ie->ie_blli_l1_id = id & UNI_IE_BLLI_LP_MASK; - bc--; - break; - case UNI_IE_BLLI_L2_ID: - /* - * Layer 2 info--contents vary based on type - */ - ie->ie_blli_l2_id = id & UNI_IE_BLLI_LP_MASK; - bc--; - if (id & UNI_IE_EXT_BIT) - break; - switch (ie->ie_blli_l2_id) { - case UNI_IE_BLLI_L2P_X25L: - case UNI_IE_BLLI_L2P_X25M: - case UNI_IE_BLLI_L2P_HDLC1: - case UNI_IE_BLLI_L2P_HDLC2: - case UNI_IE_BLLI_L2P_HDLC3: - case UNI_IE_BLLI_L2P_Q922: - case UNI_IE_BLLI_L2P_ISO7776: - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l2_mode = (c >> - UNI_IE_BLLI_L2MODE_SHIFT) & - UNI_IE_BLLI_L2MODE_MASK; - if (!(c & UNI_IE_EXT_BIT)) - break; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l2_window = - c & UNI_IE_EXT_MASK; - break; - case UNI_IE_BLLI_L2P_USER: - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l2_user_proto = - c & UNI_IE_EXT_MASK; - break; - } - break; - case UNI_IE_BLLI_L3_ID: - /* - * Layer 3 info--contents vary based on type - */ - ie->ie_blli_l3_id = id & UNI_IE_BLLI_LP_MASK; - bc--; - switch (ie->ie_blli_l3_id) { - case UNI_IE_BLLI_L3P_X25: - case UNI_IE_BLLI_L3P_ISO8208: - case UNI_IE_BLLI_L3P_ISO8878: - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l3_mode = (c >> - UNI_IE_BLLI_L3MODE_SHIFT) & - UNI_IE_BLLI_L3MODE_MASK; - if (!(c & UNI_IE_EXT_BIT)) - break; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l3_packet_size = - c & UNI_IE_BLLI_L3PS_MASK; - if (!(c & UNI_IE_EXT_BIT)) - break; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l3_window = - c & UNI_IE_EXT_MASK; - break; - case UNI_IE_BLLI_L3P_USER: - rc = usf_byte(usf, &c); - if (rc) - return(rc); - bc--; - ie->ie_blli_l3_mode = - c & UNI_IE_EXT_MASK; - break; - case UNI_IE_BLLI_L3P_ISO9577: - rc = usf_ext(usf, &ipi); - if (rc) - return(rc); - bc -= 2; - ie->ie_blli_l3_ipi = ipi >> - UNI_IE_BLLI_L3IPI_SHIFT; - if (ie->ie_blli_l3_ipi != - UNI_IE_BLLI_L3IPI_SNAP) - break; - - rc = usf_byte(usf, &c); - ie->ie_blli_l3_snap_id = c & UNI_IE_EXT_MASK; - if (rc) - return(rc); - bc --; - - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[0]); - if (rc) - return(rc); - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[1]); - if (rc) - return(rc); - rc = usf_byte(usf, - &ie->ie_blli_l3_oui[2]); - if (rc) - return(rc); - rc = usf_byte(usf, - &ie->ie_blli_l3_pid[0]); - if (rc) - return(rc); - rc = usf_byte(usf, - &ie->ie_blli_l3_pid[1]); - if (rc) - return(rc); - bc -= 5; - break; - } - break; - default: - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - for (i=0; iie_length; i++) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - } - } - } - - return(0); -} - - -/* - * Decode a call state information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_clst(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_clst_absent, &ie->ie_u.ie_clst, - sizeof(ie_clst_absent)); - - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_clst_state = c & UNI_IE_CLST_STATE_MASK; - - return(0); -} - - -/* - * Decode a called party number information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_cdad(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_cdad_absent, &ie->ie_u.ie_cdad, - sizeof(ie_cdad_absent)); - - /* - * Get and check the numbering plan - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_cdad_plan = c & UNI_IE_CDAD_PLAN_MASK; - len = ie->ie_length - 1; - switch (ie->ie_cdad_plan) { - case UNI_IE_CDAD_PLAN_E164: - ie->ie_cdad_addr.address_format = T_ATM_E164_ADDR; - break; - case UNI_IE_CDAD_PLAN_NSAP: - ie->ie_cdad_addr.address_format = T_ATM_ENDSYS_ADDR; - break; - default: - /* - * Invalid numbering plan - */ - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - } - - return(0); - } - - /* - * Get the ATM address - */ - rc = usf_dec_atm_addr(usf, &ie->ie_cdad_addr, len); - if (rc == EINVAL) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - rc = 0; - } - - return(rc); -} - - -/* - * Decode a called party subaddress information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_cdsa(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_cdsa_absent, &ie->ie_u.ie_cdsa, - sizeof(ie_cdsa_absent)); - - /* - * Get and check the subaddress type - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len = ie->ie_length - 1; - if (((c >> UNI_IE_CDSA_TYPE_SHIFT) & UNI_IE_CDSA_TYPE_MASK) != - UNI_IE_CDSA_TYPE_AESA) { - /* - * Invalid subaddress type - */ - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - } - - return(0); - } - - /* - * Get the ATM address - */ - ie->ie_cdsa_addr.address_format = T_ATM_ENDSYS_ADDR; - rc = usf_dec_atm_addr(usf, &ie->ie_cdsa_addr, len); - if (rc == EINVAL) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - rc = 0; - } - - return(rc); -} - - -/* - * Decode a calling party number information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_cgad(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_cgad_absent, &ie->ie_u.ie_cgad, - sizeof(ie_cgad_absent)); - - /* - * Get and check the numbering plan - */ - len = ie->ie_length; - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_cgad_type = (c >> UNI_IE_CGAD_TYPE_SHIFT) & - UNI_IE_CGAD_TYPE_MASK; - ie->ie_cgad_plan = c & UNI_IE_CGAD_PLAN_MASK; - len--; - switch (ie->ie_cgad_plan) { - case UNI_IE_CGAD_PLAN_E164: - ie->ie_cgad_addr.address_format = T_ATM_E164_ADDR; - break; - case UNI_IE_CGAD_PLAN_NSAP: - ie->ie_cgad_addr.address_format = T_ATM_ENDSYS_ADDR; - break; - default: - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - } - - return(0); - } - - /* - * Get the presentation and screening indicators, if present - */ - if (!(c & UNI_IE_EXT_BIT)) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - ie->ie_cgad_pres_ind = (c >> UNI_IE_CGAD_PRES_SHIFT) & - UNI_IE_CGAD_PRES_MASK; - ie->ie_cgad_screen_ind = c & UNI_IE_CGAD_SCR_MASK; - } else { - ie->ie_cgad_pres_ind = 0; - ie->ie_cgad_screen_ind =0; - } - - /* - * Get the ATM address - */ - rc = usf_dec_atm_addr(usf, &ie->ie_cgad_addr, len); - if (rc == EINVAL) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - rc = 0; - } - - return(rc); -} - - -/* - * Decode a calling party subaddress information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_cgsa(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_cgsa_absent, &ie->ie_u.ie_cgsa, - sizeof(ie_cgsa_absent)); - - /* - * Get and check the subaddress type - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len = ie->ie_length - 1; - if (((c >> UNI_IE_CGSA_TYPE_SHIFT) & UNI_IE_CGSA_TYPE_MASK) != - UNI_IE_CGSA_TYPE_AESA) { - /* - * Invalid subaddress type - */ - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - } - - return(0); - } - - /* - * Get the ATM address - */ - ie->ie_cgsa_addr.address_format = T_ATM_ENDSYS_ADDR; - rc = usf_dec_atm_addr(usf, &ie->ie_cgsa_addr, len); - if (rc == EINVAL) { - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - rc = 0; - } - - return(rc); -} - - -/* - * Decode a cause information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_caus(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_caus_absent, &ie->ie_u.ie_caus, - sizeof(ie_caus_absent)); - - /* - * Get the cause location - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_caus_loc = c & UNI_IE_CAUS_LOC_MASK; - - /* - * Get the cause value - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_caus_cause = c & UNI_IE_EXT_MASK; - - /* - * Get any included diagnostics - */ - len = ie->ie_length - 2; - for (i = 0, ie->ie_caus_diag_len = 0; - len && i < sizeof(ie->ie_caus_diagnostic); - len--, i++, ie->ie_caus_diag_len++) { - rc = usf_byte(usf, &ie->ie_caus_diagnostic[i]); - if (rc) - return(rc); - } - - return(0); -} - - -/* - * Decode a conection identifier information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_cnid(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - - /* - * Clear the IE - */ - bcopy(&ie_cnid_absent, &ie->ie_u.ie_cnid, - sizeof(ie_cnid_absent)); - - rc = usf_ext(usf, &i); - if (rc) - return(rc); - ie->ie_cnid_vp_sig = (i >> UNI_IE_CNID_VPSIG_SHIFT) & - UNI_IE_CNID_VPSIG_MASK; - ie->ie_cnid_pref_excl = i & UNI_IE_CNID_PREX_MASK; - - rc = usf_short(usf, &ie->ie_cnid_vpci); - if (rc) - return(rc); - rc = usf_short(usf, &ie->ie_cnid_vci); - return(rc); -} - - -/* - * Decode a quality of service parameters information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_qosp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - - /* - * Clear the IE - */ - bcopy(&ie_qosp_absent, &ie->ie_u.ie_qosp, - sizeof(ie_qosp_absent)); - - /* - * Get forward QoS class - */ - rc = usf_byte(usf, &ie->ie_qosp_fwd_class); - if (rc) - return(rc); - - /* - * Get backward QoS class - */ - rc = usf_byte(usf, &ie->ie_qosp_bkwd_class); - - return(rc); -} - - -/* - * Decode a broadband repeat indicator information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_brpi(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_brpi_absent, &ie->ie_u.ie_brpi, - sizeof(ie_brpi_absent)); - - /* - * Get the repeat indicator - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - ie->ie_brpi_ind = c & UNI_IE_BRPI_IND_MASK; - - return(0); -} - - -/* - * Decode a restart indicator information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_rsti(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_rsti_absent, &ie->ie_u.ie_rsti, - sizeof(ie_rsti_absent)); - - /* - * Get the restart class - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - ie->ie_rsti_class = c & UNI_IE_RSTI_CLASS_MASK; - - return(0); -} - - -/* - * Decode a broadband sending complete information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a broadband sending complete IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_bsdc(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_bsdc_absent, &ie->ie_u.ie_bsdc, - sizeof(ie_bsdc_absent)); - - /* - * Get the sending complete indicator - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - - /* - * Validate the indicator - */ - c &= UNI_IE_EXT_MASK; - if (c != UNI_IE_BSDC_IND) - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - ie->ie_bsdc_ind = c; - - return(0); -} - - -/* - * Decode a transit network selection information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a transit network selection IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_trnt(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, len, rc; - u_char c; - - /* - * Clear the IE - */ - bcopy(&ie_trnt_absent, &ie->ie_u.ie_trnt, - sizeof(ie_trnt_absent)); - - /* - * Get the network ID type and plan - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - ie->ie_trnt_id_type = (c >> UNI_IE_TRNT_IDT_SHIFT) & - UNI_IE_TRNT_IDT_MASK; - ie->ie_trnt_id_plan = c & UNI_IE_TRNT_IDP_MASK; - - /* - * Get the length of the network ID - */ - len = ie->ie_length - 1; - ie->ie_trnt_id_len = MIN(len, sizeof(ie->ie_trnt_id)); - - /* - * Get the network ID - */ - for (i=0; iie_trnt_id)) - rc = usf_byte(usf, &ie->ie_trnt_id[i]); - else - rc = usf_byte(usf, &c); - if (rc) - return(rc); - } - - return(0); -} - - -/* - * Decode an unimplemented information element - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_uimp(usf, ie) - struct usfmt *usf; - struct ie_generic *ie; -{ - int i, rc; - u_char c; - - /* - * Skip over the IE contents - */ - for (i=0; iie_length; i++) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - } - - return(0); -} - - -/* - * Decode an information element using field identifiers - * - * The AAL parameters and ATM user cell rate IEs are formatted - * with a one-byte identifier preceding each field. The routine - * parses these IEs by using a table which relates the field - * identifiers with the fields in the appropriate IE structure. - * Field order in the received message is immaterial. - * - * Arguments: - * usf pointer to a unisig formatting structure - * ie pointer to a cell rate IE structure - * tbl pointer to an IE decoding table - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_ie_ident(usf, ie, tbl) - struct usfmt *usf; - struct ie_generic *ie; - struct ie_decode_tbl *tbl; -{ - int i, len, rc; - u_char c; - u_int8_t cv; - u_int16_t sv; - u_int32_t iv; - void *dest; - - /* - * Scan through the IE - */ - len = ie->ie_length; - while (len) { - /* - * Get the field identifier - */ - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - - /* - * Look up the field in the table - */ - for (i=0; (tbl[i].ident != c) && tbl[i].len; i++) { - } - if (tbl[i].ident == 0) { - /* - * Bad subfield identifier -- flag an - * error and skip over the rest of the IE - */ - ie->ie_err_cause = UNI_IE_CAUS_IECONTENT; - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - } - return(0); - } - - /* - * Save final destination address - */ - dest = (void *)((intptr_t)ie + tbl[i].f_offs); - - /* - * Get the field value - */ - switch (tbl[i].len) { - case 0: - cv = 1; - goto savec; - - case 1: - rc = usf_byte(usf, &cv); - if (rc) - break; -savec: - /* - * Save field value - */ - switch (tbl[i].f_size) { - case 1: - *(u_int8_t *)dest = cv; - break; - case 2: - *(u_int16_t *)dest = cv; - break; - case 4: - *(u_int32_t *)dest = cv; - break; - default: - goto badtbl; - } - break; - - case 2: - rc = usf_short(usf, &sv); - if (rc) - break; - - /* - * Save field value - */ - switch (tbl[i].f_size) { - case 2: - *(u_int16_t *)dest = sv; - break; - case 4: - *(u_int32_t *)dest = sv; - break; - default: - goto badtbl; - } - break; - - case 3: - rc = usf_int3(usf, &iv); - goto savei; - - case 4: - rc = usf_int(usf, &iv); -savei: - /* - * Save field value - */ - if (rc) - break; - switch (tbl[i].f_size) { - case 4: - *(u_int32_t *)dest = iv; - break; - default: - goto badtbl; - } - break; - - default: -badtbl: - log(LOG_ERR, - "uni decode: id=%d,len=%d,off=%d,size=%d\n", - tbl[i].ident, tbl[i].len, - tbl[i].f_offs, tbl[i].f_size); - rc = EFAULT; - break; - } - - if (rc) - return(rc); - - len -= tbl[i].len; - - } - - return(0); -} - - -/* - * Decode an ATM address - * - * Arguments: - * usf pointer to a unisig formatting structure - * addr pointer to an ATM address structure - * len length of data remainig in the IE - * - * Returns: - * 0 success - * errno error encountered - * - */ -static int -usf_dec_atm_addr(usf, addr, len) - struct usfmt *usf; - Atm_addr *addr; - int len; -{ - int rc; - u_char c, *cp; - - /* - * Check the address type - */ - addr->address_length = len; - switch (addr->address_format) { - case T_ATM_E164_ADDR: - if (len > sizeof(Atm_addr_e164)) { - goto flush; - } - cp = (u_char *) addr->address; - break; - case T_ATM_ENDSYS_ADDR: - if (len != sizeof(Atm_addr_nsap)) { - goto flush; - } - cp = (u_char *) addr->address; - break; - default: - /* Silence the compiler */ - cp = NULL; - } - - /* - * Get the ATM address - */ - while (len) { - rc = usf_byte(usf, cp); - if (rc) - return(rc); - len--; - cp++; - } - - return(0); - -flush: - while (len) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - len--; - } - - return(EINVAL); -} Property changes on: head/sys/netatm/uni/unisig_decode.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/q2110_sigcpcs.c =================================================================== --- head/sys/netatm/uni/q2110_sigcpcs.c (revision 179307) +++ head/sys/netatm/uni/q2110_sigcpcs.c (nonexistent) @@ -1,1767 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * ITU-T Q.2110 - Process CPCS-signals (SSCOP PDUs) - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static void sscop_bgn_outconn(struct sscop *, KBuffer *, caddr_t); -static void sscop_bgn_inconn(struct sscop *, KBuffer *, caddr_t); -static void sscop_bgn_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_bgrej_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_end_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_end_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_endak_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_outresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_inresyn(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_rs_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_error(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_idle(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_recovrsp(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_inrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_er_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_erak_error(struct sscop *, KBuffer *, caddr_t); -static void sscop_erak_idle(struct sscop *, KBuffer *, caddr_t); -static void sscop_erak_outrecov(struct sscop *, KBuffer *, caddr_t); -static void sscop_sd_ready(struct sscop *, KBuffer *, caddr_t); -static void sscop_poll_ready(struct sscop *, KBuffer *, caddr_t); - - -/* - * PDU type state lookup tables - */ -/* BGN PDU */ -static void (*sscop_bgn_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgn_idle, /* SOS_IDLE */ - sscop_bgn_outconn, /* SOS_OUTCONN */ - sscop_bgn_inconn, /* SOS_INCONN */ - sscop_bgn_outdisc, /* SOS_OUTDISC */ - sscop_bgn_outresyn, /* SOS_OUTRESYN */ - sscop_bgn_inresyn, /* SOS_INRESYN */ - sscop_bgn_inresyn, /* SOS_OUTRECOV */ - sscop_bgn_inresyn, /* SOS_RECOVRSP */ - sscop_bgn_inresyn, /* SOS_INRECOV */ - sscop_bgn_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* BGAK PDU */ -static void (*sscop_bgak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgak_idle, /* SOS_IDLE */ - sscop_bgak_outconn, /* SOS_OUTCONN */ - sscop_bgak_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_bgak_error, /* SOS_INRESYN */ - sscop_bgak_error, /* SOS_OUTRECOV */ - sscop_bgak_error, /* SOS_RECOVRSP */ - sscop_bgak_error, /* SOS_INRECOV */ - sscop_noop, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* BGREJ PDU */ -static void (*sscop_bgrej_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_bgrej_error, /* SOS_IDLE */ - sscop_bgrej_outconn, /* SOS_OUTCONN */ - sscop_bgrej_inconn, /* SOS_INCONN */ - sscop_endak_outdisc, /* SOS_OUTDISC */ - sscop_bgrej_outresyn, /* SOS_OUTRESYN */ - sscop_bgrej_inconn, /* SOS_INRESYN */ - sscop_bgrej_outrecov, /* SOS_OUTRECOV */ - sscop_bgrej_inconn, /* SOS_RECOVRSP */ - sscop_bgrej_inconn, /* SOS_INRECOV */ - sscop_bgrej_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* END PDU */ -static void (*sscop_end_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_end_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_end_inconn, /* SOS_INCONN */ - sscop_end_outdisc, /* SOS_OUTDISC */ - sscop_end_inconn, /* SOS_OUTRESYN */ - sscop_end_inconn, /* SOS_INRESYN */ - sscop_end_outrecov, /* SOS_OUTRECOV */ - sscop_end_inconn, /* SOS_RECOVRSP */ - sscop_end_inconn, /* SOS_INRECOV */ - sscop_end_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* ENDAK PDU */ -static void (*sscop_endak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_noop, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_endak_inconn, /* SOS_INCONN */ - sscop_endak_outdisc, /* SOS_OUTDISC */ - sscop_endak_inconn, /* SOS_OUTRESYN */ - sscop_endak_inconn, /* SOS_INRESYN */ - sscop_endak_outrecov, /* SOS_OUTRECOV */ - sscop_endak_inconn, /* SOS_RECOVRSP */ - sscop_endak_inconn, /* SOS_INRECOV */ - sscop_endak_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* RS PDU */ -static void (*sscop_rs_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_rs_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_rs_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_rs_outresyn, /* SOS_OUTRESYN */ - sscop_rs_inresyn, /* SOS_INRESYN */ - sscop_rs_outrecov, /* SOS_OUTRECOV */ - sscop_rs_outrecov, /* SOS_RECOVRSP */ - sscop_rs_outrecov, /* SOS_INRECOV */ - sscop_rs_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* RSAK PDU */ -static void (*sscop_rsak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_rsak_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_rsak_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_rsak_outresyn, /* SOS_OUTRESYN */ - sscop_rsak_error, /* SOS_INRESYN */ - sscop_rsak_error, /* SOS_OUTRECOV */ - sscop_rsak_error, /* SOS_RECOVRSP */ - sscop_rsak_error, /* SOS_INRECOV */ - sscop_noop, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* ER PDU */ -static void (*sscop_er_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_er_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_er_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_er_error, /* SOS_INRESYN */ - sscop_er_outrecov, /* SOS_OUTRECOV */ - sscop_er_recovrsp, /* SOS_RECOVRSP */ - sscop_er_inrecov, /* SOS_INRECOV */ - sscop_er_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* ERAK PDU */ -static void (*sscop_erak_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_erak_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_erak_error, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_erak_error, /* SOS_INRESYN */ - sscop_erak_outrecov, /* SOS_OUTRECOV */ - sscop_noop, /* SOS_RECOVRSP */ - sscop_erak_error, /* SOS_INRECOV */ - sscop_noop, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* SD PDU */ -static void (*sscop_sd_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_sd_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_sd_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_sd_inconn, /* SOS_INRESYN */ - sscop_noop, /* SOS_OUTRECOV */ - sscop_noop, /* SOS_RECOVRSP */ - sscop_sd_inconn, /* SOS_INRECOV */ - sscop_sd_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* POLL PDU */ -static void (*sscop_poll_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_poll_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_poll_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_poll_inconn, /* SOS_INRESYN */ - sscop_noop, /* SOS_OUTRECOV */ - sscop_noop, /* SOS_RECOVRSP */ - sscop_poll_inconn, /* SOS_INRECOV */ - sscop_poll_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* STAT PDU */ -static void (*sscop_stat_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_stat_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_stat_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_stat_inconn, /* SOS_INRESYN */ - sscop_noop, /* SOS_OUTRECOV */ - sscop_stat_inconn, /* SOS_RECOVRSP */ - sscop_stat_inconn, /* SOS_INRECOV */ - sscop_stat_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* USTAT PDU */ -static void (*sscop_ustat_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_ustat_idle, /* SOS_IDLE */ - sscop_noop, /* SOS_OUTCONN */ - sscop_ustat_inconn, /* SOS_INCONN */ - sscop_noop, /* SOS_OUTDISC */ - sscop_noop, /* SOS_OUTRESYN */ - sscop_ustat_inconn, /* SOS_INRESYN */ - sscop_noop, /* SOS_OUTRECOV */ - sscop_ustat_inconn, /* SOS_RECOVRSP */ - sscop_ustat_inconn, /* SOS_INRECOV */ - sscop_ustat_ready, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* UD PDU */ -static void (*sscop_ud_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_ud_all, /* SOS_IDLE */ - sscop_ud_all, /* SOS_OUTCONN */ - sscop_ud_all, /* SOS_INCONN */ - sscop_ud_all, /* SOS_OUTDISC */ - sscop_ud_all, /* SOS_OUTRESYN */ - sscop_ud_all, /* SOS_INRESYN */ - sscop_ud_all, /* SOS_OUTRECOV */ - sscop_ud_all, /* SOS_RECOVRSP */ - sscop_ud_all, /* SOS_INRECOV */ - sscop_ud_all, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - -/* MD PDU */ -static void (*sscop_md_tab[SOS_NUMSTATES]) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, /* SOS_INST */ - sscop_md_all, /* SOS_IDLE */ - sscop_md_all, /* SOS_OUTCONN */ - sscop_md_all, /* SOS_INCONN */ - sscop_md_all, /* SOS_OUTDISC */ - sscop_md_all, /* SOS_OUTRESYN */ - sscop_md_all, /* SOS_INRESYN */ - sscop_md_all, /* SOS_OUTRECOV */ - sscop_md_all, /* SOS_RECOVRSP */ - sscop_md_all, /* SOS_INRECOV */ - sscop_md_all, /* SOS_READY */ - sscop_noop /* SOS_TERM */ -}; - - -/* - * PDU type lookup table - */ -void (*(*sscop_q2110_pdutab[])) - (struct sscop *, KBuffer *, caddr_t) = { - NULL, - sscop_bgn_tab, - sscop_bgak_tab, - sscop_end_tab, - sscop_endak_tab, - sscop_rs_tab, - sscop_rsak_tab, - sscop_bgrej_tab, - sscop_sd_tab, - sscop_er_tab, - sscop_poll_tab, - sscop_stat_tab, - sscop_ustat_tab, - sscop_ud_tab, - sscop_md_tab, - sscop_erak_tab -}; - - -/* - * BGN PDU / SOS_OUTCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_bgn_outconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err; - - /* - * If retransmitted BGN, ignore it - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize state variables - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - q2110_init_state(sop); - - /* - * Return an ACK to peer - */ - (void) sscop_send_bgak(sop); - - /* - * Notify user of connection establishment - */ - STACK_CALL(SSCOP_ESTABLISH_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * OK, we're ready for data - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * BGN PDU / SOS_INCONN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_bgn_inconn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err; - - /* - * If retransmitted BGN, ignore it - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - return; - } - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - /* - * First, tell user current connection has been released - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_USER, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Now, tell user of new connection establishment - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - return; -} - - -/* - * BGN PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_bgn_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct bgn_pdu *bp = (struct bgn_pdu *)trlr; - int err; - - /* - * If retransmitted BGN, just ACK it again - */ - if (sscop_is_rexmit(sop, bp->bgn_nsq)) { - KB_FREEALL(m); - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - (void) sscop_send_bgak(sop); - return; - } - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(bp->bgn_nmr)); - - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - - /* - * Tell user current connection has been released - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_USER, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Tell user of incoming connection - */ - STACK_CALL(SSCOP_ESTABLISH_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user's response - */ - sop->so_state = SOS_INCONN; - - return; -} - - -/* - * BGREJ PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_bgrej_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Report protocol error - */ - sscop_bgrej_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear receiver buffer - */ - sscop_rcvr_drain(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_end_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct end_pdu *ep = (struct end_pdu *)trlr; - int err, source; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Get Source value - */ - if (ep->end_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear receiver buffer - */ - sscop_rcvr_drain(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * END PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_end_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct end_pdu *ep = (struct end_pdu *)trlr; - int err, source; - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Acknowledge END - */ - (void) sscop_send_endak(sop); - - /* - * Get Source value - */ - if (ep->end_type & PT_SOURCE_SSCOP) - source = SSCOP_SOURCE_SSCOP; - else - source = SSCOP_SOURCE_USER; - - /* - * Notify user of connection termination - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, source, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * ENDAK PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_endak_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Report protocol error - */ - sscop_endak_error(sop, m, trlr); - - /* - * Notify user of connection failure - */ - STACK_CALL(SSCOP_RELEASE_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, SSCOP_UU_NULL, SSCOP_SOURCE_SSCOP, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear receiver buffer - */ - sscop_rcvr_drain(sop); - - /* - * Back to idle state - */ - sop->so_state = SOS_IDLE; - - return; -} - - -/* - * RS PDU / SOS_OUTRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_outresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct rs_pdu *rp = (struct rs_pdu *)trlr; - int err; - - /* - * If retransmitted RS, ignore it - */ - if (sscop_is_rexmit(sop, rp->rs_nsq)) { - KB_FREEALL(m); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize state variables - */ - SEQ_SET(sop->so_sendmax, ntohl(rp->rs_nmr)); - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - q2110_init_state(sop); - - /* - * Free PDU buffers - */ - KB_FREEALL(m); - - /* - * Return an ACK to peer - */ - (void) sscop_send_rsak(sop); - - /* - * Notify user of connection resynchronization - */ - STACK_CALL(SSCOP_RESYNC_CNF, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Start data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = sop->so_parm.sp_timepoll; - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - - /* - * OK, we're ready for data - */ - sop->so_state = SOS_READY; - - /* - * See if transmit queues need servicing - */ - if (sop->so_flags & SOF_XMITSRVC) - sscop_service_xmit(sop); - - return; -} - - -/* - * RS PDU / SOS_INRESYN Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_inresyn(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct rs_pdu *rp = (struct rs_pdu *)trlr; - - /* - * If retransmitted RS, ignore it - */ - if (sscop_is_rexmit(sop, rp->rs_nsq)) { - KB_FREEALL(m); - return; - } - - /* - * Report error condition - */ - sscop_rs_error(sop, m, trlr); - - return; -} - - -/* - * RS PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct rs_pdu *rp = (struct rs_pdu *)trlr; - int err; - - /* - * If retransmitted RS, report an error - */ - if (sscop_is_rexmit(sop, rp->rs_nsq)) { - sscop_rs_error(sop, m, trlr); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(rp->rs_nmr)); - - /* - * Notify user of connection resynchronization - */ - STACK_CALL(SSCOP_RESYNC_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear receiver buffer - */ - sscop_rcvr_drain(sop); - - /* - * Wait for user response - */ - sop->so_state = SOS_INRESYN; - - return; -} - - -/* - * RS PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_rs_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct rs_pdu *rp = (struct rs_pdu *)trlr; - int err; - - /* - * If retransmitted RS, just ACK it - */ - if (sscop_is_rexmit(sop, rp->rs_nsq)) { - KB_FREEALL(m); - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - sscop_send_rsak(sop); - return; - } - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(rp->rs_nmr)); - - /* - * Notify user of connection resynchronization - */ - STACK_CALL(SSCOP_RESYNC_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, 0, err); - if (err) { - KB_FREEALL(m); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Clear out appropriate queues - */ - q2110_prep_retrieve(sop); - - /* - * Wait for user response - */ - sop->so_state = SOS_INRESYN; - - return; -} - -/* - * ER PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'L'); - KB_FREEALL(m); - - return; -} - - -/* - * ER PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_er_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - return; -} - - -/* - * ER PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct er_pdu *ep = (struct er_pdu *)trlr; - int err; - - /* - * If retransmitted ER, report an error - */ - if (sscop_is_rexmit(sop, ep->er_nsq)) { - sscop_er_error(sop, m, trlr); - return; - } - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(ep->er_nmr)); - - /* - * Initialize receiver window - */ - SEQ_SET(sop->so_rcvmax, sop->so_parm.sp_rcvwin); - - /* - * Free PDU buffers - */ - KB_FREEALL(m); - - /* - * Acknowledge ER - */ - (void) sscop_send_erak(sop); - - /* - * Deliver any outstanding data to user - */ - q2110_deliver_data(sop); - - /* - * Notify user of connection recovery - */ - STACK_CALL(SSCOP_RECOVER_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user response - */ - sop->so_state = SOS_RECOVRSP; - - return; -} - - -/* - * ER PDU / SOS_RECOVRSP Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_recovrsp(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct er_pdu *ep = (struct er_pdu *)trlr; - - /* - * If retransmitted ER, just ACK it - */ - if (sscop_is_rexmit(sop, ep->er_nsq)) { - KB_FREEALL(m); - (void) sscop_send_erak(sop); - return; - } - - /* - * Report error condition - */ - sscop_er_error(sop, m, trlr); - - return; -} - - -/* - * ER PDU / SOS_INRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_inrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct er_pdu *ep = (struct er_pdu *)trlr; - - /* - * If retransmitted ER, just ignore it - */ - if (sscop_is_rexmit(sop, ep->er_nsq)) { - KB_FREEALL(m); - return; - } - - /* - * Report error condition - */ - sscop_er_error(sop, m, trlr); - - return; -} - - -/* - * ER PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_er_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct er_pdu *ep = (struct er_pdu *)trlr; - int err; - - /* - * If retransmitted ER, just ACK it - */ - if (sscop_is_rexmit(sop, ep->er_nsq)) { - KB_FREEALL(m); - sop->so_timer[SSCOP_T_NORESP] = sop->so_parm.sp_timeresp; - sscop_send_erak(sop); - return; - } - - /* - * Stop data transfer timers - */ - sop->so_timer[SSCOP_T_POLL] = 0; - sop->so_timer[SSCOP_T_NORESP] = 0; - sop->so_timer[SSCOP_T_IDLE] = 0; - sop->so_flags &= ~SOF_KEEPALIVE; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(ep->er_nmr)); - - /* - * Free PDU buffers - */ - KB_FREEALL(m); - - /* - * Clear out appropriate queues - */ - q2110_prep_recovery(sop); - - /* - * Deliver any outstanding data to user - */ - q2110_deliver_data(sop); - - /* - * Notify user of connection recovery - */ - STACK_CALL(SSCOP_RECOVER_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user response - */ - sop->so_state = SOS_INRECOV; - - return; -} - - -/* - * ERAK PDU / Protocol Error - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_erak_error(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_maa_error(sop, 'M'); - KB_FREEALL(m); - - return; -} - - -/* - * ERAK PDU / SOS_IDLE Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_erak_idle(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - - /* - * Record error condition - */ - sscop_erak_error(sop, m, trlr); - - /* - * Return an END to peer - */ - (void) sscop_send_end(sop, SSCOP_SOURCE_SSCOP); - - return; -} - - -/* - * ERAK PDU / SOS_OUTRECOV Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_erak_outrecov(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct erak_pdu *ep = (struct erak_pdu *)trlr; - int err; - - /* - * Stop retransmit timer - */ - sop->so_timer[SSCOP_T_CC] = 0; - - /* - * Initialize transmit window - */ - SEQ_SET(sop->so_sendmax, ntohl(ep->erak_nmr)); - - /* - * Free PDU buffers - */ - KB_FREEALL(m); - - /* - * Deliver any outstanding data to user - */ - q2110_deliver_data(sop); - - /* - * Notify user of connection recovery - */ - STACK_CALL(SSCOP_RECOVER_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, 0, 0, err); - if (err) { - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Wait for user response - */ - sop->so_state = SOS_RECOVRSP; - - return; -} - - -/* - * SD PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_sd_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct sd_pdu *sp = (struct sd_pdu *)trlr; - struct pdu_hdr *php; - KBuffer *n; - sscop_seq ns; - int err, space; - - /* - * Get PDU sequence number - */ - SEQ_SET(ns, ntohl(sp->sd_ns)); - - /* - * Ensure that the sequence number fits within the window - */ - if (SEQ_GEQ(ns, sop->so_rcvmax, sop->so_rcvnext)) { - /* - * It doesn't, drop received data - */ - KB_FREEALL(m); - - /* - * If next highest PDU hasn't reached window end yet, - * then send a USTAT to inform transmitter of this gap - */ - if (SEQ_LT(sop->so_rcvhigh, sop->so_rcvmax, sop->so_rcvnext)) { - (void) sscop_send_ustat(sop, sop->so_rcvmax); - sop->so_rcvhigh = sop->so_rcvmax; - } - return; - } - - /* - * If this is the next in-sequence PDU, hand it to user - */ - if (ns == sop->so_rcvnext) { - STACK_CALL(SSCOP_DATA_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)m, ns, err); - if (err) { - KB_FREEALL(m); - return; - } - - /* - * Bump next expected sequence number - */ - SEQ_INCR(sop->so_rcvnext, 1); - - /* - * Slide receive window down - */ - SEQ_INCR(sop->so_rcvmax, 1); - - /* - * Is this the highest sequence PDU we've received?? - */ - if (ns == sop->so_rcvhigh) { - /* - * Yes, bump the limit and exit - */ - sop->so_rcvhigh = sop->so_rcvnext; - return; - } - - /* - * This is a retransmitted PDU, so see if we have - * more in-sequence PDUs already queued up - */ - while ((php = sop->so_recv_hd) && - (php->ph_ns == sop->so_rcvnext)) { - - /* - * Yup we do, so remove next PDU from queue and - * pass it up to the user as well - */ - sop->so_recv_hd = php->ph_recv_lk; - if (sop->so_recv_hd == NULL) - sop->so_recv_tl = NULL; - STACK_CALL(SSCOP_DATA_IND, sop->so_upper, sop->so_toku, - sop->so_connvc, (intptr_t)php->ph_buf, - php->ph_ns, err); - if (err) { - /* - * Should never happen, but... - */ - KB_FREEALL(php->ph_buf); - sscop_abort(sop, "stack memory\n"); - return; - } - - /* - * Bump next expected sequence number - */ - SEQ_INCR(sop->so_rcvnext, 1); - - /* - * Slide receive window down - */ - SEQ_INCR(sop->so_rcvmax, 1); - } - - /* - * Finished with data delivery... - */ - return; - } - - /* - * We're gonna have to queue this PDU, so find space - * for the PDU header - */ - KB_HEADROOM(m, space); - - /* - * If there's not enough room in the received buffer, - * allocate & link a new buffer for the header - */ - if (space < sizeof(struct pdu_hdr)) { - - KB_ALLOC(n, sizeof(struct pdu_hdr), KB_F_NOWAIT, KB_T_HEADER); - if (n == NULL) { - KB_FREEALL(m); - return; - } - KB_HEADSET(n, sizeof(struct pdu_hdr)); - KB_LEN(n) = 0; - KB_LINKHEAD(n, m); - m = n; - } - - /* - * Build PDU header - * - * We can at least assume/require that the start of - * the user data is aligned. Also note that we don't - * include this header in the buffer len/offset fields. - */ - KB_DATASTART(m, php, struct pdu_hdr *); - php--; - php->ph_ns = ns; - php->ph_buf = m; - - /* - * Insert PDU into the receive queue - */ - if (sscop_recv_insert(sop, php)) { - /* - * Oops, a duplicate sequence number PDU is already on - * the queue, somethings wrong here. - */ - sscop_maa_error(sop, 'Q'); - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Go into recovery mode - */ - q2110_error_recovery(sop); - - return; - } - - /* - * Are we at the high-water mark?? - */ - if (ns == sop->so_rcvhigh) { - /* - * Yes, just bump the mark - */ - SEQ_INCR(sop->so_rcvhigh, 1); - - return; - } - - /* - * Are we beyond the high-water mark?? - */ - if (SEQ_GT(ns, sop->so_rcvhigh, sop->so_rcvnext)) { - /* - * Yes, then there's a missing PDU, so inform the transmitter - */ - (void) sscop_send_ustat(sop, ns); - - /* - * Update high-water mark - */ - sop->so_rcvhigh = SEQ_ADD(ns, 1); - } - - return; -} - - -/* - * POLL PDU / SOS_READY Processor - * - * Arguments: - * sop pointer to sscop connection block - * m pointer to PDU buffer (without trailer) - * trlr pointer to PDU trailer - * - * Returns: - * none - * - */ -static void -sscop_poll_ready(sop, m, trlr) - struct sscop *sop; - KBuffer *m; - caddr_t trlr; -{ - struct poll_pdu *pp = (struct poll_pdu *)trlr; - sscop_seq nps; - - pp->poll_ns = ntohl(pp->poll_ns); - - /* - * If the poll sequence number is less than highest number - * we've already seen, something's wrong - */ - if (SEQ_LT(pp->poll_ns, sop->so_rcvhigh, sop->so_rcvnext)) { - /* - * Record error condition - */ - sscop_maa_error(sop, 'Q'); - - /* - * Free buffers - */ - KB_FREEALL(m); - - /* - * Go into recovery mode - */ - q2110_error_recovery(sop); - - return; - } - - /* - * Set a new "next highest" sequence number expected - */ - if (SEQ_LT(pp->poll_ns, sop->so_rcvmax, sop->so_rcvnext)) - SEQ_SET(sop->so_rcvhigh, pp->poll_ns); - else - sop->so_rcvhigh = sop->so_rcvmax; - - /* - * Return a STAT PDU to peer - */ - SEQ_SET(nps, ntohl(pp->poll_nps)); - KB_FREEALL(m); - (void) sscop_send_stat(sop, nps); - - return; -} - Property changes on: head/sys/netatm/uni/q2110_sigcpcs.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/uniarp_timer.c =================================================================== --- head/sys/netatm/uni/uniarp_timer.c (revision 179307) +++ head/sys/netatm/uni/uniarp_timer.c (nonexistent) @@ -1,329 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * UNI ATMARP support (RFC1577) - Timer processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local functions - */ -static void uniarp_svc_oldage(struct uniarp *); -static void uniarp_pvc_oldage(struct uniarp *); - - -/* - * Process a UNI ATMARP entry timeout - * - * Called when a previously scheduled uniarp control block timer expires. - * - * Called at splnet. - * - * Arguments: - * tip pointer to uniarp timer control block - * - * Returns: - * none - * - */ -void -uniarp_timeout(tip) - struct atm_time *tip; -{ - struct uniip *uip; - struct uniarp *uap; - struct ipvcc *ivp; - - - /* - * Back-off to uniarp control block - */ - uap = (struct uniarp *) - ((caddr_t)tip - offsetof(struct uniarp, ua_time)); - uip = uap->ua_intf; - - - /* - * Do we know the IP address for this entry yet?? - */ - if (uap->ua_dstip.s_addr == 0) { - - /* - * No, then send another InATMARP_REQ on each active VCC - * associated with this entry to solicit the peer's identity. - */ - for (ivp = uap->ua_ivp; ivp; ivp = ivp->iv_arpnext) { - if (ivp->iv_state != IPVCC_ACTIVE) - continue; - (void) uniarp_inarp_req(uip, &uap->ua_dstatm, - &uap->ua_dstatmsub, ivp); - } - - /* - * Restart retry timer - */ - UNIARP_TIMER(uap, UNIARP_ARP_RETRY); - } else { - /* - * Yes, then we're trying to find the ATM address for this - * IP address - so send another ATMARP_REQ to the arpserver - * (if it's up at the moment) - */ - if (uip->uip_arpstate == UIAS_CLIENT_ACTIVE) - (void) uniarp_arp_req(uip, &uap->ua_dstip); - - /* - * Restart retry timer - */ - UNIARP_TIMER(uap, UNIARP_ARP_RETRY); - } - - return; -} - - -/* - * Process an UNI ARP SVC entry aging timer expiration - * - * This function is called when an SVC arp entry's aging timer has expired. - * - * Called at splnet(). - * - * Arguments: - * uap pointer to atmarp table entry - * - * Returns: - * none - * - */ -static void -uniarp_svc_oldage(uap) - struct uniarp *uap; -{ - struct ipvcc *ivp, *inext; - struct uniip *uip = uap->ua_intf; - - - /* - * Permanent (manually installed) entries are never aged - */ - if (uap->ua_origin >= UAO_PERM) - return; - - /* - * If entry is valid and we're out of retrys, tell - * IP/ATM that the SVCs can't be used - */ - if ((uap->ua_flags & UAF_VALID) && (uap->ua_retry-- == 0)) { - uap->ua_flags |= UAF_LOCKED; - for (ivp = uap->ua_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_INVALID); - } - uap->ua_flags &= ~(UAF_LOCKED | UAF_VALID); - uap->ua_origin = 0; - - /* - * Delete and free an unused entry - */ - if (uap->ua_ivp == NULL) { - UNIARP_CANCEL(uap); - UNIARP_DELETE(uap); - uma_zfree(uniarp_zone, uap); - return; - } - } - - /* - * We want to try and refresh this entry but we don't want - * to keep unused entries laying around forever. - */ - if (uap->ua_ivp || (uap->ua_flags & UAF_USED)) { - if (uip->uip_arpstate == UIAS_CLIENT_ACTIVE) { - /* - * If we are a client (and the server VCC is active), - * then we'll ask the server for a refresh - */ - (void) uniarp_arp_req(uip, &uap->ua_dstip); - } else { - /* - * Otherwise, solicit the each active VCC peer with - * an Inverse ATMARP - */ - for (ivp = uap->ua_ivp; ivp; ivp = ivp->iv_arpnext) { - if (ivp->iv_state != IPVCC_ACTIVE) - continue; - (void) uniarp_inarp_req(uip, &uap->ua_dstatm, - &uap->ua_dstatmsub, ivp); - } - } - } - - /* - * Reset timeout - */ - if (uap->ua_flags & UAF_VALID) - uap->ua_aging = UNIARP_RETRY_AGE; - else - uap->ua_aging = UNIARP_REVALID_AGE; - - return; -} - - -/* - * Process an UNI ARP PVC entry aging timer expiration - * - * This function is called when a PVC arp entry's aging timer has expired. - * - * Called at splnet(). - * - * Arguments: - * uap pointer to atmarp table entry - * - * Returns: - * none - * - */ -static void -uniarp_pvc_oldage(uap) - struct uniarp *uap; -{ - struct ipvcc *ivp = uap->ua_ivp; - - /* - * If entry is valid and we're out of retrys, tell - * IP/ATM that PVC can't be used - */ - if ((uap->ua_flags & UAF_VALID) && (uap->ua_retry-- == 0)) { - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_INVALID); - uap->ua_flags &= ~UAF_VALID; - } - - /* - * Solicit peer with Inverse ATMARP - */ - (void) uniarp_inarp_req(uap->ua_intf, &uap->ua_dstatm, - &uap->ua_dstatmsub, ivp); - - /* - * Reset timeout - */ - if (uap->ua_flags & UAF_VALID) - uap->ua_aging = UNIARP_RETRY_AGE; - else - uap->ua_aging = UNIARP_REVALID_AGE; - - return; -} - - -/* - * Process a UNI ARP aging timer tick - * - * This function is called every UNIARP_AGING seconds, in order to age - * all the arp table entries. If an entry's timer is expired, then the - * uniarp old-age timeout function will be called for that entry. - * - * Called at splnet. - * - * Arguments: - * tip pointer to uniarp aging timer control block - * - * Returns: - * none - * - */ -void -uniarp_aging(tip) - struct atm_time *tip; -{ - struct uniarp *uap, *unext; - int i; - - - /* - * Schedule next timeout - */ - atm_timeout(&uniarp_timer, UNIARP_AGING, uniarp_aging); - - /* - * Run through arp table bumping each entry's aging timer. - * If an expired timer is found, process that entry. - */ - for (i = 0; i < UNIARP_HASHSIZ; i++) { - for (uap = uniarp_arptab[i]; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_aging && --uap->ua_aging == 0) - uniarp_svc_oldage(uap); - } - } - - /* - * Check out PVC aging timers too - */ - for (uap = uniarp_pvctab; uap; uap = unext) { - unext = uap->ua_next; - - if (uap->ua_aging && --uap->ua_aging == 0) - uniarp_pvc_oldage(uap); - } - - /* - * Only fully resolved SVC entries need aging, so there's no need - * to examine the 'no map' table - */ -} - Property changes on: head/sys/netatm/uni/uniarp_timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_var.h =================================================================== --- head/sys/netatm/uni/sscop_var.h (revision 179307) +++ head/sys/netatm/uni/sscop_var.h (nonexistent) @@ -1,287 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP protocol control blocks - * - */ - -#ifndef _UNI_SSCOP_VAR_H -#define _UNI_SSCOP_VAR_H - -/* - * Structure containing information for each SSCOP connection. - */ -struct sscop { - struct sscop *so_next; /* Next connection in chain */ - u_char so_state; /* Connection state (see below) */ - u_short so_flags; /* Connection flags (see below) */ - enum sscop_vers so_vers; /* SSCOP version */ - - /* Transmitter variables */ - sscop_seq so_send; /* VT(S) - next SD to send */ - sscop_seq so_sendmax; /* VT(MS) - max SD to send + 1 */ - sscop_seq so_ack; /* VT(A) - next expected ack */ - sscop_seq so_pollsend; /* VT(PS) - last POLL sent */ - sscop_seq so_pollack; /* VT(PA) - next expected STAT */ - short so_polldata; /* VT(PD) - SD's sent between POLLs */ - short so_connctl; /* VT(CC) - un-ack'd BGN,END,ER,RS */ - u_char so_sendconn; /* VT(SQ) - last BGN,ER,RS sent */ - - /* Receiver variables */ - sscop_seq so_rcvnext; /* VR(R) - next SD to receive */ - sscop_seq so_rcvhigh; /* VR(H) - next highest SD to receive */ - sscop_seq so_rcvmax; /* VR(MR) - max SD to receive + 1 */ - u_char so_rcvconn; /* VR(SQ) - last BGN,ER,RS received */ - - /* PDU queues */ - KBuffer *so_xmit_hd; /* SD transmission queue head */ - KBuffer *so_xmit_tl; /* SD transmission queue tail */ - struct pdu_hdr *so_rexmit_hd; /* SD retransmission queue head */ - struct pdu_hdr *so_rexmit_tl; /* SD retransmission queue head */ - struct pdu_hdr *so_pack_hd; /* SD pending ack queue head */ - struct pdu_hdr *so_pack_tl; /* SD pending ack queue tail */ - struct pdu_hdr *so_recv_hd; /* SD receive queue head */ - struct pdu_hdr *so_recv_tl; /* SD receive queue tail */ - - /* Connection parameters */ - struct sscop_parms so_parm; /* Connection parameters */ - - /* Timers */ - u_short so_timer[SSCOP_T_NUM]; /* Connection timers */ - - /* Stack variables */ - Atm_connvc *so_connvc; /* Connection vcc for this stack */ - void *so_toku; /* Stack upper layer's token */ - void *so_tokl; /* Stack lower layer's token */ - void (*so_upper) /* Stack upper layer's interface */ - (int, void *, intptr_t, intptr_t); - void (*so_lower) /* Stack lower layer's interface */ - (int, void *, intptr_t, intptr_t); - u_short so_headout; /* Output buffer headroom */ -}; - -/* - * Connection States - * - * Notes: - * # - state valid only for Q.SAAL1 - * ## - state valid only for Q.2110 - */ -#define SOS_INST 0 /* Instantiated, waiting for INIT */ -#define SOS_IDLE 1 /* Idle connection */ -#define SOS_OUTCONN 2 /* Outgoing connection pending */ -#define SOS_INCONN 3 /* Incoming connection pending */ -#define SOS_OUTDISC 4 /* Outgoing disconnection pending */ -#define SOS_OUTRESYN 5 /* Outgoing resynchronization pending */ -#define SOS_INRESYN 6 /* Incoming resynchronization pending */ -#define SOS_CONRESYN 7 /* Concurrent resynch pending (#) */ -#define SOS_OUTRECOV 7 /* Outgoing recovery pending (##) */ -#define SOS_RECOVRSP 8 /* Recovery response pending (##) */ -#define SOS_INRECOV 9 /* Incoming recovery pending (##) */ -#define SOS_READY 10 /* Data transfer ready */ -#define SOS_TERM 11 /* Waiting for TERM */ - -#define SOS_MAXSTATE 11 /* Maximum state value */ -#define SOS_NUMSTATES (SOS_MAXSTATE+1)/* Number of states */ - -/* - * Connection Flags - */ -#define SOF_NOCLRBUF 0x0001 /* Clear buffers = no */ -#define SOF_REESTAB 0x0002 /* SSCOP initiated reestablishment */ -#define SOF_XMITSRVC 0x0004 /* Transmit queues need servicing */ -#define SOF_KEEPALIVE 0x0008 /* Polling in transient phase */ -#define SOF_ENDSSCOP 0x0010 /* Last END PDU, SOURCE=SSCOP */ -#define SOF_NOCREDIT 0x0020 /* Transmit window closed */ - - -/* - * SSCOP statistics - */ -struct sscop_stat { - u_long sos_connects; /* Connection instances */ - u_long sos_aborts; /* Connection aborts */ - u_long sos_maa_error[MAA_ERROR_COUNT]; /* Management errors */ -}; - -#ifdef _KERNEL - -#include - -/* - * Global function declarations - */ - /* sscop.c */ -int sscop_start(void); -int sscop_stop(void); -void sscop_maa_error(struct sscop *, int); -void sscop_abort(struct sscop *, char *); - - /* sscop_lower.c */ -void sscop_lower(int, void *, intptr_t, intptr_t); -void sscop_aa_noop_0(struct sscop *, intptr_t, intptr_t); -void sscop_aa_noop_1(struct sscop *, intptr_t, intptr_t); -void sscop_init_inst(struct sscop *, intptr_t, intptr_t); -void sscop_term_all(struct sscop *, intptr_t, intptr_t); - - /* sscop_pdu.c */ -int sscop_send_bgn(struct sscop *, int); -int sscop_send_bgak(struct sscop *); -int sscop_send_bgrej(struct sscop *); -int sscop_send_end(struct sscop *, int); -int sscop_send_endak(struct sscop *); -int sscop_send_rs(struct sscop *); -int sscop_send_rsak(struct sscop *); -int sscop_send_er(struct sscop *); -int sscop_send_erak(struct sscop *); -int sscop_send_poll(struct sscop *); -int sscop_send_stat(struct sscop *, sscop_seq); -int sscop_send_ustat(struct sscop *, sscop_seq); -int sscop_send_ud(struct sscop *, KBuffer *); -void sscop_pdu_print(const struct sscop *, - const KBuffer *, const char *); - - /* sscop_sigaa.c */ -void sscop_estreq_idle(struct sscop *, intptr_t, intptr_t); -void sscop_estrsp_inconn(struct sscop *, intptr_t, intptr_t); -void sscop_relreq_outconn(struct sscop *, intptr_t, intptr_t); -void sscop_relreq_inconn(struct sscop *, intptr_t, intptr_t); -void sscop_relreq_ready(struct sscop *, intptr_t, intptr_t); -void sscop_datreq_ready(struct sscop *, intptr_t, intptr_t); -void sscop_udtreq_all(struct sscop *, intptr_t, intptr_t); - - /* sscop_sigcpcs.c */ -void sscop_noop(struct sscop *, KBuffer *, caddr_t); -void sscop_bgn_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_bgn_outdisc(struct sscop *, KBuffer *, caddr_t); -void sscop_bgn_outresyn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgn_inresyn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgak_error(struct sscop *, KBuffer *, caddr_t); -void sscop_bgak_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_bgak_outconn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgrej_error(struct sscop *, KBuffer *, caddr_t); -void sscop_bgrej_outconn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgrej_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgrej_outresyn(struct sscop *, KBuffer *, caddr_t); -void sscop_bgrej_ready(struct sscop *, KBuffer *, caddr_t); -void sscop_end_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_end_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_end_outdisc(struct sscop *, KBuffer *, caddr_t); -void sscop_endak_error(struct sscop *, KBuffer *, caddr_t); -void sscop_endak_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_endak_outdisc(struct sscop *, KBuffer *, caddr_t); -void sscop_endak_ready(struct sscop *, KBuffer *, caddr_t); -void sscop_rs_error(struct sscop *, KBuffer *, caddr_t); -void sscop_rs_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_rsak_error(struct sscop *, KBuffer *, caddr_t); -void sscop_rsak_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_rsak_outresyn(struct sscop *, KBuffer *, caddr_t); -void sscop_sd_error(struct sscop *, KBuffer *, caddr_t); -void sscop_sd_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_sd_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_poll_error(struct sscop *, KBuffer *, caddr_t); -void sscop_poll_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_poll_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_stat_error(struct sscop *, KBuffer *, caddr_t); -void sscop_stat_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_stat_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_stat_ready(struct sscop *, KBuffer *, caddr_t); -void sscop_ustat_error(struct sscop *, KBuffer *, caddr_t); -void sscop_ustat_idle(struct sscop *, KBuffer *, caddr_t); -void sscop_ustat_inconn(struct sscop *, KBuffer *, caddr_t); -void sscop_ustat_ready(struct sscop *, KBuffer *, caddr_t); -void sscop_ud_all(struct sscop *, KBuffer *, caddr_t); -void sscop_md_all(struct sscop *, KBuffer *, caddr_t); - - /* sscop_subr.c */ -KBuffer * sscop_stat_getelem(KBuffer *, sscop_seq *); -struct pdu_hdr *sscop_pack_locate(struct sscop *, sscop_seq); -void sscop_pack_free(struct sscop *, sscop_seq); -void sscop_rexmit_insert(struct sscop *, struct pdu_hdr *); -void sscop_rexmit_unlink(struct sscop *, struct pdu_hdr *); -void sscop_xmit_drain(struct sscop *); -int sscop_recv_insert(struct sscop *, struct pdu_hdr *); -void sscop_rcvr_drain(struct sscop *); -void sscop_service_xmit(struct sscop *); -int sscop_is_rexmit(struct sscop *, u_char); -void sscop_set_poll(struct sscop *); - - /* sscop_timer.c */ -void sscop_timeout(struct atm_time *); - - /* sscop_upper.c */ -void sscop_upper(int, void *, intptr_t, intptr_t); - - /* q2110_sigaa.c */ - - /* q2110_sigcpcs.c */ - - /* q2110_subr.c */ -void q2110_clear_xmit(struct sscop *); -void q2110_init_state(struct sscop *); -void q2110_prep_retrieve(struct sscop *); -void q2110_prep_recovery(struct sscop *); -void q2110_deliver_data(struct sscop *); -void q2110_error_recovery(struct sscop *); - - /* qsaal1_sigaa.c */ - - /* qsaal1_sigcpcs.c */ - - /* qsaal1_subr.c */ -void qsaal1_reestablish(struct sscop *); -void qsaal1_reset_xmit(struct sscop *); -void qsaal1_reset_rcvr(struct sscop *); -void qsaal1_clear_connection(struct sscop *); - - -/* - * External variables - */ -extern uma_zone_t sscop_zone; -extern int sscop_vccnt; -extern struct sscop *sscop_head; -extern struct sscop_stat sscop_stat; -extern struct atm_time sscop_timer; -extern void (*(*sscop_qsaal_aatab[])) - (struct sscop *, intptr_t, intptr_t); -extern void (*(*sscop_q2110_aatab[])) - (struct sscop *, intptr_t, intptr_t); -extern void (*(*sscop_qsaal_pdutab[])) - (struct sscop *, KBuffer *, caddr_t); -extern void (*(*sscop_q2110_pdutab[])) - (struct sscop *, KBuffer *, caddr_t); - -#endif /* _KERNEL */ - -#endif /* _UNI_SSCOP_VAR_H */ Property changes on: head/sys/netatm/uni/sscop_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_decode.h =================================================================== --- head/sys/netatm/uni/unisig_decode.h (revision 179307) +++ head/sys/netatm/uni/unisig_decode.h (nonexistent) @@ -1,76 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message formats - * - */ - -#ifndef _UNI_SIG_DECODE_H -#define _UNI_SIG_DECODE_H - - -/* - * Values specifying which IEs are required in messages - */ -#define IE_NA 0 -#define IE_MAND 1 -#define IE_OPT 2 - -/* - * Structure for information element decoding information - */ -struct ie_ent { - u_char ident; /* IE identifier */ - int min_len; /* Min. length */ - int max_len; /* Max. length */ - int p_idx; /* IE pointer index in msg */ - int (*decode) /* Decoding function */ - (struct usfmt *, struct ie_generic *); -}; - -#define IE_OFF_SIZE(f) \ - offsetof(struct ie_generic, f), (sizeof(((struct ie_generic *) 0)->f)) - - -/* - * Structure to define a field-driven decoding table (for AAL - * parameters and ATM user cell rate IEs) - */ -struct ie_decode_tbl { - u_char ident; - int len; - int f_offs; - int f_size; -}; - -#endif /* _UNI_SIG_DECODE_H */ Property changes on: head/sys/netatm/uni/unisig_decode.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_mbuf.c =================================================================== --- head/sys/netatm/uni/unisig_mbuf.c (revision 179307) +++ head/sys/netatm/uni/unisig_mbuf.c (nonexistent) @@ -1,497 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message buffer handling routines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Initialize a unisig formatting structure - * - * Arguments: - * usf pointer to a unisig formatting structure - * usp pointer to a unisig protocol instance - * buf pointer to a buffer chain (decode only) - * op operation code (encode or decode) - * headroom headroom to leave in first buffer - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_init(usf, usp, buf, op, headroom) - struct usfmt *usf; - struct unisig *usp; - KBuffer *buf; - int op; - int headroom; -{ - KBuffer *m; - - ATM_DEBUG3("usf_init: usf=%p, buf=%p, op=%d\n", - usf, buf, op); - - /* - * Check parameters - */ - if (!usf) - return(EINVAL); - - switch(op) { - - case USF_ENCODE: - /* - * Get a buffer - */ - KB_ALLOCPKT(m, USF_MIN_ALLOC, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return(ENOMEM); - KB_LEN(m) = 0; - if (headroom < KB_BFRLEN(m)) { - KB_HEADSET(m, headroom); - } - break; - - case USF_DECODE: - /* - * Verify buffer address - */ - if (!buf) - return(EINVAL); - m = buf; - break; - - default: - return(EINVAL); - } - - /* - * Save parameters in formatting structure - */ - usf->usf_m_addr = m; - usf->usf_m_base = m; - usf->usf_loc = 0; - usf->usf_op = op; - usf->usf_sig = usp; - - return(0); -} - - -/* - * Get or put the next byte of a signalling message - * - * Arguments: - * usf pointer to a unisig formatting structure - * c pointer to the byte to send from or receive into - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_byte(usf, c) - struct usfmt *usf; - u_char *c; -{ - u_char *mp; - KBuffer *m = usf->usf_m_addr, *m1; - int space; - - switch (usf->usf_op) { - - case USF_DECODE: - /* - * Make sure we're not past the end of the buffer - * (allowing for zero-length buffers) - */ - while (usf->usf_loc >= KB_LEN(m)) { - if (KB_NEXT(usf->usf_m_addr)) { - usf->usf_m_addr = m = KB_NEXT(usf->usf_m_addr); - usf->usf_loc = 0; - } else { - return(EMSGSIZE); - } - } - - /* - * Get the data from the buffer - */ - KB_DATASTART(m, mp, u_char *); - *c = mp[usf->usf_loc]; - usf->usf_loc++; - break; - - case USF_ENCODE: - /* - * If the current buffer is full, get another - */ - KB_TAILROOM(m, space); - if (space == 0) { - KB_ALLOC(m1, USF_MIN_ALLOC, KB_F_NOWAIT, KB_T_DATA); - if (m1 == NULL) - return(ENOMEM); - KB_LEN(m1) = 0; - KB_LINK(m1, m); - usf->usf_m_addr = m = m1; - usf->usf_loc = 0; - } - - /* - * Put the data into the buffer - */ - KB_DATASTART(m, mp, u_char *); - mp[usf->usf_loc] = *c; - KB_TAILADJ(m, 1); - usf->usf_loc++; - break; - - default: - /* - * Invalid operation code - */ - return(EINVAL); - } - - return(0); - -} - -/* - * Get or put a short integer - * - * Arguments: - * usf pointer to a unisig formatting structure - * s pointer to a short to send from or receive into - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_short(usf, s) - struct usfmt *usf; - u_short *s; - -{ - int rc; - union { - u_short value; - u_char b[sizeof(u_short)]; - } tval; - - tval.value = 0; - if (usf->usf_op == USF_ENCODE) - tval.value = htons(*s); - - if ((rc = usf_byte(usf, &tval.b[0])) != 0) - return(rc); - if ((rc = usf_byte(usf, &tval.b[1])) != 0) - return(rc); - - if (usf->usf_op == USF_DECODE) - *s = ntohs(tval.value); - - return(0); -} - - -/* - * Get or put a 3-byte integer - * - * Arguments: - * usf pointer to a unisig formatting structure - * i pointer to an integer to send from or receive into - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_int3(usf, i) - struct usfmt *usf; - u_int *i; - -{ - int j, rc; - union { - u_int value; - u_char b[sizeof(u_int)]; - } tval; - - tval.value = 0; - - if (usf->usf_op == USF_ENCODE) - tval.value = htonl(*i); - - for (j=0; j<3; j++) { - rc = usf_byte(usf, &tval.b[j+sizeof(u_int)-3]); - if (rc) - return(rc); - } - - if (usf->usf_op == USF_DECODE) - *i = ntohl(tval.value); - - return(rc); -} - - -/* - * Get or put an integer - * - * Arguments: - * usf pointer to a unisig formatting structure - * i pointer to an integer to send from or receive into - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_int(usf, i) - struct usfmt *usf; - u_int *i; - -{ - int j, rc; - union { - u_int value; - u_char b[sizeof(u_int)]; - } tval; - - if (usf->usf_op == USF_ENCODE) - tval.value = htonl(*i); - - for (j=0; j<4; j++) { - rc = usf_byte(usf, &tval.b[j+sizeof(u_int)-4]); - if (rc) - return(rc); - } - - if (usf->usf_op == USF_DECODE) - *i = ntohl(tval.value); - - return(rc); -} - - -/* - * Get or put an extented field - * - * An extented field consists of a string of bytes. All but the last - * byte of the field has the high-order bit set to zero. When decoding, - * this routine will read bytes until either the input is exhausted or - * a byte with a high-order one is found. Whe encoding, it will take an - * unsigned integer and write until the highest-order one bit has been - * written. - * - * Arguments: - * usf pointer to a unisig formatting structure - * i pointer to an integer to send from or receive into - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_ext(usf, i) - struct usfmt *usf; - u_int *i; - -{ - int j, rc; - u_char c, buff[sizeof(u_int)+1]; - u_int val; - union { - u_int value; - u_char b[sizeof(u_int)]; - } tval; - - switch(usf->usf_op) { - - case USF_ENCODE: - val = *i; - j = 0; - while (val) { - tval.value = htonl(val); - buff[j] = tval.b[sizeof(u_int)-1] & UNI_IE_EXT_MASK; - val >>= 7; - j++; - } - j--; - buff[0] |= UNI_IE_EXT_BIT; - for (; j>=0; j--) { - rc = usf_byte(usf, &buff[j]); - if (rc) - return(rc); - } - break; - - case USF_DECODE: - c = 0; - val = 0; - while (!(c & UNI_IE_EXT_BIT)) { - rc = usf_byte(usf, &c); - if (rc) - return(rc); - val = (val << 7) + (c & UNI_IE_EXT_MASK); - } - *i = val; - break; - - default: - return(EINVAL); - } - - return(0); -} - - -/* - * Count the bytes remaining to be decoded - * - * Arguments: - * usf pointer to a unisig formatting structure - * - * Returns: - * int the number of bytes in the buffer chain remaining to - * be decoded - * - */ -int -usf_count(usf) - struct usfmt *usf; -{ - int count; - KBuffer *m = usf->usf_m_addr; - - /* - * Return zero if we're not decoding - */ - if (usf->usf_op != USF_DECODE) - return (0); - - /* - * Calculate the length of data remaining in the current buffer - */ - count = KB_LEN(m) - usf->usf_loc; - - /* - * Loop through any remaining buffers, adding in their lengths - */ - while (KB_NEXT(m)) { - m = KB_NEXT(m); - count += KB_LEN(m); - } - - return(count); - -} - - -/* - * Get or put the next byte of a signalling message and return - * the byte's buffer address - * - * Arguments: - * usf pointer to a unisig formatting structure - * c pointer to the byte to send from or receive into - * bp address to store the byte's buffer address - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -usf_byte_mark(usf, c, bp) - struct usfmt *usf; - u_char *c; - u_char **bp; -{ - u_char *mp; - int rc; - - /* - * First, get/put the data byte - */ - rc = usf_byte(usf, c); - if (rc) { - - /* - * Error encountered - */ - *bp = NULL; - return (rc); - } - - /* - * Now return the buffer address of that byte - */ - KB_DATASTART(usf->usf_m_addr, mp, u_char *); - *bp = &mp[usf->usf_loc - 1]; - - return (0); -} - Property changes on: head/sys/netatm/uni/unisig_mbuf.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_var.h =================================================================== --- head/sys/netatm/uni/unisig_var.h (revision 179307) +++ head/sys/netatm/uni/unisig_var.h (nonexistent) @@ -1,329 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Protocol control blocks - * - */ - -#ifndef _UNISIG_VAR_H -#define _UNISIG_VAR_H - -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif - -#ifdef _KERNEL - -#include - -/* - * Structure containing state information for each UNI protocol - * instance. There will be one instance for each ATM device interface - * using the UNI signalling manager. - */ -struct unisig { - struct siginst us_inst; /* Header */ - struct atm_time us_time; /* Timer controls */ - void (*us_lower) /* Lower command handler */ - (int, void *, intptr_t, intptr_t); - Atm_connection *us_conn; /* Signalling connection */ - int us_cref; /* Call reference allocation */ - u_int us_retry; /* Protocol retry count */ - u_short us_headout; /* Headroom on sig ch output */ - u_char us_proto; /* Signalling version */ -}; - -#define us_next us_inst.si_next -#define us_pif us_inst.si_pif -#define us_addr us_inst.si_addr -#define us_subaddr us_inst.si_subaddr -#define us_vccq us_inst.si_vccq -#define us_state us_inst.si_state -#define us_ipserv us_inst.si_ipserv -#endif /* _KERNEL */ - -/* - * Signalling manager states - */ -#define UNISIG_NULL 0 -#define UNISIG_ADDR_WAIT 1 -#define UNISIG_INIT 2 -#define UNISIG_ACTIVE 3 -#define UNISIG_DETACH 4 - -/* - * Signalling manager events - */ -#define UNISIG_SIGMGR_TIMEOUT 0 -#define UNISIG_SIGMGR_SSCF_EST_IND 1 -#define UNISIG_SIGMGR_SSCF_EST_CNF 2 -#define UNISIG_SIGMGR_SSCF_RLS_IND 3 -#define UNISIG_SIGMGR_SSCF_RLS_CNF 4 -#define UNISIG_SIGMGR_SSCF_DATA_IND 5 -#define UNISIG_SIGMGR_SSCF_UDATA_IND 6 -#define UNISIG_SIGMGR_CALL_CLEARED 7 -#define UNISIG_SIGMGR_DETACH 8 -#define UNISIG_SIGMGR_ADDR_SET 9 - -/* - * Signalling manager timer values - */ -#define UNISIG_SSCF_TIMEOUT (3 * ATM_HZ) - - -#ifdef _KERNEL -/* - * UNI Virtual Channel Connection control block. All information - * regarding the state of a UNI-controlled VCC will be recorded here. - * There will be one UNI VCC control block for each UNI-controlled - * VCC. - */ -struct unisig_vccb { - struct vccb vcp_hdr; /* Generic VCCB */ - u_short uv_retry; /* Xmit retry count */ - u_int uv_call_ref; /* Q.2931 call reference */ -}; - -#define uv_type vcp_hdr.vc_type -#define uv_proto vcp_hdr.vc_proto -#define uv_sstate vcp_hdr.vc_sstate -#define uv_ustate vcp_hdr.vc_ustate -#define uv_pif vcp_hdr.vc_pif -#define uv_nif vcp_hdr.vc_nif -#define uv_sigelem vcp_hdr.vc_sigelem -#define uv_time vcp_hdr.vc_time -#define uv_vpi vcp_hdr.vc_vpi -#define uv_vci vcp_hdr.vc_vci -#define uv_connvc vcp_hdr.vc_connvc -#define uv_ipdus vcp_hdr.vc_ipdus -#define uv_opdus vcp_hdr.vc_opdus -#define uv_ibytes vcp_hdr.vc_ibytes -#define uv_obytes vcp_hdr.vc_obytes -#define uv_ierrors vcp_hdr.vc_ierrors -#define uv_oerrors vcp_hdr.vc_oerrors -#define uv_tstamp vcp_hdr.vc_tstamp -#endif /* _KERNEL */ - -/* - * UNI VCC protocol states. Taken from The ATM Forum UNI 3.0 (section - * 5.2.1.1) - */ -#define UNI_NULL 0 /* No call exists */ -#define UNI_CALL_INITIATED 1 /* Initiating call */ -#define UNI_CALL_OUT_PROC 3 /* Outgoing call proceeding */ -#define UNI_CALL_DELIVERED 4 /* Not supported */ -#define UNI_CALL_PRESENT 6 /* Call coming in */ -#define UNI_CALL_RECEIVED 7 /* Not supported */ -#define UNI_CONNECT_REQUEST 8 /* Call coming in */ -#define UNI_CALL_IN_PROC 9 /* Incoming call proceeding */ -#define UNI_ACTIVE 10 /* Call is established */ -#define UNI_RELEASE_REQUEST 11 /* Clearing call */ -#define UNI_RELEASE_IND 12 /* Network disconnecting */ - -/* - * Additional states required for internal management of VCCs - */ -#define UNI_SSCF_RECOV 13 /* Signalling chan recovery */ -#define UNI_FREE 14 /* Waiting for user to free */ -#define UNI_PVC_ACTIVE 15 /* PVC Active */ -#define UNI_PVC_ACT_DOWN 16 /* PVC Active - i/f down */ - -/* - * UNI VCC events - */ -#define UNI_VC_TIMEOUT 0 /* Timer expired */ -#define UNI_VC_CALLP_MSG 1 /* CALL PROCEEDING message */ -#define UNI_VC_CONNECT_MSG 2 /* CONNECT message */ -#define UNI_VC_CNCTACK_MSG 3 /* CONNECT ACK message */ -#define UNI_VC_SETUP_MSG 4 /* SETUP message */ -#define UNI_VC_RELEASE_MSG 5 /* RELEASE message */ -#define UNI_VC_RLSCMP_MSG 6 /* RELEASE COMPLETE message */ -#define UNI_VC_STATUS_MSG 7 /* STATUS message */ -#define UNI_VC_STATUSENQ_MSG 8 /* STATUS ENQ message */ -#define UNI_VC_ADDP_MSG 9 /* ADD PARTY message */ -#define UNI_VC_ADDPACK_MSG 10 /* ADD PARTY ACK message */ -#define UNI_VC_ADDPREJ_MSG 11 /* ADD PARTY REJ message */ -#define UNI_VC_DROP_MSG 12 /* DROP PARTY message */ -#define UNI_VC_DROPACK_MSG 13 /* DROP PARTY ACK message */ -#define UNI_VC_SETUP_CALL 14 /* Setup routine called */ -#define UNI_VC_ACCEPT_CALL 15 /* Accept call routine called */ -#define UNI_VC_REJECT_CALL 16 /* Reject call routine called */ -#define UNI_VC_RELEASE_CALL 17 /* Release routine called */ -#define UNI_VC_ABORT_CALL 18 /* Abort routine called */ -#define UNI_VC_SAAL_FAIL 19 /* Signalling AAL failed */ -#define UNI_VC_SAAL_ESTAB 20 /* Signalling AAL back up */ - - -#ifdef _KERNEL -/* - * UNI Timer Values. These values (except for T317) are taken from - * The ATM Forum UNI 3.0 (section 5.7.2). - */ -#define UNI_T303 (4 * ATM_HZ) -#define UNI_T308 (30 * ATM_HZ) -#define UNI_T309 (10 * ATM_HZ) -#define UNI_T310 (10 * ATM_HZ) -#define UNI_T313 (4 * ATM_HZ) -#define UNI_T316 (120 * ATM_HZ) -#define UNI_T317 (60 * ATM_HZ) -#define UNI_T322 (4 * ATM_HZ) -#define UNI_T398 (4 * ATM_HZ) -#define UNI_T399 (14 * ATM_HZ) - - -/* - * Timer macros - */ -#define UNISIG_TIMER(s, t) atm_timeout(&(s)->us_time, (t), unisig_timer) -#define UNISIG_CANCEL(s) atm_untimeout(&(s)->us_time) -#define UNISIG_VC_TIMER(v, t) atm_timeout(&(v)->vc_time, (t), unisig_vctimer) -#define UNISIG_VC_CANCEL(v) atm_untimeout(&(v)->vc_time) - - -/* - * Global function declarations - */ -struct usfmt; -struct unisig_msg; - - /* unisig_decode.c */ -int usf_dec_msg(struct usfmt *, struct unisig_msg *); - - /* unisig_encode.c */ -int usf_enc_msg(struct usfmt *, struct unisig_msg *); - - /* unisig_if.c */ -int unisig_start(void); -int unisig_stop(void); -int unisig_free(struct vccb *); - - /* unisig_mbuf.c */ -int usf_init(struct usfmt *, struct unisig *, KBuffer *, int, int); -int usf_byte(struct usfmt *, u_char *); -int usf_short(struct usfmt *, u_short *); -int usf_int3(struct usfmt *, u_int *); -int usf_int(struct usfmt *, u_int *); -int usf_ext(struct usfmt *, u_int *); -int usf_count(struct usfmt *); -int usf_byte_mark(struct usfmt *, u_char *, u_char **); - - /* unisig_msg.c */ -struct ie_generic; -void unisig_cause_from_attr(struct ie_generic *, - Atm_attributes *); -void unisig_cause_from_msg(struct ie_generic *, - struct unisig_msg *, int); -int unisig_send_msg(struct unisig *, - struct unisig_msg *); -int unisig_send_setup(struct unisig *, - struct unisig_vccb *); -int unisig_send_release(struct unisig *, - struct unisig_vccb *, - struct unisig_msg *, - int); -int unisig_send_release_complete(struct unisig *, - struct unisig_vccb *, - struct unisig_msg *, - int); -int unisig_send_status(struct unisig *, - struct unisig_vccb *, - struct unisig_msg *, - int); -int unisig_rcv_msg(struct unisig *, KBuffer *); - - /* unisig_print.c */ -void usp_print_msg(struct unisig_msg *, int); - - /* unisig_proto.c */ -void unisig_timer(struct atm_time *); -void unisig_vctimer(struct atm_time *); -void unisig_saal_ctl(int, void *, void *); -void unisig_saal_data(void *, KBuffer *); -caddr_t unisig_getname(void *); -void unisig_connected(void *); -void unisig_cleared(void *, struct t_atm_cause *); - - /* unisig_sigmgr_state.c */ -int unisig_sigmgr_state(struct unisig *, int, - KBuffer *); - - /* unisig_subr.c */ -void unisig_cause_attr_from_user(Atm_attributes *, int); -void unisig_cause_attr_from_ie(Atm_attributes *, - struct ie_generic *); -int unisig_open_vcc(struct unisig *, Atm_connvc *); -int unisig_close_vcc(struct unisig *, - struct unisig_vccb *); -int unisig_clear_vcc(struct unisig *, - struct unisig_vccb *, int); -void unisig_switch_reset(struct unisig *, int); -void unisig_save_attrs(struct unisig *, struct unisig_msg *, - Atm_attributes *); -int unisig_set_attrs(struct unisig *, struct unisig_msg *, - Atm_attributes *); - - /* unisig_util.c */ -void unisig_free_msg(struct unisig_msg *); -int unisig_verify_vccb(struct unisig *, - struct unisig_vccb *); -struct unisig_vccb * - unisig_find_conn(struct unisig *, u_int); -struct unisig_vccb * - unisig_find_vpvc(struct unisig *, int, int, - u_char); -int unisig_alloc_call_ref(struct unisig *); -char * unisig_addr_print(Atm_addr *); -void unisig_print_mbuf(KBuffer *); -void unisig_print_buffer(KBuffer *); - - /* unisig_vc_state.c */ -int unisig_vc_state(struct unisig *, - struct unisig_vccb *, - int, - struct unisig_msg *); - - -/* - * External variables - */ -extern uma_zone_t unisig_vc_zone; -extern uma_zone_t unisig_msg_zone; -extern uma_zone_t unisig_ie_zone; - -#ifdef SYSCTL_DECL -SYSCTL_DECL(_net_harp_uni); -#endif - -#endif /* _KERNEL */ -#endif /* _UNISIG_VAR_H */ Property changes on: head/sys/netatm/uni/unisig_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/sscop_upper.c =================================================================== --- head/sys/netatm/uni/sscop_upper.c (revision 179307) +++ head/sys/netatm/uni/sscop_upper.c (nonexistent) @@ -1,421 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI Support - * --------------------- - * - * SSCOP - CPCS SAP interface processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -/* - * Local functions - */ -static caddr_t sscop_pdu_receive(KBuffer *, struct sscop *, int *); - - -/* - * Local variables - */ -static union { - struct bgn_pdu t_bgn; - struct bgak_pdu t_bgak; - struct end_pdu t_end; - struct endak_q2110_pdu t_endak_q2110; - struct endak_qsaal_pdu t_endak_qsaal; - struct rs_pdu t_rs; - struct rsak_q2110_pdu t_rsak_q2110; - struct rsak_qsaal_pdu t_rsak_qsaal; - struct bgrej_pdu t_bgrej; - struct sd_pdu t_sd; - struct sdp_pdu t_sdp; - struct er_pdu t_er; - struct poll_pdu t_poll; - struct stat_pdu t_stat; - struct ustat_pdu t_ustat; - struct ud_pdu t_ud; - struct md_pdu t_md; - struct erak_pdu t_erak; -} sscop_trailer; - - -/* - * PDU length validation table - */ -struct pdulen { - int min; - int max; -}; - -static struct pdulen qsaal_pdulen[] = { - {0, 0}, - {sizeof(struct bgn_pdu), sizeof(struct bgn_pdu)}, - {sizeof(struct bgak_pdu), sizeof(struct bgak_pdu)}, - {sizeof(struct end_pdu), sizeof(struct end_pdu)}, - {sizeof(struct endak_qsaal_pdu),sizeof(struct endak_qsaal_pdu)}, - {sizeof(struct rs_pdu), sizeof(struct rs_pdu)}, - {sizeof(struct rsak_qsaal_pdu), sizeof(struct rsak_qsaal_pdu)}, - {sizeof(struct bgrej_pdu), sizeof(struct bgrej_pdu)}, - {sizeof(struct sd_pdu), sizeof(struct sd_pdu) + PDU_MAX_INFO}, - {sizeof(struct sdp_pdu), sizeof(struct sdp_pdu) + PDU_MAX_INFO}, - {sizeof(struct poll_pdu), sizeof(struct poll_pdu)}, - {sizeof(struct stat_pdu), sizeof(struct stat_pdu) + PDU_MAX_STAT}, - {sizeof(struct ustat_pdu), sizeof(struct ustat_pdu)}, - {sizeof(struct ud_pdu), sizeof(struct ud_pdu) + PDU_MAX_INFO}, - {sizeof(struct md_pdu), sizeof(struct md_pdu) + PDU_MAX_INFO}, - {0, 0} -}; - -static struct pdulen q2110_pdulen[] = { - {0, 0}, - {sizeof(struct bgn_pdu), sizeof(struct bgn_pdu) + PDU_MAX_UU}, - {sizeof(struct bgak_pdu), sizeof(struct bgak_pdu) + PDU_MAX_UU}, - {sizeof(struct end_pdu), sizeof(struct end_pdu) + PDU_MAX_UU}, - {sizeof(struct endak_q2110_pdu),sizeof(struct endak_q2110_pdu)}, - {sizeof(struct rs_pdu), sizeof(struct rs_pdu) + PDU_MAX_UU}, - {sizeof(struct rsak_q2110_pdu), sizeof(struct rsak_q2110_pdu)}, - {sizeof(struct bgrej_pdu), sizeof(struct bgrej_pdu) + PDU_MAX_UU}, - {sizeof(struct sd_pdu), sizeof(struct sd_pdu) + PDU_MAX_INFO}, - {sizeof(struct er_pdu), sizeof(struct er_pdu)}, - {sizeof(struct poll_pdu), sizeof(struct poll_pdu)}, - {sizeof(struct stat_pdu), sizeof(struct stat_pdu) + PDU_MAX_STAT}, - {sizeof(struct ustat_pdu), sizeof(struct ustat_pdu)}, - {sizeof(struct ud_pdu), sizeof(struct ud_pdu) + PDU_MAX_INFO}, - {sizeof(struct md_pdu), sizeof(struct md_pdu) + PDU_MAX_INFO}, - {sizeof(struct erak_pdu), sizeof(struct erak_pdu)} -}; - - -/* - * PDUs with Pad Length Fields - */ -static u_char qsaal_padlen[] = { - 0, /* --- */ - 0, /* BGN */ - 0, /* BGAK */ - 0, /* END */ - 0, /* ENDAK */ - 0, /* RS */ - 0, /* RSAK */ - 0, /* BGREJ */ - 1, /* SD */ - 1, /* SDP */ - 0, /* POLL */ - 0, /* STAT */ - 0, /* USTAT */ - 1, /* UD */ - 1, /* MD */ - 0 /* --- */ -}; - -static u_char q2110_padlen[] = { - 0, /* --- */ - 1, /* BGN */ - 1, /* BGAK */ - 1, /* END */ - 0, /* ENDAK */ - 1, /* RS */ - 0, /* RSAK */ - 1, /* BGREJ */ - 1, /* SD */ - 0, /* ER */ - 0, /* POLL */ - 0, /* STAT */ - 0, /* USTAT */ - 1, /* UD */ - 1, /* MD */ - 0 /* ERAK */ -}; - - -/* - * SSCOP Upper Stack Command Handler - * - * This function will receive all of the stack commands issued from the - * layer below SSCOP (ie. CPCS). Currently, only incoming PDUs will be - * received here. The appropriate processing function will be determined - * based on the received PDU type and the current sscop control block state. - * - * Arguments: - * cmd stack command code - * tok session token - * arg1 command specific argument - * arg2 command specific argument - * - * Returns: - * none - * - */ -void -sscop_upper(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - struct sscop *sop = (struct sscop *)tok; - void (**ptab)(struct sscop *, KBuffer *, caddr_t); - void (*func)(struct sscop *, KBuffer *, caddr_t); - caddr_t trlr; - int type; - - ATM_DEBUG5("sscop_upper: cmd=0x%x, sop=%p, state=%d, arg1=%p, arg2=%p\n", - cmd, sop, sop->so_state, (void *)arg1, (void *)arg2); - - switch (cmd) { - - case CPCS_UNITDATA_SIG: - /* - * Decode/validate received PDU - */ - trlr = sscop_pdu_receive((KBuffer *)arg1, sop, &type); - if (trlr == NULL) { - return; - } - - /* - * Validate sscop state - */ - if (sop->so_state > SOS_MAXSTATE) { - log(LOG_ERR, - "sscop_upper: invalid state sop=%p, state=%d\n", - sop, sop->so_state); - KB_FREEALL((KBuffer *)arg1); - return; - } - - /* - * Call event processing function - */ - ptab = sop->so_vers == SSCOP_VERS_QSAAL ? - sscop_qsaal_pdutab[type]: - sscop_q2110_pdutab[type]; - func = ptab[sop->so_state]; - if (func == NULL) { - log(LOG_ERR, - "sscop_upper: unsupported pdu=%d, state=%d\n", - type, sop->so_state); - break; - } - (*func)(sop, (KBuffer *)arg1, trlr); - break; - - default: - log(LOG_ERR, "sscop_upper: unknown cmd 0x%x, sop=%p\n", - cmd, sop); - } - - return; -} - - -/* - * Decode and Validate Received PDU - * - * This function will process all received SSCOP PDUs. The PDU type will be - * determined and PDU format validation will be performed. If the PDU is - * successfully decoded and validated, the buffer chain will have the PDU - * trailer removed, but any resultant zero-length buffers will NOT be freed. - * If the PDU fails validation, then the buffer chain will be freed. - * - * Arguments: - * m pointer to PDU buffer chain - * sop pointer to sscop connection block - * typep address to store PDU type - * - * Returns: - * addr pointer to (contiguous) PDU trailer - * 0 invalid PDU, buffer chain freed - * - */ -static caddr_t -sscop_pdu_receive(m, sop, typep) - KBuffer *m; - struct sscop *sop; - int *typep; -{ - KBuffer *m0, *ml, *mn; - caddr_t cp, tp; - int len, tlen, type, plen; - - /* - * Calculate PDU length and find the last two buffers in the chain - */ - len = 0; - for (m0 = m, ml = mn = NULL; m0; m0 = KB_NEXT(m0)) { - len += KB_LEN(m0); - mn = ml; - ml = m0; - } - - /* - * Make sure we've got a minimum sized PDU - */ - if (len < PDU_MIN_LEN) - goto badpdu; - - /* - * Get PDU type field - */ - if (KB_LEN(ml) >= PDU_MIN_LEN) { - KB_DATAEND(ml, tp, caddr_t); - tp -= PDU_MIN_LEN; - } else { - KB_DATAEND(mn, tp, caddr_t); - tp -= (PDU_MIN_LEN - KB_LEN(ml)); - } - *typep = type = *tp & PT_TYPE_MASK; - - /* - * Check up on PDU length - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) { - if ((len < (tlen = qsaal_pdulen[type].min)) || - (len > qsaal_pdulen[type].max) || - (len & PDU_LEN_MASK)) - goto badpdu; - } else { - if ((len < (tlen = q2110_pdulen[type].min)) || - (len > q2110_pdulen[type].max) || - (len & PDU_LEN_MASK)) - goto badpdu; - } - - /* - * Get a contiguous, aligned PDU trailer and adjust buffer - * controls to remove trailer - */ - if (KB_LEN(ml) >= tlen) { - /* - * Trailer is contained in last buffer - */ - KB_TAILADJ(ml, -tlen); - KB_DATAEND(ml, cp, caddr_t); - if ((intptr_t)cp & PDU_ADDR_MASK) { - /* - * Trailer not aligned in buffer, use local memory - */ - bcopy(cp, (caddr_t)&sscop_trailer, tlen); - cp = (caddr_t)&sscop_trailer; - } - } else { - /* - * Trailer is split across buffers, use local memory - */ - caddr_t cp1; - int off = tlen - KB_LEN(ml); - - cp = (caddr_t)&sscop_trailer; - - /* - * Ensure trailer is within last two buffers - */ - if ((mn == NULL) || (KB_LEN(mn) < off)) - goto badpdu; - - KB_DATASTART(ml, cp1, caddr_t); - bcopy(cp1, cp + off, KB_LEN(ml)); - KB_LEN(ml) = 0; - KB_TAILADJ(mn, -off); - KB_DATAEND(mn, cp1, caddr_t); - bcopy(cp1, cp, off); - } - - /* - * Get possible PDU Pad Length - */ - if (sop->so_vers == SSCOP_VERS_QSAAL) { - if (qsaal_padlen[type]) - plen = (*tp & PT_PAD_MASK) >> PT_PAD_SHIFT; - else - plen = 0; - } else { - if (q2110_padlen[type]) - plen = (*tp & PT_PAD_MASK) >> PT_PAD_SHIFT; - else - plen = 0; - } - - /* - * Perform Pad Length adjustments - */ - if (plen) { - if (KB_LEN(ml) >= plen) { - /* - * All pad bytes in last buffer - */ - KB_TAILADJ(ml, -plen); - } else { - /* - * Pad bytes split between buffers - */ - plen -= KB_LEN(ml); - if ((mn == NULL) || (KB_LEN(mn) < plen)) - goto badpdu; - KB_LEN(ml) = 0; - KB_TAILADJ(mn, -plen); - } - } - - return (cp); - -badpdu: - /* - * This MAA Error is only supposed to be for a PDU length violation, - * but we use it for any PDU format error. - */ - sscop_maa_error(sop, 'U'); - sscop_pdu_print(sop, m, "badpdu received"); - KB_FREEALL(m); - return (NULL); -} - Property changes on: head/sys/netatm/uni/sscop_upper.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_print.c =================================================================== --- head/sys/netatm/uni/unisig_print.c (revision 179307) +++ head/sys/netatm/uni/unisig_print.c (nonexistent) @@ -1,881 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Print Q.2931 messages - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* - * Local declarations - */ -struct type_name { - char *name; - u_char type; -}; - - -/* - * Local functions - */ -static char * find_type(struct type_name *, u_char); -static void usp_print_atm_addr(Atm_addr *); -static void usp_print_ie(struct ie_generic *); -static void usp_print_ie_aalp(struct ie_generic *); -static void usp_print_ie_clrt(struct ie_generic *); -static void usp_print_ie_bbcp(struct ie_generic *); -static void usp_print_ie_bhli(struct ie_generic *); -static void usp_print_ie_blli(struct ie_generic *); -static void usp_print_ie_clst(struct ie_generic *); -static void usp_print_ie_cdad(struct ie_generic *); -static void usp_print_ie_cdsa(struct ie_generic *); -static void usp_print_ie_cgad(struct ie_generic *); -static void usp_print_ie_cgsa(struct ie_generic *); -static void usp_print_ie_caus(struct ie_generic *); -static void usp_print_ie_cnid(struct ie_generic *); -static void usp_print_ie_qosp(struct ie_generic *); -static void usp_print_ie_brpi(struct ie_generic *); -static void usp_print_ie_rsti(struct ie_generic *); -static void usp_print_ie_blsh(struct ie_generic *); -static void usp_print_ie_bnsh(struct ie_generic *); -static void usp_print_ie_bsdc(struct ie_generic *); -static void usp_print_ie_trnt(struct ie_generic *); -static void usp_print_ie_eprf(struct ie_generic *); -static void usp_print_ie_epst(struct ie_generic *); - - -/* - * Values for Q.2931 message type. - */ -static struct type_name msg_types[] = { - { "Call proceeding", 0x02 }, - { "Connect", 0x07 }, - { "Connect ACK", 0x0F }, - { "Setup", 0x05 }, - { "Release", 0x4D }, - { "Release complete", 0x5A }, - { "Restart", 0x46 }, - { "Restart ACK", 0x4E }, - { "Status", 0x7D }, - { "Status enquiry", 0x75 }, - { "Add party", 0x80 }, - { "Add party ACK", 0x81 }, - { "Add party reject", 0x82 }, - { "Drop party", 0x83 }, - { "Drop party ACK", 0x84 }, - {0, 0} -}; - - -/* - * Values for information element identifier. - */ -static struct type_name ie_types[] = { - { "Cause", 0x08 }, - { "Call state", 0x14 }, - { "Endpoint reference", 0x54 }, - { "Endpoint state", 0x55 }, - { "ATM AAL parameters", 0x58 }, - { "ATM user cell rate", 0x59 }, - { "Connection ID", 0x5A }, - { "QoS parameter", 0x5C }, - { "Broadband high layer info", 0x5D }, - { "Broadband bearer capability", 0x5E }, - { "Broadband low layer info", 0x5F }, - { "Broadband locking shift", 0x60 }, - { "Broadband non-locking shift", 0x61 }, - { "Broadband sending complete", 0x62 }, - { "Broadband repeat indicator", 0x63 }, - { "Calling party number", 0x6C }, - { "Calling party subaddress", 0x6D }, - { "Called party number", 0x70 }, - { "Called party subaddress", 0x71 }, - { "Transit net selection", 0x78 }, - { "Restart indicator", 0x79 }, - { 0, 0 } -}; - - -/* - * Search a name - type translation table - * - * Arguments: - * tbl a pointer to the table to search - * type the type to look for - * - * Returns: - * name a pointer to a character string with the name - * - */ -static char * -find_type(tbl, type) - struct type_name *tbl; - u_char type; -{ - while (type != tbl->type && tbl->name) - tbl++; - - if (tbl->name) - return(tbl->name); - else - return("-"); -} - - -/* - * Print an ATM address - * - * Arguments: - * p pointer to an Atm_address - * - * Returns: - * none - * - */ -static void -usp_print_atm_addr(p) - Atm_addr *p; -{ - char *cp; - - cp = unisig_addr_print(p); - printf("%s", cp); -} - - -/* - * Print a Q.2931 message structure - * - * Arguments: - * msg pointer to the message to print - * - * Returns: - * None - * - */ -void -usp_print_msg(msg, dir) - struct unisig_msg *msg; - int dir; -{ - char *name; - int i; - struct ie_generic *ie, *inxt; - - name = find_type(msg_types, msg->msg_type); - switch (dir) { - case UNISIG_MSG_IN: - printf("Received "); - break; - case UNISIG_MSG_OUT: - printf("Sent "); - break; - } - printf("message: %s (%x)\n", name, msg->msg_type); - printf(" Call reference: 0x%x\n", msg->msg_call_ref); -#ifdef LONG_PRINT - printf(" Message type flag: 0x%x\n", msg->msg_type_flag); - printf(" Message type action: 0x%x\n", msg->msg_type_action); - printf(" Message length: %d\n", msg->msg_length); - for (i=0; imsg_ie_vec[i]; - while (ie) { - inxt = ie->ie_next; - usp_print_ie(ie); - ie = inxt; - } - } -#else - for (i=0; imsg_ie_vec[i]; - while (ie) { - inxt = ie->ie_next; - name = find_type(ie_types, ie->ie_ident); - if (ie->ie_ident == UNI_IE_CAUS || - ie->ie_ident == UNI_IE_RSTI || - ie->ie_ident == UNI_IE_CLST) { - usp_print_ie(ie); - } else { - printf(" Information element: %s (0x%x)\n", - name, ie->ie_ident); - } - ie = inxt; - } - } -#endif -} - - -/* - * Print a Q.2931 information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie(ie) - struct ie_generic *ie; -{ - char *name; - - while (ie) { - name = find_type(ie_types, ie->ie_ident); - printf(" Information element: %s (0x%x)\n", - name, ie->ie_ident); -#ifdef LONG_PRINT - printf(" Coding: 0x%x\n", - ie->ie_coding); - printf(" Flag: 0x%x\n", ie->ie_flag); - printf(" Action: 0x%x\n", - ie->ie_action); - printf(" Length: %d\n", ie->ie_length); -#endif - - switch (ie->ie_ident) { - case UNI_IE_AALP: - usp_print_ie_aalp(ie); - break; - case UNI_IE_CLRT: - usp_print_ie_clrt(ie); - break; - case UNI_IE_BBCP: - usp_print_ie_bbcp(ie); - break; - case UNI_IE_BHLI: - usp_print_ie_bhli(ie); - break; - case UNI_IE_BLLI: - usp_print_ie_blli(ie); - break; - case UNI_IE_CLST: - usp_print_ie_clst(ie); - break; - case UNI_IE_CDAD: - usp_print_ie_cdad(ie); - break; - case UNI_IE_CDSA: - usp_print_ie_cdsa(ie); - break; - case UNI_IE_CGAD: - usp_print_ie_cgad(ie); - break; - case UNI_IE_CGSA: - usp_print_ie_cgsa(ie); - break; - case UNI_IE_CAUS: - usp_print_ie_caus(ie); - break; - case UNI_IE_CNID: - usp_print_ie_cnid(ie); - break; - case UNI_IE_QOSP: - usp_print_ie_qosp(ie); - break; - case UNI_IE_BRPI: - usp_print_ie_brpi(ie); - break; - case UNI_IE_RSTI: - usp_print_ie_rsti(ie); - break; - case UNI_IE_BLSH: - usp_print_ie_blsh(ie); - break; - case UNI_IE_BNSH: - usp_print_ie_bnsh(ie); - break; - case UNI_IE_BSDC: - usp_print_ie_bsdc(ie); - break; - case UNI_IE_TRNT: - usp_print_ie_trnt(ie); - break; - case UNI_IE_EPRF: - usp_print_ie_eprf(ie); - break; - case UNI_IE_EPST: - usp_print_ie_epst(ie); - break; - } - ie = ie->ie_next; - } -} - - -/* - * Print an AAL parameters information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_aalp(ie) - struct ie_generic *ie; -{ - printf(" AAL type: %d\n", ie->ie_aalp_aal_type); - switch(ie->ie_aalp_aal_type) { - case UNI_IE_AALP_AT_AAL1: - printf(" Subtype: 0x%x\n", - ie->ie_aalp_1_subtype); - printf(" CBR rate: 0x%x\n", - ie->ie_aalp_1_cbr_rate); - printf(" Multiplier: 0x%x\n", - ie->ie_aalp_1_multiplier); - printf(" Clock rcvry: 0x%x\n", - ie->ie_aalp_1_clock_recovery); - printf(" Err corr: 0x%x\n", - ie->ie_aalp_1_error_correction); - printf(" Struct data: 0x%x\n", - ie->ie_aalp_1_struct_data_tran); - printf(" Partial cells: 0x%x\n", - ie->ie_aalp_1_partial_cells); - break; - case UNI_IE_AALP_AT_AAL3: - printf(" Fwd max SDU: %d\n", - ie->ie_aalp_4_fwd_max_sdu); - printf(" Bkwd max SDU: %d\n", - ie->ie_aalp_4_bkwd_max_sdu); - printf(" MID range: %d\n", - ie->ie_aalp_4_mid_range); - printf(" Mode: 0x%x\n", - ie->ie_aalp_4_mode); - printf(" SSCS type: 0x%x\n", - ie->ie_aalp_4_sscs_type); - break; - case UNI_IE_AALP_AT_AAL5: - printf(" Fwd max SDU: %d\n", - ie->ie_aalp_5_fwd_max_sdu); - printf(" Bkwd max SDU: %d\n", - ie->ie_aalp_5_bkwd_max_sdu); - printf(" Mode: 0x%x\n", - ie->ie_aalp_5_mode); - printf(" SSCS type: 0x%x\n", - ie->ie_aalp_5_sscs_type); - break; - case UNI_IE_AALP_AT_AALU: - printf(" User info: 0x%x %x %x %x\n", - ie->ie_aalp_user_info[0], - ie->ie_aalp_user_info[1], - ie->ie_aalp_user_info[2], - ie->ie_aalp_user_info[3]); - break; - } -} - - -/* - * Print a user cell rate information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_clrt(ie) - struct ie_generic *ie; -{ - printf(" Forward peak: %d\n", ie->ie_clrt_fwd_peak); - printf(" Backward peak: %d\n", ie->ie_clrt_bkwd_peak); - printf(" Fwd peak 01: %d\n", ie->ie_clrt_fwd_peak_01); - printf(" Bkwd peak 01: %d\n", ie->ie_clrt_bkwd_peak_01); - printf(" Fwd sust: %d\n", ie->ie_clrt_fwd_sust); - printf(" Bkwd sust: %d\n", ie->ie_clrt_bkwd_sust); - printf(" Fwd sust 01: %d\n", ie->ie_clrt_fwd_sust_01); - printf(" Bkwd sust 01: %d\n", ie->ie_clrt_bkwd_sust_01); - printf(" Fwd burst: %d\n", ie->ie_clrt_fwd_burst); - printf(" Bkwd burst: %d\n", ie->ie_clrt_bkwd_burst); - printf(" Fwd burst 01: %d\n", ie->ie_clrt_fwd_burst_01); - printf(" Bkwd burst 01: %d\n", - ie->ie_clrt_bkwd_burst_01); - printf(" Best effort: %d\n", ie->ie_clrt_best_effort); - printf(" TM optons: 0x%x\n", - ie->ie_clrt_tm_options); -} - - -/* - * Print a broadband bearer capability information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_bbcp(ie) - struct ie_generic *ie; -{ - printf(" Bearer class: 0x%x\n", - ie->ie_bbcp_bearer_class); - printf(" Traffic type: 0x%x\n", - ie->ie_bbcp_traffic_type); - printf(" Timing req: 0x%x\n", - ie->ie_bbcp_timing_req); - printf(" Clipping: 0x%x\n", ie->ie_bbcp_clipping); - printf(" Conn config: 0x%x\n", - ie->ie_bbcp_conn_config); -} - - -/* - * Print a broadband high layer information information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_bhli(ie) - struct ie_generic *ie; -{ - int i; - - printf(" Type: 0x%x\n", ie->ie_bhli_type); - printf(" HL info: 0x"); - for (i=0; iie_length-1; i++) { - printf("%x ", ie->ie_bhli_info[i]); - } - printf("\n"); -} - - -/* - * Print a broadband low-layer information information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_blli(ie) - struct ie_generic *ie; -{ - printf(" Layer 1 ID: 0x%x\n", ie->ie_blli_l1_id); - printf(" Layer 2 ID: 0x%x\n", ie->ie_blli_l2_id); - printf(" Layer 2 mode: 0x%x\n", ie->ie_blli_l2_mode); - printf(" Layer 2 Q.933: 0x%x\n", - ie->ie_blli_l2_q933_use); - printf(" Layer 2 win: 0x%x\n", - ie->ie_blli_l2_window); - printf(" Layer 2 user: 0x%x\n", - ie->ie_blli_l2_user_proto); - printf(" Layer 3 ID: 0x%x\n", ie->ie_blli_l3_id); - printf(" Layer 3 mode: 0x%x\n", ie->ie_blli_l3_mode); - printf(" Layer 3 pkt: 0x%x\n", - ie->ie_blli_l3_packet_size); - printf(" Layer 3 win: 0x%x\n", - ie->ie_blli_l3_window); - printf(" Layer 3 user: 0x%x\n", - ie->ie_blli_l3_user_proto); - printf(" Layer 3 IPI: 0x%x\n", ie->ie_blli_l3_ipi); - printf(" Layer 3 SNAP: 0x%x\n", - ie->ie_blli_l3_snap_id); - printf(" Layer 3 OUI: 0x%x %x %x\n", - ie->ie_blli_l3_oui[0], - ie->ie_blli_l3_oui[1], - ie->ie_blli_l3_oui[2]); - printf(" Layer 3 PID: 0x%x %x\n", - ie->ie_blli_l3_pid[0], - ie->ie_blli_l3_pid[1]); -} - - -/* - * Print a call state information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_clst(ie) - struct ie_generic *ie; -{ - printf(" Call state: %d\n", - ie->ie_clst_state); -} - - -/* - * Print a called party number information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_cdad(ie) - struct ie_generic *ie; -{ - printf(" ATM addr: "); - usp_print_atm_addr(&ie->ie_cdad_addr); - printf("\n"); -} - - -/* - * Print a called party subaddress information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_cdsa(ie) - struct ie_generic *ie; -{ - printf(" ATM subaddr: "); - usp_print_atm_addr(&ie->ie_cdsa_addr); - printf("\n"); -} - - -/* - * Print a calling party number information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_cgad(ie) - struct ie_generic *ie; -{ - printf(" ATM addr: "); - usp_print_atm_addr(&ie->ie_cgad_addr); - printf("\n"); -} - - -/* - * Print a calling party subaddress information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_cgsa(ie) - struct ie_generic *ie; -{ - printf(" ATM subaddr: "); - usp_print_atm_addr(&ie->ie_cgsa_addr); - printf("\n"); -} - - -/* - * Print a cause information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_caus(ie) - struct ie_generic *ie; -{ - int i; - - printf(" Location: %d\n", ie->ie_caus_loc); - printf(" Cause: %d\n", ie->ie_caus_cause); - switch(ie->ie_caus_cause) { - case UNI_IE_CAUS_IECONTENT: - printf(" Flagged IEs: "); - for (i=0; ie->ie_caus_diagnostic[i]; i++) { - printf("0x%x ", ie->ie_caus_diagnostic[i]); - } - printf("\n"); - break; - case UNI_IE_CAUS_TIMER: - printf(" Timer ID: %c%c%c\n", - ie->ie_caus_diagnostic[0], - ie->ie_caus_diagnostic[1], - ie->ie_caus_diagnostic[2]); - break; - default: - printf(" Diag length: %d\n", - ie->ie_caus_diag_len); - printf(" Diagnostic: "); - for (i=0; iie_caus_diag_len; i++) { - printf("0x%x ", ie->ie_caus_diagnostic[i]); - } - printf("\n"); - } -} - - -/* - * Print a connection identifier information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_cnid(ie) - struct ie_generic *ie; -{ - printf(" VP assoc sig: 0x%x\n", ie->ie_cnid_vp_sig); - printf(" Pref/excl: 0x%x\n", - ie->ie_cnid_pref_excl); - printf(" VPCI: %d\n", ie->ie_cnid_vpci); - printf(" VCI: %d\n", ie->ie_cnid_vci); -} - - -/* - * Print a quality of service parameter information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_qosp(ie) - struct ie_generic *ie; -{ - printf(" QoS fwd: 0x%x\n", - ie->ie_qosp_fwd_class); - printf(" QoS bkwd: 0x%x\n", - ie->ie_qosp_bkwd_class); -} - - -/* - * Print a broadband repeat indicator information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_brpi(ie) - struct ie_generic *ie; -{ - printf(" Indicator: 0x%x\n", ie->ie_brpi_ind); -} - - -/* - * Print a restart indicator information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_rsti(ie) - struct ie_generic *ie; -{ - printf(" Class: 0x%x\n", ie->ie_rsti_class); -} - - -/* - * Print a broadband locking shift information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_blsh(ie) - struct ie_generic *ie; -{ -} - - -/* - * Print a broadband non-locking shift information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_bnsh(ie) - struct ie_generic *ie; -{ -} - - -/* - * Print a broadband sending complete information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_bsdc(ie) - struct ie_generic *ie; -{ - printf(" Indication: 0x%x\n", ie->ie_bsdc_ind); -} - - -/* - * Print a transit net selection information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_trnt(ie) - struct ie_generic *ie; -{ -#ifdef NOTDEF - struct ie_generic ie_trnt_hdr; - u_char ie_trnt_id_type; - u_char ie_trnt_id_plan; - Atm_addr ie_trnt_id; -#endif -} - - -/* - * Print an endpoint reference information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_eprf(ie) - struct ie_generic *ie; -{ - printf(" Ref type: 0x%x\n", - ie->ie_eprf_type); - printf(" Endpt ref: 0x%x\n", - ie->ie_eprf_id); -} - - -/* - * Print an endpoint state information element - * - * Arguments: - * ie pointer to the IE to print - * - * Returns: - * None - * - */ -static void -usp_print_ie_epst(ie) - struct ie_generic *ie; -{ - printf(" Endpt state: %d\n", - ie->ie_epst_state); -} Property changes on: head/sys/netatm/uni/unisig_print.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_mbuf.h =================================================================== --- head/sys/netatm/uni/unisig_mbuf.h (revision 179307) +++ head/sys/netatm/uni/unisig_mbuf.h (nonexistent) @@ -1,58 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Message buffer formats - * - */ - -#ifndef _UNI_SIG_MBUF_H -#define _UNI_SIG_MBUF_H - - -/* - * Structure for message encoding/decoding information. - */ -struct usfmt { - KBuffer *usf_m_addr; /* Current buffer */ - KBuffer *usf_m_base; /* First buffer in chain */ - int usf_loc; /* Offset in current buffer */ - int usf_op; /* Operation (see below) */ - struct unisig *usf_sig; /* UNI signalling instance */ -}; - -#define USF_ENCODE 1 -#define USF_DECODE 2 - -#define USF_MIN_ALLOC MHLEN /* Minimum encoding buffer size */ - -#endif /* _UNI_SIG_MBUF_H */ Property changes on: head/sys/netatm/uni/unisig_mbuf.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/uni/unisig_proto.c =================================================================== --- head/sys/netatm/uni/unisig_proto.c (revision 179307) +++ head/sys/netatm/uni/unisig_proto.c (nonexistent) @@ -1,339 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * ATM Forum UNI 3.0/3.1 Signalling Manager - * ---------------------------------------- - * - * Protocol processing module. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * net.harp.uni - */ -SYSCTL_NODE(_net_harp, OID_AUTO, uni, CTLFLAG_RW, 0, "UNI"); - -/* - * Process a UNISIG timeout - * - * Called when a previously scheduled protocol instance control block - * timer expires. This routine passes a timeout event to the UNISIG - * signalling manager state machine. - * - * Called at splnet. - * - * Arguments: - * tip pointer to UNISIG timer control block - * - * Returns: - * none - * - */ -void -unisig_timer(tip) - struct atm_time *tip; -{ - struct unisig *usp; - - /* - * Back-off to UNISIG control block - */ - usp = (struct unisig *) - ((caddr_t)tip - offsetof(struct unisig, us_time)); - - ATM_DEBUG2("unisig_timer: usp=%p,state=%d\n", - usp, usp->us_state); - - /* - * Pass the timeout to the signalling manager state machine - */ - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_TIMEOUT, - (KBuffer *) 0); -} - - -/* - * Process a UNISIG VCC timeout - * - * Called when a previously scheduled UNISIG VCCB timer expires. - * Processing will based on the current VCC state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to vccb timer control block - * - * Returns: - * none - * - */ -void -unisig_vctimer(tip) - struct atm_time *tip; -{ - struct unisig *usp; - struct unisig_vccb *uvp; - - /* - * Get VCCB and UNISIG control block addresses - */ - uvp = (struct unisig_vccb *) - ((caddr_t)tip - offsetof(struct vccb, vc_time)); - usp = (struct unisig *)uvp->uv_pif->pif_siginst; - - ATM_DEBUG3("unisig_vctimer: uvp=%p, sstate=%d, ustate=%d\n", - uvp, uvp->uv_sstate, uvp->uv_ustate); - - /* - * Hand the timeout to the VC finite state machine - */ - if (uvp->uv_ustate == VCCU_ABORT) { - /* - * If we're aborting, this is an ABORT call - */ - (void) unisig_vc_state(usp, uvp, UNI_VC_ABORT_CALL, - (struct unisig_msg *) 0); - } else { - /* - * If we're not aborting, it's a timeout - */ - (void) unisig_vc_state(usp, uvp, UNI_VC_TIMEOUT, - (struct unisig_msg *) 0); - } -} - - -/* - * UNISIG SAAL Control Handler - * - * This is the module which receives data on the UNISIG signalling - * channel. Processing is based on the indication received from the - * SSCF and the protocol state. - * - * Arguments: - * cmd command code - * tok session token (pointer to UNISIG protocol control block) - * a1 argument 1 - * - * Returns: - * none - * - */ -void -unisig_saal_ctl(cmd, tok, a1) - int cmd; - void *tok; - void *a1; -{ - struct unisig *usp = tok; - - ATM_DEBUG4("unisig_upper: usp=%p,state=%d,cmd=%d,a1=0x%lx,\n", - usp, usp->us_state, cmd, (u_long)a1); - - /* - * Process command - */ - switch (cmd) { - - case SSCF_UNI_ESTABLISH_IND: - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_SSCF_EST_IND, - (KBuffer *) 0); - break; - - case SSCF_UNI_ESTABLISH_CNF: - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_SSCF_EST_CNF, - (KBuffer *) 0); - break; - - case SSCF_UNI_RELEASE_IND: - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_SSCF_RLS_IND, - (KBuffer *) 0); - break; - - case SSCF_UNI_RELEASE_CNF: - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_SSCF_RLS_CNF, - (KBuffer *) 0); - break; - - default: - log(LOG_ERR, - "unisig: unknown SAAL cmd: usp=%p, state=%d, cmd=%d\n", - usp, usp->us_state, cmd); - } -} - - -/* - * UNISIG SAAL Data Handler - * - * This is the module which receives data on the UNISIG signalling - * channel. Processing is based on the protocol state. - * - * Arguments: - * tok session token (pointer to UNISIG protocol control block) - * m pointer to data - * - * Returns: - * none - * - */ -void -unisig_saal_data(tok, m) - void *tok; - KBuffer *m; -{ - struct unisig *usp = tok; - - ATM_DEBUG3("unisig_saal_data: usp=%p,state=%d,m=%p,\n", - usp, usp->us_state, m); - - /* - * Pass data to signalling manager state machine - */ - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_SSCF_DATA_IND, - m); -} - - -/* - * Get Connection's Application/Owner Name - * - * Arguments: - * tok UNI signalling connection token (pointer to protocol instance) - * - * Returns: - * addr pointer to string containing our name - * - */ -caddr_t -unisig_getname(tok) - void *tok; -{ - struct unisig *usp = tok; - - if (usp->us_proto == ATM_SIG_UNI30) - return ("UNI3.0"); - else if (usp->us_proto == ATM_SIG_UNI31) - return ("UNI3.1"); - else if (usp->us_proto == ATM_SIG_UNI40) - return ("UNI4.0"); - else - return ("UNI"); -} - - -/* - * Process a VCC connection notification - * - * Should never be called. - * - * Arguments: - * tok user's connection token (unisig protocol block) - * - * Returns: - * none - * - */ -void -unisig_connected(tok) - void *tok; -{ - struct unisig *usp = tok; - - ATM_DEBUG2("unisig_connected: usp=%p,state=%d\n", - usp, usp->us_state); - - /* - * Connected routine shouldn't ever get called for a PVC - */ - log(LOG_ERR, "unisig: connected notification, usp=%p\n", - usp); -} - - -/* - * Process a VCC closed notification - * - * Called when UNISIG signalling channel is closed. - * - * Arguments: - * tok user's connection token (unisig protocol block) - * cp pointer to cause structure - * - * Returns: - * none - * - */ -void -unisig_cleared(tok, cp) - void *tok; - struct t_atm_cause *cp; -{ - struct unisig *usp = tok; - - ATM_DEBUG3("unisig_cleared: usp=%p, state=%d, cause=%d\n", - usp, usp->us_state, cp->cause_value); - - /* - * VCC has been closed. Notify the signalling - * manager state machine. - */ - (void) unisig_sigmgr_state(usp, - UNISIG_SIGMGR_CALL_CLEARED, - (KBuffer *) 0); -} Property changes on: head/sys/netatm/uni/unisig_proto.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_subr.c =================================================================== --- head/sys/netatm/atm_subr.c (revision 179307) +++ head/sys/netatm/atm_subr.c (nonexistent) @@ -1,620 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * Miscellaneous ATM subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Global variables - */ -struct atm_pif *atm_interface_head = NULL; -struct atm_ncm *atm_netconv_head = NULL; -Atm_endpoint *atm_endpoints[ENDPT_MAX+1] = {NULL}; -struct stackq_entry *atm_stackq_head = NULL, *atm_stackq_tail; -struct atm_sock_stat atm_sock_stat = { { 0 } }; -int atm_init = 0; -int atm_version = ATM_VERSION; -struct timeval atm_debugtime = {0, 0}; -struct ifqueue atm_intrq; - -uma_zone_t atm_attributes_zone; - -/* - * net.harp.atm.atm_debug - */ -int atm_debug; -SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_debug, CTLFLAG_RW, - &atm_debug, 0, "HARP ATM layer debugging flag"); - -/* - * net.harp.atm.atm_dev_print - */ -int atm_dev_print; -SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_dev_print, CTLFLAG_RW, - &atm_dev_print, 0, "display ATM CPCS headers"); - -/* - * net.harp.atm.atm_print_data - */ -int atm_print_data; -SYSCTL_INT(_net_harp_atm, OID_AUTO, atm_print_data, CTLFLAG_RW, - &atm_print_data, 0, "display ATM CPCS payloads"); - -/* - * Local functions - */ -static KTimeout_ret atm_timexp(void *); -static void atm_intr(struct mbuf *); - -/* - * Local variables - */ -static struct atm_time *atm_timeq = NULL; -static uma_zone_t atm_stackq_zone; - -/* - * Initialize ATM kernel - * - * Performs any initialization required before things really get underway. - * Called from ATM domain initialization or from first registration function - * which gets called. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atm_initialize() -{ - /* - * Never called from interrupts, so no locking needed - */ - if (atm_init) - return; - atm_init = 1; - - atm_attributes_zone = uma_zcreate("atm attributes", - sizeof(Atm_attributes), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - if (atm_attributes_zone == NULL) - panic("atm_initialize: unable to create attributes zone"); - - atm_stackq_zone = uma_zcreate("atm stackq", sizeof(struct stackq_entry), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (atm_stackq_zone == NULL) - panic("atm_initialize: unable to create stackq zone"); - - atm_intrq.ifq_maxlen = ATM_INTRQ_MAX; - mtx_init(&atm_intrq.ifq_mtx, "atm_inq", NULL, MTX_DEF); - netisr_register(NETISR_ATM, atm_intr, &atm_intrq, 0); - - /* - * Initialize subsystems - */ - atm_sock_init(); - atm_cm_init(); - atm_aal5_init(); - - /* - * Prime the timer - */ - (void)timeout(atm_timexp, (void *)0, hz/ATM_HZ); -} - - -/* - * Handle timer tick expiration - * - * Decrement tick count in first block on timer queue. If there - * are blocks with expired timers, call their timeout function. - * This function is called ATM_HZ times per second. - * - * Arguments: - * arg argument passed on timeout() call - * - * Returns: - * none - * - */ -static KTimeout_ret -atm_timexp(arg) - void *arg; -{ - struct atm_time *tip; - int s = splimp(); - - - /* - * Decrement tick count - */ - if (((tip = atm_timeq) == NULL) || (--tip->ti_ticks > 0)) { - goto restart; - } - - /* - * Stack queue should have been drained - */ - KASSERT(atm_stackq_head == NULL, ("atm_timexp: stack queue not empty")); - - /* - * Dispatch expired timers - */ - while (((tip = atm_timeq) != NULL) && (tip->ti_ticks == 0)) { - void (*func)(struct atm_time *); - - /* - * Remove expired block from queue - */ - atm_timeq = tip->ti_next; - tip->ti_flag &= ~TIF_QUEUED; - - /* - * Call timeout handler (with network interrupts locked out) - */ - func = tip->ti_func; - (void) splx(s); - s = splnet(); - (*func)(tip); - (void) splx(s); - s = splimp(); - - /* - * Drain any deferred calls - */ - STACK_DRAIN(); - } - -restart: - /* - * Restart the timer - */ - (void) splx(s); - (void) timeout(atm_timexp, (void *)0, hz/ATM_HZ); - - return; -} - - -/* - * Schedule a control block timeout - * - * Place the supplied timer control block on the timer queue. The - * function (func) will be called in 't' timer ticks with the - * control block address as its only argument. There are ATM_HZ - * timer ticks per second. The ticks value stored in each block is - * a delta of the number of ticks from the previous block in the queue. - * Thus, for each tick interval, only the first block in the queue - * needs to have its tick value decremented. - * - * Arguments: - * tip pointer to timer control block - * t number of timer ticks until expiration - * func pointer to function to call at expiration - * - * Returns: - * none - * - */ -void -atm_timeout(tip, t, func) - struct atm_time *tip; - int t; - void (*func)(struct atm_time *); -{ - struct atm_time *tip1, *tip2; - int s; - - - /* - * Check for double queueing error - */ - if (tip->ti_flag & TIF_QUEUED) - panic("atm_timeout: double queueing"); - - /* - * Make sure we delay at least a little bit - */ - if (t <= 0) - t = 1; - - /* - * Find out where we belong on the queue - */ - s = splimp(); - for (tip1 = NULL, tip2 = atm_timeq; tip2 && (tip2->ti_ticks <= t); - tip1 = tip2, tip2 = tip1->ti_next) { - t -= tip2->ti_ticks; - } - - /* - * Place ourselves on queue and update timer deltas - */ - if (tip1 == NULL) - atm_timeq = tip; - else - tip1->ti_next = tip; - tip->ti_next = tip2; - - if (tip2) - tip2->ti_ticks -= t; - - /* - * Setup timer block - */ - tip->ti_flag |= TIF_QUEUED; - tip->ti_ticks = t; - tip->ti_func = func; - - (void) splx(s); - return; -} - - -/* - * Cancel a timeout - * - * Remove the supplied timer control block from the timer queue. - * - * Arguments: - * tip pointer to timer control block - * - * Returns: - * 0 control block successfully dequeued - * 1 control block not on timer queue - * - */ -int -atm_untimeout(tip) - struct atm_time *tip; -{ - struct atm_time *tip1, *tip2; - int s; - - /* - * Is control block queued? - */ - if ((tip->ti_flag & TIF_QUEUED) == 0) - return(1); - - /* - * Find control block on the queue - */ - s = splimp(); - for (tip1 = NULL, tip2 = atm_timeq; tip2 && (tip2 != tip); - tip1 = tip2, tip2 = tip1->ti_next) { - } - - if (tip2 == NULL) { - (void) splx(s); - return (1); - } - - /* - * Remove block from queue and update timer deltas - */ - tip2 = tip->ti_next; - if (tip1 == NULL) - atm_timeq = tip2; - else - tip1->ti_next = tip2; - - if (tip2) - tip2->ti_ticks += tip->ti_ticks; - - /* - * Reset timer block - */ - tip->ti_flag &= ~TIF_QUEUED; - - (void) splx(s); - return (0); -} - - -/* - * Queue a Stack Call - * - * Queues a stack call which must be deferred to the global stack queue. - * The call parameters are stored in entries which are allocated from the - * stack queue storage pool. - * - * Arguments: - * cmd stack command - * func destination function - * token destination layer's token - * cvp pointer to connection vcc - * arg1 command argument - * arg2 command argument - * - * Returns: - * 0 call queued - * errno call not queued - reason indicated - * - */ -int -atm_stack_enq(cmd, func, token, cvp, arg1, arg2) - int cmd; - void (*func)(int, void *, intptr_t, intptr_t); - void *token; - Atm_connvc *cvp; - intptr_t arg1; - intptr_t arg2; -{ - struct stackq_entry *sqp; - int s = splnet(); - - /* - * Get a new queue entry for this call - */ - sqp = uma_zalloc(atm_stackq_zone, M_NOWAIT | M_ZERO); - if (sqp == NULL) { - (void) splx(s); - return (ENOMEM); - } - - /* - * Fill in new entry - */ - sqp->sq_next = NULL; - sqp->sq_cmd = cmd; - sqp->sq_func = func; - sqp->sq_token = token; - sqp->sq_arg1 = arg1; - sqp->sq_arg2 = arg2; - sqp->sq_connvc = cvp; - - /* - * Put new entry at end of queue - */ - if (atm_stackq_head == NULL) - atm_stackq_head = sqp; - else - atm_stackq_tail->sq_next = sqp; - atm_stackq_tail = sqp; - - (void) splx(s); - return (0); -} - - -/* - * Drain the Stack Queue - * - * Dequeues and processes entries from the global stack queue. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atm_stack_drain() -{ - struct stackq_entry *sqp, *qprev, *qnext; - int s = splnet(); - int cnt; - - /* - * Loop thru entire queue until queue is empty - * (but panic rather loop forever) - */ - do { - cnt = 0; - qprev = NULL; - for (sqp = atm_stackq_head; sqp; ) { - - /* - * Got an eligible entry, do STACK_CALL stuff - */ - if (sqp->sq_cmd & STKCMD_UP) { - if (sqp->sq_connvc->cvc_downcnt) { - - /* - * Cant process now, skip it - */ - qprev = sqp; - sqp = sqp->sq_next; - continue; - } - - /* - * OK, dispatch the call - */ - sqp->sq_connvc->cvc_upcnt++; - (*sqp->sq_func)(sqp->sq_cmd, - sqp->sq_token, - sqp->sq_arg1, - sqp->sq_arg2); - sqp->sq_connvc->cvc_upcnt--; - } else { - if (sqp->sq_connvc->cvc_upcnt) { - - /* - * Cant process now, skip it - */ - qprev = sqp; - sqp = sqp->sq_next; - continue; - } - - /* - * OK, dispatch the call - */ - sqp->sq_connvc->cvc_downcnt++; - (*sqp->sq_func)(sqp->sq_cmd, - sqp->sq_token, - sqp->sq_arg1, - sqp->sq_arg2); - sqp->sq_connvc->cvc_downcnt--; - } - - /* - * Dequeue processed entry and free it - */ - cnt++; - qnext = sqp->sq_next; - if (qprev) - qprev->sq_next = qnext; - else - atm_stackq_head = qnext; - if (qnext == NULL) - atm_stackq_tail = qprev; - uma_zfree(atm_stackq_zone, sqp); - sqp = qnext; - } - } while (cnt > 0); - - /* - * Make sure entire queue was drained - */ - if (atm_stackq_head != NULL) - panic("atm_stack_drain: Queue not emptied"); - - (void) splx(s); -} - - -/* - * Process Interrupt Queue - * - * Processes entries on the ATM interrupt queue. This queue is used by - * device interface drivers in order to schedule events from the driver's - * lower (interrupt) half to the driver's stack services. - * - * The interrupt routines must store the stack processing function to call - * and a token (typically a driver/stack control block) at the front of the - * queued buffer. We assume that the function pointer and token values are - * both contained (and properly aligned) in the first buffer of the chain. - * The size of these two fields is not accounted for in the packet header - * length field. The packet header itself must be in the first mbuf. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -atm_intr(struct mbuf *m) -{ - caddr_t cp; - atm_intr_func_t func; - void *token; - - GIANT_REQUIRED; - - /* - * Get function to call and token value - */ - cp = mtod(m, caddr_t); - func = *(atm_intr_func_t *)cp; - cp += sizeof(func); - token = *(void **)cp; - - m->m_len -= sizeof(func) + sizeof(token); - m->m_data += sizeof(func) + sizeof(token); - - /* - * Call processing function - */ - (*func)(token, m); - - /* - * Drain any deferred calls - */ - STACK_DRAIN(); -} - -/* - * Print a pdu buffer chain - * - * Arguments: - * m pointer to pdu buffer chain - * msg pointer to message header string - * - * Returns: - * none - * - */ -void -atm_pdu_print(const KBuffer *m, const char *msg) -{ - const u_char *cp; - int i; - char c = ' '; - - printf("%s:", msg); - while (m) { - KB_DATASTART(m, cp, const u_char *); - printf("%cbfr=%p data=%p len=%d: ", - c, m, cp, KB_LEN(m)); - c = '\t'; - if (atm_print_data) { - for (i = 0; i < KB_LEN(m); i++) { - printf("%2x ", *cp++); - } - printf("\n"); - } else { - printf("\n"); - } - m = KB_NEXT(m); - } -} Property changes on: head/sys/netatm/atm_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_var.h =================================================================== --- head/sys/netatm/atm_var.h (revision 179307) +++ head/sys/netatm/atm_var.h (nonexistent) @@ -1,185 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM system variables - * - */ - -#ifndef _NETATM_ATM_VAR_H -#define _NETATM_ATM_VAR_H - - -#ifdef _KERNEL - -#include - -typedef void (*atm_init_fn)(void); - -/* - * Global variable declarations - */ -extern struct pr_usrreqs atm_aal5_usrreqs; - - /* atm_proto.c */ -extern struct domain atmdomain; - - /* atm_subr.c */ -extern struct atm_pif *atm_interface_head; -extern struct atm_ncm *atm_netconv_head; -extern Atm_endpoint *atm_endpoints[]; -extern struct stackq_entry *atm_stackq_head; -extern struct stackq_entry *atm_stackq_tail; -extern struct atm_sock_stat atm_sock_stat; -extern int atm_init; -extern int atm_version; -extern int atm_debug; -extern struct timeval atm_debugtime; -extern int atm_dev_print; -extern int atm_print_data; -extern uma_zone_t atm_attributes_zone; - -extern struct pr_usrreqs atm_dgram_usrreqs; - - -/* - * Global function declarations - */ - /* atm_aal5.c */ -int atm_aal5_ctloutput(struct socket *, struct sockopt *); -void atm_aal5_init(void); - - /* atm_cm.c */ -int atm_cm_connect(Atm_endpoint *, void *, Atm_attributes *, - Atm_connection **); -int atm_cm_listen(struct socket *, Atm_endpoint *, void *, - Atm_attributes *, Atm_connection **, int); -int atm_cm_addllc(Atm_endpoint *, void *, struct attr_llc *, - Atm_connection *, Atm_connection **); -int atm_cm_addparty(Atm_connection *, int, struct t_atm_sap *); -int atm_cm_dropparty(Atm_connection *, int, struct t_atm_cause *); -int atm_cm_release(Atm_connection *, struct t_atm_cause *); -int atm_cm_abort(Atm_connvc *, struct t_atm_cause *); -int atm_cm_incoming(struct vccb *, Atm_attributes *); -void atm_cm_connected(Atm_connvc *); -void atm_cm_cleared(Atm_connvc *); -Atm_connection *atm_cm_match(Atm_attributes *, Atm_connection *); -int atm_cm_cpcs_ctl(int, Atm_connection *, void *); -int atm_cm_cpcs_data(Atm_connection *, KBuffer *); -int atm_cm_saal_ctl(int, Atm_connection *, void *); -int atm_cm_saal_data(Atm_connection *, KBuffer *); -int atm_cm_sscop_ctl(int, Atm_connection *, void *, void *); -int atm_cm_sscop_data(Atm_connection *, KBuffer *); -int atm_endpoint_register(Atm_endpoint *); -int atm_endpoint_deregister(Atm_endpoint *); - - /* atm_device.c */ -int atm_dev_inst(struct stack_defn **, Atm_connvc *); -void atm_dev_lower(int, void *, intptr_t, intptr_t); -void * atm_dev_alloc(u_int, u_int, u_int); -void atm_dev_free(volatile void *); -KBuffer * atm_dev_compress(KBuffer *); -Cmn_vcc * atm_dev_vcc_find(Cmn_unit *, u_int, u_int, u_int); -void atm_dev_pdu_print(const Cmn_unit *, const Cmn_vcc *, - const KBuffer *, const char *); - - /* atm_if.c */ -int atm_physif_register(Cmn_unit *, const char *, - struct stack_defn *); -int atm_physif_deregister(Cmn_unit *); -void atm_physif_freenifs(struct atm_pif *, uma_zone_t); -int atm_netconv_register(struct atm_ncm *); -int atm_netconv_deregister(struct atm_ncm *); -int atm_nif_attach(struct atm_nif *); -void atm_nif_detach(struct atm_nif *); -int atm_nif_setaddr(struct atm_nif *, struct ifaddr *); -int atm_ifoutput(struct ifnet *, KBuffer *, - struct sockaddr *, struct rtentry *); -struct atm_pif * - atm_pifname(char *); -struct atm_nif * - atm_nifname(char *); - - /* atm_proto.c */ -int atm_proto_notsupp1(struct socket *); -int atm_proto_notsupp2(struct socket *, struct sockaddr *, - struct thread *); -int atm_proto_notsupp3(struct socket *, struct sockaddr **); -int atm_proto_notsupp4(struct socket *, int, KBuffer *, - struct sockaddr *, KBuffer *, struct thread *); -void atm_proto_notsupp5(struct socket *); - - /* atm_signal.c */ -int atm_sigmgr_register(struct sigmgr *); -int atm_sigmgr_deregister(struct sigmgr *); -int atm_sigmgr_attach(struct atm_pif *, u_char); -int atm_sigmgr_detach(struct atm_pif *); -int atm_stack_register(struct stack_defn *); -int atm_stack_deregister(struct stack_defn *); -int atm_create_stack(Atm_connvc *, struct stack_list *, - void (*)(int, void *, intptr_t, intptr_t) ); - - /* atm_socket.c */ -void atm_sock_init(void); -int atm_sock_attach(struct socket *, u_long, u_long); -void atm_sock_detach(struct socket *); -int atm_sock_bind(struct socket *, struct sockaddr *); -int atm_sock_listen(struct socket *, Atm_endpoint *, int); -int atm_sock_connect(struct socket *, struct sockaddr *, - Atm_endpoint *); -int atm_sock_disconnect(struct socket *); -int atm_sock_sockaddr(struct socket *, struct sockaddr **); -int atm_sock_peeraddr(struct socket *, struct sockaddr **); -int atm_sock_setopt(struct socket *, struct sockopt *, - Atm_pcb *); -int atm_sock_getopt(struct socket *, struct sockopt *, - Atm_pcb *); -void atm_sock_connected(void *); -void atm_sock_cleared(void *, struct t_atm_cause *); - - /* atm_subr.c */ -void atm_initialize(void); -void atm_timeout(struct atm_time *, int, - void (*)(struct atm_time *) ); -int atm_untimeout(struct atm_time *); -int atm_stack_enq(int, void (*)(int, void *, intptr_t, intptr_t), - void *, Atm_connvc *, intptr_t, intptr_t); -void atm_stack_drain(void); -void atm_pdu_print(const KBuffer *, const char *); - -#ifdef SYSCTL_DECL -SYSCTL_DECL(_net_harp); -SYSCTL_DECL(_net_harp_atm); -#endif - -#endif /* _KERNEL */ -#endif /* _NETATM_ATM_VAR_H */ Property changes on: head/sys/netatm/atm_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_device.c =================================================================== --- head/sys/netatm/atm_device.c (revision 179307) +++ head/sys/netatm/atm_device.c (nonexistent) @@ -1,816 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM device support functions - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Private structures for managing allocated kernel memory resources - * - * For each allocation of kernel memory, one Mem_ent will be used. - * The Mem_ent structures will be allocated in blocks inside of a - * Mem_blk structure. - */ -#define MEM_NMEMENT 10 /* How many Mem_ent's in a Mem_blk */ - -struct mem_ent { - void *me_kaddr; /* Allocated memory address */ - u_int me_ksize; /* Allocated memory length */ - void *me_uaddr; /* Memory address returned to caller */ - u_int me_flags; /* Flags (see below) */ -}; -typedef struct mem_ent Mem_ent; - -/* - * Memory entry flags - */ -#define MEF_NONCACHE 1 /* Memory is noncacheable */ - - -struct mem_blk { - struct mem_blk *mb_next; /* Next block in chain */ - Mem_ent mb_mement[MEM_NMEMENT]; /* Allocated memory entries */ -}; -typedef struct mem_blk Mem_blk; - -static Mem_blk *atm_mem_head = NULL; - -static struct t_atm_cause atm_dev_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_VPCI_VCI_ASSIGNMENT_FAILURE, - {0, 0, 0, 0} -}; - -extern struct ifqueue atm_intrq; - -/* - * ATM Device Stack Instantiation - * - * Called at splnet. - * - * Arguments - * ssp pointer to array of stack definition pointers - * for connection - * ssp[0] points to upper layer's stack definition - * ssp[1] points to this layer's stack definition - * ssp[2] points to lower layer's stack definition - * cvcp pointer to connection vcc for this stack - * - * Returns - * 0 instantiation successful - * err instantiation failed - reason indicated - * - */ -int -atm_dev_inst(ssp, cvcp) - struct stack_defn **ssp; - Atm_connvc *cvcp; -{ - Cmn_unit *cup = (Cmn_unit *)cvcp->cvc_attr.nif->nif_pif; - Cmn_vcc *cvp; - int err; - - /* - * Check to see if device has been initialized - */ - if ((cup->cu_flags & CUF_INITED) == 0) - return ( EIO ); - - /* - * Validate lower SAP - */ - /* - * Device driver is the lowest layer - no need to validate - */ - - /* - * Validate PVC vpi.vci - */ - if (cvcp->cvc_attr.called.addr.address_format == T_ATM_PVC_ADDR) { - /* - * Look through existing circuits - return error if found - */ - Atm_addr_pvc *pp; - - pp = (Atm_addr_pvc *)cvcp->cvc_attr.called.addr.address; - if (atm_dev_vcc_find(cup, ATM_PVC_GET_VPI(pp), - ATM_PVC_GET_VCI(pp), 0)) - return ( EADDRINUSE ); - } - - /* - * Validate our SAP type - */ - switch ((*(ssp+1))->sd_sap) { - case SAP_CPCS_AAL3_4: - case SAP_CPCS_AAL5: - case SAP_ATM: - break; - default: - return (EINVAL); - } - - /* - * Allocate a VCC control block - * This can happen from a callout so don't wait here. - */ - cvp = uma_zalloc(cup->cu_vcc_zone, M_NOWAIT); - if (cvp == NULL) - return (ENOMEM); - - cvp->cv_state = CVS_INST; - cvp->cv_toku = (*ssp)->sd_toku; - cvp->cv_upper = (*ssp)->sd_upper; - cvp->cv_connvc = cvcp; - - /* - * Let device have a look at the connection request - */ - err = (*cup->cu_instvcc)(cup, cvp); - if (err) { - uma_zfree(cup->cu_vcc_zone, cvp); - return (err); - } - - /* - * Looks good so far, so link in device VCC - */ - LINK2TAIL ( cvp, Cmn_vcc, cup->cu_vcc, cv_next ); - - /* - * Save my token - */ - (*++ssp)->sd_toku = cvp; - - /* - * Pass instantiation down the stack - */ - /* - * No need - we're the lowest point. - */ - /* err = (*(ssp + 1))->sd_inst(ssp, cvcp); */ - - /* - * Save the lower layer's interface info - */ - /* - * No need - we're the lowest point - */ - /* cvp->cv_lower = (*++ssp)->sd_lower; */ - /* cvp->cv_tok1 = (*ssp)->sd_toku; */ - - return (0); -} - - -/* - * ATM Device Stack Command Handler - * - * Arguments - * cmd stack command code - * tok session token (Cmn_vcc) - * arg1 command specific argument - * arg2 command specific argument - * - * Returns - * none - * - */ -/*ARGSUSED*/ -void -atm_dev_lower(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - Cmn_vcc *cvp = (Cmn_vcc *)tok; - Atm_connvc *cvcp = cvp->cv_connvc; - Cmn_unit *cup = (Cmn_unit *)cvcp->cvc_attr.nif->nif_pif; - struct vccb *vcp; - u_int state; - int s; - - switch ( cmd ) { - - case CPCS_INIT: - /* - * Sanity check - */ - if ( cvp->cv_state != CVS_INST ) { - log ( LOG_ERR, - "atm_dev_lower: INIT: tok=%p, state=%d\n", - tok, cvp->cv_state ); - break; - } - - vcp = cvp->cv_connvc->cvc_vcc; - - /* - * Validate SVC vpi.vci - */ - if ( vcp->vc_type & VCC_SVC ) { - - if (atm_dev_vcc_find(cup, vcp->vc_vpi, vcp->vc_vci, - vcp->vc_type & (VCC_IN | VCC_OUT)) - != cvp){ - log ( LOG_ERR, - "atm_dev_lower: dup SVC (%d,%d) tok=%p\n", - vcp->vc_vpi, vcp->vc_vci, tok ); - atm_cm_abort(cvp->cv_connvc, &atm_dev_cause); - break; - } - } - - /* - * Tell the device to open the VCC - */ - cvp->cv_state = CVS_INITED; - s = splimp(); - if ((*cup->cu_openvcc)(cup, cvp)) { - atm_cm_abort(cvp->cv_connvc, &atm_dev_cause); - (void) splx(s); - break; - } - (void) splx(s); - break; - - case CPCS_TERM: { - KBuffer *m, *prev, *next; - int *ip; - - s = splimp(); - - /* - * Disconnect the VCC - ignore return code - */ - if ((cvp->cv_state == CVS_INITED) || - (cvp->cv_state == CVS_ACTIVE)) { - (void) (*cup->cu_closevcc)(cup, cvp); - } - cvp->cv_state = CVS_TERM; - - /* - * Remove from interface list - */ - UNLINK ( cvp, Cmn_vcc, cup->cu_vcc, cv_next ); - - /* - * Free any buffers from this VCC on the ATM interrupt queue - */ - prev = NULL; - IF_LOCK(&atm_intrq); - for (m = atm_intrq.ifq_head; m; m = next) { - next = KB_QNEXT(m); - - /* - * See if this entry is for the terminating VCC - */ - KB_DATASTART(m, ip, int *); - ip++; - if (*ip == (intptr_t)cvp) { - /* - * Yep, so dequeue the entry - */ - if (prev == NULL) - atm_intrq.ifq_head = next; - else - KB_QNEXT(prev) = next; - - if (next == NULL) - atm_intrq.ifq_tail = prev; - - atm_intrq.ifq_len--; - - /* - * Free the unwanted buffers - */ - KB_FREEALL(m); - } else { - prev = m; - } - } - IF_UNLOCK(&atm_intrq); - (void) splx(s); - - /* - * Free VCC resources - */ - uma_zfree(cup->cu_vcc_zone, cvp); - break; - } - - case CPCS_UNITDATA_INV: - - /* - * Sanity check - * - * Use temp state variable since we dont want to lock out - * interrupts, but initial VC activation interrupt may - * happen here, changing state somewhere in the middle. - */ - state = cvp->cv_state; - if ((state != CVS_ACTIVE) && - (state != CVS_INITED)) { - log ( LOG_ERR, - "atm_dev_lower: UNITDATA: tok=%p, state=%d\n", - tok, state ); - KB_FREEALL((KBuffer *)arg1); - break; - } - - /* - * Send the packet to the interface's bpf if this vc has one. - */ - if (cvcp->cvc_vcc != NULL && cvcp->cvc_vcc->vc_nif != NULL) { - struct ifnet *ifp = - (struct ifnet *)cvcp->cvc_vcc->vc_nif; - - BPF_MTAP(ifp, (KBuffer *)arg1); - } - - /* - * Hand the data off to the device - */ - (*cup->cu_output)(cup, cvp, (KBuffer *)arg1); - - break; - - case CPCS_UABORT_INV: - log ( LOG_ERR, - "atm_dev_lower: unimplemented stack cmd 0x%x, tok=%p\n", - cmd, tok ); - break; - - default: - log ( LOG_ERR, - "atm_dev_lower: unknown stack cmd 0x%x, tok=%p\n", - cmd, tok ); - - } - - return; -} - - - -/* - * Allocate kernel memory block - * - * This function will allocate a kernel memory block of the type specified - * in the flags parameter. The returned address will point to a memory - * block of the requested size and alignment. The memory block will also - * be zeroed. The alloc/free functions will manage/mask both the OS-specific - * kernel memory management requirements and the bookkeeping required to - * deal with data alignment issues. - * - * This function should not be called from interrupt level. - * - * Arguments: - * size size of memory block to allocate - * align data alignment requirement - * flags allocation flags (ATM_DEV_*) - * - * Returns: - * uaddr pointer to aligned memory block - * NULL unable to allocate memory - * - */ -void * -atm_dev_alloc(size, align, flags) - u_int size; - u_int align; - u_int flags; -{ - Mem_blk *mbp; - Mem_ent *mep; - u_int kalign, ksize; - int s, i; - - s = splimp(); - - /* - * Find a free Mem_ent - */ - mep = NULL; - for (mbp = atm_mem_head; mbp && mep == NULL; mbp = mbp->mb_next) { - for (i = 0; i < MEM_NMEMENT; i++) { - if (mbp->mb_mement[i].me_uaddr == NULL) { - mep = &mbp->mb_mement[i]; - break; - } - } - } - - /* - * If there are no free Mem_ent's, then allocate a new Mem_blk - * and link it into the chain - */ - if (mep == NULL) { - mbp = malloc(sizeof(Mem_blk), M_DEVBUF, M_NOWAIT|M_ZERO); - if (mbp == NULL) { - log(LOG_ERR, "atm_dev_alloc: Mem_blk failure\n"); - (void) splx(s); - return (NULL); - } - mbp->mb_next = atm_mem_head; - atm_mem_head = mbp; - mep = mbp->mb_mement; - } - - /* - * Now we need to get the kernel's allocation alignment minimum - * - * This is obviously very OS-specific stuff - */ - kalign = MINALLOCSIZE; - - /* - * Figure out how much memory we must allocate to satify the - * user's size and alignment needs - */ - if (align <= kalign) - ksize = size; - else - ksize = size + align - kalign; - - /* - * Finally, go get the memory - */ - if (flags & ATM_DEV_NONCACHE) { - mep->me_kaddr = malloc(ksize, M_DEVBUF, M_NOWAIT); - } else { - mep->me_kaddr = malloc(ksize, M_DEVBUF, M_NOWAIT); - } - - if (mep->me_kaddr == NULL) { - log(LOG_ERR, "atm_dev_alloc: %skernel memory unavailable\n", - (flags & ATM_DEV_NONCACHE) ? "non-cacheable " : ""); - (void) splx(s); - return (NULL); - } - - /* - * Calculate correct alignment address to pass back to user - */ - mep->me_uaddr = (void *) roundup((uintptr_t)mep->me_kaddr, align); - mep->me_ksize = ksize; - mep->me_flags = flags; - - /* - * Clear memory for user - */ - bzero(mep->me_uaddr, size); - - ATM_DEBUG4("atm_dev_alloc: size=%d, align=%d, flags=%d, uaddr=%p\n", - size, align, flags, mep->me_uaddr); - - (void) splx(s); - - return (mep->me_uaddr); -} - - -/* - * Free kernel memory block - * - * This function will free a kernel memory block previously allocated by - * the atm_dev_alloc function. - * - * This function should not be called from interrupt level. - * - * Arguments: - * uaddr pointer to allocated aligned memory block - * - * Returns: - * none - * - */ -void -atm_dev_free(uaddr) - volatile void *uaddr; -{ - Mem_blk *mbp; - Mem_ent *mep; - int s, i; - - ATM_DEBUG1("atm_dev_free: uaddr=%p\n", uaddr); - - s = splimp(); - - /* - * Protect ourselves... - */ - if (uaddr == NULL) - panic("atm_dev_free: trying to free null address"); - - /* - * Find our associated entry - */ - mep = NULL; - for (mbp = atm_mem_head; mbp && mep == NULL; mbp = mbp->mb_next) { - for (i = 0; i < MEM_NMEMENT; i++) { - if (mbp->mb_mement[i].me_uaddr == uaddr) { - mep = &mbp->mb_mement[i]; - break; - } - } - } - - /* - * If we didn't find our entry, then unceremoniously let the caller - * know they screwed up (it certainly couldn't be a bug here...) - */ - if (mep == NULL) - panic("atm_dev_free: trying to free unknown address"); - - /* - * Give the memory space back to the kernel - */ - if (mep->me_flags & ATM_DEV_NONCACHE) { - free(mep->me_kaddr, M_DEVBUF); - } else { - free(mep->me_kaddr, M_DEVBUF); - } - - /* - * Free our entry - */ - mep->me_uaddr = NULL; - - (void) splx(s); - - return; -} - -/* - * Compress buffer chain - * - * This function will compress a supplied buffer chain into a minimum number - * of kernel buffers. Typically, this function will be used because the - * number of buffers in an output buffer chain is too large for a device's - * DMA capabilities. This should only be called as a last resort, since - * all the data copying will surely kill any hopes of decent performance. - * - * Arguments: - * m pointer to source buffer chain - * - * Returns: - * n pointer to compressed buffer chain - * - */ -KBuffer * -atm_dev_compress(m) - KBuffer *m; -{ - KBuffer *n, *n0, **np; - int len, space; - caddr_t src, dst; - - n = n0 = NULL; - np = &n0; - dst = NULL; - space = 0; - - /* - * Copy each source buffer into compressed chain - */ - while (m) { - - if (space == 0) { - - /* - * Allocate another buffer for compressed chain - */ - KB_ALLOCEXT(n, ATM_DEV_CMPR_LG, KB_F_NOWAIT, KB_T_DATA); - if (n) { - space = ATM_DEV_CMPR_LG; - } else { - KB_ALLOC(n, ATM_DEV_CMPR_SM, KB_F_NOWAIT, - KB_T_DATA); - if (n) { - space = ATM_DEV_CMPR_SM; - } else { - /* - * Unable to get any new buffers, so - * just return the partially compressed - * chain and hope... - */ - *np = m; - break; - } - } - - KB_HEADSET(n, 0); - KB_LEN(n) = 0; - KB_BFRSTART(n, dst, caddr_t); - - *np = n; - np = &KB_NEXT(n); - } - - /* - * Copy what we can from source buffer - */ - len = MIN(space, KB_LEN(m)); - KB_DATASTART(m, src, caddr_t); - bcopy(src, dst, len); - - /* - * Adjust for copied data - */ - dst += len; - space -= len; - - KB_HEADADJ(m, -len); - KB_TAILADJ(n, len); - - /* - * If we've exhausted our current source buffer, free it - * and move to the next one - */ - if (KB_LEN(m) == 0) { - KB_FREEONE(m, m); - } - } - - return (n0); -} - - -/* - * Locate VCC entry - * - * This function will return the VCC entry for a specified interface and - * VPI/VCI value. - * - * Arguments: - * cup pointer to interface unit structure - * vpi VPI value - * vci VCI value - * type VCC type - * - * Returns: - * vcp pointer to located VCC entry matching - * NULL no VCC found - * - */ -Cmn_vcc * -atm_dev_vcc_find(cup, vpi, vci, type) - Cmn_unit *cup; - u_int vpi; - u_int vci; - u_int type; -{ - Cmn_vcc *cvp; - int s = splnet(); - - /* - * Go find VCC - * - * (Probably should stick in a hash table some time) - */ - for (cvp = cup->cu_vcc; cvp; cvp = cvp->cv_next) { - struct vccb *vcp; - - vcp = cvp->cv_connvc->cvc_vcc; - if ((vcp->vc_vci == vci) && (vcp->vc_vpi == vpi) && - ((vcp->vc_type & type) == type)) - break; - } - - (void) splx(s); - return (cvp); -} - - -#ifdef notdef -/* - * Module unloading notification - * - * This function must be called just prior to unloading the module from - * memory. All allocated memory will be freed here and anything else that - * needs cleaning up. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atm_unload() -{ - Mem_blk *mbp; - Mem_ent *mep; - int s, i; - - s = splimp(); - - /* - * Free up all of our memory management storage - */ - while (mbp = atm_mem_head) { - - /* - * Make sure users have freed up all of their memory - */ - for (i = 0; i < MEM_NMEMENT; i++) { - if (mbp->mb_mement[i].me_uaddr != NULL) { - panic("atm_unload: unfreed memory"); - } - } - - atm_mem_head = mbp->mb_next; - - /* - * Hand this block back to the kernel - */ - free((caddr_t)mbp, M_DEVBUF); - } - - (void) splx(s); - - return; -} -#endif /* notdef */ - - -/* - * Print a PDU - * - * Arguments: - * cup pointer to device unit - * cvp pointer to VCC control block - * m pointer to pdu buffer chain - * msg pointer to message string - * - * Returns: - * none - * - */ -void -atm_dev_pdu_print(const Cmn_unit *cup, const Cmn_vcc *cvp, - const KBuffer *m, const char *msg) -{ - char buf[128]; - - snprintf(buf, sizeof(buf), "%s vcc=(%d,%d)", msg, - cvp->cv_connvc->cvc_vcc->vc_vpi, - cvp->cv_connvc->cvc_vcc->vc_vci); - - atm_pdu_print(m, buf); -} Property changes on: head/sys/netatm/atm_device.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_cm.c =================================================================== --- head/sys/netatm/atm_cm.c (revision 179307) +++ head/sys/netatm/atm_cm.c (nonexistent) @@ -1,3502 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Connection Manager - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Global variables - */ -struct atm_cm_stat atm_cm_stat = {0}; - -/* - * Local functions - */ -static void atm_cm_cpcs_upper(int, void *, intptr_t, intptr_t); -static void atm_cm_saal_upper(int, void *, intptr_t, intptr_t); -static void atm_cm_sscop_upper(int, void *, intptr_t, intptr_t); -static Atm_connvc * atm_cm_share_llc(Atm_attributes *); -static void atm_cm_closeconn(Atm_connection *, - struct t_atm_cause *); -static void atm_cm_closevc(Atm_connvc *); -static void atm_cm_timeout(struct atm_time *); -static KTimeout_ret atm_cm_procinq(void *); -static void atm_cm_incall(Atm_connvc *); -static int atm_cm_accept(Atm_connvc *, Atm_connection *); - -/* - * Local variables - */ -static Queue_t atm_connection_queue = {NULL}; -static Queue_t atm_incoming_queue = {NULL}; -static int atm_incoming_qlen = 0; -static Atm_connection *atm_listen_queue = NULL; -static struct attr_cause atm_cause_tmpl = - {T_ATM_PRESENT, {T_ATM_ITU_CODING, T_ATM_LOC_USER, 0, {0, 0, 0, 0}}}; - -/* - * Stack commands, indexed by API - */ -static struct { - int init; - int term; -} atm_stackcmds[] = { - {CPCS_INIT, CPCS_TERM}, /* CMAPI_CPCS */ - {SSCF_UNI_INIT, SSCF_UNI_TERM}, /* CMAPI_SAAL */ - {SSCOP_INIT, SSCOP_TERM}, /* CMAPI_SSCOP */ -}; - -static uma_zone_t atm_connection_zone; -static uma_zone_t atm_connvc_zone; - -void -atm_cm_init(void) -{ - - atm_connection_zone = uma_zcreate("atm connection", - sizeof(Atm_connection), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (atm_connection_zone == NULL) - panic("atm_connection_zone"); - - atm_connvc_zone = uma_zcreate("atm connvc", sizeof(Atm_connvc), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (atm_connvc_zone == NULL) - panic("atm_connvc_zone"); -} - -/* - * Initiate Outgoing ATM Call - * - * Called by an endpoint service to create a new Connection Manager API - * instance and to initiate an outbound ATM connection. The endpoint - * provided token will be used in all further CM -> endpoint function - * calls, and the returned connection block pointer must be used in all - * subsequent endpoint -> CM function calls. - * - * If the return indicates that the connection setup has been immediately - * successful (typically only for PVCs and shared SVCs), then the connection - * is ready for data transmission. - * - * If the return indicates that the connection setup is still in progress, - * then the endpoint must wait for notification from the Connection Manager - * indicating the final status of the call setup. If the call setup completes - * successfully, then a "call connected" notification will be sent to the - * endpoint by the Connection Manager. If the call setup fails, then the - * endpoint will receive a "call cleared" notification. - * - * All connection instances must be freed with an atm_cm_release() call. - * - * Arguments: - * epp pointer to endpoint definition structure - * token endpoint's connection instance token - * ap pointer to requested connection attributes - * copp pointer to location to return allocated connection block - * - * Returns: - * 0 connection has been successfully established - * EINPROGRESS connection establishment is in progress - * errno connection failed - reason indicated - * - */ -int -atm_cm_connect(epp, token, ap, copp) - Atm_endpoint *epp; - void *token; - Atm_attributes *ap; - Atm_connection **copp; -{ - Atm_connection *cop; - Atm_connvc *cvp; - struct atm_pif *pip; - struct sigmgr *smp; - struct stack_list sl; - void (*upf)(int, void *, intptr_t, intptr_t); - int s, sli, err, err2; - - *copp = NULL; - cvp = NULL; - - /* - * Get a connection block - * May be called from timeout - don't wait. - */ - cop = uma_zalloc(atm_connection_zone, M_NOWAIT); - if (cop == NULL) - return (ENOMEM); - - /* - * Initialize connection info - */ - cop->co_endpt = epp; - cop->co_toku = token; - - /* - * Initialize stack list index - */ - sli = 0; - - /* - * Validate and extract useful attribute information - */ - - /* - * Must specify a network interface (validated below) - */ - if (ap->nif == NULL) { - err = EINVAL; - goto done; - } - - /* - * Check out Data API - */ - switch (ap->api) { - - case CMAPI_CPCS: - upf = atm_cm_cpcs_upper; - break; - - case CMAPI_SAAL: - sl.sl_sap[sli++] = SAP_SSCF_UNI; - sl.sl_sap[sli++] = SAP_SSCOP; - upf = atm_cm_saal_upper; - break; - - case CMAPI_SSCOP: - sl.sl_sap[sli++] = SAP_SSCOP; - upf = atm_cm_sscop_upper; - break; - - default: - err = EINVAL; - goto done; - } - - /* - * AAL Attributes - */ - if (ap->aal.tag != T_ATM_PRESENT) { - err = EINVAL; - goto done; - } - - switch (ap->aal.type) { - - case ATM_AAL5: - sl.sl_sap[sli++] = SAP_CPCS_AAL5; - sl.sl_sap[sli++] = SAP_SAR_AAL5; - sl.sl_sap[sli++] = SAP_ATM; - break; - - case ATM_AAL3_4: - sl.sl_sap[sli++] = SAP_CPCS_AAL3_4; - sl.sl_sap[sli++] = SAP_SAR_AAL3_4; - sl.sl_sap[sli++] = SAP_ATM; - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Broadband Bearer Attributes - */ - if (ap->bearer.tag != T_ATM_PRESENT) { - err = EINVAL; - goto done; - } - - switch (ap->bearer.v.connection_configuration) { - - case T_ATM_1_TO_1: - cop->co_flags |= COF_P2P; - break; - - case T_ATM_1_TO_MANY: - /* Not supported */ - cop->co_flags |= COF_P2MP; - err = EINVAL; - goto done; - - default: - err = EINVAL; - goto done; - } - - /* - * Logical Link Control Attributes - */ - if (ap->llc.tag == T_ATM_PRESENT) { - if ((ap->blli.tag_l2 != T_ATM_PRESENT) || - (ap->blli.v.layer_2_protocol.ID_type != T_ATM_SIMPLE_ID) || - (ap->blli.v.layer_2_protocol.ID.simple_ID != - T_ATM_BLLI2_I8802) || - (ap->llc.v.llc_len < T_ATM_LLC_MIN_LEN) || - (ap->llc.v.llc_len > T_ATM_LLC_MAX_LEN)) { - err = EINVAL; - goto done; - } - cop->co_mpx = ATM_ENC_LLC; - cop->co_llc = ap->llc; - } else - cop->co_mpx = ATM_ENC_NULL; - - /* - * Called Party Attributes - */ - if (ap->called.tag != T_ATM_PRESENT) { - err = EINVAL; - goto done; - } - - if ((ap->called.addr.address_format == T_ATM_ABSENT) || - (ap->called.addr.address_length == 0)) { - err = EINVAL; - goto done; - } - - /* - * Calling Party Attributes - */ - if (ap->calling.tag != T_ATM_ABSENT) { - err = EINVAL; - goto done; - } - - /* - * Quality of Service Attributes - */ - if (ap->qos.tag != T_ATM_PRESENT) { - err = EINVAL; - goto done; - } - - /* - * Terminate stack list - */ - sl.sl_sap[sli] = 0; - - s = splnet(); - - /* - * Let multiplexors decide whether we need a new VCC - */ - switch (cop->co_mpx) { - - case ATM_ENC_NULL: - /* - * All of these connections require a new VCC - */ - break; - - case ATM_ENC_LLC: - /* - * See if we can share an existing LLC connection - */ - cvp = atm_cm_share_llc(ap); - if (cvp == NULL) - break; - - /* - * We've got a connection to share - */ - cop->co_connvc = cvp; - if (cvp->cvc_state == CVCS_ACTIVE) { - cop->co_state = COS_ACTIVE; - err = 0; - } else { - cop->co_state = COS_OUTCONN; - err = EINPROGRESS; - } - LINK2TAIL(cop, Atm_connection, cvp->cvc_conn->co_mxh, co_next); - cop->co_mxh = cvp->cvc_conn->co_mxh; - *copp = cop; - - (void) splx(s); - return (err); - - default: - panic("atm_cm_connect: unknown mpx"); - } - - /* - * If we get here, it means we need to create - * a new VCC for this connection - */ - - /* - * Validate that network interface is registered and that - * a signalling manager is attached - */ - for (pip = atm_interface_head; pip != NULL; pip = pip->pif_next) { - struct atm_nif *nip; - for (nip = pip->pif_nif; nip; nip = nip->nif_pnext) { - if (nip == ap->nif) - break; - } - if (nip) - break; - } - if (pip == NULL) { - err = ENXIO; - goto donex; - } - - if ((smp = pip->pif_sigmgr) == NULL) { - err = ENXIO; - goto donex; - } - - /* - * Get a connection VCC block - * May be called from timeouts - don't wait. - */ - cvp = uma_zalloc(atm_connvc_zone, M_NOWAIT); - if (cvp == NULL) { - err = ENOMEM; - goto donex; - } - - /* - * Save VCC attributes - */ - cvp->cvc_attr = *ap; - cvp->cvc_flags |= CVCF_CALLER; - - /* - * Link the control blocks - */ - cop->co_connvc = cvp; - cvp->cvc_conn = cop; - cvp->cvc_sigmgr = smp; - - /* - * Create a service stack - */ - err = atm_create_stack(cvp, &sl, upf); - if (err) { - cvp->cvc_state = CVCS_CLEAR; - atm_cm_closevc(cvp); - goto donex; - } - - /* - * Let the signalling manager handle the VCC creation - */ - cvp->cvc_state = CVCS_SETUP; - switch ((*smp->sm_setup)(cvp, &err)) { - - case CALL_CONNECTED: - /* - * Connection is fully setup - initialize the stack - */ - cvp->cvc_state = CVCS_INIT; - STACK_CALL(atm_stackcmds[ap->api].init, cvp->cvc_lower, - cvp->cvc_tokl, cvp, ap->api_init, 0, err2); - if (err2) - panic("atm_cm_connect: init"); - - if (cvp->cvc_flags & CVCF_ABORTING) { - /* - * Someone on the stack bailed out...schedule the - * VCC and stack termination - */ - atm_cm_closevc(cvp); - err = EFAULT; - } else { - /* - * Everything looks fine from here - */ - cvp->cvc_state = CVCS_ACTIVE; - cop->co_state = COS_ACTIVE; - } - break; - - case CALL_FAILED: - /* - * Terminate stack and clean up before we leave - */ - cvp->cvc_state = CVCS_CLEAR; - atm_cm_closevc(cvp); - break; - - case CALL_PROCEEDING: - /* - * We'll just wait for final call status - */ - cop->co_state = COS_OUTCONN; - err = EINPROGRESS; - break; - - default: - panic("atm_cm_connect: setup"); - } - -donex: - (void) splx(s); - -done: - if (err && err != EINPROGRESS) { - /* - * Undo any partial setup stuff - */ - if (cop) - uma_zfree(atm_connection_zone, cop); - } else { - /* - * Finish connection setup - */ - s = splnet(); - cvp->cvc_flags |= CVCF_CONNQ; - ENQUEUE(cvp, Atm_connvc, cvc_q, atm_connection_queue); - LINK2TAIL(cop, Atm_connection, cop->co_mxh, co_next); - (void) splx(s); - *copp = cop; - } - return (err); -} - - -/* - * Listen for Incoming ATM Calls - * - * Called by an endpoint service in order to indicate its willingness to - * accept certain incoming calls. The types of calls which the endpoint - * is prepared to accept are specified in the Atm_attributes parameter. - * - * For each call which meets the criteria specified by the endpoint, the - * endpoint service will receive an incoming call notification via the - * endpoint's ep_incoming() function. - * - * To cancel the listening connection, the endpoint user should invoke - * atm_cm_release(). - * - * Arguments: - * so optional socket pointer -- if present, will set listen state - * epp pointer to endpoint definition structure - * token endpoint's listen instance token - * ap pointer to listening connection attributes - * copp pointer to location to return allocated connection block - * - * Returns: - * 0 listening connection installed - * errno listen failed - reason indicated - * - */ -int -atm_cm_listen(so, epp, token, ap, copp, backlog) - struct socket *so; - Atm_endpoint *epp; - void *token; - Atm_attributes *ap; - Atm_connection **copp; - int backlog; -{ - Atm_connection *cop; - int s, err = 0; - - *copp = NULL; - - /* - * Get a connection block - */ - cop = uma_zalloc(atm_connection_zone, M_WAITOK); - if (cop == NULL) - return (ENOMEM); - - /* - * Initialize connection info - */ - cop->co_endpt = epp; - cop->co_toku = token; - cop->co_mxh = cop; - - /* - * Validate and extract useful attribute information - */ - - /* - * Check out Data API - */ - switch (ap->api) { - - case CMAPI_CPCS: - case CMAPI_SAAL: - case CMAPI_SSCOP: - break; - - default: - err = EINVAL; - goto done; - } - - /* - * AAL Attributes - */ - switch (ap->aal.tag) { - - case T_ATM_PRESENT: - - switch (ap->aal.type) { - - case ATM_AAL5: - case ATM_AAL3_4: - break; - - default: - err = EINVAL; - goto done; - } - break; - - case T_ATM_ABSENT: - case T_ATM_ANY: - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Broadband High Layer Information Attributes - */ - switch (ap->bhli.tag) { - - case T_ATM_PRESENT: - case T_ATM_ABSENT: - case T_ATM_ANY: - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Broadband Low Layer Information Attributes - */ - switch (ap->blli.tag_l2) { - - case T_ATM_PRESENT: - case T_ATM_ABSENT: - case T_ATM_ANY: - break; - - default: - err = EINVAL; - goto done; - } - - switch (ap->blli.tag_l3) { - - case T_ATM_PRESENT: - case T_ATM_ABSENT: - case T_ATM_ANY: - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Logical Link Control Attributes - */ - switch (ap->llc.tag) { - - case T_ATM_PRESENT: - if ((ap->blli.tag_l2 != T_ATM_PRESENT) || - (ap->blli.v.layer_2_protocol.ID_type != T_ATM_SIMPLE_ID) || - (ap->blli.v.layer_2_protocol.ID.simple_ID != - T_ATM_BLLI2_I8802) || - (ap->llc.v.llc_len < T_ATM_LLC_MIN_LEN) || - (ap->llc.v.llc_len > T_ATM_LLC_MAX_LEN)) { - err = EINVAL; - goto done; - } - cop->co_mpx = ATM_ENC_LLC; - cop->co_llc = ap->llc; - break; - - case T_ATM_ABSENT: - case T_ATM_ANY: - cop->co_mpx = ATM_ENC_NULL; - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Called Party Attributes - */ - switch (ap->called.tag) { - - case T_ATM_PRESENT: - switch (ap->called.addr.address_format) { - - case T_ATM_ABSENT: - ap->called.tag = T_ATM_ABSENT; - break; - - case T_ATM_PVC_ADDR: - err = EINVAL; - goto done; - } - break; - - case T_ATM_ABSENT: - case T_ATM_ANY: - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Get an attribute block and save listening attributes - */ - cop->co_lattr = uma_zalloc(atm_attributes_zone, M_WAITOK | M_ZERO); - if (cop->co_lattr == NULL) { - err = ENOMEM; - goto done; - } - *cop->co_lattr = *ap; - - /* - * Now try to register the listening connection - */ - if (so != NULL) - SOCK_LOCK(so); - s = splnet(); - if (so != NULL) - err = solisten_proto_check(so); - if (err) - goto donex; - if (atm_cm_match(cop->co_lattr, NULL) != NULL) { - /* - * Can't have matching listeners - */ - err = EADDRINUSE; - goto donex; - } - cop->co_state = COS_LISTEN; - LINK2TAIL(cop, Atm_connection, atm_listen_queue, co_next); - if (so != NULL) - solisten_proto(so, backlog); - -donex: - (void) splx(s); - if (so != NULL) - SOCK_UNLOCK(so); - -done: - if (err) { - /* - * Undo any partial setup stuff - */ - if (cop) { - if (cop->co_lattr) - uma_zfree(atm_attributes_zone, cop->co_lattr); - uma_zfree(atm_connection_zone, cop); - } - } else { - /* - * Finish connection setup - */ - *copp = cop; - } - return (err); -} - - -/* - * Add to LLC Connection - * - * Called by an endpoint service to create a new Connection Manager API - * instance to be associated with an LLC-multiplexed connection instance - * which has been previously created. The endpoint provided token will - * be used in all further CM -> endpoint function calls, and the returned - * connection block pointer must be used in all subsequent endpoint -> CM - * function calls. - * - * If the return indicates that the connection setup has been immediately - * successful, then the connection is ready for data transmission. - * - * If the return indicates that the connection setup is still in progress, - * then the endpoint must wait for notification from the Connection Manager - * indicating the final status of the call setup. If the call setup completes - * successfully, then a "call connected" notification will be sent to the - * endpoint by the Connection Manager. If the call setup fails, then the - * endpoint will receive a "call cleared" notification. - * - * All connection instances must be freed with an atm_cm_release() call. - * - * Arguments: - * epp pointer to endpoint definition structure - * token endpoint's connection instance token - * llc pointer to llc attributes for new connection - * ecop pointer to existing connection block - * copp pointer to location to return allocated connection block - * - * Returns: - * 0 connection has been successfully established - * EINPROGRESS connection establishment is in progress - * errno addllc failed - reason indicated - * - */ -int -atm_cm_addllc(epp, token, llc, ecop, copp) - Atm_endpoint *epp; - void *token; - struct attr_llc *llc; - Atm_connection *ecop; - Atm_connection **copp; -{ - Atm_connection *cop, *cop2; - Atm_connvc *cvp; - int s, err; - - *copp = NULL; - - /* - * Check out requested LLC attributes - */ - if ((llc->tag != T_ATM_PRESENT) || - ((llc->v.flags & T_ATM_LLC_SHARING) == 0) || - (llc->v.llc_len < T_ATM_LLC_MIN_LEN) || - (llc->v.llc_len > T_ATM_LLC_MAX_LEN)) - return (EINVAL); - - /* - * Get a connection block - * May be called from netisr - don't wait. - */ - cop = uma_zalloc(atm_connection_zone, M_NOWAIT); - if (cop == NULL) - return (ENOMEM); - - /* - * Initialize connection info - */ - cop->co_endpt = epp; - cop->co_toku = token; - cop->co_llc = *llc; - - s = splnet(); - - /* - * Ensure that supplied connection is really valid - */ - cop2 = NULL; - for (cvp = Q_HEAD(atm_connection_queue, Atm_connvc); cvp; - cvp = Q_NEXT(cvp, Atm_connvc, cvc_q)) { - for (cop2 = cvp->cvc_conn; cop2; cop2 = cop2->co_next) { - if (ecop == cop2) - break; - } - if (cop2) - break; - } - if (cop2 == NULL) { - err = ENOENT; - goto done; - } - - switch (ecop->co_state) { - - case COS_OUTCONN: - case COS_INACCEPT: - err = EINPROGRESS; - break; - - case COS_ACTIVE: - err = 0; - break; - - default: - err = EINVAL; - goto done; - } - - /* - * Connection must be LLC multiplexed and shared - */ - if ((ecop->co_mpx != ATM_ENC_LLC) || - ((ecop->co_llc.v.flags & T_ATM_LLC_SHARING) == 0)) { - err = EINVAL; - goto done; - } - - /* - * This new LLC header must be unique for this VCC - */ - cop2 = ecop->co_mxh; - while (cop2) { - int i = MIN(llc->v.llc_len, cop2->co_llc.v.llc_len); - - if (bcmp(llc->v.llc_info, cop2->co_llc.v.llc_info, i) == 0) { - err = EINVAL; - goto done; - } - - cop2 = cop2->co_next; - } - - /* - * Everything seems to check out - */ - cop->co_flags = ecop->co_flags; - cop->co_state = ecop->co_state; - cop->co_mpx = ecop->co_mpx; - cop->co_connvc = ecop->co_connvc; - - LINK2TAIL(cop, Atm_connection, ecop->co_mxh, co_next); - cop->co_mxh = ecop->co_mxh; - -done: - (void) splx(s); - - if (err && err != EINPROGRESS) { - /* - * Undo any partial setup stuff - */ - if (cop) - uma_zfree(atm_connection_zone, cop); - } else { - /* - * Pass new connection back to caller - */ - *copp = cop; - } - return (err); -} - - -/* - * XXX - * - * Arguments: - * cop pointer to connection block - * id identifier for party to be added - * addr address of party to be added - * - * Returns: - * 0 addparty successful - * errno addparty failed - reason indicated - * - */ -int -atm_cm_addparty(cop, id, addr) - Atm_connection *cop; - int id; - struct t_atm_sap *addr; -{ - return (0); -} - - -/* - * XXX - * - * Arguments: - * cop pointer to connection block - * id identifier for party to be added - * cause pointer to cause of drop - * - * Returns: - * 0 dropparty successful - * errno dropparty failed - reason indicated - * - */ -int -atm_cm_dropparty(cop, id, cause) - Atm_connection *cop; - int id; - struct t_atm_cause *cause; -{ - return (0); -} - - -/* - * Release Connection Resources - * - * Called by the endpoint service in order to terminate an ATM connection - * and to release all system resources for the connection. This function - * must be called for every allocated connection instance and must only - * be called by the connection's owner. - * - * Arguments: - * cop pointer to connection block - * cause pointer to cause of release - * - * Returns: - * 0 release successful - * errno release failed - reason indicated - * - */ -int -atm_cm_release(cop, cause) - Atm_connection *cop; - struct t_atm_cause *cause; -{ - Atm_connvc *cvp; - int s; - - s = splnet(); - - /* - * First, a quick state validation check - */ - switch (cop->co_state) { - - case COS_OUTCONN: - case COS_LISTEN: - case COS_INACCEPT: - case COS_ACTIVE: - case COS_CLEAR: - /* - * Break link to user - */ - cop->co_toku = NULL; - break; - - case COS_INCONN: - (void) splx(s); - return (EFAULT); - - default: - panic("atm_cm_release: bogus conn state"); - } - - /* - * Check out the VCC state too - */ - if ((cvp = cop->co_connvc) != NULL) { - - switch (cvp->cvc_state) { - - case CVCS_SETUP: - case CVCS_INIT: - case CVCS_ACCEPT: - case CVCS_ACTIVE: - break; - - case CVCS_INCOMING: - (void) splx(s); - return (EFAULT); - - case CVCS_CLEAR: - (void) splx(s); - return (EALREADY); - - default: - panic("atm_cm_release: bogus connvc state"); - } - - /* - * If we're the only connection, terminate the VCC - */ - if ((cop->co_mxh == cop) && (cop->co_next == NULL)) { - cvp->cvc_attr.cause.tag = T_ATM_PRESENT; - cvp->cvc_attr.cause.v = *cause; - atm_cm_closevc(cvp); - } - } - - /* - * Now get rid of the connection - */ - atm_cm_closeconn(cop, cause); - - return (0); -} - - -/* - * Abort an ATM Connection VCC - * - * This function allows any non-owner kernel entity to request an - * immediate termination of an ATM VCC. This will normally be called - * when encountering a catastrophic error condition that cannot be - * resolved via the available stack protocols. The connection manager - * will schedule the connection's termination, including notifying the - * connection owner of the termination. - * - * This function should only be called by a stack entity instance. After - * calling the function, the caller should set a protocol state which just - * waits for a _TERM stack command to be delivered. - * - * Arguments: - * cvp pointer to connection VCC block - * cause pointer to cause of abort - * - * Returns: - * 0 abort successful - * errno abort failed - reason indicated - * - */ -int -atm_cm_abort(cvp, cause) - Atm_connvc *cvp; - struct t_atm_cause *cause; -{ - ATM_DEBUG2("atm_cm_abort: cvp=%p cause=%d\n", - cvp, cause->cause_value); - - /* - * Note that we're aborting - */ - cvp->cvc_flags |= CVCF_ABORTING; - - switch (cvp->cvc_state) { - - case CVCS_INIT: - /* - * In-line code will handle this - */ - cvp->cvc_attr.cause.tag = T_ATM_PRESENT; - cvp->cvc_attr.cause.v = *cause; - break; - - case CVCS_SETUP: - case CVCS_ACCEPT: - case CVCS_ACTIVE: - /* - * Schedule connection termination, since we want - * to avoid any sequencing interactions - */ - cvp->cvc_attr.cause.tag = T_ATM_PRESENT; - cvp->cvc_attr.cause.v = *cause; - CVC_TIMER(cvp, 0); - break; - - case CVCS_REJECT: - case CVCS_RELEASE: - case CVCS_CLEAR: - case CVCS_TERM: - /* - * Ignore abort, as we're already terminating - */ - break; - - default: - log(LOG_ERR, - "atm_cm_abort: invalid state: cvp=%p, state=%d\n", - cvp, cvp->cvc_state); - } - return (0); -} - - -/* - * Incoming ATM Call Received - * - * Called by a signalling manager to indicate that a new call request has - * been received. This function will allocate and initialize the connection - * manager control blocks and queue this call request. The call request - * processing function, atm_cm_procinq(), will be scheduled to perform the - * call processing. - * - * Arguments: - * vcp pointer to incoming call's VCC control block - * ap pointer to incoming call's attributes - * - * Returns: - * 0 call queuing successful - * errno call queuing failed - reason indicated - * - */ -int -atm_cm_incoming(vcp, ap) - struct vccb *vcp; - Atm_attributes *ap; -{ - Atm_connvc *cvp; - int s, err; - - - /* - * Do some minimal attribute validation - */ - - /* - * Must specify a network interface - */ - if (ap->nif == NULL) - return (EINVAL); - - /* - * AAL Attributes - */ - if ((ap->aal.tag != T_ATM_PRESENT) || - ((ap->aal.type != ATM_AAL5) && - (ap->aal.type != ATM_AAL3_4))) - return (EINVAL); - - /* - * Traffic Descriptor Attributes - */ - if ((ap->traffic.tag != T_ATM_PRESENT) && - (ap->traffic.tag != T_ATM_ABSENT)) - return (EINVAL); - - /* - * Broadband Bearer Attributes - */ - if ((ap->bearer.tag != T_ATM_PRESENT) || - ((ap->bearer.v.connection_configuration != T_ATM_1_TO_1) && - (ap->bearer.v.connection_configuration != T_ATM_1_TO_MANY))) - return (EINVAL); - - /* - * Broadband High Layer Attributes - */ - if ((ap->bhli.tag != T_ATM_PRESENT) && - (ap->bhli.tag != T_ATM_ABSENT)) - return (EINVAL); - - /* - * Broadband Low Layer Attributes - */ - if ((ap->blli.tag_l2 != T_ATM_PRESENT) && - (ap->blli.tag_l2 != T_ATM_ABSENT)) - return (EINVAL); - if ((ap->blli.tag_l3 != T_ATM_PRESENT) && - (ap->blli.tag_l3 != T_ATM_ABSENT)) - return (EINVAL); - - /* - * Logical Link Control Attributes - */ - if (ap->llc.tag == T_ATM_PRESENT) - return (EINVAL); - ap->llc.tag = T_ATM_ANY; - - /* - * Called Party Attributes - */ - if ((ap->called.tag != T_ATM_PRESENT) || - (ap->called.addr.address_format == T_ATM_ABSENT)) - return (EINVAL); - if (ap->called.tag == T_ATM_ABSENT) { - ap->called.addr.address_format = T_ATM_ABSENT; - ap->called.addr.address_length = 0; - ap->called.subaddr.address_format = T_ATM_ABSENT; - ap->called.subaddr.address_length = 0; - } - - /* - * Calling Party Attributes - */ - if ((ap->calling.tag != T_ATM_PRESENT) && - (ap->calling.tag != T_ATM_ABSENT)) - return (EINVAL); - if (ap->calling.tag == T_ATM_ABSENT) { - ap->calling.addr.address_format = T_ATM_ABSENT; - ap->calling.addr.address_length = 0; - ap->calling.subaddr.address_format = T_ATM_ABSENT; - ap->calling.subaddr.address_length = 0; - } - - /* - * Quality of Service Attributes - */ - if (ap->qos.tag != T_ATM_PRESENT) - return (EINVAL); - - /* - * Transit Network Attributes - */ - if ((ap->transit.tag != T_ATM_PRESENT) && - (ap->transit.tag != T_ATM_ABSENT)) - return (EINVAL); - - /* - * Cause Attributes - */ - if ((ap->cause.tag != T_ATM_PRESENT) && - (ap->cause.tag != T_ATM_ABSENT)) - return (EINVAL); - - /* - * Get a connection VCC block - * May be called from netisr - don't wait. - */ - cvp = uma_zalloc(atm_connvc_zone, M_NOWAIT); - if (cvp == NULL) { - err = ENOMEM; - goto fail; - } - - /* - * Initialize the control block - */ - cvp->cvc_vcc = vcp; - cvp->cvc_sigmgr = vcp->vc_pif->pif_sigmgr; - cvp->cvc_attr = *ap; - cvp->cvc_state = CVCS_INCOMING; - - /* - * Control queue length - */ - s = splnet(); - if (atm_incoming_qlen >= ATM_CALLQ_MAX) { - (void) splx(s); - err = EBUSY; - goto fail; - } - - /* - * Queue request and schedule call processing function - */ - cvp->cvc_flags |= CVCF_INCOMQ; - ENQUEUE(cvp, Atm_connvc, cvc_q, atm_incoming_queue); - if (atm_incoming_qlen++ == 0) { - timeout(atm_cm_procinq, (void *)0, 0); - } - - /* - * Link for signalling manager - */ - vcp->vc_connvc = cvp; - - (void) splx(s); - - return (0); - -fail: - /* - * Free any resources - */ - if (cvp) - uma_zfree(atm_connvc_zone, cvp); - return (err); -} - - -/* - * VCC Connected Notification - * - * This function is called by a signalling manager as notification that a - * VCC call setup has been successful. - * - * Arguments: - * cvp pointer to connection VCC block - * - * Returns: - * none - * - */ -void -atm_cm_connected(cvp) - Atm_connvc *cvp; -{ - Atm_connection *cop, *cop2; - KBuffer *m; - int s, err; - - s = splnet(); - - /* - * Validate connection vcc - */ - switch (cvp->cvc_state) { - - case CVCS_SETUP: - /* - * Initialize the stack - */ - cvp->cvc_state = CVCS_INIT; - STACK_CALL(atm_stackcmds[cvp->cvc_attr.api].init, - cvp->cvc_lower, cvp->cvc_tokl, - cvp, cvp->cvc_attr.api_init, 0, err); - if (err) - panic("atm_cm_connected: init"); - - if (cvp->cvc_flags & CVCF_ABORTING) { - /* - * Someone on the stack bailed out...notify all of the - * connections and schedule the VCC termination - */ - cop = cvp->cvc_conn; - while (cop) { - cop2 = cop->co_next; - atm_cm_closeconn(cop, &cvp->cvc_attr.cause.v); - cop = cop2; - } - atm_cm_closevc(cvp); - (void) splx(s); - return; - } - break; - - case CVCS_ACCEPT: - /* - * Stack already initialized - */ - break; - - default: - panic("atm_cm_connected: connvc state"); - } - - /* - * VCC is ready for action - */ - cvp->cvc_state = CVCS_ACTIVE; - - /* - * Notify all connections that the call has completed - */ - cop = cvp->cvc_conn; - while (cop) { - cop2 = cop->co_next; - - switch (cop->co_state) { - - case COS_OUTCONN: - case COS_INACCEPT: - cop->co_state = COS_ACTIVE; - (*cop->co_endpt->ep_connected)(cop->co_toku); - break; - - case COS_ACTIVE: - /* - * May get here if an ep_connected() call (from - * above) results in an atm_cm_addllc() call for - * the just connected connection. - */ - break; - - default: - panic("atm_cm_connected: connection state"); - } - - cop = cop2; - } - - (void) splx(s); - - /* - * Input any queued packets - */ - while ((m = cvp->cvc_rcvq) != NULL) { - cvp->cvc_rcvq = KB_QNEXT(m); - cvp->cvc_rcvqlen--; - KB_QNEXT(m) = NULL; - - /* - * Currently only supported for CPCS API - */ - atm_cm_cpcs_upper(CPCS_UNITDATA_SIG, cvp, (intptr_t)m, 0); - } - - return; -} - - -/* - * VCC Cleared Notification - * - * This function is called by a signalling manager as notification that a - * VCC call has been cleared. The cause information describing the reason - * for the call clearing will be contained in the connection VCC attributes. - * - * Arguments: - * cvp pointer to connection VCC block - * - * Returns: - * none - * - */ -void -atm_cm_cleared(cvp) - Atm_connvc *cvp; -{ - Atm_connection *cop, *cop2; - int s; - - KASSERT((cvp->cvc_state != CVCS_FREE) && (cvp->cvc_state < CVCS_CLEAR), - ("atm_cm_cleared: state sanity check failed")); - - cvp->cvc_state = CVCS_CLEAR; - s = splnet(); - - /* - * Terminate all connections - */ - cop = cvp->cvc_conn; - while (cop) { - cop2 = cop->co_next; - atm_cm_closeconn(cop, &cvp->cvc_attr.cause.v); - cop = cop2; - } - - /* - * Clean up connection VCC - */ - atm_cm_closevc(cvp); - - (void) splx(s); - - return; -} - - -/* - * Process Incoming Call Queue - * - * This function is scheduled by atm_cm_incoming() in order to process - * all the entries on the incoming call queue. - * - * Arguments: - * arg argument passed on timeout() call - * - * Returns: - * none - * - */ -static KTimeout_ret -atm_cm_procinq(arg) - void *arg; -{ - Atm_connvc *cvp; - int cnt = 0, s; - - /* - * Only process incoming calls up to our quota - */ - while (cnt++ < ATM_CALLQ_MAX) { - - s = splnet(); - - /* - * Get next awaiting call - */ - cvp = Q_HEAD(atm_incoming_queue, Atm_connvc); - if (cvp == NULL) { - (void) splx(s); - break; - } - DEQUEUE(cvp, Atm_connvc, cvc_q, atm_incoming_queue); - atm_incoming_qlen--; - cvp->cvc_flags &= ~CVCF_INCOMQ; - - /* - * Handle the call - */ - atm_cm_incall(cvp); - - (void) splx(s); - } - - /* - * If we've expended our quota, reschedule ourselves - */ - if (cnt >= ATM_CALLQ_MAX) - timeout(atm_cm_procinq, (void *)0, 0); -} - - -/* - * Process Incoming Call - * - * This function will search through the listening queue and try to find - * matching endpoint(s) for the incoming call. If we find any, we will - * notify the endpoint service(s) of the incoming call and will then - * notify the signalling manager to progress the call to an active status. - * - * If there are no listeners for the call, the signalling manager will be - * notified of a call rejection. - * - * Called at splnet. - * - * Arguments: - * cvp pointer to connection VCC for incoming call - * - * Returns: - * none - * - */ -static void -atm_cm_incall(cvp) - Atm_connvc *cvp; -{ - Atm_connection *cop, *lcop, *hcop; - Atm_attributes attr; - int err; - - hcop = NULL; - lcop = NULL; - cop = NULL; - attr = cvp->cvc_attr; - - /* - * Look for matching listeners - */ - while ((lcop = atm_cm_match(&attr, lcop)) != NULL) { - - if (cop == NULL) { - /* - * Need a new connection block - * May be called from timeout - dont wait. - */ - cop = uma_zalloc(atm_connection_zone, M_NOWAIT); - if (cop == NULL) { - cvp->cvc_attr.cause = atm_cause_tmpl; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_TEMPORARY_FAILURE; - goto fail; - } - } - - /* - * Initialize connection from listener and incoming call - */ - cop->co_mxh = NULL; - cop->co_state = COS_INCONN; - cop->co_mpx = lcop->co_mpx; - cop->co_endpt = lcop->co_endpt; - cop->co_llc = lcop->co_llc; - - switch (attr.bearer.v.connection_configuration) { - - case T_ATM_1_TO_1: - cop->co_flags |= COF_P2P; - break; - - case T_ATM_1_TO_MANY: - /* Not supported */ - cop->co_flags |= COF_P2MP; - cvp->cvc_attr.cause = atm_cause_tmpl; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_BEARER_CAPABILITY_NOT_IMPLEMENTED; - goto fail; - } - - /* - * Notify endpoint of incoming call - */ - err = (*cop->co_endpt->ep_incoming) - (lcop->co_toku, cop, &cvp->cvc_attr, &cop->co_toku); - - if (err == 0) { - - /* - * Endpoint has accepted the call - * - * Setup call attributes - */ - if (hcop == NULL) { - cvp->cvc_attr.api = lcop->co_lattr->api; - cvp->cvc_attr.api_init = - lcop->co_lattr->api_init; - cvp->cvc_attr.llc = lcop->co_lattr->llc; - } - cvp->cvc_attr.headin = MAX(cvp->cvc_attr.headin, - lcop->co_lattr->headin); - - /* - * Setup connection info and queueing - */ - cop->co_state = COS_INACCEPT; - cop->co_connvc = cvp; - LINK2TAIL(cop, Atm_connection, hcop, co_next); - cop->co_mxh = hcop; - - /* - * Need a new connection block next time around - */ - cop = NULL; - - } else { - /* - * Endpoint refuses call - */ - goto fail; - } - } - - /* - * We're done looking for listeners - */ - if (hcop) { - /* - * Someone actually wants the call, so notify - * the signalling manager to continue - */ - cvp->cvc_flags |= CVCF_CONNQ; - ENQUEUE(cvp, Atm_connvc, cvc_q, atm_connection_queue); - if (atm_cm_accept(cvp, hcop)) - goto fail; - - } else { - /* - * Nobody around to take the call - */ - cvp->cvc_attr.cause = atm_cause_tmpl; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_INCOMPATIBLE_DESTINATION; - goto fail; - } - - /* - * Clean up loose ends - */ - if (cop) - uma_zfree(atm_connection_zone, cop); - - /* - * Call has been accepted - */ - return; - -fail: - /* - * Call failed - notify any endpoints of the call failure - */ - - /* - * Clean up loose ends - */ - if (cop) - uma_zfree(atm_connection_zone, cop); - - if (cvp->cvc_attr.cause.tag != T_ATM_PRESENT) { - cvp->cvc_attr.cause = atm_cause_tmpl; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_UNSPECIFIED_NORMAL; - } - cop = hcop; - while (cop) { - Atm_connection *cop2 = cop->co_next; - atm_cm_closeconn(cop, &cvp->cvc_attr.cause.v); - cop = cop2; - } - - /* - * Tell the signalling manager to reject the call - */ - atm_cm_closevc(cvp); - - return; -} - - -/* - * Accept an Incoming ATM Call - * - * Some endpoint service(s) wants to accept an incoming call, so the - * signalling manager will be notified to attempt to progress the call - * to an active status. - * - * If the signalling manager indicates that connection activation has - * been immediately successful, then all of the endpoints will be notified - * that the connection is ready for data transmission. - * - * If the return indicates that connection activation is still in progress, - * then the endpoints must wait for notification from the Connection Manager - * indicating the final status of the call setup. If the call setup completes - * successfully, then a "call connected" notification will be sent to the - * endpoints by the Connection Manager. If the call setup fails, then the - * endpoints will receive a "call cleared" notification. - * - * Called at splnet. - * - * Arguments: - * cvp pointer to connection VCC for incoming call - * cop pointer to head of accepted connections - * - * Returns: - * 0 connection has been successfully activated - * errno accept failed - reason indicated - * - */ -static int -atm_cm_accept(cvp, cop) - Atm_connvc *cvp; - Atm_connection *cop; -{ - struct stack_list sl; - void (*upf)(int, void *, intptr_t, intptr_t); - int sli, err, err2; - - - /* - * Link vcc to connections - */ - cvp->cvc_conn = cop; - - /* - * Initialize stack list index - */ - sli = 0; - - /* - * Check out Data API - */ - switch (cvp->cvc_attr.api) { - - case CMAPI_CPCS: - upf = atm_cm_cpcs_upper; - break; - - case CMAPI_SAAL: - sl.sl_sap[sli++] = SAP_SSCF_UNI; - sl.sl_sap[sli++] = SAP_SSCOP; - upf = atm_cm_saal_upper; - break; - - case CMAPI_SSCOP: - sl.sl_sap[sli++] = SAP_SSCOP; - upf = atm_cm_sscop_upper; - break; - - default: - upf = NULL; - } - - /* - * AAL Attributes - */ - switch (cvp->cvc_attr.aal.type) { - - case ATM_AAL5: - sl.sl_sap[sli++] = SAP_CPCS_AAL5; - sl.sl_sap[sli++] = SAP_SAR_AAL5; - sl.sl_sap[sli++] = SAP_ATM; - break; - - case ATM_AAL3_4: - sl.sl_sap[sli++] = SAP_CPCS_AAL3_4; - sl.sl_sap[sli++] = SAP_SAR_AAL3_4; - sl.sl_sap[sli++] = SAP_ATM; - break; - } - - /* - * Terminate stack list - */ - sl.sl_sap[sli] = 0; - - /* - * Create a service stack - */ - err = atm_create_stack(cvp, &sl, upf); - if (err) { - goto done; - } - - /* - * Let the signalling manager finish the VCC activation - */ - switch ((*cvp->cvc_sigmgr->sm_accept)(cvp->cvc_vcc, &err)) { - - case CALL_PROCEEDING: - /* - * Note that we're not finished yet - */ - err = EINPROGRESS; - /* FALLTHRU */ - - case CALL_CONNECTED: - /* - * Initialize the stack now, even if the call isn't totally - * active yet. We want to avoid the delay between getting - * the "call connected" event and actually notifying the - * adapter to accept cells on the new VCC - if the delay is - * too long, then we end up dropping the first pdus sent by - * the caller. - */ - cvp->cvc_state = CVCS_INIT; - STACK_CALL(atm_stackcmds[cvp->cvc_attr.api].init, - cvp->cvc_lower, cvp->cvc_tokl, cvp, - cvp->cvc_attr.api_init, 0, err2); - if (err2) - panic("atm_cm_accept: init"); - - if (cvp->cvc_flags & CVCF_ABORTING) { - /* - * Someone on the stack bailed out...schedule the - * VCC and stack termination - */ - err = ECONNABORTED; - } else { - /* - * Everything looks fine from here - */ - if (err) - cvp->cvc_state = CVCS_ACCEPT; - else - cvp->cvc_state = CVCS_ACTIVE; - } - break; - - case CALL_FAILED: - /* - * Terminate stack and clean up before we leave - */ - cvp->cvc_state = CVCS_CLEAR; - break; - - default: - panic("atm_cm_accept: accept"); - } - -done: - if (err == 0) { - /* - * Call has been connected, notify endpoints - */ - while (cop) { - Atm_connection *cop2 = cop->co_next; - - cop->co_state = COS_ACTIVE; - (*cop->co_endpt->ep_connected)(cop->co_toku); - cop = cop2; - } - - } else if (err == EINPROGRESS) { - /* - * Call is still in progress, endpoint must wait - */ - err = 0; - - } else { - /* - * Let caller know we failed - */ - cvp->cvc_attr.cause = atm_cause_tmpl; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_UNSPECIFIED_RESOURCE_UNAVAILABLE; - } - - return (err); -} - - -/* - * Match Attributes on Listening Queue - * - * This function will attempt to match the supplied connection attributes - * with one of the registered attributes in the listening queue. The pcop - * argument may be supplied in order to allow multiple listeners to share - * an incoming call (if supported by the listeners). - * - * Called at splnet. - * - * Arguments: - * ap pointer to attributes to be matched - * pcop pointer to the previously matched connection - * - * Returns: - * addr connection with which a match was found - * 0 no match found - * - */ -Atm_connection * -atm_cm_match(ap, pcop) - Atm_attributes *ap; - Atm_connection *pcop; -{ - Atm_connection *cop; - Atm_attributes *lap; - - - /* - * If we've already matched a listener... - */ - if (pcop) { - /* - * Make sure already matched listener supports sharing - */ - if ((pcop->co_mpx != ATM_ENC_LLC) || - ((pcop->co_llc.v.flags & T_ATM_LLC_SHARING) == 0)) - return (NULL); - - /* - * Position ourselves after the matched entry - */ - for (cop = atm_listen_queue; cop; cop = cop->co_next) { - if (cop == pcop) { - cop = pcop->co_next; - break; - } - } - } else { - /* - * Start search at top of listening queue - */ - cop = atm_listen_queue; - } - - /* - * Search through listening queue - */ - for (; cop; cop = cop->co_next) { - - lap = cop->co_lattr; - - /* - * If we're trying to share, check that this entry allows it - */ - if (pcop) { - if ((cop->co_mpx != ATM_ENC_LLC) || - ((cop->co_llc.v.flags & T_ATM_LLC_SHARING) == 0)) - continue; - } - - /* - * ALL "matchable" attributes must match - */ - - /* - * BHLI - */ - if (lap->bhli.tag == T_ATM_ABSENT) { - if (ap->bhli.tag == T_ATM_PRESENT) - continue; - } else if (lap->bhli.tag == T_ATM_PRESENT) { - if (ap->bhli.tag == T_ATM_ABSENT) - continue; - if (ap->bhli.tag == T_ATM_PRESENT) - if (bcmp(&lap->bhli.v, &ap->bhli.v, - sizeof(struct t_atm_bhli))) - continue; - } - - /* - * BLLI Layer 2 - */ - if (lap->blli.tag_l2 == T_ATM_ABSENT) { - if (ap->blli.tag_l2 == T_ATM_PRESENT) - continue; - } else if (lap->blli.tag_l2 == T_ATM_PRESENT) { - if (ap->blli.tag_l2 == T_ATM_ABSENT) - continue; - if (ap->blli.tag_l2 == T_ATM_PRESENT) { - if (bcmp(&lap->blli.v.layer_2_protocol.ID, - &ap->blli.v.layer_2_protocol.ID, - sizeof( - ap->blli.v.layer_2_protocol.ID))) - continue; - } - } - - /* - * BLLI Layer 3 - */ - if (lap->blli.tag_l3 == T_ATM_ABSENT) { - if (ap->blli.tag_l3 == T_ATM_PRESENT) - continue; - } else if (lap->blli.tag_l3 == T_ATM_PRESENT) { - if (ap->blli.tag_l3 == T_ATM_ABSENT) - continue; - if (ap->blli.tag_l3 == T_ATM_PRESENT) { - if (bcmp(&lap->blli.v.layer_3_protocol.ID, - &ap->blli.v.layer_3_protocol.ID, - sizeof( - ap->blli.v.layer_3_protocol.ID))) - continue; - } - } - - /* - * LLC - */ - if (lap->llc.tag == T_ATM_ABSENT) { - if (ap->llc.tag == T_ATM_PRESENT) - continue; - } else if (lap->llc.tag == T_ATM_PRESENT) { - if (ap->llc.tag == T_ATM_ABSENT) - continue; - if (ap->llc.tag == T_ATM_PRESENT) { - int i = MIN(lap->llc.v.llc_len, - ap->llc.v.llc_len); - - if (bcmp(lap->llc.v.llc_info, - ap->llc.v.llc_info, i)) - continue; - } - } - - /* - * AAL - */ - if (lap->aal.tag == T_ATM_ABSENT) { - if (ap->aal.tag == T_ATM_PRESENT) - continue; - } else if (lap->aal.tag == T_ATM_PRESENT) { - if (ap->aal.tag == T_ATM_ABSENT) - continue; - if (ap->aal.tag == T_ATM_PRESENT) { - if (lap->aal.type != ap->aal.type) - continue; - if (lap->aal.type == ATM_AAL5) { - if (lap->aal.v.aal5.SSCS_type != - ap->aal.v.aal5.SSCS_type) - continue; - } else { - if (lap->aal.v.aal4.SSCS_type != - ap->aal.v.aal4.SSCS_type) - continue; - } - } - } - - /* - * Called Party - */ - if (lap->called.tag == T_ATM_ABSENT) { - if (ap->called.tag == T_ATM_PRESENT) - continue; - } else if (lap->called.tag == T_ATM_PRESENT) { - if (ap->called.tag == T_ATM_ABSENT) - continue; - if (ap->called.tag == T_ATM_PRESENT) { - if ((!ATM_ADDR_EQUAL(&lap->called.addr, - &ap->called.addr)) || - (!ATM_ADDR_EQUAL(&lap->called.subaddr, - &ap->called.subaddr))) - continue; - } - } - - /* - * Found a full match - return it - */ - break; - } - - return (cop); -} - - -/* - * Find Shareable LLC VCC - * - * Given an endpoint-supplied connection attribute using LLC multiplexing, - * this function will attempt to locate an existing connection which meets - * the requirements of the supplied attributes. - * - * Called at splnet. - * - * Arguments: - * ap pointer to requested attributes - * - * Returns: - * addr shareable LLC connection VCC - * 0 no shareable VCC available - * - */ -static Atm_connvc * -atm_cm_share_llc(ap) - Atm_attributes *ap; -{ - Atm_connection *cop; - Atm_connvc *cvp; - - /* - * Is requestor willing to share? - */ - if ((ap->llc.v.flags & T_ATM_LLC_SHARING) == 0) - return (NULL); - - /* - * Try to find a shareable connection - */ - for (cvp = Q_HEAD(atm_connection_queue, Atm_connvc); cvp; - cvp = Q_NEXT(cvp, Atm_connvc, cvc_q)) { - - /* - * Dont use terminating connections - */ - switch (cvp->cvc_state) { - - case CVCS_SETUP: - case CVCS_ACCEPT: - case CVCS_ACTIVE: - break; - - default: - continue; - } - - /* - * Is connection LLC and shareable? - */ - if ((cvp->cvc_attr.llc.tag != T_ATM_PRESENT) || - ((cvp->cvc_attr.llc.v.flags & T_ATM_LLC_SHARING) == 0)) - continue; - - /* - * Match requested attributes with existing connection - */ - if (ap->nif != cvp->cvc_attr.nif) - continue; - - if ((ap->api != cvp->cvc_attr.api) || - (ap->api_init != cvp->cvc_attr.api_init)) - continue; - - /* - * Remote Party - */ - if (cvp->cvc_flags & CVCF_CALLER) { - if ((!ATM_ADDR_EQUAL(&ap->called.addr, - &cvp->cvc_attr.called.addr)) || - (!ATM_ADDR_EQUAL(&ap->called.subaddr, - &cvp->cvc_attr.called.subaddr))) - continue; - } else { - if (cvp->cvc_attr.calling.tag != T_ATM_PRESENT) - continue; - if ((!ATM_ADDR_EQUAL(&ap->called.addr, - &cvp->cvc_attr.calling.addr)) || - (!ATM_ADDR_EQUAL(&ap->called.subaddr, - &cvp->cvc_attr.calling.subaddr))) - continue; - } - - /* - * AAL - */ - if (ap->aal.type == ATM_AAL5) { - struct t_atm_aal5 *ap5, *cv5; - - ap5 = &ap->aal.v.aal5; - cv5 = &cvp->cvc_attr.aal.v.aal5; - - if ((cvp->cvc_attr.aal.type != ATM_AAL5) || - (ap5->SSCS_type != cv5->SSCS_type)) - continue; - - if (cvp->cvc_flags & CVCF_CALLER) { - if (ap5->forward_max_SDU_size > - cv5->forward_max_SDU_size) - continue; - } else { - if (ap5->forward_max_SDU_size > - cv5->backward_max_SDU_size) - continue; - } - } else { - struct t_atm_aal4 *ap4, *cv4; - - ap4 = &ap->aal.v.aal4; - cv4 = &cvp->cvc_attr.aal.v.aal4; - - if ((cvp->cvc_attr.aal.type != ATM_AAL3_4) || - (ap4->SSCS_type != cv4->SSCS_type)) - continue; - - if (cvp->cvc_flags & CVCF_CALLER) { - if (ap4->forward_max_SDU_size > - cv4->forward_max_SDU_size) - continue; - } else { - if (ap4->forward_max_SDU_size > - cv4->backward_max_SDU_size) - continue; - } - } - - /* - * Traffic Descriptor - */ - if ((ap->traffic.tag != T_ATM_PRESENT) || - (cvp->cvc_attr.traffic.tag != T_ATM_PRESENT) || - (ap->traffic.v.best_effort != T_YES) || - (cvp->cvc_attr.traffic.v.best_effort != T_YES)) - continue; - - /* - * Broadband Bearer - */ - if (ap->bearer.v.connection_configuration != - cvp->cvc_attr.bearer.v.connection_configuration) - continue; - - /* - * QOS - */ - if (cvp->cvc_flags & CVCF_CALLER) { - if ((ap->qos.v.forward.qos_class != - cvp->cvc_attr.qos.v.forward.qos_class) || - (ap->qos.v.backward.qos_class != - cvp->cvc_attr.qos.v.backward.qos_class)) - continue; - } else { - if ((ap->qos.v.forward.qos_class != - cvp->cvc_attr.qos.v.backward.qos_class) || - (ap->qos.v.backward.qos_class != - cvp->cvc_attr.qos.v.forward.qos_class)) - continue; - } - - /* - * The new LLC header must also be unique for this VCC - */ - for (cop = cvp->cvc_conn; cop; cop = cop->co_next) { - int i = MIN(ap->llc.v.llc_len, - cop->co_llc.v.llc_len); - - if (bcmp(ap->llc.v.llc_info, - cop->co_llc.v.llc_info, i) == 0) - break; - } - - /* - * If no header overlaps, then we're done - */ - if (cop == NULL) - break; - } - - return (cvp); -} - - -/* - * Close Connection - * - * This function will terminate a connection, including notifying the - * user, if necessary, and freeing up control block memory. The caller - * is responsible for managing the connection VCC. - * - * Called at splnet. - * - * Arguments: - * cop pointer to connection block - * cause pointer to cause of close - * - * Returns: - * none - * - */ -static void -atm_cm_closeconn(cop, cause) - Atm_connection *cop; - struct t_atm_cause *cause; -{ - - /* - * Decide whether user needs notification - */ - switch (cop->co_state) { - - case COS_OUTCONN: - case COS_LISTEN: - case COS_INCONN: - case COS_INACCEPT: - case COS_ACTIVE: - /* - * Yup, let 'em know connection is gone - */ - if (cop->co_toku) - (*cop->co_endpt->ep_cleared)(cop->co_toku, cause); - break; - - case COS_CLEAR: - /* - * Nope,they should know already - */ - break; - - default: - panic("atm_cm_closeconn: bogus state"); - } - - /* - * Unlink connection from its queues - */ - switch (cop->co_state) { - - case COS_LISTEN: - uma_zfree(atm_attributes_zone, cop->co_lattr); - UNLINK(cop, Atm_connection, atm_listen_queue, co_next); - break; - - default: - /* - * Remove connection from multiplexor queue - */ - if (cop->co_mxh != cop) { - /* - * Connection is down the chain, just unlink it - */ - UNLINK(cop, Atm_connection, cop->co_mxh, co_next); - - } else if (cop->co_next != NULL) { - /* - * Connection is at the head of a non-singleton chain, - * so unlink and reset the chain head - */ - Atm_connection *t, *nhd; - - t = nhd = cop->co_next; - while (t) { - t->co_mxh = nhd; - t = t->co_next; - } - if (nhd->co_connvc) - nhd->co_connvc->cvc_conn = nhd; - } - } - - /* - * Free the connection block - */ - cop->co_state = COS_FREE; - uma_zfree(atm_connection_zone, cop); - return; -} - - -/* - * Close Connection VCC - * - * This function will terminate a connection VCC, including releasing the - * the call to the signalling manager, terminating the VCC protocol stack, - * and freeing up control block memory. - * - * Called at splnet. - * - * Arguments: - * cvp pointer to connection VCC block - * - * Returns: - * none - * - */ -static void -atm_cm_closevc(cvp) - Atm_connvc *cvp; -{ - int err; - - /* - * Break links with the connection block - */ - cvp->cvc_conn = NULL; - - /* - * Cancel any running timer - */ - CVC_CANCEL(cvp); - - /* - * Free queued packets - */ - while (cvp->cvc_rcvq) { - KBuffer *m; - - m = cvp->cvc_rcvq; - cvp->cvc_rcvq = KB_QNEXT(m); - KB_QNEXT(m) = NULL; - KB_FREEALL(m); - } - - /* - * Unlink from any queues - */ - if (cvp->cvc_flags & CVCF_INCOMQ) { - DEQUEUE(cvp, Atm_connvc, cvc_q, atm_incoming_queue); - atm_incoming_qlen--; - cvp->cvc_flags &= ~CVCF_INCOMQ; - - } else if (cvp->cvc_flags & CVCF_CONNQ) { - DEQUEUE(cvp, Atm_connvc, cvc_q, atm_connection_queue); - cvp->cvc_flags &= ~CVCF_CONNQ; - } - - /* - * Release the signalling call - */ - switch (cvp->cvc_state) { - - case CVCS_SETUP: - case CVCS_INIT: - case CVCS_ACCEPT: - case CVCS_ACTIVE: - case CVCS_RELEASE: - if (cvp->cvc_vcc) { - cvp->cvc_state = CVCS_RELEASE; - switch ((*cvp->cvc_sigmgr->sm_release) - (cvp->cvc_vcc, &err)) { - - case CALL_CLEARED: - /* - * Looks good so far... - */ - break; - - case CALL_PROCEEDING: - /* - * We'll have to wait for the call to clear - */ - return; - - case CALL_FAILED: - /* - * If there's a memory shortage, retry later. - * Otherwise who knows what's going on.... - */ - if ((err == ENOMEM) || (err == ENOBUFS)) { - CVC_TIMER(cvp, 1 * ATM_HZ); - return; - } - log(LOG_ERR, - "atm_cm_closevc: release %d\n", err); - break; - } - } - break; - - case CVCS_INCOMING: - case CVCS_REJECT: - if (cvp->cvc_vcc) { - cvp->cvc_state = CVCS_REJECT; - switch ((*cvp->cvc_sigmgr->sm_reject) - (cvp->cvc_vcc, &err)) { - - case CALL_CLEARED: - /* - * Looks good so far... - */ - break; - - case CALL_FAILED: - /* - * If there's a memory shortage, retry later. - * Otherwise who knows what's going on.... - */ - if ((err == ENOMEM) || (err == ENOBUFS)) { - CVC_TIMER(cvp, 1 * ATM_HZ); - return; - } - log(LOG_ERR, - "atm_cm_closevc: reject %d\n", err); - break; - } - } - break; - - case CVCS_CLEAR: - case CVCS_TERM: - /* - * No need for anything here - */ - break; - - default: - panic("atm_cm_closevc: bogus state"); - } - - /* - * Now terminate the stack - */ - if (cvp->cvc_tokl) { - cvp->cvc_state = CVCS_TERM; - - /* - * Wait until stack is unwound before terminating - */ - if ((cvp->cvc_downcnt > 0) || (cvp->cvc_upcnt > 0)) { - CVC_TIMER(cvp, 0); - return; - } - - STACK_CALL(atm_stackcmds[cvp->cvc_attr.api].term, - cvp->cvc_lower, cvp->cvc_tokl, cvp, 0, 0, err); - - cvp->cvc_tokl = NULL; - } - - /* - * Let signalling manager finish up - */ - cvp->cvc_state = CVCS_FREE; - if (cvp->cvc_vcc) { - (void) (*cvp->cvc_sigmgr->sm_free)(cvp->cvc_vcc); - } - - /* - * Finally, free our own control blocks - */ - uma_zfree(atm_connvc_zone, cvp); - return; -} - - -/* - * Process a Connection VCC timeout - * - * Called when a previously scheduled cvc control block timer expires. - * Processing will be based on the current cvc state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to cvc timer control block - * - * Returns: - * none - * - */ -static void -atm_cm_timeout(tip) - struct atm_time *tip; -{ - Atm_connection *cop, *cop2; - Atm_connvc *cvp; - - /* - * Back-off to cvc control block - */ - cvp = (Atm_connvc *) - ((caddr_t)tip - offsetof(Atm_connvc, cvc_time)); - - /* - * Process timeout based on protocol state - */ - switch (cvp->cvc_state) { - - case CVCS_SETUP: - case CVCS_ACCEPT: - case CVCS_ACTIVE: - /* - * Handle VCC abort - */ - if ((cvp->cvc_flags & CVCF_ABORTING) == 0) - goto logerr; - - /* - * Terminate all connections - */ - cop = cvp->cvc_conn; - while (cop) { - cop2 = cop->co_next; - atm_cm_closeconn(cop, &cvp->cvc_attr.cause.v); - cop = cop2; - } - - /* - * Terminate VCC - */ - atm_cm_closevc(cvp); - - break; - - case CVCS_REJECT: - case CVCS_RELEASE: - case CVCS_TERM: - /* - * Retry failed operation - */ - atm_cm_closevc(cvp); - break; - - default: -logerr: - log(LOG_ERR, - "atm_cm_timeout: invalid state: cvp=%p, state=%d\n", - cvp, cvp->cvc_state); - } -} - - -/* - * CPCS User Control Commands - * - * This function is called by an endpoint user to pass a control command - * across a CPCS data API. Mostly we just send these down the stack. - * - * Arguments: - * cmd stack command code - * cop pointer to connection block - * arg argument - * - * Returns: - * 0 command output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_cpcs_ctl(cmd, cop, arg) - int cmd; - Atm_connection *cop; - void *arg; -{ - Atm_connvc *cvp; - int err = 0; - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_CPCS) { - err = EFAULT; - goto done; - } - - switch (cmd) { - - default: - err = EINVAL; - } - -done: - return (err); -} - - -/* - * CPCS Data Output - * - * This function is called by an endpoint user to output a data packet - * across a CPCS data API. After we've validated the connection state, the - * packet will be encapsulated (if necessary) and sent down the data stack. - * - * Arguments: - * cop pointer to connection block - * m pointer to packet buffer chain to be output - * - * Returns: - * 0 packet output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_cpcs_data(cop, m) - Atm_connection *cop; - KBuffer *m; -{ - Atm_connvc *cvp; - struct attr_llc *llcp; - int err, space; - void *bp; - - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_CPCS) { - err = EFAULT; - goto done; - } - - /* - * Add any packet encapsulation - */ - switch (cop->co_mpx) { - - case ATM_ENC_NULL: - /* - * None needed... - */ - break; - - case ATM_ENC_LLC: - /* - * Need to add an LLC header - */ - llcp = &cop->co_llc; - - /* - * See if there's room to add LLC header to front of packet. - */ - KB_HEADROOM(m, space); - if (space < llcp->v.llc_len) { - KBuffer *n; - - /* - * We have to allocate another buffer and tack it - * onto the front of the packet - */ - MGETHDR(n, KB_F_NOWAIT, KB_T_HEADER); - if (n == 0) { - err = ENOMEM; - goto done; - } - KB_TAILALIGN(n, llcp->v.llc_len); - KB_LINKHEAD(n, m); - m = n; - } else { - /* - * Header fits, just adjust buffer controls - */ - KB_HEADADJ(m, llcp->v.llc_len); - } - - /* - * Add the LLC header - */ - KB_DATASTART(m, bp, void *); - bcopy(llcp->v.llc_info, bp, llcp->v.llc_len); - KB_PLENADJ(m, llcp->v.llc_len); - break; - - default: - panic("atm_cm_cpcs_data: mpx"); - } - - /* - * Finally, we can send the packet on its way - */ - STACK_CALL(CPCS_UNITDATA_INV, cvp->cvc_lower, cvp->cvc_tokl, - cvp, (intptr_t)m, 0, err); - -done: - return (err); -} - - -/* - * Process CPCS Stack Commands - * - * This is the top of the CPCS API data stack. All upward stack commands - * for the CPCS data API will be received and processed here. - * - * Arguments: - * cmd stack command code - * tok session token (pointer to connection VCC control block) - * arg1 argument 1 - * arg2 argument 2 - * - * Returns: - * none - * - */ -static void -atm_cm_cpcs_upper(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - Atm_connection *cop; - Atm_connvc *cvp = tok; - KBuffer *m; - void *bp; - int s; - - switch (cmd) { - - case CPCS_UNITDATA_SIG: - /* - * Input data packet - */ - m = (KBuffer *)arg1; - - if (cvp->cvc_state != CVCS_ACTIVE) { - if (cvp->cvc_state == CVCS_ACCEPT) { - KBuffer *n; - - /* - * Queue up any packets received before sigmgr - * notifies us of incoming call completion - */ - if (cvp->cvc_rcvqlen >= CVC_RCVQ_MAX) { - KB_FREEALL(m); - atm_cm_stat.cms_rcvconnvc++; - return; - } - KB_QNEXT(m) = NULL; - if (cvp->cvc_rcvq == NULL) { - cvp->cvc_rcvq = m; - } else { - for (n = cvp->cvc_rcvq; - KB_QNEXT(n) != NULL; - n = KB_QNEXT(n)) - ; - KB_QNEXT(n) = m; - } - cvp->cvc_rcvqlen++; - return; - } else { - KB_FREEALL(m); - atm_cm_stat.cms_rcvconnvc++; - return; - } - } - - /* - * Send the packet to the interface's bpf if this - * vc has one. - */ - if (cvp->cvc_vcc != NULL && - cvp->cvc_vcc->vc_nif != NULL) { - struct ifnet *ifp = - (struct ifnet *)cvp->cvc_vcc->vc_nif; - - BPF_MTAP(ifp, m); - } - - /* - * Locate packet's connection - */ - cop = cvp->cvc_conn; - switch (cop->co_mpx) { - - case ATM_ENC_NULL: - /* - * We're already there... - */ - break; - - case ATM_ENC_LLC: - /* - * Find connection with matching LLC header - */ - if (KB_LEN(m) < T_ATM_LLC_MAX_LEN) { - KB_PULLUP(m, T_ATM_LLC_MAX_LEN, m); - if (m == 0) { - atm_cm_stat.cms_llcdrop++; - return; - } - } - KB_DATASTART(m, bp, void *); - - s = splnet(); - - while (cop) { - if (bcmp(bp, cop->co_llc.v.llc_info, - cop->co_llc.v.llc_len) == 0) - break; - cop = cop->co_next; - } - - (void) splx(s); - - if (cop == NULL) { - /* - * No connected user for this LLC - */ - KB_FREEALL(m); - atm_cm_stat.cms_llcid++; - return; - } - - /* - * Strip off the LLC header - */ - KB_HEADADJ(m, -cop->co_llc.v.llc_len); - KB_PLENADJ(m, -cop->co_llc.v.llc_len); - break; - - default: - panic("atm_cm_cpcs_upper: mpx"); - } - - /* - * We've found our connection, so hand the packet off - */ - if (cop->co_state != COS_ACTIVE) { - KB_FREEALL(m); - atm_cm_stat.cms_rcvconn++; - return; - } - (*cop->co_endpt->ep_cpcs_data)(cop->co_toku, m); - break; - - case CPCS_UABORT_SIG: - case CPCS_PABORT_SIG: - /* - * We don't support these (yet), so just FALLTHROUGH - */ - - default: - log(LOG_ERR, "atm_cm_cpcs_upper: unknown cmd 0x%x\n", cmd); - } -} - - -/* - * SAAL User Control Commands - * - * This function is called by an endpoint user to pass a control command - * across a SAAL data API. Mostly we just send these down the stack. - * - * Arguments: - * cmd stack command code - * cop pointer to connection block - * arg argument - * - * Returns: - * 0 command output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_saal_ctl(cmd, cop, arg) - int cmd; - Atm_connection *cop; - void *arg; -{ - Atm_connvc *cvp; - int err = 0; - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_SAAL) { - err = EFAULT; - goto done; - } - - switch (cmd) { - - case SSCF_UNI_ESTABLISH_REQ: - case SSCF_UNI_RELEASE_REQ: - /* - * Pass command down the stack - */ - STACK_CALL(cmd, cvp->cvc_lower, cvp->cvc_tokl, cvp, - (intptr_t)arg, 0, err); - break; - - default: - err = EINVAL; - } - -done: - return (err); -} - - -/* - * SAAL Data Output - * - * This function is called by an endpoint user to output a data packet - * across a SAAL data API. After we've validated the connection state, - * the packet will be sent down the data stack. - * - * Arguments: - * cop pointer to connection block - * m pointer to packet buffer chain to be output - * - * Returns: - * 0 packet output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_saal_data(cop, m) - Atm_connection *cop; - KBuffer *m; -{ - Atm_connvc *cvp; - int err; - - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_SAAL) { - err = EFAULT; - goto done; - } - - /* - * Finally, we can send the packet on its way - */ - STACK_CALL(SSCF_UNI_DATA_REQ, cvp->cvc_lower, cvp->cvc_tokl, - cvp, (intptr_t)m, 0, err); - -done: - return (err); -} - - -/* - * Process SAAL Stack Commands - * - * This is the top of the SAAL API data stack. All upward stack commands - * for the SAAL data API will be received and processed here. - * - * Arguments: - * cmd stack command code - * tok session token (pointer to connection VCC control block) - * arg1 argument 1 - * arg2 argument 2 - * - * Returns: - * none - * - */ -static void -atm_cm_saal_upper(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - Atm_connection *cop; - Atm_connvc *cvp = tok; - - - switch (cmd) { - - case SSCF_UNI_ESTABLISH_IND: - case SSCF_UNI_ESTABLISH_CNF: - case SSCF_UNI_RELEASE_IND: - case SSCF_UNI_RELEASE_CNF: - /* - * Control commands - */ - cop = cvp->cvc_conn; - if (cvp->cvc_state != CVCS_ACTIVE) - break; - if (cop->co_state != COS_ACTIVE) - break; - - (*cop->co_endpt->ep_saal_ctl)(cmd, cop->co_toku, (void *)arg1); - break; - - case SSCF_UNI_DATA_IND: - /* - * User data - */ - cop = cvp->cvc_conn; - if (cvp->cvc_state != CVCS_ACTIVE) { - atm_cm_stat.cms_rcvconnvc++; - KB_FREEALL((KBuffer *)arg1); - break; - } - if (cop->co_state != COS_ACTIVE) { - atm_cm_stat.cms_rcvconn++; - KB_FREEALL((KBuffer *)arg1); - break; - } - - (*cop->co_endpt->ep_saal_data)(cop->co_toku, (KBuffer *)arg1); - break; - - case SSCF_UNI_UNITDATA_IND: - /* - * Not supported - */ - KB_FREEALL((KBuffer *)arg1); - - /* FALLTHRU */ - - default: - log(LOG_ERR, "atm_cm_saal_upper: unknown cmd 0x%x\n", cmd); - } -} - - -/* - * SSCOP User Control Commands - * - * This function is called by an endpoint user to pass a control command - * across a SSCOP data API. Mostly we just send these down the stack. - * - * Arguments: - * cmd stack command code - * cop pointer to connection block - * arg1 argument - * arg2 argument - * - * Returns: - * 0 command output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_sscop_ctl(cmd, cop, arg1, arg2) - int cmd; - Atm_connection *cop; - void *arg1; - void *arg2; -{ - Atm_connvc *cvp; - int err = 0; - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_SSCOP) { - err = EFAULT; - goto done; - } - - switch (cmd) { - - case SSCOP_ESTABLISH_REQ: - case SSCOP_ESTABLISH_RSP: - case SSCOP_RELEASE_REQ: - case SSCOP_RESYNC_REQ: - case SSCOP_RESYNC_RSP: - case SSCOP_RECOVER_RSP: - case SSCOP_RETRIEVE_REQ: - /* - * Pass command down the stack - */ - STACK_CALL(cmd, cvp->cvc_lower, cvp->cvc_tokl, cvp, - (intptr_t)arg1, (intptr_t)arg2, err); - break; - - default: - err = EINVAL; - } - -done: - return (err); -} - - -/* - * SSCOP Data Output - * - * This function is called by an endpoint user to output a data packet - * across a SSCOP data API. After we've validated the connection state, - * the packet will be encapsulated and sent down the data stack. - * - * Arguments: - * cop pointer to connection block - * m pointer to packet buffer chain to be output - * - * Returns: - * 0 packet output successful - * errno output failed - reason indicated - * - */ -int -atm_cm_sscop_data(cop, m) - Atm_connection *cop; - KBuffer *m; -{ - Atm_connvc *cvp; - int err; - - - /* - * Validate connection state - */ - if (cop->co_state != COS_ACTIVE) { - err = EFAULT; - goto done; - } - - cvp = cop->co_connvc; - if (cvp->cvc_state != CVCS_ACTIVE) { - err = EFAULT; - goto done; - } - - if (cvp->cvc_attr.api != CMAPI_SSCOP) { - err = EFAULT; - goto done; - } - - /* - * Finally, we can send the packet on its way - */ - STACK_CALL(SSCOP_DATA_REQ, cvp->cvc_lower, cvp->cvc_tokl, - cvp, (intptr_t)m, 0, err); - -done: - return (err); -} - - -/* - * Process SSCOP Stack Commands - * - * This is the top of the SSCOP API data stack. All upward stack commands - * for the SSCOP data API will be received and processed here. - * - * Arguments: - * cmd stack command code - * tok session token (pointer to connection VCC control block) - * arg1 argument 1 - * arg2 argument 2 - * - * Returns: - * none - * - */ -static void -atm_cm_sscop_upper(cmd, tok, arg1, arg2) - int cmd; - void *tok; - intptr_t arg1; - intptr_t arg2; -{ - Atm_connection *cop; - Atm_connvc *cvp = tok; - - switch (cmd) { - - case SSCOP_ESTABLISH_IND: - case SSCOP_ESTABLISH_CNF: - case SSCOP_RELEASE_IND: - case SSCOP_RESYNC_IND: - /* - * Control commands - */ - cop = cvp->cvc_conn; - if ((cvp->cvc_state != CVCS_ACTIVE) || - (cop->co_state != COS_ACTIVE)) { - KB_FREEALL((KBuffer *)arg1); - break; - } - - (*cop->co_endpt->ep_sscop_ctl) - (cmd, cop->co_toku, (void *)arg1, (void *)arg2); - break; - - case SSCOP_RELEASE_CNF: - case SSCOP_RESYNC_CNF: - case SSCOP_RECOVER_IND: - case SSCOP_RETRIEVE_IND: - case SSCOP_RETRIEVECMP_IND: - /* - * Control commands - */ - cop = cvp->cvc_conn; - if ((cvp->cvc_state != CVCS_ACTIVE) || - (cop->co_state != COS_ACTIVE)) - break; - - (*cop->co_endpt->ep_sscop_ctl) - (cmd, cop->co_toku, (void *)arg1, (void *)arg2); - break; - - case SSCOP_DATA_IND: - /* - * User data - */ - cop = cvp->cvc_conn; - if (cvp->cvc_state != CVCS_ACTIVE) { - atm_cm_stat.cms_rcvconnvc++; - KB_FREEALL((KBuffer *)arg1); - break; - } - if (cop->co_state != COS_ACTIVE) { - atm_cm_stat.cms_rcvconn++; - KB_FREEALL((KBuffer *)arg1); - break; - } - - (*cop->co_endpt->ep_sscop_data) - (cop->co_toku, (KBuffer *)arg1, arg2); - break; - - case SSCOP_UNITDATA_IND: - /* - * Not supported - */ - KB_FREEALL((KBuffer *)arg1); - - /* FALLTHRU */ - - default: - log(LOG_ERR, "atm_cm_sscop_upper: unknown cmd 0x%x\n", cmd); - } -} - - -/* - * Register an ATM Endpoint Service - * - * Every ATM endpoint service must register itself here before it can - * issue or receive any connection requests. - * - * Arguments: - * epp pointer to endpoint definition structure - * - * Returns: - * 0 registration successful - * errno registration failed - reason indicated - * - */ -int -atm_endpoint_register(epp) - Atm_endpoint *epp; -{ - int s = splnet(); - - /* - * See if we need to be initialized - */ - if (!atm_init) - atm_initialize(); - - /* - * Validate endpoint - */ - if (epp->ep_id > ENDPT_MAX) { - (void) splx(s); - return (EINVAL); - } - if (atm_endpoints[epp->ep_id] != NULL) { - (void) splx(s); - return (EEXIST); - } - - /* - * Add endpoint to list - */ - atm_endpoints[epp->ep_id] = epp; - - (void) splx(s); - return (0); -} - - -/* - * De-register an ATM Endpoint Service - * - * Each ATM endpoint service provider must de-register its registered - * endpoint(s) before terminating. Specifically, loaded kernel modules - * must de-register their services before unloading themselves. - * - * Arguments: - * epp pointer to endpoint definition structure - * - * Returns: - * 0 de-registration successful - * errno de-registration failed - reason indicated - * - */ -int -atm_endpoint_deregister(epp) - Atm_endpoint *epp; -{ - int s = splnet(); - - /* - * Validate endpoint - */ - if (epp->ep_id > ENDPT_MAX) { - (void) splx(s); - return (EINVAL); - } - if (atm_endpoints[epp->ep_id] != epp) { - (void) splx(s); - return (ENOENT); - } - - /* - * Remove endpoint from list - */ - atm_endpoints[epp->ep_id] = NULL; - - (void) splx(s); - return (0); -} - Property changes on: head/sys/netatm/atm_cm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_cm.h =================================================================== --- head/sys/netatm/atm_cm.h (revision 179307) +++ head/sys/netatm/atm_cm.h (nonexistent) @@ -1,351 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Connection Management definitions - * - */ - -#ifndef _NETATM_ATM_CM_H -#define _NETATM_ATM_CM_H - -/* - * Forward declaration - */ -struct atm_connection; -struct atm_attributes; - - -#ifdef _KERNEL -/* - * Structure used to define a kernel ATM endpoint service module and its - * associated entry points. An endpoint service is defined as a kernel - * entity which will serve as the endpoint of an ATM connection, i.e. it is - * responsible for issuing/receiving requests to/from the connection manager. - */ -struct atm_endpoint { - struct atm_endpoint *ep_next; /* Next in registry list */ - u_int ep_id; /* Endpoint ID (see below) */ - -/* Exported functions: Miscellaneous */ - int (*ep_ioctl) /* Ioctl */ - (int, caddr_t, caddr_t); - caddr_t (*ep_getname) /* Get application/owner name */ - (void *); - -/* Exported functions: Connection Manager Control API */ - void (*ep_connected) /* Call connected */ - (void *); - void (*ep_cleared) /* Call cleared */ - (void *, struct t_atm_cause *); - int (*ep_incoming) /* Incoming call */ - (void *, struct atm_connection *, - struct atm_attributes *, void **); - int (*ep_addparty) /* Add Party notification */ - (void *, int, int); - int (*ep_dropparty) /* Drop Party notification */ - (void *, int, int); - -/* Exported functions: Connection Manager Data API: CPCS */ - void (*ep_cpcs_ctl) /* Control operation */ - (int, void *, void *); - void (*ep_cpcs_data) /* Received data */ - (void *, KBuffer *); - -/* Exported functions: Connection Manager Data API: SAAL */ - void (*ep_saal_ctl) /* Control operation */ - (int, void *, void *); - void (*ep_saal_data) /* Received data */ - (void *, KBuffer *); - -/* Exported functions: Connection Manager Data API: SSCOP */ - void (*ep_sscop_ctl) /* Control operation */ - (int, void *, void *, void *); - void (*ep_sscop_data) /* Received data */ - (void *, KBuffer *, u_int); -}; -typedef struct atm_endpoint Atm_endpoint; -#endif /* _KERNEL */ - -/* - * Endpoint IDs - */ -#define ENDPT_UNKNOWN 0 /* Unknown */ -#define ENDPT_IP 1 /* IP over ATM */ -#define ENDPT_ATMARP 2 /* ATMARP */ -#define ENDPT_SPANS_SIG 3 /* SPANS Signalling */ -#define ENDPT_SPANS_CLS 4 /* SPANS CLS */ -#define ENDPT_UNI_SIG 5 /* UNI Signalling */ -#define ENDPT_SOCK_AAL5 6 /* Socket - AAL5 */ -#define ENDPT_SOCK_SSCOP 7 /* Socket - SSCOP */ -#define ENDPT_MAX 7 - - -/* - * ATM Connection Attributes - * - * Note: Attribute tag values are the same as the SVE_tag values. - * Unless otherwise specified, attribute field values are the same - * as the corresponding socket option values. - * The above values are all defined in netatm/atm.h. - */ - -/* AAL Attributes */ -struct t_atm_aal4 { - int32_t forward_max_SDU_size; - int32_t backward_max_SDU_size; - int32_t SSCS_type; - int32_t mid_low; - int32_t mid_high; -}; - -struct attr_aal { - int tag; /* Attribute tag */ - Aal_t type; /* AAL type (discriminator) */ - union { - struct t_atm_aal4 aal4; - struct t_atm_aal5 aal5; - } v; /* Attribute value */ -}; - -/* Traffic Descriptor Attributes */ -struct attr_traffic { - int tag; /* Attribute tag */ - struct t_atm_traffic v; /* Attribute value */ -}; - -/* Broadband Bearer Attributes */ -struct attr_bearer { - int tag; /* Attribute tag */ - struct t_atm_bearer v; /* Attribute value */ -}; - -/* Broadband High Layer Information Attributes */ -struct attr_bhli { - int tag; /* Attribute tag */ - struct t_atm_bhli v; /* Attribute value */ -}; - -/* Broadband Low Layer Information Attributes */ -struct attr_blli { - int tag_l2; /* Layer 2 attribute tag */ - int tag_l3; /* Layer 3 attribute tag */ - struct t_atm_blli v; /* Attribute value */ -}; - -/* Logical Link Control Attributes (multiplexing use only, not signalled) */ -struct attr_llc { - int tag; /* Attribute tag */ - struct t_atm_llc v; /* Attribute value */ -}; - -/* Called Party Attributes */ -struct attr_called { - int tag; /* Attribute tag */ - Atm_addr addr; /* Called party address */ - Atm_addr subaddr; /* Called party subaddress */ -}; - -/* Calling Party Attributes */ -struct attr_calling { - int tag; /* Attribute tag */ - Atm_addr addr; /* Calling party address */ - Atm_addr subaddr; /* Calling party subaddress */ - struct t_atm_caller_id cid; /* Caller ID */ -}; - -/* Quality of Service Attributes */ -struct attr_qos { - int tag; /* Attribute tag */ - struct t_atm_qos v; /* Attribute value */ -}; - -/* Transit Network Attributes */ -struct attr_transit { - int tag; /* Attribute tag */ - struct t_atm_transit v; /* Attribute value */ -}; - -/* Cause Attributes */ -struct attr_cause { - int tag; /* Attribute tag */ - struct t_atm_cause v; /* Attribute value */ -}; - - -struct atm_attributes { - struct atm_nif *nif; /* Network interface */ - u_int api; /* Connect Mgr Data API (see below) */ - int api_init;/* API initialization parameter */ - u_short headin; /* Input buffer headroom */ - u_short headout;/* Output buffer headroom */ - struct attr_aal aal; /* AAL attributes */ - struct attr_traffic traffic;/* Traffic descriptor attributes */ - struct attr_bearer bearer; /* Broadband bearer attributes */ - struct attr_bhli bhli; /* Broadband high layer attributes */ - struct attr_blli blli; /* Broadband low layer attributes */ - struct attr_llc llc; /* Logical link control attributes */ - struct attr_called called; /* Called party attributes */ - struct attr_calling calling;/* Calling party attributes */ - struct attr_qos qos; /* Quality of service attributes */ - struct attr_transit transit;/* Transit network attributes */ - struct attr_cause cause; /* Cause attributes */ -}; -typedef struct atm_attributes Atm_attributes; - -/* - * Connection Manager Data APIs - */ -#define CMAPI_CPCS 0 /* AAL CPCS */ -#define CMAPI_SAAL 1 /* Signalling AAL */ -#define CMAPI_SSCOP 2 /* Reliable data (SSCOP) */ - - -#ifdef _KERNEL -/* - * ATM Connection Instance - * - * There will be one connection block for each endpoint <-> Connection Manager - * API instance. Note that with connection multiplexors (e.g. LLC), there - * may be multiple connections per VCC. - */ -struct atm_connection { - struct atm_connection *co_next; /* Multiplexor/listen queue link */ - struct atm_connection *co_mxh; /* Connection multiplexor head */ - u_char co_flags; /* Connection flags (see below) */ - u_char co_state; /* User <-> CM state (see below) */ - Encaps_t co_mpx; /* Multiplexor type */ - void *co_toku; /* Endpoint's session token */ - Atm_endpoint *co_endpt; /* Endpoint service */ - struct atm_connvc *co_connvc; /* Connection VCC */ - struct attr_llc co_llc; /* Connection LLC header */ - Atm_attributes *co_lattr; /* Listening attributes */ -}; -typedef struct atm_connection Atm_connection; - -/* - * Connection Flags - */ -#define COF_P2P 0x01 /* Point-to-point */ -#define COF_P2MP 0x02 /* Point-to-multipoint */ - -/* - * Endpoint <-> Connection Manager States - */ -#define COS_FREE 0 /* Not allocated */ -#define COS_OUTCONN 1 /* Outgoing connection pending */ -#define COS_LISTEN 2 /* Listening for connection */ -#define COS_INCONN 3 /* Incoming connection pending */ -#define COS_INACCEPT 4 /* Incoming connection accepted */ -#define COS_ACTIVE 5 /* Connection active */ -#define COS_CLEAR 6 /* Connection is clearing */ - - -/* - * ATM Connection VCC Instance - * - * There will be one connection-vcc block for each VCC created by the - * Connection Manager. For multiplexed connections, there may be multiple - * connection blocks associated with each connection-vcc. This block is - * used to control the Connection Manager <-> VCC interface, including the - * interfaces to stack management and the signalling manager. - */ -struct atm_connvc { - Qelem_t cvc_q; /* Queueing links */ - Atm_connection *cvc_conn; /* Connection head */ - struct vccb *cvc_vcc; /* VCC for connection */ - struct sigmgr *cvc_sigmgr; /* VCC signalling manager */ - u_char cvc_flags; /* Connection flags (see below) */ - u_char cvc_state; /* CM - VCC state (see below) */ - void *cvc_tokl; /* Stack lower layer token */ - void (*cvc_lower) /* Stack lower layer handler */ - (int, void *, intptr_t, intptr_t); - u_short cvc_upcnt; /* Up stack calls in progress */ - u_short cvc_downcnt; /* Down stack calls in progress */ - KBuffer *cvc_rcvq; /* Packet receive queue */ - int cvc_rcvqlen; /* Receive queue length */ - Atm_attributes cvc_attr; /* VCC attributes */ - struct atm_time cvc_time; /* Timer controls */ -}; -typedef struct atm_connvc Atm_connvc; - -/* - * Connection Flags - */ -#define CVCF_ABORTING 0x01 /* VCC abort is pending */ -#define CVCF_INCOMQ 0x02 /* VCC is on incoming queue */ -#define CVCF_CONNQ 0x04 /* VCC is on connection queue */ -#define CVCF_CALLER 0x08 /* We are the call originator */ - -/* - * Connection Manager <-> VCC States - */ -#define CVCS_FREE 0 /* Not allocated */ -#define CVCS_SETUP 1 /* Call setup pending */ -#define CVCS_INIT 2 /* Stack INIT pending */ -#define CVCS_INCOMING 3 /* Incoming call present */ -#define CVCS_ACCEPT 4 /* Incoming call accepted */ -#define CVCS_REJECT 5 /* Incoming call rejected */ -#define CVCS_ACTIVE 6 /* Stack active */ -#define CVCS_RELEASE 7 /* Connection release pending */ -#define CVCS_CLEAR 8 /* Call has been cleared */ -#define CVCS_TERM 9 /* Stack TERM pending */ - - -/* - * Connection VCC variables - */ -#define CVC_RCVQ_MAX 3 /* Max length of receive queue */ - - -/* - * Timer macros - */ -#define CVC_TIMER(s, t) atm_timeout(&(s)->cvc_time, (t), atm_cm_timeout) -#define CVC_CANCEL(s) atm_untimeout(&(s)->cvc_time) - - -/* - * Connection Manager Statistics - */ -struct atm_cm_stat { - u_long cms_llcdrop; /* Packets dropped by llc demux'ing */ - u_long cms_llcid; /* Packets with unknown llc id */ - u_long cms_rcvconn; /* Packets dropped, bad conn state */ - u_long cms_rcvconnvc; /* Packets dropped, bad connvc state */ -}; - -void atm_cm_init(void); - -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_CM_H */ Property changes on: head/sys/netatm/atm_cm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_ioctl.h =================================================================== --- head/sys/netatm/atm_ioctl.h (revision 179307) +++ head/sys/netatm/atm_ioctl.h (nonexistent) @@ -1,430 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * PF_ATM socket ioctl definitions - * - */ - -#ifndef _NETATM_ATM_IOCTL_H -#define _NETATM_ATM_IOCTL_H - - -/* - * Structure for PF_ATM configure (AIOCCFG) socket ioctls - */ -struct atmcfgreq { - int acr_opcode; /* Sub-operation */ - union { - struct { - /* Configure - attach */ - char acru_att_intf[IFNAMSIZ];/* Interface name */ - u_char acru_att_proto; /* Signalling protocol */ - } acru_att; - struct { - /* Configure - detach */ - char acru_det_intf[IFNAMSIZ];/* Interface name */ - } acru_det; - } acr_u; -}; -#define acr_att_intf acr_u.acru_att.acru_att_intf -#define acr_att_proto acr_u.acru_att.acru_att_proto -#define acr_det_intf acr_u.acru_det.acru_det_intf - - -/* - * Structure for PF_ATM set (AIOCSET) socket ioctls - */ -struct atmsetreq { - int asr_opcode; /* Sub-operation */ - union { - /* ARP server */ - struct { - char asru_arp_intf[IFNAMSIZ];/* Interface name */ - Atm_addr asru_arp_addr; /* ARP srvr address */ - Atm_addr asru_arp_subaddr;/* ARP srvr subaddr */ - caddr_t asru_arp_pbuf; /* Prefix buffer addr */ - size_t asru_arp_plen; /* Prefix buffer len */ - } asru_asrvr; - /* MAC address */ - struct { - char asru_mac_intf[IFNAMSIZ];/* Interface name */ - struct mac_addr asru_mac_addr; /* MAC address */ - } asru_mac; - /* Network interface */ - struct { - char asru_nif_intf[IFNAMSIZ];/* Interface name */ - char asru_nif_pref[IFNAMSIZ];/* I/f prefix name */ - u_int asru_nif_cnt; /* Number of i/fs */ - } asru_nif; - /* NSAP prefix */ - struct { - char asru_prf_intf[IFNAMSIZ];/* Interface name */ - u_char asru_prf_pref[13]; /* NSAP prefix */ - } asru_prf; - } asr_u; -}; -#define asr_arp_intf asr_u.asru_asrvr.asru_arp_intf -#define asr_arp_addr asr_u.asru_asrvr.asru_arp_addr -#define asr_arp_pbuf asr_u.asru_asrvr.asru_arp_pbuf -#define asr_arp_plen asr_u.asru_asrvr.asru_arp_plen -#define asr_arp_subaddr asr_u.asru_asrvr.asru_arp_subaddr -#define asr_mac_intf asr_u.asru_mac.asru_mac_intf -#define asr_mac_addr asr_u.asru_mac.asru_mac_addr -#define asr_nif_intf asr_u.asru_nif.asru_nif_intf -#define asr_nif_pref asr_u.asru_nif.asru_nif_pref -#define asr_nif_cnt asr_u.asru_nif.asru_nif_cnt -#define asr_prf_intf asr_u.asru_prf.asru_prf_intf -#define asr_prf_pref asr_u.asru_prf.asru_prf_pref - - -/* - * Structure for PF_ATM add (AIOCADD) socket ioctls - */ -struct atmaddreq { - int aar_opcode; /* Sub-operation */ - union { - /* Add PVC */ - struct { - char aaru_pvc_intf[IFNAMSIZ];/* Interface name */ - u_short aaru_pvc_vpi; /* VPI value */ - u_short aaru_pvc_vci; /* VCI value */ - struct sockaddr aaru_pvc_dst; /* Destination addr */ - Sap_t aaru_pvc_sap; /* Endpoint SAP */ - Aal_t aaru_pvc_aal; /* AAL */ - Encaps_t aaru_pvc_encaps; /* Encapsulation */ - u_char aaru_pvc_flags; /* Flags (see below) */ - uint8_t aaru_pvc_traffic_type; /* traffic type */ - struct t_atm_traffic aaru_pvc_traffic; /* traffic parameters */ - } aaru_add_pvc; - - /* Add ARP table entry */ - struct { - char aaru_arp_intf[IFNAMSIZ];/* Interface name */ - struct sockaddr aaru_arp_dst; /* IP addr */ - Atm_addr aaru_arp_addr; /* ATM addr */ - u_char aaru_arp_origin; /* Entry origin */ - } aaru_add_arp; - } aar_u; -}; -#define aar_pvc_intf aar_u.aaru_add_pvc.aaru_pvc_intf -#define aar_pvc_vpi aar_u.aaru_add_pvc.aaru_pvc_vpi -#define aar_pvc_vci aar_u.aaru_add_pvc.aaru_pvc_vci -#define aar_pvc_dst aar_u.aaru_add_pvc.aaru_pvc_dst -#define aar_pvc_sap aar_u.aaru_add_pvc.aaru_pvc_sap -#define aar_pvc_aal aar_u.aaru_add_pvc.aaru_pvc_aal -#define aar_pvc_encaps aar_u.aaru_add_pvc.aaru_pvc_encaps -#define aar_pvc_flags aar_u.aaru_add_pvc.aaru_pvc_flags -#define aar_pvc_traffic_type aar_u.aaru_add_pvc.aaru_pvc_traffic_type -#define aar_pvc_traffic aar_u.aaru_add_pvc.aaru_pvc_traffic -#define aar_arp_intf aar_u.aaru_add_arp.aaru_arp_intf -#define aar_arp_dst aar_u.aaru_add_arp.aaru_arp_dst -#define aar_arp_addr aar_u.aaru_add_arp.aaru_arp_addr -#define aar_arp_origin aar_u.aaru_add_arp.aaru_arp_origin - -/* PVC flags */ -#define PVC_DYN 0x01 /* Dest addr is dynamic */ - - -/* - * Structure for PF_ATM delete (AIOCDEL) socket ioctls - */ -struct atmdelreq { - int adr_opcode; /* Sub-operation */ - union { - /* Delete PVC */ - struct { - char adru_pvc_intf[IFNAMSIZ];/* Interface name */ - u_short adru_pvc_vpi; /* VPI value */ - u_short adru_pvc_vci; /* VCI value */ - } adru_del_pvc; - - /* Delete SVC */ - struct { - char adru_svc_intf[IFNAMSIZ];/* Interface name */ - u_short adru_svc_vpi; /* VPI value */ - u_short adru_svc_vci; /* VCI value */ - } adru_del_svc; - - /* Delete ARP table entry */ - struct { - char adru_arp_intf[IFNAMSIZ];/* Interface name */ - struct sockaddr adru_arp_dst; /* IP addr */ - } adru_del_arp; - } adr_u; -}; -#define adr_pvc_intf adr_u.adru_del_pvc.adru_pvc_intf -#define adr_pvc_vpi adr_u.adru_del_pvc.adru_pvc_vpi -#define adr_pvc_vci adr_u.adru_del_pvc.adru_pvc_vci -#define adr_svc_intf adr_u.adru_del_svc.adru_svc_intf -#define adr_svc_vpi adr_u.adru_del_svc.adru_svc_vpi -#define adr_svc_vci adr_u.adru_del_svc.adru_svc_vci -#define adr_arp_intf adr_u.adru_del_arp.adru_arp_intf -#define adr_arp_dst adr_u.adru_del_arp.adru_arp_dst - - -/* - * Structure for PF_ATM information (AIOCINFO) socket ioctls - */ -struct atminfreq { - int air_opcode; /* Sub-operation */ - caddr_t air_buf_addr; /* Buffer for returned info */ - size_t air_buf_len; /* Buffer length */ - union { - /* Vendor info */ - char airu_vinfo_intf[IFNAMSIZ];/* Interface name */ - /* IP VCC */ - struct sockaddr airu_ip_addr; /* Destination host */ - /* ARP table */ - struct { - struct sockaddr airu_arp_addr; /* Destination host */ - u_char airu_arp_flags; /* Flags (see below) */ - } airu_arp; - /* ARP server */ - char airu_asrv_intf[IFNAMSIZ];/* Interface name */ - /* Interface */ - char airu_int_intf[IFNAMSIZ];/* Interface name */ - /* VCC */ - char airu_vcc_intf[IFNAMSIZ];/* Interface name */ - /* Configuration */ - char airu_cfg_intf[IFNAMSIZ];/* Interface name */ - /* Network interface */ - char airu_netif_intf[IFNAMSIZ];/* Interface name */ - /* Physical interface statistics */ - char airu_physt_intf[IFNAMSIZ];/* Interface name */ - } air_u; -}; -#define air_vinfo_intf air_u.airu_vinfo_intf -#define air_ip_addr air_u.airu_ip_addr -#define air_arp_addr air_u.airu_arp.airu_arp_addr -#define air_arp_flags air_u.airu_arp.airu_arp_flags -#define air_asrv_intf air_u.airu_asrv_intf -#define air_int_intf air_u.airu_int_intf -#define air_vcc_intf air_u.airu_vcc_intf -#define air_cfg_intf air_u.airu_cfg_intf -#define air_netif_intf air_u.airu_netif_intf -#define air_physt_intf air_u.airu_physt_intf - -/* ARP table info flags */ -#define ARP_RESET_REF 0x01 /* Reset refresh status */ - - -/* - * Structures returned by information requests - */ - -/* - * Vendor-specific interface information - */ -struct air_vinfo_rsp { - char avsp_intf[IFNAMSIZ]; /* Interface name */ - size_t avsp_len; /* Length of returned - Vendor Info block */ - /* Vendor info ... */ -}; - - -/* - * ARP table information - */ -struct air_arp_rsp { - struct sockaddr aap_arp_addr; /* Destination host */ - char aap_intf[IFNAMSIZ]; /* Interface name */ - u_char aap_flags; /* Flags (see below) */ - u_char aap_origin; /* Entry origin (see below) */ - u_char aap_age; /* Aging timeout (minutes) */ - Atm_addr aap_addr; /* ATM address */ - Atm_addr aap_subaddr; /* ATM subaddress */ -}; - -/* - * ARP entry flags - */ -#define ARPF_VALID 0x01 /* Entry is valid */ -#define ARPF_REFRESH 0x02 /* Entry has been refreshed */ - -/* - * ARP entry origin - */ -#define ARP_ORIG_PERM 50 /* Permanent entry */ - -/* - * IP VCC information - */ -struct air_ip_vcc_rsp { - struct sockaddr aip_dst_addr; /* Destination host */ - char aip_intf[IFNAMSIZ]; /* Interface name */ - u_short aip_vpi; /* VPI value */ - u_short aip_vci; /* VCI value */ - u_char aip_sig_proto; /* Signalling protocol */ - u_char aip_flags; /* Flags (IVF_*) */ - u_char aip_state; /* IP VCC state */ -}; - -/* - * ARP server information - */ -struct air_asrv_rsp { - char asp_intf[IFNAMSIZ]; /* Interface name */ - Atm_addr asp_addr; /* Server ATM address */ - Atm_addr asp_subaddr; /* Server ATM subaddress */ - int asp_state; /* Server state */ - int asp_nprefix; /* Number of prefix entries */ -}; - -/* - * Interface information - */ -struct air_int_rsp { - char anp_intf[IFNAMSIZ]; /* Interface name */ - Atm_addr anp_addr; /* ATM address */ - Atm_addr anp_subaddr; /* ATM subaddress */ - u_char anp_sig_proto; /* Signalling protocol */ - u_char anp_sig_state; /* Signalling protocol state */ - char anp_nif_pref[IFNAMSIZ]; /* Netif prefix */ - u_int anp_nif_cnt; /* No. of netifs */ -}; - -/* - * Network interface information - */ -struct air_netif_rsp { - char anp_intf[IFNAMSIZ]; /* Interface name */ - struct sockaddr anp_proto_addr; /* Protocol address */ - char anp_phy_intf[IFNAMSIZ]; /* Interface name */ -}; - -/* - * VCC information - * Todo: add avp_traffic_type and avp_traffic. Update unisig_if.c, - * spans_if.c and sigpvc_if.c - */ -#define O_CNT 8 -struct air_vcc_rsp { - char avp_intf[IFNAMSIZ]; /* Interface name */ - u_short avp_vpi; /* VPI value */ - u_short avp_vci; /* VCI value */ - u_char avp_type; /* Type (SVC or PVC) */ - u_char avp_aal; /* AAL */ - u_char avp_sig_proto; /* Signalling protocol */ - Encaps_t avp_encaps; /* Encapsulation */ - u_char avp_state; /* State (sig mgr specific) */ - char avp_owners[(T_ATM_APP_NAME_LEN+1)*O_CNT];/* VCC users */ - Atm_addr avp_daddr; /* Address of far end */ - Atm_addr avp_dsubaddr; /* Subaddress of far end */ - u_long avp_ipdus; /* PDUs received from VCC */ - u_long avp_opdus; /* PDUs sent to VCC */ - u_long avp_ibytes; /* Bytes received from VCC */ - u_long avp_obytes; /* Bytes sent to VCC */ - u_long avp_ierrors; /* Errors receiving from VCC */ - u_long avp_oerrors; /* Errors sending to VCC */ - time_t avp_tstamp; /* State transition timestamp */ -}; - -/* - * Adapter configuration information - */ -struct air_cfg_rsp { - char acp_intf[IFNAMSIZ]; /* Interface name */ - Atm_config acp_cfg; /* Config info */ -}; -#define acp_vendor acp_cfg.ac_vendor -#define acp_vendapi acp_cfg.ac_vendapi -#define acp_device acp_cfg.ac_device -#define acp_media acp_cfg.ac_media -#define acp_serial acp_cfg.ac_serial -#define acp_bustype acp_cfg.ac_bustype -#define acp_busslot acp_cfg.ac_busslot -#define acp_ram acp_cfg.ac_ram -#define acp_ramsize acp_cfg.ac_ramsize -#define acp_macaddr acp_cfg.ac_macaddr -#define acp_hard_vers acp_cfg.ac_hard_vers -#define acp_firm_vers acp_cfg.ac_firm_vers - -/* - * Version information - */ -struct air_version_rsp { - int avp_version; /* Software version */ -}; - -/* - * Physical interface statistics - */ -struct air_phy_stat_rsp { - char app_intf[IFNAMSIZ]; /* Interface name */ - u_quad_t app_ipdus; /* PDUs received from I/F */ - u_quad_t app_opdus; /* PDUs sent to I/F */ - u_quad_t app_ibytes; /* Bytes received from I/F */ - u_quad_t app_obytes; /* Bytes sent to I/F */ - u_quad_t app_ierrors; /* Errors receiving from I/F */ - u_quad_t app_oerrors; /* Errors sending to I/F */ - u_quad_t app_cmderrors; /* I/F command errors */ -}; - - -/* - * PF_ATM sub-operation codes - */ -#define AIOCS_CFG_ATT 1 -#define AIOCS_CFG_DET 2 -#define AIOCS_ADD_PVC 32 -#define AIOCS_ADD_ARP 33 -#define AIOCS_DEL_PVC 64 -#define AIOCS_DEL_SVC 65 -#define AIOCS_DEL_ARP 66 -#define AIOCS_SET_ASV 96 -#define AIOCS_SET_NIF 97 -#define AIOCS_SET_PRF 98 -#define AIOCS_SET_MAC 99 -#define AIOCS_INF_VST 160 -#define AIOCS_INF_IPM 161 -#define AIOCS_INF_ARP 162 -#define AIOCS_INF_ASV 163 -#define AIOCS_INF_INT 164 -#define AIOCS_INF_VCC 165 -#define AIOCS_INF_CFG 166 -#define AIOCS_INF_NIF 167 -#define AIOCS_INF_PIS 168 -#define AIOCS_INF_VER 169 - - -/* - * PF_ATM ioctls - */ -#define AIOCCFG _IOW('A', 128, struct atmcfgreq)/* Configure i/f */ -#define AIOCADD _IOW('A', 129, struct atmaddreq)/* Add (e.g. PVC) */ -#define AIOCDEL _IOW('A', 130, struct atmdelreq)/* Delete */ -#define AIOCSET _IOW('A', 132, struct atmsetreq)/* Set (e.g. net i/f) */ -#define AIOCINFO _IOWR('A', 133, struct atminfreq)/* Show kernel info */ - -#endif /* _NETATM_ATM_IOCTL_H */ Property changes on: head/sys/netatm/atm_ioctl.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_signal.c =================================================================== --- head/sys/netatm/atm_signal.c (revision 179307) +++ head/sys/netatm/atm_signal.c (nonexistent) @@ -1,511 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * General ATM signalling management - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * Local variables - */ -static struct sigmgr *atm_sigmgr_head = NULL; -static struct stack_defn *atm_stack_head = NULL; - - -/* - * Register a new Signalling Manager - * - * Each Signalling Manager must register itself here upon completing - * its internal initialization. This applies to both linked and loaded - * managers. - * - * Arguments: - * smp pointer to Signalling Manager description - * - * Returns: - * 0 registration was successful - * errno registration failed - reason indicated - * - */ -int -atm_sigmgr_register(struct sigmgr *smp) -{ - struct sigmgr *smp2; - int s = splnet(); - - /* - * See if we need to be initialized - */ - if (!atm_init) - atm_initialize(); - - /* - * Make sure there's only one instance of each protocol - */ - for (smp2 = atm_sigmgr_head; smp2 != NULL; smp2 = smp2->sm_next) { - if (smp->sm_proto == smp2->sm_proto) { - (void) splx(s); - return (EEXIST); - } - } - - /* - * Looks okay, link it in - */ - LINK2TAIL(smp, struct sigmgr, atm_sigmgr_head, sm_next); - - (void) splx(s); - return (0); -} - - -/* - * De-register a Signalling Manager - * - * Each Signalling Manager must de-register (is this really a word?) - * itself before removing itself from the system. This really only - * applies to managers about to be modunload'ed. It is the signal - * manager's responsibility to ensure that all its protocol instances - * have been successfully terminated before de-registering itself. - * - * Arguments: - * smp pointer to Signalling Manager description - * - * Returns: - * 0 deregistration was successful - * errno deregistration failed - reason indicated - * - */ -int -atm_sigmgr_deregister(struct sigmgr *smp) -{ - int found, s = splnet(); - - /* - * Unlink descriptor - */ - UNLINKF(smp, struct sigmgr, atm_sigmgr_head, sm_next, found); - - (void) splx(s); - - if (!found) - return (ENOENT); - - return (0); -} - - -/* - * Attach a Signalling Manager to an ATM physical interface - * - * Each ATM physical interface must have a signalling manager attached to - * itself for the signalling protocol to be run across this interface. The - * interface must be registered and completely initialized before the attach, - * since the signalling manager may initiate virtual circuit activity as part - * its response to this call. - * - * Called at splnet. - * - * Arguments: - * pip pointer to atm physical interface control block - * proto requested signalling protocol - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -int -atm_sigmgr_attach(struct atm_pif *pip, u_char proto) -{ - struct atm_pif *tp; - struct sigmgr *smp; - int err; - - /* - * Make sure interface is registered - */ - for (tp = atm_interface_head; tp != NULL; tp = tp->pif_next) { - if (tp == pip) - break; - } - if (tp == NULL) { - return (ENOENT); - } - - /* - * Make sure no signalling manager is already attached - */ - if (pip->pif_sigmgr != NULL) { - return (EEXIST); - } - - /* - * Must have at least one network interface defined - */ - if (pip->pif_nif == NULL) - return (ETOOMANYREFS); - - /* - * Find requested protocol - */ - for (smp = atm_sigmgr_head; smp != NULL; smp = smp->sm_next) { - if (smp->sm_proto == proto) - break; - } - if (smp == NULL) { - return (EPROTONOSUPPORT); - } - - /* - * Tell the signal manager about it - */ - err = (*smp->sm_attach)(smp, pip); - - /* - * Tell all registered convergence modules about this - */ - if (!err) { - struct atm_nif *nip; - struct atm_ncm *ncp; - - for (nip = pip->pif_nif; nip; nip = nip->nif_pnext) { - for (ncp = atm_netconv_head; ncp; ncp = ncp->ncm_next) { - if ((err = (*ncp->ncm_stat) - (NCM_SIGATTACH, nip, 0)) != 0) - break; - } - if (err) - break; - } - - if (err) { - /* - * Someone's unhappy, so back all this out - */ - (void) atm_sigmgr_detach(pip); - } - } - - return (err); -} - - -/* - * Detach an ATM physical interface from a Signalling Manager - * - * The ATM interface must be detached from the signalling manager - * before the interface can be de-registered. - * - * Called at splnet. - * - * Arguments: - * pip pointer to atm physical interface control block - * - * Returns: - * 0 detach successful - * errno detach failed - reason indicated - * - */ -int -atm_sigmgr_detach(struct atm_pif *pip) -{ - struct atm_pif *tp; - struct atm_nif *nip; - struct atm_ncm *ncp; - int err; - - - /* - * Make sure interface is registered - */ - for (tp = atm_interface_head; tp != NULL; tp = tp->pif_next) { - if (tp == pip) - break; - } - if (tp == NULL) { - return (ENOENT); - } - - /* - * Make sure a signalling manager is attached - */ - if (pip->pif_sigmgr == NULL) { - return (ENOENT); - } - - /* - * Tell all registered convergence modules about this - */ - for (nip = pip->pif_nif; nip; nip = nip->nif_pnext) { - for (ncp = atm_netconv_head; ncp; ncp = ncp->ncm_next) { - (void) (*ncp->ncm_stat)(NCM_SIGDETACH, nip, 0); - } - } - - /* - * Tell the signal manager about it - * - * NOTE: - * The only reason this should ever fail is if things are really - * hosed up somewhere, in which case doing a bunch of NCM_SIGATTACH's - * here just doesn't seem to help much. - */ - err = (*pip->pif_sigmgr->sm_detach)(pip); - - return (err); -} - - -/* - * Register an ATM Stack Service - * - * Each ATM stack service provider must register its provided service(s) here. - * Each service must be registered separately. Service providers include - * both loaded and linked kernel modules. Device driver services are NOT - * registered here - their service registry is performed implicitly through - * the device interface structure stack services list (pif_services). - * - * Arguments: - * sdp pointer to stack service definition block - * - * Returns: - * 0 registration successful - * errno registration failed - reason indicated - * - */ -int -atm_stack_register(struct stack_defn *sdp) -{ - struct stack_defn *tdp; - int s = splnet(); - - /* - * See if we need to be initialized - */ - if (!atm_init) - atm_initialize(); - - /* - * Ensure no duplicates - */ - for (tdp = atm_stack_head; tdp != NULL; tdp = tdp->sd_next) { - if (tdp->sd_sap == sdp->sd_sap) - break; - } - if (tdp != NULL) { - (void) splx(s); - return (EEXIST); - } - - /* - * Add stack to list - */ - LINK2TAIL(sdp, struct stack_defn, atm_stack_head, sd_next); - - (void) splx(s); - return (0); -} - - -/* - * De-register an ATM Stack Service - * - * Each ATM stack service provider must de-register its registered service(s) - * before terminating the service. Specifically, loaded kernel modules - * must de-register their services before unloading themselves. - * - * Arguments: - * sdp pointer to stack service definition block - * - * Returns: - * 0 de-registration successful - * errno de-registration failed - reason indicated - * - */ -int -atm_stack_deregister(struct stack_defn *sdp) -{ - int found, s = splnet(); - - /* - * Remove service from list - */ - UNLINKF(sdp, struct stack_defn, atm_stack_head, sd_next, found); - (void) splx(s); - - if (!found) - return (ENOENT); - - return (0); -} - - -/* - * Create and Instantiate a Stack - * - * For the requested stack list, locate the stack service definitions - * necessary to build the stack to implement the listed services. - * The stack service definitions provided by the interface device-driver - * are always preferred, since they are (hopefully) done with - * hardware assistance from the interface card. - * - * After the stack has been built, the selected services are called to - * notify them of the new stack instantiation. Each service should then - * allocate all the resources it requires for this new stack instance. - * The service should then wait for subsequent protocol notification - * via its stack command handlers. - * - * Must be called at splnet. - * - * Arguments: - * cvp pointer to connection vcc block for the created stack - * tlp pointer to stack list - * upf top-of-stack CM upper command handler - * - * Returns: - * 0 stack successfully created - * errno failed - reason indicated - * - */ -int -atm_create_stack(Atm_connvc *cvp, struct stack_list *tlp, - void (*upf)(int, void *, intptr_t, intptr_t)) -{ - struct stack_defn *sdp, usd; - struct stack_inst svs; - struct atm_pif *pip = cvp->cvc_attr.nif->nif_pif; - int i, err; - - - /* - * Initialize stack (element 0 is for owner's services) - */ - svs.si_srvc[1] = sdp = NULL; - - /* - * Locate service provider for each service in the - * stack list. We prefer interface driver providers - * over kernel module providers. - */ - for (i = 0; i < STACK_CNT; i++) { - Sap_t sap; - - /* Stack list is 0-terminated */ - if ((sap = tlp->sl_sap[i]) == 0) - break; - - /* - * Search interface's services - */ - for (sdp = pip->pif_services; sdp; sdp = sdp->sd_next) - if (sdp->sd_sap == sap) - break; - if (sdp == NULL) { - - /* - * Search kernel services - */ - for (sdp = atm_stack_head; sdp; - sdp = sdp->sd_next) - if (sdp->sd_sap == sap) - break; - } - if (sdp == NULL) { - - /* - * Requested service id not found - */ - return (ENOENT); - } - - /* - * Save stack definition for this service - */ - svs.si_srvc[i+1] = sdp; - - /* - * Quit loop if this service is terminal, ie. if - * it takes care of the rest of the stack. - */ - if (sdp->sd_flag & SDF_TERM) - break; - } - - /* - * Ensure stack instance array is located and terminated - */ - if ((svs.si_srvc[1] == NULL) || !(sdp->sd_flag & SDF_TERM)) { - return (ENOENT); - } - - /* - * Setup owner service definition - */ - bzero((caddr_t)&usd, sizeof(struct stack_defn)); - usd.sd_upper = upf; - usd.sd_toku = cvp; - svs.si_srvc[0] = &usd; - - /* - * Instantiate the stack - */ - err = (*svs.si_srvc[1]->sd_inst)(&svs.si_srvc[0], cvp); - if (err) { - return (err); - } - - /* - * Save top 'o stack info - */ - cvp->cvc_lower = svs.si_srvc[1]->sd_lower; - cvp->cvc_tokl = svs.si_srvc[1]->sd_toku; - - return (0); -} Property changes on: head/sys/netatm/atm_signal.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_cls.h =================================================================== --- head/sys/netatm/spans/spans_cls.h (revision 179307) +++ head/sys/netatm/spans/spans_cls.h (nonexistent) @@ -1,188 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS Connectionless Datagram Service (CLS) control blocks - * - */ - -#ifndef _SPANS_SPANSCLS_H -#define _SPANS_SPANSCLS_H - -/* - * Protocol constants - */ -#define SPANSARP_AGING (60 * ATM_HZ) /* ARP aging timer */ -#define SPANSARP_RETRY (3 * ATM_HZ) /* ARP retry timer */ -#define SPANSARP_MAXAGE 20 /* Max ARP entry age (minutes)*/ -#define SPANSARP_HASHSIZ 19 /* Hash table size */ - - -/* - * SPANS CLS protocol structure. There will be one such structure for - * each SPANS signalling instance. - */ -struct spanscls { - struct spanscls *cls_next; /* Next attached cls instance */ - u_char cls_state; /* Protocol state (see below) */ - struct spans *cls_spans; /* Spans signalling instance */ - Atm_connection *cls_conn; /* Connection manager token */ - struct ip_nif *cls_ipnif; /* IP network interface */ -}; - -/* - * SPANS CLS Protocol States - */ -#define CLS_CLOSED 1 /* CLS PVC is closed */ -#define CLS_OPEN 2 /* CLS PVC is open */ - - -/* - * Structure for SPANS ARP mappings. Each of these structures will contain - * IP address to SPANS hardware address mappings. There will be one such - * structure for each IP address currently in use. - */ -struct spansarp { - struct arpmap sa_arpmap; /* Common entry header */ - struct spanscls *sa_cls; /* Interface where we learned answer */ - struct spansarp *sa_next; /* Hash chain */ - struct spansarp *sa_rnext; /* Retry chain */ - u_char sa_flags; /* Flags (see below) */ - u_char sa_origin; /* Origin (see below) */ - u_short sa_reftime; /* Entry reference time (minutes) */ - struct ipvcc *sa_ivp; /* IP VCCs waiting for answer */ -}; -#define sa_dstip sa_arpmap.am_dstip -#define sa_dstatm sa_arpmap.am_dstatm -#define sa_dstatmsub sa_arpmap.am_dstatmsub - -/* - * Entry Flags - */ -#define SAF_VALID ARPF_VALID /* Entry is valid */ -#define SAF_REFRESH ARPF_REFRESH /* Entry has been refreshed */ -#define SAF_LOCKED 0x04 /* Entry is locked */ - -/* - * Entry Origin - */ -#define SAO_PERM ARP_ORIG_PERM /* Entry is permanently installed */ -#define SAO_LOOKUP 20 /* Learned via lookup */ - - -/* - * SPANS CLS Packet Header - */ -struct spanscls_hdr { - /* IEEE 802.6 MAC header */ - spans_addr ch_dst; /* Destination SPANS address */ - spans_addr ch_src; /* Source SPANS address */ - u_char ch_proto; /* */ - u_char ch_extlen; /* */ - u_short ch_bridging; /* */ - - /* LLC SNAP header */ - u_char ch_dsap; /* Destination SAP */ - u_char ch_ssap; /* Source SAP */ - u_char ch_ctl; /* Control field */ - u_char ch_oui[3]; /* Organizationally Unique Identifier */ - u_short ch_pid; /* Protocol Identifier */ -}; - -/* - * SPANS ARP Packet Format - */ -struct spansarp_hdr { - u_short ah_hrd; /* Hardware type (see below) */ - u_short ah_pro; /* Protocol type */ - u_char ah_hln; /* Length of hardware address */ - u_char ah_pln; /* Length of protocol address */ - u_short ah_op; /* Operation code (see below) */ - spans_addr ah_sha; /* Source hardware address */ - u_char ah_spa[4]; /* Source protocol address */ - spans_addr ah_tha; /* Target hardware address */ - u_char ah_tpa[4]; /* Target protocol address */ -}; - -/* - * Hardware types - */ -#define ARP_SPANS 0x4040 - -/* - * Operation types - */ -#define ARP_REQUEST 1 /* SPANSARP request */ -#define ARP_REPLY 2 /* SPANSARP response */ - -#define ARP_PACKET_LEN \ - (sizeof(struct spanscls_hdr) + sizeof(struct spansarp_hdr)) - -#ifdef _KERNEL -/* - * Macros for manipulating SPANS ARP tables and entries - */ -#define SPANSARP_HASH(ip) ((u_long)(ip) % SPANSARP_HASHSIZ) - -#define SPANSARP_ADD(sa) \ -{ \ - struct spansarp **h; \ - h = &spansarp_arptab[SPANSARP_HASH((sa)->sa_dstip.s_addr)]; \ - LINK2TAIL((sa), struct spansarp, *h, sa_next); \ -} - -#define SPANSARP_DELETE(sa) \ -{ \ - struct spansarp **h; \ - h = &spansarp_arptab[SPANSARP_HASH((sa)->sa_dstip.s_addr)]; \ - UNLINK((sa), struct spansarp, *h, sa_next); \ -} - -#define SPANSARP_LOOKUP(ip, sa) \ -{ \ - for ((sa) = spansarp_arptab[SPANSARP_HASH(ip)]; \ - (sa); (sa) = (sa)->sa_next) { \ - if ((sa)->sa_dstip.s_addr == (ip)) \ - break; \ - } \ -} - - -/* - * External variables - */ -extern struct spanscls *spanscls_head; -extern struct spanscls_hdr spanscls_hdr; - -#endif /* _KERNEL */ - -#endif /* _SPANS_SPANSCLS_H */ Property changes on: head/sys/netatm/spans/spans_cls.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_util.c =================================================================== --- head/sys/netatm/spans/spans_util.c (revision 179307) +++ head/sys/netatm/spans/spans_util.c (nonexistent) @@ -1,484 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS-related utility routines. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -#ifdef NOTDEF -/* XXX -- Remove all SAP checks? */ -#define MAX_SAP_ENT 1 -static struct { - spans_sap spans_sap; - Sap_t local_sap; -} sap_table[MAX_SAP_ENT] = { - {SPANS_SAP_IP, SAP_IP}, -}; - - -/* - * Translate an internal SAP to a SPANS SAP - * - * Search the SAP table for the given SAP. Put the corresponding SPANS - * SAP into the indicated variable. - * - * Arguments: - * lsap the value of the internal SAP - * ssap a pointer to the variable to receive the SPANS SAP value - * - * Returns: - * TRUE the SAP was found; *ssap is valid - * FALSE the SAP was not found; *ssap is not valid - * - */ -int -spans_get_spans_sap(lsap, ssap) - Sap_t lsap; - spans_sap *ssap; -{ - int i; - - /* - * Search the SAP table for the given local SAP - */ - for (i=0; i< MAX_SAP_ENT; i++) { - if (sap_table[i].local_sap == lsap) { - *ssap = sap_table[i].spans_sap; - return(TRUE); - } - } - return(FALSE); -} - - -/* - * Translate a SPANS SAP to internal format - * - * Search the SAP table for the given SAP. Put the corresponding - * internal SAP into the indicated variable. - * - * Arguments: - * ssap the value of the SPANS SAP - * lsap a pointer to the variable to receive the internal - * SAP value - * - * Returns: - * TRUE the SAP was found; *lsap is valid - * FALSE the SAP was not found; *lsap is not valid - * - */ -int -spans_get_local_sap(ssap, lsap) - spans_sap ssap; - Sap_t *lsap; -{ - int i; - - /* - * Search the SAP table for the given SPANS SAP - */ - for (i=0; i< MAX_SAP_ENT; i++) { - if (sap_table[i].spans_sap == ssap) { - *lsap = sap_table[i].local_sap; - return(TRUE); - } - } - return(FALSE); -} -#endif - - -/* - * Allocate an ephemeral SPANS SAP - * - * Arguments: - * spp pointer to SPANS protocol instance - * - * Returns: - * a SPANS ephemeral SAP number - * - */ -int -spans_ephemeral_sap(spp) - struct spans *spp; -{ - return(SPANS_SAP_EPHEMERAL); -} - - -/* - * Translate an internal AAL designator to a SPANS AAL type - * - * Arguments: - * laal internal AAL designation - * saal a pointer to the variable to receive the SPANS AAL type - * - * Returns: - * TRUE the AAL was found; *saal is valid - * FALSE the AAL was not found; *saal is not valid - * - */ -int -spans_get_spans_aal(laal, saal) - Aal_t laal; - spans_aal *saal; -{ - /* - * - */ - switch (laal) { - case ATM_AAL0: - *saal = SPANS_AAL0; - return(TRUE); - case ATM_AAL1: - *saal = SPANS_AAL1; - return(TRUE); - case ATM_AAL2: - *saal = SPANS_AAL2; - return(TRUE); - case ATM_AAL3_4: - *saal = SPANS_AAL4; - return(TRUE); - case ATM_AAL5: - *saal = SPANS_AAL5; - return(TRUE); - default: - return(FALSE); - } -} - - -/* - * Translate a SPANS AAL type to an internal AAL designator - * - * Arguments: - * saal the SPANS AAL type - * laal a pointer to the variable to receive the internal - * AAL designation - * - * Returns: - * TRUE the AAL was found; *laal is valid - * FALSE the AAL was not found; *laal is not valid - * - */ -int -spans_get_local_aal(saal, laal) - spans_aal saal; - Aal_t *laal; -{ - /* - * - */ - switch (saal) { - case SPANS_AAL0: - *laal = ATM_AAL0; - return(TRUE); - case SPANS_AAL1: - *laal = ATM_AAL1; - return(TRUE); - case SPANS_AAL2: - *laal = ATM_AAL2; - return(TRUE); - case SPANS_AAL3: - case SPANS_AAL4: - *laal = ATM_AAL3_4; - return(TRUE); - case SPANS_AAL5: - *laal = ATM_AAL5; - return(TRUE); - default: - return(FALSE); - } -} - - -/* - * Verify a VCCB - * - * Search SPANS's VCCB queue to verify that a VCCB belongs to SPANS. - * - * Arguments: - * spp pointer to SPANS protocol instance - * svp pointer to a VCCB - * - * Returns: - * TRUE the VCCB belongs to SPANS - * FALSE the VCCB doesn't belong to SPANS - * - */ -int -spans_verify_vccb(spp, svp) - struct spans *spp; - struct spans_vccb *svp; - -{ - struct spans_vccb *vcp, *vcnext; - - for (vcp = Q_HEAD(spp->sp_vccq, struct spans_vccb); - vcp; vcp = vcnext){ - vcnext = Q_NEXT(vcp, struct spans_vccb, sv_sigelem); - if (svp == vcp) { - return(TRUE); - } - } - return(FALSE); -} - - -/* - * Find a VCCB - * - * Find a VCCB given the VPI and VCI. - * - * Arguments: - * spp pointer to SPANS protocol instance - * vpi the VPI to search for - * vci the VCI to search for - * dir the direction of the VCC (VCC_IN, VCC_OUT, or both). - * If dir is set to zero, return the address of any VCCB - * with the given VPI/VCI, regardless of direction. - * - * Returns: - * 0 there is no such VCCB - * address the address of the VCCB - * - */ -struct spans_vccb * -spans_find_vpvc(spp, vpi, vci, dir) - struct spans *spp; - int vpi, vci; - u_char dir; - -{ - struct spans_vccb *svp, *svnext; - - for (svp = Q_HEAD(spp->sp_vccq, struct spans_vccb); svp; - svp = svnext){ - svnext = Q_NEXT(svp, struct spans_vccb, sv_sigelem); - if (svp->sv_vpi == vpi && - svp->sv_vci == vci && - (svp->sv_type & dir) == dir) - break; - } - return(svp); -} - - -/* - * Find a connection - * - * Find a VCCB given the connection structure. - * - * Arguments: - * spp pointer to SPANS protocol instance - * p pointer to a spans_atm_conn structure - * - * Returns: - * 0 there is no such VCCB - * address the address of the VCCB - * - */ -struct spans_vccb * -spans_find_conn(spp, p) - struct spans *spp; - struct spans_atm_conn *p; -{ - struct spans_vccb *svp, *svnext; - - for (svp = Q_HEAD(spp->sp_vccq, struct spans_vccb); svp; svp = svnext){ - svnext = Q_NEXT(svp, struct spans_vccb, sv_sigelem); - if (!bcmp(p, &svp->sv_conn, sizeof (spans_atm_conn))) - break; - } - return(svp); -} - - -/* - * Allocate a VPI/VCI pair - * - * When we get an open request or indication from the network, we have - * allocate a VPI and VCI for the conection. This routine will allocate - * a VPI/VCI based on the next available VCI in the SPANS protocol block. - * The VPI/VCI chose must be within the range allowed by the interface and - * must not already be in use. - * - * Currently the Fore ATM interface only supports VPI 0, so this code only - * allocates a VCI. - * - * There's probably a more elegant way to do this. - * - * Arguments: - * spp pointer to connection's SPANS protocol instance - * - * Returns: - * 0 no VPI/VCI available - * vpvc the VPI/VCI for the connection - * - */ -spans_vpvc -spans_alloc_vpvc(spp) - struct spans *spp; -{ - int vpi, vci; - - /* - * Loop through the allowable VCIs, starting with the curent one, - * to find one that's not in use. - */ - while (spp->sp_alloc_vci <= spp->sp_max_vci) { - vpi = spp->sp_alloc_vpi; - vci = spp->sp_alloc_vci++; - if (!spans_find_vpvc(spp, vpi, vci, 0)) { - return(SPANS_PACK_VPIVCI(vpi, vci)); - } - } - - /* - * Reset the VCI to the minimum - */ - spp->sp_alloc_vci = spp->sp_min_vci; - - /* - * Try looping through again - */ - while (spp->sp_alloc_vci <= spp->sp_max_vci) { - vpi = spp->sp_alloc_vpi; - vci = spp->sp_alloc_vci++; - if (!spans_find_vpvc(spp, vpi, vci, 0)) { - return(SPANS_PACK_VPIVCI(vpi, vci)); - } - } - - /* - * All allowable VCIs are in use - */ - return(0); -} - - -/* - * Print a SPANS address - * - * Convert a SPANS address into an ASCII string suitable for printing. - * - * Arguments: - * p pointer to a struct spans_addr - * - * Returns: - * the address of a string with the ASCII representation of the - * address. - * - */ -char * -spans_addr_print(p) - struct spans_addr *p; -{ - static char strbuff[80]; - union { - int w; - char c[4]; - } u1, u2; - - - /* - * Clear the returned string - */ - bzero(strbuff, sizeof(strbuff)); - - /* - * Get address into integers - */ - u1.c[0] =p->addr[0]; - u1.c[1] =p->addr[1]; - u1.c[2] =p->addr[2]; - u1.c[3] =p->addr[3]; - u2.c[0] =p->addr[4]; - u2.c[1] =p->addr[5]; - u2.c[2] =p->addr[6]; - u2.c[3] =p->addr[7]; - - /* - * Print and return the string - */ - sprintf(strbuff, "%lx.%lx", (u_long)ntohl(u1.w), (u_long)ntohl(u2.w)); - return(strbuff); -} - - -/* - * Print a buffer chain - * - * Arguments: - * m pointer to a buffer chain - * - * Returns: - * none - * - */ -void -spans_dump_buffer(m) - KBuffer *m; -{ - int i; - caddr_t cp; - - printf("spans_dump_buffer:\n"); - while (m) { - KB_DATASTART(m, cp, caddr_t); - for (i = 0; i < KB_LEN(m); i++) { - if (i == 0) - printf(" bfr=%p: ", m); - printf("%x ", (u_char)*cp++); - } - printf("\n"); - m = KB_NEXT(m); - } -} Property changes on: head/sys/netatm/spans/spans_util.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_msg.c =================================================================== --- head/sys/netatm/spans/spans_msg.c (revision 179307) +++ head/sys/netatm/spans/spans_msg.c (nonexistent) @@ -1,1644 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS signalling message processing. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -/* - * External functions - */ -void xdrmbuf_init(XDR *, KBuffer *, enum xdr_op); - -/* - * Local functions - */ -static void spans_host_link(struct spans *, long); -static void spans_status_ind(struct spans *, spans_msg *); -static void spans_status_rsp(struct spans *, spans_msg *); -static void spans_open_req(struct spans *, spans_msg *); -static void spans_open_rsp(struct spans *, spans_msg *); -static void spans_close_req(struct spans *, spans_msg *); -static void spans_close_rsp(struct spans *, spans_msg *); -static void spans_multi_req(struct spans *, spans_msg *); -static void spans_add_req(struct spans *, spans_msg *); -static void spans_join_req(struct spans *, spans_msg *); -static void spans_leave_req(struct spans *, spans_msg *); -static void spans_vcir_ind(struct spans *, spans_msg *); -static void spans_query_req(struct spans *, spans_msg *); - - -/* - * Called to set status when a status message comes in from a host - * connected back-to-back with us. Check the epoch and, if it has - * changed, set the appropriate state and save updated state - * information. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * host_epoch epoch of host at far end of link - * - * Returns: - * 0 message sent OK - * errno error encountered - * - */ -static void -spans_host_link(spp, host_epoch) - struct spans *spp; - long host_epoch; -{ - struct atm_pif *pip = spp->sp_pif; - - /* - * There's a host at the other end of the link. If its - * epoch has changed, clean up our state and save the - * new information. - */ - if (spp->sp_s_epoch != host_epoch) { - spp->sp_s_epoch = host_epoch; - spans_switch_reset(spp, SPANS_UNI_UP); - spp->sp_addr.address_format = T_ATM_SPANS_ADDR; - spp->sp_addr.address_length = sizeof(spans_addr); - bcopy(&pip->pif_macaddr.ma_data[2], - &spp->sp_addr.address[4], - 4); - log(LOG_INFO, - "spans: using SPANS address of %s on interface %s%d\n", - spans_addr_print((spans_addr *)spp->sp_addr.address), - pip->pif_name, - pip->pif_unit); - } -} - -/* - * Send a SPANS signalling message - * - * Called to send a SPANS message. This routine gets a buffer, performs - * XDR processing, and hands the message to the AAL for transmission. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to status message - * - * Returns: - * 0 message sent OK - * errno error encountered - * - */ -int -spans_send_msg(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - int err = 0; - KBuffer *m; - XDR xdrs; - -#ifdef NOTDEF - ATM_DEBUG2("spans_send_msg: msg=%p, type=%d\n", msg, - msg->sm_type); - if (msg->sm_type != SPANS_STAT_REQ && - msg->sm_type != SPANS_STAT_IND && - msg->sm_type != SPANS_STAT_RSP) { - printf("spans_send_msg: sending "); - spans_print_msg(msg); - } -#endif - - /* - * If the signalling channel has been closed, don't do anything - */ - if (!spp->sp_conn) - return(ECONNABORTED); - - /* - * Get a buffer - */ - KB_ALLOCPKT(m, sizeof(spans_msg), KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) { - /* No buffer available */ - return(ENOBUFS); - } - - /* - * Convert message to network order - */ - KB_LEN(m) = KB_BFRLEN(m); - xdrmbuf_init(&xdrs, m, XDR_ENCODE); - if (!xdr_spans_msg(&xdrs, msg)) { - log(LOG_ERR, "spans_send_msg: XDR encode failed\n"); - KB_LEN(m) = XDR_GETPOS(&xdrs); - spans_dump_buffer(m); - KB_FREEALL(m); - return(EIO); - } - KB_LEN(m) = XDR_GETPOS(&xdrs); - - /* - * Send the message - */ - err = atm_cm_cpcs_data(spp->sp_conn, m); - if (err) - KB_FREEALL(m); - - return(err); -} - - -/* - * Send an open request - * - * Build and send an open request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * svp pointer to VCCB for which the request is being sent - * - * Returns: - * none - * - */ -int -spans_send_open_req(spp, svp) - struct spans *spp; - struct spans_vccb *svp; -{ - spans_msg *req; - int err = 0; - - ATM_DEBUG1("spans_send_open_req: svp=%p\n", svp); - - /* - * Get memory for a request message - */ - req = uma_zalloc(spans_msg_zone, M_WAITOK); - if (req == NULL) { - err = ENOBUFS; - goto done; - } - - /* - * Fill in the request - */ - req->sm_vers = SPANS_VERS_1_0; - req->sm_type = SPANS_OPEN_REQ; - req->sm_open_req.opreq_conn = svp->sv_conn; - req->sm_open_req.opreq_aal = svp->sv_spans_aal; - req->sm_open_req.opreq_desrsrc = svp->sv_spans_qos; - req->sm_open_req.opreq_minrsrc.rsc_peak = 0; - req->sm_open_req.opreq_minrsrc.rsc_mean = 0; - req->sm_open_req.opreq_minrsrc.rsc_burst = 0; - req->sm_open_req.opreq_vpvc.vpf_valid = FALSE; - - /* - * Send the request - */ - err = spans_send_msg(spp, req); - uma_zfree(spans_msg_zone, req); -done: - return(err); -} - - -/* - * Send an open response - * - * Build and send a response to an open request or open indication. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * svp pointer to VCCB for which the response is being sent - * result result code to include in the response - * - * Returns: - * none - * - */ -int -spans_send_open_rsp(spp, svp, result) - struct spans *spp; - struct spans_vccb *svp; - spans_result result; -{ - spans_msg *rsp; - int rc; - - ATM_DEBUG2("spans_send_open_rsp: svp=%p, result=%d\n", svp, - result); - - /* - * Get memory for a response message - */ - rsp = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp == NULL) - return(ENOBUFS); - - /* - * Fill in the response - */ - rsp->sm_vers = SPANS_VERS_1_0; - rsp->sm_type = SPANS_OPEN_RSP; - rsp->sm_open_rsp.oprsp_conn = svp->sv_conn; - rsp->sm_open_rsp.oprsp_result = result; - rsp->sm_open_rsp.oprsp_rsrc = svp->sv_spans_qos; - rsp->sm_open_rsp.oprsp_vpvc = - SPANS_PACK_VPIVCI(svp->sv_vpi, svp->sv_vci); - - /* - * Send the response - */ - rc = spans_send_msg(spp, rsp); - uma_zfree(spans_msg_zone, rsp); - return(rc); -} - - -/* - * Send a close request - * - * Called to send a close request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * svp pointer to VCCB for which the close is being sent - * - * Returns: - * none - * - */ -int -spans_send_close_req(spp, svp) - struct spans *spp; - struct spans_vccb *svp; -{ - spans_msg *req; - int err = 0; - - ATM_DEBUG1("spans_send_close_req: svp=%p\n", svp); - - /* - * Get memory for a close request - */ - req = uma_zalloc(spans_msg_zone, M_WAITOK); - if (req == NULL) { - err = ENOBUFS; - goto done; - } - - /* - * Fill in the request - */ - req->sm_vers = SPANS_VERS_1_0; - if (svp->sv_type & VCC_OUT) { - req->sm_type = SPANS_CLOSE_REQ; - } else if (svp->sv_type & VCC_IN) { - req->sm_type = SPANS_RCLOSE_REQ; - } else { - err = EINVAL; - ATM_DEBUG1( - "spans_send_close_req: invalid VCCB type 0x%x\n", - svp->sv_type); - goto done; - } - req->sm_close_req.clreq_conn = svp->sv_conn; - - /* - * Send the close request - */ - err = spans_send_msg(spp, req); - -done: - if (req) - uma_zfree(spans_msg_zone, req); - - return(err); -} - - - -/* - * Process a status indication or status request - * - * Called when a status indication or status request is received. - * Processing will be based on the current SPANS state. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the status message - * - * Returns: - * none - * - */ -static void -spans_status_ind(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_msg *rsp_msg; - struct atm_pif *pip = spp->sp_pif; - - /* - * Reset the probe count. - */ - spp->sp_probe_ct = 0; - - switch (spp->sp_state) { - case SPANS_PROBE: - /* - * Interface just came up, update signalling state - */ - spp->sp_state = SPANS_ACTIVE; - break; - - case SPANS_ACTIVE: - break; - - default: - log(LOG_ERR, "spans: received status msg in state %d\n", - spp->sp_state); - } - - /* - * Process the message - */ - switch (msg->sm_type) { - - case SPANS_STAT_REQ: - /* - * Handle a request from a host at the other end of - * the link. - */ - spans_host_link(spp, msg->sm_stat_req.streq_es_epoch); - break; - - case SPANS_STAT_IND: - - /* - * There's a switch at the other end of the link. If - * its epoch has changed, reset the SPANS state and save - * the new information. - */ - if (spp->sp_s_epoch != - msg->sm_stat_ind.stind_sw_epoch) { - spans_switch_reset(spp, SPANS_UNI_UP); - spp->sp_s_epoch = - msg->sm_stat_ind.stind_sw_epoch; - spp->sp_addr.address_format = T_ATM_SPANS_ADDR; - spp->sp_addr.address_length = - sizeof(spans_addr); - spans_addr_copy(&msg->sm_stat_ind.stind_es_addr, - spp->sp_addr.address); - log(LOG_INFO, - "spans: received SPANS address %s from switch for interface %s%d\n", - spans_addr_print((spans_addr *)spp->sp_addr.address), - pip->pif_name, - pip->pif_unit); - } - break; - - default: - ATM_DEBUG1("spans_status_ind: Invalid message type %d\n", - msg->sm_type); - return; - } - - /* - * Respond to the status request or indication with a - * status response - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_STAT_RSP; - rsp_msg->sm_stat_rsp.strsp_es_epoch = spp->sp_h_epoch; - spans_addr_copy(spp->sp_addr.address, - &rsp_msg->sm_stat_rsp.strsp_es_addr); - spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - - -/* - * Process a status response - * - * Called when a status response is received. - * Processing will be based on the current SPANS state. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the status response message - * - * Returns: - * none - * - */ -static void -spans_status_rsp(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - - /* - * Reset the probe count. - */ - spp->sp_probe_ct = 0; - - switch (spp->sp_state) { - case SPANS_PROBE: - /* - * Interface just came up, update signalling state - */ - spp->sp_state = SPANS_ACTIVE; - break; - - case SPANS_ACTIVE: - break; - - default: - log(LOG_ERR, "spans: received status msg in state %d\n", - spp->sp_state); - } - - /* - * Process the message - */ - spans_host_link(spp, msg->sm_stat_req.streq_es_epoch); -} - - -/* - * Process an open indication or open request - * - * Called when an open indication or open request is received. - * Processing will be based on the state of the requested connection. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the open message - * - * Returns: - * none - * - */ -static void -spans_open_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_result result = SPANS_OK; - spans_msg *rsp_msg; - struct spans_vccb *svp = NULL; - struct atm_pif *pip; - spans_vpvc vpvc; - int err = 0, vpi, vci; - Aal_t aal; - Atm_attributes call_attrs; - - ATM_DEBUG2("spans_open_req: spp=%p, msg=%p\n", spp, msg); - - /* - * See if the connection is new - */ - if ((svp = spans_find_conn(spp, &msg->sm_open_req.opreq_conn)) != NULL) { - /* - * We already have a VCCB that matches the connection in - * the request - */ - vpi = SPANS_EXTRACT_VPI(msg->sm_open_req.opreq_vpvc.vpf_vpvc); - vci = SPANS_EXTRACT_VCI(msg->sm_open_req.opreq_vpvc.vpf_vpvc); - if (msg->sm_open_req.opreq_aal == svp->sv_spans_aal && - (!msg->sm_open_req.opreq_vpvc.vpf_valid || - (vpi == svp->sv_vpi && - vci == svp->sv_vci))) { - /* - * VCCB already exists, process depending on - * state - */ - switch (svp->sv_sstate) { - case SPANS_VC_R_POPEN: - /* I'm still thinking about it */ - return; - case SPANS_VC_OPEN: - /* Retransmit the open_rsp */ - break; - case SPANS_VC_POPEN: - case SPANS_VC_CLOSE: - case SPANS_VC_ABORT: - ATM_DEBUG0("spans_open_req: bad VCCB state\n"); - result = SPANS_FAIL; - break; - } - } else { - /* - * VCCB is for same connection, but other - * parameters don't match - */ - ATM_DEBUG0("spans_open_req: VCCB confusion\n"); - result = SPANS_FAIL; - } - svp = NULL; - goto response; - } - - /* - * Verify that the request is for our ATM addres - */ - if (spans_addr_cmp(spp->sp_addr.address, - &msg->sm_open_req.opreq_conn.con_dst)) { - ATM_DEBUG0("spans_open_req: bad destination\n"); - result = SPANS_BADDEST; - goto response; - } - - /* - * See if we recognize the specified AAL - */ - if (!spans_get_local_aal(msg->sm_open_req.opreq_aal, &aal)) { - ATM_DEBUG0("spans_open_req: bad AAL\n"); - result = SPANS_FAIL; - goto response; - } - - /* - * Should verify that we can handle requested connection QOS - */ - - /* - * Select a VPI/VCI for the new connection - */ - if (msg->sm_open_req.opreq_vpvc.vpf_valid) { - /* - * Requestor asked for a certain VPI/VCI. Make sure we - * aren't already using the pair that was asked for. - */ - vpi = SPANS_EXTRACT_VPI(msg->sm_open_req.opreq_vpvc.vpf_vpvc); - vci = SPANS_EXTRACT_VCI(msg->sm_open_req.opreq_vpvc.vpf_vpvc); - if (spans_find_vpvc(spp, vci, vpi, VCC_IN)) { - ATM_DEBUG0("spans_open_req: VPI, VCI busy\n"); - result = SPANS_NOVPVC; - goto response; - } - vpvc = msg->sm_open_req.opreq_vpvc.vpf_vpvc; - } else { - /* - * Allocate a VPI/VCI for this end of the VCC - */ - vpvc = spans_alloc_vpvc(spp); - if (vpvc == 0) { - ATM_DEBUG0("spans_open_req: no VPI, VCI available\n"); - result = SPANS_NOVPVC; - goto response; - } - } - - /* - * Get a new VCCB for the connection - */ - svp = uma_zalloc(spans_vc_zone, M_WAITOK); - if (svp == NULL) { - ATM_DEBUG0("spans_open_req: VCCB pool empty\n"); - result = SPANS_NORSC; - goto response; - } - - /* - * Find the physical interface structure - */ - pip = spp->sp_pif; - - /* - * Fill in the VCCB fields that we can at this point - */ - svp->sv_type = VCC_SVC | VCC_IN; - svp->sv_proto = ATM_SIG_SPANS; - svp->sv_sstate = SPANS_VC_R_POPEN; - svp->sv_ustate = VCCU_POPEN; - svp->sv_pif = pip; - svp->sv_nif = pip->pif_nif; - svp->sv_conn = msg->sm_open_req.opreq_conn; - svp->sv_spans_qos = msg->sm_open_req.opreq_desrsrc; - svp->sv_spans_aal = msg->sm_open_req.opreq_aal; - svp->sv_tstamp = time_second; - - svp->sv_vpi = SPANS_EXTRACT_VPI(vpvc); - svp->sv_vci = SPANS_EXTRACT_VCI(vpvc); - - /* - * Put the VCCB on the SPANS queue - */ - ENQUEUE(svp, struct spans_vccb, sv_sigelem, spp->sp_vccq); - - /* - * Set up the ATM attributes block - */ - bzero(&call_attrs, sizeof(call_attrs)); - call_attrs.nif = svp->sv_nif; - call_attrs.api = CMAPI_CPCS; - - call_attrs.aal.tag = T_ATM_PRESENT; - call_attrs.aal.type = aal; - switch(aal) { - case ATM_AAL3_4: - call_attrs.aal.v.aal4.forward_max_SDU_size = - ATM_NIF_MTU; - call_attrs.aal.v.aal4.backward_max_SDU_size = - ATM_NIF_MTU; - call_attrs.aal.v.aal4.SSCS_type = - T_ATM_NULL; - call_attrs.aal.v.aal4.mid_low = 0; - call_attrs.aal.v.aal4.mid_high = 1023; - break; - case ATM_AAL5: - call_attrs.aal.v.aal5.forward_max_SDU_size = - ATM_NIF_MTU; - call_attrs.aal.v.aal5.backward_max_SDU_size = - ATM_NIF_MTU; - call_attrs.aal.v.aal5.SSCS_type = - T_ATM_NULL; - break; - } - - call_attrs.traffic.tag = T_ATM_PRESENT; - call_attrs.traffic.v.forward.PCR_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.forward.PCR_all_traffic = - msg->sm_open_req.opreq_desrsrc.rsc_peak * - 1000 / 53; - call_attrs.traffic.v.forward.SCR_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.forward.SCR_all_traffic = T_ATM_ABSENT; - call_attrs.traffic.v.forward.MBS_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.forward.MBS_all_traffic = T_ATM_ABSENT; - call_attrs.traffic.v.forward.tagging = T_NO; - call_attrs.traffic.v.backward.PCR_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.backward.PCR_all_traffic = - call_attrs.traffic.v.forward.PCR_all_traffic; - call_attrs.traffic.v.backward.SCR_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.backward.SCR_all_traffic = T_ATM_ABSENT; - call_attrs.traffic.v.backward.MBS_high_priority = T_ATM_ABSENT; - call_attrs.traffic.v.backward.MBS_all_traffic = T_ATM_ABSENT; - call_attrs.traffic.v.backward.tagging = T_NO; - call_attrs.traffic.v.best_effort = T_YES; - - call_attrs.bearer.tag = T_ATM_PRESENT; - call_attrs.bearer.v.bearer_class = T_ATM_CLASS_X; - call_attrs.bearer.v.traffic_type = T_ATM_NULL; - call_attrs.bearer.v.timing_requirements = T_ATM_NULL; - call_attrs.bearer.v.clipping_susceptibility = T_NO; - call_attrs.bearer.v.connection_configuration = T_ATM_1_TO_1; - - - call_attrs.bhli.tag = T_ATM_ABSENT; - call_attrs.blli.tag_l2 = T_ATM_ABSENT; - call_attrs.blli.tag_l3 = T_ATM_ABSENT; - call_attrs.llc.tag = T_ATM_ABSENT; - - call_attrs.called.tag = T_ATM_PRESENT; - spans_addr_copy(&msg->sm_open_req.opreq_conn.con_dst, - call_attrs.called.addr.address); - call_attrs.called.addr.address_format = T_ATM_SPANS_ADDR; - call_attrs.called.addr.address_length = sizeof(spans_addr); - call_attrs.called.subaddr.address_format = T_ATM_ABSENT; - call_attrs.called.subaddr.address_length = 0; - - call_attrs.calling.tag = T_ATM_PRESENT; - spans_addr_copy(&msg->sm_open_req.opreq_conn.con_src, - call_attrs.calling.addr.address); - call_attrs.calling.addr.address_format = T_ATM_SPANS_ADDR; - call_attrs.calling.addr.address_length = sizeof(spans_addr); - call_attrs.calling.subaddr.address_format = T_ATM_ABSENT; - call_attrs.calling.subaddr.address_length = 0; - - call_attrs.qos.tag = T_ATM_PRESENT; - call_attrs.qos.v.coding_standard = T_ATM_NETWORK_CODING; - call_attrs.qos.v.forward.qos_class = T_ATM_QOS_CLASS_0; - call_attrs.qos.v.backward.qos_class = T_ATM_QOS_CLASS_0; - - call_attrs.transit.tag = T_ATM_ABSENT; - call_attrs.cause.tag = T_ATM_ABSENT; - - /* - * Notify the connection manager that it has a new channel - */ - err = atm_cm_incoming((struct vccb *)svp, &call_attrs); - if (err) { - ATM_DEBUG0("spans_open_req: atm_cm_incoming returned error\n"); - result = SPANS_FAIL; - goto response; - } - - /* - * Wait for the connection recipient to issue an accept - */ - return; - -response: - /* - * Clean up the VCCB and the atm_conn block if we got them - */ - if (svp) { - DEQUEUE(svp, struct spans_vccb, sv_sigelem, - spp->sp_vccq); - uma_zfree(spans_vc_zone, svp); - } - - /* - * Some problem was detected with the request. Send a SPANS - * message rejecting the connection. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_OPEN_RSP; - rsp_msg->sm_open_rsp.oprsp_conn = msg->sm_open_req.opreq_conn; - rsp_msg->sm_open_rsp.oprsp_result = result; - rsp_msg->sm_open_rsp.oprsp_vpvc = 0; - - /* - * Send the Open Response - */ - spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process an open response or open confirmation - * - * Called when an open response or open confirmation is received. - * Processing will be based on the state of the requested connection and - * the status returned. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the open response or confirmation message - * - * Returns: - * none - * - */ -static void -spans_open_rsp(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - struct spans_vccb *svp; - - ATM_DEBUG2("spans_open_rsp: spp=%p, msg=%p\n", spp, msg); - - /* - * Locate the VCCB for the connection - */ - svp = spans_find_conn(spp, &msg->sm_open_rsp.oprsp_conn); - if (svp == NULL) - return; - - /* - * Check the connection state - */ - if ((svp->sv_sstate != SPANS_VC_POPEN && - svp->sv_sstate != SPANS_VC_R_POPEN) || - svp->sv_ustate != VCCU_POPEN) { - ATM_DEBUG2( - "spans_open_rsp: invalid VCCB state, sstate=%d, ustate=%d\n", - svp->sv_sstate, svp->sv_ustate); - return; - } - - /* - * Cancel the retransmission timer - */ - SPANS_VC_CANCEL((struct vccb *) svp); - - /* - * Check the result - */ - switch (msg->sm_open_rsp.oprsp_result) { - - case SPANS_OK: - /* - * Save the assigned VPI and VCI - */ - svp->sv_vpi = SPANS_EXTRACT_VPI(msg->sm_open_rsp.oprsp_vpvc); - svp->sv_vci = SPANS_EXTRACT_VCI(msg->sm_open_rsp.oprsp_vpvc); - - /* - * Update the VCC state and notify the VCC owner - */ - svp->sv_sstate = SPANS_VC_OPEN; - svp->sv_ustate = VCCU_OPEN; - svp->sv_tstamp = time_second; - atm_cm_connected(svp->sv_connvc); - break; - - case SPANS_FAIL: - case SPANS_NOVPVC: - case SPANS_NORSC: - case SPANS_BADDEST: - /* - * Close out the VCCB and notify the user - */ - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_ustate = VCCU_CLOSED; - svp->sv_connvc->cvc_attr.cause.tag = T_ATM_PRESENT; - svp->sv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - svp->sv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - svp->sv_connvc->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_CALL_REJECTED; - bzero(svp->sv_connvc->cvc_attr.cause.v.diagnostics, - sizeof(svp->sv_connvc->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - break; - - default: - log(LOG_ERR, "spans: unknown result %d in open rsp\n", - msg->sm_open_rsp.oprsp_result); - break; - } -} - - -/* - * Process a close request from the network - * - * Called when a close request, close indication, rclose request, or - * rclose indication is received. Processing will be based on the - * state of the connection. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the close request message - * - * Returns: - * none - * - */ -static void -spans_close_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - struct spans_vccb *svp; - spans_result result; - spans_msg *rsp_msg; - u_char outstate; - Atm_connvc *cvp; - - ATM_DEBUG2("spans_close_req: spp=%p, msg=%p\n", spp, msg); - - /* - * Locate the VCCB for the connection - */ - svp = spans_find_conn(spp, &msg->sm_close_req.clreq_conn); - if (svp == NULL) { - result = SPANS_BADDEST; - goto response; - } - - /* - * Check the connection type - */ - if (!(svp->sv_type & VCC_SVC)) { - result = SPANS_FAIL; - goto response; - } - - /* - * Check the connection state - */ - switch (svp->sv_sstate) { - case SPANS_VC_OPEN: - case SPANS_VC_R_POPEN: - case SPANS_VC_POPEN: - /* - * VCC is open or opening--continue - */ - break; - case SPANS_VC_CLOSE: - case SPANS_VC_FREE: - case SPANS_VC_ABORT: - /* - * We're already closing--give a response, since this - * is probably a retransmission - */ - result = SPANS_OK; - goto response; - case SPANS_VC_NULL: - result = SPANS_FAIL; - goto response; - } - - /* - * Cancel the retransmission timer - */ - SPANS_VC_CANCEL((struct vccb *) svp); - - /* - * Close out the VCCB and notify the user - */ - outstate = svp->sv_sstate; - svp->sv_ustate = VCCU_CLOSED; - svp->sv_sstate = SPANS_VC_FREE; - cvp = svp->sv_connvc; - switch (outstate) { - case SPANS_VC_R_POPEN: - spans_free((struct vccb *)svp); - /* FALLTHRU */ - - case SPANS_VC_POPEN: - case SPANS_VC_OPEN: - cvp->cvc_attr.cause.tag = T_ATM_PRESENT; - cvp->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - cvp->cvc_attr.cause.v.location = T_ATM_LOC_USER; - cvp->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_NORMAL_CALL_CLEARING; - bzero(cvp->cvc_attr.cause.v.diagnostics, - sizeof(cvp->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - break; - } - - result = SPANS_OK; - -response: - /* - * Respond to the SPANS_CLOSE_IND with a SPANS_CLOSE_RSP - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - rsp_msg->sm_vers = SPANS_VERS_1_0; - if (msg->sm_type == SPANS_RCLOSE_REQ || - msg->sm_type == SPANS_RCLOSE_IND) { - rsp_msg->sm_type = SPANS_RCLOSE_RSP; - } else { - rsp_msg->sm_type = SPANS_CLOSE_RSP; - } - rsp_msg->sm_close_rsp.clrsp_conn = msg->sm_close_req.clreq_conn; - rsp_msg->sm_close_rsp.clrsp_result = result; - spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process a close response or close confirmation - * - * Called when a close response or close confirmation is received. - * Processing will be based on the state of the requested connection and - * the returned status. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the close response or confirmation message - * - * Returns: - * none - * - */ -static void -spans_close_rsp(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - struct spans_vccb *svp; - - ATM_DEBUG2("spans_close_rsp: spp=%p, msg=%p\n", spp, msg); - - /* - * Locate the VCCB for the connection - */ - svp = spans_find_conn(spp, &msg->sm_close_rsp.clrsp_conn); - if (svp == NULL) { - return; - } - - /* - * Check the VCCB state - */ - if (svp->sv_sstate != SPANS_VC_CLOSE) { - return; - } - - /* - * Cancel the retransmission timer - */ - SPANS_VC_CANCEL((struct vccb *) svp); - - /* - * Check the response from the remote end - */ - switch (msg->sm_close_rsp.clrsp_result) { - - case SPANS_OK: - /* - * Mark the VCCB as closed and notify the owner - */ - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_connvc->cvc_attr.cause.tag = T_ATM_PRESENT; - svp->sv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - svp->sv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - svp->sv_connvc->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_NORMAL_CALL_CLEARING; - bzero(svp->sv_connvc->cvc_attr.cause.v.diagnostics, - sizeof(svp->sv_connvc->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - break; - - case SPANS_NOVPVC: - case SPANS_BADDEST: - case SPANS_FAIL: - case SPANS_NORSC: - /* - * Mark the VCCB as closed and notify the owner - */ - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_connvc->cvc_attr.cause.tag = T_ATM_PRESENT; - svp->sv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - svp->sv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - svp->sv_connvc->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_UNSPECIFIED_NORMAL; - bzero(svp->sv_connvc->cvc_attr.cause.v.diagnostics, - sizeof(svp->sv_connvc->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - break; - - default: - log(LOG_ERR, "spans: unknown result %d in close rsp\n", - msg->sm_close_rsp.clrsp_result); - break; - } -} - - -/* - * Process a multi request or multi indication - * - * Called when a multi response or multi confirmation is received. We - * don't support multicast channels, so we just reject the request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the multi request or indication message - * - * Returns: - * none - * - */ -static void -spans_multi_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_msg *rsp_msg; - - /* - * Get memory for a SPANS_MULTI_RSP message. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response. - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_MULTI_RSP; - rsp_msg->sm_multi_rsp.mursp_conn = msg->sm_multi_req.mureq_conn; - rsp_msg->sm_multi_rsp.mursp_result = SPANS_FAIL; - rsp_msg->sm_multi_rsp.mursp_rsrc = msg->sm_multi_req.mureq_desrsrc; - rsp_msg->sm_multi_rsp.mursp_vpvc = 0; - - /* - * Send the response and free the message. - */ - (void) spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process an add request or add indication - * - * Called when an add response or add confirmation is received. We - * don't support multicast channels, so we just reject the request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the add request or indication message - * - * Returns: - * none - * - */ -static void -spans_add_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_msg *rsp_msg; - - /* - * Get memory for a SPANS_ADD_RSP message. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response. - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_ADD_RSP; - rsp_msg->sm_add_rsp.adrsp_conn = msg->sm_add_req.adreq_desconn; - rsp_msg->sm_add_rsp.adrsp_result = SPANS_FAIL; - rsp_msg->sm_add_rsp.adrsp_rsrc.rsc_peak = 0; - rsp_msg->sm_add_rsp.adrsp_rsrc.rsc_mean = 0; - rsp_msg->sm_add_rsp.adrsp_rsrc.rsc_burst = 0; - - /* - * Send the response and free the message. - */ - (void) spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process a join request - * - * Called when a join request is received. We don't support group - * addresses, so we just reject the request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the join request message - * - * Returns: - * none - * - */ -static void -spans_join_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_msg *rsp_msg; - - /* - * Get memory for a SPANS_JOIN_CNF message. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response. - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_JOIN_CNF; - spans_addr_copy(&msg->sm_join_req.jnreq_addr, - &rsp_msg->sm_join_cnf.jncnf_addr); - rsp_msg->sm_join_cnf.jncnf_result = SPANS_FAIL; - - /* - * Send the response and free the message. - */ - (void) spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process a leave request - * - * Called when a leave request is received. We don't support group - * addresses, so we just reject the request. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the leave request message - * - * Returns: - * none - * - */ -static void -spans_leave_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - spans_msg *rsp_msg; - - /* - * Get memory for a SPANS_LEAVE_CNF message. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response. - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_LEAVE_CNF; - spans_addr_copy(&msg->sm_leave_req.lvreq_addr, - &rsp_msg->sm_leave_cnf.lvcnf_addr); - rsp_msg->sm_leave_cnf.lvcnf_result = SPANS_FAIL; - - /* - * Send the response and free the message. - */ - (void) spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process a VCI range indication - * - * Called when a VCI range indication is received. Adjust the VCI - * bounds if they have changed. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the VCI range indication message - * - * Returns: - * none - * - */ -static void -spans_vcir_ind(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - /* - * Adjust the limits if they have changed - */ - if (msg->sm_vcir_ind.vrind_min != spp->sp_min_vci) { - spp->sp_min_vci = - (msg->sm_vcir_ind.vrind_min < - SPANS_MIN_VCI ? - SPANS_MIN_VCI : - msg->sm_vcir_ind.vrind_min); - } - if (msg->sm_vcir_ind.vrind_max != spp->sp_max_vci) { - spp->sp_max_vci = - (msg->sm_vcir_ind.vrind_max > - SPANS_MAX_VCI ? - SPANS_MAX_VCI : - msg->sm_vcir_ind.vrind_max); - } -} - - -/* - * Process a query request - * - * Called when a query request is received. Respond with the - * appropriate query response. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * msg pointer to the VCI range indication message - * - * Returns: - * none - * - */ -static void -spans_query_req(spp, msg) - struct spans *spp; - spans_msg *msg; -{ - struct spans_vccb *svp = NULL; - spans_msg *rsp_msg; - - ATM_DEBUG1("spans_query_req: msg=%p\n", msg); - - /* - * Ignore an end-to-end query - */ - if (msg->sm_query_req.qyreq_type == SPANS_QUERY_END_TO_END) { - return; - } - - /* - * Get memory for a SPANS_QUERY_RSP message. - */ - rsp_msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (rsp_msg == NULL) - return; - - /* - * Fill out the response. - */ - rsp_msg->sm_vers = SPANS_VERS_1_0; - rsp_msg->sm_type = SPANS_QUERY_RSP; - rsp_msg->sm_query_rsp.qyrsp_conn = msg->sm_query_req.qyreq_conn; - rsp_msg->sm_query_rsp.qyrsp_type = msg->sm_query_req.qyreq_type; - rsp_msg->sm_query_rsp.qyrsp_data = 0; - - /* - * Get the state of the requested connection - */ - svp = spans_find_conn(spp, &msg->sm_query_req.qyreq_conn); - if (svp) { - switch(svp->sv_sstate) { - case SPANS_VC_NULL: - case SPANS_VC_FREE: - rsp_msg->sm_query_rsp.qyrsp_state = - SPANS_CONN_CLOSED; - break; - case SPANS_VC_OPEN: - rsp_msg->sm_query_rsp.qyrsp_state = - SPANS_CONN_OPEN; - break; - case SPANS_VC_POPEN: - case SPANS_VC_R_POPEN: - rsp_msg->sm_query_rsp.qyrsp_state = - SPANS_CONN_OPEN_PEND; - break; - case SPANS_VC_CLOSE: - case SPANS_VC_ABORT: - rsp_msg->sm_query_rsp.qyrsp_state = - SPANS_CONN_CLOSE_PEND; - break; - case SPANS_VC_ACTIVE: - case SPANS_VC_ACT_DOWN: - /* - * VCCB is for a PVC (shouldn't happen) - */ - uma_zfree(spans_msg_zone, rsp_msg); - return; - } - } else { - /* - * No VCCB found--connection doesn't exist - */ - rsp_msg->sm_query_rsp.qyrsp_state = SPANS_CONN_CLOSED; - } - - /* - * Send the response and free the message. - */ - (void) spans_send_msg(spp, rsp_msg); - uma_zfree(spans_msg_zone, rsp_msg); -} - - -/* - * Process a SPANS signalling message - * - * Called when a SPANS message is received. The message is converted - * into internal format with XDR and decoded by calling the appropriate - * mesage handling routine. Unrecognized and unexpected messages are - * logged. - * - * Arguments: - * spp pointer to SPANS protocol instance block - * m pointer to a buffer chain containing the SPANS message - * - * Returns: - * none - * - */ -void -spans_rcv_msg(spp, m) - struct spans *spp; - KBuffer *m; -{ - XDR xdrs; - spans_msg *msg; - - /* - * Get storage for the message - */ - msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (msg == NULL) - return; - - /* - * Convert the message from network order to internal format - */ - xdrmbuf_init(&xdrs, m, XDR_DECODE); - if (!xdr_spans_msg(&xdrs, msg)) { - log(LOG_ERR, "spans_rcv_msg: XDR decode failed\n"); - spans_dump_buffer(m); - goto done; - } - -#ifdef NOTDEF - /* - * Debug--print some information about the message - */ - if (msg->sm_type != SPANS_STAT_REQ && - msg->sm_type != SPANS_STAT_IND && - msg->sm_type != SPANS_STAT_RSP) { - printf("spans_rcv_msg: got "); - spans_print_msg(msg); - } -#endif - - /* - * Verify the message sm_vers - */ - if (msg->sm_vers != SPANS_VERS_1_0) { - log(LOG_ERR, "spans: invalid message version 0x%x\n", - msg->sm_vers); - } - - /* - * Ignore the message if SPANS isn't up yet - */ - if (spp->sp_state != SPANS_ACTIVE && - (spp->sp_state != SPANS_PROBE || - (msg->sm_type != SPANS_STAT_REQ && - msg->sm_type != SPANS_STAT_RSP && - msg->sm_type != SPANS_STAT_IND))) { - goto done; - } - - /* - * Process the message based on its type - */ - switch(msg->sm_type) { - case SPANS_STAT_REQ: - spans_status_ind(spp, msg); - break; - case SPANS_STAT_IND: - spans_status_ind(spp, msg); - break; - case SPANS_STAT_RSP: - spans_status_rsp(spp, msg); - break; - case SPANS_OPEN_REQ: - spans_open_req(spp, msg); - break; - case SPANS_OPEN_IND: - spans_open_req(spp, msg); - break; - case SPANS_OPEN_RSP: - spans_open_rsp(spp, msg); - break; - case SPANS_OPEN_CNF: - spans_open_rsp(spp, msg); - break; - case SPANS_CLOSE_REQ: - spans_close_req(spp, msg); - break; - case SPANS_CLOSE_IND: - spans_close_req(spp, msg); - break; - case SPANS_CLOSE_RSP: - spans_close_rsp(spp, msg); - break; - case SPANS_CLOSE_CNF: - spans_close_rsp(spp, msg); - break; - case SPANS_RCLOSE_REQ: - spans_close_req(spp, msg); - break; - case SPANS_RCLOSE_IND: - spans_close_req(spp, msg); - break; - case SPANS_RCLOSE_RSP: - spans_close_rsp(spp, msg); - break; - case SPANS_RCLOSE_CNF: - spans_close_rsp(spp, msg); - break; - case SPANS_MULTI_REQ: - spans_multi_req(spp, msg); - break; - case SPANS_MULTI_IND: - spans_multi_req(spp, msg); - break; - case SPANS_MULTI_RSP: - log(LOG_ERR, - "spans: unexpected message (multi_rsp)\n"); - break; - case SPANS_MULTI_CNF: - log(LOG_ERR, - "spans: unexpected message (multi_conf)\n"); - break; - case SPANS_ADD_REQ: - spans_add_req(spp, msg); - break; - case SPANS_ADD_IND: - spans_add_req(spp, msg); - break; - case SPANS_ADD_RSP: - log(LOG_ERR, - "spans: unexpected message (add_rsp)\n"); - break; - case SPANS_ADD_CNF: - log(LOG_ERR, "spans: unexpected message (add_conf)\n"); - break; - case SPANS_JOIN_REQ: - spans_join_req(spp, msg); - break; - case SPANS_JOIN_CNF: - log(LOG_ERR, "spans: unexpected message (join_conf)\n"); - break; - case SPANS_LEAVE_REQ: - spans_leave_req(spp, msg); - break; - case SPANS_LEAVE_CNF: - log(LOG_ERR, - "spans: unexpected message (leave_conf)\n"); - break; - case SPANS_VCIR_IND: - spans_vcir_ind(spp, msg); - break; - case SPANS_QUERY_REQ: - spans_query_req(spp, msg); - break; - case SPANS_QUERY_RSP: - log(LOG_ERR, - "spans: unexpected message (query_rsp)\n"); - break; - default: - log(LOG_ERR, "spans: unknown SPANS message type %d\n", - msg->sm_type); - } - -done: - /* - * Free the incoming message (both buffer and internal format) if - * necessary. - */ - if (msg) - uma_zfree(spans_msg_zone, msg); - if (m) - KB_FREEALL(m); -} Property changes on: head/sys/netatm/spans/spans_msg.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_print.c =================================================================== --- head/sys/netatm/spans/spans_print.c (revision 179307) +++ head/sys/netatm/spans/spans_print.c (nonexistent) @@ -1,1094 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS Print Routines. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -/* - * If LONGPRINT is defined, every field of the SPANS message will be - * printed. If not, a shorter summary (useful for debugging without - * swamping the console) is printed. - */ -/* #define LONGPRINT */ - -/* - * Local functions - */ -static void spans_msgtype_str(spans_msgtype *, char *, int); -static void spans_print_msgbody(spans_msgbody *); -static void spans_result_str(spans_result *, char *, int); - -#ifdef LONGPRINT - -static void inc_indent(void); -static void dec_indent(void); -static void spans_aal_str(spans_aal *, char *, int); -static void spans_query_type_str(spans_query_type *, char *, int); -static void spans_state_str(spans_query_type *, char *, int); -static void spans_print_version(spans_version *); -static void spans_print_vpvc(spans_vpvc *); -static void spans_print_vpvc_pref(spans_vpvc_pref *); -static void spans_print_addr(spans_addr *); -static void spans_print_sap(spans_sap *); -static void spans_print_atm_conn(spans_atm_conn *); -static void spans_print_resrc(spans_resrc *); -static void spans_print_aal(spans_aal *); -static void spans_print_result(spans_result *); -static void spans_print_msgtype(spans_msgtype *); -static void spans_print_parm_stat_req(spans_parm_stat_req *); -static void spans_print_parm_stat_ind(spans_parm_stat_ind *); -static void spans_print_parm_stat_rsp(spans_parm_stat_rsp *); -static void spans_print_parm_open_req(spans_parm_open_req *); -static void spans_print_parm_open_ind(spans_parm_open_ind *); -static void spans_print_parm_open_rsp(spans_parm_open_rsp *); -static void spans_print_parm_open_cnf(spans_parm_open_cnf *); -static void spans_print_parm_close_req(spans_parm_close_req *); -static void spans_print_parm_close_ind(spans_parm_close_ind *); -static void spans_print_parm_close_rsp(spans_parm_close_rsp *); -static void spans_print_parm_close_cnf(spans_parm_close_cnf *); -static void spans_print_parm_rclose_req(spans_parm_rclose_req *); -static void spans_print_parm_rclose_ind(spans_parm_rclose_ind *); -static void spans_print_parm_rclose_rsp(spans_parm_rclose_rsp *); -static void spans_print_parm_rclose_cnf(spans_parm_rclose_cnf *); -static void spans_print_parm_multi_req(spans_parm_multi_req *); -static void spans_print_parm_multi_ind(spans_parm_multi_ind *); -static void spans_print_parm_multi_rsp(spans_parm_multi_rsp *); -static void spans_print_parm_multi_cnf(spans_parm_multi_cnf *); -static void spans_print_parm_add_req(spans_parm_add_req *); -static void spans_print_parm_add_ind(spans_parm_add_ind *); -static void spans_print_parm_add_rsp(spans_parm_add_rsp *); -static void spans_print_parm_add_cnf(spans_parm_add_cnf *); -static void spans_print_parm_join_req(spans_parm_join_req *); -static void spans_print_parm_join_cnf(spans_parm_join_cnf *); -static void spans_print_parm_leave_req(spans_parm_leave_req *); -static void spans_print_parm_leave_cnf(spans_parm_leave_cnf *); -static void spans_print_parm_vcir_ind(spans_parm_vcir_ind *); -static void spans_print_parm_query_req(spans_parm_query_req *); -static void spans_print_parm_query_rsp(spans_parm_query_rsp *); - - -/* - * Local variables - */ -#define MAX_INDENT 10 -#define INIT_INDENT &indent_str[MAX_INDENT] -static char *spans_indent; -static char indent_str[11] = " "; - -static void -inc_indent() -{ - if (spans_indent != &indent_str[0]) { - spans_indent--; - } -} - -static void -dec_indent() -{ - if (spans_indent != INIT_INDENT) { - spans_indent++; - } -} - -static void -spans_aal_str(objp, dest, len) - spans_aal *objp; - char *dest; - int len; -{ - static char *aal_names[] = { - "SPANS_AAL0", - "SPANS_AAL1", - "SPANS_AAL2", - "SPANS_AAL3", - "SPANS_AAL4", - "SPANS_AAL5" - }; - - if (*objp < SPANS_AAL0 || *objp > SPANS_AAL5) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); - } else { - snprintf(dest, len, "%s (%d)", aal_names[(int)*objp], - (int)*objp); - } -} - -#endif - -static void -spans_result_str(objp, dest, len) - spans_result *objp; - char *dest; - int len; -{ - static char *result_names[] = { - "SPANS_OK", - "SPANS_FAIL", - "SPANS_NOVPVC", - "SPANS_NORSC", - "SPANS_BADDEST" - }; - - if (*objp < SPANS_OK || *objp > SPANS_BADDEST) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); - } else { - snprintf(dest, len, "%s (%d)", - result_names[(int)*objp], (int)*objp); - } -} - -static void -spans_msgtype_str(objp, dest, len) - spans_msgtype *objp; - char *dest; - int len; -{ - int i; - - static struct { - spans_msgtype type; - char *name; - } msgtype_names[] = { - { SPANS_STAT_REQ, "SPANS_STAT_REQ" }, - { SPANS_STAT_IND, "SPANS_STAT_IND" }, - { SPANS_STAT_RSP, "SPANS_STAT_RSP" }, - { SPANS_OPEN_REQ, "SPANS_OPEN_REQ" }, - { SPANS_OPEN_IND, "SPANS_OPEN_IND" }, - { SPANS_OPEN_RSP, "SPANS_OPEN_RSP" }, - { SPANS_OPEN_CNF, "SPANS_OPEN_CNF" }, - { SPANS_CLOSE_REQ, "SPANS_CLOSE_REQ" }, - { SPANS_CLOSE_IND, "SPANS_CLOSE_IND" }, - { SPANS_CLOSE_RSP, "SPANS_CLOSE_RSP" }, - { SPANS_CLOSE_CNF, "SPANS_CLOSE_CNF" }, - { SPANS_RCLOSE_REQ, "SPANS_RCLOSE_REQ" }, - { SPANS_RCLOSE_IND, "SPANS_RCLOSE_IND" }, - { SPANS_RCLOSE_RSP, "SPANS_RCLOSE_RSP" }, - { SPANS_RCLOSE_CNF, "SPANS_RCLOSE_CNF" }, - { SPANS_MULTI_REQ, "SPANS_MULTI_REQ" }, - { SPANS_MULTI_IND, "SPANS_MULTI_IND" }, - { SPANS_MULTI_RSP, "SPANS_MULTI_RSP" }, - { SPANS_MULTI_CNF, "SPANS_MULTI_CNF" }, - { SPANS_ADD_REQ, "SPANS_ADD_REQ" }, - { SPANS_ADD_IND, "SPANS_ADD_IND" }, - { SPANS_ADD_RSP, "SPANS_ADD_RSP" }, - { SPANS_ADD_CNF, "SPANS_ADD_CNF" }, - { SPANS_JOIN_REQ, "SPANS_JOIN_REQ" }, - { SPANS_JOIN_CNF, "SPANS_JOIN_CNF" }, - { SPANS_LEAVE_REQ, "SPANS_LEAVE_REQ" }, - { SPANS_LEAVE_CNF, "SPANS_LEAVE_CNF" }, - { SPANS_VCIR_IND, "SPANS_VCIR_IND" }, - { SPANS_QUERY_REQ, "SPANS_QUERY_REQ" }, - { SPANS_QUERY_RSP, "SPANS_QUERY_RSP" }, - { 0, (char *) 0 } - }; - - /* - * Search the name table for the specified type - */ - for (i=0; msgtype_names[i].name; i++) { - if (*objp == msgtype_names[i].type) { - snprintf(dest, len, "%s (%d)", - msgtype_names[i].name, - (int)*objp); - return; - } - } - - /* - * Type was not found--return an error indicator - */ - snprintf(dest, len, "Invalid (%d)", (int)*objp); -} - -#ifdef LONGPRINT - -static void -spans_query_type_str(objp, dest, len) - spans_query_type *objp; - char *dest; - int len; -{ - static char *query_names[] = { - "SPANS_QUERY_NORMAL", - "SPANS_QUERY_DEBUG", - "SPANS_QUERY_END_TO_END" - }; - - if (*objp < SPANS_QUERY_NORMAL || - *objp > SPANS_QUERY_END_TO_END) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); - } else { - snprintf(dest, len, "%s (%d)", query_names[(int)*objp], - (int)*objp); - } -} - -static void -spans_state_str(objp, dest, len) - spans_query_type *objp; - char *dest; - int len; -{ - static char *state_names[] = { - "SPANS_CONN_OPEN", - "SPANS_CONN_OPEN_PEND", - "SPANS_CONN_CLOSE_PEND", - "SPANS_CONN_CLOSED" - }; - - if (*objp < SPANS_CONN_OPEN || *objp > SPANS_CONN_CLOSED) { - snprintf(dest, len, "Invalid (%d)", (int)*objp); - } else { - snprintf(dest, len, "%s (%d)", state_names[(int)*objp], - (int)*objp); - } -} - - -static void -spans_print_version(objp) - spans_version *objp; -{ - printf("%sspans_version 0x%x\n", spans_indent, *objp); -} - -static void -spans_print_vpvc(objp) - spans_vpvc *objp; -{ - printf("%sVP/VC %d/%d\n", spans_indent, - SPANS_EXTRACT_VPI(*objp), - SPANS_EXTRACT_VCI(*objp)); -} - -static void -spans_print_vpvc_pref(objp) - spans_vpvc_pref *objp; -{ - printf("%sspans_vpvc_pref\n", spans_indent); - inc_indent(); - printf("%s%s\n", spans_indent, - (objp->vpf_valid ? "Valid" : "Not valid")); - spans_print_vpvc(&objp->vpf_vpvc); - dec_indent(); -} - -static void -spans_print_addr(objp) - spans_addr *objp; -{ - char addr_str[80]; - - strncpy(addr_str, spans_addr_print(objp), sizeof(addr_str)); - printf("%sspans_addr %s\n", spans_indent, addr_str); -} - -static void -spans_print_sap(objp) - spans_sap *objp; -{ - printf("%sSAP %d\n", spans_indent, *objp); -} - -static void -spans_print_atm_conn(objp) - spans_atm_conn *objp; -{ - printf("%sspans_atm_conn\n", spans_indent); - inc_indent(); - spans_print_addr(&objp->con_dst); - spans_print_addr(&objp->con_src); - spans_print_sap(&objp->con_dsap); - spans_print_sap(&objp->con_ssap); - dec_indent(); -} - -static void -spans_print_resrc(objp) - spans_resrc *objp; -{ - printf("%sspans_resrc\n", spans_indent); - inc_indent(); - printf("%srsc_peak %d\n", spans_indent, objp->rsc_peak); - printf("%srsc_mean %d\n", spans_indent, objp->rsc_mean); - printf("%srsc_burst %d\n", spans_indent, objp->rsc_burst); - dec_indent(); -} - -static void -spans_print_aal(objp) - spans_aal *objp; -{ - char aal_str[80]; - - spans_aal_str(objp, aal_str, sizeof(aal_str)); - printf("%sspans_aal %s\n", spans_indent, aal_str); -} - -static void -spans_print_result(objp) - spans_result *objp; -{ - char result_str[80]; - - spans_result_str(objp, result_str, sizeof(result_str)); - printf("%sspans_result %s\n", spans_indent, result_str); -} - -static void -spans_print_msgtype(objp) - spans_msgtype *objp; -{ - char msgtype_str[80]; - - spans_msgtype_str(objp, msgtype_str, sizeof(msgtype_str)); - printf("%sspans_msgtype %s\n", spans_indent, msgtype_str); -} - -static void -spans_print_parm_stat_req(objp) - spans_parm_stat_req *objp; -{ - printf("%sspans_parm_stat_req\n", spans_indent); - inc_indent(); - printf("%sstreq_es_epoch %d\n", spans_indent, - objp->streq_es_epoch); - dec_indent(); -} - -static void -spans_print_parm_stat_ind(objp) - spans_parm_stat_ind *objp; -{ - printf("%sspans_parm_stat_ind\n", spans_indent); - inc_indent(); - printf("%sstind_sw_epoch %d\n", spans_indent, - objp->stind_sw_epoch); - spans_print_addr(&objp->stind_es_addr); - spans_print_addr(&objp->stind_sw_addr); - dec_indent(); -} - -static void -spans_print_parm_stat_rsp(objp) - spans_parm_stat_rsp *objp; -{ - printf("%sspans_parm_stat_rsp\n", spans_indent); - inc_indent(); - printf("%sstrsp_es_epoch %d\n", spans_indent, - objp->strsp_es_epoch); - spans_print_addr(&objp->strsp_es_addr); - dec_indent(); -} - -static void -spans_print_parm_open_req(objp) - spans_parm_open_req *objp; -{ - printf("%sspans_parm_open_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->opreq_conn); - spans_print_aal(&objp->opreq_aal); - spans_print_resrc(&objp->opreq_desrsrc); - spans_print_resrc(&objp->opreq_minrsrc); - spans_print_vpvc_pref(&objp->opreq_vpvc); - dec_indent(); -} - -static void -spans_print_parm_open_ind(objp) - spans_parm_open_ind *objp; -{ - printf("%sspans_parm_open_ind\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->opind_conn); - spans_print_aal(&objp->opind_aal); - spans_print_resrc(&objp->opind_desrsrc); - spans_print_resrc(&objp->opind_minrsrc); - spans_print_vpvc_pref(&objp->opind_vpvc); - dec_indent(); -} - -static void -spans_print_parm_open_rsp(objp) - spans_parm_open_rsp *objp; -{ - printf("%sspans_parm_open_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->oprsp_conn); - spans_print_result(&objp->oprsp_result); - spans_print_resrc(&objp->oprsp_rsrc); - spans_print_vpvc(&objp->oprsp_vpvc); - dec_indent(); -} - -static void -spans_print_parm_open_cnf(objp) - spans_parm_open_cnf *objp; -{ - printf("%sspans_parm_open_cnf\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->opcnf_conn); - spans_print_result(&objp->opcnf_result); - spans_print_resrc(&objp->opcnf_rsrc); - spans_print_vpvc(&objp->opcnf_vpvc); - dec_indent(); -} - -static void -spans_print_parm_close_req(objp) - spans_parm_close_req *objp; -{ - printf("%sspans_parm_close_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->clreq_conn); - dec_indent(); -} - -static void -spans_print_parm_close_ind(objp) - spans_parm_close_ind *objp; -{ - printf("%sspans_parm_close_ind\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->clind_conn); - dec_indent(); -} - -static void -spans_print_parm_close_rsp(objp) - spans_parm_close_rsp *objp; -{ - printf("%sspans_parm_close_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->clrsp_conn); - spans_print_result(&objp->clrsp_result); - dec_indent(); -} - -static void -spans_print_parm_close_cnf(objp) - spans_parm_close_cnf *objp; -{ - printf("%sspans_parm_close_cnf\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->clcnf_conn); - spans_print_result(&objp->clcnf_result); - dec_indent(); -} - -static void -spans_print_parm_rclose_req(objp) - spans_parm_rclose_req *objp; -{ - printf("%sspans_parm_rclose_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->rcreq_conn); - dec_indent(); -} - -static void -spans_print_parm_rclose_ind(objp) - spans_parm_rclose_ind *objp; -{ - printf("%sspans_parm_rclose_ind\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->rcind_conn); - dec_indent(); -} - -static void -spans_print_parm_rclose_rsp(objp) - spans_parm_rclose_rsp *objp; -{ - printf("%sspans_parm_rclose_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->rcrsp_conn); - spans_print_result(&objp->rcrsp_result); - dec_indent(); -} - -static void -spans_print_parm_rclose_cnf(objp) - spans_parm_rclose_cnf *objp; -{ - printf("%sspans_parm_rclose_cnf\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->rccnf_conn); - spans_print_result(&objp->rccnf_result); - dec_indent(); -} - -static void -spans_print_parm_multi_req(objp) - spans_parm_multi_req *objp; -{ - printf("%sspans_parm_multi_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->mureq_conn); - spans_print_aal(&objp->mureq_aal); - spans_print_resrc(&objp->mureq_desrsrc); - spans_print_resrc(&objp->mureq_minrsrc); - spans_print_vpvc(&objp->mureq_vpvc); - dec_indent(); -} - -static void -spans_print_parm_multi_ind(objp) - spans_parm_multi_ind *objp; -{ - printf("%sspans_parm_multi_ind\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->muind_conn); - spans_print_aal(&objp->muind_aal); - spans_print_resrc(&objp->muind_desrsrc); - spans_print_resrc(&objp->muind_minrsrc); - spans_print_vpvc(&objp->muind_vpvc); - dec_indent(); -} - -static void -spans_print_parm_multi_rsp(objp) - spans_parm_multi_rsp *objp; -{ - printf("%sspans_parm_multi_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->mursp_conn); - spans_print_result(&objp->mursp_result); - spans_print_resrc(&objp->mursp_rsrc); - spans_print_vpvc(&objp->mursp_vpvc); - dec_indent(); -} - -static void -spans_print_parm_multi_cnf(objp) - spans_parm_multi_cnf *objp; -{ - printf("%sspans_parm_multi_cnf\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->mucnf_conn); - spans_print_result(&objp->mucnf_result); - spans_print_resrc(&objp->mucnf_rsrc); - spans_print_vpvc(&objp->mucnf_vpvc); - dec_indent(); -} - -static void -spans_print_parm_add_req(objp) - spans_parm_add_req *objp; -{ - printf("%sspans_parm_add_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->adreq_desconn); - spans_print_atm_conn(&objp->adreq_xstconn); - dec_indent(); -} - -static void -spans_print_parm_add_ind(objp) - spans_parm_add_ind *objp; -{ - printf("%sspans_parm_add_ind\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->adind_desconn); - spans_print_atm_conn(&objp->adind_xstconn); - dec_indent(); -} - -static void -spans_print_parm_add_rsp(objp) - spans_parm_add_rsp *objp; -{ - printf("%sspans_parm_add_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->adrsp_conn); - spans_print_result(&objp->adrsp_result); - spans_print_resrc(&objp->adrsp_rsrc); - dec_indent(); -} - -static void -spans_print_parm_add_cnf(objp) - spans_parm_add_cnf *objp; -{ - printf("%sspans_parm_add_cnf\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->adcnf_conn); - spans_print_result(&objp->adcnf_result); - spans_print_resrc(&objp->adcnf_rsrc); - dec_indent(); -} - -static void -spans_print_parm_join_req(objp) - spans_parm_join_req *objp; -{ - printf("%sspans_parm_join_req\n", spans_indent); - inc_indent(); - spans_print_addr(&objp->jnreq_addr); - dec_indent(); -} - -static void -spans_print_parm_join_cnf(objp) - spans_parm_join_cnf *objp; -{ - printf("%sspans_print_parm_join_cnf\n", spans_indent); - inc_indent(); - spans_print_addr(&objp->jncnf_addr); - spans_print_result(&objp->jncnf_result); - dec_indent(); -} - -static void -spans_print_parm_leave_req(objp) - spans_parm_leave_req *objp; -{ - printf("%sspans_print_parm_leave_req\n", spans_indent); - inc_indent(); - spans_print_addr(&objp->lvreq_addr); - dec_indent(); -} - -static void -spans_print_parm_leave_cnf(objp) - spans_parm_leave_cnf *objp; -{ - printf("%sspans_parm_leave_cnf\n", spans_indent); - inc_indent(); - spans_print_addr(&objp->lvcnf_addr); - spans_print_result(&objp->lvcnf_result); - dec_indent(); -} - -static void -spans_print_parm_vcir_ind(objp) - spans_parm_vcir_ind *objp; -{ - printf("%sspans_parm_vcir_ind\n", spans_indent); - inc_indent(); - printf("%svrind_min %d\n", spans_indent, objp->vrind_min); - printf("%svrind_max %d\n", spans_indent, objp->vrind_max); - dec_indent(); -} - -static void -spans_print_parm_query_req(objp) - spans_parm_query_req *objp; -{ - char query_type_str[80]; - - printf("%sspans_parm_query_req\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->qyreq_conn); - spans_query_type_str(&objp->qyreq_type, - query_type_str, sizeof(query_type_str)); - printf("%sqyreq_type %s\n", spans_indent, query_type_str); - dec_indent(); -} - -static void -spans_print_parm_query_rsp(objp) - spans_parm_query_rsp *objp; -{ - char query_type_str[80], state_type_str[80]; - - printf("%sspans_parm_query_rsp\n", spans_indent); - inc_indent(); - spans_print_atm_conn(&objp->qyrsp_conn); - spans_query_type_str(&objp->qyrsp_type, - query_type_str, sizeof(query_type_str)); - printf("%sqyrsp_type %s\n", spans_indent, query_type_str); - spans_state_str(&objp->qyrsp_state, - state_type_str, sizeof(state_type_str)); - printf("%sqyrsp_state %s\n", spans_indent, state_type_str); - printf("%sqyrsp_data 0x%x\n", spans_indent, - objp->qyrsp_data); - dec_indent(); -} - -static void -spans_print_msgbody(objp) - spans_msgbody *objp; -{ - printf("%sspans_msgbody\n", spans_indent); - inc_indent(); - spans_print_msgtype(&objp->mb_type); - switch (objp->mb_type) { - case SPANS_STAT_REQ: - spans_print_parm_stat_req(&objp->spans_msgbody_u.mb_stat_req); - break; - case SPANS_STAT_IND: - spans_print_parm_stat_ind(&objp->spans_msgbody_u.mb_stat_ind); - break; - case SPANS_STAT_RSP: - spans_print_parm_stat_rsp(&objp->spans_msgbody_u.mb_stat_rsp); - break; - case SPANS_OPEN_REQ: - spans_print_parm_open_req(&objp->spans_msgbody_u.mb_open_req); - break; - case SPANS_OPEN_IND: - spans_print_parm_open_ind(&objp->spans_msgbody_u.mb_open_ind); - break; - case SPANS_OPEN_RSP: - spans_print_parm_open_rsp(&objp->spans_msgbody_u.mb_open_rsp); - break; - case SPANS_OPEN_CNF: - spans_print_parm_open_cnf(&objp->spans_msgbody_u.mb_open_cnf); - break; - case SPANS_CLOSE_REQ: - spans_print_parm_close_req(&objp->spans_msgbody_u.mb_close_req); - break; - case SPANS_CLOSE_IND: - spans_print_parm_close_ind(&objp->spans_msgbody_u.mb_close_ind); - break; - case SPANS_CLOSE_RSP: - spans_print_parm_close_rsp(&objp->spans_msgbody_u.mb_close_rsp); - break; - case SPANS_CLOSE_CNF: - spans_print_parm_close_cnf(&objp->spans_msgbody_u.mb_close_cnf); - break; - case SPANS_RCLOSE_REQ: - spans_print_parm_rclose_req(&objp->spans_msgbody_u.mb_rclose_req); - break; - case SPANS_RCLOSE_IND: - spans_print_parm_rclose_ind(&objp->spans_msgbody_u.mb_rclose_ind); - break; - case SPANS_RCLOSE_RSP: - spans_print_parm_rclose_rsp(&objp->spans_msgbody_u.mb_rclose_rsp); - break; - case SPANS_RCLOSE_CNF: - spans_print_parm_rclose_cnf(&objp->spans_msgbody_u.mb_rclose_cnf); - break; - case SPANS_MULTI_REQ: - spans_print_parm_multi_req(&objp->spans_msgbody_u.mb_multi_req); - break; - case SPANS_MULTI_IND: - spans_print_parm_multi_ind(&objp->spans_msgbody_u.mb_multi_ind); - break; - case SPANS_MULTI_RSP: - spans_print_parm_multi_rsp(&objp->spans_msgbody_u.mb_multi_rsp); - break; - case SPANS_MULTI_CNF: - spans_print_parm_multi_cnf(&objp->spans_msgbody_u.mb_multi_cnf); - break; - case SPANS_ADD_REQ: - spans_print_parm_add_req(&objp->spans_msgbody_u.mb_add_req); - break; - case SPANS_ADD_IND: - spans_print_parm_add_ind(&objp->spans_msgbody_u.mb_add_ind); - break; - case SPANS_ADD_RSP: - spans_print_parm_add_rsp(&objp->spans_msgbody_u.mb_add_rsp); - break; - case SPANS_ADD_CNF: - spans_print_parm_add_cnf(&objp->spans_msgbody_u.mb_add_cnf); - break; - case SPANS_JOIN_REQ: - spans_print_parm_join_req(&objp->spans_msgbody_u.mb_join_req); - break; - case SPANS_JOIN_CNF: - spans_print_parm_join_cnf(&objp->spans_msgbody_u.mb_join_cnf); - break; - case SPANS_LEAVE_REQ: - spans_print_parm_leave_req(&objp->spans_msgbody_u.mb_leave_req); - break; - case SPANS_LEAVE_CNF: - spans_print_parm_leave_cnf(&objp->spans_msgbody_u.mb_leave_cnf); - break; - case SPANS_VCIR_IND: - spans_print_parm_vcir_ind(&objp->spans_msgbody_u.mb_vcir_ind); - break; - case SPANS_QUERY_REQ: - spans_print_parm_query_req(&objp->spans_msgbody_u.mb_query_req); - break; - case SPANS_QUERY_RSP: - spans_print_parm_query_rsp(&objp->spans_msgbody_u.mb_query_rsp); - break; - } - dec_indent(); -} - -void -spans_print_msg(objp) - spans_msg *objp; -{ - spans_indent = INIT_INDENT; - printf("%sspans_msg\n", spans_indent); - inc_indent(); - spans_print_version(&objp->sm_vers); - spans_print_msgbody(&objp->sm_body); - dec_indent(); -} - -#else /* ifdef LONGPRINT */ - -static void -spans_print_msgbody(objp) - spans_msgbody *objp; -{ - char daddr[80], msgtype_str[80], result_str[80], saddr[80]; - spans_parm_stat_req *streq_p; - spans_parm_stat_ind *stind_p; - spans_parm_stat_rsp *strsp_p; - spans_parm_open_req *opreq_p; - spans_parm_open_ind *opind_p; - spans_parm_open_rsp *oprsp_p; - spans_parm_open_cnf *opcnf_p; - spans_parm_close_req *clreq_p; - spans_parm_close_ind *clind_p; - spans_parm_close_rsp *clrsp_p; - spans_parm_close_cnf *clcnf_p; - spans_parm_rclose_req *rcreq_p; - spans_parm_rclose_ind *rcind_p; - spans_parm_rclose_rsp *rcrsp_p; - spans_parm_rclose_cnf *rccnf_p; - - spans_msgtype_str(&objp->mb_type, msgtype_str, sizeof(msgtype_str)); - printf("%s: ", msgtype_str); - switch (objp->mb_type) { - case SPANS_STAT_REQ: - streq_p = &objp->spans_msgbody_u.mb_stat_req; - printf("es_epoch=0x%lx", streq_p->streq_es_epoch); - break; - case SPANS_STAT_IND: - stind_p = &objp->spans_msgbody_u.mb_stat_ind; - strncpy(daddr, spans_addr_print(&stind_p->stind_es_addr), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&stind_p->stind_sw_addr), - sizeof(saddr)); - printf("sw_epoch=0x%lx, es_addr=%s, sw_addr=0x%s", - stind_p->stind_sw_epoch, - daddr, saddr); - break; - case SPANS_STAT_RSP: - strsp_p = &objp->spans_msgbody_u.mb_stat_rsp; - strncpy(daddr, spans_addr_print(&strsp_p->strsp_es_addr), - sizeof(daddr)); - printf("es_epoch=0x%lx, es_addr=%s", - strsp_p->strsp_es_epoch, daddr); - break; - case SPANS_OPEN_REQ: - opreq_p = &objp->spans_msgbody_u.mb_open_req; - strncpy(daddr, spans_addr_print(&opreq_p->opreq_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&opreq_p->opreq_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d, aal=%d", - daddr, saddr, - opreq_p->opreq_conn.con_dsap, - opreq_p->opreq_conn.con_ssap, - opreq_p->opreq_aal); - if (opreq_p->opreq_vpvc.vpf_valid) - printf(", vp.vc=%d.%d", - SPANS_EXTRACT_VPI(opreq_p->opreq_vpvc.vpf_vpvc), - SPANS_EXTRACT_VCI(opreq_p->opreq_vpvc.vpf_vpvc)); - break; - case SPANS_OPEN_IND: - opind_p = &objp->spans_msgbody_u.mb_open_ind; - strncpy(daddr, spans_addr_print(&opind_p->opind_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&opind_p->opind_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d, aal=%d", - daddr, saddr, - opind_p->opind_conn.con_dsap, - opind_p->opind_conn.con_ssap, - opind_p->opind_aal); - if (opind_p->opind_vpvc.vpf_valid) - printf(", vp.vc=%d.%d", - SPANS_EXTRACT_VPI(opind_p->opind_vpvc.vpf_vpvc), - SPANS_EXTRACT_VCI(opind_p->opind_vpvc.vpf_vpvc)); - break; - case SPANS_OPEN_RSP: - oprsp_p = &objp->spans_msgbody_u.mb_open_rsp; - strncpy(daddr, spans_addr_print(&oprsp_p->oprsp_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&oprsp_p->oprsp_conn.con_src), - sizeof(saddr)); - spans_result_str(&oprsp_p->oprsp_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d", - result_str, daddr, saddr, - oprsp_p->oprsp_conn.con_dsap, - oprsp_p->oprsp_conn.con_ssap, - SPANS_EXTRACT_VPI(oprsp_p->oprsp_vpvc), - SPANS_EXTRACT_VCI(oprsp_p->oprsp_vpvc)); - break; - case SPANS_OPEN_CNF: - opcnf_p = &objp->spans_msgbody_u.mb_open_cnf; - strncpy(daddr, spans_addr_print(&opcnf_p->opcnf_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&opcnf_p->opcnf_conn.con_src), - sizeof(saddr)); - spans_result_str(&opcnf_p->opcnf_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d, vp.vc=%d.%d", - result_str, daddr, saddr, - opcnf_p->opcnf_conn.con_dsap, - opcnf_p->opcnf_conn.con_ssap, - SPANS_EXTRACT_VPI(opcnf_p->opcnf_vpvc), - SPANS_EXTRACT_VCI(opcnf_p->opcnf_vpvc)); - break; - case SPANS_CLOSE_REQ: - clreq_p = &objp->spans_msgbody_u.mb_close_req; - strncpy(daddr, spans_addr_print(&clreq_p->clreq_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&clreq_p->clreq_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d", - daddr, saddr, - clreq_p->clreq_conn.con_dsap, - clreq_p->clreq_conn.con_ssap); - break; - case SPANS_CLOSE_IND: - clind_p = &objp->spans_msgbody_u.mb_close_ind; - strncpy(daddr, spans_addr_print(&clind_p->clind_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&clind_p->clind_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d", - daddr, saddr, - clind_p->clind_conn.con_dsap, - clind_p->clind_conn.con_ssap); - break; - case SPANS_CLOSE_RSP: - clrsp_p = &objp->spans_msgbody_u.mb_close_rsp; - strncpy(daddr, spans_addr_print(&clrsp_p->clrsp_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&clrsp_p->clrsp_conn.con_src), - sizeof(saddr)); - spans_result_str(&clrsp_p->clrsp_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d", - result_str, daddr, saddr, - clrsp_p->clrsp_conn.con_dsap, - clrsp_p->clrsp_conn.con_ssap); - break; - case SPANS_CLOSE_CNF: - clcnf_p = &objp->spans_msgbody_u.mb_close_cnf; - strncpy(daddr, spans_addr_print(&clcnf_p->clcnf_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&clcnf_p->clcnf_conn.con_src), - sizeof(saddr)); - spans_result_str(&clcnf_p->clcnf_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d", - result_str, daddr, saddr, - clcnf_p->clcnf_conn.con_dsap, - clcnf_p->clcnf_conn.con_ssap); - break; - case SPANS_RCLOSE_REQ: - rcreq_p = &objp->spans_msgbody_u.mb_rclose_req; - strncpy(daddr, spans_addr_print(&rcreq_p->rcreq_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&rcreq_p->rcreq_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d", - daddr, saddr, - rcreq_p->rcreq_conn.con_dsap, - rcreq_p->rcreq_conn.con_ssap); - break; - case SPANS_RCLOSE_IND: - rcind_p = &objp->spans_msgbody_u.mb_rclose_ind; - strncpy(daddr, spans_addr_print(&rcind_p->rcind_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&rcind_p->rcind_conn.con_src), - sizeof(saddr)); - printf("daddr=%s, saddr=%s, dsap=%d, ssap=%d", - daddr, saddr, - rcind_p->rcind_conn.con_dsap, - rcind_p->rcind_conn.con_ssap); - break; - case SPANS_RCLOSE_RSP: - rcrsp_p = &objp->spans_msgbody_u.mb_rclose_rsp; - strncpy(daddr, spans_addr_print(&rcrsp_p->rcrsp_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&rcrsp_p->rcrsp_conn.con_src), - sizeof(saddr)); - spans_result_str(&rcrsp_p->rcrsp_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d", - result_str, daddr, saddr, - rcrsp_p->rcrsp_conn.con_dsap, - rcrsp_p->rcrsp_conn.con_ssap); - break; - case SPANS_RCLOSE_CNF: - rccnf_p = &objp->spans_msgbody_u.mb_rclose_cnf; - strncpy(daddr, spans_addr_print(&rccnf_p->rccnf_conn.con_dst), - sizeof(daddr)); - strncpy(saddr, spans_addr_print(&rccnf_p->rccnf_conn.con_src), - sizeof(saddr)); - spans_result_str(&rccnf_p->rccnf_result, result_str, - sizeof(result_str)); - printf("result=%s, daddr=%s, saddr=%s, dsap=%d, ssap=%d", - result_str, daddr, saddr, - rccnf_p->rccnf_conn.con_dsap, - rccnf_p->rccnf_conn.con_ssap); - break; - default: - break; - } - printf("\n"); -} - -void -spans_print_msg(objp) - spans_msg *objp; -{ -#ifdef LONGPRINT - spans_indent = INIT_INDENT; -#endif - spans_print_msgbody(&objp->sm_body); -} - -#endif /* ifdef LONGPRINT */ Property changes on: head/sys/netatm/spans/spans_print.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_kxdr.c =================================================================== --- head/sys/netatm/spans/spans_kxdr.c (revision 179307) +++ head/sys/netatm/spans/spans_kxdr.c (nonexistent) @@ -1,673 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * Kernel XDR (External Data Representation) routines - */ - -#include -#include -#include -#include -#include - -/* - * This file contains code that has been copied and/or modified from - * the following FreeBSD files: - * - * /usr/src/lib/libc/xdr/xdr.c - * /usr/src/lib/libc/xdr/xdr_mem.c - * - * which are covered by the copyright notice below. - */ - -/* - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#if defined(LIBC_SCCS) && !defined(lint) -/*static char *sccsid = "from: @(#)xdr.c 1.35 87/08/12";*/ -/*static char *sccsid = "from: @(#)xdr.c 2.1 88/07/29 4.0 RPCSRC";*/ -#endif -#include -__FBSDID("$FreeBSD$"); - -/* - * xdr.c, Generic XDR routines implementation. - * - * Copyright (C) 1986, Sun Microsystems, Inc. - * - * These are the "generic" xdr routines used to serialize and de-serialize - * most common data items. See xdr.h for more info on the interface to - * xdr. - */ - -#include - -/* - * constants specific to the xdr "protocol" - */ -#define XDR_FALSE ((long) 0) -#define XDR_TRUE ((long) 1) -#define LASTUNSIGNED ((u_int) 0-1) - -/* - * for unit alignment - */ -static char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 }; - -/* - * XDR integers - */ -bool_t -xdr_int(xdrs, ip) - XDR *xdrs; - int *ip; -{ - -#ifdef lint - (void) (xdr_short(xdrs, (short *)ip)); - return (xdr_long(xdrs, (long *)ip)); -#else - if (sizeof (int) == sizeof (long)) { - return (xdr_long(xdrs, (long *)ip)); - } else { - return (xdr_short(xdrs, (short *)ip)); - } -#endif -} - -/* - * XDR unsigned integers - */ -bool_t -xdr_u_int(xdrs, up) - XDR *xdrs; - u_int *up; -{ - -#ifdef lint - (void) (xdr_short(xdrs, (short *)up)); - return (xdr_u_long(xdrs, (u_long *)up)); -#else - if (sizeof (u_int) == sizeof (u_long)) { - return (xdr_u_long(xdrs, (u_long *)up)); - } else { - return (xdr_short(xdrs, (short *)up)); - } -#endif -} - -/* - * XDR long integers - * same as xdr_u_long - open coded to save a proc call! - */ -bool_t -xdr_long(xdrs, lp) - register XDR *xdrs; - long *lp; -{ - - if (xdrs->x_op == XDR_ENCODE) - return (XDR_PUTLONG(xdrs, lp)); - - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETLONG(xdrs, lp)); - - if (xdrs->x_op == XDR_FREE) - return (TRUE); - - return (FALSE); -} - -/* - * XDR unsigned long integers - * same as xdr_long - open coded to save a proc call! - */ -bool_t -xdr_u_long(xdrs, ulp) - register XDR *xdrs; - u_long *ulp; -{ - - if (xdrs->x_op == XDR_DECODE) - return (XDR_GETLONG(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_ENCODE) - return (XDR_PUTLONG(xdrs, (long *)ulp)); - if (xdrs->x_op == XDR_FREE) - return (TRUE); - return (FALSE); -} - -/* - * XDR short integers - */ -bool_t -xdr_short(xdrs, sp) - register XDR *xdrs; - short *sp; -{ - long l; - - switch (xdrs->x_op) { - - case XDR_ENCODE: - l = (long) *sp; - return (XDR_PUTLONG(xdrs, &l)); - - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &l)) { - return (FALSE); - } - *sp = (short) l; - return (TRUE); - - case XDR_FREE: - return (TRUE); - } - return (FALSE); -} - -/* - * XDR unsigned short integers - */ -bool_t -xdr_u_short(xdrs, usp) - register XDR *xdrs; - u_short *usp; -{ - u_long l; - - switch (xdrs->x_op) { - - case XDR_ENCODE: - l = (u_long) *usp; - return (XDR_PUTLONG(xdrs, &l)); - - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &l)) { - return (FALSE); - } - *usp = (u_short) l; - return (TRUE); - - case XDR_FREE: - return (TRUE); - } - return (FALSE); -} - - -/* - * XDR a char - */ -bool_t -xdr_char(xdrs, cp) - XDR *xdrs; - char *cp; -{ - int i; - - i = (*cp); - if (!xdr_int(xdrs, &i)) { - return (FALSE); - } - *cp = i; - return (TRUE); -} - -/* - * XDR an unsigned char - */ -bool_t -xdr_u_char(xdrs, cp) - XDR *xdrs; - u_char *cp; -{ - u_int u; - - u = (*cp); - if (!xdr_u_int(xdrs, &u)) { - return (FALSE); - } - *cp = u; - return (TRUE); -} - -/* - * XDR booleans - */ -bool_t -xdr_bool(xdrs, bp) - register XDR *xdrs; - bool_t *bp; -{ - long lb; - - switch (xdrs->x_op) { - - case XDR_ENCODE: - lb = *bp ? XDR_TRUE : XDR_FALSE; - return (XDR_PUTLONG(xdrs, &lb)); - - case XDR_DECODE: - if (!XDR_GETLONG(xdrs, &lb)) { - return (FALSE); - } - *bp = (lb == XDR_FALSE) ? FALSE : TRUE; - return (TRUE); - - case XDR_FREE: - return (TRUE); - } - return (FALSE); -} - -/* - * XDR enumerations - */ -bool_t -xdr_enum(xdrs, ep) - XDR *xdrs; - enum_t *ep; -{ -#ifndef lint - enum sizecheck { SIZEVAL }; /* used to find the size of an enum */ - - /* - * enums are treated as ints - */ - if (sizeof (enum sizecheck) == sizeof (long)) { - return (xdr_long(xdrs, (long *)ep)); - } else if (sizeof (enum sizecheck) == sizeof (short)) { - return (xdr_short(xdrs, (short *)ep)); - } else { - return (FALSE); - } -#else - (void) (xdr_short(xdrs, (short *)ep)); - return (xdr_long(xdrs, (long *)ep)); -#endif -} - -/* - * XDR opaque data - * Allows the specification of a fixed size sequence of opaque bytes. - * cp points to the opaque object and cnt gives the byte length. - */ -bool_t -xdr_opaque(xdrs, cp, cnt) - register XDR *xdrs; - caddr_t cp; - register u_int cnt; -{ - register u_int rndup; - static char crud[BYTES_PER_XDR_UNIT]; - - /* - * if no data we are done - */ - if (cnt == 0) - return (TRUE); - - /* - * round byte count to full xdr units - */ - rndup = cnt % BYTES_PER_XDR_UNIT; - if (rndup > 0) - rndup = BYTES_PER_XDR_UNIT - rndup; - - if (xdrs->x_op == XDR_DECODE) { - if (!XDR_GETBYTES(xdrs, cp, cnt)) { - return (FALSE); - } - if (rndup == 0) - return (TRUE); - return (XDR_GETBYTES(xdrs, crud, rndup)); - } - - if (xdrs->x_op == XDR_ENCODE) { - if (!XDR_PUTBYTES(xdrs, cp, cnt)) { - return (FALSE); - } - if (rndup == 0) - return (TRUE); - return (XDR_PUTBYTES(xdrs, xdr_zero, rndup)); - } - - if (xdrs->x_op == XDR_FREE) { - return (TRUE); - } - - return (FALSE); -} - - -/* - * XDR implementation using kernel buffers - */ - -#if defined(LIBC_SCCS) && !defined(lint) -/*static char *sccsid = "from: @(#)xdr_mem.c 1.19 87/08/11 Copyr 1984 Sun Micro";*/ -/*static char *sccsid = "from: @(#)xdr_mem.c 2.1 88/07/29 4.0 RPCSRC";*/ -#endif - -/* - * xdr_mem.h, XDR implementation using memory buffers. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - * - * If you have some data to be interpreted as external data representation - * or to be converted to external data representation in a memory buffer, - * then this is the package for you. - * - */ - - -void xdrmbuf_init(XDR *, KBuffer *, enum xdr_op); -static bool_t xdrmbuf_getlong(XDR *, long *); -static bool_t xdrmbuf_putlong(XDR *, const long *); -static bool_t xdrmbuf_getbytes(XDR *, char *, u_int); -static bool_t xdrmbuf_putbytes(XDR *, const char *, u_int); -static u_int xdrmbuf_getpos(XDR *); - -static struct xdr_ops xdrmbuf_ops = { - xdrmbuf_getlong, - xdrmbuf_putlong, - xdrmbuf_getbytes, - xdrmbuf_putbytes, - xdrmbuf_getpos, - NULL, - NULL, - NULL -}; - -/* - * The procedure xdrmbuf_init initializes a stream descriptor for a - * kernel buffer. - */ -void -xdrmbuf_init(xdrs, m, op) - register XDR *xdrs; - KBuffer *m; - enum xdr_op op; -{ - - xdrs->x_op = op; - xdrs->x_ops = &xdrmbuf_ops; - xdrs->x_base = (caddr_t)m; - KB_DATASTART(m, xdrs->x_private, caddr_t); - xdrs->x_handy = KB_LEN(m); -} - -static bool_t -xdrmbuf_getlong(xdrs, lp) - register XDR *xdrs; - long *lp; -{ - - /* - * See if long is contained in this buffer - */ - if ((xdrs->x_handy -= sizeof(long)) < 0) { - register KBuffer *m; - - /* - * We (currently) don't allow a long to span a buffer - */ - if (xdrs->x_handy != -sizeof(long)) { - printf("xdrmbuf_getlong: data spans buffers\n"); - return (FALSE); - } - - /* - * Try to move to a chained buffer - */ - if ((m = (KBuffer *)(xdrs->x_base)) != NULL) { - m = KB_NEXT(m); - xdrs->x_base = (caddr_t)m; - } - if (m) { - /* - * Setup new buffer's info - */ - KB_DATASTART(m, xdrs->x_private, caddr_t); - if ((xdrs->x_handy = KB_LEN(m) - sizeof(long)) < 0) { - printf("xdrmbuf_getlong: short buffer\n"); - return (FALSE); - } - } else { - /* - * No more buffers - */ - return (FALSE); - } - } - - /* - * Return the long value - */ - *lp = (long)ntohl((u_long)(*((long *)(xdrs->x_private)))); - - /* - * Advance the data stream - */ - xdrs->x_private = (long *)xdrs->x_private + 1; - return (TRUE); -} - -static bool_t -xdrmbuf_putlong(xdrs, lp) - register XDR *xdrs; - const long *lp; -{ - - /* - * See if long will fit in this buffer - */ - if ((xdrs->x_handy -= sizeof(long)) < 0) { - register KBuffer *m; - - /* - * We (currently) don't allow a long to span a buffer - */ - if (xdrs->x_handy != -sizeof(long)) { - printf("xdrmbuf_putlong: data spans buffers\n"); - return (FALSE); - } - - /* - * Try to move to a chained buffer - */ - if ((m = (KBuffer *)(xdrs->x_base)) != NULL) { - m = KB_NEXT(m); - xdrs->x_base = (caddr_t)m; - } - if (m) { - /* - * Setup new buffer's info - */ - KB_DATASTART(m, xdrs->x_private, caddr_t); - if ((xdrs->x_handy = KB_LEN(m) - sizeof(long)) < 0) { - printf("xdrmbuf_putlong: short buffer\n"); - return (FALSE); - } - } else { - /* - * No more buffers - */ - return (FALSE); - } - } - - /* - * Store the long value into our buffer - */ - *(long *)xdrs->x_private = (long)htonl((u_long)(*lp)); - - /* - * Advance the data stream - */ - xdrs->x_private = (long *)xdrs->x_private + 1; - return (TRUE); -} - -static bool_t -xdrmbuf_getbytes(xdrs, addr, len) - register XDR *xdrs; - caddr_t addr; - register u_int len; -{ - - while (len > 0) { - u_int copy; - - if (xdrs->x_handy <= 0) { - register KBuffer *m; - - /* - * No data in current buffer, move to a chained buffer - */ - if ((m = (KBuffer *)(xdrs->x_base)) != NULL) { - m = KB_NEXT(m); - xdrs->x_base = (caddr_t)m; - } - if (m) { - /* - * Setup new buffer's info - */ - KB_DATASTART(m, xdrs->x_private, caddr_t); - xdrs->x_handy = KB_LEN(m); - } else { - /* - * No more buffers - */ - return (FALSE); - } - } - - /* - * Copy from buffer to user's space - */ - copy = MIN(len, xdrs->x_handy); - bcopy(xdrs->x_private, addr, copy); - - /* - * Update data stream controls - */ - xdrs->x_private = (char *)xdrs->x_private + copy; - xdrs->x_handy -= copy; - addr += copy; - len -= copy; - } - return (TRUE); -} - -static bool_t -xdrmbuf_putbytes(xdrs, addr, len) - register XDR *xdrs; - const char *addr; - register u_int len; -{ - - while (len > 0) { - u_int copy; - - if (xdrs->x_handy <= 0) { - register KBuffer *m; - - /* - * No data in current buffer, move to a chained buffer - */ - if ((m = (KBuffer *)(xdrs->x_base)) != NULL) { - m = KB_NEXT(m); - xdrs->x_base = (caddr_t)m; - } - if (m) { - /* - * Setup new buffer's info - */ - KB_DATASTART(m, xdrs->x_private, caddr_t); - xdrs->x_handy = KB_LEN(m); - } else { - /* - * No more buffers - */ - return (FALSE); - } - } - - /* - * Copy from user's space into buffer - */ - copy = MIN(len, xdrs->x_handy); - bcopy(addr, xdrs->x_private, copy); - - /* - * Update data stream controls - */ - xdrs->x_private = (char *)xdrs->x_private + 1; /*XXXKAN:copy? */ - xdrs->x_handy -= copy; - addr += copy; - len -= copy; - } - return (TRUE); -} - -static u_int -xdrmbuf_getpos(xdrs) - register XDR *xdrs; -{ - - return ((uintptr_t)xdrs->x_private - (uintptr_t)xdrs->x_base); -} Property changes on: head/sys/netatm/spans/spans_kxdr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_kxdr.h =================================================================== --- head/sys/netatm/spans/spans_kxdr.h (revision 179307) +++ head/sys/netatm/spans/spans_kxdr.h (nonexistent) @@ -1,379 +0,0 @@ -/* $NetBSD: types.h,v 1.13 2000/06/13 01:02:44 thorpej Exp $ */ -/* $NetBSD: xdr.h,v 1.19 2000/07/17 05:00:45 matt Exp $ */ - -/*- - * Sun RPC is a product of Sun Microsystems, Inc. and is provided for - * unrestricted use provided that this legend is included on all tape - * media and as a part of the software program in whole or part. Users - * may copy or modify Sun RPC without charge, but are not authorized - * to license or distribute it to anyone else except as part of a product or - * program developed by the user. - * - * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE - * Sun RPC is provided with no support and without any obligation on the - * part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - * - * from: @(#)types.h 1.18 87/07/24 SMI - * from: @(#)types.h 2.3 88/08/15 4.0 RPCSRC - * from: @(#)xdr.h 1.19 87/04/22 SMI - * from: @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC - * $FreeBSD$ - */ - -#ifndef _SPANS_KXDR_H -#define _SPANS_KXDR_H - -/* - * Rpc additions to - */ -#include - -typedef int32_t bool_t; -typedef int32_t enum_t; - -typedef u_int32_t rpcprog_t; -typedef u_int32_t rpcvers_t; -typedef u_int32_t rpcproc_t; -typedef u_int32_t rpcprot_t; -typedef u_int32_t rpcport_t; -typedef int32_t rpc_inline_t; - -#define __dontcare__ -1 - -#ifndef FALSE -# define FALSE (0) -#endif -#ifndef TRUE -# define TRUE (1) -#endif -#ifndef NULL -# define NULL 0 -#endif - -/* - * xdr.h, External Data Representation Serialization Routines. - * - * Copyright (C) 1984, Sun Microsystems, Inc. - */ - -/* - * XDR provides a conventional way for converting between C data - * types and an external bit-string representation. Library supplied - * routines provide for the conversion on built-in C data types. These - * routines and utility routines defined here are used to help implement - * a type encode/decode routine for each user-defined type. - * - * Each data type provides a single procedure which takes two arguments: - * - * bool_t - * xdrproc(xdrs, argresp) - * XDR *xdrs; - * *argresp; - * - * xdrs is an instance of a XDR handle, to which or from which the data - * type is to be converted. argresp is a pointer to the structure to be - * converted. The XDR handle contains an operation field which indicates - * which of the operations (ENCODE, DECODE * or FREE) is to be performed. - * - * XDR_DECODE may allocate space if the pointer argresp is null. This - * data can be freed with the XDR_FREE operation. - * - * We write only one procedure per data type to make it easy - * to keep the encode and decode procedures for a data type consistent. - * In many cases the same code performs all operations on a user defined type, - * because all the hard work is done in the component type routines. - * decode as a series of calls on the nested data types. - */ - -/* - * Xdr operations. XDR_ENCODE causes the type to be encoded into the - * stream. XDR_DECODE causes the type to be extracted from the stream. - * XDR_FREE can be used to release the space allocated by an XDR_DECODE - * request. - */ -enum xdr_op { - XDR_ENCODE=0, - XDR_DECODE=1, - XDR_FREE=2 -}; - -/* - * This is the number of bytes per unit of external data. - */ -#define BYTES_PER_XDR_UNIT (4) -#define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \ - * BYTES_PER_XDR_UNIT) - -/* - * The XDR handle. - * Contains operation which is being applied to the stream, - * an operations vector for the particular implementation (e.g. see xdr_mem.c), - * and two private fields for the use of the particular implementation. - */ -typedef struct __rpc_xdr { - enum xdr_op x_op; /* operation; fast additional param */ - const struct xdr_ops { - /* get a long from underlying stream */ - bool_t (*x_getlong)(struct __rpc_xdr *, long *); - /* put a long to " */ - bool_t (*x_putlong)(struct __rpc_xdr *, const long *); - /* get some bytes from " */ - bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int); - /* put some bytes to " */ - bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int); - /* returns bytes off from beginning */ - u_int (*x_getpostn)(struct __rpc_xdr *); - /* lets you reposition the stream */ - bool_t (*x_setpostn)(struct __rpc_xdr *, u_int); - /* buf quick ptr to buffered data */ - int32_t *(*x_inline)(struct __rpc_xdr *, u_int); - /* free privates of this xdr_stream */ - void (*x_destroy)(struct __rpc_xdr *); - bool_t (*x_control)(struct __rpc_xdr *, int, void *); - } *x_ops; - char * x_public; /* users' data */ - void * x_private; /* pointer to private data */ - char * x_base; /* private used for position info */ - int x_handy; /* extra private word */ -} XDR; - -/* - * A xdrproc_t exists for each data type which is to be encoded or decoded. - * - * The second argument to the xdrproc_t is a pointer to an opaque pointer. - * The opaque pointer generally points to a structure of the data type - * to be decoded. If this pointer is 0, then the type routines should - * allocate dynamic storage of the appropriate size and return it. - */ -typedef bool_t (*xdrproc_t)(XDR *, void *, u_int); - -/* - * Operations defined on a XDR handle - * - * XDR *xdrs; - * long *longp; - * char * addr; - * u_int len; - * u_int pos; - */ -#define XDR_GETLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) -#define xdr_getlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_getlong)(xdrs, longp) - -#define XDR_PUTLONG(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) -#define xdr_putlong(xdrs, longp) \ - (*(xdrs)->x_ops->x_putlong)(xdrs, longp) - -static __inline int -xdr_getint32(XDR *xdrs, int32_t *ip) -{ - long l; - - if (!xdr_getlong(xdrs, &l)) - return (FALSE); - *ip = (int32_t)l; - return (TRUE); -} - -static __inline int -xdr_putint32(XDR *xdrs, int32_t *ip) -{ - long l; - - l = (long)*ip; - return xdr_putlong(xdrs, &l); -} - -#define XDR_GETINT32(xdrs, int32p) xdr_getint32(xdrs, int32p) -#define XDR_PUTINT32(xdrs, int32p) xdr_putint32(xdrs, int32p) - -#define XDR_GETBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) -#define xdr_getbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) - -#define XDR_PUTBYTES(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) -#define xdr_putbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) - -#define XDR_GETPOS(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) -#define xdr_getpos(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) - -#define XDR_SETPOS(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) -#define xdr_setpos(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) - -#define XDR_INLINE(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) -#define xdr_inline(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) - -#define XDR_DESTROY(xdrs) \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs) -#define xdr_destroy(xdrs) \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs) - -#define XDR_CONTROL(xdrs, req, op) \ - if ((xdrs)->x_ops->x_control) \ - (*(xdrs)->x_ops->x_control)(xdrs, req, op) -#define xdr_control(xdrs, req, op) XDR_CONTROL(xdrs, req, op) - -/* - * Solaris strips the '_t' from these types -- not sure why. - * But, let's be compatible. - */ -#define xdr_rpcvers(xdrs, versp) xdr_u_int32(xdrs, versp) -#define xdr_rpcprog(xdrs, progp) xdr_u_int32(xdrs, progp) -#define xdr_rpcproc(xdrs, procp) xdr_u_int32(xdrs, procp) -#define xdr_rpcprot(xdrs, protp) xdr_u_int32(xdrs, protp) -#define xdr_rpcport(xdrs, portp) xdr_u_int32(xdrs, portp) - -/* - * Support struct for discriminated unions. - * You create an array of xdrdiscrim structures, terminated with - * an entry with a null procedure pointer. The xdr_union routine gets - * the discriminant value and then searches the array of structures - * for a matching value. If a match is found the associated xdr routine - * is called to handle that part of the union. If there is - * no match, then a default routine may be called. - * If there is no match and no default routine it is an error. - */ -#define NULL_xdrproc_t ((xdrproc_t)0) -struct xdr_discrim { - int value; - xdrproc_t proc; -}; - -/* - * In-line routines for fast encode/decode of primitive data types. - * Caveat emptor: these use single memory cycles to get the - * data from the underlying buffer, and will fail to operate - * properly if the data is not aligned. The standard way to use these - * is to say: - * if ((buf = XDR_INLINE(xdrs, count)) == NULL) - * return (FALSE); - * <<< macro calls >>> - * where ``count'' is the number of bytes of data occupied - * by the primitive data types. - * - * N.B. and frozen for all time: each data type here uses 4 bytes - * of external representation. - */ -#define IXDR_GET_INT32(buf) ((int32_t)__ntohl((u_int32_t)*(buf)++)) -#define IXDR_PUT_INT32(buf, v) (*(buf)++ =(int32_t)__htonl((u_int32_t)v)) -#define IXDR_GET_U_INT32(buf) ((u_int32_t)IXDR_GET_INT32(buf)) -#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v))) - -#define IXDR_GET_LONG(buf) ((long)__ntohl((u_int32_t)*(buf)++)) -#define IXDR_PUT_LONG(buf, v) (*(buf)++ =(int32_t)__htonl((u_int32_t)v)) - -#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf)) -#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf)) -#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf)) -#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf)) -#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf)) - -#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), (v)) -#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), (v)) - -/* - * These are the "generic" xdr routines. - */ -__BEGIN_DECLS -extern bool_t xdr_void(void); -extern bool_t xdr_int(XDR *, int *); -extern bool_t xdr_u_int(XDR *, u_int *); -extern bool_t xdr_long(XDR *, long *); -extern bool_t xdr_u_long(XDR *, u_long *); -extern bool_t xdr_short(XDR *, short *); -extern bool_t xdr_u_short(XDR *, u_short *); -extern bool_t xdr_int16_t(XDR *, int16_t *); -extern bool_t xdr_u_int16_t(XDR *, u_int16_t *); -extern bool_t xdr_int32_t(XDR *, int32_t *); -extern bool_t xdr_u_int32_t(XDR *, u_int32_t *); -extern bool_t xdr_int64_t(XDR *, int64_t *); -extern bool_t xdr_u_int64_t(XDR *, u_int64_t *); -extern bool_t xdr_bool(XDR *, bool_t *); -extern bool_t xdr_enum(XDR *, enum_t *); -extern bool_t xdr_array(XDR *, char **, u_int *, u_int, u_int, xdrproc_t); -extern bool_t xdr_bytes(XDR *, char **, u_int *, u_int); -extern bool_t xdr_opaque(XDR *, char *, u_int); -extern bool_t xdr_string(XDR *, char **, u_int); -extern bool_t xdr_union(XDR *, enum_t *, char *, const struct xdr_discrim *, xdrproc_t); -extern bool_t xdr_char(XDR *, char *); -extern bool_t xdr_u_char(XDR *, u_char *); -extern bool_t xdr_vector(XDR *, char *, u_int, u_int, xdrproc_t); -extern bool_t xdr_float(XDR *, float *); -extern bool_t xdr_double(XDR *, double *); -extern bool_t xdr_quadruple(XDR *, long double *); -extern bool_t xdr_reference(XDR *, char **, u_int, xdrproc_t); -extern bool_t xdr_pointer(XDR *, char **, u_int, xdrproc_t); -extern bool_t xdr_wrapstring(XDR *, char **); -extern void xdr_free(xdrproc_t, void *); -extern bool_t xdr_hyper(XDR *, quad_t *); -extern bool_t xdr_u_hyper(XDR *, u_quad_t *); -extern bool_t xdr_longlong_t(XDR *, quad_t *); -extern bool_t xdr_u_longlong_t(XDR *, u_quad_t *); -__END_DECLS - -/* - * Common opaque bytes objects used by many rpc protocols; - * declared here due to commonality. - */ -#define MAX_NETOBJ_SZ 1024 -struct netobj { - u_int n_len; - char *n_bytes; -}; -typedef struct netobj netobj; -extern bool_t xdr_netobj(XDR *, struct netobj *); - -/* - * These are the public routines for the various implementations of - * xdr streams. - */ -__BEGIN_DECLS -/* XDR using memory buffers */ -extern void xdrmem_create(XDR *, char *, u_int, enum xdr_op); - -/* XDR pseudo records for tcp */ -extern void xdrrec_create(XDR *, u_int, u_int, void *, - int (*)(void *, void *, int), - int (*)(void *, void *, int)); - -/* make end of xdr record */ -extern bool_t xdrrec_endofrecord(XDR *, int); - -/* move to beginning of next record */ -extern bool_t xdrrec_skiprecord(XDR *); - -/* true if no more input */ -extern bool_t xdrrec_eof(XDR *); -extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int); -__END_DECLS - -#endif /* !_SPANS_KXDR_H */ Property changes on: head/sys/netatm/spans/spans_kxdr.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_arp.c =================================================================== --- head/sys/netatm/spans/spans_arp.c (revision 179307) +++ head/sys/netatm/spans/spans_arp.c (nonexistent) @@ -1,1167 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS CLS - ARP support - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "spans_xdr.h" -#include -#include - -#include - -/* - * Global variables - */ -struct spansarp *spansarp_arptab[SPANSARP_HASHSIZ] = {NULL}; - - -/* - * Local functions - */ -static int spansarp_request(struct spansarp *); -static void spansarp_aging(struct atm_time *); -static void spansarp_retry(struct atm_time *); - -/* - * Local variables - */ -static struct atm_time spansarp_timer = {0, 0}; /* Aging timer */ -static struct atm_time spansarp_rtimer = {0, 0}; /* Retry timer */ - -static struct spansarp *spansarp_retry_head = NULL; /* Retry chain */ - -static uma_zone_t spansarp_zone; - - -/* - * Process a new outgoing SVC requiring SPANS ARP support - * - * This function is called by an endpoint wishing to resolve a destination - * IP address to an ATM address in order to open an SVC to that destination. - * If a valid mapping is already in our cache, then we just tell the caller - * about it and that's that. Otherwise, we have to allocate a new arp entry - * and issue a query for the mapping. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * dst pointer to destination IP address - * - * Returns: - * MAP_VALID - Got the answer, returned via iv_arpent field. - * MAP_PROCEEDING - OK so far, querying for peer's mapping - * MAP_FAILED - error, unable to allocate resources - * - */ -int -spansarp_svcout(ivp, dst) - struct ipvcc *ivp; - struct in_addr *dst; -{ - struct spanscls *clp; - struct spansarp *sap; - int s; - - ivp->iv_arpent = NULL; - - /* - * Lookup destination address - */ - s = splnet(); - SPANSARP_LOOKUP(dst->s_addr, sap); - - if (sap) { - /* - * Link this vcc to entry queue - */ - LINK2TAIL(ivp, struct ipvcc, sap->sa_ivp, iv_arpnext); - - /* - * If entry is valid, we're done - */ - if (sap->sa_flags & SAF_VALID) { - ivp->iv_arpent = (struct arpmap *)sap; - (void) splx(s); - return (MAP_VALID); - } - - /* - * We're already looking for this address - */ - (void) splx(s); - return (MAP_PROCEEDING); - } - - /* - * Need a new arp entry - first, find the cls instance - * corresponding to the requestor's IP interface. - */ - for (clp = spanscls_head; clp; clp = clp->cls_next) { - if (clp->cls_ipnif == ivp->iv_ipnif) - break; - } - if (clp == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Now get the new arp entry - */ - sap = uma_zalloc(spansarp_zone, M_WAITOK); - if (sap == NULL) { - (void) splx(s); - return (MAP_FAILED); - } - - /* - * Get entry set up - */ - sap->sa_dstip.s_addr = dst->s_addr; - sap->sa_dstatm.address_format = T_ATM_ABSENT; - sap->sa_dstatm.address_length = 0; - sap->sa_dstatmsub.address_format = T_ATM_ABSENT; - sap->sa_dstatmsub.address_length = 0; - sap->sa_cls = clp; - sap->sa_origin = SAO_LOOKUP; - - /* - * Link ipvcc to arp entry for later notification - */ - LINK2TAIL(ivp, struct ipvcc, sap->sa_ivp, iv_arpnext); - - /* - * Add arp entry to table - */ - SPANSARP_ADD(sap); - - /* - * Add arp entry to retry list and start retry timer if needed - */ - LINK2TAIL(sap, struct spansarp, spansarp_retry_head, sa_rnext); - if ((spansarp_rtimer.ti_flag & TIF_QUEUED) == 0) - atm_timeout(&spansarp_rtimer, SPANSARP_RETRY, spansarp_retry); - - /* - * Issue arp request for this address - */ - (void) spansarp_request(sap); - - (void) splx(s); - return (MAP_PROCEEDING); -} - - -/* - * Process a new incoming SVC requiring SPANS ARP support - * - * This function is called by an endpoint wishing to resolve a destination - * ATM address to its IP address for an incoming call in order to allow a - * bi-directional flow of IP packets on the SVC. - * - * SPANS ARP does not provide reverse mapping facilities and only supports - * uni-directional SVCs. Thus, we lie a little to IP and always return a - * MAP_PROCEEDING indication, but we will never later notify IP of a - * MAP_VALID condition. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * dst pointer to destination ATM address - * dstsub pointer to destination ATM subaddress - * - * Returns: - * MAP_VALID - Got the answer, returned via iv_arpent field. - * MAP_PROCEEDING - OK so far, querying for peer's mapping - * MAP_FAILED - error, unable to allocate resources - * - */ -int -spansarp_svcin(ivp, dst, dstsub) - struct ipvcc *ivp; - Atm_addr *dst; - Atm_addr *dstsub; -{ - /* - * Clear ARP entry field - */ - ivp->iv_arpent = NULL; - - return (MAP_PROCEEDING); -} - - -/* - * SPANS ARP SVC activation notification - * - * This function is called when a previously opened SVC has successfully - * been connected. - * - * Arguments: - * ivp pointer to SVC's IPVCC control block - * - * Returns: - * 0 activation processing successful - * errno activation failed - reason indicated - * - */ -int -spansarp_svcactive(ivp) - struct ipvcc *ivp; -{ - struct spansarp *sap; - int s = splnet(); - - /* - * Find an entry for the destination address - */ - SPANSARP_LOOKUP(ivp->iv_dst.s_addr, sap); - if (sap) { - /* - * IP is finished with entry, so remove IP VCC from chain - */ - UNLINK(ivp, struct ipvcc, sap->sa_ivp, iv_arpnext); - ivp->iv_arpent = NULL; - - /* - * This seems like a reasonable reason to refresh the entry - */ - sap->sa_reftime = 0; - } - - (void) splx(s); - return (0); -} - - -/* - * SPANS ARP supported VCC is closing - * - * This function is called just prior to a user closing a VCC which - * supports SPANS ARP. We'll sever our links to the VCC and then - * figure out how much more cleanup we need to do for now. - * - * Arguments: - * ivp pointer to VCC's IPVCC control block - * - * Returns: - * none - * - */ -void -spansarp_vcclose(ivp) - struct ipvcc *ivp; -{ - struct spansarp *sap; - int s = splnet(); - - /* - * Get spansarp entry - */ - SPANSARP_LOOKUP(ivp->iv_dst.s_addr, sap); - if (sap == NULL) { - (void) splx(s); - return; - } - - /* - * Remove IP VCC from chain - */ - UNLINK(ivp, struct ipvcc, sap->sa_ivp, iv_arpnext); - ivp->iv_arpent = NULL; - - /* - * If entry is currently valid or in use, not much else for us to do - */ - if ((sap->sa_flags & (SAF_VALID | SAF_LOCKED)) || - (sap->sa_origin >= SAO_PERM)) { - (void) splx(s); - return; - } - - /* - * If there are still other VCCs waiting, exit - */ - if (sap->sa_ivp) { - (void) splx(s); - return; - } - - /* - * Noone else waiting, so remove entry from the retry chain - */ - UNLINK(sap, struct spansarp, spansarp_retry_head, sa_rnext); - - /* - * Free entry - */ - SPANSARP_DELETE(sap); - uma_zfree(spansarp_zone, sap); - (void) splx(s); -} - -/* - * Called when the spans module is loaded. - */ -void -spansarp_start() -{ - - spansarp_zone = uma_zcreate("spansarp", sizeof(struct spansarp), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (spansarp_zone == NULL) - panic("spansarp_zone"); -} - -/* - * Process module unloading notification - * - * Called whenever the spans module is about to be unloaded. All signalling - * instances will have been previously detached. All spansarp resources - * must be freed now. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -spansarp_stop() -{ - int i; - - /* - * Make sure the arp table is empty - */ - for (i = 0; i < SPANSARP_HASHSIZ; i++) { - if (spansarp_arptab[i] != NULL) - panic("spansarp_stop: arp table not empty"); - } - - /* - * Cancel timers - */ - (void) atm_untimeout(&spansarp_timer); - (void) atm_untimeout(&spansarp_rtimer); - - /* - * Free our storage pools - */ - uma_zdestroy(spansarp_zone); -} - - -/* - * Process IP Network Interface Activation - * - * Called whenever an IP network interface becomes active. - * - * Called at splnet. - * - * Arguments: - * clp pointer to CLS interface - * - * Returns: - * none - * - */ -void -spansarp_ipact(clp) - struct spanscls *clp; -{ - /* - * Make sure aging timer is running - */ - if ((spansarp_timer.ti_flag & TIF_QUEUED) == 0) - atm_timeout(&spansarp_timer, SPANSARP_AGING, spansarp_aging); -} - - -/* - * Process IP Network Interface Deactivation - * - * Called whenever an IP network interface becomes inactive. - * - * Called at splnet. - * - * Arguments: - * clp pointer to CLS interface - * - * Returns: - * none - * - */ -void -spansarp_ipdact(clp) - struct spanscls *clp; -{ - struct spanscls *clp2; - struct spansarp *sap, *snext; - int i; - - /* - * Delete all interface entries - */ - for (i = 0; i < SPANSARP_HASHSIZ; i++) { - for (sap = spansarp_arptab[i]; sap; sap = snext) { - snext = sap->sa_next; - - /* - * Clean up entries for this interface - */ - if (sap->sa_cls != clp) - continue; - - /* - * All VCCs better be gone by now - */ - if (sap->sa_ivp) - panic("spansarp_ipdact: entry not empty"); - - /* - * Remove entry from the retry chain - */ - UNLINK(sap, struct spansarp, - spansarp_retry_head, sa_rnext); - - /* - * Delete entry from arp table - */ - SPANSARP_DELETE(sap); - uma_zfree(spansarp_zone, sap); - } - } - - /* - * Stop aging timer if this is the last active interface - */ - for (clp2 = spanscls_head; clp2; clp2 = clp2->cls_next) { - if ((clp != clp2) && (clp2->cls_ipnif)) - break; - } - if (clp2 == NULL) - (void) atm_untimeout(&spansarp_timer); -} - - -/* - * Issue a SPANS ARP request packet - * - * Arguments: - * sap pointer to arp table entry - * - * Returns: - * 0 packet was successfully sent - * else unable to send packet - * - */ -static int -spansarp_request(sap) - struct spansarp *sap; -{ - struct spanscls *clp; - struct spans *spp; - struct spanscls_hdr *chp; - struct spansarp_hdr *ahp; - KBuffer *m; - struct ip_nif *inp; - int err; - - clp = sap->sa_cls; - spp = clp->cls_spans; - inp = clp->cls_ipnif; - - /* - * Make sure CLS VCC is open and that we know our addresses - */ - if (clp->cls_state != CLS_OPEN) - return (1); - if (spp->sp_addr.address_format != T_ATM_SPANS_ADDR) - return (1); - if (inp == NULL) - return (1); - - /* - * Get a buffer for pdu - */ - KB_ALLOCPKT(m, ARP_PACKET_LEN, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) - return (1); - - /* - * Place pdu at end of buffer - */ - KB_PLENSET(m, ARP_PACKET_LEN); - KB_TAILALIGN(m, ARP_PACKET_LEN); - KB_DATASTART(m, chp, struct spanscls_hdr *); - ahp = (struct spansarp_hdr *)(chp + 1); - - /* - * Build headers - */ - spans_addr_copy(&spans_bcastaddr, &chp->ch_dst); - spans_addr_copy(spp->sp_addr.address, &chp->ch_src); - *(u_int *)&chp->ch_proto = *(u_int *)&spanscls_hdr.ch_proto; - *(u_int *)&chp->ch_dsap = *(u_int *)&spanscls_hdr.ch_dsap; - *(u_short *)&chp->ch_oui[1] = *(u_short *)&spanscls_hdr.ch_oui[1]; - chp->ch_pid = htons(ETHERTYPE_ARP); - - - /* - * Build ARP packet - */ - ahp->ah_hrd = htons(ARP_SPANS); - ahp->ah_pro = htons(ETHERTYPE_IP); - ahp->ah_hln = sizeof(spans_addr); - ahp->ah_pln = sizeof(struct in_addr); - ahp->ah_op = htons(ARP_REQUEST); - spans_addr_copy(spp->sp_addr.address, &ahp->ah_sha); - bcopy(&(IA_SIN(inp->inf_addr)->sin_addr), ahp->ah_spa, - sizeof(struct in_addr)); - bcopy(&sap->sa_dstip, ahp->ah_tpa, sizeof(struct in_addr)); - - /* - * Now, send the pdu via the CLS service - */ - err = atm_cm_cpcs_data(clp->cls_conn, m); - if (err) { - KB_FREEALL(m); - return (1); - } - - return (0); -} - - -/* - * Process a SPANS ARP input packet - * - * Arguments: - * clp pointer to interface CLS control block - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -void -spansarp_input(clp, m) - struct spanscls *clp; - KBuffer *m; -{ - struct spans *spp = clp->cls_spans; - struct spanscls_hdr *chp; - struct spansarp_hdr *ahp; - struct spansarp *sap; - struct ip_nif *inp = clp->cls_ipnif; - struct in_addr in_me, in_src, in_targ; - int s, err; - - /* - * Make sure IP interface has been activated - */ - if (inp == NULL) - goto free; - - /* - * Get the packet together - */ - if (KB_LEN(m) < ARP_PACKET_LEN) { - KB_PULLUP(m, ARP_PACKET_LEN, m); - if (m == 0) - return; - } - KB_DATASTART(m, chp, struct spanscls_hdr *); - ahp = (struct spansarp_hdr *)(chp + 1); - - bcopy(ahp->ah_spa, &in_src, sizeof(struct in_addr)); - bcopy(ahp->ah_tpa, &in_targ, sizeof(struct in_addr)); - bcopy(&(IA_SIN(inp->inf_addr)->sin_addr), &in_me, - sizeof(struct in_addr)); - - /* - * Initial packet verification - */ - if ((ahp->ah_hrd != htons(ARP_SPANS)) || - (ahp->ah_pro != htons(ETHERTYPE_IP))) - goto free; - - /* - * Validate source addresses - * can't be from hardware broadcast - * can't be from me - */ - if (!spans_addr_cmp(&ahp->ah_sha, &spans_bcastaddr)) - goto free; - if (!spans_addr_cmp(&ahp->ah_sha, spp->sp_addr.address)) - goto free; - if (in_src.s_addr == in_me.s_addr) { - log(LOG_ERR, - "duplicate IP address sent from spans address %s\n", - spans_addr_print(&ahp->ah_sha)); - in_targ = in_me; - goto chkop; - } - - /* - * If source IP address is from unspecified or broadcast addresses, - * don't bother updating arp table, but answer possible requests - */ - if (in_broadcast(in_src, ANIF2IFP(inp->inf_nif))) - goto chkop; - - /* - * Update arp table with source address info - */ - s = splnet(); - SPANSARP_LOOKUP(in_src.s_addr, sap); - if (sap) { - /* - * Found an entry for the source, but don't - * update permanent entries - */ - if (sap->sa_origin != SAO_PERM) { - - /* - * Update the entry - */ - sap->sa_dstatm.address_format = T_ATM_SPANS_ADDR; - sap->sa_dstatm.address_length = sizeof(spans_addr); - spans_addr_copy(&ahp->ah_sha, sap->sa_dstatm.address); - sap->sa_cls = clp; - sap->sa_reftime = 0; - if ((sap->sa_flags & SAF_VALID) == 0) { - /* - * Newly valid entry, notify waiting users - */ - struct ipvcc *ivp, *inext; - - sap->sa_flags |= SAF_VALID; - for (ivp = sap->sa_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - - ivp->iv_arpent = (struct arpmap *)sap; - (*inp->inf_arpnotify)(ivp, MAP_VALID); - } - - /* - * Remove ourselves from the retry chain - */ - UNLINK(sap, struct spansarp, - spansarp_retry_head, sa_rnext); - } - } - - } else if (in_targ.s_addr == in_me.s_addr) { - /* - * Source unknown and we're the target - add new entry - */ - sap = uma_zalloc(spansarp_zone, M_WAITOK); - if (sap) { - sap->sa_dstip.s_addr = in_src.s_addr; - sap->sa_dstatm.address_format = T_ATM_SPANS_ADDR; - sap->sa_dstatm.address_length = sizeof(spans_addr); - spans_addr_copy(&ahp->ah_sha, sap->sa_dstatm.address); - sap->sa_dstatmsub.address_format = T_ATM_ABSENT; - sap->sa_dstatmsub.address_length = 0; - sap->sa_cls = clp; - sap->sa_flags = SAF_VALID; - sap->sa_origin = SAO_LOOKUP; - SPANSARP_ADD(sap); - } - } - (void) splx(s); - -chkop: - /* - * If this is a request for our address, send a reply - */ - if (ntohs(ahp->ah_op) != ARP_REQUEST) - goto free; - if (in_targ.s_addr != in_me.s_addr) - goto free; - - spans_addr_copy(&chp->ch_src, &chp->ch_dst); - spans_addr_copy(spp->sp_addr.address, &chp->ch_src); - ahp->ah_op = htons(ARP_REPLY); - spans_addr_copy(&ahp->ah_sha, &ahp->ah_tha); - spans_addr_copy(spp->sp_addr.address, &ahp->ah_sha); - bcopy(ahp->ah_spa, ahp->ah_tpa, sizeof(struct in_addr)); - bcopy(&in_me, ahp->ah_spa, sizeof(struct in_addr)); - - err = atm_cm_cpcs_data(clp->cls_conn, m); - if (err) - goto free; - return; - -free: - KB_FREEALL(m); -} - - -/* - * Process a SPANS ARP aging timer tick - * - * This function is called every SPANSARP_AGING seconds, in order to age - * all the arp table entries. - * - * Called at splnet. - * - * Arguments: - * tip pointer to spansarp aging timer control block - * - * Returns: - * none - * - */ -static void -spansarp_aging(tip) - struct atm_time *tip; -{ - struct spansarp *sap, *snext; - struct ipvcc *ivp, *inext; - int i; - - - /* - * Schedule next timeout - */ - atm_timeout(&spansarp_timer, SPANSARP_AGING, spansarp_aging); - - /* - * Run through arp table bumping each entry's aging timer. - */ - for (i = 0; i < SPANSARP_HASHSIZ; i++) { - for (sap = spansarp_arptab[i]; sap; sap = snext) { - snext = sap->sa_next; - - /* - * Permanent (manually installed) entries aren't aged - */ - if (sap->sa_origin == SAO_PERM) - continue; - - /* - * See if entry is valid and over-aged - */ - if ((sap->sa_flags & SAF_VALID) == 0) - continue; - if (++sap->sa_reftime < SPANSARP_MAXAGE) - continue; - - /* - * Entry is now invalid, tell IP/ATM about it - */ - sap->sa_flags |= SAF_LOCKED; - for (ivp = sap->sa_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify) - (ivp, MAP_INVALID); - } - sap->sa_flags &= ~(SAF_LOCKED | SAF_VALID); - - if (sap->sa_ivp != NULL) { - /* - * Somebody still cares, so add the arp - * entry to the retry list. - */ - LINK2TAIL(sap, struct spansarp, - spansarp_retry_head, sa_rnext); - if ((spansarp_rtimer.ti_flag & TIF_QUEUED) == 0) - atm_timeout(&spansarp_rtimer, - SPANSARP_RETRY, spansarp_retry); - - /* - * Issue arp request for this address - */ - (void) spansarp_request(sap); - - } else { - /* - * Delete unused entry - */ - SPANSARP_DELETE(sap); - uma_zfree(spansarp_zone, sap); - } - } - } -} - - -/* - * Process a SPANS ARP retry timer tick - * - * This function is called every SPANSARP_RETRY seconds, in order to retry - * awaiting arp resolution requests. We will retry requests indefinitely, - * assuming that IP will set a timeout to close the VCC(s) requesting the - * failing address resolution. - * - * Called at splnet. - * - * Arguments: - * tip pointer to spansarp retry timer control block - * - * Returns: - * none - * - */ -static void -spansarp_retry(tip) - struct atm_time *tip; -{ - struct spansarp *sap; - - - /* - * See if there's work to do - */ - if (spansarp_retry_head == NULL) { - return; - } - - /* - * Schedule next timeout - */ - atm_timeout(&spansarp_rtimer, SPANSARP_RETRY, spansarp_retry); - - /* - * Run through retry chain, (re)issuing arp requests. - */ - for (sap = spansarp_retry_head; sap; sap = sap->sa_next) { - - /* - * Send another arp request - */ - (void) spansarp_request(sap); - } -} - - -/* - * SPANS ARP IOCTL support - * - * Function will be called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -int -spansarp_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmaddreq *aap; - struct atmdelreq *adp; - struct atminfreq *aip; - struct spans *spp; - struct spanscls *clp; - struct spansarp *sap; - struct air_arp_rsp aar; - struct ip_nif *inp; - struct ipvcc *ivp, *inext; - struct in_addr ip; - u_long dst; - int err = 0, i; - size_t buf_len; - caddr_t buf_addr; - - - switch (code) { - - case AIOCS_ADD_ARP: - /* - * Add a permanent ARP mapping - */ - aap = (struct atmaddreq *)data; - clp = (struct spanscls *)arg1; - inp = clp->cls_ipnif; - if ((aap->aar_arp_addr.address_format != T_ATM_SPANS_ADDR) || - (aap->aar_arp_origin != ARP_ORIG_PERM)) { - err = EINVAL; - break; - } - ip = SATOSIN(&aap->aar_arp_dst)->sin_addr; - - /* - * See if we already have an entry for this IP address - */ - SPANSARP_LOOKUP(ip.s_addr, sap); - if (sap == NULL) { - /* - * No, get a new arp entry - */ - sap = uma_zalloc(spansarp_zone, M_WAITOK); - if (sap == NULL) { - err = ENOMEM; - break; - } - - /* - * Get entry set up - */ - sap->sa_dstip = ip; - ATM_ADDR_COPY(&aap->aar_arp_addr, &sap->sa_dstatm); - sap->sa_dstatmsub.address_format = T_ATM_ABSENT; - sap->sa_dstatmsub.address_length = 0; - sap->sa_cls = clp; - sap->sa_flags |= SAF_VALID; - sap->sa_origin = SAO_PERM; - - /* - * Add entry to table - */ - SPANSARP_ADD(sap); - break; - - } - - /* - * See if we're attempting to change the ATM address for - * this cached entry - */ - if ((sap->sa_dstatm.address_format != T_ATM_ABSENT) && - (!ATM_ADDR_EQUAL(&aap->aar_arp_addr, &sap->sa_dstatm) || - (clp != sap->sa_cls))) { - - /* - * Yes, notify IP/ATM that a mapping change has - * occurred. IP/ATM will close any VCC's which - * aren't waiting for this map. - */ - sap->sa_flags |= SAF_LOCKED; - for (ivp = sap->sa_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_CHANGED); - } - sap->sa_flags &= ~SAF_LOCKED; - } - - /* - * Update the cached entry with the new data - */ - ATM_ADDR_COPY(&aap->aar_arp_addr, &sap->sa_dstatm); - sap->sa_cls = clp; - - /* - * If this entry isn't valid, notify anyone who might - * be interested - */ - if ((sap->sa_flags & SAF_VALID) == 0) { - - sap->sa_flags |= SAF_LOCKED; - for (ivp = sap->sa_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*inp->inf_arpnotify)(ivp, MAP_VALID); - } - sap->sa_flags &= ~SAF_LOCKED; - } - - /* - * Remove this entry from the retry chain - */ - UNLINK(sap, struct spansarp, spansarp_retry_head, sa_rnext); - - /* - * Mark the entry as permanent - */ - sap->sa_flags |= SAF_VALID; - sap->sa_origin = SAO_PERM; - break; - - case AIOCS_DEL_ARP: - /* - * Delete an ARP mapping - */ - adp = (struct atmdelreq *)data; - clp = (struct spanscls *)arg1; - ip = SATOSIN(&adp->adr_arp_dst)->sin_addr; - - /* - * Now find the entry to be deleted - */ - SPANSARP_LOOKUP(ip.s_addr, sap); - if (sap == NULL) { - err = ENOENT; - break; - } - - /* - * Notify all VCCs using this entry that they must finish - * up now. - */ - sap->sa_flags |= SAF_LOCKED; - for (ivp = sap->sa_ivp; ivp; ivp = inext) { - inext = ivp->iv_arpnext; - (*ivp->iv_ipnif->inf_arpnotify)(ivp, MAP_FAILED); - } - - /* - * Now free up the entry - */ - UNLINK(sap, struct spansarp, spansarp_retry_head, sa_rnext); - SPANSARP_DELETE(sap); - uma_zfree(spansarp_zone, sap); - break; - - case AIOCS_INF_ARP: - /* - * Get ARP table information - */ - aip = (struct atminfreq *)data; - spp = (struct spans *)arg1; - - if (aip->air_arp_addr.sa_family != AF_INET) - break; - dst = SATOSIN(&aip->air_arp_addr)->sin_addr.s_addr; - - buf_addr = aip->air_buf_addr; - buf_len = aip->air_buf_len; - - if ((clp = spp->sp_cls) == NULL) - break; - - /* - * Run through entire arp table - */ - for (i = 0; i < SPANSARP_HASHSIZ; i++) { - for (sap = spansarp_arptab[i]; sap; - sap = sap->sa_next) { - /* - * We only want entries learned - * from the supplied interface. - */ - if (sap->sa_cls != clp) - continue; - if ((dst != INADDR_ANY) && - (dst != sap->sa_dstip.s_addr)) - continue; - - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(aar)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - SATOSIN(&aar.aap_arp_addr)->sin_family = - AF_INET; - SATOSIN(&aar.aap_arp_addr)->sin_addr.s_addr = - sap->sa_dstip.s_addr; - strlcpy(aar.aap_intf, - ANIF2IFP(clp->cls_ipnif->inf_nif)->if_xname, - sizeof(aar.aap_intf)); - aar.aap_flags = sap->sa_flags; - aar.aap_origin = sap->sa_origin; - if (sap->sa_flags & SAF_VALID) - aar.aap_age = SPANSARP_MAXAGE - - sap->sa_reftime; - else - aar.aap_age = 0; - ATM_ADDR_COPY(&sap->sa_dstatm, &aar.aap_addr); - ATM_ADDR_COPY(&sap->sa_dstatmsub, - &aar.aap_subaddr); - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&aar, buf_addr, - sizeof(aar))) != 0) - break; - buf_addr += sizeof(aar); - buf_len -= sizeof(aar); - } - if (err) - break; - } - - /* - * Update the buffer pointer and length - */ - aip->air_buf_addr = buf_addr; - aip->air_buf_len = buf_len; - break; - - case AIOCS_INF_ASV: - /* - * Get ARP server information - */ - /* SPANS doesn't have an ARP server */ - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} - Property changes on: head/sys/netatm/spans/spans_arp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_proto.c =================================================================== --- head/sys/netatm/spans/spans_proto.c (revision 179307) +++ head/sys/netatm/spans/spans_proto.c (nonexistent) @@ -1,574 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS protocol processing module. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -/* - * Internal functions - */ -caddr_t spans_getname(void *); -void spans_connected(void *); -void spans_cleared(void *, struct t_atm_cause *); -void spans_cpcs_data(void *, KBuffer *); - - -/* - * ATM endpoint for SPANS signalling channel - */ -static Atm_endpoint spans_endpt = { - NULL, /* ep_next */ - ENDPT_SPANS_SIG, /* ep_id */ - NULL, /* ep_ioctl */ - spans_getname, /* ep_getname */ - spans_connected, /* ep_connected */ - spans_cleared, /* ep_cleared */ - NULL, /* ep_incoming */ - NULL, /* ep_addparty */ - NULL, /* ep_dropparty */ - NULL, /* ep_cpcs_ctl */ - spans_cpcs_data, /* ep_cpcs_data */ - NULL, /* ep_saal_ctl */ - NULL, /* ep_saal_data */ - NULL, /* ep_sscop_ctl */ - NULL /* ep_sscop_data */ -}; - - -/* - * ATM connection attributes for UNI signalling channel - */ -static Atm_attributes spans_attr = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, /* aal.tag */ - ATM_AAL3_4 /* aal.aal_type */ - }, - { /* traffic */ - T_ATM_PRESENT, /* traffic.tag */ - { /* traffic.v */ - { /* traffic.v.forward */ - T_ATM_ABSENT, /* PCR_high */ - 0, /* PCR_all */ - T_ATM_ABSENT, /* SCR_high */ - T_ATM_ABSENT, /* SCR_all */ - T_ATM_ABSENT, /* MBS_high */ - T_ATM_ABSENT, /* MBS_all */ - T_NO, /* tagging */ - }, - { /* traffic.v.backward */ - T_ATM_ABSENT, /* PCR_high */ - 0, /* PCR_all */ - T_ATM_ABSENT, /* SCR_high */ - T_ATM_ABSENT, /* SCR_all */ - T_ATM_ABSENT, /* MBS_high */ - T_ATM_ABSENT, /* MBS_all */ - T_NO, /* tagging */ - }, - T_YES, /* best_effort */ - } - }, - { /* bearer */ - T_ATM_PRESENT, /* bearer.tag */ - { /* bearer.v */ - T_ATM_CLASS_X, /* class */ - T_ATM_NULL, /* traffic_type */ - T_ATM_NO_END_TO_END, /* timing_req */ - T_NO, /* clipping */ - T_ATM_1_TO_1, /* conn_conf */ - } - }, - { /* bhli */ - T_ATM_ABSENT, /* bhli.tag */ - }, - { /* blli */ - T_ATM_ABSENT, /* blli.tag_l2 */ - T_ATM_ABSENT, /* blli.tag_l3 */ - }, - { /* llc */ - T_ATM_ABSENT, /* llc.tag */ - }, - { /* called */ - T_ATM_PRESENT, /* called.tag */ - }, - { /* calling */ - T_ATM_ABSENT, /* calling.tag */ - }, - { /* qos */ - T_ATM_PRESENT, /* qos.tag */ - { /* qos.v */ - T_ATM_NETWORK_CODING, /* coding_standard */ - { /* qos.v.forward */ - T_ATM_QOS_CLASS_0, /* class */ - }, - { /* qos.v.backward */ - T_ATM_QOS_CLASS_0, /* class */ - } - } - }, - { /* transit */ - T_ATM_ABSENT, /* transit.tag */ - }, - { /* cause */ - T_ATM_ABSENT, /* cause.tag */ - } -}; - - -/* - * SPANS cause structre - */ -struct t_atm_cause spans_cause = { - T_ATM_ITU_CODING, /* coding_standard */ - T_ATM_LOC_USER, /* location */ - T_ATM_CAUSE_UNSPECIFIED_NORMAL, /* cause_value */ - { 0, 0, 0, 0 } /* diagnostics */ -}; - -SYSCTL_NODE(_net_harp, OID_AUTO, spans, CTLFLAG_RW, 0, "spans"); - -/* - * Process a SPANS timeout - * - * Called when a previously scheduled spans control block timer expires. - * Processing will based on the current SPANS state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to spans timer control block - * - * Returns: - * none - * - */ -void -spans_timer(tip) - struct atm_time *tip; -{ - struct spans *spp; - spans_msg *msg; - Atm_addr_pvc *pvcp; - int err; - - /* - * Back-off to SPANS control block - */ - spp = (struct spans *) - ((caddr_t)tip - offsetof(struct spans, sp_time)); - - ATM_DEBUG2("spans_timer: spp=%p,state=%d\n", - spp, spp->sp_state); - - /* - * Process timeout based on protocol state - */ - switch (spp->sp_state) { - - case SPANS_INIT: - - /* - * Open signalling channel - */ - spans_attr.nif = spp->sp_pif->pif_nif; - - spans_attr.aal.v.aal4.forward_max_SDU_size = - ATM_NIF_MTU; - spans_attr.aal.v.aal4.backward_max_SDU_size = - ATM_NIF_MTU; - spans_attr.aal.v.aal4.SSCS_type = - T_ATM_SSCS_SSCOP_UNREL; - spans_attr.aal.v.aal4.mid_low = 0; - spans_attr.aal.v.aal4.mid_high = 0; - - spans_attr.called.tag = T_ATM_PRESENT; - spans_attr.called.addr.address_format = T_ATM_PVC_ADDR; - spans_attr.called.addr.address_length = - sizeof(Atm_addr_pvc); - pvcp = (Atm_addr_pvc *)spans_attr.called.addr.address; - ATM_PVC_SET_VPI(pvcp, SPANS_SIG_VPI); - ATM_PVC_SET_VCI(pvcp, SPANS_SIG_VCI); - spans_attr.called.subaddr.address_format = T_ATM_ABSENT; - spans_attr.called.subaddr.address_length = 0; - - spans_attr.traffic.v.forward.PCR_all_traffic = - spp->sp_pif->pif_pcr; - spans_attr.traffic.v.backward.PCR_all_traffic = - spp->sp_pif->pif_pcr; - - err = atm_cm_connect(&spans_endpt, spp, &spans_attr, - &spp->sp_conn); - if (err) { - log(LOG_CRIT, "spans: signalling channel setup failed\n"); - return; - } - - /* - * Signalling channel open, start probing - */ - spp->sp_state = SPANS_PROBE; - - /* FALLTHRU */ - - case SPANS_PROBE: - case SPANS_ACTIVE: - - /* - * Send out SPANS_STAT_REQ message - */ - msg = uma_zalloc(spans_msg_zone, M_WAITOK); - if (msg == NULL) { - /* XXX arr: This is bogus and will go away RSN */ - /* Retry later if no memory */ - SPANS_TIMER(spp, SPANS_PROBE_ERR_WAIT); - break; - } - msg->sm_vers = SPANS_VERS_1_0; - msg->sm_type = SPANS_STAT_REQ; - msg->sm_stat_req.streq_es_epoch = spp->sp_h_epoch; - if (spans_send_msg(spp, msg)) { - /* Retry later if send fails */ - SPANS_TIMER(spp, SPANS_PROBE_ERR_WAIT); - uma_zfree(spans_msg_zone, msg); - break; - } - uma_zfree(spans_msg_zone, msg); - spp->sp_probe_ct++; - - /* - * Check whether we're getting an answer to our probes - */ - if (spp->sp_state == SPANS_ACTIVE && - spp->sp_probe_ct > SPANS_PROBE_THRESH) { - /* - * Interface is down, notify VCC owners - */ - spans_switch_reset(spp, SPANS_UNI_DOWN); - - /* - * Set new state and increment host epoch so - * switch knows we reset everyting. - */ - spp->sp_state = SPANS_PROBE; - spp->sp_h_epoch++; - spp->sp_s_epoch = 0; - } - - /* - * Keep sending status requests - */ - SPANS_TIMER(spp, SPANS_PROBE_INTERVAL); - - break; - - case SPANS_DETACH: - /* - * Try to terminate the SPANS signalling PVC - */ - err = atm_cm_release(spp->sp_conn, &spans_cause); - if (err) { - log(LOG_ERR, "spans: can't close signalling channel\n"); - } - break; - - default: - log(LOG_ERR, "spans: timer state: spp=%p, state=%d\n", - spp, spp->sp_state); - } -} - - -/* - * Process a SPANS VCC timeout - * - * Called when a previously scheduled SPANS VCCB timer expires. - * Processing will based on the current VCC state. - * - * Called at splnet. - * - * Arguments: - * tip pointer to vccb timer control block - * - * Returns: - * none - * - */ -void -spans_vctimer(tip) - struct atm_time *tip; -{ - int err; - struct spans *spp; - struct spans_vccb *svp; - - /* - * Get VCCB and SPANS control block addresses - */ - svp = (struct spans_vccb *) - ((caddr_t)tip - offsetof(struct vccb, vc_time)); - spp = (struct spans *)svp->sv_pif->pif_siginst; - - ATM_DEBUG3("spans_vctimer: svp=%p, sstate=%d, ustate=%d\n", - svp, svp->sv_sstate, svp->sv_ustate); - - /* - * Process timeout based on protocol state - */ - switch (svp->sv_sstate) { - - case SPANS_VC_ABORT: - /* - * Kill the VCCB and notify the owner - */ - err = spans_clear_vcc(spp, svp); - break; - - case SPANS_VC_FREE: - /* - * Free VCCB storage - */ - svp->sv_ustate = VCCU_CLOSED; - svp->sv_sstate = SPANS_VC_FREE; - spans_free((struct vccb *)svp); - break; - - case SPANS_VC_POPEN: - /* - * Issued open request, but didn't get response. - */ - if (svp->sv_retry < SV_MAX_RETRY) { - /* - * Retransmit the open request - */ - err = spans_send_open_req(spp, svp); - svp->sv_retry++; - SPANS_VC_TIMER((struct vccb *) svp, SV_TIMEOUT); - } else { - /* - * Retry limit exceeded--report the open failed - */ - svp->sv_ustate = VCCU_CLOSED; - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_connvc->cvc_attr.cause.tag = - T_ATM_PRESENT; - svp->sv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - svp->sv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - svp->sv_connvc->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_NO_USER_RESPONDING; - bzero(svp->sv_connvc->cvc_attr.cause.v.diagnostics, - sizeof(svp->sv_connvc->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - } - break; - - case SPANS_VC_CLOSE: - /* - * Issued close request, but didn't get response. - */ - if (svp->sv_retry < SV_MAX_RETRY) { - /* - * Retransmit the close request - */ - err = spans_send_close_req(spp, svp); - svp->sv_retry++; - SPANS_VC_TIMER((struct vccb *) svp, SV_TIMEOUT); - } else { - /* - * Retry limit exceeded--just finish the close - */ - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_connvc->cvc_attr.cause.tag = T_ATM_PRESENT; - svp->sv_connvc->cvc_attr.cause.v.coding_standard = - T_ATM_ITU_CODING; - svp->sv_connvc->cvc_attr.cause.v.location = - T_ATM_LOC_USER; - svp->sv_connvc->cvc_attr.cause.v.cause_value = - T_ATM_CAUSE_NO_USER_RESPONDING; - bzero(svp->sv_connvc->cvc_attr.cause.v.diagnostics, - sizeof(svp->sv_connvc->cvc_attr.cause.v.diagnostics)); - atm_cm_cleared(svp->sv_connvc); - } - break; - - case SPANS_VC_ACTIVE: - case SPANS_VC_ACT_DOWN: - /* - * Shouldn't happen - */ - log(LOG_ERR, "spans_vctimer: unexpected state %d\n", - svp->sv_sstate); - break; - - default: - log(LOG_ERR, "spans: vctimer state: svp=%p, sstate=%d\n", - svp, svp->sv_sstate); - } -} - - -/* - * SPANS name routine - * - * Arguments: - * tok SPANS signalling channel token (ignored) - * - * Returns: - * pointer to a string identifying the SPANS signalling manager - * - */ -caddr_t -spans_getname(tok) - void *tok; -{ - return("SPANS"); -} - - -/* - * Process a VCC connection notification - * - * Should never be called - * - * Arguments: - * tok user's connection token (SPANS protocol block) - * - * Returns: - * none - * - */ -void -spans_connected(tok) - void *tok; -{ - struct spans *spp = (struct spans *)tok; - - ATM_DEBUG2("spans_connected: spp=%p,state=%d\n", - spp, spp->sp_state); - - /* - * Connected routine shouldn't ever get called for a PVC - */ - log(LOG_ERR, "spans: connected function called, tok=%p\n", spp); -} - - -/* - * Process a VCC close notification - * - * Called when the SPANS signalling channel is closed - * - * Arguments: - * tok user's connection token (spans protocol block) - * cp pointer to cause structure - * - * Returns: - * none - * - */ -void -spans_cleared(tok, cp) - void *tok; - struct t_atm_cause *cp; -{ - struct spans *spp = (struct spans *)tok; - - /* - * VCC has been closed. - */ - log(LOG_ERR, "spans: signalling channel closed\n"); - SPANS_CANCEL(spp); - spp->sp_conn = 0; -} - - -/* - * SPANS CPCS data handler - * - * This is the module which receives data on the SPANS signalling - * channel. Processing is based on the indication received from the - * AAL and the protocol state. - * - * Arguments: - * tok session token (pointer to spans protocol control block) - * m pointer to buffer with data - * - * Returns: - * none - * - */ -void -spans_cpcs_data(tok, m) - void *tok; - KBuffer *m; -{ - struct spans *spp = tok; - - ATM_DEBUG3("spans_cpcs_data: spp=%p,state=%d,m=%p,\n", - spp, spp->sp_state, m); - - /* - * Process data - */ - spans_rcv_msg(spp, m); -} Property changes on: head/sys/netatm/spans/spans_proto.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_subr.c =================================================================== --- head/sys/netatm/spans/spans_subr.c (revision 179307) +++ head/sys/netatm/spans/spans_subr.c (nonexistent) @@ -1,508 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS-related subroutines. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -/* - * Open a SPANS VCC - * - * Called when a user wants to open a VC. This function will construct - * a VCCB, create the stack requested by the user, and, if we are - * opening an SVC, start the SPANS signalling message exchange. The - * user will have to wait for a notify event to be sure the SVC is fully - * open. - * - * Must be called at splnet. - * - * Arguments: - * spp pointer to SPANS protocol instance - * acp pointer to PVC's connection parameters - * - * Returns: - * 0 VCC creation successful - * errno VCC setup failed - reason indicated - * - */ -int -spans_open_vcc(spp, cvp) - struct spans *spp; - Atm_connvc *cvp; - -{ - struct atm_pif *pip = spp->sp_pif; - struct spans_vccb *svp; - Atm_addr_pvc *pvp; - spans_aal aal; - int err, pvc, vpi, vci; - - ATM_DEBUG2("spans_open_vcc: spp=%p, cvp=%p\n", spp, cvp); - - /* - * Validate user parameters. AAL and encapsulation are - * checked by the connection manager. - */ - - /* - * Check called party address(es) - */ - if (cvp->cvc_attr.called.tag != T_ATM_PRESENT || - cvp->cvc_attr.called.addr.address_format == - T_ATM_ABSENT || - cvp->cvc_attr.called.subaddr.address_format != - T_ATM_ABSENT) { - return(EINVAL); - } - switch (cvp->cvc_attr.called.addr.address_format) { - case T_ATM_PVC_ADDR: - /* - * Make sure VPI/VCI is valid - */ - pvc = 1; - pvp = (Atm_addr_pvc *)cvp->cvc_attr.called.addr.address; - vpi = ATM_PVC_GET_VPI(pvp); - vci = ATM_PVC_GET_VCI(pvp); - if ((vpi > pip->pif_maxvpi) || - (vci == 0) || - (vci > pip->pif_maxvci)) { - return(ERANGE); - } - - /* - * Make sure VPI/VCI is not already in use - */ - if (spans_find_vpvc(spp, vpi, vci, 0)) { - return(EADDRINUSE); - } - ATM_DEBUG2("spans_open_vcc: VPI.VCI=%d.%d\n", - vpi, vci); - break; - - case T_ATM_SPANS_ADDR: - pvc = 0; - vpi = vci = 0; - - /* - * Check signalling state - */ - if (spp->sp_state != SPANS_ACTIVE) { - return(ENETDOWN); - } - - /* - *Check destination address length - */ - if (cvp->cvc_attr.called.addr.address_length != - sizeof(spans_addr)) { - return(EINVAL); - } - break; - - default: - return(EINVAL); - } - - /* - * Check that this is for the same interface SPANS uses - */ - if (!cvp->cvc_attr.nif || - cvp->cvc_attr.nif->nif_pif != spp->sp_pif) { - return(EINVAL); - } - - /* - * Check AAL - */ - if (!spans_get_spans_aal(cvp->cvc_attr.aal.type, &aal)) { - return(EINVAL); - } - -#ifdef NOTDEF - /* - * Check encapsulation - */ - /* XXX -- How do we check encapsulation? */ - if (cvp->ac_encaps != ATM_ENC_NULL) { - return(EINVAL); - } -#endif - - /* - * Allocate control block for VCC - */ - svp = uma_zalloc(spans_vc_zone, M_WAITOK); - if (svp == NULL) { - return(ENOMEM); - } - - /* - * Fill in VCCB - */ - if (pvc) { - svp->sv_type = VCC_PVC | VCC_IN | VCC_OUT; - svp->sv_vpi = vpi; - svp->sv_vci = vci; - svp->sv_sstate = (spp->sp_state == SPANS_ACTIVE ? - SPANS_VC_ACTIVE : SPANS_VC_ACT_DOWN); - svp->sv_ustate = VCCU_OPEN; - } else { - svp->sv_type = VCC_SVC | VCC_OUT; - spans_addr_copy(cvp->cvc_attr.called.addr.address, - &svp->sv_conn.con_dst); - spans_addr_copy(spp->sp_addr.address, - &svp->sv_conn.con_src); - svp->sv_conn.con_dsap = SPANS_SAP_IP; - svp->sv_conn.con_ssap = spans_ephemeral_sap(spp); - svp->sv_sstate = SPANS_VC_POPEN; - svp->sv_ustate = VCCU_POPEN; - } - svp->sv_proto = ATM_SIG_SPANS; - svp->sv_pif = spp->sp_pif; - svp->sv_nif = cvp->cvc_attr.nif; - svp->sv_connvc = cvp; - svp->sv_spans_aal = aal; - svp->sv_tstamp = time_second; - - /* - * Put VCCB on SPANS queue - */ - ENQUEUE(svp, struct spans_vccb, sv_sigelem, spp->sp_vccq); - - /* - * Link VCCB to VCC connection block - */ - cvp->cvc_vcc = (struct vccb *) svp; - - /* - * Start the SPANS message exchange if this is an SVC - */ - if (!pvc) { - svp->sv_retry = 0; - svp->sv_spans_qos.rsc_peak = 1; - svp->sv_spans_qos.rsc_mean = 1; - svp->sv_spans_qos.rsc_burst = 1; - err = spans_send_open_req(spp, svp); - if (err) { - /* - * On error, delete the VCCB - */ - DEQUEUE(svp, struct spans_vccb, sv_sigelem, - spp->sp_vccq); - cvp->cvc_vcc = (struct vccb *)0; - uma_zfree(spans_vc_zone, svp); - return(err); - } else { - /* - * VCCB is opening--set the retransmit timer - */ - SPANS_VC_TIMER((struct vccb *) svp, SV_TIMEOUT); - } - } - - return(0); -} - - -/* - * Close a SPANS VCC - * - * Called when a user wants to close a VCC. This function will clean - * up the VCCB and, for an SVC, send a close request. - * - * Must be called at splnet. - * - * Arguments: - * spp pointer to SPANS protocol instance - * svp pointer to VCCB for the VCC to be closed - * - * Returns: - * 0 VCC is now closed - * errno error encountered - */ -int -spans_close_vcc(spp, svp, force) - struct spans *spp; - struct spans_vccb *svp; - int force; - -{ - int err = 0; - - ATM_DEBUG2("spans_close_vcc: svp=%p, state=%d\n", svp, - svp->sv_sstate); - - /* - * Check that this is for the same interface SPANS uses - */ - if (svp->sv_pif != spp->sp_pif) { - return (EINVAL); - } - - /* - * Kill any possible timer - */ - SPANS_VC_CANCEL((struct vccb *) svp); - - /* - * Mark the close time. - */ - svp->sv_tstamp = time_second; - - /* - * Process based on the connection type - */ - if (svp->sv_type & VCC_PVC) { - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_ustate = VCCU_CLOSED; - } else if (svp->sv_type & VCC_SVC) { - /* - * Update VCCB states - */ - svp->sv_ustate = VCCU_CLOSED; - - /* - * Send the appropriate SPANS close message - */ - switch (svp->sv_sstate) { - case SPANS_VC_R_POPEN: - err = spans_send_open_rsp(spp, svp, SPANS_FAIL); - svp->sv_sstate = SPANS_VC_FREE; - break; - case SPANS_VC_OPEN: - case SPANS_VC_POPEN: - case SPANS_VC_ABORT: - svp->sv_retry = 0; - err = spans_send_close_req(spp, svp); - if (force) { - svp->sv_sstate = SPANS_VC_FREE; - } else { - svp->sv_sstate = SPANS_VC_CLOSE; - SPANS_VC_TIMER((struct vccb *) svp, - SV_TIMEOUT); - } - break; - case SPANS_VC_CLOSE: - if (force) { - svp->sv_sstate = SPANS_VC_FREE; - } - break; - } - } - - /* - * Wait for user to free resources - */ - return(err); -} - - -/* - * Clear a SPANS VCC - * - * Called when the signalling manager wants to close a VCC immediately. - * This function will clean up the VCCB and notify the owner. - * - * Must be called at splnet. - * - * Arguments: - * spp pointer to SPANS protocol instance - * svp pointer to VCCB for the VCC to be closed - * - * Returns: - * 0 VCC is now closed - * errno error encountered - */ -int -spans_clear_vcc(spp, svp) - struct spans *spp; - struct spans_vccb *svp; - -{ - u_char outstate; - - ATM_DEBUG2("spans_clear_vcc: svp=%p, state=%d\n", svp, - svp->sv_sstate); - - /* - * Check that this is for the same interface SPANS uses - */ - if (svp->sv_pif != spp->sp_pif) { - return (EINVAL); - } - - /* - * Kill any possible timer - */ - SPANS_VC_CANCEL((struct vccb *) svp); - - /* - * Mark the close time - */ - svp->sv_tstamp = time_second; - - /* - * Mark the VCCB closed - */ - outstate = svp->sv_sstate; - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_ustate = VCCU_CLOSED; - - /* - * Notify the user if old state indicates. - */ - switch (outstate) { - case SPANS_VC_ACTIVE: - case SPANS_VC_ACT_DOWN: - case SPANS_VC_POPEN: - case SPANS_VC_OPEN: - case SPANS_VC_CLOSE: - case SPANS_VC_ABORT: - /* XXX -- set cause */ - atm_cm_cleared(svp->sv_connvc); - break; - case SPANS_VC_NULL: - case SPANS_VC_R_POPEN: - case SPANS_VC_FREE: - break; - } - - /* - * Wait for user to free resources - */ - return(0); -} - - -/* - * Reset the switch state - * - * Called when the switch or host at the far end of the ATM link has - * gone away. This can be deteched either by a number of SPANS_STAT_REQ - * messages going unanswered or by the host epoch changing in a SPANS - * SPANS_STAT_IND or SPANS_STAT_REQ message. - * - * Arguments: - * spp pointer to SPANS protocol instance - * - * Returns: - * none - * - */ -void -spans_switch_reset(spp, cause) - struct spans *spp; - int cause; - -{ - int s; - struct vccb *vcp, *vnext; - - ATM_DEBUG2("spans_switch_reset: spp=%p, cause=%d\n", - spp, cause); - - /* - * Log the event - */ - log(LOG_INFO, "spans: signalling %s on interface %s%d\n", - (cause == SPANS_UNI_DOWN ? "down" : "up"), - spp->sp_pif->pif_name, - spp->sp_pif->pif_unit); - - /* - * Terminate all of our VCCs - */ - s = splnet(); - for (vcp = Q_HEAD(spp->sp_vccq, struct vccb); vcp; - vcp = vnext) { - - u_char outstate; - - vnext = Q_NEXT(vcp, struct vccb, vc_sigelem); - - if (vcp->vc_type & VCC_SVC) { - /* - * Close the SVC and notify the owner - */ - outstate = vcp->vc_sstate; - SPANS_VC_CANCEL((struct vccb *) vcp); - vcp->vc_ustate = VCCU_CLOSED; - vcp->vc_sstate = SPANS_VC_FREE; - if (outstate == SPANS_VC_OPEN || - outstate == SPANS_VC_POPEN) { - /* XXX -- set cause */ - atm_cm_cleared(vcp->vc_connvc); - } - } else if (vcp->vc_type & VCC_PVC) { - /* - * Note new state - */ - switch(cause) { - case SPANS_UNI_DOWN: - vcp->vc_sstate = SPANS_VC_ACT_DOWN; - break; - case SPANS_UNI_UP: - vcp->vc_sstate = SPANS_VC_ACTIVE; - break; - } - } else { - log(LOG_ERR, "spans: invalid VCC type: vccb=%p, type=%d\n", - vcp, vcp->vc_type); - } - } - (void) splx(s); -} Property changes on: head/sys/netatm/spans/spans_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_var.h =================================================================== --- head/sys/netatm/spans/spans_var.h (revision 179307) +++ head/sys/netatm/spans/spans_var.h (nonexistent) @@ -1,261 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * Protocol control blocks - * - */ - -#ifndef _SPANS_SPANS_VAR_H -#define _SPANS_SPANS_VAR_H - -#ifdef _KERNEL - -#include /* XXX arr: will remove rsn */ - -/* - * Constants to indicate the state of the signalling interface - */ -#define SPANS_UNI_UP 1 -#define SPANS_UNI_DOWN -1 - - -/* - * Structure containing state information for each SPANS protocol - * instance. There will be one instance for each ATM device interface - * using the SPANS signalling manager. - */ -struct spans { - struct siginst sp_inst; /* Header */ - struct atm_time sp_time; /* Timer controls */ - void (*sp_lower) /* Lower command handler */ - (int, void *, int, int); - Atm_connection *sp_conn; /* Signalling connection */ - long sp_s_epoch; /* Switch epoch */ - long sp_h_epoch; /* Host epoch */ - u_int sp_probe_ct; /* Status_req msgs unanswered */ - u_int sp_alloc_vci; /* Next VCI to allocate */ - u_int sp_alloc_vpi; /* Next VPI to allocate */ - u_int sp_min_vci; /* Lowest VCI to allocate */ - u_int sp_max_vci; /* Highest VCI to allocate */ - struct spanscls *sp_cls; /* CLS instance */ -}; - -#define sp_next sp_inst.si_next -#define sp_pif sp_inst.si_pif -#define sp_addr sp_inst.si_addr -#define sp_subaddr sp_inst.si_subaddr -#define sp_vccq sp_inst.si_vccq -#define sp_state sp_inst.si_state -#define sp_ipserv sp_inst.si_ipserv -#endif /* _KERNEL */ - -/* - * SPANS Protocol States - */ -#define SPANS_ACTIVE 1 /* Active */ -#define SPANS_DETACH 2 /* Detach in progress */ -#define SPANS_INIT 3 /* Initializing */ -#define SPANS_PROBE 4 /* Exchanging status info */ - -#define SPANS_PROBE_INTERVAL (ATM_HZ) /* Interval between SPANS_STAT_REQs */ -#define SPANS_PROBE_THRESH 10 /* Probe time-out threshold */ -#define SPANS_PROBE_ERR_WAIT (3 * ATM_HZ) /* Time to wait if send probe fails */ - - -#ifdef _KERNEL -/* - * SPANS Virtual Channel Connection control block. All information - * regarding the state of a SPANS-controlled VCC will be recorded here. - * There will be one SPANS VCC control block for each SPANS-controlled - * VCC. - */ -struct spans_vccb { - struct vccb vcp_hdr; /* Generic VCCB */ - u_short sv_retry; /* Xmit retry count */ - spans_atm_conn sv_conn; /* SPANS connection info */ - spans_resrc sv_spans_qos; /* QoS for VCC */ - spans_aal sv_spans_aal; /* AAL for VCC */ -}; - -#define sv_type vcp_hdr.vc_type -#define sv_proto vcp_hdr.vc_proto -#define sv_sstate vcp_hdr.vc_sstate -#define sv_ustate vcp_hdr.vc_ustate -#define sv_pif vcp_hdr.vc_pif -#define sv_nif vcp_hdr.vc_nif -#define sv_sigelem vcp_hdr.vc_sigelem -#define sv_time vcp_hdr.vc_time -#define sv_vpi vcp_hdr.vc_vpi -#define sv_vci vcp_hdr.vc_vci -#define sv_connvc vcp_hdr.vc_connvc -#define sv_ipdus vcp_hdr.vc_ipdus -#define sv_opdus vcp_hdr.vc_opdus -#define sv_ibytes vcp_hdr.vc_ibytes -#define sv_obytes vcp_hdr.vc_obytes -#define sv_ierrors vcp_hdr.vc_ierrors -#define sv_oerrors vcp_hdr.vc_oerrors -#define sv_tstamp vcp_hdr.vc_tstamp -#define sv_daddr sv_conn.daddr -#define sv_saddr sv_conn.saddr -#define sv_dsap sv_conn.dsap -#define sv_ssap sv_conn.ssap - -#define SV_MAX_RETRY 3 -#define SV_TIMEOUT (ATM_HZ) - -#endif /* _KERNEL */ - - -/* - * SPANS VCC Signalling Protocol States - */ -#define SPANS_VC_NULL 0 /* No state */ -#define SPANS_VC_ACTIVE 1 /* Active */ -#define SPANS_VC_ACT_DOWN 2 /* Active - Interface down */ -#define SPANS_VC_POPEN 3 /* VCC open in progress */ -#define SPANS_VC_R_POPEN 4 /* VCC rmt open in progress */ -#define SPANS_VC_OPEN 5 /* VCC open */ -#define SPANS_VC_CLOSE 6 /* VCC close in progress */ -#define SPANS_VC_ABORT 7 /* VCC abort in progress */ -#define SPANS_VC_FREE 8 /* Waiting for user to free resources */ - - -#ifdef _KERNEL -/* - * Macro to compare two SPANS addresses. - * - * Returns 0 if the addresses are equal. - */ -#define spans_addr_cmp(a, b) \ - (bcmp((caddr_t)a, (caddr_t)b, sizeof(struct spans_addr))) - -/* - * Macro to copy a SPANS address from a to b. - */ -#define spans_addr_copy(a, b) \ - (bcopy((caddr_t)a, (caddr_t)b, sizeof(struct spans_addr))) - - -/* - * Timer macros - */ -#define SPANS_TIMER(s, t) atm_timeout(&(s)->sp_time, (t), spans_timer) -#define SPANS_CANCEL(s) atm_untimeout(&(s)->sp_time) -#define SPANS_VC_TIMER(v, t) atm_timeout(&(v)->vc_time, (t), spans_vctimer) -#define SPANS_VC_CANCEL(v) atm_untimeout(&(v)->vc_time) - - -/* - * Global function declarations - */ -struct ipvcc; - - /* spans_arp.c */ -int spansarp_svcout(struct ipvcc *, struct in_addr *); -int spansarp_svcin(struct ipvcc *, Atm_addr *, Atm_addr *); -int spansarp_svcactive(struct ipvcc *); -void spansarp_vcclose(struct ipvcc *); -void spansarp_ipact(struct spanscls *); -void spansarp_ipdact(struct spanscls *); -void spansarp_start(void); -void spansarp_stop(void); -void spansarp_input(struct spanscls *, KBuffer *); -int spansarp_ioctl(int, caddr_t, caddr_t); - - /* spans_cls.c */ -int spanscls_start(void); -void spanscls_stop(void); -int spanscls_attach(struct spans *); -void spanscls_detach(struct spans *); -void spanscls_closevc(struct spanscls *, struct t_atm_cause *); - - /* spans_if.c */ -int spans_abort(struct vccb *); -int spans_free(struct vccb *); - - /* spans_msg.c */ -int spans_send_msg(struct spans *, spans_msg *); -int spans_send_open_req(struct spans *, struct spans_vccb *); -int spans_send_open_rsp(struct spans *, - struct spans_vccb *, - spans_result); -int spans_send_close_req(struct spans *, - struct spans_vccb *); -void spans_rcv_msg(struct spans *, KBuffer *); - - /* spans_print.c */ -void spans_print_msg(spans_msg *); - - /* spans_proto.c */ -void spans_timer(struct atm_time *); -void spans_vctimer(struct atm_time *); -void spans_upper(int, void *, int, int); -void spans_notify(void *, int, int); - - /* spans_subr.c */ -int spans_open_vcc(struct spans *, Atm_connvc *); -int spans_close_vcc(struct spans *, struct spans_vccb *, int); -int spans_clear_vcc(struct spans *, struct spans_vccb *); -void spans_switch_reset(struct spans *, int); - - /* spans_util.c */ -int spans_get_spans_sap(Sap_t, spans_sap *); -int spans_get_local_sap(spans_sap, Sap_t *); -int spans_ephemeral_sap(struct spans *); -int spans_get_spans_aal(Aal_t, spans_aal *); -int spans_get_local_aal(spans_aal, Aal_t *); -int spans_verify_vccb(struct spans *, struct spans_vccb *); -struct spans_vccb * - spans_find_vpvc(struct spans *, int, int, u_char); -struct spans_vccb * - spans_find_conn(struct spans *, struct spans_atm_conn *); -spans_vpvc spans_alloc_vpvc(struct spans *); -char * spans_addr_print(struct spans_addr *); -void spans_dump_buffer(KBuffer *); - - -/* - * External variables - */ -extern struct spans_addr spans_bcastaddr; -extern uma_zone_t spans_vc_zone; -extern uma_zone_t spans_msg_zone; -extern struct t_atm_cause spans_cause; - -#ifdef SYSCTL_DECL -SYSCTL_DECL(_net_harp_spans); -#endif - -#endif /* _KERNEL */ - -#endif /* _SPANS_SPANS_VAR_H */ Property changes on: head/sys/netatm/spans/spans_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_xdr.x =================================================================== --- head/sys/netatm/spans/spans_xdr.x (revision 179307) +++ head/sys/netatm/spans/spans_xdr.x (nonexistent) @@ -1,513 +0,0 @@ -%/*- -% * -% * =================================== -% * 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$ -% * -% */ -% -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS Protocol Message XDR Specification - * - */ - -#ifdef RPC_HDR -%/* -% * SPANS Signalling Manager -% * --------------------------- -% * -% * SPANS Protocol Message Definitions -% * -% */ -% -%#ifndef _SPANS_SPANS_XDR_H -%#define _SPANS_SPANS_XDR_H -% -%#include -% -#endif - -#ifdef RPC_XDR -%/* -% * SPANS Signalling Manager -% * --------------------------- -% * -% * SPANS Protocol Message XDR Routines -% * -% */ -% -%#ifndef lint -%static const char RCSid[] = "@(#) $FreeBSD$"; -%#endif -% -#endif - - -/* - * SPANS Signalling - */ -const SPANS_SIG_VPI = 0; /* Signalling VPI */ -const SPANS_SIG_VCI = 15; /* Signalling VCI */ -const SPANS_CLS_VPI = 0; /* Connectionless VPI */ -const SPANS_CLS_VCI = 14; /* Connectionless VCI */ - -const SPANS_MIN_VCI = 32; /* Lowest VCI to allocate */ -const SPANS_MAX_VCI = 1023; /* Highest VCI to allocate */ -const SPANS_VPI = 0; /* Only VPI to allocate */ - -/* - * SPANS Protocol Version - * - * Major_version * 256 + Minor_version - */ -typedef u_int spans_version; - -const SPANS_VERS_1_0 = 0x0100; /* Version 1.0 */ - - -/* - * VPI/VCI - * - * Format: - * 4 bits - unused - * 12 bits - VPI value - * 16 bits - VCI value - */ -typedef u_int spans_vpvc; /* VPI/VCI value */ - -#ifdef RPC_HDR -%#define SPANS_EXTRACT_VPI(p) (((p) >> 16) & 0x0FFF) -%#define SPANS_EXTRACT_VCI(p) ((p) & 0x0FFFF) -%#define SPANS_PACK_VPIVCI(p, c) ((((p) & 0x0FFF) << 16) | ((c) & 0x0FFFF)) -#endif - - -/* - * VPI/VCI Preference - */ -struct spans_vpvc_pref { - bool vpf_valid; /* VPI/VCI values valid */ - spans_vpvc vpf_vpvc; /* VPI/VCI value */ -}; - - -/* - * SPANS ATM Address - */ -struct spans_addr { - opaque addr[8]; /* SPANS ATM address */ -}; - - -/* - * Service Access Point (SAP) - */ -typedef u_int spans_sap; /* SAP value */ - -const SPANS_SAP_IP = 1025; /* TCP/IP */ -const SPANS_SAP_EPHEMERAL = 2048; /* Start of ephemeral SAPs*/ - - -/* - * ATM Connection Identifier - */ -struct spans_atm_conn { - spans_addr con_dst; /* Destination ATM address */ - spans_addr con_src; /* Source ATM address */ - spans_sap con_dsap; /* Destination SAP */ - spans_sap con_ssap; /* Source SAP */ -}; - - -/* - * Connection Resources - */ -struct spans_resrc { - u_int rsc_peak; /* Peak bandwidth (Kbps) */ - u_int rsc_mean; /* Mean bandwidth (Kbps) */ - u_int rsc_burst; /* Mean burst (Kb) */ -}; - - -/* - * ATM Adaptation Layer (AAL) Types - */ -enum spans_aal { - SPANS_AAL0 = 0, /* NULL AAL */ - SPANS_AAL1 = 1, /* AAL 1 */ - SPANS_AAL2 = 2, /* AAL 2 */ - SPANS_AAL3 = 3, /* AAL 3 */ - SPANS_AAL4 = 4, /* AAL 4 */ - SPANS_AAL5 = 5 /* AAL 5 */ -}; - - -/* - * Result Codes - */ -enum spans_result { - SPANS_OK = 0, /* Success */ - SPANS_FAIL = 1, /* Failure */ - SPANS_NOVPVC = 2, /* No VP/VC */ - SPANS_NORSC = 3, /* No resources */ - SPANS_BADDEST = 4 /* Bad destination */ -}; - - -/* - * Message Types - */ -enum spans_msgtype { - /* - * SPANS UNI message types - */ - SPANS_STAT_REQ = 0, /* Status request */ - SPANS_STAT_IND = 1, /* Status indication */ - SPANS_STAT_RSP = 2, /* Status response */ - SPANS_OPEN_REQ = 3, /* Open request */ - SPANS_OPEN_IND = 4, /* Open indication */ - SPANS_OPEN_RSP = 5, /* Open response */ - SPANS_OPEN_CNF = 6, /* Open confirmation */ - SPANS_CLOSE_REQ = 7, /* Close request */ - SPANS_CLOSE_IND = 8, /* Close indication */ - SPANS_CLOSE_RSP = 9, /* Close response */ - SPANS_CLOSE_CNF = 10, /* Close confirmation */ - SPANS_RCLOSE_REQ = 11, /* Reverse close request */ - SPANS_RCLOSE_IND = 12, /* Reverse close indication */ - SPANS_RCLOSE_RSP = 13, /* Reverse close response */ - SPANS_RCLOSE_CNF = 14, /* Reverse close confirmation */ - SPANS_MULTI_REQ = 15, /* Multicast request */ - SPANS_MULTI_IND = 16, /* Multicast indication */ - SPANS_MULTI_RSP = 17, /* Multicast response */ - SPANS_MULTI_CNF = 18, /* Multicast confirmation */ - SPANS_ADD_REQ = 19, /* Add request */ - SPANS_ADD_IND = 20, /* Add indication */ - SPANS_ADD_RSP = 21, /* Add response */ - SPANS_ADD_CNF = 22, /* Add confirmation */ - SPANS_JOIN_REQ = 23, /* Join request */ - SPANS_JOIN_CNF = 24, /* Join confirmation */ - SPANS_LEAVE_REQ = 25, /* Leave request */ - SPANS_LEAVE_CNF = 26, /* Leave confirmation */ - - /* - * SPANS NNI message types - */ - SPANS_NSAP_IND = 99, /* NSAP routing message */ - SPANS_MAP_IND = 100, /* Topology message */ - SPANS_SETUP_REQ = 101, /* Setup request */ - SPANS_SETUP_RSP = 102, /* Setup response */ - SPANS_CHANGE_REQ = 103, /* Change request */ - SPANS_CHANGE_RSP = 104, /* Change response */ - SPANS_RELOC_REQ = 105, /* Relocation request */ - SPANS_RELOC_RSP = 106, /* Relocation response */ - SPANS_HELLO_IND = 107, /* Hello message */ - - SPANS_VCIR_IND = 108, /* VCI range indication */ - SPANS_QUERY_REQ = 110, /* Conn. state query request */ - SPANS_QUERY_RSP = 111 /* Conn. state query response */ -}; - - -/* - * Query types - */ -enum spans_query_type { - SPANS_QUERY_NORMAL, /* Normal--respond */ - SPANS_QUERY_DEBUG, /* Debug--respond with state */ - SPANS_QUERY_END_TO_END /* Not implemented */ -}; - - -/* - * SPANS connection states - */ -enum spans_conn_state { - SPANS_CONN_OPEN, /* Connection is open */ - SPANS_CONN_OPEN_PEND, /* Connection is being opened */ - SPANS_CONN_CLOSE_PEND, /* Connection is being closed */ - SPANS_CONN_CLOSED /* Connection does not exist */ -}; - - -/* - * Message Parameters - * - * There is a separate message parameter structure for each - * message type. - */ -struct spans_parm_stat_req { - u_long streq_es_epoch; /* End system epoch */ -}; - -struct spans_parm_stat_ind { - u_long stind_sw_epoch; /* Switch epoch */ - spans_addr stind_es_addr; /* End system ATM address */ - spans_addr stind_sw_addr; /* Switch ATM address */ -}; - -struct spans_parm_stat_rsp { - u_long strsp_es_epoch; /* End system epoch */ - spans_addr strsp_es_addr; /* End system ATM address */ -}; - -struct spans_parm_open_req { - spans_atm_conn opreq_conn; /* Connection identity */ - spans_aal opreq_aal; /* AAL type */ - spans_resrc opreq_desrsrc; /* Desired resources */ - spans_resrc opreq_minrsrc; /* Minimum resources */ - spans_vpvc_pref opreq_vpvc; /* VPI/VCI preference */ -}; - -struct spans_parm_open_ind { - spans_atm_conn opind_conn; /* Connection identity */ - spans_aal opind_aal; /* AAL type */ - spans_resrc opind_desrsrc; /* Desired resources */ - spans_resrc opind_minrsrc; /* Minimum resources */ - spans_vpvc_pref opind_vpvc; /* VPI/VCI preference */ -}; - -struct spans_parm_open_rsp { - spans_atm_conn oprsp_conn; /* Connection identity */ - spans_result oprsp_result; /* Open result */ - spans_resrc oprsp_rsrc; /* Allocated resources */ - spans_vpvc oprsp_vpvc; /* Allocated VPI/VCI */ -}; - -struct spans_parm_open_cnf { - spans_atm_conn opcnf_conn; /* Connection identity */ - spans_result opcnf_result; /* Open result */ - spans_resrc opcnf_rsrc; /* Allocated resources */ - spans_vpvc opcnf_vpvc; /* Allocated VPI/VCI */ -}; - -struct spans_parm_close_req { - spans_atm_conn clreq_conn; /* Connection identity */ -}; - -struct spans_parm_close_ind { - spans_atm_conn clind_conn; /* Connection identity */ -}; - -struct spans_parm_close_rsp { - spans_atm_conn clrsp_conn; /* Connection identity */ - spans_result clrsp_result; /* Close result */ -}; - -struct spans_parm_close_cnf { - spans_atm_conn clcnf_conn; /* Connection identity */ - spans_result clcnf_result; /* Close result */ -}; - -struct spans_parm_rclose_req { - spans_atm_conn rcreq_conn; /* Connection identity */ -}; - -struct spans_parm_rclose_ind { - spans_atm_conn rcind_conn; /* Connection identity */ -}; - -struct spans_parm_rclose_rsp { - spans_atm_conn rcrsp_conn; /* Connection identity */ - spans_result rcrsp_result; /* Rclose result */ -}; - -struct spans_parm_rclose_cnf { - spans_atm_conn rccnf_conn; /* Connection identity */ - spans_result rccnf_result; /* Rclose result */ -}; - -struct spans_parm_multi_req { - spans_atm_conn mureq_conn; /* Connection identity */ - spans_aal mureq_aal; /* AAL type */ - spans_resrc mureq_desrsrc; /* Desired resources */ - spans_resrc mureq_minrsrc; /* Minimum resources */ - spans_vpvc mureq_vpvc; /* VPI/VCI preference */ -}; - -struct spans_parm_multi_ind { - spans_atm_conn muind_conn; /* Connection identity */ - spans_aal muind_aal; /* AAL type */ - spans_resrc muind_desrsrc; /* Desired resources */ - spans_resrc muind_minrsrc; /* Minimum resources */ - spans_vpvc muind_vpvc; /* VPI/VCI preference */ -}; - -struct spans_parm_multi_rsp { - spans_atm_conn mursp_conn; /* Connection identity */ - spans_result mursp_result; /* Multi result */ - spans_resrc mursp_rsrc; /* Allocated resources */ - spans_vpvc mursp_vpvc; /* Allocated VPI/VCI */ -}; - -struct spans_parm_multi_cnf { - spans_atm_conn mucnf_conn; /* Connection identity */ - spans_result mucnf_result; /* Multi result */ - spans_resrc mucnf_rsrc; /* Allocated resources */ - spans_vpvc mucnf_vpvc; /* Allocated VPI/VCI */ -}; - -struct spans_parm_add_req { - spans_atm_conn adreq_desconn; /* Desired connection identity */ - spans_atm_conn adreq_xstconn; /* Existing connection identity */ -}; - -struct spans_parm_add_ind { - spans_atm_conn adind_desconn; /* Desired connection identity */ - spans_atm_conn adind_xstconn; /* Existing connection identity */ -}; - -struct spans_parm_add_rsp { - spans_atm_conn adrsp_conn; /* Connection identity */ - spans_result adrsp_result; /* Add result */ - spans_resrc adrsp_rsrc; /* Allocated resources */ -}; - -struct spans_parm_add_cnf { - spans_atm_conn adcnf_conn; /* Connection identity */ - spans_result adcnf_result; /* Add result */ - spans_resrc adcnf_rsrc; /* Allocated resources */ -}; - -struct spans_parm_join_req { - spans_addr jnreq_addr; /* Group address */ -}; - -struct spans_parm_join_cnf { - spans_addr jncnf_addr; /* Group address */ - spans_result jncnf_result; /* Join result */ -}; - -struct spans_parm_leave_req { - spans_addr lvreq_addr; /* Group address */ -}; - -struct spans_parm_leave_cnf { - spans_addr lvcnf_addr; /* Group address */ - spans_result lvcnf_result; /* Leave result */ -}; - -struct spans_parm_vcir_ind { - u_int vrind_min; /* Lowest VCI available */ - u_int vrind_max; /* Highest VCI available */ -}; - -struct spans_parm_query_req { - spans_atm_conn qyreq_conn; /* Conn. being queried */ - spans_query_type qyreq_type; /* Query type */ -}; - -struct spans_parm_query_rsp { - spans_atm_conn qyrsp_conn; /* Conn. being queried */ - spans_query_type qyrsp_type; /* Query type */ - spans_conn_state qyrsp_state; /* Conn. state */ - u_int qyrsp_data; /* Extra state data */ -}; - - -/* - * Message Body - */ -union spans_msgbody switch (spans_msgtype mb_type) { - -case SPANS_STAT_REQ: spans_parm_stat_req mb_stat_req; -case SPANS_STAT_IND: spans_parm_stat_ind mb_stat_ind; -case SPANS_STAT_RSP: spans_parm_stat_rsp mb_stat_rsp; -case SPANS_OPEN_REQ: spans_parm_open_req mb_open_req; -case SPANS_OPEN_IND: spans_parm_open_ind mb_open_ind; -case SPANS_OPEN_RSP: spans_parm_open_rsp mb_open_rsp; -case SPANS_OPEN_CNF: spans_parm_open_cnf mb_open_cnf; -case SPANS_CLOSE_REQ: spans_parm_close_req mb_close_req; -case SPANS_CLOSE_IND: spans_parm_close_ind mb_close_ind; -case SPANS_CLOSE_RSP: spans_parm_close_rsp mb_close_rsp; -case SPANS_CLOSE_CNF: spans_parm_close_cnf mb_close_cnf; -case SPANS_RCLOSE_REQ: spans_parm_rclose_req mb_rclose_req; -case SPANS_RCLOSE_IND: spans_parm_rclose_ind mb_rclose_ind; -case SPANS_RCLOSE_RSP: spans_parm_rclose_rsp mb_rclose_rsp; -case SPANS_RCLOSE_CNF: spans_parm_rclose_cnf mb_rclose_cnf; -case SPANS_MULTI_REQ: spans_parm_multi_req mb_multi_req; -case SPANS_MULTI_IND: spans_parm_multi_ind mb_multi_ind; -case SPANS_MULTI_RSP: spans_parm_multi_rsp mb_multi_rsp; -case SPANS_MULTI_CNF: spans_parm_multi_cnf mb_multi_cnf; -case SPANS_ADD_REQ: spans_parm_add_req mb_add_req; -case SPANS_ADD_IND: spans_parm_add_ind mb_add_ind; -case SPANS_ADD_RSP: spans_parm_add_rsp mb_add_rsp; -case SPANS_ADD_CNF: spans_parm_add_cnf mb_add_cnf; -case SPANS_JOIN_REQ: spans_parm_join_req mb_join_req; -case SPANS_JOIN_CNF: spans_parm_join_cnf mb_join_cnf; -case SPANS_LEAVE_REQ: spans_parm_leave_req mb_leave_req; -case SPANS_LEAVE_CNF: spans_parm_leave_cnf mb_leave_cnf; -case SPANS_VCIR_IND: spans_parm_vcir_ind mb_vcir_ind; -case SPANS_QUERY_REQ: spans_parm_query_req mb_query_req; -case SPANS_QUERY_RSP: spans_parm_query_rsp mb_query_rsp; -}; - - -/* - * Message Format - */ -struct spans_msg { - spans_version sm_vers; - spans_msgbody sm_body; -}; - -#ifdef RPC_HDR -%#define sm_type sm_body.mb_type -%#define sm_stat_req sm_body.spans_msgbody_u.mb_stat_req -%#define sm_stat_ind sm_body.spans_msgbody_u.mb_stat_ind -%#define sm_stat_rsp sm_body.spans_msgbody_u.mb_stat_rsp -%#define sm_open_req sm_body.spans_msgbody_u.mb_open_req -%#define sm_open_ind sm_body.spans_msgbody_u.mb_open_ind -%#define sm_open_rsp sm_body.spans_msgbody_u.mb_open_rsp -%#define sm_open_cnf sm_body.spans_msgbody_u.mb_open_cnf -%#define sm_close_req sm_body.spans_msgbody_u.mb_close_req -%#define sm_close_ind sm_body.spans_msgbody_u.mb_close_ind -%#define sm_close_rsp sm_body.spans_msgbody_u.mb_close_rsp -%#define sm_close_cnf sm_body.spans_msgbody_u.mb_close_cnf -%#define sm_rclose_req sm_body.spans_msgbody_u.mb_rclose_req -%#define sm_rclose_ind sm_body.spans_msgbody_u.mb_rclose_ind -%#define sm_rclose_rsp sm_body.spans_msgbody_u.mb_rclose_rsp -%#define sm_rclose_cnf sm_body.spans_msgbody_u.mb_rclose_cnf -%#define sm_multi_req sm_body.spans_msgbody_u.mb_multi_req -%#define sm_multi_ind sm_body.spans_msgbody_u.mb_multi_ind -%#define sm_multi_rsp sm_body.spans_msgbody_u.mb_multi_rsp -%#define sm_multi_cnf sm_body.spans_msgbody_u.mb_multi_cnf -%#define sm_add_req sm_body.spans_msgbody_u.mb_add_req -%#define sm_add_ind sm_body.spans_msgbody_u.mb_add_ind -%#define sm_add_rsp sm_body.spans_msgbody_u.mb_add_rsp -%#define sm_add_cnf sm_body.spans_msgbody_u.mb_add_cnf -%#define sm_join_req sm_body.spans_msgbody_u.mb_join_req -%#define sm_join_cnf sm_body.spans_msgbody_u.mb_join_cnf -%#define sm_leave_req sm_body.spans_msgbody_u.mb_leave_req -%#define sm_leave_cnf sm_body.spans_msgbody_u.mb_leave_cnf -%#define sm_vcir_ind sm_body.spans_msgbody_u.mb_vcir_ind -%#define sm_query_req sm_body.spans_msgbody_u.mb_query_req -%#define sm_query_rsp sm_body.spans_msgbody_u.mb_query_rsp -#endif - -#ifdef RPC_HDR -%#endif /* _SPANS_SPANS_XDR_H */ -#endif Property changes on: head/sys/netatm/spans/spans_xdr.x ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_cls.c =================================================================== --- head/sys/netatm/spans/spans_cls.c (revision 179307) +++ head/sys/netatm/spans/spans_cls.c (nonexistent) @@ -1,859 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * SPANS Connectionless Datagram Service (CLS) module - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "spans_xdr.h" -#include -#include - -#include - -/* - * Global variables - */ -int spanscls_print = 0; -SYSCTL_INT(_net_harp_spans, OID_AUTO, spanscls_print, CTLFLAG_RW, - &spanscls_print, 0, "dump SPANS packets"); - -struct spanscls *spanscls_head = NULL; - -struct spans_addr spans_bcastaddr = { - { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } -}; - -struct spanscls_hdr spanscls_hdr = { - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* dst */ - { { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }, /* src */ - 0x00, 0x00, 0, - 0xaa, 0xaa, 0x03, { 0x00, 0x00, 0x00 }, 0 /* LLC SNAP */ -}; - - -/* - * Local functions - */ -static int spanscls_ipact(struct ip_nif *); -static int spanscls_ipdact(struct ip_nif *); -static int spanscls_bcast_output(struct ip_nif *, KBuffer *); -static void spanscls_cpcs_data(void *, KBuffer *); -static void spanscls_connected(void *); -static void spanscls_cleared(void *, struct t_atm_cause *); -static caddr_t spanscls_getname(void *); -static void spanscls_pdu_print(const struct spanscls *, const KBuffer *, - const char *); - -/* - * Local variables - */ -static uma_zone_t spanscls_zone; - -static struct ip_serv spanscls_ipserv = { - spanscls_ipact, - spanscls_ipdact, - spansarp_ioctl, - NULL, - spansarp_svcout, - spansarp_svcin, - spansarp_svcactive, - spansarp_vcclose, - spanscls_bcast_output, - { - {ATM_AAL5, ATM_ENC_NULL}, - {ATM_AAL3_4, ATM_ENC_NULL} - } -}; - -static u_char spanscls_bridged[] = { - 0x00, 0x00, 0x00, 0x00, - 0xaa, 0xaa, 0x03, 0x00, 0x80, 0xc2 /* LLC SNAP */ -}; - -static Atm_endpoint spanscls_endpt = { - NULL, - ENDPT_SPANS_CLS, - NULL, - spanscls_getname, - spanscls_connected, - spanscls_cleared, - NULL, - NULL, - NULL, - NULL, - spanscls_cpcs_data, - NULL, - NULL, - NULL, - NULL -}; - -static Atm_attributes spanscls_attr = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL3_4 - }, - { /* traffic */ - T_ATM_PRESENT, - { - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - { - T_ATM_ABSENT, - 0, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_ATM_ABSENT, - T_NO - }, - T_YES - }, - }, - { /* bearer */ - T_ATM_PRESENT, - { - T_ATM_CLASS_X, - T_ATM_NULL, - T_ATM_NULL, - T_NO, - T_ATM_1_TO_1 - } - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT - }, - { /* llc */ - T_ATM_ABSENT - }, - { /* called */ - T_ATM_PRESENT, - }, - { /* calling */ - T_ATM_ABSENT - }, - { /* qos */ - T_ATM_PRESENT, - { - T_ATM_NETWORK_CODING, - { - T_ATM_QOS_CLASS_0, - }, - { - T_ATM_QOS_CLASS_0 - } - } - }, - { /* transit */ - T_ATM_ABSENT - }, - { /* cause */ - T_ATM_ABSENT - } -}; - -static struct t_atm_cause spanscls_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_UNSPECIFIED_NORMAL, - {0, 0, 0, 0} -}; - - -/* - * Process module loading - * - * Called whenever the spans module is initializing. - * - * Arguments: - * none - * - * Returns: - * 0 initialization successful - * errno initialization failed - reason indicated - * - */ -int -spanscls_start() -{ - int err; - - spanscls_zone = uma_zcreate("spanscls", sizeof(struct spanscls), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (spanscls_zone == NULL) - panic("spanscls_zone"); - - /* - * Fill in union fields - */ - spanscls_attr.aal.v.aal4.forward_max_SDU_size = ATM_NIF_MTU; - spanscls_attr.aal.v.aal4.backward_max_SDU_size = ATM_NIF_MTU; - spanscls_attr.aal.v.aal4.SSCS_type = T_ATM_NULL; - spanscls_attr.aal.v.aal4.mid_low = 0; - spanscls_attr.aal.v.aal4.mid_high = 1023; - - /* - * Register our endpoint - */ - err = atm_endpoint_register(&spanscls_endpt); - - return (err); -} - - -/* - * Process module unloading notification - * - * Called whenever the spans module is about to be unloaded. All signalling - * instances will have been previously detached. All spanscls resources - * must be freed now. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -spanscls_stop() -{ - int s = splnet(); - - /* - * Tell ARP to stop - */ - spansarp_stop(); - - /* - * Nothing should be left here... - */ - if (spanscls_head) { - panic("spanscls_stop: bad state"); - } - (void) splx(s); - - /* - * De-register ourselves - */ - (void) atm_endpoint_deregister(&spanscls_endpt); - - /* - * Free our storage pools - */ - uma_zdestroy(spanscls_zone); -} - - -/* - * Process signalling interface attach - * - * This function is called whenever a physical interface has been attached - * to spans. We will open the CLS PVC and await further events. - * - * Called at splnet. - * - * Arguments: - * spp pointer to spans signalling protocol instance - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -int -spanscls_attach(spp) - struct spans *spp; -{ - struct spanscls *clp; - Atm_addr_pvc *pvcp; - int err; - - /* - * Get a new cls control block - */ - clp = uma_zalloc(spanscls_zone, M_WAITOK); - if (clp == NULL) - return (ENOMEM); - - /* - * Initialize some stuff - */ - clp->cls_state = CLS_CLOSED; - clp->cls_spans = spp; - spp->sp_ipserv = &spanscls_ipserv; - - /* - * Fill out connection attributes - */ - spanscls_attr.nif = spp->sp_pif->pif_nif; - spanscls_attr.traffic.v.forward.PCR_all_traffic = spp->sp_pif->pif_pcr; - spanscls_attr.traffic.v.backward.PCR_all_traffic = spp->sp_pif->pif_pcr; - spanscls_attr.called.addr.address_format = T_ATM_PVC_ADDR; - spanscls_attr.called.addr.address_length = sizeof(Atm_addr_pvc); - pvcp = (Atm_addr_pvc *)spanscls_attr.called.addr.address; - ATM_PVC_SET_VPI(pvcp, SPANS_CLS_VPI); - ATM_PVC_SET_VCI(pvcp, SPANS_CLS_VCI); - spanscls_attr.called.subaddr.address_format = T_ATM_ABSENT; - spanscls_attr.called.subaddr.address_length = 0; - - /* - * Create SPANS Connectionless Service (CLS) PVC - */ - err = atm_cm_connect(&spanscls_endpt, clp, &spanscls_attr, - &clp->cls_conn); - if (err) { - uma_zfree(spanscls_zone, clp); - return (err); - } - - /* - * Set new state and link instance - */ - clp->cls_state = CLS_OPEN; - LINK2TAIL(clp, struct spanscls, spanscls_head, cls_next); - spp->sp_cls = clp; - - return (0); -} - - -/* - * Process signalling interface detach - * - * This function is called whenever a physical interface has been detached - * from spans. We will close the CLS PVC and clean up everything. - * - * Called at splnet. - * - * Arguments: - * spp pointer to spans signalling protocol instance - * - * Returns: - * none - * - */ -void -spanscls_detach(spp) - struct spans *spp; -{ - struct spanscls *clp; - - /* - * Get our control block - */ - clp = spp->sp_cls; - if (clp == NULL) - return; - - /* - * Just checking up on things... - */ - if (clp->cls_ipnif) - panic("spanscls_detach: IP interface still active"); - - /* - * Close CLS PVC - */ - spanscls_closevc(clp, &spanscls_cause); - - /* - * Sever links and free server block, if possible - */ - clp->cls_spans = NULL; - spp->sp_cls = NULL; - if (clp->cls_state == CLS_CLOSED) { - UNLINK(clp, struct spanscls, spanscls_head, cls_next); - uma_zfree(spanscls_zone, clp); - } -} - - -/* - * Process IP Network Interface Activation - * - * Called whenever an IP network interface becomes active. - * - * Called at splnet. - * - * Arguments: - * inp pointer to IP network interface - * - * Returns: - * 0 command successful - * errno command failed - reason indicated - * - */ -static int -spanscls_ipact(inp) - struct ip_nif *inp; -{ - struct spans *spp; - struct spanscls *clp; - - /* - * Get corresponding cls instance - */ - spp = (struct spans *)inp->inf_nif->nif_pif->pif_siginst; - if ((spp == NULL) || ((clp = spp->sp_cls) == NULL)) - return (ENXIO); - - /* - * Make sure it's not already activated - */ - if (clp->cls_ipnif) - return (EEXIST); - - /* - * Set two-way links with IP world - */ - clp->cls_ipnif = inp; - inp->inf_isintf = (caddr_t)clp; - - /* - * Tell arp about new interface - */ - spansarp_ipact(clp); - - return (0); -} - - -/* - * Process IP Network Interface Deactivation - * - * Called whenever an IP network interface becomes inactive. - * - * Called at splnet. - * - * Arguments: - * inp pointer to IP network interface - * - * Returns: - * 0 command successful - * errno command failed - reason indicated - * - */ -static int -spanscls_ipdact(inp) - struct ip_nif *inp; -{ - struct spanscls *clp; - - /* - * Get cls instance and make sure it's been activated - */ - clp = (struct spanscls *)inp->inf_isintf; - if ((clp == NULL) || (clp->cls_ipnif == NULL)) - return (ENXIO); - - /* - * Let arp know about this - */ - spansarp_ipdact(clp); - - /* - * Clear IP interface pointer - */ - clp->cls_ipnif = NULL; - return (0); -} - - -/* - * Output IP Broadcast Packet - * - * Called whenever an IP broadcast packet is sent to this interface. - * - * Arguments: - * inp pointer to IP network interface - * m pointer to packet buffer chain - * - * Returns: - * 0 packet sent successfully - * errno send failed - reason indicated - * - */ -static int -spanscls_bcast_output(inp, m) - struct ip_nif *inp; - KBuffer *m; -{ - struct spans *spp; - struct spanscls *clp; - struct spanscls_hdr *chp; - int err, space; - - /* - * Get cls instance and make sure it's been activated - */ - clp = (struct spanscls *)inp->inf_isintf; - if ((clp == NULL) || (clp->cls_ipnif == NULL)) { - KB_FREEALL(m); - return (ENETDOWN); - } - - /* - * Make sure that we know our addresses - */ - spp = clp->cls_spans; - if (spp->sp_addr.address_format != T_ATM_SPANS_ADDR) { - KB_FREEALL(m); - return (ENETDOWN); - } - - /* - * See if there's room to add CLS header to front of packet. - */ - KB_HEADROOM(m, space); - if (space < sizeof(struct spanscls_hdr)) { - KBuffer *n; - - /* - * We have to allocate another buffer and tack it - * onto the front of the packet - */ - KB_ALLOCPKT(n, sizeof(struct spanscls_hdr), - KB_F_NOWAIT, KB_T_HEADER); - if (n == 0) { - KB_FREEALL(m); - return (ENOBUFS); - } - KB_TAILALIGN(n, sizeof(struct spanscls_hdr)); - KB_LINKHEAD(n, m); - m = n; - } else { - /* - * Header fits, just adjust buffer controls - */ - KB_HEADADJ(m, sizeof(struct spanscls_hdr)); - } - - /* - * Now, build the CLS header - */ - KB_DATASTART(m, chp, struct spanscls_hdr *); - spans_addr_copy(&spans_bcastaddr, &chp->ch_dst); - spans_addr_copy(spp->sp_addr.address, &chp->ch_src); - *(u_int *)&chp->ch_proto = *(u_int *)&spanscls_hdr.ch_proto; - *(u_int *)&chp->ch_dsap = *(u_int *)&spanscls_hdr.ch_dsap; - *(u_short *)&chp->ch_oui[1] = *(u_short *)&spanscls_hdr.ch_oui[1]; - chp->ch_pid = htons(ETHERTYPE_IP); - - if (spanscls_print) - spanscls_pdu_print(clp, m, "output"); - - /* - * Finally, send the pdu via the CLS service - */ - err = atm_cm_cpcs_data(clp->cls_conn, m); - if (err) { - KB_FREEALL(m); - return (ENOBUFS); - } - - return (0); -} - - -/* - * Process VCC Input Data - * - * All input packets received from CLS VCC lower layers are processed here. - * - * Arguments: - * tok connection token (pointer to CLS VCC control block) - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -spanscls_cpcs_data(tok, m) - void *tok; - KBuffer *m; -{ - struct spanscls *clp = tok; - struct spans *spp = clp->cls_spans; - struct spanscls_hdr *chp; - struct ip_nif *inp; - - /* - * Make sure we're ready - */ - if ((clp->cls_state != CLS_OPEN) || (spp->sp_state != SPANS_ACTIVE)) { - KB_FREEALL(m); - return; - } - - if (spanscls_print) - spanscls_pdu_print(clp, m, "input"); - - /* - * Get CLS header into buffer - */ - if (KB_LEN(m) < sizeof(struct spanscls_hdr)) { - KB_PULLUP(m, sizeof(struct spanscls_hdr), m); - if (m == 0) - return; - } - KB_DATASTART(m, chp, struct spanscls_hdr *); - - /* - * Verify packet information - */ - if ((*(u_int *)&chp->ch_proto != *(u_int *)&spanscls_hdr.ch_proto) || - (*(u_int *)&chp->ch_dsap != *(u_int *)&spanscls_hdr.ch_dsap) || - (*(u_short *)&chp->ch_oui[1] != - *(u_short *)&spanscls_hdr.ch_oui[1])) { - - /* - * Check for bridged PDU - */ - if (bcmp((char *)&chp->ch_proto, (char *)spanscls_bridged, - sizeof(spanscls_bridged))) { - log(LOG_ERR, "spanscls_input: bad format\n"); - if (spanscls_print) - spanscls_pdu_print(clp, m, "input error"); - } - - KB_FREEALL(m); - return; - } - - /* - * Make sure packet is for us - */ - if (spans_addr_cmp(&chp->ch_dst, spp->sp_addr.address) && - spans_addr_cmp(&chp->ch_dst, &spans_bcastaddr)) { - KB_FREEALL(m); - return; - } - - /* - * Do protocol processing - */ - switch (ntohs(chp->ch_pid)) { - - case ETHERTYPE_IP: - /* - * Drop CLS header - */ - KB_HEADADJ(m, -sizeof(struct spanscls_hdr)); - KB_PLENADJ(m, -sizeof(struct spanscls_hdr)); - - /* - * Packet is ready for input to IP - */ - if ((inp = clp->cls_ipnif) != NULL) - (void) (*inp->inf_ipinput)(inp, m); - else - KB_FREEALL(m); - break; - - case ETHERTYPE_ARP: - spansarp_input(clp, m); - break; - - default: - log(LOG_ERR, "spanscls_input: unknown protocol 0x%x\n", - chp->ch_pid); - KB_FREEALL(m); - return; - } -} - - -/* - * Close a SPANS CLS VCC - * - * This function will close a SPANS CLS VCC. - * - * Arguments: - * clp pointer to CLS instance - * cause pointer to cause code - * - * Returns: - * none - * - */ -void -spanscls_closevc(clp, cause) - struct spanscls *clp; - struct t_atm_cause *cause; -{ - int err; - - /* - * Close VCC - */ - if (clp->cls_conn) { - err = atm_cm_release(clp->cls_conn, cause); - if (err) { - log(LOG_ERR, "spanscls_closevc: release err=%d\n", err); - } - clp->cls_conn = NULL; - } - - clp->cls_state = CLS_CLOSED; -} - - -/* - * Process CLS VCC Connected Notification - * - * Arguments: - * toku user's connection token (spanscls protocol block) - * - * Returns: - * none - * - */ -static void -spanscls_connected(toku) - void *toku; -{ - /* - * We should never get one of these - */ - log(LOG_ERR, "spanscls: unexpected connected event\n"); -} - - -/* - * Process CLS VCC Cleared Notification - * - * Arguments: - * toku user's connection token (spanscls protocol block) - * cause pointer to cause code - * - * Returns: - * none - * - */ -static void -spanscls_cleared(toku, cause) - void *toku; - struct t_atm_cause *cause; -{ - struct spanscls *clp = (struct spanscls *)toku; - - /* - * CLS VCC has been closed, so clean up our side - */ - clp->cls_conn = NULL; - spanscls_closevc(clp, cause); -} - - -/* - * Get Connection's Application/Owner Name - * - * Arguments: - * tok spanscls connection token - * - * Returns: - * addr pointer to string containing our name - * - */ -static caddr_t -spanscls_getname(tok) - void *tok; -{ - return ("SPANSCLS"); -} - -/* - * Print a SPANS CLS PDU - * - * Arguments: - * clp pointer to cls instance - * m pointer to pdu buffer chain - * msg pointer to message string - * - * Returns: - * none - * - */ -static void -spanscls_pdu_print(const struct spanscls *clp, const KBuffer *m, - const char *msg) -{ - char buf[128]; - - snprintf(buf, sizeof(buf), "spanscls %s:\n", msg); - atm_pdu_print(m, buf); -} Property changes on: head/sys/netatm/spans/spans_cls.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/spans/spans_if.c =================================================================== --- head/sys/netatm/spans/spans_if.c (revision 179307) +++ head/sys/netatm/spans/spans_if.c (nonexistent) @@ -1,1272 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * SPANS Signalling Manager - * --------------------------- - * - * External interfaces to SPANS manager. Includes support for - * running as a loadable kernel module. - */ - -#include -__FBSDID("$FreeBSD$"); - -#ifndef ATM_SPANS_MODULE -#include "opt_atm.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "spans_xdr.h" -#include - -/* - * Global variables - */ -uma_zone_t spans_vc_zone; -uma_zone_t spans_msg_zone; - -/* - * Local functions - */ -static int spans_start(void); -static int spans_stop(void); -static int spans_attach(struct sigmgr *, struct atm_pif *); -static int spans_detach(struct atm_pif *); -static int spans_setup(Atm_connvc *, int *); -static int spans_release(struct vccb *, int *); -static int spans_accept(struct vccb *, int *); -static int spans_reject(struct vccb *, int *); -static int spans_ioctl(int, caddr_t, caddr_t); - -/* - * Local variables - */ -static struct sigmgr *spans_mgr = NULL; - - -/* - * Initialize SPANS processing - * - * This will be called during module loading. We'll just register - * the SPANS protocol descriptor and wait for a SPANS ATM interface - * to come online. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -static int -spans_start() -{ - int err = 0; - - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - log(LOG_ERR, "version mismatch: spans=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), - ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), - ATM_VERS_MIN(atm_version)); - return (EINVAL); - } - - spans_vc_zone = uma_zcreate("spans vc", sizeof(struct spans_vccb), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (spans_vc_zone == NULL) - panic("spans_vc_zone"); - - spans_msg_zone = uma_zcreate("spans msg", sizeof(spans_msg), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (spans_msg_zone == NULL) - panic("spans_msg_zone"); - - /* - * Allocate protocol definition structure - */ - spans_mgr = malloc(sizeof(struct sigmgr), M_DEVBUF, M_NOWAIT|M_ZERO); - if (spans_mgr == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Initialize protocol invariant values - */ - spans_mgr->sm_proto = ATM_SIG_SPANS; - spans_mgr->sm_attach = spans_attach; - spans_mgr->sm_detach = spans_detach; - spans_mgr->sm_setup = spans_setup; - spans_mgr->sm_release = spans_release; - spans_mgr->sm_accept = spans_accept; - spans_mgr->sm_reject = spans_reject; - spans_mgr->sm_free = spans_free; - spans_mgr->sm_ioctl = spans_ioctl; - - /* - * Register ourselves with system - */ - err = atm_sigmgr_register(spans_mgr); - if (err) - goto done; - - /* - * Start the arp service - */ - spansarp_start(); - - /* - * Start up Connectionless Service - */ - err = spanscls_start(); - if (err) - goto done; - -done: - return (err); -} - - -/* - * Halt SPANS processing - * - * This should be called just prior to unloading the module from - * memory. All SPANS interfaces must be deregistered before the - * protocol can be shutdown. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -static int -spans_stop() -{ - int err = 0; - int s = splnet(); - - /* - * Is protocol even set up? - */ - if (spans_mgr) { - - /* - * Any protocol instances still registered? - */ - if (spans_mgr->sm_prinst) { - - /* Yes, can't stop now */ - err = EBUSY; - goto done; - } - - /* - * Stop Connectionless Service - */ - spanscls_stop(); - - /* - * De-register from system - */ - err = atm_sigmgr_deregister(spans_mgr); - - /* - * Free up protocol block - */ - free(spans_mgr, M_DEVBUF); - spans_mgr = NULL; - - /* - * Free up our storage pools - */ - uma_zdestroy(spans_vc_zone); - uma_zdestroy(spans_msg_zone); - } else - err = ENXIO; - -done: - (void) splx(s); - return (err); -} - - -/* - * Attach a SPANS-controlled interface - * - * Each ATM physical interface must be attached with the signalling - * manager for the interface's signalling protocol (via the - * atm_sigmgr_attach function). This function will handle the - * attachment for SPANS-controlled interfaces. A new SPANS protocol - * instance will be created and then we'll just sit around waiting for - * status or connection requests. - * - * Function must be called at splnet. - * - * Arguments: - * smp pointer to SPANS signalling manager control block - * pip pointer to ATM physical interface control block - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -static int -spans_attach(smp, pip) - struct sigmgr *smp; - struct atm_pif *pip; -{ - int err = 0, n = 0, s; - struct spans *spp = NULL; - struct atm_nif *np; - - ATM_DEBUG2("spans_attach: smp=%p, pip=%p\n", smp, pip); - - /* - * Count network interfaces attached to the physical interface. - * If there are more or less than one, we have big problems. - */ - np = pip->pif_nif; - while (np) { - n++; - np = np->nif_pnext; - } - if (n != 1) { - err = ETOOMANYREFS; - goto done; - } - - /* - * Allocate SPANS protocol instance control block - */ - spp = malloc(sizeof(struct spans), M_DEVBUF, M_NOWAIT|M_ZERO); - if (spp == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Set variables in SPANS protocol instance control block - */ - spp->sp_state = SPANS_INIT; - spp->sp_h_epoch = time_second; - spp->sp_s_epoch = 0; - spp->sp_addr.address_format = T_ATM_ABSENT; - spp->sp_addr.address_length = 0; - spp->sp_subaddr.address_format = T_ATM_ABSENT; - spp->sp_subaddr.address_length = 0; - spp->sp_probe_ct = 0; - spp->sp_alloc_vci = SPANS_MIN_VCI; - spp->sp_alloc_vpi = SPANS_VPI; - spp->sp_min_vci = SPANS_MIN_VCI; - spp->sp_max_vci = pip->pif_maxvci; - - /* - * Link instance into manager's chain - */ - LINK2TAIL((struct siginst *)spp, struct siginst, smp->sm_prinst, - si_next); - - /* - * Link in interface - */ - spp->sp_pif = pip; - pip->pif_sigmgr = smp; - pip->pif_siginst = (struct siginst *) spp; - - /* - * Kick-start the SPANS protocol - */ - SPANS_TIMER(spp, 0); - - /* - * Notify Connectionless Service - */ - err = spanscls_attach(spp); - - /* - * Log the fact that we've attached - */ - if (!err) - log(LOG_INFO, "spans: attached to interface %s%d\n", - pip->pif_name, pip->pif_unit); - -done: - /* - * Reset our work if attach fails - */ - if (err) { - if (spp) { - SPANS_CANCEL(spp); - UNLINK((struct siginst *)spp, struct siginst, - smp->sm_prinst, si_next); - free(spp, M_DEVBUF); - } - s = splimp(); - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - (void) splx(s); - } - - return (err); -} - - -/* - * Detach a SPANS-controlled interface - * - * Each ATM physical interface may be detached from its signalling - * manager (via the atm_sigmgr_detach function). This function will - * handle the detachment for all SPANS-controlled interfaces. All - * circuits will be immediately terminated. - * - * Function must be called at splnet. - * - * Arguments: - * pip pointer to ATM physical interface control block - * - * Returns: - * 0 detach successful - * errno detach failed - reason indicated - * - */ -static int -spans_detach(pip) - struct atm_pif *pip; -{ - struct spans *spp; - struct vccb *vcp, *vnext; - Atm_connection *cop; - int err; - - ATM_DEBUG1("spans_detach: pip=%p\n", pip); - - /* - * Get SPANS protocol instance - */ - spp = (struct spans *)pip->pif_siginst; - - /* - * Return an error if we're already detaching - */ - if (spp->sp_state == SPANS_DETACH) { - return(EALREADY); - } - - /* - * Cancel any outstanding timer - */ - SPANS_CANCEL(spp); - - /* - * Notify Connectionless Service - */ - spanscls_detach(spp); - - /* - * Terminate all of our VCCs - */ - for (vcp = Q_HEAD(spp->sp_vccq, struct vccb); vcp; vcp = vnext) { - - vnext = Q_NEXT(vcp, struct vccb, vc_sigelem); - - /* - * Don't close the signalling VCC yet - */ - if (vcp->vc_connvc && vcp->vc_connvc->cvc_conn == - spp->sp_conn) - continue; - - /* - * Close VCC and notify owner - */ - err = spans_clear_vcc(spp, (struct spans_vccb *)vcp); - if (err) { - log(LOG_ERR, "spans: error %d clearing VCCB %p\n", - err, vcp); - } - } - - /* - * Now close the SPANS signalling VCC - */ - if ((cop = spp->sp_conn) != NULL) { - err = atm_cm_release(cop, &spans_cause); - if (err) - ATM_DEBUG2( - "spans_detach: close failed for SPANS signalling channel; cop=%p, err=%d\n", - cop, err); - } - - - /* - * Get rid of protocol instance if there are no VCCs queued - */ - if (Q_HEAD(spp->sp_vccq, struct vccb) == NULL) { - struct sigmgr *smp = pip->pif_sigmgr; - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - UNLINK((struct siginst *)spp, struct siginst, - smp->sm_prinst, si_next); - free(spp, M_DEVBUF); - } else { - /* - * Otherwise, wait for protocol instance to be freed - * during spans_free processing for the last queued VCC. - */ - spp->sp_state = SPANS_DETACH; - } - - /* - * Log the fact that we've detached - */ - log(LOG_INFO, "spans: detached from interface %s%d\n", - pip->pif_name, pip->pif_unit); - - return (0); -} - - -/* - * Open a SPANS ATM Connection - * - * All service user requests to open a VC connection (via - * atm_open_connection) over an ATM interface attached to the SPANS - * signalling manager are handled here. - * - * Function will be called at splnet. - * - * Arguments: - * cvp pointer to user's requested connection parameters - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection establishment is in progress - * CALL_FAILED connection establishment failed - * CALL_CONNECTED connection has been successfully established - * - */ -static int -spans_setup(cvp, errp) - Atm_connvc *cvp; - int *errp; -{ - struct atm_pif *pip = cvp->cvc_attr.nif->nif_pif; - struct spans *spp = (struct spans *)pip->pif_siginst; - int rc = 0; - - ATM_DEBUG1("spans_setup: cvp=%p\n", cvp); - - /* - * Intialize the returned error code - */ - *errp = 0; - - /* - * Open the connection - */ - switch (cvp->cvc_attr.called.addr.address_format) { - case T_ATM_PVC_ADDR: - /* - * Create a PVC - */ - *errp = spans_open_vcc(spp, cvp); - rc = (*errp ? CALL_FAILED : CALL_CONNECTED); - break; - - case T_ATM_SPANS_ADDR: - - /* - * Create an SVC - */ - *errp = spans_open_vcc(spp, cvp); - rc = (*errp ? CALL_FAILED : CALL_PROCEEDING); - break; - - default: - *errp = EPROTONOSUPPORT; - rc = CALL_FAILED; - } - - return (rc); -} - - -/* - * Close a SPANS ATM Connection - * - * All service user requests to terminate a previously open VC - * connection (via the atm_close_connection function), which is running - * over an interface attached to the SPANS signalling manager, are - * handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection termination is in progress - * CALL_FAILED connection termination failed - * CALL_CLEARED connection has been successfully terminated - * - */ -static int -spans_release(vcp, errp) - struct vccb *vcp; - int *errp; -{ - int rc = 0; - struct atm_pif *pip = vcp->vc_pif; - struct spans *spp = (struct spans *)pip->pif_siginst; - - ATM_DEBUG1("spans_release: vcp=%p\n", vcp); - - /* - * Initialize returned error code - */ - *errp = 0; - - /* - * Make sure VCC is open - */ - if ((vcp->vc_sstate == SPANS_VC_NULL) || - (vcp->vc_sstate == SPANS_VC_CLOSE) || - (vcp->vc_sstate == SPANS_VC_FREE) || - (vcp->vc_ustate == VCCU_NULL) || - (vcp->vc_ustate == VCCU_CLOSED)) { - *errp = EALREADY; - return(CALL_FAILED); - } - - /* - * Validate the connection type (PVC or SVC) - */ - if (!(vcp->vc_type & (VCC_PVC | VCC_SVC))) { - *errp = EPROTONOSUPPORT; - return(CALL_FAILED); - } - - /* - * Close the VCCB - */ - *errp = spans_close_vcc(spp, (struct spans_vccb *)vcp, FALSE); - - /* - * Set the return code - */ - if (vcp->vc_type & VCC_PVC) { - rc = (*errp ? CALL_FAILED : CALL_CLEARED); - } else { - rc = (*errp ? CALL_FAILED : CALL_PROCEEDING); - } - - return (rc); -} - - -/* - * Accept a SPANS Open from a remote host - * - * A user calls this routine (via the atm_accept_call function) - * after it is notified that an open request was received for it. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to user's VCCB - * errp pointer to an int for extended error information - * - * Returns: - * CALL_PROCEEDING connection establishment is in progress - * CALL_FAILED connection establishment failed - * CALL_CONNECTED connection has been successfully established - * - */ -static int -spans_accept(vcp, errp) - struct vccb *vcp; - int *errp; -{ - struct atm_pif *pip = vcp->vc_pif; - struct spans *spp = (struct spans *)pip->pif_siginst; - struct spans_vccb *svp = (struct spans_vccb *)vcp; - - ATM_DEBUG1("spans_accept: vcp=%p\n", vcp); - - /* - * Initialize the returned error code - */ - *errp = 0; - - /* - * Return an error if we're detaching - */ - if (spp->sp_state == SPANS_DETACH) { - *errp = ENETDOWN; - ATM_DEBUG0("spans_accept: detaching\n"); - return(CALL_FAILED); - } - - /* - * Respond to the open request - */ - *errp = spans_send_open_rsp(spp, svp, SPANS_OK); - if (*errp) { - ATM_DEBUG0("spans_accept: spans_send_open_rsp failed\n"); - goto failed; - } - - /* - * Update the VCC states - */ - svp->sv_sstate = SPANS_VC_OPEN; - svp->sv_ustate = VCCU_OPEN; - - return(CALL_CONNECTED); - -failed: - /* - * On error, free the VCCB and return CALL_FAILED - */ - svp->sv_sstate = SPANS_VC_FREE; - svp->sv_ustate = VCCU_CLOSED; - DEQUEUE(svp, struct spans_vccb, sv_sigelem, spp->sp_vccq); - spans_free((struct vccb *)svp); - - return(CALL_FAILED); -} - - -/* - * Reject a SPANS Open from a remote host - * - * A user calls this routine (via the atm_reject_call function) - * after it is notified that an open request was received for it. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to user's VCCB - * errp pointer to an int for extended error information - * - * Returns: - * CALL_CLEARED call request rejected - * CALL_FAILED call rejection failed - * - */ -static int -spans_reject(vcp, errp) - struct vccb *vcp; - int *errp; -{ - struct atm_pif *pip = vcp->vc_pif; - struct spans *spp = (struct spans *)pip->pif_siginst; - struct spans_vccb *svp = (struct spans_vccb *)vcp; - - ATM_DEBUG1("spans_reject: vcp=%p\n", vcp); - - /* - * Initialize the returned error code - */ - *errp = 0; - - /* - * Return an error if we're detaching - */ - if (spp->sp_state == SPANS_DETACH) { - *errp = ENETDOWN; - ATM_DEBUG0("spans_reject: detaching\n"); - return(CALL_FAILED); - } - - ATM_DEBUG1("spans_reject: cause code is %d\n", - vcp->vc_connvc->cvc_attr.cause.v.cause_value); - - /* - * Clean up the VCCB--the connection manager will free it - * spans_close_vcc will send a SPANS open response - */ - if ((*errp = spans_close_vcc(spp, svp, TRUE)) != 0) { - ATM_DEBUG0("spans_reject: spans_close_vcc failed\n"); - return(CALL_FAILED); - } - - return(CALL_CLEARED); -} - - -/* - * Abort a SPANS ATM Connection - * - * All (non-user) requests to abort a previously open VC connection (via - * the atm_abort_connection function), which is running over an - * interface attached to the SPANS signalling manager, are handled here. - * The VCC owner will be notified of the request, in order to initiate - * termination of the connection. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * - * Returns: - * 0 connection release was succesful - * errno connection release failed - reason indicated - * - */ -int -spans_abort(vcp) - struct vccb *vcp; -{ - - /* - * Make sure VCC is available - */ - if ((vcp->vc_sstate == SPANS_VC_NULL) || - (vcp->vc_sstate == SPANS_VC_CLOSE) || - (vcp->vc_sstate == SPANS_VC_FREE) || - (vcp->vc_ustate == VCCU_NULL) || - (vcp->vc_ustate == VCCU_CLOSED)) { - return(EALREADY); - } - - /* - * Only abort once - */ - if (vcp->vc_sstate == SPANS_VC_ABORT) { - return (EALREADY); - } - - /* - * Cancel any timer that might be running - */ - SPANS_VC_CANCEL(vcp); - - /* - * Set immediate timer to schedule connection termination - */ - vcp->vc_sstate = SPANS_VC_ABORT; - SPANS_VC_TIMER(vcp, 0); - - return (0); -} - - -/* - * Free SPANS ATM connection resources - * - * All service user requests to free the resources of a closed - * VCC connection (via the atm_free_connection function), which - * is running over an interface attached to the SigPVC signalling - * manager, are handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * - * Returns: - * 0 connection free was successful - * errno connection free failed - reason indicated - * - */ -int -spans_free(vcp) - struct vccb *vcp; -{ - struct atm_pif *pip = vcp->vc_pif; - struct spans *spp = (struct spans *)pip->pif_siginst; - - ATM_DEBUG1("spans_free: vcp = %p\n", vcp); - - /* - * Make sure VCC has been closed - */ - if ((vcp->vc_ustate != VCCU_CLOSED) || - (vcp->vc_sstate != SPANS_VC_FREE)) { - ATM_DEBUG2("spans_free: bad state, sstate=%d, ustate=%d\n", - vcp->vc_sstate, vcp->vc_ustate); - return(EEXIST); - } - - /* - * Remove VCCB from protocol queue - */ - DEQUEUE(vcp, struct vccb, vc_sigelem, spp->sp_vccq); - - /* - * Free VCCB storage - */ - vcp->vc_ustate = VCCU_NULL; - vcp->vc_sstate = SPANS_VC_NULL; - uma_zfree(spans_vc_zone, vcp); - - /* - * If we're detaching and this was the last VCC queued, - * get rid of the protocol instance - */ - if ((spp->sp_state == SPANS_DETACH) && - (Q_HEAD(spp->sp_vccq, struct vccb) == NULL)) { - struct sigmgr *smp = pip->pif_sigmgr; - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - UNLINK((struct siginst *)spp, struct siginst, smp->sm_prinst, - si_next); - free(spp, M_DEVBUF); - } - - return (0); -} - - -/* - * SPANS IOCTL support - * - * Function will be called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -static int -spans_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmdelreq *adp; - struct atminfreq *aip; - struct spans *spp; - struct spans_vccb *svp; - struct air_vcc_rsp rsp; - Atm_connection *cop; - int err = 0, i, vpi, vci; - size_t buf_len; - caddr_t buf_addr; - - - switch (code) { - - case AIOCS_DEL_PVC: - case AIOCS_DEL_SVC: - /* - * Delete a VCC - */ - adp = (struct atmdelreq *)data; - spp = (struct spans *)arg1; - - /* - * Don't let a user close the SPANS signalling VC or - * the SPANS CLS VC - */ - vpi = adp->adr_pvc_vpi; - vci = adp->adr_pvc_vci; - if ((vpi == SPANS_SIG_VPI && vci == SPANS_SIG_VCI) || - (vpi == SPANS_CLS_VPI && - vci == SPANS_CLS_VCI)) - return(EINVAL); - - /* - * Find requested VCC - */ - for (svp = Q_HEAD(spp->sp_vccq, struct spans_vccb); svp; - svp = Q_NEXT(svp, struct spans_vccb, sv_sigelem)) { - if ((svp->sv_vpi == vpi) && (svp->sv_vci == vci)) - break; - } - if (svp == NULL) - return (ENOENT); - - /* - * Check VCC type - */ - switch (code) { - case AIOCS_DEL_PVC: - if (!(svp->sv_type & VCC_PVC)) { - return(EINVAL); - } - break; - case AIOCS_DEL_SVC: - if (!(svp->sv_type & VCC_SVC)) { - return(EINVAL); - } - break; - } - - /* - * Schedule VCC termination - */ - err = spans_abort((struct vccb *)svp); - break; - - case AIOCS_INF_VCC: - /* - * Return VCC information - */ - aip = (struct atminfreq *)data; - spp = (struct spans *)arg1; - - buf_addr = aip->air_buf_addr; - buf_len = aip->air_buf_len; - - /* - * Loop through the VCC queue - */ - for (svp = Q_HEAD(spp->sp_vccq, struct spans_vccb); svp; - svp = Q_NEXT(svp, struct spans_vccb, sv_sigelem)) { - /* - * Make sure there's room in the user's buffer - */ - if (buf_len < sizeof(rsp)) { - err = ENOSPC; - break; - } - - /* - * Fill out the response struct for the VCC - */ - (void) snprintf(rsp.avp_intf, - sizeof(rsp.avp_intf), "%s%d", - spp->sp_pif->pif_name, - spp->sp_pif->pif_unit); - rsp.avp_vpi = svp->sv_vpi; - rsp.avp_vci = svp->sv_vci; - rsp.avp_type = svp->sv_type; - rsp.avp_aal = svp->sv_connvc->cvc_attr.aal.type; - rsp.avp_sig_proto = svp->sv_proto; - cop = svp->sv_connvc->cvc_conn; - if (cop) - rsp.avp_encaps = cop->co_mpx; - else - rsp.avp_encaps = 0; - rsp.avp_state = svp->sv_sstate; - bzero(rsp.avp_owners, sizeof(rsp.avp_owners)); - for (i = 0; cop && i < sizeof(rsp.avp_owners); - cop = cop->co_next, - i += T_ATM_APP_NAME_LEN+1) { - strncpy(&rsp.avp_owners[i], - cop->co_endpt->ep_getname(cop->co_toku), - T_ATM_APP_NAME_LEN); - } - rsp.avp_daddr.address_format = T_ATM_SPANS_ADDR; - rsp.avp_daddr.address_length = - sizeof(Atm_addr_spans); - if (svp->sv_type & VCC_OUT) { - spans_addr_copy(&svp->sv_conn.con_dst, - rsp.avp_daddr.address); - } else { - spans_addr_copy(&svp->sv_conn.con_src, - rsp.avp_daddr.address); - } - rsp.avp_dsubaddr.address_format = T_ATM_ABSENT; - rsp.avp_dsubaddr.address_length = 0; - rsp.avp_ipdus = svp->sv_ipdus; - rsp.avp_opdus = svp->sv_opdus; - rsp.avp_ibytes = svp->sv_ibytes; - rsp.avp_obytes = svp->sv_obytes; - rsp.avp_ierrors = svp->sv_ierrors; - rsp.avp_oerrors = svp->sv_oerrors; - rsp.avp_tstamp = svp->sv_tstamp; - - /* - * Copy the response into the user's buffer - */ - if ((err = copyout((caddr_t)&rsp, buf_addr, - sizeof(rsp))) != 0) - break; - buf_addr += sizeof(rsp); - buf_len -= sizeof(rsp); - } - - /* - * Update the buffer pointer and length - */ - aip->air_buf_addr = buf_addr; - aip->air_buf_len = buf_len; - break; - - case AIOCS_ADD_ARP: - case AIOCS_DEL_ARP: - case AIOCS_INF_ARP: - case AIOCS_INF_ASV: - /* - * ARP specific ioctl's - */ - err = spansarp_ioctl(code, data, arg1); - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} - - -#ifdef ATM_SPANS_MODULE -/* - ******************************************************************* - * - * Loadable Module Support - * - ******************************************************************* - */ -static int spans_doload(void); -static int spans_dounload(void); - -/* - * Generic module load processing - * - * This function is called by an OS-specific function when this - * module is being loaded. - * - * Arguments: - * none - * - * Returns: - * 0 load was successful - * errno load failed - reason indicated - * - */ -static int -spans_doload() -{ - int err = 0; - - /* - * Start us up - */ - err = spans_start(); - if (err) - /* Problems, clean up */ - (void)spans_stop(); - - return (err); -} - - -/* - * Generic module unload processing - * - * This function is called by an OS-specific function when this - * module is being unloaded. - * - * Arguments: - * none - * - * Returns: - * 0 unload was successful - * errno unload failed - reason indicated - * - */ -static int -spans_dounload() -{ - int err = 0; - - /* - * OK, try to clean up our mess - */ - err = spans_stop(); - - return (err); -} - - - - -#include -#include -#include - -/* - * Loadable miscellaneous module description - */ -MOD_MISC(spans); - - -/* - * Loadable module support "load" entry point - * - * This is the routine called by the lkm driver whenever the - * modload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -spans_load(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(spans_doload()); -} - - -/* - * Loadable module support "unload" entry point - * - * This is the routine called by the lkm driver whenever the - * modunload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -spans_unload(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(spans_dounload()); -} - - -/* - * Loadable module support entry point - * - * This is the routine called by the lkm driver for all loadable module - * functions for this driver. This routine name must be specified - * on the modload(1) command. This routine will be called whenever the - * modload(1), modunload(1) or modstat(1) commands are issued for this - * module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * ver lkm version - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -int -spans_mod(lkmtp, cmd, ver) - struct lkm_table *lkmtp; - int cmd; - int ver; -{ - MOD_DISPATCH(spans, lkmtp, cmd, ver, - spans_load, spans_unload, lkm_nullcmd); -} - -#else /* !ATM_SPANS_MODULE */ - -/* - ******************************************************************* - * - * Kernel Compiled Module Support - * - ******************************************************************* - */ -static void spans_doload(void *); - -SYSINIT(atmspans, SI_SUB_PROTO_END, SI_ORDER_ANY, spans_doload, NULL); - -/* - * Kernel initialization - * - * Arguments: - * arg Not used - * - * Returns: - * none - * - */ -static void -spans_doload(void *arg) -{ - int err = 0; - - /* - * Start us up - */ - err = spans_start(); - if (err) { - /* Problems, clean up */ - (void)spans_stop(); - - log(LOG_ERR, "ATM SPANS unable to initialize (%d)!!\n", err); - } - return; -} -#endif /* ATM_SPANS_MODULE */ - Property changes on: head/sys/netatm/spans/spans_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_socket.c =================================================================== --- head/sys/netatm/atm_socket.c (revision 179307) +++ head/sys/netatm/atm_socket.c (nonexistent) @@ -1,1312 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM common socket protocol processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * Local functions - */ - - -/* - * Local variables - */ -static uma_zone_t atm_pcb_zone; - -static struct t_atm_cause atm_sock_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_UNSPECIFIED_NORMAL, - {0, 0, 0, 0} -}; - -void -atm_sock_init(void) -{ - - atm_pcb_zone = uma_zcreate("atm pcb", sizeof(Atm_pcb), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); - if (atm_pcb_zone == NULL) - panic("atm_sock_init: unable to initialize atm_pcb_zone"); -} - -/* - * Allocate resources for a new ATM socket - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * send socket send buffer maximum - * recv socket receive buffer maximum - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -int -atm_sock_attach(so, send, recv) - struct socket *so; - u_long send; - u_long recv; -{ - Atm_pcb *atp = sotoatmpcb(so); - int err; - - /* - * Make sure initialization has happened - */ - if (!atm_init) - atm_initialize(); - - /* - * Make sure we're not already attached - */ - if (atp) - return (EISCONN); - - /* - * Reserve socket buffer space, if not already done - */ - if ((so->so_snd.sb_hiwat == 0) || (so->so_rcv.sb_hiwat == 0)) { - err = soreserve(so, send, recv); - if (err) - return (err); - } - - /* - * Allocate and initialize our control block - */ - atp = uma_zalloc(atm_pcb_zone, M_ZERO | M_NOWAIT); - if (atp == NULL) - return (ENOMEM); - - atp->atp_socket = so; - so->so_pcb = (caddr_t)atp; - return (0); -} - - -/* - * Detach from socket and free resources - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * - */ -void -atm_sock_detach(so) - struct socket *so; -{ - Atm_pcb *atp = sotoatmpcb(so); - - /* - * Make sure we're still attached - */ - KASSERT(atp != NULL, ("atm_sock_detach: atp == NULL")); - - /* - * Terminate any (possibly pending) connection - */ - if (atp->atp_conn) { - (void) atm_sock_disconnect(so); - } - - so->so_pcb = NULL; - - uma_zfree(atm_pcb_zone, atp); -} - - -/* - * Bind local address to socket - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * addr pointer to protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_bind(so, addr) - struct socket *so; - struct sockaddr *addr; -{ - Atm_pcb *atp = sotoatmpcb(so); - Atm_attributes attr; - struct sockaddr_atm *satm; - struct t_atm_sap_addr *sapadr; - struct t_atm_sap_layer2 *sapl2; - struct t_atm_sap_layer3 *sapl3; - struct t_atm_sap_appl *sapapl; - - /* - * Make sure we're still attached - */ - if (atp == NULL) - return (ENOTCONN); - - /* - * Can't change local address once we've started connection process - */ - if (atp->atp_conn != NULL) - return (EADDRNOTAVAIL); - - /* - * Validate requested local address - */ - satm = (struct sockaddr_atm *)addr; - if (satm->satm_family != AF_ATM) - return (EAFNOSUPPORT); - - sapadr = &satm->satm_addr.t_atm_sap_addr; - if (sapadr->SVE_tag_addr == T_ATM_PRESENT) { - if (sapadr->address_format == T_ATM_ENDSYS_ADDR) { - if (sapadr->SVE_tag_selector != T_ATM_PRESENT) - return (EINVAL); - } else if (sapadr->address_format == T_ATM_E164_ADDR) { - if (sapadr->SVE_tag_selector != T_ATM_ABSENT) - return (EINVAL); - } else - return (EINVAL); - } else if ((sapadr->SVE_tag_addr != T_ATM_ABSENT) && - (sapadr->SVE_tag_addr != T_ATM_ANY)) - return (EINVAL); - if (sapadr->address_length > ATM_ADDR_LEN) - return (EINVAL); - - sapl2 = &satm->satm_addr.t_atm_sap_layer2; - if (sapl2->SVE_tag == T_ATM_PRESENT) { - if ((sapl2->ID_type != T_ATM_SIMPLE_ID) && - (sapl2->ID_type != T_ATM_USER_ID)) - return (EINVAL); - } else if ((sapl2->SVE_tag != T_ATM_ABSENT) && - (sapl2->SVE_tag != T_ATM_ANY)) - return (EINVAL); - - sapl3 = &satm->satm_addr.t_atm_sap_layer3; - if (sapl3->SVE_tag == T_ATM_PRESENT) { - if ((sapl3->ID_type != T_ATM_SIMPLE_ID) && - (sapl3->ID_type != T_ATM_IPI_ID) && - (sapl3->ID_type != T_ATM_SNAP_ID) && - (sapl3->ID_type != T_ATM_USER_ID)) - return (EINVAL); - } else if ((sapl3->SVE_tag != T_ATM_ABSENT) && - (sapl3->SVE_tag != T_ATM_ANY)) - return (EINVAL); - - sapapl = &satm->satm_addr.t_atm_sap_appl; - if (sapapl->SVE_tag == T_ATM_PRESENT) { - if ((sapapl->ID_type != T_ATM_ISO_APP_ID) && - (sapapl->ID_type != T_ATM_USER_APP_ID) && - (sapapl->ID_type != T_ATM_VENDOR_APP_ID)) - return (EINVAL); - } else if ((sapapl->SVE_tag != T_ATM_ABSENT) && - (sapapl->SVE_tag != T_ATM_ANY)) - return (EINVAL); - - /* - * Create temporary attributes list so that we can check out the - * new bind parameters before we modify the socket's values; - */ - attr = atp->atp_attr; - attr.called.tag = sapadr->SVE_tag_addr; - bcopy(&sapadr->address_format, &attr.called.addr, sizeof(Atm_addr)); - - attr.blli.tag_l2 = sapl2->SVE_tag; - if (sapl2->SVE_tag == T_ATM_PRESENT) { - attr.blli.v.layer_2_protocol.ID_type = sapl2->ID_type; - bcopy(&sapl2->ID, &attr.blli.v.layer_2_protocol.ID, - sizeof(attr.blli.v.layer_2_protocol.ID)); - } - - attr.blli.tag_l3 = sapl3->SVE_tag; - if (sapl3->SVE_tag == T_ATM_PRESENT) { - attr.blli.v.layer_3_protocol.ID_type = sapl3->ID_type; - bcopy(&sapl3->ID, &attr.blli.v.layer_3_protocol.ID, - sizeof(attr.blli.v.layer_3_protocol.ID)); - } - - attr.bhli.tag = sapapl->SVE_tag; - if (sapapl->SVE_tag == T_ATM_PRESENT) { - attr.bhli.v.ID_type = sapapl->ID_type; - bcopy(&sapapl->ID, &attr.bhli.v.ID, - sizeof(attr.bhli.v.ID)); - } - - /* - * Make sure we have unique listening attributes - */ - if (atm_cm_match(&attr, NULL) != NULL) - return (EADDRINUSE); - - /* - * Looks good, save new attributes - */ - atp->atp_attr = attr; - - return (0); -} - - -/* - * Listen for incoming connections - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * epp pointer to endpoint definition structure - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_listen(so, epp, backlog) - struct socket *so; - Atm_endpoint *epp; - int backlog; -{ - Atm_pcb *atp = sotoatmpcb(so); - - /* - * Make sure we're still attached - */ - if (atp == NULL) - return (ENOTCONN); - - /* - * Start listening for incoming calls - */ - return (atm_cm_listen(so, epp, atp, &atp->atp_attr, &atp->atp_conn, - backlog)); -} - - -/* - * Connect socket to peer - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * addr pointer to protocol address - * epp pointer to endpoint definition structure - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_connect(so, addr, epp) - struct socket *so; - struct sockaddr *addr; - Atm_endpoint *epp; -{ - Atm_pcb *atp = sotoatmpcb(so); - struct sockaddr_atm *satm; - struct t_atm_sap_addr *sapadr; - struct t_atm_sap_layer2 *sapl2; - struct t_atm_sap_layer3 *sapl3; - struct t_atm_sap_appl *sapapl; - int err; - - /* - * Make sure we're still attached - */ - if (atp == NULL) - return (ENOTCONN); - - /* - * Validate requested peer address - */ - satm = (struct sockaddr_atm *)addr; - if (satm->satm_family != AF_ATM) - return (EAFNOSUPPORT); - - sapadr = &satm->satm_addr.t_atm_sap_addr; - if (sapadr->SVE_tag_addr != T_ATM_PRESENT) - return (EINVAL); - if (sapadr->address_format == T_ATM_ENDSYS_ADDR) { - if (sapadr->SVE_tag_selector != T_ATM_PRESENT) - return (EINVAL); - } else if (sapadr->address_format == T_ATM_E164_ADDR) { - if (sapadr->SVE_tag_selector != T_ATM_ABSENT) - return (EINVAL); - } else if (sapadr->address_format == T_ATM_PVC_ADDR) { - if (sapadr->SVE_tag_selector != T_ATM_ABSENT) - return (EINVAL); - } else - return (EINVAL); - if (sapadr->address_length > ATM_ADDR_LEN) - return (EINVAL); - - sapl2 = &satm->satm_addr.t_atm_sap_layer2; - if (sapl2->SVE_tag == T_ATM_PRESENT) { - if ((sapl2->ID_type != T_ATM_SIMPLE_ID) && - (sapl2->ID_type != T_ATM_USER_ID)) - return (EINVAL); - } else if (sapl2->SVE_tag != T_ATM_ABSENT) - return (EINVAL); - - sapl3 = &satm->satm_addr.t_atm_sap_layer3; - if (sapl3->SVE_tag == T_ATM_PRESENT) { - if ((sapl3->ID_type != T_ATM_SIMPLE_ID) && - (sapl3->ID_type != T_ATM_IPI_ID) && - (sapl3->ID_type != T_ATM_SNAP_ID) && - (sapl3->ID_type != T_ATM_USER_ID)) - return (EINVAL); - } else if (sapl3->SVE_tag != T_ATM_ABSENT) - return (EINVAL); - - sapapl = &satm->satm_addr.t_atm_sap_appl; - if (sapapl->SVE_tag == T_ATM_PRESENT) { - if ((sapapl->ID_type != T_ATM_ISO_APP_ID) && - (sapapl->ID_type != T_ATM_USER_APP_ID) && - (sapapl->ID_type != T_ATM_VENDOR_APP_ID)) - return (EINVAL); - } else if (sapapl->SVE_tag != T_ATM_ABSENT) - return (EINVAL); - - /* - * Select an outgoing network interface - */ - if (atp->atp_attr.nif == NULL) { - struct atm_pif *pip; - - for (pip = atm_interface_head; pip != NULL; - pip = pip->pif_next) { - if (pip->pif_nif != NULL) { - atp->atp_attr.nif = pip->pif_nif; - break; - } - } - if (atp->atp_attr.nif == NULL) - return (ENXIO); - } - - /* - * Set supplied connection attributes - */ - atp->atp_attr.called.tag = T_ATM_PRESENT; - bcopy(&sapadr->address_format, &atp->atp_attr.called.addr, - sizeof(Atm_addr)); - - atp->atp_attr.blli.tag_l2 = sapl2->SVE_tag; - if (sapl2->SVE_tag == T_ATM_PRESENT) { - atp->atp_attr.blli.v.layer_2_protocol.ID_type = sapl2->ID_type; - bcopy(&sapl2->ID, &atp->atp_attr.blli.v.layer_2_protocol.ID, - sizeof(atp->atp_attr.blli.v.layer_2_protocol.ID)); - } - - atp->atp_attr.blli.tag_l3 = sapl3->SVE_tag; - if (sapl3->SVE_tag == T_ATM_PRESENT) { - atp->atp_attr.blli.v.layer_3_protocol.ID_type = sapl3->ID_type; - bcopy(&sapl3->ID, &atp->atp_attr.blli.v.layer_3_protocol.ID, - sizeof(atp->atp_attr.blli.v.layer_3_protocol.ID)); - } - - atp->atp_attr.bhli.tag = sapapl->SVE_tag; - if (sapapl->SVE_tag == T_ATM_PRESENT) { - atp->atp_attr.bhli.v.ID_type = sapapl->ID_type; - bcopy(&sapapl->ID, &atp->atp_attr.bhli.v.ID, - sizeof(atp->atp_attr.bhli.v.ID)); - } - - /* - * We're finally ready to initiate the ATM connection - */ - soisconnecting(so); - atm_sock_stat.as_connreq[atp->atp_type]++; - err = atm_cm_connect(epp, atp, &atp->atp_attr, &atp->atp_conn); - if (err == 0) { - /* - * Connection is setup - */ - atm_sock_stat.as_conncomp[atp->atp_type]++; - soisconnected(so); - - } else if (err == EINPROGRESS) { - /* - * We've got to wait for a connected event - */ - err = 0; - - } else { - /* - * Call failed... - */ - atm_sock_stat.as_connfail[atp->atp_type]++; - soisdisconnected(so); - } - - return (err); -} - - -/* - * Disconnect connected socket - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_disconnect(so) - struct socket *so; -{ - Atm_pcb *atp = sotoatmpcb(so); - struct t_atm_cause *cause; - int err; - - /* - * Make sure we're still attached - */ - if (atp == NULL) - return (ENOTCONN); - - /* - * Release the ATM connection - */ - if (atp->atp_conn) { - if (atp->atp_attr.cause.tag == T_ATM_PRESENT) - cause = &atp->atp_attr.cause.v; - else - cause = &atm_sock_cause; - err = atm_cm_release(atp->atp_conn, cause); - if (err) - log(LOG_ERR, "atm_sock_disconnect: release fail (%d)\n", - err); - atm_sock_stat.as_connrel[atp->atp_type]++; - atp->atp_conn = NULL; - } - - soisdisconnected(so); - - return (0); -} - - -/* - * Retrieve local socket address - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to contain protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_sockaddr(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - struct sockaddr_atm *satm; - struct t_atm_sap_addr *saddr; - Atm_pcb *atp = sotoatmpcb(so); - - /* - * Return local interface address, if known - */ - satm = malloc(sizeof(*satm), M_SONAME, M_WAITOK | M_ZERO); - if (satm == NULL) - return (ENOMEM); - - satm->satm_family = AF_ATM; - satm->satm_len = sizeof(*satm); - - saddr = &satm->satm_addr.t_atm_sap_addr; - if (atp->atp_attr.nif && atp->atp_attr.nif->nif_pif->pif_siginst) { - saddr->SVE_tag_addr = T_ATM_PRESENT; - ATM_ADDR_SEL_COPY( - &atp->atp_attr.nif->nif_pif->pif_siginst->si_addr, - atp->atp_attr.nif->nif_sel, saddr); - if (saddr->address_format == T_ATM_ENDSYS_ADDR) - saddr->SVE_tag_selector = T_ATM_PRESENT; - else - saddr->SVE_tag_selector = T_ATM_ABSENT; - } else { - saddr->SVE_tag_addr = T_ATM_ABSENT; - saddr->SVE_tag_selector = T_ATM_ABSENT; - saddr->address_format = T_ATM_ABSENT; - } - satm->satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_ABSENT; - satm->satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT; - satm->satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT; - - *addr = (struct sockaddr *)satm; - return (0); -} - - -/* - * Retrieve peer socket address - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to contain protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_peeraddr(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - struct sockaddr_atm *satm; - struct t_atm_sap_addr *saddr; - Atm_pcb *atp = sotoatmpcb(so); - Atm_connvc *cvp; - - /* - * Return remote address, if known - */ - satm = malloc(sizeof(*satm), M_SONAME, M_WAITOK | M_ZERO); - if (satm == NULL) - return (ENOMEM); - - satm->satm_family = AF_ATM; - satm->satm_len = sizeof(*satm); - saddr = &satm->satm_addr.t_atm_sap_addr; - if (so->so_state & SS_ISCONNECTED) { - cvp = atp->atp_conn->co_connvc; - saddr->SVE_tag_addr = T_ATM_PRESENT; - if (cvp->cvc_flags & CVCF_CALLER) { - ATM_ADDR_COPY(&cvp->cvc_attr.called.addr, saddr); - } else { - if (cvp->cvc_attr.calling.tag == T_ATM_PRESENT) { - ATM_ADDR_COPY(&cvp->cvc_attr.calling.addr, - saddr); - } else { - saddr->SVE_tag_addr = T_ATM_ABSENT; - saddr->address_format = T_ATM_ABSENT; - } - } - if (saddr->address_format == T_ATM_ENDSYS_ADDR) - saddr->SVE_tag_selector = T_ATM_PRESENT; - else - saddr->SVE_tag_selector = T_ATM_ABSENT; - } else { - saddr->SVE_tag_addr = T_ATM_ABSENT; - saddr->SVE_tag_selector = T_ATM_ABSENT; - saddr->address_format = T_ATM_ABSENT; - } - satm->satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_ABSENT; - satm->satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT; - satm->satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT; - - *addr = (struct sockaddr *)satm; - return (0); -} - - -/* - * Common setsockopt processing - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * sopt pointer to socket option info - * atp pointer to ATM PCB - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_setopt(so, sopt, atp) - struct socket *so; - struct sockopt *sopt; - Atm_pcb *atp; -{ - int err = 0; - union { - struct t_atm_aal5 aal5; - struct t_atm_traffic trf; - struct t_atm_bearer brr; - struct t_atm_bhli bhl; - struct t_atm_blli bll; - Atm_addr addr; - struct t_atm_cause cau; - struct t_atm_qos qos; - struct t_atm_transit trn; - struct t_atm_net_intf nif; - struct t_atm_llc llc; - struct t_atm_app_name appn; - } p; - -#define MAXVAL(bits) ((1 << bits) - 1) -#define MAXMASK(bits) (~MAXVAL(bits)) - - switch (sopt->sopt_name) { - - case T_ATM_AAL5: - err = sooptcopyin(sopt, &p.aal5, sizeof p.aal5, sizeof p.aal5); - if (err) - break; - if ((p.aal5.forward_max_SDU_size != T_ATM_ABSENT) && - (p.aal5.forward_max_SDU_size & MAXMASK(16))) - return (EINVAL); - if ((p.aal5.backward_max_SDU_size != T_ATM_ABSENT) && - (p.aal5.backward_max_SDU_size & MAXMASK(16))) - return (EINVAL); - if ((p.aal5.SSCS_type != T_ATM_ABSENT) && - (p.aal5.SSCS_type != T_ATM_NULL) && - (p.aal5.SSCS_type != T_ATM_SSCS_SSCOP_REL) && - (p.aal5.SSCS_type != T_ATM_SSCS_SSCOP_UNREL) && - (p.aal5.SSCS_type != T_ATM_SSCS_FR)) - return (EINVAL); - - if ((p.aal5.forward_max_SDU_size == T_ATM_ABSENT) && - (p.aal5.backward_max_SDU_size == T_ATM_ABSENT) && - (p.aal5.SSCS_type == T_ATM_ABSENT)) - atp->atp_attr.aal.tag = T_ATM_ABSENT; - else { - atp->atp_attr.aal.tag = T_ATM_PRESENT; - atp->atp_attr.aal.type = ATM_AAL5; - atp->atp_attr.aal.v.aal5 = p.aal5; - } - break; - - case T_ATM_TRAFFIC: - err = sooptcopyin(sopt, &p.trf, sizeof p.trf, sizeof p.trf); - if (err) - break; - if ((p.trf.forward.PCR_high_priority != T_ATM_ABSENT) && - (p.trf.forward.PCR_high_priority & MAXMASK(24))) - return (EINVAL); - if (p.trf.forward.PCR_all_traffic & MAXMASK(24)) - return (EINVAL); - if ((p.trf.forward.SCR_high_priority != T_ATM_ABSENT) && - (p.trf.forward.SCR_high_priority & MAXMASK(24))) - return (EINVAL); - if ((p.trf.forward.SCR_all_traffic != T_ATM_ABSENT) && - (p.trf.forward.SCR_all_traffic & MAXMASK(24))) - return (EINVAL); - if ((p.trf.forward.MBS_high_priority != T_ATM_ABSENT) && - (p.trf.forward.MBS_high_priority & MAXMASK(24))) - return (EINVAL); - if ((p.trf.forward.MBS_all_traffic != T_ATM_ABSENT) && - (p.trf.forward.MBS_all_traffic & MAXMASK(24))) - return (EINVAL); - if ((p.trf.forward.tagging != T_YES) && - (p.trf.forward.tagging != T_NO)) - return (EINVAL); - - if ((p.trf.backward.PCR_high_priority != T_ATM_ABSENT) && - (p.trf.backward.PCR_high_priority & MAXMASK(24))) - return (EINVAL); - if (p.trf.backward.PCR_all_traffic & MAXMASK(24)) - return (EINVAL); - if ((p.trf.backward.SCR_high_priority != T_ATM_ABSENT) && - (p.trf.backward.SCR_high_priority & MAXMASK(24))) - return (EINVAL); - if ((p.trf.backward.SCR_all_traffic != T_ATM_ABSENT) && - (p.trf.backward.SCR_all_traffic & MAXMASK(24))) - return (EINVAL); - if ((p.trf.backward.MBS_high_priority != T_ATM_ABSENT) && - (p.trf.backward.MBS_high_priority & MAXMASK(24))) - return (EINVAL); - if ((p.trf.backward.MBS_all_traffic != T_ATM_ABSENT) && - (p.trf.backward.MBS_all_traffic & MAXMASK(24))) - return (EINVAL); - if ((p.trf.backward.tagging != T_YES) && - (p.trf.backward.tagging != T_NO)) - return (EINVAL); - if ((p.trf.best_effort != T_YES) && - (p.trf.best_effort != T_NO)) - return (EINVAL); - - atp->atp_attr.traffic.tag = T_ATM_PRESENT; - atp->atp_attr.traffic.v = p.trf; - break; - - case T_ATM_BEARER_CAP: - err = sooptcopyin(sopt, &p.brr, sizeof p.brr, sizeof p.brr); - if (err) - break; - if ((p.brr.bearer_class != T_ATM_CLASS_A) && - (p.brr.bearer_class != T_ATM_CLASS_C) && - (p.brr.bearer_class != T_ATM_CLASS_X)) - return (EINVAL); - if ((p.brr.traffic_type != T_ATM_NULL) && - (p.brr.traffic_type != T_ATM_CBR) && - (p.brr.traffic_type != T_ATM_VBR) && - (p.brr.traffic_type != T_ATM_ABR) && - (p.brr.traffic_type != T_ATM_UBR)) - return (EINVAL); - if ((p.brr.timing_requirements != T_ATM_NULL) && - (p.brr.timing_requirements != T_ATM_END_TO_END) && - (p.brr.timing_requirements != T_ATM_NO_END_TO_END)) - return (EINVAL); - if ((p.brr.clipping_susceptibility != T_NO) && - (p.brr.clipping_susceptibility != T_YES)) - return (EINVAL); - if ((p.brr.connection_configuration != T_ATM_1_TO_1) && - (p.brr.connection_configuration != T_ATM_1_TO_MANY)) - return (EINVAL); - - atp->atp_attr.bearer.tag = T_ATM_PRESENT; - atp->atp_attr.bearer.v = p.brr; - break; - - case T_ATM_BHLI: - err = sooptcopyin(sopt, &p.bhl, sizeof p.bhl, sizeof p.bhl); - if (err) - break; - if ((p.bhl.ID_type != T_ATM_ABSENT) && - (p.bhl.ID_type != T_ATM_ISO_APP_ID) && - (p.bhl.ID_type != T_ATM_USER_APP_ID) && - (p.bhl.ID_type != T_ATM_VENDOR_APP_ID)) - return (EINVAL); - - if (p.bhl.ID_type == T_ATM_ABSENT) - atp->atp_attr.bhli.tag = T_ATM_ABSENT; - else { - atp->atp_attr.bhli.tag = T_ATM_PRESENT; - atp->atp_attr.bhli.v = p.bhl; - } - break; - - case T_ATM_BLLI: - err = sooptcopyin(sopt, &p.bll, sizeof p.bll, sizeof p.bll); - if (err) - break; - if ((p.bll.layer_2_protocol.ID_type != T_ATM_ABSENT) && - (p.bll.layer_2_protocol.ID_type != T_ATM_SIMPLE_ID) && - (p.bll.layer_2_protocol.ID_type != T_ATM_USER_ID)) - return (EINVAL); - if ((p.bll.layer_2_protocol.mode != T_ATM_ABSENT) && - (p.bll.layer_2_protocol.mode != T_ATM_BLLI_NORMAL_MODE) && - (p.bll.layer_2_protocol.mode != T_ATM_BLLI_EXTENDED_MODE)) - return (EINVAL); - if ((p.bll.layer_2_protocol.window_size != T_ATM_ABSENT) && - (p.bll.layer_2_protocol.window_size < 1)) - return (EINVAL); - - if ((p.bll.layer_3_protocol.ID_type != T_ATM_ABSENT) && - (p.bll.layer_3_protocol.ID_type != T_ATM_SIMPLE_ID) && - (p.bll.layer_3_protocol.ID_type != T_ATM_IPI_ID) && - (p.bll.layer_3_protocol.ID_type != T_ATM_SNAP_ID) && - (p.bll.layer_3_protocol.ID_type != T_ATM_USER_ID)) - return (EINVAL); - if ((p.bll.layer_3_protocol.mode != T_ATM_ABSENT) && - (p.bll.layer_3_protocol.mode != T_ATM_BLLI_NORMAL_MODE) && - (p.bll.layer_3_protocol.mode != T_ATM_BLLI_EXTENDED_MODE)) - return (EINVAL); - if ((p.bll.layer_3_protocol.packet_size != T_ATM_ABSENT) && - (p.bll.layer_3_protocol.packet_size & MAXMASK(4))) - return (EINVAL); - if ((p.bll.layer_3_protocol.window_size != T_ATM_ABSENT) && - (p.bll.layer_3_protocol.window_size < 1)) - return (EINVAL); - - if (p.bll.layer_2_protocol.ID_type == T_ATM_ABSENT) - atp->atp_attr.blli.tag_l2 = T_ATM_ABSENT; - else - atp->atp_attr.blli.tag_l2 = T_ATM_PRESENT; - - if (p.bll.layer_3_protocol.ID_type == T_ATM_ABSENT) - atp->atp_attr.blli.tag_l3 = T_ATM_ABSENT; - else - atp->atp_attr.blli.tag_l3 = T_ATM_PRESENT; - - if ((atp->atp_attr.blli.tag_l2 == T_ATM_PRESENT) || - (atp->atp_attr.blli.tag_l3 == T_ATM_PRESENT)) - atp->atp_attr.blli.v = p.bll; - break; - - case T_ATM_DEST_ADDR: - err = sooptcopyin(sopt, &p.addr, sizeof p.addr, sizeof p.addr); - if (err) - break; - if ((p.addr.address_format != T_ATM_ENDSYS_ADDR) && - (p.addr.address_format != T_ATM_E164_ADDR)) - return (EINVAL); - if (p.addr.address_length > ATM_ADDR_LEN) - return (EINVAL); - - atp->atp_attr.called.tag = T_ATM_PRESENT; - atp->atp_attr.called.addr = p.addr; - break; - - case T_ATM_DEST_SUB: - err = sooptcopyin(sopt, &p.addr, sizeof p.addr, sizeof p.addr); - if (err) - break; - if ((p.addr.address_format != T_ATM_ABSENT) && - (p.addr.address_format != T_ATM_NSAP_ADDR)) - return (EINVAL); - if (p.addr.address_length > ATM_ADDR_LEN) - return (EINVAL); - - /* T_ATM_DEST_ADDR controls tag */ - atp->atp_attr.called.subaddr = p.addr; - break; - - case T_ATM_ORIG_ADDR: - return (EACCES); - - case T_ATM_ORIG_SUB: - return (EACCES); - - case T_ATM_CALLER_ID: - return (EACCES); - - case T_ATM_CAUSE: - err = sooptcopyin(sopt, &p.cau, sizeof p.cau, sizeof p.cau); - if (err) - break; - if ((p.cau.coding_standard != T_ATM_ABSENT) && - (p.cau.coding_standard != T_ATM_ITU_CODING) && - (p.cau.coding_standard != T_ATM_NETWORK_CODING)) - return (EINVAL); - if ((p.cau.location != T_ATM_LOC_USER) && - (p.cau.location != T_ATM_LOC_LOCAL_PRIVATE_NET) && - (p.cau.location != T_ATM_LOC_LOCAL_PUBLIC_NET) && - (p.cau.location != T_ATM_LOC_TRANSIT_NET) && - (p.cau.location != T_ATM_LOC_REMOTE_PUBLIC_NET) && - (p.cau.location != T_ATM_LOC_REMOTE_PRIVATE_NET) && - (p.cau.location != T_ATM_LOC_INTERNATIONAL_NET) && - (p.cau.location != T_ATM_LOC_BEYOND_INTERWORKING)) - return (EINVAL); - - if (p.cau.coding_standard == T_ATM_ABSENT) - atp->atp_attr.cause.tag = T_ATM_ABSENT; - else { - atp->atp_attr.cause.tag = T_ATM_PRESENT; - atp->atp_attr.cause.v = p.cau; - } - break; - - case T_ATM_QOS: - err = sooptcopyin(sopt, &p.qos, sizeof p.qos, sizeof p.qos); - if (err) - break; - if ((p.qos.coding_standard != T_ATM_ABSENT) && - (p.qos.coding_standard != T_ATM_ITU_CODING) && - (p.qos.coding_standard != T_ATM_NETWORK_CODING)) - return (EINVAL); - if ((p.qos.forward.qos_class != T_ATM_QOS_CLASS_0) && - (p.qos.forward.qos_class != T_ATM_QOS_CLASS_1) && - (p.qos.forward.qos_class != T_ATM_QOS_CLASS_2) && - (p.qos.forward.qos_class != T_ATM_QOS_CLASS_3) && - (p.qos.forward.qos_class != T_ATM_QOS_CLASS_4)) - return (EINVAL); - if ((p.qos.backward.qos_class != T_ATM_QOS_CLASS_0) && - (p.qos.backward.qos_class != T_ATM_QOS_CLASS_1) && - (p.qos.backward.qos_class != T_ATM_QOS_CLASS_2) && - (p.qos.backward.qos_class != T_ATM_QOS_CLASS_3) && - (p.qos.backward.qos_class != T_ATM_QOS_CLASS_4)) - return (EINVAL); - - if (p.qos.coding_standard == T_ATM_ABSENT) - atp->atp_attr.qos.tag = T_ATM_ABSENT; - else { - atp->atp_attr.qos.tag = T_ATM_PRESENT; - atp->atp_attr.qos.v = p.qos; - } - break; - - case T_ATM_TRANSIT: - err = sooptcopyin(sopt, &p.trn, sizeof p.trn, sizeof p.trn); - if (err) - break; - if (p.trn.length > T_ATM_MAX_NET_ID) - return (EINVAL); - - if (p.trn.length == 0) - atp->atp_attr.transit.tag = T_ATM_ABSENT; - else { - atp->atp_attr.transit.tag = T_ATM_PRESENT; - atp->atp_attr.transit.v = p.trn; - } - break; - - case T_ATM_ADD_LEAF: - return (EPROTONOSUPPORT); /* XXX */ - - case T_ATM_DROP_LEAF: - return (EPROTONOSUPPORT); /* XXX */ - - case T_ATM_NET_INTF: - err = sooptcopyin(sopt, &p.nif, sizeof p.nif, sizeof p.nif); - if (err) - break; - - atp->atp_attr.nif = atm_nifname(p.nif.net_intf); - if (atp->atp_attr.nif == NULL) - return (ENXIO); - break; - - case T_ATM_LLC: - err = sooptcopyin(sopt, &p.llc, sizeof p.llc, sizeof p.llc); - if (err) - break; - if ((p.llc.llc_len < T_ATM_LLC_MIN_LEN) || - (p.llc.llc_len > T_ATM_LLC_MAX_LEN)) - return (EINVAL); - - atp->atp_attr.llc.tag = T_ATM_PRESENT; - atp->atp_attr.llc.v = p.llc; - break; - - case T_ATM_APP_NAME: - err = sooptcopyin(sopt, &p.appn, sizeof p.appn, sizeof p.appn); - if (err) - break; - - strncpy(atp->atp_name, p.appn.app_name, T_ATM_APP_NAME_LEN); - break; - - default: - return (ENOPROTOOPT); - } - - return (err); -} - - -/* - * Common getsockopt processing - * - * Called at splnet. - * - * Arguments: - * so pointer to socket - * sopt pointer to socket option info - * atp pointer to ATM PCB - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_sock_getopt(so, sopt, atp) - struct socket *so; - struct sockopt *sopt; - Atm_pcb *atp; -{ - Atm_attributes *ap; - - /* - * If socket is connected, return attributes for the VCC in use, - * otherwise just return what the user has setup so far. - */ - if (so->so_state & SS_ISCONNECTED) - ap = &atp->atp_conn->co_connvc->cvc_attr; - else - ap = &atp->atp_attr; - - switch (sopt->sopt_name) { - - case T_ATM_AAL5: - if ((ap->aal.tag == T_ATM_PRESENT) && - (ap->aal.type == ATM_AAL5)) { - return (sooptcopyout(sopt, &ap->aal.v.aal5, - sizeof ap->aal.v.aal5)); - } else { - return (ENOENT); - } - break; - - case T_ATM_TRAFFIC: - if (ap->traffic.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->traffic.v, - sizeof ap->traffic.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_BEARER_CAP: - if (ap->bearer.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->bearer.v, - sizeof ap->bearer.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_BHLI: - if (ap->bhli.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->bhli.v, - sizeof ap->bhli.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_BLLI: - if ((ap->blli.tag_l2 == T_ATM_PRESENT) || - (ap->blli.tag_l3 == T_ATM_PRESENT)) { - return (sooptcopyout(sopt, &ap->blli.v, - sizeof ap->blli.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_DEST_ADDR: - if (ap->called.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->called.addr, - sizeof ap->called.addr)); - } else { - return (ENOENT); - } - break; - - case T_ATM_DEST_SUB: - if (ap->called.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->called.subaddr, - sizeof ap->called.subaddr)); - } else { - return (ENOENT); - } - break; - - case T_ATM_ORIG_ADDR: - if (ap->calling.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->calling.addr, - sizeof ap->calling.addr)); - } else { - return (ENOENT); - } - break; - - case T_ATM_ORIG_SUB: - if (ap->calling.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->calling.subaddr, - sizeof ap->calling.subaddr)); - } else { - return (ENOENT); - } - break; - - case T_ATM_CALLER_ID: - if (ap->calling.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->calling.cid, - sizeof ap->calling.cid)); - } else { - return (ENOENT); - } - break; - - case T_ATM_CAUSE: - if (ap->cause.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->cause.v, - sizeof ap->cause.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_QOS: - if (ap->qos.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->qos.v, - sizeof ap->qos.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_TRANSIT: - if (ap->transit.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->transit.v, - sizeof ap->transit.v)); - } else { - return (ENOENT); - } - break; - - case T_ATM_LEAF_IND: - return (EPROTONOSUPPORT); /* XXX */ - - case T_ATM_NET_INTF: - if (ap->nif) { - struct t_atm_net_intf netif; - struct ifnet *ifp; - - ifp = ANIF2IFP(ap->nif); - (void) snprintf(netif.net_intf, sizeof(netif.net_intf), - "%s", ifp->if_xname); - return (sooptcopyout(sopt, &netif, - sizeof netif)); - } else { - return (ENOENT); - } - break; - - case T_ATM_LLC: - if (ap->llc.tag == T_ATM_PRESENT) { - return (sooptcopyout(sopt, &ap->llc.v, - sizeof ap->llc.v)); - } else { - return (ENOENT); - } - break; - - default: - return (ENOPROTOOPT); - } - - return (0); -} - - -/* - * Process Socket VCC Connected Notification - * - * Arguments: - * toku owner's connection token (atm_pcb protocol block) - * - * Returns: - * none - * - */ -void -atm_sock_connected(toku) - void *toku; -{ - Atm_pcb *atp = (Atm_pcb *)toku; - - /* - * Connection is setup - */ - atm_sock_stat.as_conncomp[atp->atp_type]++; - soisconnected(atp->atp_socket); -} - - -/* - * Process Socket VCC Cleared Notification - * - * Arguments: - * toku owner's connection token (atm_pcb protocol block) - * cause pointer to cause code - * - * Returns: - * none - * - */ -void -atm_sock_cleared(toku, cause) - void *toku; - struct t_atm_cause *cause; -{ - Atm_pcb *atp = (Atm_pcb *)toku; - struct socket *so; - - so = atp->atp_socket; - - /* - * Save call clearing cause - */ - atp->atp_attr.cause.tag = T_ATM_PRESENT; - atp->atp_attr.cause.v = *cause; - - /* - * Set user error code - */ - if (so->so_state & SS_ISCONNECTED) { - so->so_error = ECONNRESET; - atm_sock_stat.as_connclr[atp->atp_type]++; - } else { - so->so_error = ECONNREFUSED; - atm_sock_stat.as_connfail[atp->atp_type]++; - } - - /* - * Connection is gone - */ - atp->atp_conn = NULL; - soisdisconnected(so); - - /* - * Cleanup failed incoming connection setup - */ - if (so->so_state & SS_NOFDREF) { - (void) atm_sock_detach(so); - } -} - Property changes on: head/sys/netatm/atm_socket.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_if.h =================================================================== --- head/sys/netatm/atm_if.h (revision 179307) +++ head/sys/netatm/atm_if.h (nonexistent) @@ -1,369 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Physical and Network Interface definitions - * - */ - -#ifndef _NETATM_ATM_IF_H -#define _NETATM_ATM_IF_H - -/* - * Handy constants - */ -#define ATM_NIF_MTU 9180 /* Default network interface MTU */ - -#define ATM_PCR_25 59111 /* Peak Cell Rate for 25.6 Mbs */ -#define ATM_PCR_DS3 (12*8000) /* 12 cells in 1/8000 sec */ -#define ATM_PCR_TAXI100 227273 /* Peak Cell Rate for 100 Mbs TAXI */ -#define ATM_PCR_TAXI140 318181 /* Peak Cell Rate for 140 Mbs TAXI */ -#define ATM_PCR_OC3C 353207 /* Peak Cell Rate for OC3c */ -#define ATM_PCR_OC12C 1416905 /* Peak Cell Rate for OC12c */ - - -/* - * Media Access Control (MAC) address - */ -struct mac_addr { - u_char ma_data[6]; /* MAC address */ -}; -typedef struct mac_addr Mac_addr; - - -/* - * Adapter vendor identifiers - */ -enum atm_vendor { - VENDOR_UNKNOWN, /* Unknown vendor */ - VENDOR_FORE, /* FORE Systems, Inc. */ - VENDOR_ENI, /* Efficient Networks, Inc. */ - VENDOR_IDT, /* Integrated Device Technology, Inc. */ - VENDOR_PROSUM, /* Prosum, Inc. */ - VENDOR_NETGRAPH /* Netgraph device */ -}; -typedef enum atm_vendor Atm_vendor; - - -/* - * Adapter vendor interface identifiers - */ -enum atm_vendapi { - VENDAPI_UNKNOWN, /* Unknown interface */ - VENDAPI_FORE_1, /* FORE - 200 Series */ - VENDAPI_ENI_1, /* ENI - Midway */ - VENDAPI_IDT_1, /* IDT - NICStAR */ - VENDAPI_IDT_2, /* IDT 77252 */ - VENDAPI_NETGRAPH_1, /* Netgraph API v1 */ - VENDAPI_FORE_2, /* FORE - HE Series */ -}; -typedef enum atm_vendapi Atm_vendapi; - - -/* - * Adapter device model identifiers - */ -enum atm_device { - DEV_UNKNOWN, /* Unknown device */ - DEV_FORE_SBA200E, /* FORE SBA-200E */ - DEV_FORE_SBA200, /* FORE SBA-200 */ - DEV_FORE_PCA200E, /* FORE PCA-200E */ - DEV_FORE_ESA200E, /* FORE ESA-200E */ - DEV_ENI_155P, /* ENI-155p */ - DEV_IDT_155, /* IDT NICStAR */ - DEV_PROATM_25, /* Prosum boards based on IDT 77252 */ - DEV_PROATM_155, /* Prosum boards based on IDT 77252 */ - DEV_VATMPIF, /* Virtual ATM Physical IF */ - DEV_FORE_LE25, /* ForeLE-25 */ - DEV_FORE_LE155, /* ForeLE-155 */ - DEV_IDT_25, /* IDT NICStAR */ - DEV_IDTABR_25, /* IDT 77252 evaluation board */ - DEV_IDTABR_155, /* IDT 77252 evaluation board */ - DEV_FORE_HE155, /* ForeRunnerHE-155 */ - DEV_FORE_HE622, /* ForeRunnerHE-622 */ -}; -typedef enum atm_device Atm_device; - - -/* - * Adapter media identifiers - */ -enum atm_media { - MEDIA_UNKNOWN, /* Unknown media type */ - MEDIA_TAXI_100, /* TAXI - 100 Mbps */ - MEDIA_TAXI_140, /* TAXI - 140 Mbps */ - MEDIA_OC3C, /* OC-3C */ - MEDIA_OC12C, /* OC-12C */ - MEDIA_UTP155, /* UTP-155 */ - MEDIA_UTP25, /* UTP-25.6 */ - MEDIA_VIRTUAL, /* Virtual Link */ - MEDIA_DSL /* xDSL */ -}; -typedef enum atm_media Atm_media; - - -/* - * Bus type identifiers - */ -enum atm_bus { - BUS_UNKNOWN, /* Unknown bus type */ - BUS_SBUS_B16, /* SBus: 16 byte (4 word) max burst */ - BUS_SBUS_B32, /* SBus: 32 byte (8 word) max burst */ - BUS_PCI, /* PCI */ - BUS_EISA, /* EISA */ - BUS_USB, /* USB */ - BUS_VIRTUAL /* Virtual Bus */ -}; -typedef enum atm_bus Atm_bus; - - -#define VERSION_LEN 16 /* Length of version info string */ - - -/* - * ATM adapter configuration information structure - */ -struct atm_config { - Atm_vendor ac_vendor; /* Vendor */ - Atm_vendapi ac_vendapi; /* Vendor interface */ - Atm_device ac_device; /* Device model */ - Atm_media ac_media; /* Media type */ - u_long ac_serial; /* Serial number */ - Atm_bus ac_bustype; /* Bus type */ - u_long ac_busslot; /* Bus slot info (bus type dependent) */ - u_long ac_ram; /* Device ram offset */ - u_long ac_ramsize; /* Device ram size */ - Mac_addr ac_macaddr; /* MAC address */ - char ac_hard_vers[VERSION_LEN]; /* Hardware version */ - char ac_firm_vers[VERSION_LEN]; /* Firmware version */ -}; -typedef struct atm_config Atm_config; - - -#ifdef _KERNEL - -#include - -/* - * Common structure used to define each physical ATM device interface. - * This structure will (normally) be embedded at the top of each driver's - * device-specific interface structure. - */ -struct atm_pif { - struct atm_pif *pif_next; /* Next registered atm interface */ - const char *pif_name; /* Device name */ - short pif_unit; /* Device unit number */ - u_char pif_flags; /* Interface flags (see below) */ - struct sigmgr *pif_sigmgr; /* Signalling Manager for interface */ - struct siginst *pif_siginst; /* Signalling protocol instance */ - struct stack_defn *pif_services; /* Interface's stack services */ - struct mac_addr pif_macaddr; /* Interface's MAC address */ - struct atm_nif *pif_nif; /* List of network interfaces */ - struct atm_pif *pif_grnext; /* Next atm device in group */ - -/* Exported functions */ - int (*pif_ioctl) /* Interface ioctl handler */ - (int, caddr_t, caddr_t); - -/* Interface statistics */ - u_quad_t pif_ipdus; /* PDUs received from interface */ - u_quad_t pif_opdus; /* PDUs sent to interface */ - u_quad_t pif_ibytes; /* Bytes received from interface */ - u_quad_t pif_obytes; /* Bytes sent to interface */ - u_quad_t pif_ierrors; /* Errors receiving from interface */ - u_quad_t pif_oerrors; /* Errors sending to interface */ - u_quad_t pif_cmderrors; /* Interface command errors */ - caddr_t pif_cardstats; /* Card specific statistics */ - -/* Interface capabilities */ - u_short pif_maxvpi; /* Maximum VPI value supported */ - u_short pif_maxvci; /* Maximum VCI value supported */ - u_int pif_pcr; /* Peak Cell Rate */ -}; - -/* - * Physical interface flags - */ -#define PIF_UP 0x01 /* Interface is up */ -#define PIF_LOOPBACK 0x02 /* Loopback local packets */ - - -/* - * Structure defining an ATM network interface. This structure is used as - * the hook between the standard BSD network layer interface mechanism and - * the ATM device layer. There may be one or more network interfaces for - * each physical ATM interface. - */ -struct atm_nif { - struct ifnet *nif_ifp; /* Network interface */ - struct atm_pif *nif_pif; /* Our physical interface */ - char nif_name[IFNAMSIZ];/* Network interface name */ - u_char nif_sel; /* Interface's address selector */ - struct atm_nif *nif_pnext; /* Next net interface on phys i/f */ - -/* Interface statistics (in addition to ifnet stats) */ - long nif_ibytes; /* Bytes received from interface */ - long nif_obytes; /* Bytes sent to interface */ -}; -#define ANIF2IFP(an) ((an)->nif_ifp) -#define IFP2ANIF(ifp) ((struct atm_nif *)(ifp)->if_softc) - -/* - * Common Device VCC Entry - * - * Contains the common information for each VCC which is opened - * through a particular device. - */ -struct cmn_vcc { - struct cmn_vcc *cv_next; /* Next in list */ - void *cv_toku; /* Upper layer's token */ - void (*cv_upper) /* Upper layer's interface */ - (int, void *, intptr_t, intptr_t); - Atm_connvc *cv_connvc; /* Associated connection VCC */ - u_char cv_state; /* VCC state (see below) */ - u_char cv_flags; /* VCC flags (see below) */ -}; -typedef struct cmn_vcc Cmn_vcc; - -/* - * VCC States - */ -#define CVS_FREE 0 /* Not allocated */ -#define CVS_INST 1 /* Instantiated, waiting for INIT */ -#define CVS_INITED 2 /* Initialized, waiting for driver */ -#define CVS_ACTIVE 3 /* Device activated by driver */ -#define CVS_PTERM 4 /* Waiting for TERM */ -#define CVS_TERM 5 /* Terminated */ - -/* - * VCC Flags - */ -#define CVF_RSVD 0x0f /* Reserved for device-specific use */ - - -/* - * Common Device Unit Structure - * - * Contains the common information for a single device (adapter). - */ -struct cmn_unit { - struct atm_pif cu_pif; /* Physical interface */ - u_int cu_unit; /* Local unit number */ - u_char cu_flags; /* Device flags (see below) */ - u_int cu_mtu; /* Interface MTU */ - - u_int cu_open_vcc; /* Open VCC count */ - Cmn_vcc *cu_vcc; /* List of VCC's on interface */ - - u_int cu_intrpri; /* Highest unit interrupt priority */ - int cu_savepri; /* Saved priority for locking device */ - - uma_zone_t cu_vcc_zone; /* Device VCC zone */ - uma_zone_t cu_nif_zone; /* Device NIF zone */ - - int (*cu_ioctl) /* Interface ioctl handler */ - (int, caddr_t, caddr_t); - int (*cu_instvcc) /* VCC stack instantion handler */ - (struct cmn_unit *, Cmn_vcc *); - int (*cu_openvcc) /* Open VCC handler */ - (struct cmn_unit *, Cmn_vcc *); - int (*cu_closevcc) /* Close VCC handler */ - (struct cmn_unit *, Cmn_vcc *); - void (*cu_output) /* Data output handler */ - (struct cmn_unit *, Cmn_vcc *, KBuffer *); - - Atm_config cu_config; /* Device configuration data */ - - void * cu_softc; /* pointer to driver state */ -}; -typedef struct cmn_unit Cmn_unit; - -/* - * Device flags - */ -#define CUF_REGISTER 0x01 /* Device is registered */ -#define CUF_INITED 0x02 /* Device is initialized */ - - -/* - * Structure used to define a network convergence module and its associated - * entry points. A convergence module is used to provide the interface - * translations necessary between the ATM system and the BSD network layer - * interface mechanism. There will be one network convergence module for - * each protocol address family supporting ATM connections. - */ -struct atm_ncm { - struct atm_ncm *ncm_next; /* Next in registry list */ - u_short ncm_family; /* Protocol family */ -/* Exported functions */ - int (*ncm_ifoutput) /* Interface if_output handler */ - (struct ifnet *, KBuffer *, struct sockaddr *); - int (*ncm_stat) /* Network i/f status handler */ - (int, struct atm_nif *, intptr_t); -}; - -/* - * ncm_stat() commands - */ -#define NCM_ATTACH 1 /* Attaching a new net i/f */ -#define NCM_DETACH 2 /* Detaching a current net i/f */ -#define NCM_SETADDR 3 /* Net i/f address change */ -#define NCM_SIGATTACH 4 /* Attaching a signalling manager */ -#define NCM_SIGDETACH 5 /* Detaching a signalling manager */ - - -/* - * atm_dev_alloc() parameters - */ -#define ATM_DEV_NONCACHE 1 /* Allocate non-cacheable memory */ - -/* - * atm_dev_compress() buffer allocation sizes - */ -#define ATM_DEV_CMPR_LG MCLBYTES /* Size of large buffers */ -#define ATM_DEV_CMPR_SM MLEN /* Size of small buffers */ - -/* - * Macros to lock out device interrupts - */ -#define DEVICE_LOCK(u) ((u)->cu_savepri = splimp()) -#define DEVICE_UNLOCK(u) ((void) splx((u)->cu_savepri)) - -/* - * Macro to schedule the ATM interrupt queue handler - */ -typedef void (atm_intr_t)(void *, KBuffer *); /* Callback function type */ -typedef atm_intr_t *atm_intr_func_t; /* Pointer to callback function */ - -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_IF_H */ Property changes on: head/sys/netatm/atm_if.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_if.c =================================================================== --- head/sys/netatm/atm_if.c (revision 179307) +++ head/sys/netatm/atm_if.c (nonexistent) @@ -1,1147 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM interface management - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Local functions - */ -static int atm_physif_ioctl(int, caddr_t, caddr_t); -static int atm_if_ioctl(struct ifnet *, u_long, caddr_t); -static int atm_ifparse(const char *, char *, size_t, int *); - -/* - * Local variables - */ -static int (*atm_ifouttbl[AF_MAX+1]) - (struct ifnet *, KBuffer *, struct sockaddr *) - = {NULL}; - - -/* - * Register an ATM physical interface - * - * Each ATM device interface must register itself here upon completing - * its internal initialization. This applies to both linked and loaded - * device drivers. The interface must be registered before a signalling - * manager can be attached. - * - * Arguments: - * cup pointer to interface's common unit structure - * name pointer to device name string - * sdp pointer to interface's stack services - * - * Returns: - * 0 registration successful - * errno registration failed - reason indicated - * - */ -int -atm_physif_register(cup, name, sdp) - Cmn_unit *cup; - const char *name; - struct stack_defn *sdp; -{ - struct atm_pif *pip; - int s; - - /* - * See if we need to be initialized - */ - if (!atm_init) - atm_initialize(); - - /* - * Make sure we're not already registered - */ - if (cup->cu_flags & CUF_REGISTER) { - return (EALREADY); - } - - s = splnet(); - - /* - * Make sure an interface is only registered once - */ - for (pip = atm_interface_head; pip != NULL; pip = pip->pif_next) { - if ((cup->cu_unit == pip->pif_unit) && - (strcmp(name, pip->pif_name) == 0)) { - (void) splx(s); - return (EEXIST); - } - } - - /* - * Fill in physical interface parameters - */ - pip = &cup->cu_pif; - pip->pif_name = name; - pip->pif_unit = cup->cu_unit; - pip->pif_flags = PIF_UP; - pip->pif_services = sdp; - pip->pif_ioctl = atm_physif_ioctl; - - /* - * Link in the interface and mark us registered - */ - LINK2TAIL(pip, struct atm_pif, atm_interface_head, pif_next); - cup->cu_flags |= CUF_REGISTER; - - (void) splx(s); - return (0); -} - - -/* - * De-register an ATM physical interface - * - * Each ATM interface must de-register itself before downing the interface. - * The interface's signalling manager will be detached and any network - * interface and VCC control blocks will be freed. - * - * Arguments: - * cup pointer to interface's common unit structure - * - * Returns: - * 0 de-registration successful - * errno de-registration failed - reason indicated - * - */ -int -atm_physif_deregister(cup) - Cmn_unit *cup; -{ - struct atm_pif *pip = (struct atm_pif *)&cup->cu_pif; - Cmn_vcc *cvp, *cvp_next; - int err; - int s = splnet(); - - /* - * Detach and deregister, if needed - */ - if ((cup->cu_flags & CUF_REGISTER)) { - - /* - * Detach from signalling manager - */ - if (pip->pif_sigmgr != NULL) { - err = atm_sigmgr_detach(pip); - if (err && (err != ENOENT)) { - (void) splx(s); - return (err); - } - } - - /* - * Make sure signalling manager is detached - */ - if (pip->pif_sigmgr != NULL) { - (void) splx(s); - return (EBUSY); - } - - /* - * Unlink interface - */ - UNLINK(pip, struct atm_pif, atm_interface_head, pif_next); - - cup->cu_flags &= ~CUF_REGISTER; - } - - /* - * Free all of our network interfaces - */ - atm_physif_freenifs(pip, cup->cu_nif_zone); - - /* - * Free unit's vcc information - */ - cvp = cup->cu_vcc; - while (cvp) { - cvp_next = cvp->cv_next; - uma_zfree(cup->cu_vcc_zone, cvp); - cvp = cvp_next; - } - cup->cu_vcc = (Cmn_vcc *)NULL; - - (void) splx(s); - - return (0); -} - - -/* - * Free all network interfaces on a physical interface - * - * Arguments - * pip pointer to physical interface structure - * - * Returns - * none - * - */ -void -atm_physif_freenifs(pip, zone) - struct atm_pif *pip; - uma_zone_t zone; -{ - struct atm_nif *nip = pip->pif_nif; - int s = splnet(); - - while ( nip ) - { - /* - * atm_nif_detach zeros pointers - save so we can - * walk the chain. - */ - struct atm_nif *nipp = nip->nif_pnext; - - /* - * Clean up network i/f trails - */ - atm_nif_detach(nip); - uma_zfree(zone, nip); - nip = nipp; - } - pip->pif_nif = (struct atm_nif *)NULL; - - (void) splx(s); - - return; -} - -/* - * Handle physical interface ioctl's - * - * See for definitions. - * - * Called at splnet. - * - * Arguments: - * code Ioctl function (sub)code - * data Data block. On input contains command, - * on output, contains results - * arg Optional code specific arguments - * - * Returns: - * 0 Request processed successfully - * errno Request failed - reason code - * - */ -static int -atm_physif_ioctl(code, data, arg) - int code; - caddr_t data; - caddr_t arg; -{ - struct atminfreq *aip = (struct atminfreq *)data; - struct atmsetreq *asr = (struct atmsetreq *)data; - struct atm_pif *pip; - struct atm_nif *nip; - struct sigmgr *smp; - struct siginst *sip; - struct ifnet *ifp; - Cmn_unit *cup; - Atm_config *acp; - caddr_t buf = aip->air_buf_addr; - struct air_phy_stat_rsp *apsp; - struct air_int_rsp apr; - struct air_netif_rsp anr; - struct air_cfg_rsp acr; - u_int count; - size_t len; - size_t buf_len = aip->air_buf_len; - int err = 0; - char ifname[2*IFNAMSIZ]; - struct ifaddr *ifa; - struct in_ifaddr *ia; - struct sockaddr_dl *sdl; - - - switch ( aip->air_opcode ) { - - case AIOCS_INF_INT: - /* - * Get physical interface information - */ - aip = (struct atminfreq *)data; - pip = (struct atm_pif *)arg; - - /* - * Make sure there's room in user buffer - */ - if (aip->air_buf_len < sizeof(apr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - bzero((caddr_t)&apr, sizeof(apr)); - smp = pip->pif_sigmgr; - sip = pip->pif_siginst; - (void) snprintf(apr.anp_intf, sizeof(apr.anp_intf), - "%s%d", pip->pif_name, pip->pif_unit ); - if ( pip->pif_nif ) - { - strcpy(apr.anp_nif_pref, pip->pif_nif->nif_ifp->if_dname); - - nip = pip->pif_nif; - while ( nip ) { - apr.anp_nif_cnt++; - nip = nip->nif_pnext; - } - } - if (sip) { - ATM_ADDR_COPY(&sip->si_addr, &apr.anp_addr); - ATM_ADDR_COPY(&sip->si_subaddr, &apr.anp_subaddr); - apr.anp_sig_proto = smp->sm_proto; - apr.anp_sig_state = sip->si_state; - } - - /* - * Copy data to user buffer - */ - err = copyout((caddr_t)&apr, aip->air_buf_addr, sizeof(apr)); - if (err) - break; - - /* - * Update buffer pointer/count - */ - aip->air_buf_addr += sizeof(apr); - aip->air_buf_len -= sizeof(apr); - break; - - case AIOCS_INF_NIF: - /* - * Get network interface information - */ - aip = (struct atminfreq *)data; - nip = (struct atm_nif *)arg; - ifp = nip->nif_ifp; - pip = nip->nif_pif; - - /* - * Make sure there's room in user buffer - */ - if (aip->air_buf_len < sizeof(anr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - bzero((caddr_t)&anr, sizeof(anr)); - (void) snprintf(anr.anp_intf, sizeof(anr.anp_intf), - "%s%d", ifp->if_dname, ifp->if_dunit); - IFP_TO_IA(ifp, ia); - if (ia) { - anr.anp_proto_addr = *ia->ia_ifa.ifa_addr; - } - (void) snprintf(anr.anp_phy_intf, sizeof(anr.anp_phy_intf), - "%s%d", pip->pif_name, pip->pif_unit); - - /* - * Copy data to user buffer - */ - err = copyout((caddr_t)&anr, aip->air_buf_addr, sizeof(anr)); - if (err) - break; - - /* - * Update buffer pointer/count - */ - aip->air_buf_addr += sizeof(anr); - aip->air_buf_len -= sizeof(anr); - break; - - case AIOCS_INF_PIS: - /* - * Get per interface statistics - */ - pip = (struct atm_pif *)arg; - if ( pip == NULL ) - return ( ENXIO ); - snprintf ( ifname, sizeof(ifname), - "%s%d", pip->pif_name, pip->pif_unit ); - - /* - * Cast response into users buffer - */ - apsp = (struct air_phy_stat_rsp *)buf; - - /* - * Sanity check - */ - len = sizeof ( struct air_phy_stat_rsp ); - if ( buf_len < len ) - return ( ENOSPC ); - - /* - * Copy interface name into response - */ - if ((err = copyout ( ifname, apsp->app_intf, IFNAMSIZ)) != 0) - break; - - /* - * Copy counters - */ - if ((err = copyout(&pip->pif_ipdus, &apsp->app_ipdus, - len - sizeof(apsp->app_intf))) != 0) - break; - - /* - * Adjust buffer elements - */ - buf += len; - buf_len -= len; - - aip->air_buf_addr = buf; - aip->air_buf_len = buf_len; - break; - - case AIOCS_SET_NIF: - /* - * Set NIF - allow user to configure 1 or more logical - * interfaces per physical interface. - */ - - /* - * Get pointer to physical interface structure from - * ioctl argument. - */ - pip = (struct atm_pif *)arg; - cup = (Cmn_unit *)pip; - - /* - * Sanity check - are we already connected to something? - */ - if ( pip->pif_sigmgr ) - { - err = EBUSY; - break; - } - - /* - * Free any previously allocated NIFs - */ - atm_physif_freenifs(pip, cup->cu_nif_zone); - - /* - * Add list of interfaces - */ - for ( count = 0; count < asr->asr_nif_cnt; count++ ) - { - nip = uma_zalloc(cup->cu_nif_zone, M_WAITOK | M_ZERO); - if ( nip == NULL ) - { - /* - * Destroy any successful nifs - */ - atm_physif_freenifs(pip, cup->cu_nif_zone); - err = ENOMEM; - break; - } - - nip->nif_pif = pip; - ifp = nip->nif_ifp = if_alloc(IFT_IPOVERATM); - if (ifp == NULL) { - uma_zfree(cup->cu_nif_zone, nip); - /* - * Destroy any successful nifs - */ - atm_physif_freenifs(pip, cup->cu_nif_zone); - break; - } - - strcpy ( nip->nif_name, asr->asr_nif_pref ); - nip->nif_sel = count; - - if_initname(ifp, nip->nif_name, count); - ifp->if_mtu = ATM_NIF_MTU; - ifp->if_flags = IFF_UP | IFF_BROADCAST; - ifp->if_drv_flags = IFF_DRV_RUNNING; - ifp->if_output = atm_ifoutput; - ifp->if_ioctl = atm_if_ioctl; - ifp->if_snd.ifq_maxlen = ifqmaxlen; - switch ( cup->cu_config.ac_media ) { - case MEDIA_TAXI_100: - ifp->if_baudrate = 100000000; - break; - case MEDIA_TAXI_140: - ifp->if_baudrate = 140000000; - break; - case MEDIA_OC3C: - case MEDIA_OC12C: - case MEDIA_UTP155: - ifp->if_baudrate = 155000000; - break; - case MEDIA_UTP25: - ifp->if_baudrate = 25600000; - break; - case MEDIA_VIRTUAL: - ifp->if_baudrate = 100000000; /* XXX */ - break; - case MEDIA_DSL: - ifp->if_baudrate = 2500000; /* XXX */ - break; - case MEDIA_UNKNOWN: - ifp->if_baudrate = 9600; - break; - } - if ((err = atm_nif_attach(nip)) != 0) { - if_free(nip->nif_ifp); - uma_zfree(cup->cu_nif_zone, nip); - /* - * Destroy any successful nifs - */ - atm_physif_freenifs(pip, cup->cu_nif_zone); - break; - } - /* - * Set macaddr in address - */ - ifp->if_addrlen = 6; - ifa = ifp->if_addr; - if ( ifa ) { - sdl = (struct sockaddr_dl *) - ifa->ifa_addr; - sdl->sdl_type = IFT_ETHER; - sdl->sdl_alen = ifp->if_addrlen; - bcopy ( (caddr_t)&cup->cu_config.ac_macaddr, - LLADDR(sdl), ifp->if_addrlen ); - } - } - break; - - case AIOCS_INF_CFG: - /* - * Get adapter configuration information - */ - aip = (struct atminfreq *)data; - pip = (struct atm_pif *)arg; - cup = (Cmn_unit *)pip; - acp = &cup->cu_config; - - /* - * Make sure there's room in user buffer - */ - if (aip->air_buf_len < sizeof(acr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - bzero((caddr_t)&acr, sizeof(acr)); - (void) snprintf(acr.acp_intf, sizeof(acr.acp_intf), - "%s%d", pip->pif_name, pip->pif_unit); - bcopy((caddr_t)acp, (caddr_t)&acr.acp_cfg, - sizeof(Atm_config)); - - /* - * Copy data to user buffer - */ - err = copyout((caddr_t)&acr, aip->air_buf_addr, - sizeof(acr)); - if (err) - break; - - /* - * Update buffer pointer/count - */ - aip->air_buf_addr += sizeof(acr); - aip->air_buf_len -= sizeof(acr); - break; - - case AIOCS_INF_VST: - /* - * Pass off to device-specific handler - */ - cup = (Cmn_unit *)arg; - if (cup == NULL) - err = ENXIO; - else - err = (*cup->cu_ioctl)(code, data, arg); - break; - - default: - err = ENOSYS; - } - - return ( err ); -} - - -/* - * Register a Network Convergence Module - * - * Each ATM network convergence module must register itself here before - * it will receive network interface status notifications. - * - * Arguments: - * ncp pointer to network convergence definition structure - * - * Returns: - * 0 registration successful - * errno registration failed - reason indicated - * - */ -int -atm_netconv_register(ncp) - struct atm_ncm *ncp; -{ - struct atm_ncm *tdp; - int s = splnet(); - - /* - * See if we need to be initialized - */ - if (!atm_init) - atm_initialize(); - - /* - * Validate protocol family - */ - if (ncp->ncm_family > AF_MAX) { - (void) splx(s); - return (EINVAL); - } - - /* - * Ensure no duplicates - */ - for (tdp = atm_netconv_head; tdp != NULL; tdp = tdp->ncm_next) { - if (tdp->ncm_family == ncp->ncm_family) { - (void) splx(s); - return (EEXIST); - } - } - - /* - * Add module to list - */ - LINK2TAIL(ncp, struct atm_ncm, atm_netconv_head, ncm_next); - - /* - * Add new interface output function - */ - atm_ifouttbl[ncp->ncm_family] = ncp->ncm_ifoutput; - - (void) splx(s); - return (0); -} - - -/* - * De-register an ATM Network Convergence Module - * - * Each ATM network convergence provider must de-register its registered - * service(s) before terminating. Specifically, loaded kernel modules - * must de-register their services before unloading themselves. - * - * Arguments: - * ncp pointer to network convergence definition structure - * - * Returns: - * 0 de-registration successful - * errno de-registration failed - reason indicated - * - */ -int -atm_netconv_deregister(ncp) - struct atm_ncm *ncp; -{ - int found, s = splnet(); - - /* - * Remove module from list - */ - UNLINKF(ncp, struct atm_ncm, atm_netconv_head, ncm_next, found); - - if (!found) { - (void) splx(s); - return (ENOENT); - } - - /* - * Remove module's interface output function - */ - atm_ifouttbl[ncp->ncm_family] = NULL; - - (void) splx(s); - return (0); -} - - -/* - * Attach an ATM Network Interface - * - * Before an ATM network interface can be used by the system, the owning - * device interface must attach the network interface using this function. - * The physical interface for this network interface must have been previously - * registered (using atm_interface_register). The network interface will be - * added to the kernel's interface list and to the physical interface's list. - * The caller is responsible for initializing the control block fields. - * - * Arguments: - * nip pointer to atm network interface control block - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -int -atm_nif_attach(nip) - struct atm_nif *nip; -{ - struct atm_pif *pip, *pip2; - struct ifnet *ifp; - struct atm_ncm *ncp; - int s; - - ifp = nip->nif_ifp; - if (ifp == NULL) - return (ENOSPC); - pip = nip->nif_pif; - - s = splimp(); - - /* - * Verify physical interface is registered - */ - for (pip2 = atm_interface_head; pip2 != NULL; pip2 = pip2->pif_next) { - if (pip == pip2) - break; - } - if ((pip == NULL) || (pip2 == NULL)) { - (void) splx(s); - return (EFAULT); - } - - /* - * Add to system interface list - */ - if_attach(ifp); - - /* - * Add to BPF interface list - * DLT_ATM_RFC_1483 cannot be used because both NULL and LLC/SNAP could - * be provisioned - */ - bpfattach(ifp, DLT_ATM_CLIP, T_ATM_LLC_MAX_LEN); - - /* - * Add to physical interface list - */ - LINK2TAIL(nip, struct atm_nif, pip->pif_nif, nif_pnext); - - /* - * Notify network convergence modules of new network i/f - */ - for (ncp = atm_netconv_head; ncp; ncp = ncp->ncm_next) { - int err; - - err = (*ncp->ncm_stat)(NCM_ATTACH, nip, 0); - if (err) { - atm_nif_detach(nip); - (void) splx(s); - return (err); - } - } - - (void) splx(s); - return (0); -} - - -/* - * Detach an ATM Network Interface - * - * Before an ATM network interface control block can be freed, all kernel - * references to/from this block must be released. This function will delete - * all routing references to the interface and free all interface addresses - * for the interface. The network interface will then be removed from the - * kernel's interface list and from the owning physical interface's list. - * The caller is responsible for free'ing the control block. - * - * Arguments: - * nip pointer to atm network interface control block - * - * Returns: - * none - * - */ -void -atm_nif_detach(nip) - struct atm_nif *nip; -{ - struct atm_ncm *ncp; - int s; - struct ifnet *ifp = nip->nif_ifp; - - s = splimp(); - - /* - * Notify convergence modules of network i/f demise - */ - for (ncp = atm_netconv_head; ncp; ncp = ncp->ncm_next) { - (void) (*ncp->ncm_stat)(NCM_DETACH, nip, 0); - } - - /* - * Remove from BPF interface list - */ - bpfdetach(ifp); - - /* - * Free all interface routes and addresses, - * delete all remaining routes using this interface, - * then remove from the system interface list - */ - if_detach(ifp); - if_free(ifp); - - /* - * Remove from physical interface list - */ - UNLINK(nip, struct atm_nif, nip->nif_pif->pif_nif, nif_pnext); - - (void) splx(s); -} - -/* - * Set an ATM Network Interface address - * - * This is called from a device interface when processing an SIOCSIFADDR - * ioctl request. We just notify all convergence modules of the new address - * and hope everyone has non-overlapping interests, since if someone reports - * an error we don't go back and tell everyone to undo the change. - * - * Arguments: - * nip pointer to atm network interface control block - * ifa pointer to new interface address - * - * Returns: - * 0 set successful - * errno set failed - reason indicated - * - */ -int -atm_nif_setaddr(nip, ifa) - struct atm_nif *nip; - struct ifaddr *ifa; -{ - struct atm_ncm *ncp; - int err = 0, s = splnet(); - - /* - * Notify convergence modules of network i/f change - */ - for (ncp = atm_netconv_head; ncp; ncp = ncp->ncm_next) { - err = (*ncp->ncm_stat)(NCM_SETADDR, nip, (intptr_t)ifa); - if (err) - break; - } - (void) splx(s); - - return (err); -} - - -/* - * ATM Interface Packet Output - * - * All ATM network interfaces must have their ifnet if_output address set to - * this function. Since no existing network layer code is to be modified - * for ATM support, this function serves as the hook to allow network output - * packets to be assigned to their proper outbound VCC. Each network address - * family which is to be supported over ATM must be assigned an output - * packet processing function via atm_netconv_register(). - * - * Arguments: - * ifp pointer to ifnet structure - * m pointer to packet buffer chain to be output - * dst pointer to packet's network destination address - * - * Returns: - * 0 packet queued to interface - * errno output failed - reason indicated - * - */ -int -atm_ifoutput(ifp, m, dst, rt) - struct ifnet *ifp; - KBuffer *m; - struct sockaddr *dst; - struct rtentry *rt; -{ - u_short fam = dst->sa_family; - int (*func)(struct ifnet *, KBuffer *, - struct sockaddr *); - - /* - * Validate address family - */ - if (fam > AF_MAX) { - KB_FREEALL(m); - return (EAFNOSUPPORT); - } - - /* - * Hand packet off for dst-to-VCC mapping - */ - func = atm_ifouttbl[fam]; - if (func == NULL) { - KB_FREEALL(m); - return (EAFNOSUPPORT); - } - return ((*func)(ifp, m, dst)); -} - - -/* - * Handle interface ioctl requests. - * - * Arguments: - * ifp pointer to network interface structure - * cmd IOCTL cmd - * data arguments to/from ioctl - * - * Returns: - * error errno value - */ -static int -atm_if_ioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; -{ - register struct ifreq *ifr = (struct ifreq *)data; - struct atm_nif *nip = IFP2ANIF(ifp); - int error = 0; - int s = splnet(); - - switch ( cmd ) - { - case SIOCGIFADDR: - bcopy ( (caddr_t)&(nip->nif_pif->pif_macaddr), - (caddr_t)ifr->ifr_addr.sa_data, - sizeof(struct mac_addr) ); - break; - - case SIOCSIFADDR: - error = atm_nif_setaddr ( nip, (struct ifaddr *)data); - ifp->if_flags |= IFF_UP | IFF_BROADCAST; - ifp->if_drv_flags |= IFF_DRV_RUNNING; - break; - - case SIOCGIFFLAGS: - *(int *)data = ifp->if_flags; - break; - - case SIOCSIFFLAGS: - break; - - default: - error = EINVAL; - break; - } - - (void) splx(s); - return ( error ); -} - - -/* - * Parse interface name - * - * Parses an interface name string into a name and a unit component. - * - * Arguments: - * name pointer to interface name string - * namep address to store interface name - * size size available at namep - * unitp address to store interface unit number - * - * Returns: - * 0 name parsed - * else parse error - * - */ -static int -atm_ifparse(const char *name, char *namep, size_t size, int *unitp) -{ - const char *cp; - char *np; - size_t len = 0; - int unit = 0; - - /* - * Separate supplied string into name and unit parts. - */ - cp = name; - np = namep; - while (*cp) { - if (*cp >= '0' && *cp <= '9') - break; - if (++len >= size) - return (-1); - *np++ = *cp++; - } - *np = '\0'; - while (*cp && *cp >= '0' && *cp <= '9') - unit = 10 * unit + *cp++ - '0'; - - *unitp = unit; - - return (0); -} - - -/* - * Locate ATM physical interface via name - * - * Uses the supplied interface name string to locate a registered - * ATM physical interface. - * - * Arguments: - * name pointer to interface name string - * - * Returns: - * 0 interface not found - * else pointer to atm physical interface structure - * - */ -struct atm_pif * -atm_pifname(name) - char *name; -{ - struct atm_pif *pip; - char n[IFNAMSIZ]; - int unit; - - /* - * Break down name - */ - if (atm_ifparse(name, n, sizeof(n), &unit)) - return ((struct atm_pif *)0); - - /* - * Look for the physical interface - */ - for (pip = atm_interface_head; pip; pip = pip->pif_next) { - if ((pip->pif_unit == unit) && (strcmp(pip->pif_name, n) == 0)) - break; - } - - return (pip); -} - - -/* - * Locate ATM network interface via name - * - * Uses the supplied interface name string to locate an ATM network interface. - * - * Arguments: - * name pointer to interface name string - * - * Returns: - * 0 interface not found - * else pointer to atm network interface structure - * - */ -struct atm_nif * -atm_nifname(name) - char *name; -{ - struct atm_pif *pip; - struct atm_nif *nip; - char n[IFNAMSIZ]; - int unit; - - /* - * Break down name - */ - if (atm_ifparse(name, n, sizeof(n), &unit)) - return ((struct atm_nif *)0); - - /* - * Search thru each physical interface - */ - for (pip = atm_interface_head; pip; pip = pip->pif_next) { - /* - * Looking for network interface - */ - for (nip = pip->pif_nif; nip; nip = nip->nif_pnext) { - struct ifnet *ifp = (struct ifnet *)nip; - if ((ifp->if_dunit == unit) && - (strcmp(ifp->if_dname, n) == 0)) - return (nip); - } - } - return (NULL); -} Property changes on: head/sys/netatm/atm_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_stack.h =================================================================== --- head/sys/netatm/atm_stack.h (revision 179307) +++ head/sys/netatm/atm_stack.h (nonexistent) @@ -1,287 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Stack definitions - * - */ - -#ifndef _NETATM_ATM_STACK_H -#define _NETATM_ATM_STACK_H - -#ifdef _KERNEL -/* - * Structure used to define a kernel-provided ATM stack service and its - * associated entry points. Each stack service provider must register - * themselves before they will be used. ATM stack service providers include - * kernel modules (both linked and loaded) and device drivers, which must list - * (via its atm_pif) any of its available hardware-supplied stack services - * (such as on-card AAL processing). - */ -struct stack_defn { - struct stack_defn *sd_next; /* Next in registry list */ - Sap_t sd_sap; /* Stack instance SAP */ - u_char sd_flag; /* Flags (see below) */ -/* Exported functions */ - int (*sd_inst) /* Stack instantiation */ - (struct stack_defn **, Atm_connvc *); - void (*sd_lower) /* Lower (from above) command handler */ - (int, void *, intptr_t, intptr_t); - void (*sd_upper) /* Upper (from below) command handler */ - (int, void *, intptr_t, intptr_t); -/* Variables used during stack instantiation */ - void *sd_toku; /* Stack service instance token */ -}; - -/* - * Stack Service Flags - */ -#define SDF_TERM 0x01 /* Terminal (to lowest layer) service */ - - -/* - * Stack Specification List - * - * The list names the stack services and their layering relationships in - * order to construct a stack to provide the protocol services defined - * by the list. The list is ordered starting from the stack service - * interfacing with the user "down" to the ATM cell service. - */ -#define STACK_CNT 8 /* Max services in a stack list */ -struct stack_list { - Sap_t sl_sap[STACK_CNT]; /* Stack service SAP list */ -}; - - -/* - * Structure used during the construction and instantiation of a stack - * instance from a supplied stack list. It contains pointers to the stack - * service definitions which will be used to implement the stack. The first - * element in the array is reserved for the user's "stack service". - */ -struct stack_inst { - struct stack_defn *si_srvc[STACK_CNT+1]; /* Assigned services */ -}; - - -/* - * Macros to update buffer headroom values during stack instantiation. - * - * These values are advisory, i.e. every service must verify the amount - * of available space in input/output messages and allocate new buffers - * if needed. - * - * The 'maximum' and 'minimum' values used below may be chosen by a - * service to reflect the typical, expected message traffic pattern - * for a specific connection. - * - * The macro arguments are: - * cvp = pointer to connection vcc; - * hi = maximum amount of buffer headroom required by the current - * service during input message processing; - * si = minimum amount of buffer data stripped off the front - * of an input message by the current service; - * ho = maximum amount of buffer headroom required by the current - * service during output message processing; - * ao = maximum amount of buffer data added to the front - * of an output message by the current service; - */ -#define HEADIN(cvp, hi, si) \ -{ \ - short t = (cvp)->cvc_attr.headin - (si); \ - t = (t >= (hi)) ? t : (hi); \ - (cvp)->cvc_attr.headin = roundup(t, sizeof(long)); \ -} - -#define HEADOUT(cvp, ho, ao) \ -{ \ - short t = (cvp)->cvc_attr.headout + (ao); \ - t = (t >= (ho)) ? t : (ho); \ - (cvp)->cvc_attr.headout = roundup(t, sizeof(long)); \ -} - - -/* - * Stack command codes - All stack command codes are specific to the - * defined stack SAP across which the command is used. Command values 0-15 - * are reserved for any common codes, which all stack SAPs must support. - */ -#define STKCMD(s, d, v) (((s) << 16) | (d) | (v)) -#define STKCMD_DOWN 0 -#define STKCMD_UP 0x00008000 -#define STKCMD_SAP_MASK 0xffff0000 -#define STKCMD_VAL_MASK 0x00007fff - -/* Common command values (0-15) */ -#define CCV_INIT 1 /* DOWN */ -#define CCV_TERM 2 /* DOWN */ - -/* SAP_ATM */ -#define ATM_INIT STKCMD(SAP_ATM, STKCMD_DOWN, CCV_INIT) -#define ATM_TERM STKCMD(SAP_ATM, STKCMD_DOWN, CCV_TERM) -#define ATM_DATA_REQ STKCMD(SAP_ATM, STKCMD_DOWN, 16) -#define ATM_DATA_IND STKCMD(SAP_ATM, STKCMD_UP, 17) - -/* SAP_SAR */ -#define SAR_INIT STKCMD(SAP_SAR, STKCMD_DOWN, CCV_INIT) -#define SAR_TERM STKCMD(SAP_SAR, STKCMD_DOWN, CCV_TERM) -#define SAR_UNITDATA_INV STKCMD(SAP_SAR, STKCMD_DOWN, 16) -#define SAR_UNITDATA_SIG STKCMD(SAP_SAR, STKCMD_UP, 17) -#define SAR_UABORT_INV STKCMD(SAP_SAR, STKCMD_DOWN, 18) -#define SAR_UABORT_SIG STKCMD(SAP_SAR, STKCMD_UP, 19) -#define SAR_PABORT_SIG STKCMD(SAP_SAR, STKCMD_UP, 20) - -/* SAP_CPCS */ -#define CPCS_INIT STKCMD(SAP_CPCS, STKCMD_DOWN, CCV_INIT) -#define CPCS_TERM STKCMD(SAP_CPCS, STKCMD_DOWN, CCV_TERM) -#define CPCS_UNITDATA_INV STKCMD(SAP_CPCS, STKCMD_DOWN, 16) -#define CPCS_UNITDATA_SIG STKCMD(SAP_CPCS, STKCMD_UP, 17) -#define CPCS_UABORT_INV STKCMD(SAP_CPCS, STKCMD_DOWN, 18) -#define CPCS_UABORT_SIG STKCMD(SAP_CPCS, STKCMD_UP, 19) -#define CPCS_PABORT_SIG STKCMD(SAP_CPCS, STKCMD_UP, 20) - -/* SAP_SSCOP */ -#define SSCOP_INIT STKCMD(SAP_SSCOP, STKCMD_DOWN, CCV_INIT) -#define SSCOP_TERM STKCMD(SAP_SSCOP, STKCMD_DOWN, CCV_TERM) -#define SSCOP_ESTABLISH_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 16) -#define SSCOP_ESTABLISH_IND STKCMD(SAP_SSCOP, STKCMD_UP, 17) -#define SSCOP_ESTABLISH_RSP STKCMD(SAP_SSCOP, STKCMD_DOWN, 18) -#define SSCOP_ESTABLISH_CNF STKCMD(SAP_SSCOP, STKCMD_UP, 19) -#define SSCOP_RELEASE_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 20) -#define SSCOP_RELEASE_IND STKCMD(SAP_SSCOP, STKCMD_UP, 21) -#define SSCOP_RELEASE_CNF STKCMD(SAP_SSCOP, STKCMD_UP, 22) -#define SSCOP_DATA_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 23) -#define SSCOP_DATA_IND STKCMD(SAP_SSCOP, STKCMD_UP, 24) -#define SSCOP_RESYNC_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 25) -#define SSCOP_RESYNC_IND STKCMD(SAP_SSCOP, STKCMD_UP, 26) -#define SSCOP_RESYNC_RSP STKCMD(SAP_SSCOP, STKCMD_DOWN, 27) -#define SSCOP_RESYNC_CNF STKCMD(SAP_SSCOP, STKCMD_UP, 28) -#define SSCOP_RECOVER_IND STKCMD(SAP_SSCOP, STKCMD_UP, 29) -#define SSCOP_RECOVER_RSP STKCMD(SAP_SSCOP, STKCMD_DOWN, 30) -#define SSCOP_UNITDATA_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 31) -#define SSCOP_UNITDATA_IND STKCMD(SAP_SSCOP, STKCMD_UP, 32) -#define SSCOP_RETRIEVE_REQ STKCMD(SAP_SSCOP, STKCMD_DOWN, 33) -#define SSCOP_RETRIEVE_IND STKCMD(SAP_SSCOP, STKCMD_UP, 34) -#define SSCOP_RETRIEVECMP_IND STKCMD(SAP_SSCOP, STKCMD_UP, 35) - -/* SAP_SSCF_UNI */ -#define SSCF_UNI_INIT STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, CCV_INIT) -#define SSCF_UNI_TERM STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, CCV_TERM) -#define SSCF_UNI_ESTABLISH_REQ STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, 16) -#define SSCF_UNI_ESTABLISH_IND STKCMD(SAP_SSCF_UNI, STKCMD_UP, 17) -#define SSCF_UNI_ESTABLISH_CNF STKCMD(SAP_SSCF_UNI, STKCMD_UP, 18) -#define SSCF_UNI_RELEASE_REQ STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, 19) -#define SSCF_UNI_RELEASE_IND STKCMD(SAP_SSCF_UNI, STKCMD_UP, 20) -#define SSCF_UNI_RELEASE_CNF STKCMD(SAP_SSCF_UNI, STKCMD_UP, 21) -#define SSCF_UNI_DATA_REQ STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, 22) -#define SSCF_UNI_DATA_IND STKCMD(SAP_SSCF_UNI, STKCMD_UP, 23) -#define SSCF_UNI_UNITDATA_REQ STKCMD(SAP_SSCF_UNI, STKCMD_DOWN, 24) -#define SSCF_UNI_UNITDATA_IND STKCMD(SAP_SSCF_UNI, STKCMD_UP, 25) - - -/* - * The STACK_CALL macro must be used for all stack calls between adjacent - * entities. In order to avoid the problem with recursive stack calls - * modifying protocol state, this macro will only allow calls to proceed if - * they are not "against the flow" of any currently pending calls for a - * stack instance. If the requested call can't be processed now, it will - * be deferred and queued until a later, safe time (but before control is - * returned back to the kernel scheduler) when it will be dispatched. - * - * The STACK_CALL macro arguments are: - * cmd = command code; - * fn = Destination entity processing function - * tok = Destination layer's session token; - * cvp = Connection VCC address; - * a1 = command specific argument; - * a2 = command specific argument; - * ret = call result value (0 => success) - * - * The receiving entity command processing function prototype is: - * - * void (fn)(int cmd, int tok, int arg1, int arg2) - * - */ -#define STACK_CALL(cmd, fn, tok, cvp, a1, a2, ret) \ -{ \ - if ((cmd) & STKCMD_UP) { \ - if ((cvp)->cvc_downcnt) { \ - (ret) = atm_stack_enq((cmd), (fn), (tok), \ - (cvp), (a1), (a2)); \ - } else { \ - (cvp)->cvc_upcnt++; \ - (*fn)(cmd, tok, a1, a2); \ - (cvp)->cvc_upcnt--; \ - (ret) = 0; \ - } \ - } else { \ - if ((cvp)->cvc_upcnt) { \ - (ret) = atm_stack_enq((cmd), (fn), (tok), \ - (cvp), (a1), (a2)); \ - } else { \ - (cvp)->cvc_downcnt++; \ - (*fn)(cmd, tok, a1, a2); \ - (cvp)->cvc_downcnt--; \ - (ret) = 0; \ - } \ - } \ -} - - -/* - * Stack queue entry - The stack queue will contain stack calls which have - * been deferred in order to avoid recursive calls to a single protocol - * control block. The queue entries are allocated from its own storage pool. - */ -struct stackq_entry { - struct stackq_entry *sq_next; /* Next entry in queue */ - int sq_cmd; /* Stack command */ - void (*sq_func) /* Destination function */ - (int, void *, intptr_t, intptr_t); - void *sq_token; /* Destination token */ - intptr_t sq_arg1; /* Command-specific argument */ - intptr_t sq_arg2; /* Command-specific argument */ - Atm_connvc *sq_connvc; /* Connection VCC */ -}; - - -/* - * Macro to avoid unnecessary function call when draining the stack queue. - */ -#define STACK_DRAIN() \ -{ \ - if (atm_stackq_head) \ - atm_stack_drain(); \ -} -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_STACK_H */ Property changes on: head/sys/netatm/atm_stack.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_sigmgr.h =================================================================== --- head/sys/netatm/atm_sigmgr.h (revision 179307) +++ head/sys/netatm/atm_sigmgr.h (nonexistent) @@ -1,109 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM Signalling Manager definitions - * - */ - -#ifndef _NETATM_ATM_SIGMGR_H -#define _NETATM_ATM_SIGMGR_H - -#ifdef _KERNEL -/* - * Structure common to all ATM Signalling Managers. Each Signalling - * Manager must create one of these and use it to register itself - * with the system. - */ -struct sigmgr { - struct sigmgr *sm_next; /* Next registered sigmgr */ - u_char sm_proto; /* Signalling protocol (see below) */ - struct siginst *sm_prinst; /* List of protocol instances */ -/* Exported functions */ - int (*sm_attach) /* Attach interface */ - (struct sigmgr *, struct atm_pif *); - int (*sm_detach) /* Detach interface */ - (struct atm_pif *); - int (*sm_setup) /* Connection setup */ - (Atm_connvc *, int *); - int (*sm_accept) /* Call accepted */ - (struct vccb *, int *); - int (*sm_reject) /* Call rejected */ - (struct vccb *, int *); - int (*sm_release) /* Connection release */ - (struct vccb *, int *); - int (*sm_free) /* Free connection resources */ - (struct vccb *); - int (*sm_ioctl) /* Ioctl handler */ - (int, caddr_t, caddr_t); -}; -#endif /* _KERNEL */ - -/* - * ATM Signalling Protocols - */ -#define ATM_SIG_PVC 1 /* PVC-only */ -#define ATM_SIG_SPANS 2 /* Fore Systems SPANS */ -#define ATM_SIG_UNI30 3 /* ATM Forum UNI 3.0 */ -#define ATM_SIG_UNI31 4 /* ATM Forum UNI 3.1 */ -#define ATM_SIG_UNI40 5 /* ATM Forum UNI 4.0 */ - - -#ifdef _KERNEL -/* - * Signalling Protocol Instance control block header. Common header for - * every signalling protocol instance control block. - */ -struct siginst { - struct siginst *si_next; /* Next sigmgr protocol instance */ - struct atm_pif *si_pif; /* Device interface */ - Atm_addr si_addr; /* Interface ATM address */ - Atm_addr si_subaddr; /* Interface ATM subaddress */ - Queue_t si_vccq; /* VCCB queue */ - u_short si_state; /* Protocol state (sigmgr specific) */ - -/* Exported protocol services */ - struct ip_serv *si_ipserv; /* IP/ATM services */ -}; - - -/* - * Sigmgr function return codes - */ -#define CALL_PROCEEDING 1 /* Connection request is in progress */ -#define CALL_FAILED 2 /* Connection request failed */ -#define CALL_CONNECTED 3 /* Connection setup successful */ -#define CALL_CLEARED 4 /* Connection has been terminated */ - -#endif /* _KERNEL */ - -#endif /* _NETATM_ATM_SIGMGR_H */ Property changes on: head/sys/netatm/atm_sigmgr.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_proto.c =================================================================== --- head/sys/netatm/atm_proto.c (revision 179307) +++ head/sys/netatm/atm_proto.c (nonexistent) @@ -1,200 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM socket protocol family support definitions - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#error "NET_NEEDS_GIANT" - -struct protosw atmsw[] = { -{ - .pr_type = SOCK_DGRAM, /* ioctl()-only */ - .pr_domain = &atmdomain, - .pr_usrreqs = &atm_dgram_usrreqs -}, - -{ - .pr_type = SOCK_SEQPACKET, /* AAL-5 */ - .pr_domain = &atmdomain, - .pr_protocol = ATM_PROTO_AAL5, - .pr_flags = PR_ATOMIC|PR_CONNREQUIRED, - .pr_ctloutput = atm_aal5_ctloutput, - .pr_usrreqs = &atm_aal5_usrreqs -}, - -#ifdef XXX -{ - .pr_type = SOCK_SEQPACKET, /* SSCOP */ - .pr_domain = &atmdomain, - .pr_protocol = ATM_PROTO_SSCOP, - .pr_flags = PR_ATOMIC|PR_CONNREQUIRED|PR_WANTRCVD, - .pr_input = x, - .pr_output = x, - .pr_ctlinput = x, - .pr_ctloutput = x, - .pr_drain = x, - .pr_usrreqs = x -}, -#endif -}; - -struct domain atmdomain = { - .dom_family = AF_ATM, - .dom_name = "atm", - .dom_init = atm_initialize, - .dom_protosw = atmsw, - .dom_protoswNPROTOSW = &atmsw[sizeof(atmsw) / sizeof(atmsw[0])] -}; - -DOMAIN_SET(atm); - -SYSCTL_NODE(_net, PF_ATM, harp, CTLFLAG_RW, 0, "HARP/ATM family"); -SYSCTL_NODE(_net_harp, OID_AUTO, atm, CTLFLAG_RW, 0, "ATM layer"); - -/* - * Protocol request not supported - * - * Arguments: - * so pointer to socket - * - * Returns: - * errno error - operation not supported - * - */ -int -atm_proto_notsupp1(so) - struct socket *so; -{ - return (EOPNOTSUPP); -} - - -/* - * Protocol request not supported - * - * Arguments: - * so pointer to socket - * addr pointer to protocol address - * p pointer to process - * - * Returns: - * errno error - operation not supported - * - */ -int -atm_proto_notsupp2(so, addr, td) - struct socket *so; - struct sockaddr *addr; - struct thread *td; -{ - return (EOPNOTSUPP); -} - - -/* - * Protocol request not supported - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to protocol address - * - * Returns: - * errno error - operation not supported - * - */ -int -atm_proto_notsupp3(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - return (EOPNOTSUPP); -} - - -/* - * Protocol request not supported - * - * Arguments: - * so pointer to socket - * i integer - * m pointer to kernel buffer - * addr pointer to protocol address - * m2 pointer to kernel buffer - * p pointer to process - * - * Returns: - * errno error - operation not supported - * - */ -int -atm_proto_notsupp4(so, i, m, addr, m2, td) - struct socket *so; - int i; - KBuffer *m; - struct sockaddr *addr; - KBuffer *m2; - struct thread *td; -{ - return (EOPNOTSUPP); -} - -/* - * Protocol request not supported - * - * Arguments: - * so pointer to socket - * - */ -void -atm_proto_notsupp5(so) - struct socket *so; -{ - -} Property changes on: head/sys/netatm/atm_proto.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/queue.h =================================================================== --- head/sys/netatm/queue.h (revision 179307) +++ head/sys/netatm/queue.h (nonexistent) @@ -1,213 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * General queueing/linking definitions - * - */ - -#ifndef _NETATM_QUEUE_H -#define _NETATM_QUEUE_H - -/* - * Structure defining the queue controls for a doubly linked queue - */ -struct q_queue { - caddr_t q_head; /* Head of queue */ - caddr_t q_tail; /* Tail of queue */ -}; -typedef struct q_queue Queue_t; - -/* - * Structure defining the queue elements of a doubly linked queue - */ -struct q_elem { - caddr_t q_forw; /* Forward link */ - caddr_t q_back; /* Backward link */ -}; -typedef struct q_elem Qelem_t; - -/* - * Macro to add a control block onto the tail of a doubly linked queue - * e = control block to add - * t = control block structure type - * el = name of control block's q_elem field - * q = pointer to queue controls - */ -#define ENQUEUE(e,t,el,q) \ -{ \ - (e)->el.q_forw = NULL; \ - (e)->el.q_back = (q).q_tail; \ - if ((q).q_head == NULL) { \ - (q).q_head = (caddr_t)(e); \ - (q).q_tail = (caddr_t)(e); \ - } else { \ - ((t *)(q).q_tail)->el.q_forw = (caddr_t)(e); \ - (q).q_tail = (caddr_t)(e); \ - } \ -} - -/* - * Macro to remove a control block from a doubly linked queue - * e = control block to remove - * t = control block structure type - * el = name of control block's q_elem field - * q = pointer to queue controls - */ -#define DEQUEUE(e,t,el,q) \ -{ \ - /* Ensure control block is on queue */ \ - if ((e)->el.q_forw || (q).q_tail == (caddr_t)(e)) { \ - if ((e)->el.q_forw) \ - ((t *)(e)->el.q_forw)->el.q_back = (e)->el.q_back;\ - else \ - (q).q_tail = (e)->el.q_back; \ - if ((e)->el.q_back) \ - ((t *)(e)->el.q_back)->el.q_forw = (e)->el.q_forw;\ - else \ - (q).q_head = (e)->el.q_forw; \ - } \ - (e)->el.q_back = (e)->el.q_forw = NULL; \ -} - -/* - * Macro to return the head of a doubly linked queue - * q = pointer to queue controls - * t = control block structure type - */ -#define Q_HEAD(q,t) ((t *)(q).q_head) - -/* - * Macro to return the next control block of a doubly linked queue - * e = current control block - * t = control block structure type - * el = name of control block's q_elem field - */ -#define Q_NEXT(e,t,el) ((t *)(e)->el.q_forw) - - -/* - * Macro to add a control block onto the head of a singly linked chain - * u = control block to add - * t = structure type - * h = head of chain - * l = name of link field - */ -#define LINK2HEAD(u,t,h,l) \ -{ \ - (u)->l = (h); \ - (h) = (u); \ -} - -/* - * Macro to add a control block onto the tail of a singly linked chain - * u = control block to add - * t = structure type - * h = head of chain - * l = name of link field - */ -#define LINK2TAIL(u,t,h,l) \ -{ \ - (u)->l = (t *)NULL; \ - /* Check for empty chain */ \ - if ((h) == (t *)NULL) { \ - (h) = (u); \ - } else { \ - t *tp; \ - /* Loop until we find the end of chain */ \ - for (tp = (h); tp->l != (t *)NULL; tp = tp->l) \ - ; \ - tp->l = (u); \ - } \ -} - -/* - * Macro to remove a control block from a singly linked chain - * u = control block to unlink - * t = structure type - * h = head of chain - * l = name of link field - */ -#define UNLINK(u,t,h,l) \ -{ \ - /* Check for control block at head of chain */ \ - if ((u) == (h)) { \ - (h) = (u)->l; \ - } else { \ - t *tp; \ - /* Loop until we find the control block */ \ - for (tp = (h); tp != (t *)NULL; tp = tp->l) { \ - if (tp->l == (u)) \ - break; \ - } \ - if (tp) { \ - /* Remove it from chain */ \ - tp->l = (u)->l; \ - } \ - } \ - (u)->l = (t *)NULL; \ -} - -/* - * Macro to remove a control block from a singly linked chain and return - * an indication of whether the block was found - * u = control block to unlink - * t = structure type - * h = head of chain - * l = name of link field - * f = flag; 1 => control block found on chain; else 0 - */ -#define UNLINKF(u,t,h,l,f) \ -{ \ - /* Check for control block at head of chain */ \ - if ((u) == (h)) { \ - (h) = (u)->l; \ - (f) = 1; \ - } else { \ - t *tp; \ - /* Loop until we find the control block */ \ - for (tp = (h); tp != (t *)NULL; tp = tp->l) { \ - if (tp->l == (u)) \ - break; \ - } \ - if (tp) { \ - /* Remove it from chain */ \ - tp->l = (u)->l; \ - (f) = 1; \ - } else \ - /* It wasn't on the chain */ \ - (f) = 0; \ - } \ - (u)->l = (t *)NULL; \ -} - -#endif /* _NETATM_QUEUE_H */ Property changes on: head/sys/netatm/queue.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm_aal5.c =================================================================== --- head/sys/netatm/atm_aal5.c (revision 179307) +++ head/sys/netatm/atm_aal5.c (nonexistent) @@ -1,941 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM AAL5 socket protocol processing - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/* - * Global variables - */ -u_long atm_aal5_sendspace = 64 * 1024; /* XXX */ -u_long atm_aal5_recvspace = 64 * 1024; /* XXX */ - - -/* - * Local functions - */ -static int atm_aal5_attach(struct socket *, int, struct thread *td); -static void atm_aal5_detach(struct socket *); -static int atm_aal5_bind(struct socket *, struct sockaddr *, - struct thread *td); -static int atm_aal5_listen(struct socket *, int backlog, - struct thread *td); -static int atm_aal5_connect(struct socket *, struct sockaddr *, - struct thread *td); -static int atm_aal5_accept(struct socket *, struct sockaddr **); -static int atm_aal5_disconnect(struct socket *); -static int atm_aal5_shutdown(struct socket *); -static int atm_aal5_send(struct socket *, int, KBuffer *, - struct sockaddr *, KBuffer *, struct thread *td); -static void atm_aal5_abort(struct socket *); -static int atm_aal5_control(struct socket *, u_long, caddr_t, - struct ifnet *, struct thread *td); -static int atm_aal5_sense(struct socket *, struct stat *); -static int atm_aal5_sockaddr(struct socket *, struct sockaddr **); -static int atm_aal5_peeraddr(struct socket *, struct sockaddr **); -static int atm_aal5_incoming(void *, Atm_connection *, - Atm_attributes *, void **); -static void atm_aal5_cpcs_data(void *, KBuffer *); -static caddr_t atm_aal5_getname(void *); -static void atm_aal5_close(struct socket *); - - -/* - * New-style socket request routines - */ -struct pr_usrreqs atm_aal5_usrreqs = { - .pru_abort = atm_aal5_abort, - .pru_accept = atm_aal5_accept, - .pru_attach = atm_aal5_attach, - .pru_bind = atm_aal5_bind, - .pru_connect = atm_aal5_connect, - .pru_control = atm_aal5_control, - .pru_detach = atm_aal5_detach, - .pru_disconnect = atm_aal5_disconnect, - .pru_listen = atm_aal5_listen, - .pru_peeraddr = atm_aal5_peeraddr, - .pru_send = atm_aal5_send, - .pru_sense = atm_aal5_sense, - .pru_shutdown = atm_aal5_shutdown, - .pru_sockaddr = atm_aal5_sockaddr, - .pru_close = atm_aal5_close, -}; - -/* - * Local variables - */ -static Atm_endpoint atm_aal5_endpt = { - NULL, - ENDPT_SOCK_AAL5, - NULL, - atm_aal5_getname, - atm_sock_connected, - atm_sock_cleared, - atm_aal5_incoming, - NULL, - NULL, - NULL, - atm_aal5_cpcs_data, - NULL, - NULL, - NULL, - NULL -}; - -static Atm_attributes atm_aal5_defattr = { - NULL, /* nif */ - CMAPI_CPCS, /* api */ - 0, /* api_init */ - 0, /* headin */ - 0, /* headout */ - { /* aal */ - T_ATM_PRESENT, - ATM_AAL5 - }, - { /* traffic */ - T_ATM_ABSENT, - }, - { /* bearer */ - T_ATM_ABSENT, - }, - { /* bhli */ - T_ATM_ABSENT - }, - { /* blli */ - T_ATM_ABSENT, - T_ATM_ABSENT, - }, - { /* llc */ - T_ATM_ABSENT, - }, - { /* called */ - T_ATM_ABSENT, - { - T_ATM_ABSENT, - 0 - }, - { - T_ATM_ABSENT, - 0 - } - }, - { /* calling */ - T_ATM_ABSENT - }, - { /* qos */ - T_ATM_ABSENT, - }, - { /* transit */ - T_ATM_ABSENT - }, - { /* cause */ - T_ATM_ABSENT - } -}; - - -/* - * Handy common code macros - */ -#ifdef DIAGNOSTIC -#define ATM_INTRO(f) \ - int s, err = 0; \ - s = splnet(); \ - ATM_DEBUG2("aal5 socket %s (%p)\n", f, so); \ - /* \ - * Stack queue should have been drained \ - */ \ - if (atm_stackq_head != NULL) \ - panic("atm_aal5: stack queue not empty"); \ - ; -#else /* !DIAGNOSTIC */ -#define ATM_INTRO(f) \ - int s, err = 0; \ - s = splnet(); \ - ; -#endif /* DIAGNOSTIC */ - -#define ATM_INTRO_NOERR(f) \ - int s; \ - s = splnet(); \ - ; - -#define ATM_OUTRO() \ - /* \ - * Drain any deferred calls \ - */ \ - STACK_DRAIN(); \ - (void) splx(s); \ - return (err); \ - ; - -#define ATM_OUTRO_NOERR() \ - /* \ - * Drain any deferred calls \ - */ \ - STACK_DRAIN(); \ - (void) splx(s); \ - ; - -#define ATM_RETERR(errno) { \ - err = errno; \ - goto out; \ -} - - -/* - * Attach protocol to socket - * - * Arguments: - * so pointer to socket - * proto protocol identifier - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_attach(so, proto, td) - struct socket *so; - int proto; - struct thread *td; -{ - Atm_pcb *atp; - - ATM_INTRO("attach"); - - /* - * Do general attach stuff - */ - err = atm_sock_attach(so, atm_aal5_sendspace, atm_aal5_recvspace); - if (err) - ATM_RETERR(err); - - /* - * Finish up any protocol specific stuff - */ - atp = sotoatmpcb(so); - atp->atp_type = ATPT_AAL5; - - /* - * Set default connection attributes - */ - atp->atp_attr = atm_aal5_defattr; - strncpy(atp->atp_name, "(AAL5)", T_ATM_APP_NAME_LEN); - -out: - ATM_OUTRO(); -} - - -/* - * Detach protocol from socket - * - * Arguments: - * so pointer to socket - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static void -atm_aal5_detach(so) - struct socket *so; -{ - ATM_INTRO_NOERR("detach"); - - atm_sock_detach(so); - - ATM_OUTRO_NOERR(); -} - - -/* - * Bind address to socket - * - * Arguments: - * so pointer to socket - * addr pointer to protocol address - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_bind(so, addr, td) - struct socket *so; - struct sockaddr *addr; - struct thread *td; -{ - ATM_INTRO("bind"); - - err = atm_sock_bind(so, addr); - - ATM_OUTRO(); -} - - -/* - * Listen for incoming connections - * - * Arguments: - * so pointer to socket - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_listen(so, backlog, td) - struct socket *so; - int backlog; - struct thread *td; -{ - ATM_INTRO("listen"); - - err = atm_sock_listen(so, &atm_aal5_endpt, backlog); - - ATM_OUTRO(); -} - - -/* - * Connect socket to peer - * - * Arguments: - * so pointer to socket - * addr pointer to protocol address - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_connect(so, addr, td) - struct socket *so; - struct sockaddr *addr; - struct thread *td; -{ - Atm_pcb *atp; - - ATM_INTRO("connect"); - - atp = sotoatmpcb(so); - - /* - * Resize send socket buffer to maximum sdu size - */ - if (atp->atp_attr.aal.tag == T_ATM_PRESENT) { - long size; - - size = atp->atp_attr.aal.v.aal5.forward_max_SDU_size; - if (size != T_ATM_ABSENT) - if (!sbreserve(&so->so_snd, size, so, td)) { - err = ENOBUFS; - ATM_OUTRO(); - } - - } - - /* - * Now get the socket connected - */ - err = atm_sock_connect(so, addr, &atm_aal5_endpt); - - ATM_OUTRO(); -} - - -/* - * Accept pending connection - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to contain protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_accept(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - ATM_INTRO("accept"); - - /* - * Everything is pretty much done already, we just need to - * return the caller's address to the user. - */ - err = atm_sock_peeraddr(so, addr); - - ATM_OUTRO(); -} - - -/* - * Disconnect connected socket - * - * Arguments: - * so pointer to socket - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_disconnect(so) - struct socket *so; -{ - ATM_INTRO("disconnect"); - - err = atm_sock_disconnect(so); - - ATM_OUTRO(); -} - - -/* - * Shut down socket data transmission - * - * Arguments: - * so pointer to socket - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_shutdown(so) - struct socket *so; -{ - ATM_INTRO("shutdown"); - - socantsendmore(so); - - ATM_OUTRO(); -} - - -/* - * Send user data - * - * Arguments: - * so pointer to socket - * flags send data flags - * m pointer to buffer containing user data - * addr pointer to protocol address - * control pointer to buffer containing protocol control data - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_send(so, flags, m, addr, control, td) - struct socket *so; - int flags; - KBuffer *m; - struct sockaddr *addr; - KBuffer *control; - struct thread *td; -{ - Atm_pcb *atp; - - ATM_INTRO("send"); - - /* - * We don't support any control functions - */ - if (control) { - int clen; - - clen = KB_LEN(control); - KB_FREEALL(control); - if (clen) { - KB_FREEALL(m); - ATM_RETERR(EINVAL); - } - } - - /* - * We also don't support any flags or send-level addressing - */ - if (flags || addr) { - KB_FREEALL(m); - ATM_RETERR(EINVAL); - } - - /* - * All we've got left is the data, so push it out - */ - atp = sotoatmpcb(so); - err = atm_cm_cpcs_data(atp->atp_conn, m); - if (err) { - /* - * Output problem, drop packet - */ - atm_sock_stat.as_outdrop[atp->atp_type]++; - KB_FREEALL(m); - } - -out: - ATM_OUTRO(); -} - - -/* - * Abnormally terminate service - * - * Arguments: - * so pointer to socket - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static void -atm_aal5_abort(so) - struct socket *so; -{ - ATM_INTRO_NOERR("abort"); - - (void)atm_sock_disconnect(so); - so->so_error = ECONNABORTED; - - ATM_OUTRO_NOERR(); -} - -static void -atm_aal5_close(so) - struct socket *so; -{ - ATM_INTRO_NOERR("close"); - - (void)atm_sock_disconnect(so); - - ATM_OUTRO_NOERR(); -} - - -/* - * Do control operation - ioctl system call - * - * Arguments: - * so pointer to socket - * cmd ioctl code - * data pointer to code specific parameter data area - * ifp pointer to ifnet structure if it's an interface ioctl - * p pointer to process - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_control(so, cmd, data, ifp, td) - struct socket *so; - u_long cmd; - caddr_t data; - struct ifnet *ifp; - struct thread *td; -{ - ATM_INTRO("control"); - - switch (cmd) { - - default: - err = EOPNOTSUPP; - } - - ATM_OUTRO(); -} - -/* - * Sense socket status - fstat system call - * - * Arguments: - * so pointer to socket - * st pointer to file status structure - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_sense(so, st) - struct socket *so; - struct stat *st; -{ - ATM_INTRO("sense"); - - /* - * Just return the max sdu size for the connection - */ - st->st_blksize = so->so_snd.sb_hiwat; - - ATM_OUTRO(); -} - - -/* - * Retrieve local socket address - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to contain protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_sockaddr(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - ATM_INTRO("sockaddr"); - - err = atm_sock_sockaddr(so, addr); - - ATM_OUTRO(); -} - - -/* - * Retrieve peer socket address - * - * Arguments: - * so pointer to socket - * addr pointer to pointer to contain protocol address - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -static int -atm_aal5_peeraddr(so, addr) - struct socket *so; - struct sockaddr **addr; -{ - ATM_INTRO("peeraddr"); - - err = atm_sock_peeraddr(so, addr); - - ATM_OUTRO(); -} - - -/* - * Process Incoming Calls - * - * This function will receive control when an incoming call has been matched - * to one of our registered listen parameter blocks. Assuming the call passes - * acceptance criteria and all required resources are available, we will - * create a new protocol control block and socket association. We must - * then await notification of the final SVC setup results. If any - * problems are encountered, we will just tell the connection manager to - * reject the call. - * - * Called at splnet. - * - * Arguments: - * tok owner's matched listening token - * cop pointer to incoming call's connection block - * ap pointer to incoming call's attributes - * tokp pointer to location to store our connection token - * - * Returns: - * 0 call is accepted - * errno call rejected - reason indicated - * - */ -static int -atm_aal5_incoming(tok, cop, ap, tokp) - void *tok; - Atm_connection *cop; - Atm_attributes *ap; - void **tokp; -{ - Atm_pcb *atp0 = tok, *atp; - struct socket *so; - int err = 0; - - /* - * Allocate a new socket and pcb for this connection. - * - * Note that our attach function will be called via sonewconn - * and it will allocate and setup most of the pcb. - */ - atm_sock_stat.as_inconn[atp0->atp_type]++; - so = sonewconn(atp0->atp_socket, 0); - - if (so) { - /* - * Finish pcb setup and pass pcb back to CM - */ - atp = sotoatmpcb(so); - atp->atp_conn = cop; - atp->atp_attr = *atp0->atp_conn->co_lattr; - strncpy(atp->atp_name, atp0->atp_name, T_ATM_APP_NAME_LEN); - *tokp = atp; - } else { - err = ECONNABORTED; - atm_sock_stat.as_connfail[atp0->atp_type]++; - } - - return (err); -} - - -/* - * Process Socket VCC Input Data - * - * Arguments: - * tok owner's connection token (atm_pcb) - * m pointer to input packet buffer chain - * - * Returns: - * none - * - */ -static void -atm_aal5_cpcs_data(tok, m) - void *tok; - KBuffer *m; -{ - Atm_pcb *atp = tok; - struct socket *so; - int len; - - so = atp->atp_socket; - - KB_PLENGET(m, len); - - /* - * Ensure that the socket is able to receive data and - * that there's room in the socket buffer - */ - if (((so->so_state & SS_ISCONNECTED) == 0) || - (so->so_rcv.sb_state & SBS_CANTRCVMORE) || - (len > sbspace(&so->so_rcv))) { - atm_sock_stat.as_indrop[atp->atp_type]++; - KB_FREEALL(m); - return; - } - - /* - * Queue the data and notify the user - */ - sbappendrecord(&so->so_rcv, m); - sorwakeup(so); - - return; -} - - -/* - * Process getsockopt/setsockopt system calls - * - * Arguments: - * so pointer to socket - * sopt pointer to socket option info - * - * Returns: - * 0 request processed - * errno error processing request - reason indicated - * - */ -int -atm_aal5_ctloutput(so, sopt) - struct socket *so; - struct sockopt *sopt; -{ - Atm_pcb *atp; - - ATM_INTRO("ctloutput"); - - /* - * Make sure this is for us - */ - if (sopt->sopt_level != T_ATM_SIGNALING) { - ATM_RETERR(EINVAL); - } - atp = sotoatmpcb(so); - if (atp == NULL) { - ATM_RETERR(ENOTCONN); - } - - switch (sopt->sopt_dir) { - - case SOPT_SET: - /* - * setsockopt() - */ - - /* - * Validate socket state - */ - switch (sopt->sopt_name) { - - case T_ATM_ADD_LEAF: - case T_ATM_DROP_LEAF: - if ((so->so_state & SS_ISCONNECTED) == 0) { - ATM_RETERR(ENOTCONN); - } - break; - - case T_ATM_CAUSE: - case T_ATM_APP_NAME: - break; - - default: - if (so->so_state & SS_ISCONNECTED) { - ATM_RETERR(EISCONN); - } - break; - } - - /* - * Validate and save user-supplied option data - */ - err = atm_sock_setopt(so, sopt, atp); - - break; - - case SOPT_GET: - /* - * getsockopt() - */ - - /* - * Return option data - */ - err = atm_sock_getopt(so, sopt, atp); - - break; - } - -out: - ATM_OUTRO(); -} - - -/* - * Initialize AAL5 Sockets - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atm_aal5_init() -{ - /* - * Register our endpoint - */ - if (atm_endpoint_register(&atm_aal5_endpt)) - panic("atm_aal5_init: register"); - - /* - * Set default connection attributes - */ - atm_aal5_defattr.aal.v.aal5.forward_max_SDU_size = T_ATM_ABSENT; - atm_aal5_defattr.aal.v.aal5.backward_max_SDU_size = T_ATM_ABSENT; - atm_aal5_defattr.aal.v.aal5.SSCS_type = T_ATM_NULL; -} - - -/* - * Get Connection's Application/Owner Name - * - * Arguments: - * tok owner's connection token (atm_pcb) - * - * Returns: - * addr pointer to string containing our name - * - */ -static caddr_t -atm_aal5_getname(tok) - void *tok; -{ - Atm_pcb *atp = tok; - - return (atp->atp_name); -} - Property changes on: head/sys/netatm/atm_aal5.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/atm.h =================================================================== --- head/sys/netatm/atm.h (revision 179307) +++ head/sys/netatm/atm.h (nonexistent) @@ -1,649 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * Core ATM Services - * ----------------- - * - * ATM address family definitions - * - */ - -#ifndef _NETATM_ATM_H -#define _NETATM_ATM_H - - -/* - * The definitions in this file are intended to conform to the - * specifications defined in: - * - * The Open Group, Networking Services (XNS) Issue 5 - * - * ATM Transport Protocol Information for Sockets - * - * which is Copyright (c) 1997, The Open Group. - * - * All extensions contained in this file to the base specification - * are denoted with a comment string of "XNS_EXT". - */ - -/* - * ATM socket protocols - */ -#define ATM_PROTO_AAL5 0x5301 /* AAL type 5 protocol */ -#define ATM_PROTO_SSCOP 0x5302 /* SSCOP protocol */ - - -/* - * ATM address defintions - */ -/* - * General format of an ATM address - */ -#define ATM_ADDR_LEN 20 /* Size of address field (XNS_EXT) */ - -struct t_atm_addr { - int8_t address_format; /* Address format (see below) */ - u_int8_t address_length; /* Length of address field */ - u_int8_t address[ATM_ADDR_LEN]; /* Address field */ -}; -typedef struct t_atm_addr Atm_addr; /* XNS_EXT */ - -/* - * ATM address formats - */ -#define T_ATM_ABSENT (-1) /* No address present */ -#define T_ATM_ENDSYS_ADDR 1 /* ATM Endsystem */ -#define T_ATM_NSAP_ADDR 1 /* NSAP */ -#define T_ATM_E164_ADDR 2 /* E.164 */ -#define T_ATM_SPANS_ADDR 3 /* FORE SPANS (XNS_EXT) */ -#define T_ATM_PVC_ADDR 4 /* PVC (VPI,VCI) (XNS_EXT) */ - -/* - * ATM Endsystem / NSAP address format - */ -struct atm_addr_nsap { /* XNS_EXT */ - u_char aan_afi; /* Authority and Format Identifier */ - /* (see below) */ - u_char aan_afspec[12]; /* AFI specific fields */ - u_char aan_esi[6]; /* End System Identifier */ - u_char aan_sel; /* Selector */ -}; -typedef struct atm_addr_nsap Atm_addr_nsap; - -/* - * AFI codes - */ -#define AFI_DCC 0x39 /* DCC ATM Format (XNS_EXT) */ -#define AFI_ICD 0x47 /* ICD ATM Format (XNS_EXT) */ -#define AFI_E164 0x45 /* E.164 ATM Format (XNS_EXT) */ - -/* - * E.164 address format - */ -struct atm_addr_e164 { /* XNS_EXT */ - u_char aae_addr[15]; /* E.164 address */ -}; -typedef struct atm_addr_e164 Atm_addr_e164; - -/* - * SPANS address format - */ -struct atm_addr_spans { /* XNS_EXT */ - u_char aas_addr[8]; /* See SPANS code for specific fields */ -}; -typedef struct atm_addr_spans Atm_addr_spans; - -/* - * PVC address format - */ -struct atm_addr_pvc { /* XNS_EXT */ - u_int8_t aap_vpi[2]; /* VPI */ - u_int8_t aap_vci[2]; /* VCI */ -}; -typedef struct atm_addr_pvc Atm_addr_pvc; - -#define ATM_PVC_GET_VPI(addr) /* XNS_EXT */ \ - ((u_int16_t)(((addr)->aap_vpi[0] << 8) | (addr)->aap_vpi[1])) -#define ATM_PVC_GET_VCI(addr) /* XNS_EXT */ \ - ((u_int16_t)(((addr)->aap_vci[0] << 8) | (addr)->aap_vci[1])) -#define ATM_PVC_SET_VPI(addr,vpi) { /* XNS_EXT */ \ - (addr)->aap_vpi[0] = ((vpi) >> 8) & 0xff; \ - (addr)->aap_vpi[1] = (vpi) & 0xff; \ -} -#define ATM_PVC_SET_VCI(addr,vci) { /* XNS_EXT */ \ - (addr)->aap_vci[0] = ((vci) >> 8) & 0xff; \ - (addr)->aap_vci[1] = (vci) & 0xff; \ -} - - -/* - * ATM service access point (SAP) - * - * A SAP address consists of SAP Vector Elements (SVE). Each SVE consists - * of the following fields: - * o tag - defines the interpretation of the SVE; - * o length - the length of the SVE value field; - * o value - the value associated with the SVE; - * - * All of the possible SAP field values are either defined below - * or in the corresponding option value definitions. - */ - -/* - * ATM Address and Selector SVE - */ -struct t_atm_sap_addr { - int8_t SVE_tag_addr; /* SVE tag (address) */ - int8_t SVE_tag_selector; /* SVE tag (selector) */ - /* Address/selector value */ - int8_t address_format; /* Address format */ - u_int8_t address_length; /* Length of address field */ - u_int8_t address[ATM_ADDR_LEN]; /* Address field */ -}; - -/* - * B-LLI Layer 2 SVE - */ -struct t_atm_sap_layer2 { - int8_t SVE_tag; /* SVE tag */ - u_int8_t ID_type; /* Layer 2 protocol discriminator */ - union { /* Layer 2 protocol */ - u_int8_t simple_ID; /* ITU */ - u_int8_t user_defined_ID;/* User-defined */ - } ID; -}; - -/* - * B-LLI Layer 3 SVE - */ -struct t_atm_sap_layer3 { - int8_t SVE_tag; /* SVE tag */ - u_int8_t ID_type; /* Layer 3 protocol discriminator */ - union { /* Layer 3 protocol */ - u_int8_t simple_ID; /* ITU */ - u_int8_t IPI_ID; /* ISO IPI */ - struct { /* IEEE 802.1 SNAP ID */ - u_int8_t OUI[3]; - u_int8_t PID[2]; - } SNAP_ID; - u_int8_t user_defined_ID;/* User-defined */ - } ID; -}; - -/* - * B_HLI SVE - */ -struct t_atm_sap_appl { - int8_t SVE_tag; /* SVE tag */ - u_int8_t ID_type; /* High Layer type discriminator */ - union { /* High Layer type */ - u_int8_t ISO_ID[8]; /* ISO */ - struct { /* Vendor-specific */ - u_int8_t OUI[3]; - u_int8_t app_ID[4]; - } vendor_ID; - u_int8_t user_defined_ID[8];/* User-defined */ - } ID; -}; - -/* - * ATM SAP (protocol) address structure - */ -struct t_atm_sap { - struct t_atm_sap_addr t_atm_sap_addr; - struct t_atm_sap_layer2 t_atm_sap_layer2; - struct t_atm_sap_layer3 t_atm_sap_layer3; - struct t_atm_sap_appl t_atm_sap_appl; -}; - -/* - * SVE Tag values - */ -#define T_ATM_ABSENT (-1) /* Value field invalid; match none */ -#define T_ATM_PRESENT (-2) /* Value field valid; match value */ -#define T_ATM_ANY (-3) /* Value field invalid; match any */ - - -/* - * ATM socket address - */ -struct sockaddr_atm { /* XNS_EXT */ - u_char satm_len; /* Length of socket structure */ - u_char satm_family; /* Address family */ - struct t_atm_sap satm_addr; /* Protocol address */ -}; - - -/* - * ATM socket options for use with [gs]etsockopt() - */ -#define T_ATM_SIGNALING 0x5301 /* Option level */ - -#define T_ATM_AAL5 1 /* ATM adaptation layer 5 */ -#define T_ATM_TRAFFIC 2 /* ATM traffic descriptor */ -#define T_ATM_BEARER_CAP 3 /* ATM service capabilities */ -#define T_ATM_BHLI 4 /* Higher-layer protocol */ -#define T_ATM_BLLI 5 /* Lower-layer protocol */ -#define T_ATM_DEST_ADDR 6 /* Call responder's address */ -#define T_ATM_DEST_SUB 7 /* Call responder's subaddress */ -#define T_ATM_ORIG_ADDR 8 /* Call initiator's address */ -#define T_ATM_ORIG_SUB 9 /* Call initiator's subaddress */ -#define T_ATM_CALLER_ID 10 /* Caller's ID attributes */ -#define T_ATM_CAUSE 11 /* Cause of disconection */ -#define T_ATM_QOS 12 /* Quality of service */ -#define T_ATM_TRANSIT 13 /* Choice of public carrier */ -#define T_ATM_ADD_LEAF 14 /* Add leaf to connection */ -#define T_ATM_DROP_LEAF 15 /* Remove leaf from connection */ -#define T_ATM_LEAF_IND 16 /* Indication of leaf status */ -#define T_ATM_NET_INTF 17 /* Network interface XNS_EXT */ -#define T_ATM_LLC 18 /* LLC multiplexing XNS_EXT */ -#define T_ATM_APP_NAME 19 /* Application name XNS_EXT */ - - -/* - * Common socket option values - * - * See API specification for individual option applicability/meaning - */ -#define T_ATM_ABSENT (-1) /* No option value present */ -#define T_ATM_NULL 0 /* Option value is null */ -#define T_NO 0 /* Option is not requested */ -#define T_YES 1 /* Option is requested */ - - -/* - * T_ATM_AAL5 option value structure - */ -struct t_atm_aal5 { - int32_t forward_max_SDU_size; - int32_t backward_max_SDU_size; - int32_t SSCS_type; -}; - -/* - * T_ATM_AAL5 option values - */ - /* SSCS_type */ -#define T_ATM_SSCS_SSCOP_REL 1 /* SSCOP assured operation */ -#define T_ATM_SSCS_SSCOP_UNREL 2 /* SSCOP non-assured operation */ -#define T_ATM_SSCS_FR 4 /* Frame relay */ - - -/* - * T_ATM_TRAFFIC option value structure - */ -struct t_atm_traffic_substruct { - int32_t PCR_high_priority; - int32_t PCR_all_traffic; - int32_t SCR_high_priority; - int32_t SCR_all_traffic; - int32_t MBS_high_priority; - int32_t MBS_all_traffic; - int32_t tagging; -}; - -struct t_atm_traffic { - struct t_atm_traffic_substruct forward; - struct t_atm_traffic_substruct backward; - u_int8_t best_effort; -}; - - -/* - * T_ATM_BEARER_CAP option value structure - */ -struct t_atm_bearer { - u_int8_t bearer_class; - u_int8_t traffic_type; - u_int8_t timing_requirements; - u_int8_t clipping_susceptibility; - u_int8_t connection_configuration; -}; - -/* - * T_ATM_BEARER_CAP option values - */ - /* bearer_class */ -#define T_ATM_CLASS_A 0x01 /* Bearer class A */ -#define T_ATM_CLASS_C 0x03 /* Bearer class C */ -#define T_ATM_CLASS_X 0x10 /* Bearer class X */ - - /* traffic_type */ -#define T_ATM_CBR 0x01 /* Constant bit rate */ -#define T_ATM_VBR 0x02 /* Variable bit rate */ -#define T_ATM_ABR 0x03 /* Available Bit Rate */ -#define T_ATM_UBR 0x04 /* Unspecified bit rate */ - - /* timing_requirements */ -#define T_ATM_END_TO_END 0x01 /* End-to-end timing required */ -#define T_ATM_NO_END_TO_END 0x02 /* End-to-end timing not required */ - - /* connection_configuration */ -#define T_ATM_1_TO_1 0x00 /* Point-to-point connection */ -#define T_ATM_1_TO_MANY 0x01 /* Point-to-multipoint connection */ - - -/* - * T_ATM_BHLI option value structure - */ -struct t_atm_bhli { - int32_t ID_type; - union { - u_int8_t ISO_ID[8]; - struct { - u_int8_t OUI[3]; - u_int8_t app_ID[4]; - } vendor_ID; - u_int8_t user_defined_ID[8]; - } ID; -}; - -/* - * T_ATM_BHLI option values - */ - /* ID_type */ -#define T_ATM_ISO_APP_ID 0 /* ISO codepoint */ -#define T_ATM_USER_APP_ID 1 /* User-specific codepoint */ -#define T_ATM_VENDOR_APP_ID 3 /* Vendor-specific codepoint */ - -/* - * T_ATM_BLLI option value structure - */ -struct t_atm_blli { - struct { - int8_t ID_type; - union { - u_int8_t simple_ID; - u_int8_t user_defined_ID; - } ID; - int8_t mode; - int8_t window_size; - } layer_2_protocol; - struct { - int8_t ID_type; - union { - u_int8_t simple_ID; - int32_t IPI_ID; - struct { - u_int8_t OUI[3]; - u_int8_t PID[2]; - } SNAP_ID; - u_int8_t user_defined_ID; - } ID; - int8_t mode; - int8_t packet_size; - int8_t window_size; - } layer_3_protocol; -}; - - -/* - * T_ATM_BLLI option values - */ - /* layer_[23]_protocol.ID_type */ -#define T_ATM_SIMPLE_ID 1 /* ID via ITU encoding */ -#define T_ATM_IPI_ID 2 /* ID via ISO/IEC TR 9577 */ -#define T_ATM_SNAP_ID 3 /* ID via SNAP */ -#define T_ATM_USER_ID 4 /* ID via user codepoints */ - - /* layer_[23]_protocol.mode */ -#define T_ATM_BLLI_NORMAL_MODE 1 -#define T_ATM_BLLI_EXTENDED_MODE 2 - - /* layer_2_protocol.simple_ID */ -#define T_ATM_BLLI2_I1745 1 /* I.1745 */ -#define T_ATM_BLLI2_Q921 2 /* Q.921 */ -#define T_ATM_BLLI2_X25_LINK 6 /* X.25, link layer */ -#define T_ATM_BLLI2_X25_MLINK 7 /* X.25, multilink */ -#define T_ATM_BLLI2_LAPB 8 /* Extended LAPB */ -#define T_ATM_BLLI2_HDLC_ARM 9 /* I.4335, ARM */ -#define T_ATM_BLLI2_HDLC_NRM 10 /* I.4335, NRM */ -#define T_ATM_BLLI2_HDLC_ABM 11 /* I.4335, ABM */ -#define T_ATM_BLLI2_I8802 12 /* I.8802 */ -#define T_ATM_BLLI2_X75 13 /* X.75 */ -#define T_ATM_BLLI2_Q922 14 /* Q.922 */ -#define T_ATM_BLLI2_I7776 17 /* I.7776 */ - - /* layer_3_protocol.simple_ID */ -#define T_ATM_BLLI3_X25 6 /* X.25 */ -#define T_ATM_BLLI3_I8208 7 /* I.8208 */ -#define T_ATM_BLLI3_X223 8 /* X.223 */ -#define T_ATM_BLLI3_I8473 9 /* I.8473 */ -#define T_ATM_BLLI3_T70 10 /* T.70 */ -#define T_ATM_BLLI3_I9577 11 /* I.9577 */ - - /* layer_3_protocol.packet_size */ -#define T_ATM_PACKET_SIZE_16 4 -#define T_ATM_PACKET_SIZE_32 5 -#define T_ATM_PACKET_SIZE_64 6 -#define T_ATM_PACKET_SIZE_128 7 -#define T_ATM_PACKET_SIZE_256 8 -#define T_ATM_PACKET_SIZE_512 9 -#define T_ATM_PACKET_SIZE_1024 10 -#define T_ATM_PACKET_SIZE_2048 11 -#define T_ATM_PACKET_SIZE_4096 12 - - -/* - * T_ATM_CALLER_ID option value structure - */ -struct t_atm_caller_id { - int8_t presentation; - u_int8_t screening; -}; - -/* - * T_ATM_CALLER_ID option values - */ - /* presentation */ -#define T_ATM_PRES_ALLOWED 0 -#define T_ATM_PRES_RESTRICTED 1 -#define T_ATM_PRES_UNAVAILABLE 2 - /* screening */ -#define T_ATM_USER_ID_NOT_SCREENED 0 -#define T_ATM_USER_ID_PASSED_SCREEN 1 -#define T_ATM_USER_ID_FAILED_SCREEN 2 -#define T_ATM_NETWORK_PROVIDED_ID 3 - - -/* - * T_ATM_CAUSE option value structure - */ -struct t_atm_cause { - int8_t coding_standard; - u_int8_t location; - u_int8_t cause_value; - u_int8_t diagnostics[4]; -}; - -/* - * T_ATM_CAUSE option values - */ - /* coding_standard */ -#define T_ATM_ITU_CODING 0 -#define T_ATM_NETWORK_CODING 3 - - /* location */ -#define T_ATM_LOC_USER 0 -#define T_ATM_LOC_LOCAL_PRIVATE_NET 1 -#define T_ATM_LOC_LOCAL_PUBLIC_NET 2 -#define T_ATM_LOC_TRANSIT_NET 3 -#define T_ATM_LOC_REMOTE_PUBLIC_NET 4 -#define T_ATM_LOC_REMOTE_PRIVATE_NET 5 -#define T_ATM_LOC_INTERNATIONAL_NET 7 -#define T_ATM_LOC_BEYOND_INTERWORKING 10 - - /* cause_value */ -#define T_ATM_CAUSE_UNALLOCATED_NUMBER 1 -#define T_ATM_CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK 2 -#define T_ATM_CAUSE_NO_ROUTE_TO_DESTINATION 3 -#define T_ATM_CAUSE_NORMAL_CALL_CLEARING 16 -#define T_ATM_CAUSE_USER_BUSY 17 -#define T_ATM_CAUSE_NO_USER_RESPONDING 18 -#define T_ATM_CAUSE_CALL_REJECTED 21 -#define T_ATM_CAUSE_NUMBER_CHANGED 22 -#define T_ATM_CAUSE_ALL_CALLS_WITHOUT_CALLER_ID_REJECTED 23 -#define T_ATM_CAUSE_DESTINATION_OUT_OF_ORDER 27 -#define T_ATM_CAUSE_INVALID_NUMBER_FORMAT 28 -#define T_ATM_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30 -#define T_ATM_CAUSE_UNSPECIFIED_NORMAL 31 -#define T_ATM_CAUSE_REQUESTED_VPCI_VCI_NOT_AVAILABLE 35 -#define T_ATM_CAUSE_VPCI_VCI_ASSIGNMENT_FAILURE 36 -#define T_ATM_CAUSE_USER_CELL_RATE_NOT_AVAILABLE 37 -#define T_ATM_CAUSE_NETWORK_OUT_OF_ORDER 38 -#define T_ATM_CAUSE_TEMPORARY_FAILURE 41 -#define T_ATM_CAUSE_ACCESS_INFO_DISCARDED 43 -#define T_ATM_CAUSE_NO_VPCI_VCI_AVAILABLE 45 -#define T_ATM_CAUSE_UNSPECIFIED_RESOURCE_UNAVAILABLE 47 -#define T_ATM_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE 49 -#define T_ATM_CAUSE_BEARER_CAPABILITY_NOT_AUTHORIZED 57 -#define T_ATM_CAUSE_BEARER_CAPABILITY_UNAVAILABLE 58 -#define T_ATM_CAUSE_SERVICE_OR_OPTION_UNAVAILABLE 63 -#define T_ATM_CAUSE_BEARER_CAPABILITY_NOT_IMPLEMENTED 65 -#define T_ATM_CAUSE_INVALID_TRAFFIC_PARAMETERS 73 -#define T_ATM_CAUSE_AAL_PARAMETERS_NOT_SUPPORTED 78 -#define T_ATM_CAUSE_INVALID_CALL_REFERENCE_VALUE 81 -#define T_ATM_CAUSE_IDENTIFIED_CHANNEL_DOES_NOT_EXIST 82 -#define T_ATM_CAUSE_INCOMPATIBLE_DESTINATION 88 -#define T_ATM_CAUSE_INVALID_ENDPOINT_REFERENCE 89 -#define T_ATM_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION 91 -#define T_ATM_CAUSE_TOO_MANY_PENDING_ADD_PARTY_REQUESTS 92 -#define T_ATM_CAUSE_MANDITORY_INFO_ELEMENT_MISSING 96 -#define T_ATM_CAUSE_MESSAGE_TYPE_NOT_IMPLEMENTED 97 -#define T_ATM_CAUSE_INFO_ELEMENT_NOT_IMPLEMENTED 99 -#define T_ATM_CAUSE_INVALID_INFO_ELEMENT_CONTENTS 100 -#define T_ATM_CAUSE_MESSAGE_INCOMPATIBLE_WITH_CALL_STATE 101 -#define T_ATM_CAUSE_RECOVERY_ON_TIMER_EXPIRY 102 -#define T_ATM_CAUSE_INCORRECT_MESSAGE_LENGTH 104 -#define T_ATM_CAUSE_UNSPECIFIED_PROTOCOL_ERROR 111 - - -/* - * T_ATM_QOS option value structure - */ -struct t_atm_qos_substruct { - int32_t qos_class; -}; - -struct t_atm_qos { - int8_t coding_standard; - struct t_atm_qos_substruct forward; - struct t_atm_qos_substruct backward; -}; - -/* - * T_ATM_QOS option values - */ - /* qos_class */ -#define T_ATM_QOS_CLASS_0 0 -#define T_ATM_QOS_CLASS_1 1 -#define T_ATM_QOS_CLASS_2 2 -#define T_ATM_QOS_CLASS_3 3 -#define T_ATM_QOS_CLASS_4 4 - - -/* - * T_ATM_TRANSIT structure - */ -#define T_ATM_MAX_NET_ID 4 /* XNS_EXT */ -struct t_atm_transit { - u_int8_t length; - u_int8_t network_id[T_ATM_MAX_NET_ID]; -}; - - -/* - * T_ATM_ADD_LEAF option value structure - */ -struct t_atm_add_leaf { - int32_t leaf_ID; - struct t_atm_addr leaf_address; -}; - - -/* - * T_ATM_DROP_LEAF option value structure - */ -struct t_atm_drop_leaf { - int32_t leaf_ID; - int32_t reason; -}; - -/* - * T_ATM_LEAF_IND option value structure - */ -struct t_atm_leaf_ind { - int32_t status; - int32_t leaf_ID; - int32_t reason; -}; - -/* - * T_ATM_LEAF_IND option values - */ - /* status */ -#define T_LEAF_NOCHANGE 0 -#define T_LEAF_CONNECTED 1 -#define T_LEAF_DISCONNECTED 2 - -/* - * T_ATM_NET_INTF option value structure (XNS_EXT) - */ -struct t_atm_net_intf { /* XNS_EXT */ - char net_intf[IFNAMSIZ]; -}; - -/* - * T_ATM_LLC option value structure (XNS_EXT) - */ -#define T_ATM_LLC_MIN_LEN 3 -#define T_ATM_LLC_MAX_LEN 8 - -struct t_atm_llc { /* XNS_EXT */ - u_int8_t flags; /* LLC flags (see below) */ - u_int8_t llc_len; /* Length of LLC information */ - u_int8_t llc_info[T_ATM_LLC_MAX_LEN]; /* LLC information */ -}; - -/* - * T_ATM_LLC option values - */ - /* flags */ -#define T_ATM_LLC_SHARING 0x01 /* LLC sharing allowed */ - -/* - * T_ATM_APP_NAME option value structure (XNS_EXT) - */ -#define T_ATM_APP_NAME_LEN 8 -struct t_atm_app_name { /* XNS_EXT */ - char app_name[T_ATM_APP_NAME_LEN]; -}; - -#endif /* _NETATM_ATM_H */ Property changes on: head/sys/netatm/atm.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/port.h =================================================================== --- head/sys/netatm/port.h (revision 179307) +++ head/sys/netatm/port.h (nonexistent) @@ -1,292 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * System Configuration - * -------------------- - * - * Porting aides - * - */ - -#ifndef _NETATM_PORT_H -#define _NETATM_PORT_H - - -#ifdef _KERNEL -/* - * Kernel buffers - * - * KBuffer Typedef for a kernel buffer. - * - * KB_NEXT(bfr) Access next buffer in chain (r/w). - * KB_LEN(bfr) Access length of data in this buffer (r/w). - * KB_QNEXT(bfr) Access next buffer in queue (r/w). - * - * KB_ALLOC(bfr, size, flags, type) - * Allocates a new kernel buffer of at least size bytes. - * KB_ALLOCPKT(bfr, size, flags, type) - * Allocates a new kernel packet header buffer of at - * least size bytes. - * KB_ALLOCEXT(bfr, size, flags, type) - * Allocates a new kernel buffer with external storage - * of at least size bytes. - * KB_FREEONE(bfr, nxt) Free buffer bfr and set next buffer in chain in nxt. - * KB_FREEALL(bfr) Free bfr's entire buffer chain. - * KB_COPY(bfr, off, len, new, flags) - * Copy len bytes of user data from buffer bfr starting at - * byte offset off and return new buffer chain in new. - * If len is KB_COPYALL, copy until end of chain. - * KB_COPYDATA(bfr, off, len, datap) - * Copy data from buffer bfr starting at byte offset off - * for len bytes into the data area pointed to by datap. - * Returns the number of bytes not copied to datap. - * KB_PULLUP(bfr, n, new) - * Get at least the first n bytes of data in the buffer - * chain headed by bfr contiguous in the first buffer. - * Returns the (potentially new) head of the chain in new. - * On failure the chain is freed and NULL is returned. - * KB_LINKHEAD(new, head) - * Link the kernel buffer new at the head of the buffer - * chain headed by head. If both new and head are - * packet header buffers, new will become the packet - * header for the chain. - * KB_LINK(new, prev) - * Link the kernel buffer new into the buffer chain - * after the buffer prev. - * KB_UNLINKHEAD(head, next) - * Unlink the kernel buffer from the head of the buffer - * chain headed by head. The buffer head will be freed - * and the new chain head will be placed in next. - * KB_UNLINK(old, prev, next) - * Unlink the kernel buffer old with previous buffer prev - * from its buffer chain. The following buffer in the - * chain will be placed in next and the buffer old will - * be freed. - * KB_ISPKT(bfr) Tests whether bfr is a packet header buffer. - * KB_ISEXT(bfr) Tests whether bfr has external storage. - * KB_BFRSTART(bfr, x, t) - * Sets x (cast to type t) to point to the start of the - * buffer space in bfr. - * KB_BFREND(bfr, x, t) - * Sets x (cast to type t) to point one byte past the end - * of the buffer space in bfr. - * KB_BFRLEN(bfr) Returns length of buffer space in bfr. - * KB_DATASTART(bfr, x, t) - * Sets x (cast to type t) to point to the start of the - * buffer data contained in bfr. - * KB_DATAEND(bfr, x, t) - * Sets x (cast to type t) to point one byte past the end - * of the buffer data contained in bfr. - * KB_HEADSET(bfr, n) Sets the start address for buffer data in buffer bfr to - * n bytes from the beginning of the buffer space. - * KB_HEADMOVE(bfr, n) Adjust buffer data controls to move data down (n > 0) - * or up (n < 0) n bytes in the buffer bfr. - * KB_HEADADJ(bfr, n) Adjust buffer data controls to add (n > 0) or subtract - * (n < 0) n bytes of data to/from the beginning of bfr. - * KB_TAILADJ(bfr, n) Adjust buffer data controls to add (n > 0) or subtract - * (n < 0) n bytes of data to/from the end of bfr. - * KB_TAILALIGN(bfr, n) Set buffer data controls to place an object of size n - * at the end of bfr, longword aligned. - * KB_HEADROOM(bfr, n) Set n to the amount of buffer space available before - * the start of data in bfr. - * KB_TAILROOM(bfr, n) Set n to the amount of buffer space available after - * the end of data in bfr. - * KB_PLENGET(bfr, n) Set n to bfr's packet length. - * KB_PLENSET(bfr, n) Set bfr's packet length to n. - * KB_PLENADJ(bfr, n) Adjust total packet length by n bytes. - * - */ -#include -typedef struct mbuf KBuffer; - -#define KB_F_WAIT M_WAIT -#define KB_F_NOWAIT M_DONTWAIT - -#define KB_T_HEADER MT_HEADER -#define KB_T_DATA MT_DATA - -#define KB_COPYALL M_COPYALL - -#define KB_NEXT(bfr) (bfr)->m_next -#define KB_LEN(bfr) (bfr)->m_len -#define KB_QNEXT(bfr) (bfr)->m_nextpkt -#define KB_ALLOC(bfr, size, flags, type) { \ - if ((size) <= MLEN) { \ - MGET((bfr), (flags), (type)); \ - } else \ - (bfr) = NULL; \ -} -#define KB_ALLOCPKT(bfr, size, flags, type) { \ - if ((size) <= MHLEN) { \ - MGETHDR((bfr), (flags), (type)); \ - } else \ - (bfr) = NULL; \ -} -#define KB_ALLOCEXT(bfr, size, flags, type) { \ - if ((size) <= MCLBYTES) { \ - MGET((bfr), (flags), (type)); \ - if ((bfr) != NULL) { \ - MCLGET((bfr), (flags)); \ - if (((bfr)->m_flags & M_EXT) == 0) { \ - m_freem((bfr)); \ - (bfr) = NULL; \ - } \ - } \ - } else \ - (bfr) = NULL; \ -} -#define KB_FREEONE(bfr, nxt) { \ - (nxt) = m_free(bfr); \ -} -#define KB_FREEALL(bfr) { \ - m_freem(bfr); \ -} -#define KB_COPY(bfr, off, len, new, flags) { \ - (new) = m_copym((bfr), (off), (len), (flags)); \ -} -#define KB_COPYDATA(bfr, off, len, datap) \ - (m_copydata((bfr), (off), (len), (datap)), 0) -#define KB_PULLUP(bfr, n, new) { \ - (new) = m_pullup((bfr), (n)); \ -} -#define KB_LINKHEAD(new, head) { \ - if ((head) && KB_ISPKT(new) && KB_ISPKT(head)) {\ - M_MOVE_PKTHDR((new), (head)); \ - } \ - (new)->m_next = (head); \ -} -#define KB_LINK(new, prev) { \ - (new)->m_next = (prev)->m_next; \ - (prev)->m_next = (new); \ -} -#define KB_UNLINKHEAD(head, next) { \ - (next) = m_free((head)); \ - (head) = NULL; \ -} -#define KB_UNLINK(old, prev, next) { \ - (next) = m_free((old)); \ - (old) = NULL; \ - (prev)->m_next = (next); \ -} -#define KB_ISPKT(bfr) (((bfr)->m_flags & M_PKTHDR) != 0) -#define KB_ISEXT(bfr) (((bfr)->m_flags & M_EXT) != 0) -#define KB_BFRSTART(bfr, x, t) { \ - if ((bfr)->m_flags & M_EXT) \ - (x) = (t)((bfr)->m_ext.ext_buf); \ - else if ((bfr)->m_flags & M_PKTHDR) \ - (x) = (t)(&(bfr)->m_pktdat); \ - else \ - (x) = (t)((bfr)->m_dat); \ -} -#define KB_BFREND(bfr, x, t) { \ - if ((bfr)->m_flags & M_EXT) \ - (x) = (t)((bfr)->m_ext.ext_buf + (bfr)->m_ext.ext_size);\ - else if ((bfr)->m_flags & M_PKTHDR) \ - (x) = (t)(&(bfr)->m_pktdat + MHLEN); \ - else \ - (x) = (t)((bfr)->m_dat + MLEN); \ -} -#define KB_BFRLEN(bfr) \ - (((bfr)->m_flags & M_EXT) ? (bfr)->m_ext.ext_size : \ - (((bfr)->m_flags & M_PKTHDR) ? MHLEN : MLEN)) -#define KB_DATASTART(bfr, x, t) { \ - (x) = mtod((bfr), t); \ -} -#define KB_DATAEND(bfr, x, t) { \ - (x) = (t)(mtod((bfr), caddr_t) + (bfr)->m_len); \ -} -#define KB_HEADSET(bfr, n) { \ - if ((bfr)->m_flags & M_EXT) \ - (bfr)->m_data = (bfr)->m_ext.ext_buf + (n); \ - else if ((bfr)->m_flags & M_PKTHDR) \ - (bfr)->m_data = (bfr)->m_pktdat + (n); \ - else \ - (bfr)->m_data = (bfr)->m_dat + (n); \ -} -#define KB_HEADMOVE(bfr, n) { \ - (bfr)->m_data += (n); \ -} -#define KB_HEADADJ(bfr, n) { \ - (bfr)->m_len += (n); \ - (bfr)->m_data -= (n); \ -} -#define KB_TAILADJ(bfr, n) { \ - (bfr)->m_len += (n); \ -} -#define KB_TAILALIGN(bfr, n) { \ - (bfr)->m_len = (n); \ - if ((bfr)->m_flags & M_EXT) \ - (bfr)->m_data = (caddr_t)(((uintptr_t)(bfr)->m_ext.ext_buf \ - + (bfr)->m_ext.ext_size - (n)) & ~(sizeof(long) - 1));\ - else \ - (bfr)->m_data = (caddr_t)(((uintptr_t)(bfr)->m_dat + MLEN - (n)) \ - & ~(sizeof(long) - 1)); \ -} -#define KB_HEADROOM(bfr, n) { \ - /* N = m_leadingspace(BFR) XXX */ \ - (n) = ((bfr)->m_flags & M_EXT ? (bfr)->m_data - (bfr)->m_ext.ext_buf : \ - (bfr)->m_flags & M_PKTHDR ? (bfr)->m_data - (bfr)->m_pktdat : \ - (bfr)->m_data - (bfr)->m_dat); \ -} -#define KB_TAILROOM(bfr, n) { \ - (n) = M_TRAILINGSPACE(bfr); \ -} -#define KB_PLENGET(bfr, n) { \ - (n) = (bfr)->m_pkthdr.len; \ -} -#define KB_PLENSET(bfr, n) { \ - (bfr)->m_pkthdr.len = (n); \ -} -#define KB_PLENADJ(bfr, n) { \ - (bfr)->m_pkthdr.len += (n); \ -} - - -/* - * Kernel time - * - * KTimeout_ret Typedef for timeout() function return - * - * KT_TIME(t) Sets t to the current time. - * - */ -typedef void KTimeout_ret; -#define KT_TIME(t) microtime(&t) - -#endif /* _KERNEL */ - -#ifndef MAX -#define MAX(a,b) max((a),(b)) -#endif -#ifndef MIN -#define MIN(a,b) min((a),(b)) -#endif - -#endif /* _NETATM_PORT_H */ Property changes on: head/sys/netatm/port.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/sigpvc/sigpvc_if.c =================================================================== --- head/sys/netatm/sigpvc/sigpvc_if.c (revision 179307) +++ head/sys/netatm/sigpvc/sigpvc_if.c (nonexistent) @@ -1,888 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * PVC-only Signalling Manager - * --------------------------- - * - * External interfaces to SigPVC manager. Includes support for - * running as a loadable kernel module. - */ - -#include -__FBSDID("$FreeBSD$"); - -#ifndef ATM_SIGPVC_MODULE -#include "opt_atm.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -/* - * Global variables - */ -uma_zone_t sigpvc_vc_zone; - -/* - * Local functions - */ -static int sigpvc_start(void); -static int sigpvc_stop(void); -static int sigpvc_attach(struct sigmgr *, struct atm_pif *); -static int sigpvc_detach(struct atm_pif *); -static int sigpvc_setup(Atm_connvc *, int *); -static int sigpvc_release(struct vccb *, int *); -static int sigpvc_free(struct vccb *); -static int sigpvc_ioctl(int, caddr_t, caddr_t); - -/* - * Local variables - */ -static int sigpvc_registered = 0; -static struct sigmgr sigpvc_mgr = { - NULL, - ATM_SIG_PVC, - NULL, - sigpvc_attach, - sigpvc_detach, - sigpvc_setup, - NULL, - NULL, - sigpvc_release, - sigpvc_free, - sigpvc_ioctl -}; - -static struct attr_cause sigpvc_cause = { - T_ATM_PRESENT, - { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_UNSPECIFIED_NORMAL, - {0, 0, 0, 0} - } -}; - - -/* - * Initialize sigpvc processing - * - * This will be called during module loading. We'll just register - * the sigpvc protocol descriptor and wait for a SigPVC ATM interface - * to come online. - * - * Arguments: - * none - * - * Returns: - * 0 startup was successful - * errno startup failed - reason indicated - * - */ -static int -sigpvc_start() -{ - int err = 0; - - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - log(LOG_ERR, "version mismatch: sigpvc=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version)); - return (EINVAL); - } - - sigpvc_vc_zone = uma_zcreate("sigpvc vc", sizeof(struct sigpvc_vccb), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (sigpvc_vc_zone == NULL) - return (ENOMEM); - - /* - * Register ourselves with system - */ - err = atm_sigmgr_register(&sigpvc_mgr); - if (err == 0) - sigpvc_registered = 1; - - return (err); -} - - -/* - * Halt sigpvc processing - * - * This should be called just prior to unloading the module from - * memory. All sigpvc interfaces must be deregistered before the - * protocol can be shutdown. - * - * Arguments: - * none - * - * Returns: - * 0 shutdown was successful - * errno shutdown failed - reason indicated - * - */ -static int -sigpvc_stop() -{ - int err = 0; - int s = splnet(); - - /* - * Is protocol even setup? - */ - if (sigpvc_registered) { - - /* - * Any protocol instances still registered?? - */ - if (sigpvc_mgr.sm_prinst) { - - /* Yes, can't stop now */ - err = EBUSY; - goto done; - } - - /* - * De-register from system - */ - err = atm_sigmgr_deregister(&sigpvc_mgr); - sigpvc_registered = 0; - - /* - * Free up our vccb storage pool - */ - uma_zdestroy(sigpvc_vc_zone); - } else - err = ENXIO; - -done: - (void) splx(s); - return (err); -} - - -/* - * Attach a SigPVC-controlled interface - * - * Each ATM physical interface must be attached with the signalling manager for - * the interface's signalling protocol (via the atm_sigmgr_attach function). - * This function will handle the attachment for SigPVC-controlled interfaces. - * A new sigpvc protocol instance will be created and then we'll just sit - * around waiting for connection requests. - * - * Function must be called at splnet. - * - * Arguments: - * smp pointer to sigpvc signalling manager control block - * pip pointer to atm physical interface control block - * - * Returns: - * 0 attach successful - * errno attach failed - reason indicated - * - */ -static int -sigpvc_attach(smp, pip) - struct sigmgr *smp; - struct atm_pif *pip; -{ - int err = 0; - struct sigpvc *pvp = NULL; - - /* - * Allocate sigpvc protocol instance control block - */ - pvp = malloc(sizeof(struct sigpvc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (pvp == NULL) { - err = ENOMEM; - goto done; - } - - /* - * Link instance into manager's chain - */ - LINK2TAIL((struct siginst *)pvp, struct siginst, - smp->sm_prinst, si_next); - - /* - * Finally, set state and link in interface - */ - pvp->pv_pif = pip; - pvp->pv_state = SIGPVC_ACTIVE; - pip->pif_sigmgr = smp; - pip->pif_siginst = (struct siginst *)pvp; - -done: - /* - * Reset our work if attach fails - */ - if (err) { - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - if (pvp) { - UNLINK((struct siginst *)pvp, struct siginst, - smp->sm_prinst, si_next); - free(pvp, M_DEVBUF); - } - } - - return (err); -} - - -/* - * Detach a SigPVC-controlled interface - * - * Each ATM physical interface may be detached from its signalling manager - * (via the atm_sigmgr_detach function). This function will handle the - * detachment for all SigPVC-controlled interfaces. All circuits will be - * immediately terminated. - * - * Function must be called at splnet. - * - * Arguments: - * pip pointer to atm physical interface control block - * - * Returns: - * 0 detach successful - * errno detach failed - reason indicated - * - */ -static int -sigpvc_detach(pip) - struct atm_pif *pip; -{ - struct sigpvc *pvp; - struct vccb *vcp, *vnext; - - /* - * Get SigPVC protocol instance - */ - pvp = (struct sigpvc *)pip->pif_siginst; - - /* - * Terminate all of our VCCs - */ - for (vcp = Q_HEAD(pvp->pv_vccq, struct vccb); vcp; vcp = vnext){ - u_char oustate; - - vnext = Q_NEXT(vcp, struct vccb, vc_sigelem); - - /* - * Close VCC and notify owner - */ - oustate = vcp->vc_ustate; - sigpvc_close_vcc(vcp); - if (oustate == VCCU_OPEN) { - vcp->vc_connvc->cvc_attr.cause = sigpvc_cause; - atm_cm_cleared(vcp->vc_connvc); - } - } - - /* - * If there are no vcc's queued, then get rid of the protocol - * instance. - */ - if (Q_HEAD(pvp->pv_vccq, struct vccb) == NULL) { - struct sigmgr *smp = pip->pif_sigmgr; - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - UNLINK((struct siginst *)pvp, struct siginst, smp->sm_prinst, - si_next); - free(pvp, M_DEVBUF); - } else { - - /* - * Otherwise, set new state indicating detach in progress. - * The protocol instance will be freed during sigpvc_free - * processing for the last queued vcc. - */ - pvp->pv_state = SIGPVC_DETACH; - } - - return (0); -} - - -/* - * Open a SigPVC ATM Connection - * - * All service user requests to open a VC connection (via atm_open_connection) - * over an ATM interface attached to the SigPVC signalling manager are handled - * here. Only PVC requests are allowed. - * - * Function will be called at splnet. - * - * Arguments: - * cvp pointer to CM's connection VCC - * errp location to store an error code if CALL_FAILED is returned - * - * Returns: - * CALL_PROCEEDING - connection establishment is in progress - * CALL_FAILED - connection establishment failed - * CALL_CONNECTED - connection has been successfully established - * - */ -static int -sigpvc_setup(cvp, errp) - Atm_connvc *cvp; - int *errp; -{ - struct sigpvc *pvp = - (struct sigpvc *)cvp->cvc_attr.nif->nif_pif->pif_siginst; - int ret; - - /* - * See what signalling has to say - */ - switch (pvp->pv_state) { - - case SIGPVC_ACTIVE: - break; - - default: - *errp = ENXIO; - ret = CALL_FAILED; - goto done; - } - - /* - * Open requested type of connection - */ - switch (cvp->cvc_attr.called.addr.address_format) { - - case T_ATM_PVC_ADDR: - /* - * Create a PVC - */ - ret = sigpvc_create_pvc(pvp, cvp, errp); - break; - - default: - *errp = EPROTONOSUPPORT; - ret = CALL_FAILED; - } - -done: - return (ret); -} - - -/* - * Close a SigPVC ATM Connection - * - * All service user requests to terminate a previously open VC connection - * (via the atm_close_connection function), which is running over an interface - * attached to the SigPVC signalling manager, are handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VC control block - * errp location to store an error code if CALL_FAILED is returned - * - * Returns: - * CALL_PROCEEDING - connection termination is in progress - * CALL_FAILED - connection termination failed - * CALL_CLEARED - connection has been successfully terminated - * - */ -static int -sigpvc_release(vcp, errp) - struct vccb *vcp; - int *errp; -{ - - /* - * Make sure VCC is open - */ - if ((vcp->vc_sstate == VCCS_NULL) || (vcp->vc_sstate == VCCS_FREE) || - (vcp->vc_ustate == VCCU_NULL) || (vcp->vc_ustate == VCCU_CLOSED)) { - *errp = EALREADY; - return (CALL_FAILED); - } - - /* - * Not much else to do except close the vccb - */ - sigpvc_close_vcc(vcp); - - return (CALL_CLEARED); -} - - -/* - * Free SigPVC ATM Connection Resources - * - * All service user requests to free the resources of a closed VCC connection - * (via the atm_free_connection function), which is running over an interface - * attached to the SigPVC signalling manager, are handled here. - * - * Function will be called at splnet. - * - * Arguments: - * vcp pointer to connection's VCC control block - * - * Returns: - * 0 connection free was successful - * errno connection free failed - reason indicated - * - */ -static int -sigpvc_free(vcp) - struct vccb *vcp; -{ - struct atm_pif *pip = vcp->vc_pif; - struct sigpvc *pvp = (struct sigpvc *)pip->pif_siginst; - - /* - * Make sure VCC has been closed - */ - if ((vcp->vc_ustate != VCCU_CLOSED) || (vcp->vc_sstate != VCCS_FREE)) - return (EEXIST); - - /* - * Remove vccb from protocol queue - */ - DEQUEUE(vcp, struct vccb, vc_sigelem, pvp->pv_vccq); - - /* - * Free vccb storage - */ - vcp->vc_ustate = VCCU_NULL; - vcp->vc_sstate = VCCS_NULL; - uma_zfree(sigpvc_vc_zone, vcp); - - /* - * If we're detaching and this was the last vcc queued, - * get rid of the protocol instance - */ - if ((pvp->pv_state == SIGPVC_DETACH) && - (Q_HEAD(pvp->pv_vccq, struct vccb) == NULL)) { - struct sigmgr *smp = pip->pif_sigmgr; - - pip->pif_sigmgr = NULL; - pip->pif_siginst = NULL; - UNLINK((struct siginst *)pvp, struct siginst, smp->sm_prinst, - si_next); - free(pvp, M_DEVBUF); - } - - return (0); -} - - -/* - * Process Signalling Manager PF_ATM ioctls - * - * Function will be called at splnet. - * - * Arguments: - * code PF_ATM sub-operation code - * data pointer to code specific parameter data area - * arg1 pointer to code specific argument - * - * Returns: - * 0 request procesed - * errno error processing request - reason indicated - * - */ -static int -sigpvc_ioctl(code, data, arg1) - int code; - caddr_t data; - caddr_t arg1; -{ - struct atmdelreq *adp; - struct atminfreq *aip; - struct air_vcc_rsp avr; - struct sigpvc *pvp; - struct vccb *vcp; - Atm_connection *cop; - caddr_t cp; - u_int vpi, vci; - int err; - size_t space; - size_t tlen; - - err = 0; - switch (code) { - - case AIOCS_DEL_PVC: - /* - * Delete a PVC - */ - adp = (struct atmdelreq *)data; - pvp = (struct sigpvc *)arg1; - - /* - * Find requested VCC - */ - vpi = adp->adr_pvc_vpi; - vci = adp->adr_pvc_vci; - for (vcp = Q_HEAD(pvp->pv_vccq, struct vccb); vcp; - vcp = Q_NEXT(vcp, struct vccb, vc_sigelem)) { - if ((vcp->vc_vpi == vpi) && (vcp->vc_vci == vci)) - break; - } - if (vcp == NULL) - return (ENOENT); - - /* - * Schedule VCC termination - */ - err = atm_cm_abort(vcp->vc_connvc, &sigpvc_cause.v); - break; - - case AIOCS_DEL_SVC: - /* - * Delete a SVC - */ - err = ENOENT; - break; - - case AIOCS_INF_VCC: - /* - * Get VCC information - */ - aip = (struct atminfreq *)data; - pvp = (struct sigpvc *)arg1; - - cp = aip->air_buf_addr; - space = aip->air_buf_len; - - /* - * Get info for all VCCs on interface - */ - for (vcp = Q_HEAD(pvp->pv_vccq, struct vccb); vcp; - vcp = Q_NEXT(vcp, struct vccb, vc_sigelem)) { - /* - * Make sure there's room in user buffer - */ - if (space < sizeof(avr)) { - err = ENOSPC; - break; - } - - /* - * Fill in info to be returned - */ - (void) snprintf(avr.avp_intf, sizeof(avr.avp_intf), - "%s%d", - pvp->pv_pif->pif_name, pvp->pv_pif->pif_unit); - avr.avp_vpi = vcp->vc_vpi; - avr.avp_vci = vcp->vc_vci; - avr.avp_type = vcp->vc_type; - avr.avp_sig_proto = ATM_SIG_PVC; - avr.avp_aal = vcp->vc_connvc->cvc_attr.aal.type; - cop = vcp->vc_connvc->cvc_conn; - if (cop) - avr.avp_encaps = cop->co_mpx; - else - avr.avp_encaps = 0; - bzero(avr.avp_owners, sizeof(avr.avp_owners)); - for (tlen = 0; cop && tlen < sizeof(avr.avp_owners); - cop = cop->co_next, - tlen += T_ATM_APP_NAME_LEN + 1) { - strncpy(&avr.avp_owners[tlen], - cop->co_endpt->ep_getname(cop->co_toku), - T_ATM_APP_NAME_LEN); - } - avr.avp_state = vcp->vc_sstate; - avr.avp_daddr.address_format = T_ATM_ABSENT; - avr.avp_dsubaddr.address_format = T_ATM_ABSENT; - avr.avp_ipdus = vcp->vc_ipdus; - avr.avp_opdus = vcp->vc_opdus; - avr.avp_ibytes = vcp->vc_ibytes; - avr.avp_obytes = vcp->vc_obytes; - avr.avp_ierrors = vcp->vc_ierrors; - avr.avp_oerrors = vcp->vc_oerrors; - avr.avp_tstamp = vcp->vc_tstamp; - - /* - * Copy data to user buffer and update buffer info - */ - if ((err = copyout((caddr_t)&avr, cp, sizeof(avr))) != 0) - break; - cp += sizeof(avr); - space -= sizeof(avr); - } - - /* - * Update buffer pointer/count - */ - aip->air_buf_addr = cp; - aip->air_buf_len = space; - break; - - case AIOCS_INF_ARP: - case AIOCS_INF_ASV: - /* - * Get ARP table/server information - */ - /* We don't maintain any ARP information */ - break; - - default: - err = EOPNOTSUPP; - } - - return (err); -} - - -#ifdef ATM_SIGPVC_MODULE -/* - ******************************************************************* - * - * Loadable Module Support - * - ******************************************************************* - */ -static int sigpvc_doload(void); -static int sigpvc_dounload(void); - -/* - * Generic module load processing - * - * This function is called by an OS-specific function when this - * module is being loaded. - * - * Arguments: - * none - * - * Returns: - * 0 load was successful - * errno load failed - reason indicated - * - */ -static int -sigpvc_doload() -{ - int err = 0; - - /* - * Start us up - */ - err = sigpvc_start(); - if (err) - /* Problems, clean up */ - (void)sigpvc_stop(); - - return (err); -} - - -/* - * Generic module unload processing - * - * This function is called by an OS-specific function when this - * module is being unloaded. - * - * Arguments: - * none - * - * Returns: - * 0 unload was successful - * errno unload failed - reason indicated - * - */ -static int -sigpvc_dounload() -{ - int err = 0; - - /* - * OK, try to clean up our mess - */ - err = sigpvc_stop(); - - return (err); -} - - - - -#include -#include -#include - -/* - * Loadable miscellaneous module description - */ -MOD_MISC(sigpvc); - - -/* - * Loadable module support "load" entry point - * - * This is the routine called by the lkm driver whenever the - * modload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -sigpvc_load(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(sigpvc_doload()); -} - - -/* - * Loadable module support "unload" entry point - * - * This is the routine called by the lkm driver whenever the - * modunload(1) command is issued for this module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -static int -sigpvc_unload(lkmtp, cmd) - struct lkm_table *lkmtp; - int cmd; -{ - return(sigpvc_dounload()); -} - - -/* - * Loadable module support entry point - * - * This is the routine called by the lkm driver for all loadable module - * functions for this driver. This routine name must be specified - * on the modload(1) command. This routine will be called whenever the - * modload(1), modunload(1) or modstat(1) commands are issued for this - * module. - * - * Arguments: - * lkmtp pointer to lkm drivers's structure - * cmd lkm command code - * ver lkm version - * - * Returns: - * 0 command was successful - * errno command failed - reason indicated - * - */ -int -sigpvc_mod(lkmtp, cmd, ver) - struct lkm_table *lkmtp; - int cmd; - int ver; -{ - MOD_DISPATCH(sigpvc, lkmtp, cmd, ver, - sigpvc_load, sigpvc_unload, lkm_nullcmd); -} - -#else /* !ATM_SIGPVC_MODULE */ - -/* - ******************************************************************* - * - * Kernel Compiled Module Support - * - ******************************************************************* - */ -static void sigpvc_doload(void *); - -SYSINIT(atmsigpvc, SI_SUB_PROTO_END, SI_ORDER_ANY, sigpvc_doload, NULL); - -/* - * Kernel initialization - * - * Arguments: - * arg Not used - * - * Returns: - * none - * - */ -static void -sigpvc_doload(void *arg) -{ - int err = 0; - - /* - * Start us up - */ - err = sigpvc_start(); - if (err) { - /* Problems, clean up */ - (void)sigpvc_stop(); - - log(LOG_ERR, "ATM SIGPVC unable to initialize (%d)!!\n", err); - } - return; -} -#endif /* ATM_SIGPVC_MODULE */ - Property changes on: head/sys/netatm/sigpvc/sigpvc_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/sigpvc/sigpvc_var.h =================================================================== --- head/sys/netatm/sigpvc/sigpvc_var.h (revision 179307) +++ head/sys/netatm/sigpvc/sigpvc_var.h (nonexistent) @@ -1,95 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * PVC-only Signalling Manager - * --------------------------- - * - * Protocol control blocks - * - */ - -#ifndef _SIGPVC_SIGPVC_VAR_H -#define _SIGPVC_SIGPVC_VAR_H - -#ifdef _KERNEL -/* - * Structure containing state information for each SigPVC protocol instance. - * There will be one instance for each ATM device interface using the SigPVC - * signalling manager. - */ -struct sigpvc { - struct siginst pv_inst; /* Common header */ -}; -#define pv_next pv_inst.si_next -#define pv_pif pv_inst.si_pif -#define pv_addr pv_inst.si_addr -#define pv_vccq pv_inst.si_vccq -#define pv_state pv_inst.si_state -#endif /* _KERNEL */ - -/* - * SigPVC Protocol States - */ -#define SIGPVC_ACTIVE 1 /* Active */ -#define SIGPVC_DETACH 2 /* Detach in progress */ - - -#ifdef _KERNEL -/* - * SigPVC Virtual Channel Connection control block. All information regarding - * the state of a SigPVC controlled VCC will be recorded here. There will be - * one SigPVC VCC control block for each SigPVC-controlled VCC. - */ -struct sigpvc_vccb { - struct vccb vcp_hdr; /* Generic vccb */ -}; -#endif /* _KERNEL */ - -/* - * SigPVC VCC Signalling Protocol States - */ -#define VCCS_NULL 0 /* No state */ -#define VCCS_ACTIVE 1 /* Active */ -#define VCCS_FREE 2 /* Waiting for user to free resources */ - - -#ifdef _KERNEL -/* - * Global function declarations - */ - /* sigpvc_if.c */ - - /* sigpvc_subr.c */ -int sigpvc_create_pvc(struct sigpvc *, Atm_connvc *, int *); -void sigpvc_close_vcc(struct vccb *); - -#endif /* _KERNEL */ - -#endif /* _SIGPVC_SIGPVC_VAR_H */ Property changes on: head/sys/netatm/sigpvc/sigpvc_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netatm/sigpvc/sigpvc_subr.c =================================================================== --- head/sys/netatm/sigpvc/sigpvc_subr.c (revision 179307) +++ head/sys/netatm/sigpvc/sigpvc_subr.c (nonexistent) @@ -1,187 +0,0 @@ -/*- - * =================================== - * 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. - */ - -/* - * PVC-only Signalling Manager - * --------------------------- - * - * Subroutines - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -extern uma_zone_t sigpvc_vc_zone; - -/* - * Create a SigPVC Permanent Virtual Channel - * - * This function will construct a vccb for a "sigpvc-controlled" PVC - * and create the service stack requested by the user. - * - * Must be called at splnet. - * - * Arguments: - * pvp pointer to sigpvc protocol instance - * cvp pointer to CM's connection VCC - * errp location to store an error code if CALL_FAILED is returned - * - * Returns: - * CALL_FAILED - pvc creation failed - * CALL_CONNECTED - pvc has been successfully created - * - */ -int -sigpvc_create_pvc(pvp, cvp, errp) - struct sigpvc *pvp; - Atm_connvc *cvp; - int *errp; -{ - Atm_addr_pvc *pp; - struct vccb *vcp; - u_int vpi, vci; - - pp = (Atm_addr_pvc *)cvp->cvc_attr.called.addr.address; - vpi = ATM_PVC_GET_VPI(pp); - vci = ATM_PVC_GET_VCI(pp); - - /* - * Verify requested VPI,VCI - */ - if ((vpi > pvp->pv_pif->pif_maxvpi) || - (vci == 0) || (vci > pvp->pv_pif->pif_maxvci)) { - *errp = ERANGE; - return (CALL_FAILED); - } - - for (vcp = Q_HEAD(pvp->pv_vccq, struct vccb); vcp; - vcp = Q_NEXT(vcp, struct vccb, vc_sigelem)) { - - if ((vcp->vc_vpi == vpi) && - (vcp->vc_vci == vci)) { - *errp = EADDRINUSE; - return (CALL_FAILED); - } - } - - /* - * Verify network interface - */ - if (cvp->cvc_attr.nif) { - if (cvp->cvc_attr.nif->nif_pif != pvp->pv_pif) { - *errp = EINVAL; - return (CALL_FAILED); - } - } - - /* - * Allocate control block for PVC - */ - vcp = uma_zalloc(sigpvc_vc_zone, M_WAITOK | M_ZERO); - if (vcp == NULL) { - *errp = ENOMEM; - return (CALL_FAILED); - } - - /* - * Fill in VCCB - */ - vcp->vc_type = VCC_PVC | VCC_IN | VCC_OUT; - vcp->vc_proto = ATM_SIG_PVC; - vcp->vc_sstate = VCCS_ACTIVE; - vcp->vc_ustate = VCCU_OPEN; - vcp->vc_pif = pvp->pv_pif; - vcp->vc_nif = cvp->cvc_attr.nif; - vcp->vc_vpi = vpi; - vcp->vc_vci = vci; - vcp->vc_connvc = cvp; - - /* - * Put VCCB on sigpvc queue - */ - ENQUEUE(vcp, struct vccb, vc_sigelem, pvp->pv_vccq); - - /* - * Pass back VCCB to connection manager - */ - cvp->cvc_vcc = vcp; - - /* - * PVC is ready to go! - */ - return (CALL_CONNECTED); -} - -/* - * Close a SigPVC VCC - * - * Clean up vccb, note that it's closing and wait for its freeing. - * - * Arguments: - * vcp pointer to connection's VCC control block - * - * Returns: - * none - * - */ -void -sigpvc_close_vcc(vcp) - struct vccb *vcp; -{ - - /* - * Sanity check (actually design-flaw check) - */ - if (vcp->vc_connvc->cvc_upcnt || vcp->vc_connvc->cvc_downcnt) - panic("sigpvc_close_vcc: stack call"); - - /* - * Set state variables - */ - vcp->vc_ustate = VCCU_CLOSED; - vcp->vc_sstate = VCCS_FREE; - - /* - * Wait for user to free resources - */ -} - Property changes on: head/sys/netatm/sigpvc/sigpvc_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/Makefile =================================================================== --- head/sys/Makefile (revision 179307) +++ head/sys/Makefile (revision 179308) @@ -1,44 +1,44 @@ # $FreeBSD$ .include # The boot loader .if ${MK_BOOT} != "no" SUBDIR= boot .endif # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam compat conf contrib crypto ddb dev fs gdb geom \ - gnu i4b isa kern libkern modules net net80211 netatalk netatm \ + gnu i4b isa kern libkern modules net net80211 netatalk \ netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfs4client nfsclient nfsserver opencrypto pccard \ pci rpc security sys ufs vm ${ARCHDIR} ARCHDIR ?= ${MACHINE} # Loadable kernel modules .if defined(MODULES_WITH_WORLD) SUBDIR+=modules .endif HTAGSFLAGS+= -at `awk -F= '/^RELEASE *=/{release=$2}; END {print "FreeBSD", release, "kernel"}' < conf/newvers.sh` # You need the devel/cscope port for this. cscope: cscope.out cscope.out: ${.CURDIR}/cscope.files cd ${.CURDIR}; cscope -k -buq -p4 ${.CURDIR}/cscope.files: .PHONY cd ${.CURDIR}; \ find ${CSCOPEDIRS} -name "*.[chSs]" -a -type f > ${.TARGET} cscope-clean: rm -f cscope.files cscope.out cscope.in.out cscope.po.out # You need the devel/global and one of editor/emacs* ports for that. TAGS ${.CURDIR}/TAGS: ${.CURDIR}/cscope.files rm -f ${.CURDIR}/TAGS cd ${.CURDIR}; xargs etags -a < ${.CURDIR}/cscope.files .include Index: head/sys/conf/NOTES =================================================================== --- head/sys/conf/NOTES (revision 179307) +++ head/sys/conf/NOTES (revision 179308) @@ -1,2729 +1,2697 @@ # $FreeBSD$ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # # Lines that begin with 'device', 'options', 'machine', 'ident', 'maxusers', # 'makeoptions', 'hints', etc. go into the kernel configuration that you # run config(8) with. # # Lines that begin with 'hint.' are NOT for config(8), they go into your # hints file. See /boot/device.hints and/or the 'hints' config(8) directive. # # Please use ``make LINT'' to create an old-style LINT file if you want to # do kernel test-builds. # # This file contains machine independent kernel configuration notes. For # machine dependent notes, look in /sys//conf/NOTES. # # # NOTES conventions and style guide: # # Large block comments should begin and end with a line containing only a # comment character. # # To describe a particular object, a block comment (if it exists) should # come first. Next should come device, options, and hints lines in that # order. All device and option lines must be described by a comment that # doesn't just expand the device or option name. Use only a concise # comment on the same line if possible. Very detailed descriptions of # devices and subsystems belong in man pages. # # A space followed by a tab separates 'options' from an option name. Two # spaces followed by a tab separate 'device' from a device name. Comments # after an option or device should use one space after the comment character. # To comment out a negative option that disables code and thus should not be # enabled for LINT builds, precede 'options' with "#!". # # # This is the ``identification'' of the kernel. Usually this should # be the same as the name of your kernel. # ident LINT # # The `maxusers' parameter controls the static sizing of a number of # internal system tables by a formula defined in subr_param.c. # Omitting this parameter or setting it to 0 will cause the system to # auto-size based on physical memory. # maxusers 10 # # The `makeoptions' parameter allows variables to be passed to the # generated Makefile in the build area. # # CONF_CFLAGS gives some extra compiler flags that are added to ${CFLAGS} # after most other flags. Here we use it to inhibit use of non-optimal # gcc built-in functions (e.g., memcmp). # # DEBUG happens to be magic. # The following is equivalent to 'config -g KERNELNAME' and creates # 'kernel.debug' compiled with -g debugging as well as a normal # 'kernel'. Use 'make install.debug' to install the debug kernel # but that isn't normally necessary as the debug symbols are not loaded # by the kernel and are not useful there anyway. # # KERNEL can be overridden so that you can change the default name of your # kernel. # # MODULES_OVERRIDE can be used to limit modules built to a specific list. # makeoptions CONF_CFLAGS=-fno-builtin #Don't allow use of memcmp, etc. #makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols #makeoptions KERNEL=foo #Build kernel "foo" and install "/foo" # Only build ext2fs module plus those parts of the sound system I need. #makeoptions MODULES_OVERRIDE="ext2fs sound/sound sound/driver/maestro3" makeoptions DESTDIR=/tmp # # FreeBSD processes are subject to certain limits to their consumption # of system resources. See getrlimit(2) for more details. Each # resource limit has two values, a "soft" limit and a "hard" limit. # The soft limits can be modified during normal system operation, but # the hard limits are set at boot time. Their default values are # in sys//include/vmparam.h. There are two ways to change them: # # 1. Set the values at kernel build time. The options below are one # way to allow that limit to grow to 1GB. They can be increased # further by changing the parameters: # # 2. In /boot/loader.conf, set the tunables kern.maxswzone, # kern.maxbcache, kern.maxtsiz, kern.dfldsiz, kern.maxdsiz, # kern.dflssiz, kern.maxssiz and kern.sgrowsiz. # # The options in /boot/loader.conf override anything in the kernel # configuration file. See the function init_param1 in # sys/kern/subr_param.c for more details. # options MAXDSIZ=(1024UL*1024*1024) options MAXSSIZ=(128UL*1024*1024) options DFLDSIZ=(1024UL*1024*1024) # # BLKDEV_IOSIZE sets the default block size used in user block # device I/O. Note that this value will be overridden by the label # when specifying a block device from a label with a non-0 # partition blocksize. The default is PAGE_SIZE. # options BLKDEV_IOSIZE=8192 # # MAXPHYS and DFLTPHYS # # These are the max and default 'raw' I/O block device access sizes. # Reads and writes will be split into DFLTPHYS chunks. Some applications # have better performance with larger raw I/O access sizes. Typically # MAXPHYS should be twice the size of DFLTPHYS. Note that certain VM # parameters are derived from these values and making them too large # can make an an unbootable kernel. # # The defaults are 64K and 128K respectively. options DFLTPHYS=(64*1024) options MAXPHYS=(128*1024) # This allows you to actually store this configuration file into # the kernel binary itself. See config(8) for more details. # options INCLUDE_CONFIG_FILE # Include this file in kernel options GEOM_AES # Don't use, use GEOM_BDE options GEOM_BDE # Disk encryption. options GEOM_BSD # BSD disklabels options GEOM_CACHE # Disk cache. options GEOM_CONCAT # Disk concatenation. options GEOM_ELI # Disk encryption. options GEOM_FOX # Redundant path mitigation options GEOM_GATE # Userland services. options GEOM_JOURNAL # Journaling. options GEOM_LABEL # Providers labelization. options GEOM_LINUX_LVM # Linux LVM2 volumes options GEOM_MBR # DOS/MBR partitioning options GEOM_MIRROR # Disk mirroring. options GEOM_MULTIPATH # Disk multipath options GEOM_NOP # Test class. options GEOM_PART_APM # Apple partitioning options GEOM_PART_BSD # BSD disklabel options GEOM_PART_GPT # GPT partitioning options GEOM_PART_MBR # MBR partitioning options GEOM_PART_PC98 # PC-9800 disk partitioning options GEOM_PART_VTOC8 # SMI VTOC8 disk label options GEOM_PC98 # NEC PC9800 partitioning options GEOM_RAID3 # RAID3 functionality. options GEOM_SHSEC # Shared secret. options GEOM_STRIPE # Disk striping. options GEOM_SUNLABEL # Sun/Solaris partitioning options GEOM_UZIP # Read-only compressed disks options GEOM_VIRSTOR # Virtual storage. options GEOM_VOL # Volume names from UFS superblock options GEOM_ZERO # Performance testing helper. # # The root device and filesystem type can be compiled in; # this provides a fallback option if the root device cannot # be correctly guessed by the bootstrap code, or an override if # the RB_DFLTROOT flag (-r) is specified when booting the kernel. # options ROOTDEVNAME=\"ufs:da0s2e\" ##################################################################### # Scheduler options: # # Specifying one of SCHED_4BSD or SCHED_ULE is mandatory. These options # select which scheduler is compiled in. # # SCHED_4BSD is the historical, proven, BSD scheduler. It has a global run # queue and no CPU affinity which makes it suboptimal for SMP. It has very # good interactivity and priority selection. # # SCHED_ULE provides significant performance advantages over 4BSD on many # workloads on SMP machines. It supports cpu-affinity, per-cpu runqueues # and scheduler locks. It also has a stronger notion of interactivity # which leads to better responsiveness even on uniprocessor machines. This # will eventually become the default scheduler. # # SCHED_STATS is a debugging option which keeps some stats in the sysctl # tree at 'kern.sched.stats' and is useful for debugging scheduling decisions. # options SCHED_4BSD options SCHED_STATS #options SCHED_ULE ##################################################################### # SMP OPTIONS: # # SMP enables building of a Symmetric MultiProcessor Kernel. # Mandatory: options SMP # Symmetric MultiProcessor Kernel # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin # if the thread that currently owns the mutex is executing on another # CPU. This behaviour is enabled by default, so this option can be used # to disable it. options NO_ADAPTIVE_MUTEXES # ADAPTIVE_RWLOCKS changes the behavior of reader/writer locks to spin # if the thread that currently owns the rwlock is executing on another # CPU. This behaviour is enabled by default, so this option can be used # to disable it. options NO_ADAPTIVE_RWLOCKS # ADAPTIVE_SX changes the behavior of sx locks to spin if the thread # that currently owns the lock is executing on another CPU. Note that # in addition to enabling this option, individual sx locks must be # initialized with the SX_ADAPTIVESPIN flag. options ADAPTIVE_SX # MUTEX_NOINLINE forces mutex operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is # already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, # and WITNESS options. options MUTEX_NOINLINE # RWLOCK_NOINLINE forces rwlock operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is # already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, # and WITNESS options. options RWLOCK_NOINLINE # SX_NOINLINE forces sx lock operations to call functions to perform each # operation rather than inlining the simple cases. This can be used to # shrink the size of the kernel text segment. Note that this behavior is # already implied by the INVARIANT_SUPPORT, INVARIANTS, KTR, LOCK_PROFILING, # and WITNESS options. options SX_NOINLINE # SMP Debugging Options: # # PREEMPTION allows the threads that are in the kernel to be preempted # by higher priority threads. It helps with interactivity and # allows interrupt threads to run sooner rather than waiting. # WARNING! Only tested on amd64 and i386. # FULL_PREEMPTION instructs the kernel to preempt non-realtime kernel # threads. Its sole use is to expose race conditions and other # bugs during development. Enabling this option will reduce # performance and increase the frequency of kernel panics by # design. If you aren't sure that you need it then you don't. # Relies on the PREEMPTION option. DON'T TURN THIS ON. # MUTEX_DEBUG enables various extra assertions in the mutex code. # SLEEPQUEUE_PROFILING enables rudimentary profiling of the hash table # used to hold active sleep queues as well as sleep wait message # frequency. # TURNSTILE_PROFILING enables rudimentary profiling of the hash table # used to hold active lock queues. # WITNESS enables the witness code which detects deadlocks and cycles # during locking operations. # WITNESS_KDB causes the witness code to drop into the kernel debugger if # a lock hierarchy violation occurs or if locks are held when going to # sleep. # WITNESS_SKIPSPIN disables the witness checks on spin mutexes. options PREEMPTION options FULL_PREEMPTION options MUTEX_DEBUG options WITNESS options WITNESS_KDB options WITNESS_SKIPSPIN # LOCK_PROFILING - Profiling locks. See LOCK_PROFILING(9) for details. options LOCK_PROFILING # Set the number of buffers and the hash size. The hash size MUST be larger # than the number of buffers. Hash size should be prime. options MPROF_BUFFERS="1536" options MPROF_HASH_SIZE="1543" # Profiling for internal hash tables. options SLEEPQUEUE_PROFILING options TURNSTILE_PROFILING ##################################################################### # COMPATIBILITY OPTIONS # # Implement system calls compatible with 4.3BSD and older versions of # FreeBSD. You probably do NOT want to remove this as much current code # still relies on the 4.3 emulation. Note that some architectures that # are supported by FreeBSD do not include support for certain important # aspects of this compatibility option, namely those related to the # signal delivery mechanism. # options COMPAT_43 # Old tty interface. options COMPAT_43TTY # Enable FreeBSD4 compatibility syscalls options COMPAT_FREEBSD4 # Enable FreeBSD5 compatibility syscalls options COMPAT_FREEBSD5 # Enable FreeBSD6 compatibility syscalls options COMPAT_FREEBSD6 # Enable FreeBSD7 compatibility syscalls options COMPAT_FREEBSD7 # # These three options provide support for System V Interface # Definition-style interprocess communication, in the form of shared # memory, semaphores, and message queues, respectively. # options SYSVSHM options SYSVSEM options SYSVMSG ##################################################################### # DEBUGGING OPTIONS # # Compile with kernel debugger related code. # options KDB # # Print a stack trace of the current thread on the console for a panic. # options KDB_TRACE # # Don't enter the debugger for a panic. Intended for unattended operation # where you may want to enter the debugger from the console, but still want # the machine to recover from a panic. # options KDB_UNATTENDED # # Enable the ddb debugger backend. # options DDB # # Print the numerical value of symbols in addition to the symbolic # representation. # options DDB_NUMSYM # # Enable the remote gdb debugger backend. # options GDB # # Enable the kernel DTrace hooks which are required to load the DTrace # kernel modules. # options KDTRACE_HOOKS # # SYSCTL_DEBUG enables a 'sysctl' debug tree that can be used to dump the # contents of the registered sysctl nodes on the console. It is disabled by # default because it generates excessively verbose console output that can # interfere with serial console operation. # options SYSCTL_DEBUG # # DEBUG_MEMGUARD builds and enables memguard(9), a replacement allocator # for the kernel used to detect modify-after-free scenarios. See the # memguard(9) man page for more information on usage. # options DEBUG_MEMGUARD # # DEBUG_REDZONE enables buffer underflows and buffer overflows detection for # malloc(9). # options DEBUG_REDZONE # # KTRACE enables the system-call tracing facility ktrace(2). To be more # SMP-friendly, KTRACE uses a worker thread to process most trace events # asynchronously to the thread generating the event. This requires a # pre-allocated store of objects representing trace events. The # KTRACE_REQUEST_POOL option specifies the initial size of this store. # The size of the pool can be adjusted both at boottime and runtime via # the kern.ktrace_request_pool tunable and sysctl. # options KTRACE #kernel tracing options KTRACE_REQUEST_POOL=101 # # KTR is a kernel tracing mechanism imported from BSD/OS. Currently # it has no userland interface aside from a few sysctl's. It is # enabled with the KTR option. KTR_ENTRIES defines the number of # entries in the circular trace buffer; it must be a power of two. # KTR_COMPILE defines the mask of events to compile into the kernel as # defined by the KTR_* constants in . KTR_MASK defines the # initial value of the ktr_mask variable which determines at runtime # what events to trace. KTR_CPUMASK determines which CPU's log # events, with bit X corresponding to CPU X. KTR_VERBOSE enables # dumping of KTR events to the console by default. This functionality # can be toggled via the debug.ktr_verbose sysctl and defaults to off # if KTR_VERBOSE is not defined. # options KTR options KTR_ENTRIES=1024 options KTR_COMPILE=(KTR_INTR|KTR_PROC) options KTR_MASK=KTR_INTR options KTR_CPUMASK=0x3 options KTR_VERBOSE # # ALQ(9) is a facility for the asynchronous queuing of records from the kernel # to a vnode, and is employed by services such as KTR(4) to produce trace # files based on a kernel event stream. Records are written asynchronously # in a worker thread. # options ALQ options KTR_ALQ # # The INVARIANTS option is used in a number of source files to enable # extra sanity checking of internal structures. This support is not # enabled by default because of the extra time it would take to check # for these conditions, which can only occur as a result of # programming errors. # options INVARIANTS # # The INVARIANT_SUPPORT option makes us compile in support for # verifying some of the internal structures. It is a prerequisite for # 'INVARIANTS', as enabling 'INVARIANTS' will make these functions be # called. The intent is that you can set 'INVARIANTS' for single # source files (by changing the source file or specifying it on the # command line) if you have 'INVARIANT_SUPPORT' enabled. Also, if you # wish to build a kernel module with 'INVARIANTS', then adding # 'INVARIANT_SUPPORT' to your kernel will provide all the necessary # infrastructure without the added overhead. # options INVARIANT_SUPPORT # # The DIAGNOSTIC option is used to enable extra debugging information # from some parts of the kernel. As this makes everything more noisy, # it is disabled by default. # options DIAGNOSTIC # # REGRESSION causes optional kernel interfaces necessary only for regression # testing to be enabled. These interfaces may constitute security risks # when enabled, as they permit processes to easily modify aspects of the # run-time environment to reproduce unlikely or unusual (possibly normally # impossible) scenarios. # options REGRESSION # # RESTARTABLE_PANICS allows one to continue from a panic as if it were # a call to the debugger to continue from a panic as instead. It is only # useful if a kernel debugger is present. To restart from a panic, reset # the panicstr variable to NULL and continue execution. This option is # for development use only and should NOT be used in production systems # to "workaround" a panic. # #options RESTARTABLE_PANICS # # This option let some drivers co-exist that can't co-exist in a running # system. This is used to be able to compile all kernel code in one go for # quality assurance purposes (like this file, which the option takes it name # from.) # options COMPILING_LINT # # STACK enables the stack(9) facility, allowing the capture of kernel stack # for the purpose of procinfo(1), etc. stack(9) will also be compiled in # automatically if DDB(4) is compiled into the kernel. # options STACK ##################################################################### # PERFORMANCE MONITORING OPTIONS # # The hwpmc driver that allows the use of in-CPU performance monitoring # counters for performance monitoring. The base kernel needs to configured # with the 'options' line, while the hwpmc device can be either compiled # in or loaded as a loadable kernel module. # # Additional configuration options may be required on specific architectures, # please see hwpmc(4). device hwpmc # Driver (also a loadable module) options HWPMC_HOOKS # Other necessary kernel hooks ##################################################################### # NETWORKING OPTIONS # # Protocol families # options INET #Internet communications protocols options INET6 #IPv6 communications protocols options ROUTETABLES=2 # max 16. 1 is back compatible. # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration options IPSEC #IP security (requires device crypto) #options IPSEC_DEBUG #debug for IP security # # Set IPSEC_FILTERTUNNEL to force packets coming through a tunnel # to be processed by any configured packet filtering twice. # The default is that packets coming out of a tunnel are _not_ processed; # they are assumed trusted. # # IPSEC history is preserved for such packets, and can be filtered # using ipfw(8)'s 'ipsec' keyword, when this option is enabled. # #options IPSEC_FILTERTUNNEL #filter ipsec packets from a tunnel options IPX #IPX/SPX communications protocols options NCP #NetWare Core protocol options NETATALK #Appletalk communications protocols options NETATALKDEBUG #Appletalk debugging # # SMB/CIFS requester # NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV # options. options NETSMB #SMB/CIFS requester # mchain library. It can be either loaded as KLD or compiled into kernel options LIBMCHAIN # libalias library, performing NAT options LIBALIAS # # SCTP is a NEW transport protocol defined by # RFC2960 updated by RFC3309 and RFC3758.. and # soon to have a new base RFC and many many more # extensions. This release supports all the extensions # including many drafts (most about to become RFC's). # It is the premeier SCTP implementation in the NET # and is quite well tested. # # Note YOU MUST have both INET and INET6 defined. # you don't have to enable V6, but SCTP is # dual stacked and so far we have not teased apart # the V6 and V4.. since an association can span # both a V6 and V4 address at the SAME time :-) # options SCTP # There are bunches of options: # this one turns on all sorts of # nastly printing that you can # do. Its all controled by a # bit mask (settable by socket opt and # by sysctl). Including will not cause # logging until you set the bits.. but it # can be quite verbose.. so without this # option we don't do any of the tests for # bits and prints.. which makes the code run # faster.. if you are not debugging don't use. options SCTP_DEBUG # # This option turns off the CRC32c checksum. Basically # You will not be able to talk to anyone else that # has not done this. Its more for expermentation to # see how much CPU the CRC32c really takes. Most new # cards for TCP support checksum offload.. so this # option gives you a "view" into what SCTP would be # like with such an offload (which only exists in # high in iSCSI boards so far). With the new # splitting 8's algorithm its not as bad as it used # to be.. but it does speed things up try only # for in a captured lab environment :-) options SCTP_WITH_NO_CSUM # # # All that options after that turn on specific types of # logging. You can monitor CWND growth, flight size # and all sorts of things. Go look at the code and # see. I have used this to produce interesting # charts and graphs as well :-> # # I have not yet commited the tools to get and print # the logs, I will do that eventually .. before then # if you want them send me an email rrs@freebsd.org # You basically must have KTR enabled for these # and you then set the sysctl to turn on/off various # logging bits. Use ktrdump to pull the log and run # it through a dispaly program.. and graphs and other # things too. # options SCTP_LOCK_LOGGING options SCTP_MBUF_LOGGING options SCTP_MBCNT_LOGGING options SCTP_PACKET_LOGGING options SCTP_LTRACE_CHUNKS options SCTP_LTRACE_ERRORS # altq(9). Enable the base part of the hooks with the ALTQ option. # Individual disciplines must be built into the base system and can not be # loaded as modules at this point. ALTQ requires a stable TSC so if yours is # broken or changes with CPU throttling then you must also have the ALTQ_NOPCC # option. options ALTQ options ALTQ_CBQ # Class Based Queueing options ALTQ_RED # Random Early Detection options ALTQ_RIO # RED In/Out options ALTQ_HFSC # Hierarchical Packet Scheduler options ALTQ_CDNR # Traffic conditioner options ALTQ_PRIQ # Priority Queueing options ALTQ_NOPCC # Required if the TSC is unusable options ALTQ_DEBUG # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option # listed below; however, this is not strictly necessary as netgraph # will automatically load the corresponding KLD module if the node type # is not already compiled into the kernel. Each type below has a # corresponding man page, e.g., ng_async(8). options NETGRAPH # netgraph(4) system options NETGRAPH_DEBUG # enable extra debugging, this # affects netgraph(4) and nodes # Node types options NETGRAPH_ASYNC options NETGRAPH_ATMLLC options NETGRAPH_ATM_ATMPIF options NETGRAPH_BLUETOOTH # ng_bluetooth(4) options NETGRAPH_BLUETOOTH_BT3C # ng_bt3c(4) options NETGRAPH_BLUETOOTH_H4 # ng_h4(4) options NETGRAPH_BLUETOOTH_HCI # ng_hci(4) options NETGRAPH_BLUETOOTH_L2CAP # ng_l2cap(4) options NETGRAPH_BLUETOOTH_SOCKET # ng_btsocket(4) options NETGRAPH_BLUETOOTH_UBT # ng_ubt(4) options NETGRAPH_BLUETOOTH_UBTBCMFW # ubtbcmfw(4) options NETGRAPH_BPF options NETGRAPH_BRIDGE options NETGRAPH_CAR options NETGRAPH_CISCO options NETGRAPH_DEFLATE options NETGRAPH_DEVICE options NETGRAPH_ECHO options NETGRAPH_EIFACE options NETGRAPH_ETHER options NETGRAPH_FEC options NETGRAPH_FRAME_RELAY options NETGRAPH_GIF options NETGRAPH_GIF_DEMUX options NETGRAPH_HOLE options NETGRAPH_IFACE options NETGRAPH_IP_INPUT options NETGRAPH_IPFW options NETGRAPH_KSOCKET options NETGRAPH_L2TP options NETGRAPH_LMI # MPPC compression requires proprietary files (not included) #options NETGRAPH_MPPC_COMPRESSION options NETGRAPH_MPPC_ENCRYPTION options NETGRAPH_NETFLOW options NETGRAPH_NAT options NETGRAPH_ONE2MANY options NETGRAPH_PPP options NETGRAPH_PPPOE options NETGRAPH_PPTPGRE options NETGRAPH_PRED1 options NETGRAPH_RFC1490 options NETGRAPH_SOCKET options NETGRAPH_SPLIT options NETGRAPH_SPPP options NETGRAPH_TAG options NETGRAPH_TCPMSS options NETGRAPH_TEE options NETGRAPH_TTY options NETGRAPH_UI options NETGRAPH_VJC # NgATM - Netgraph ATM options NGATM_ATM options NGATM_ATMBASE options NGATM_SSCOP options NGATM_SSCFU options NGATM_UNI options NGATM_CCATM device mn # Munich32x/Falc54 Nx64kbit/sec cards. # # Network interfaces: # The `loop' device is MANDATORY when networking is enabled. # The `ether' device provides generic code to handle # Ethernets; it is MANDATORY when an Ethernet device driver is # configured or token-ring is enabled. # The `vlan' device implements the VLAN tagging of Ethernet frames # according to IEEE 802.1Q. It requires `device miibus'. # The `wlan' device provides generic code to support 802.11 # drivers, including host AP mode; it is MANDATORY for the wi, # and ath drivers and will eventually be required by all 802.11 drivers. # The `wlan_wep', `wlan_tkip', and `wlan_ccmp' devices provide # support for WEP, TKIP, and AES-CCMP crypto protocols optionally # used with 802.11 devices that depend on the `wlan' module. # The `wlan_xauth' device provides support for external (i.e. user-mode) # authenticators for use with 802.11 drivers that use the `wlan' # module and support 802.1x and/or WPA security protocols. # The `wlan_acl' device provides a MAC-based access control mechanism # for use with 802.11 drivers operating in ap mode and using the # `wlan' module. # The `fddi' device provides generic code to support FDDI. # The `arcnet' device provides generic code to support Arcnet. # The `sppp' device serves a similar role for certain types # of synchronous PPP links (like `cx', `ar'). # The `sl' device implements the Serial Line IP (SLIP) service. # The `ppp' device implements the Point-to-Point Protocol. # The `bpf' device enables the Berkeley Packet Filter. Be # aware of the legal and administrative consequences of enabling this # option. The number of devices determines the maximum number of # simultaneous BPF clients programs runnable. DHCP requires bpf. # The `disc' device implements a minimal network interface, # which throws away all packets sent and never receives any. It is # included for testing and benchmarking purposes. # The `edsc' device implements a minimal Ethernet interface, # which discards all packets sent and receives none. # The `tap' device is a pty-like virtual Ethernet interface # The `tun' device implements (user-)ppp and nos-tun # The `gif' device implements IPv6 over IP4 tunneling, # IPv4 over IPv6 tunneling, IPv4 over IPv4 tunneling and # IPv6 over IPv6 tunneling. # The `gre' device implements two types of IP4 over IP4 tunneling: # GRE and MOBILE, as specified in the RFC1701 and RFC2004. # The XBONEHACK option allows the same pair of addresses to be configured on # multiple gif interfaces. # The `faith' device captures packets sent to it and diverts them # to the IPv4/IPv6 translation daemon. # The `stf' device implements 6to4 encapsulation. # The `ef' device provides support for multiple ethernet frame types # specified via ETHER_* options. See ef(4) for details. # # The pf packet filter consists of three devices: # The `pf' device provides /dev/pf and the firewall code itself. # The `pflog' device provides the pflog0 interface which logs packets. # The `pfsync' device provides the pfsync0 interface used for # synchronization of firewall state tables (over the net). # # The PPP_BSDCOMP option enables support for compress(1) style entire # packet compression, the PPP_DEFLATE is for zlib/gzip style compression. # PPP_FILTER enables code for filtering the ppp data stream and selecting # events for resetting the demand dial activity timer - requires bpf. # See pppd(8) for more details. # device ether #Generic Ethernet device vlan #VLAN support (needs miibus) device wlan #802.11 support options IEEE80211_DEBUG #enable debugging msgs options IEEE80211_AMPDU_AGE #age frames in AMPDU reorder q's device wlan_wep #802.11 WEP support device wlan_ccmp #802.11 CCMP support device wlan_tkip #802.11 TKIP support device wlan_xauth #802.11 external authenticator support device wlan_acl #802.11 MAC ACL support device wlan_amrr #AMRR transmit rate control algorithm device token #Generic TokenRing device fddi #Generic FDDI device arcnet #Generic Arcnet device sppp #Generic Synchronous PPP device loop #Network loopback device device bpf #Berkeley packet filter device disc #Discard device based on loopback device edsc #Ethernet discard device device tap #Virtual Ethernet driver device tun #Tunnel driver (ppp(8), nos-tun(8)) device sl #Serial Line IP device gre #IP over IP tunneling device if_bridge #Bridge interface device pf #PF OpenBSD packet-filter firewall device pflog #logging support interface for PF device pfsync #synchronization interface for PF device carp #Common Address Redundancy Protocol device enc #IPsec interface device ppp #Point-to-point protocol options PPP_BSDCOMP #PPP BSD-compress support options PPP_DEFLATE #PPP zlib/deflate/gzip support options PPP_FILTER #enable bpf filtering (needs bpf) device lagg #Link aggregation interface device ef # Multiple ethernet frames support options ETHER_II # enable Ethernet_II frame options ETHER_8023 # enable Ethernet_802.3 (Novell) frame options ETHER_8022 # enable Ethernet_802.2 frame options ETHER_SNAP # enable Ethernet_802.2/SNAP frame # for IPv6 device gif #IPv6 and IPv4 tunneling options XBONEHACK device faith #for IPv6 and IPv4 translation device stf #6to4 IPv6 over IPv4 encapsulation # # Internet family options: # # MROUTING enables the kernel multicast packet forwarder, which works # with mrouted and XORP. # # IPFIREWALL enables support for IP firewall construction, in # conjunction with the `ipfw' program. IPFIREWALL_VERBOSE sends # logged packets to the system logger. IPFIREWALL_VERBOSE_LIMIT # limits the number of times a matching entry can be logged. # # WARNING: IPFIREWALL defaults to a policy of "deny ip from any to any" # and if you do not add other rules during startup to allow access, # YOU WILL LOCK YOURSELF OUT. It is suggested that you set firewall_type=open # in /etc/rc.conf when first enabling this feature, then refining the # firewall rules in /etc/rc.firewall after you've tested that the new kernel # feature works properly. # # IPFIREWALL_DEFAULT_TO_ACCEPT causes the default rule (at boot) to # allow everything. Use with care, if a cracker can crash your # firewall machine, they can get to your protected machines. However, # if you are using it as an as-needed filter for specific problems as # they arise, then this may be for you. Changing the default to 'allow' # means that you won't get stuck if the kernel and /sbin/ipfw binary get # out of sync. # # IPDIVERT enables the divert IP sockets, used by ``ipfw divert''. It # depends on IPFIREWALL if compiled into the kernel. # # IPFIREWALL_FORWARD enables changing of the packet destination either # to do some sort of policy routing or transparent proxying. Used by # ``ipfw forward''. All redirections apply to locally generated # packets too. Because of this great care is required when # crafting the ruleset. # # IPFIREWALL_NAT adds support for in kernel nat in ipfw, and it requires # LIBALIAS. # # IPSTEALTH enables code to support stealth forwarding (i.e., forwarding # packets without touching the TTL). This can be useful to hide firewalls # from traceroute and similar tools. # # TCPDEBUG enables code which keeps traces of the TCP state machine # for sockets with the SO_DEBUG option set, which can then be examined # using the trpt(8) utility. # options MROUTING # Multicast routing options IPFIREWALL #firewall options IPFIREWALL_VERBOSE #enable logging to syslogd(8) options IPFIREWALL_VERBOSE_LIMIT=100 #limit verbosity options IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default options IPFIREWALL_FORWARD #packet destination changes options IPFIREWALL_NAT #ipfw kernel nat support options IPDIVERT #divert sockets options IPFILTER #ipfilter support options IPFILTER_LOG #ipfilter logging options IPFILTER_LOOKUP #ipfilter pools options IPFILTER_DEFAULT_BLOCK #block all packets by default options IPSTEALTH #support for stealth forwarding options TCPDEBUG # The MBUF_STRESS_TEST option enables options which create # various random failures / extreme cases related to mbuf # functions. See mbuf(9) for a list of available test cases. # MBUF_PROFILING enables code to profile the mbuf chains # exiting the system (via participating interfaces) and # return a logarithmic histogram of monitored parameters # (e.g. packet size, wasted space, number of mbufs in chain). options MBUF_STRESS_TEST options MBUF_PROFILING # Statically Link in accept filters options ACCEPT_FILTER_DATA options ACCEPT_FILTER_HTTP # TCP_SIGNATURE adds support for RFC 2385 (TCP-MD5) digests. These are # carried in TCP option 19. This option is commonly used to protect # TCP sessions (e.g. BGP) where IPSEC is not available nor desirable. # This is enabled on a per-socket basis using the TCP_MD5SIG socket option. # This requires the use of 'device crypto', 'options IPSEC' # or 'device cryptodev'. #options TCP_SIGNATURE #include support for RFC 2385 # DUMMYNET enables the "dummynet" bandwidth limiter. You need IPFIREWALL # as well. See dummynet(4) and ipfw(8) for more info. When you run # DUMMYNET it is advisable to also have at least "options HZ=1000" to achieve # a smooth scheduling of the traffic. options DUMMYNET # Zero copy sockets support. This enables "zero copy" for sending and # receiving data via a socket. The send side works for any type of NIC, # the receive side only works for NICs that support MTUs greater than the # page size of your architecture and that support header splitting. See # zero_copy(9) for more details. options ZERO_COPY_SOCKETS -# -# ATM (HARP version) options -# -# XXX: These have been disabled in FreeBSD 7.0 as they are not MPSAFE. -# -# ATM_CORE includes the base ATM functionality code. This must be included -# for ATM support. -# -# ATM_IP includes support for running IP over ATM. -# -# At least one (and usually only one) of the following signalling managers -# must be included (note that all signalling managers include PVC support): -# ATM_SIGPVC includes support for the PVC-only signalling manager `sigpvc'. -# ATM_SPANS includes support for the `spans' signalling manager, which runs -# the FORE Systems's proprietary SPANS signalling protocol. -# ATM_UNI includes support for the `uni30' and `uni31' signalling managers, -# which run the ATM Forum UNI 3.x signalling protocols. -# -# The `hfa' driver provides support for the FORE Systems, Inc. -# PCA-200E ATM PCI Adapter. -# -# The `harp' pseudo-driver makes all NATM interface drivers available to HARP. -# -#options ATM_CORE #core ATM protocol family -#options ATM_IP #IP over ATM support -#options ATM_SIGPVC #SIGPVC signalling manager -#options ATM_SPANS #SPANS signalling manager -#options ATM_UNI #UNI signalling manager - -#device hfa #FORE PCA-200E ATM PCI -#device harp #Pseudo-interface for NATM - ##################################################################### # FILESYSTEM OPTIONS # # Only the root, /usr, and /tmp filesystems need be statically # compiled; everything else will be automatically loaded at mount # time. (Exception: the UFS family--- FFS --- cannot # currently be demand-loaded.) Some people still prefer to statically # compile other filesystems as well. # # NB: The PORTAL filesystem is known to be buggy, and WILL panic your # system if you attempt to do anything with it. It is included here # as an incentive for some enterprising soul to sit down and fix it. # The UNION filesystem was known to be buggy in the past. It is now # being actively maintained, although there are still some issues being # resolved. # # One of these is mandatory: options FFS #Fast filesystem options NFSCLIENT #Network File System client # The rest are optional: options CD9660 #ISO 9660 filesystem options FDESCFS #File descriptor filesystem options HPFS #OS/2 File system options MSDOSFS #MS DOS File System (FAT, FAT32) options NFSSERVER #Network File System server options NFSLOCKD #Network Lock Manager options NTFS #NT File System options NULLFS #NULL filesystem # Broken (depends on NCP): #options NWFS #NetWare filesystem options PORTALFS #Portal filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework options PSEUDOFS_TRACE #Debugging support for PSEUDOFS options SMBFS #SMB/CIFS filesystem options UDF #Universal Disk Format options UNIONFS #Union filesystem # The xFS_ROOT options REQUIRE the associated ``options xFS'' options NFS_ROOT #NFS usable as root device # Soft updates is a technique for improving filesystem speed and # making abrupt shutdown less risky. # options SOFTUPDATES # Extended attributes allow additional data to be associated with files, # and is used for ACLs, Capabilities, and MAC labels. # See src/sys/ufs/ufs/README.extattr for more information. options UFS_EXTATTR options UFS_EXTATTR_AUTOSTART # Access Control List support for UFS filesystems. The current ACL # implementation requires extended attribute support, UFS_EXTATTR, # for the underlying filesystem. # See src/sys/ufs/ufs/README.acls for more information. options UFS_ACL # Directory hashing improves the speed of operations on very large # directories at the expense of some memory. options UFS_DIRHASH # Gjournal-based UFS journaling support. options UFS_GJOURNAL # Make space in the kernel for a root filesystem on a md device. # Define to the number of kilobytes to reserve for the filesystem. options MD_ROOT_SIZE=10 # Make the md device a potential root device, either with preloaded # images of type mfs_root or md_root. options MD_ROOT # Disk quotas are supported when this option is enabled. options QUOTA #enable disk quotas # If you are running a machine just as a fileserver for PC and MAC # users, using SAMBA or Netatalk, you may consider setting this option # and keeping all those users' directories on a filesystem that is # mounted with the suiddir option. This gives new files the same # ownership as the directory (similar to group). It's a security hole # if you let these users run programs, so confine it to file-servers # (but it'll save you lots of headaches in those cases). Root owned # directories are exempt and X bits are cleared. The suid bit must be # set on the directory as well; see chmod(1) PC owners can't see/set # ownerships so they keep getting their toes trodden on. This saves # you all the support calls as the filesystem it's used on will act as # they expect: "It's my dir so it must be my file". # options SUIDDIR # NFS options: options NFS_MINATTRTIMO=3 # VREG attrib cache timeout in sec options NFS_MAXATTRTIMO=60 options NFS_MINDIRATTRTIMO=30 # VDIR attrib cache timeout in sec options NFS_MAXDIRATTRTIMO=60 options NFS_GATHERDELAY=10 # Default write gather delay (msec) options NFS_WDELAYHASHSIZ=16 # and with this options NFS_DEBUG # Enable NFS Debugging # Coda stuff: options CODA #CODA filesystem. device vcoda #coda minicache <-> venus comm. # Use the old Coda 5.x venus<->kernel interface instead of the new # realms-aware 6.x protocol. #options CODA_COMPAT_5 # # Add support for the EXT2FS filesystem of Linux fame. Be a bit # careful with this - the ext2fs code has a tendency to lag behind # changes and not be exercised very much, so mounting read/write could # be dangerous (and even mounting read only could result in panics.) # options EXT2FS # # Add support for the ReiserFS filesystem (used in Linux). Currently, # this is limited to read-only access. # options REISERFS # # Add support for the SGI XFS filesystem. Currently, # this is limited to read-only access. # options XFS # Use real implementations of the aio_* system calls. There are numerous # stability and security issues in the current aio code that make it # unsuitable for inclusion on machines with untrusted local users. options VFS_AIO # Cryptographically secure random number generator; /dev/random device random # The system memory devices; /dev/mem, /dev/kmem device mem # Optional character code conversion support with LIBICONV. # Each option requires their base file system and LIBICONV. options CD9660_ICONV options MSDOSFS_ICONV options NTFS_ICONV options UDF_ICONV ##################################################################### # POSIX P1003.1B # Real time extensions added in the 1993 POSIX # _KPOSIX_PRIORITY_SCHEDULING: Build in _POSIX_PRIORITY_SCHEDULING options _KPOSIX_PRIORITY_SCHEDULING # p1003_1b_semaphores are very experimental, # user should be ready to assist in debugging if problems arise. options P1003_1B_SEMAPHORES # POSIX message queue options P1003_1B_MQUEUE ##################################################################### # SECURITY POLICY PARAMETERS # Support for BSM audit options AUDIT # Support for Mandatory Access Control (MAC): options MAC options MAC_BIBA options MAC_BSDEXTENDED options MAC_IFOFF options MAC_LOMAC options MAC_MLS options MAC_NONE options MAC_PARTITION options MAC_PORTACL options MAC_SEEOTHERUIDS options MAC_STUB options MAC_TEST ##################################################################### # CLOCK OPTIONS # The granularity of operation is controlled by the kernel option HZ whose # default value (1000 on most architectures) means a granularity of 1ms # (1s/HZ). Historically, the default was 100, but finer granularity is # required for DUMMYNET and other systems on modern hardware. There are # reasonable arguments that HZ should, in fact, be 100 still; consider, # that reducing the granularity too much might cause excessive overhead in # clock interrupt processing, potentially causing ticks to be missed and thus # actually reducing the accuracy of operation. options HZ=100 # Enable support for the kernel PLL to use an external PPS signal, # under supervision of [x]ntpd(8) # More info in ntpd documentation: http://www.eecis.udel.edu/~ntp options PPS_SYNC ##################################################################### # SCSI DEVICES # SCSI DEVICE CONFIGURATION # The SCSI subsystem consists of the `base' SCSI code, a number of # high-level SCSI device `type' drivers, and the low-level host-adapter # device drivers. The host adapters are listed in the ISA and PCI # device configuration sections below. # # It is possible to wire down your SCSI devices so that a given bus, # target, and LUN always come on line as the same device unit. In # earlier versions the unit numbers were assigned in the order that # the devices were probed on the SCSI bus. This means that if you # removed a disk drive, you may have had to rewrite your /etc/fstab # file, and also that you had to be careful when adding a new disk # as it may have been probed earlier and moved your device configuration # around. (See also option GEOM_VOL for a different solution to this # problem.) # This old behavior is maintained as the default behavior. The unit # assignment begins with the first non-wired down unit for a device # type. For example, if you wire a disk as "da3" then the first # non-wired disk will be assigned da4. # The syntax for wiring down devices is: hint.scbus.0.at="ahc0" hint.scbus.1.at="ahc1" hint.scbus.1.bus="0" hint.scbus.3.at="ahc2" hint.scbus.3.bus="0" hint.scbus.2.at="ahc2" hint.scbus.2.bus="1" hint.da.0.at="scbus0" hint.da.0.target="0" hint.da.0.unit="0" hint.da.1.at="scbus3" hint.da.1.target="1" hint.da.2.at="scbus2" hint.da.2.target="3" hint.sa.1.at="scbus1" hint.sa.1.target="6" # "units" (SCSI logical unit number) that are not specified are # treated as if specified as LUN 0. # All SCSI devices allocate as many units as are required. # The ch driver drives SCSI Media Changer ("jukebox") devices. # # The da driver drives SCSI Direct Access ("disk") and Optical Media # ("WORM") devices. # # The sa driver drives SCSI Sequential Access ("tape") devices. # # The cd driver drives SCSI Read Only Direct Access ("cd") devices. # # The ses driver drives SCSI Environment Services ("ses") and # SAF-TE ("SCSI Accessible Fault-Tolerant Enclosure") devices. # # The pt driver drives SCSI Processor devices. # # The sg driver provides a passthrough API that is compatible with the # Linux SG driver. It will work in conjunction with the COMPAT_LINUX # option to run linux SG apps. It can also stand on its own and provide # source level API compatiblity for porting apps to FreeBSD. # # Target Mode support is provided here but also requires that a SIM # (SCSI Host Adapter Driver) provide support as well. # # The targ driver provides target mode support as a Processor type device. # It exists to give the minimal context necessary to respond to Inquiry # commands. There is a sample user application that shows how the rest # of the command support might be done in /usr/share/examples/scsi_target. # # The targbh driver provides target mode support and exists to respond # to incoming commands that do not otherwise have a logical unit assigned # to them. # # The "unknown" device (uk? in pre-2.0.5) is now part of the base SCSI # configuration as the "pass" driver. device scbus #base SCSI code device ch #SCSI media changers device da #SCSI direct access devices (aka disks) device sa #SCSI tapes device cd #SCSI CD-ROMs device ses #SCSI Environmental Services (and SAF-TE) device pt #SCSI processor device targ #SCSI Target Mode Code device targbh #SCSI Target Mode Blackhole Device device pass #CAM passthrough driver device sg #Linux SCSI passthrough # CAM OPTIONS: # debugging options: # -- NOTE -- If you specify one of the bus/target/lun options, you must # specify them all! # CAMDEBUG: When defined enables debugging macros # CAM_DEBUG_BUS: Debug the given bus. Use -1 to debug all busses. # CAM_DEBUG_TARGET: Debug the given target. Use -1 to debug all targets. # CAM_DEBUG_LUN: Debug the given lun. Use -1 to debug all luns. # CAM_DEBUG_FLAGS: OR together CAM_DEBUG_INFO, CAM_DEBUG_TRACE, # CAM_DEBUG_SUBTRACE, and CAM_DEBUG_CDB # # CAM_MAX_HIGHPOWER: Maximum number of concurrent high power (start unit) cmds # SCSI_NO_SENSE_STRINGS: When defined disables sense descriptions # SCSI_NO_OP_STRINGS: When defined disables opcode descriptions # SCSI_DELAY: The number of MILLISECONDS to freeze the SIM (scsi adapter) # queue after a bus reset, and the number of milliseconds to # freeze the device queue after a bus device reset. This # can be changed at boot and runtime with the # kern.cam.scsi_delay tunable/sysctl. options CAMDEBUG options CAM_DEBUG_BUS=-1 options CAM_DEBUG_TARGET=-1 options CAM_DEBUG_LUN=-1 options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_TRACE|CAM_DEBUG_CDB) options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS options SCSI_DELAY=5000 # Be pessimistic about Joe SCSI device # Options for the CAM CDROM driver: # CHANGER_MIN_BUSY_SECONDS: Guaranteed minimum time quantum for a changer LUN # CHANGER_MAX_BUSY_SECONDS: Maximum time quantum per changer LUN, only # enforced if there is I/O waiting for another LUN # The compiled in defaults for these variables are 2 and 10 seconds, # respectively. # # These can also be changed on the fly with the following sysctl variables: # kern.cam.cd.changer.min_busy_seconds # kern.cam.cd.changer.max_busy_seconds # options CHANGER_MIN_BUSY_SECONDS=2 options CHANGER_MAX_BUSY_SECONDS=10 # Options for the CAM sequential access driver: # SA_IO_TIMEOUT: Timeout for read/write/wfm operations, in minutes # SA_SPACE_TIMEOUT: Timeout for space operations, in minutes # SA_REWIND_TIMEOUT: Timeout for rewind operations, in minutes # SA_ERASE_TIMEOUT: Timeout for erase operations, in minutes # SA_1FM_AT_EOD: Default to model which only has a default one filemark at EOT. options SA_IO_TIMEOUT=4 options SA_SPACE_TIMEOUT=60 options SA_REWIND_TIMEOUT=(2*60) options SA_ERASE_TIMEOUT=(4*60) options SA_1FM_AT_EOD # Optional timeout for the CAM processor target (pt) device # This is specified in seconds. The default is 60 seconds. options SCSI_PT_DEFAULT_TIMEOUT=60 # Optional enable of doing SES passthrough on other devices (e.g., disks) # # Normally disabled because a lot of newer SCSI disks report themselves # as having SES capabilities, but this can then clot up attempts to build # build a topology with the SES device that's on the box these drives # are in.... options SES_ENABLE_PASSTHROUGH ##################################################################### # MISCELLANEOUS DEVICES AND OPTIONS # The `pty' device usually turns out to be ``effectively mandatory'', # as it is required for `telnetd', `rlogind', `screen', `emacs', and # `xterm', among others. device pty #Pseudo ttys device nmdm #back-to-back tty devices device md #Memory/malloc disk device snp #Snoop device - to look at pty/vty/etc.. device ccd #Concatenated disk driver device firmware #firmware(9) support # Kernel side iconv library options LIBICONV # Size of the kernel message buffer. Should be N * pagesize. options MSGBUF_SIZE=40960 # Maximum size of a tty or pty input buffer. options TTYHOG=8193 ##################################################################### # HARDWARE DEVICE CONFIGURATION # For ISA the required hints are listed. # EISA, MCA, PCI, CardBus, SD/MMC and pccard are self identifying buses, so # no hints are needed. # # Mandatory devices: # # These options are valid for other keyboard drivers as well. options KBD_DISABLE_KEYMAP_LOAD # refuse to load a keymap options KBD_INSTALL_CDEV # install a CDEV entry in /dev options FB_DEBUG # Frame buffer debugging device splash # Splash screen and screen saver support # Various screen savers. device blank_saver device daemon_saver device dragon_saver device fade_saver device fire_saver device green_saver device logo_saver device rain_saver device snake_saver device star_saver device warp_saver # The syscons console driver (SCO color console compatible). device sc hint.sc.0.at="isa" options MAXCONS=16 # number of virtual consoles options SC_ALT_MOUSE_IMAGE # simplified mouse cursor in text mode options SC_DFLT_FONT # compile font in makeoptions SC_DFLT_FONT=cp850 options SC_DISABLE_KDBKEY # disable `debug' key options SC_DISABLE_REBOOT # disable reboot key sequence options SC_HISTORY_SIZE=200 # number of history buffer lines options SC_MOUSE_CHAR=0x3 # char code for text mode mouse cursor options SC_PIXEL_MODE # add support for the raster text mode # The following options will let you change the default colors of syscons. options SC_NORM_ATTR=(FG_GREEN|BG_BLACK) options SC_NORM_REV_ATTR=(FG_YELLOW|BG_GREEN) options SC_KERNEL_CONS_ATTR=(FG_RED|BG_BLACK) options SC_KERNEL_CONS_REV_ATTR=(FG_BLACK|BG_RED) # The following options will let you change the default behaviour of # cut-n-paste feature options SC_CUT_SPACES2TABS # convert leading spaces into tabs options SC_CUT_SEPCHARS=\"x09\" # set of characters that delimit words # (default is single space - \"x20\") # If you have a two button mouse, you may want to add the following option # to use the right button of the mouse to paste text. options SC_TWOBUTTON_MOUSE # You can selectively disable features in syscons. options SC_NO_CUTPASTE options SC_NO_FONT_LOADING options SC_NO_HISTORY options SC_NO_MODE_CHANGE options SC_NO_SYSMOUSE options SC_NO_SUSPEND_VTYSWITCH # `flags' for sc # 0x80 Put the video card in the VESA 800x600 dots, 16 color mode # 0x100 Probe for a keyboard device periodically if one is not present # # Optional devices: # # # SCSI host adapters: # # adv: All Narrow SCSI bus AdvanSys controllers. # adw: Second Generation AdvanSys controllers including the ADV940UW. # aha: Adaptec 154x/1535/1640 # ahb: Adaptec 174x EISA controllers # ahc: Adaptec 274x/284x/2910/293x/294x/394x/3950x/3960x/398X/4944/ # 19160x/29160x, aic7770/aic78xx # ahd: Adaptec 29320/39320 Controllers. # aic: Adaptec 6260/6360, APA-1460 (PC Card), NEC PC9801-100 (C-BUS) # amd: Support for the AMD 53C974 SCSI host adapter chip as found on devices # such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F # esp: NCR53c9x. Only for SBUS hardware right now. # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters, # ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2, # ISP 12160 Ultra3 SCSI, # Qlogic ISP 2100 and ISP 2200 1Gb Fibre Channel host adapters. # Qlogic ISP 2300 and ISP 2312 2Gb Fibre Channel host adapters. # Qlogic ISP 2322 and ISP 6322 2Gb Fibre Channel host adapters. # ispfw: Firmware module for Qlogic host adapters # mpt: LSI-Logic MPT/Fusion 53c1020 or 53c1030 Ultra4 # or FC9x9 Fibre Channel host adapters. # ncr: NCR 53C810, 53C825 self-contained SCSI host adapters. # sym: Symbios/Logic 53C8XX family of PCI-SCSI I/O processors: # 53C810, 53C810A, 53C815, 53C825, 53C825A, 53C860, 53C875, # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, # 53C1010-33, 53C1010-66. # trm: Tekram DC395U/UW/F DC315U adapters. # wds: WD7000 # # Note that the order is important in order for Buslogic ISA/EISA cards to be # probed correctly. # device bt hint.bt.0.at="isa" hint.bt.0.port="0x330" device adv hint.adv.0.at="isa" device adw device aha hint.aha.0.at="isa" device aic hint.aic.0.at="isa" device ahb device ahc device ahd device amd device esp device iscsi_initiator device isp hint.isp.0.disable="1" hint.isp.0.role="3" hint.isp.0.prefer_iomap="1" hint.isp.0.prefer_memmap="1" hint.isp.0.fwload_disable="1" hint.isp.0.ignore_nvram="1" hint.isp.0.fullduplex="1" hint.isp.0.topology="lport" hint.isp.0.topology="nport" hint.isp.0.topology="lport-only" hint.isp.0.topology="nport-only" # we can't get u_int64_t types, nor can we get strings if it's got # a leading 0x, hence this silly dodge. hint.isp.0.portwnn="w50000000aaaa0000" hint.isp.0.nodewnn="w50000000aaaa0001" device ispfw device mpt device ncr device sym device trm device wds hint.wds.0.at="isa" hint.wds.0.port="0x350" hint.wds.0.irq="11" hint.wds.0.drq="6" # The aic7xxx driver will attempt to use memory mapped I/O for all PCI # controllers that have it configured only if this option is set. Unfortunately, # this doesn't work on some motherboards, which prevents it from being the # default. options AHC_ALLOW_MEMIO # Dump the contents of the ahc controller configuration PROM. options AHC_DUMP_EEPROM # Bitmap of units to enable targetmode operations. options AHC_TMODE_ENABLE # Compile in Aic7xxx Debugging code. options AHC_DEBUG # Aic7xxx driver debugging options. See sys/dev/aic7xxx/aic7xxx.h options AHC_DEBUG_OPTS # Print register bitfields in debug output. Adds ~128k to driver # See ahc(4). options AHC_REG_PRETTY_PRINT # Compile in aic79xx debugging code. options AHD_DEBUG # Aic79xx driver debugging options. Adds ~215k to driver. See ahd(4). options AHD_DEBUG_OPTS=0xFFFFFFFF # Print human-readable register definitions when debugging options AHD_REG_PRETTY_PRINT # Bitmap of units to enable targetmode operations. options AHD_TMODE_ENABLE # The adw driver will attempt to use memory mapped I/O for all PCI # controllers that have it configured only if this option is set. options ADW_ALLOW_MEMIO # Options used in dev/iscsi (Software iSCSI stack) # options ISCSI_INITIATOR_DEBUG=9 # Options used in dev/isp/ (Qlogic SCSI/FC driver). # # ISP_TARGET_MODE - enable target mode operation # options ISP_TARGET_MODE=1 # # ISP_DEFAULT_ROLES - default role # none=0 # target=1 # initiator=2 # both=3 (not supported currently) # options ISP_DEFAULT_ROLES=2 # Options used in dev/sym/ (Symbios SCSI driver). #options SYM_SETUP_LP_PROBE_MAP #-Low Priority Probe Map (bits) # Allows the ncr to take precedence # 1 (1<<0) -> 810a, 860 # 2 (1<<1) -> 825a, 875, 885, 895 # 4 (1<<2) -> 895a, 896, 1510d #options SYM_SETUP_SCSI_DIFF #-HVD support for 825a, 875, 885 # disabled:0 (default), enabled:1 #options SYM_SETUP_PCI_PARITY #-PCI parity checking # disabled:0, enabled:1 (default) #options SYM_SETUP_MAX_LUN #-Number of LUNs supported # default:8, range:[1..64] # The 'dpt' driver provides support for old DPT controllers (http://www.dpt.com/). # These have hardware RAID-{0,1,5} support, and do multi-initiator I/O. # The DPT controllers are commonly re-licensed under other brand-names - # some controllers by Olivetti, Dec, HP, AT&T, SNI, AST, Alphatronic, NEC and # Compaq are actually DPT controllers. # # See src/sys/dev/dpt for debugging and other subtle options. # DPT_MEASURE_PERFORMANCE Enables a set of (semi)invasive metrics. Various # instruments are enabled. The tools in # /usr/sbin/dpt_* assume these to be enabled. # DPT_HANDLE_TIMEOUTS Normally device timeouts are handled by the DPT. # If you ant the driver to handle timeouts, enable # this option. If your system is very busy, this # option will create more trouble than solve. # DPT_TIMEOUT_FACTOR Used to compute the excessive amount of time to # wait when timing out with the above option. # DPT_DEBUG_xxxx These are controllable from sys/dev/dpt/dpt.h # DPT_LOST_IRQ When enabled, will try, once per second, to catch # any interrupt that got lost. Seems to help in some # DPT-firmware/Motherboard combinations. Minimal # cost, great benefit. # DPT_RESET_HBA Make "reset" actually reset the controller # instead of fudging it. Only enable this if you # are 100% certain you need it. device dpt # DPT options #!CAM# options DPT_MEASURE_PERFORMANCE #!CAM# options DPT_HANDLE_TIMEOUTS options DPT_TIMEOUT_FACTOR=4 options DPT_LOST_IRQ options DPT_RESET_HBA # # Compaq "CISS" RAID controllers (SmartRAID 5* series) # These controllers have a SCSI-like interface, and require the # CAM infrastructure. # device ciss # # Intel Integrated RAID controllers. # This driver was developed and is maintained by Intel. Contacts # at Intel for this driver are # "Kannanthanam, Boji T" and # "Leubner, Achim" . # device iir # # Mylex AcceleRAID and eXtremeRAID controllers with v6 and later # firmware. These controllers have a SCSI-like interface, and require # the CAM infrastructure. # device mly # # Compaq Smart RAID, Mylex DAC960 and AMI MegaRAID controllers. Only # one entry is needed; the code will find and configure all supported # controllers. # device ida # Compaq Smart RAID device mlx # Mylex DAC960 device amr # AMI MegaRAID device mfi # LSI MegaRAID SAS device mfip # LSI MegaRAID SAS passthrough, requires CAM options MFI_DEBUG # # 3ware ATA RAID # device twe # 3ware ATA RAID # # The 'ATA' driver supports all ATA and ATAPI devices, including PC Card # devices. You only need one "device ata" for it to find all # PCI and PC Card ATA/ATAPI devices on modern machines. device ata device atadisk # ATA disk drives device ataraid # ATA RAID drives device atapicd # ATAPI CDROM drives device atapifd # ATAPI floppy drives device atapist # ATAPI tape drives device atapicam # emulate ATAPI devices as SCSI ditto via CAM # needs CAM to be present (scbus & pass) # # For older non-PCI, non-PnPBIOS systems, these are the hints lines to add: hint.ata.0.at="isa" hint.ata.0.port="0x1f0" hint.ata.0.irq="14" hint.ata.1.at="isa" hint.ata.1.port="0x170" hint.ata.1.irq="15" # # The following options are valid on the ATA driver: # # ATA_STATIC_ID: controller numbering is static ie depends on location # else the device numbers are dynamically allocated. options ATA_STATIC_ID # # Standard floppy disk controllers and floppy tapes, supports # the Y-E DATA External FDD (PC Card) # device fdc hint.fdc.0.at="isa" hint.fdc.0.port="0x3F0" hint.fdc.0.irq="6" hint.fdc.0.drq="2" # # FDC_DEBUG enables floppy debugging. Since the debug output is huge, you # gotta turn it actually on by setting the variable fd_debug with DDB, # however. options FDC_DEBUG # # Activate this line if you happen to have an Insight floppy tape. # Probing them proved to be dangerous for people with floppy disks only, # so it's "hidden" behind a flag: #hint.fdc.0.flags="1" # Specify floppy devices hint.fd.0.at="fdc0" hint.fd.0.drive="0" hint.fd.1.at="fdc0" hint.fd.1.drive="1" # # uart: newbusified driver for serial interfaces. It consolidates the sio(4), # sab(4) and zs(4) drivers. # device uart # Options for uart(4) options UART_PPS_ON_CTS # Do time pulse capturing using CTS # instead of DCD. # The following hint should only be used for pure ISA devices. It is not # needed otherwise. Use of hints is strongly discouraged. hint.uart.0.at="isa" # The following 3 hints are used when the UART is a system device (i.e., a # console or debug port), but only on platforms that don't have any other # means to pass the information to the kernel. The unit number of the hint # is only used to bundle the hints together. There is no relation to the # unit number of the probed UART. hint.uart.0.port="0x3f8" hint.uart.0.flags="0x10" hint.uart.0.baud="115200" # `flags' for serial drivers that support consoles like sio(4) and uart(4): # 0x10 enable console support for this unit. Other console flags # (if applicable) are ignored unless this is set. Enabling # console support does not make the unit the preferred console. # Boot with -h or set boot_serial=YES in the loader. For sio(4) # specifically, the 0x20 flag can also be set (see above). # Currently, at most one unit can have console support; the # first one (in config file order) with this flag set is # preferred. Setting this flag for sio0 gives the old behaviour. # 0x80 use this port for serial line gdb support in ddb. Also known # as debug port. # # Options for serial drivers that support consoles: options BREAK_TO_DEBUGGER # A BREAK on a serial console goes to # ddb, if available. # Solaris implements a new BREAK which is initiated by a character # sequence CR ~ ^b which is similar to a familiar pattern used on # Sun servers by the Remote Console. There are FreeBSD extentions: # CR ~ ^p requests force panic and CR ~ ^r requests a clean reboot. options ALT_BREAK_TO_DEBUGGER # Serial Communications Controller # Supports the Siemens SAB 82532 and Zilog Z8530 multi-channel # communications controllers. device scc # PCI Universal Communications driver # Supports various multi port PCI I/O cards. device puc # # Network interfaces: # # MII bus support is required for some PCI 10/100 ethernet NICs, # namely those which use MII-compliant transceivers or implement # transceiver control interfaces that operate like an MII. Adding # "device miibus0" to the kernel config pulls in support for # the generic miibus API and all of the PHY drivers, including a # generic one for PHYs that aren't specifically handled by an # individual driver. device miibus # an: Aironet 4500/4800 802.11 wireless adapters. Supports the PCMCIA, # PCI and ISA varieties. # age: Support for gigabit ethernet adapters based on the Attansic/Atheros # L1 PCI express gigabit ethernet controllers. # bce: Broadcom NetXtreme II (BCM5706/BCM5708) PCI/PCIe Gigabit Ethernet # adapters. # bfe: Broadcom BCM4401 Ethernet adapter. # bge: Support for gigabit ethernet adapters based on the Broadcom # BCM570x family of controllers, including the 3Com 3c996-T, # the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and # the embedded gigE NICs on Dell PowerEdge 2550 servers. # cm: Arcnet SMC COM90c26 / SMC COM90c56 # (and SMC COM90c66 in '56 compatibility mode) adapters. # cnw: Xircom CNW/Netware Airsurfer PC Card adapter # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics # AX88140A and AX88141, the Davicom DM9100 and DM9102, the Lite-On # 82c168 and 82c169 PNIC, the Lite-On/Macronix LC82C115 PNIC II # and the Macronix 98713/98713A/98715/98715A/98725 PMAC. This driver # replaces the old al, ax, dm, pn and mx drivers. List of brands: # Digital DE500-BA, Kingston KNE100TX, D-Link DFE-570TX, SOHOware SFA110, # SVEC PN102-TX, CNet Pro110B, 120A, and 120B, Compex RL100-TX, # LinkSys LNE100TX, LNE100TX V2.0, Jaton XpressNet, Alfa Inc GFC2204, # KNE110TX. # de: Digital Equipment DC21040 # em: Intel Pro/1000 Gigabit Ethernet 82542, 82543, 82544 based adapters. # igb: Intel Pro/1000 PCI Express Gigabit Ethernet: 82575 and later adapters. # ep: 3Com 3C509, 3C529, 3C556, 3C562D, 3C563D, 3C572, 3C574X, 3C579, 3C589 # and PC Card devices using these chipsets. # ex: Intel EtherExpress Pro/10 and other i82595-based adapters, # Olicom Ethernet PC Card devices. # fe: Fujitsu MB86960A/MB86965A Ethernet # fea: DEC DEFEA EISA FDDI adapter # fpa: Support for the Digital DEFPA PCI FDDI. `device fddi' is also needed. # fxp: Intel EtherExpress Pro/100B # (hint of prefer_iomap can be done to prefer I/O instead of Mem mapping) # gem: Apple GMAC/Sun ERI/Sun GEM # hme: Sun HME (Happy Meal Ethernet) # le: AMD Am7900 LANCE and Am79C9xx PCnet # lge: Support for PCI gigabit ethernet adapters based on the Level 1 # LXT1001 NetCellerator chipset. This includes the D-Link DGE-500SX, # SMC TigerCard 1000 (SMC9462SX), and some Addtron cards. # msk: Support for gigabit ethernet adapters based on the Marvell/SysKonnect # Yukon II Gigabit controllers, including 88E8021, 88E8022, 88E8061, # 88E8062, 88E8035, 88E8036, 88E8038, 88E8050, 88E8052, 88E8053, # 88E8055, 88E8056 and D-Link 560T/550SX. # lmc: Support for the LMC/SBE wide-area network interface cards. # my: Myson Fast Ethernet (MTD80X, MTD89X) # nge: Support for PCI gigabit ethernet adapters based on the National # Semiconductor DP83820 and DP83821 chipset. This includes the # SMC EZ Card 1000 (SMC9462TX), D-Link DGE-500T, Asante FriendlyNet # GigaNIX 1000TA and 1000TPC, the Addtron AEG320T, the Surecom # EP-320G-TX and the Netgear GA622T. # pcn: Support for PCI fast ethernet adapters based on the AMD Am79c97x # PCnet-FAST, PCnet-FAST+, PCnet-FAST III, PCnet-PRO and PCnet-Home # chipsets. These can also be handled by the le(4) driver if the # pcn(4) driver is left out of the kernel. The le(4) driver does not # support the additional features like the MII bus and burst mode of # the PCnet-FAST and greater chipsets though. # rl: Support for PCI fast ethernet adapters based on the RealTek 8129/8139 # chipset. Note that the RealTek driver defaults to using programmed # I/O to do register accesses because memory mapped mode seems to cause # severe lockups on SMP hardware. This driver also supports the # Accton EN1207D `Cheetah' adapter, which uses a chip called # the MPX 5030/5038, which is either a RealTek in disguise or a # RealTek workalike. Note that the D-Link DFE-530TX+ uses the RealTek # chipset and is supported by this driver, not the 'vr' driver. # sf: Support for Adaptec Duralink PCI fast ethernet adapters based on the # Adaptec AIC-6915 "starfire" controller. # This includes dual and quad port cards, as well as one 100baseFX card. # Most of these are 64-bit PCI devices, except for one single port # card which is 32-bit. # sis: Support for NICs based on the Silicon Integrated Systems SiS 900, # SiS 7016 and NS DP83815 PCI fast ethernet controller chips. # sbsh: Support for Granch SBNI16 SHDSL modem PCI adapters # sk: Support for the SysKonnect SK-984x series PCI gigabit ethernet NICs. # This includes the SK-9841 and SK-9842 single port cards (single mode # and multimode fiber) and the SK-9843 and SK-9844 dual port cards # (also single mode and multimode). # The driver will autodetect the number of ports on the card and # attach each one as a separate network interface. # sn: Support for ISA and PC Card Ethernet devices using the # SMC91C90/92/94/95 chips. # ste: Sundance Technologies ST201 PCI fast ethernet controller, includes # the D-Link DFE-550TX. # stge: Support for gigabit ethernet adapters based on the Sundance/Tamarack # TC9021 family of controllers, including the Sundance ST2021/ST2023, # the Sundance/Tamarack TC9021, the D-Link DL-4000 and ASUS NX1101. # ti: Support for PCI gigabit ethernet NICs based on the Alteon Networks # Tigon 1 and Tigon 2 chipsets. This includes the Alteon AceNIC, the # 3Com 3c985, the Netgear GA620 and various others. Note that you will # probably want to bump up kern.ipc.nmbclusters a lot to use this driver. # tl: Support for the Texas Instruments TNETE100 series 'ThunderLAN' # cards and integrated ethernet controllers. This includes several # Compaq Netelligent 10/100 cards and the built-in ethernet controllers # in several Compaq Prosignia, Proliant and Deskpro systems. It also # supports several Olicom 10Mbps and 10/100 boards. # tx: SMC 9432 TX, BTX and FTX cards. (SMC EtherPower II series) # txp: Support for 3Com 3cR990 cards with the "Typhoon" chipset # vr: Support for various fast ethernet adapters based on the VIA # Technologies VT3043 `Rhine I' and VT86C100A `Rhine II' chips, # including the D-Link DFE530TX (see 'rl' for DFE530TX+), the Hawking # Technologies PN102TX, and the AOpen/Acer ALN-320. # vx: 3Com 3C590 and 3C595 # wb: Support for fast ethernet adapters based on the Winbond W89C840F chip. # Note: this is not the same as the Winbond W89C940F, which is a # NE2000 clone. # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both # the PCMCIA and ISA cards: the ISA card is really a PCMCIA to ISA # bridge with a PCMCIA adapter plugged into it. # xe: Xircom/Intel EtherExpress Pro100/16 PC Card ethernet controller, # Accton Fast EtherCard-16, Compaq Netelligent 10/100 PC Card, # Toshiba 10/100 Ethernet PC Card, Xircom 16-bit Ethernet + Modem 56 # xl: Support for the 3Com 3c900, 3c905, 3c905B and 3c905C (Fast) # Etherlink XL cards and integrated controllers. This includes the # integrated 3c905B-TX chips in certain Dell Optiplex and Dell # Precision desktop machines and the integrated 3c905-TX chips # in Dell Latitude laptop docking stations. # Also supported: 3Com 3c980(C)-TX, 3Com 3cSOHO100-TX, 3Com 3c450-TX # Order for ISA/EISA devices is important here device cm hint.cm.0.at="isa" hint.cm.0.port="0x2e0" hint.cm.0.irq="9" hint.cm.0.maddr="0xdc000" device ep device ex device fe hint.fe.0.at="isa" hint.fe.0.port="0x300" device fea device sn hint.sn.0.at="isa" hint.sn.0.port="0x300" hint.sn.0.irq="10" device an device cnw device wi device xe # PCI Ethernet NICs that use the common MII bus controller code. device age # Attansic/Atheros L1 Gigabit Ethernet device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cxgb # Chelsio T3 10 Gigabit Ethernet device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) hint.fxp.0.prefer_iomap="0" device gem # Apple GMAC/Sun ERI/Sun GEM device hme # Sun HME (Happy Meal Ethernet) device lge # Level 1 LXT1001 gigabit Ethernet device my # Myson Fast Ethernet (MTD80X, MTD89X) device nge # NatSemi DP83820 gigabit Ethernet device rl # RealTek 8129/8139 device pcn # AMD Am79C97x PCI 10/100 NICs device sf # Adaptec AIC-6915 (``Starfire'') device sbsh # Granch SBNI16 SHDSL modem device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') #device em # Intel Pro/1000 Gigabit Ethernet #device igb # Intel Pro/1000 PCIE Gigabit Ethernet #device ixgbe # Intel Pro/10Gbe PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') # PCI FDDI NICs. device fpa # PCI WAN adapters. device lmc # Use "private" jumbo buffers allocated exclusively for the ti(4) driver. # This option is incompatible with the TI_JUMBO_HDRSPLIT option below. #options TI_PRIVATE_JUMBOS # Turn on the header splitting option for the ti(4) driver firmware. This # only works for Tigon II chips, and has no effect for Tigon I chips. options TI_JUMBO_HDRSPLIT # These two options allow manipulating the mbuf cluster size and mbuf size, # respectively. Be very careful with NIC driver modules when changing # these from their default values, because that can potentially cause a # mismatch between the mbuf size assumed by the kernel and the mbuf size # assumed by a module. The only driver that currently has the ability to # detect a mismatch is ti(4). options MCLSHIFT=12 # mbuf cluster shift in bits, 12 == 4KB options MSIZE=512 # mbuf size in bytes # # ATM related options (Cranor version) # (note: this driver cannot be used with the HARP ATM stack) # # The `en' device provides support for Efficient Networks (ENI) # ENI-155 PCI midway cards, and the Adaptec 155Mbps PCI ATM cards (ANA-59x0). # # The `hatm' device provides support for Fore/Marconi HE155 and HE622 # ATM PCI cards. # # The `fatm' device provides support for Fore PCA200E ATM PCI cards. # # The `patm' device provides support for IDT77252 based cards like # ProSum's ProATM-155 and ProATM-25 and IDT's evaluation boards. # # atm device provides generic atm functions and is required for # atm devices. # NATM enables the netnatm protocol family that can be used to # bypass TCP/IP. # # utopia provides the access to the ATM PHY chips and is required for en, # hatm and fatm. # # the current driver supports only PVC operations (no atm-arp, no multicast). # for more details, please read the original documents at # http://www.ccrc.wustl.edu/pub/chuck/tech/bsdatm/bsdatm.html # device atm device en device fatm #Fore PCA200E device hatm #Fore/Marconi HE155/622 device patm #IDT77252 cards (ProATM and IDT) device utopia #ATM PHY driver options NATM #native ATM options LIBMBPOOL #needed by patm, iatm # # Sound drivers # # sound: The generic sound driver. # device sound # # snd_*: Device-specific drivers. # # The flags of the device tells the device a bit more info about the # device that normally is obtained through the PnP interface. # bit 2..0 secondary DMA channel; # bit 4 set if the board uses two dma channels; # bit 15..8 board type, overrides autodetection; leave it # zero if don't know what to put in (and you don't, # since this is unsupported at the moment...). # # snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP. # snd_als4000: Avance Logic ALS4000 PCI. # snd_atiixp: ATI IXP 200/300/400 PCI. # snd_au88x0 Aureal Vortex 1/2/Advantage PCI. This driver # lacks support for playback and recording. # snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus. Only # for sparc64. # snd_cmi: CMedia CMI8338/CMI8738 PCI. # snd_cs4281: Crystal Semiconductor CS4281 PCI. # snd_csa: Crystal Semiconductor CS461x/428x PCI. (except # 4281) # snd_ds1: Yamaha DS-1 PCI. # snd_emu10k1: Creative EMU10K1 PCI and EMU10K2 (Audigy) PCI. # snd_emu10kx: Creative SoundBlaster Live! and Audigy # snd_envy24: VIA Envy24 and compatible, needs snd_spicds. # snd_envy24ht: VIA Envy24HT and compatible, needs snd_spicds. # snd_es137x: Ensoniq AudioPCI ES137x PCI. # snd_ess: Ensoniq ESS ISA PnP/non-PnP, to be used in # conjunction with snd_sbc. # snd_fm801: Forte Media FM801 PCI. # snd_gusc: Gravis UltraSound ISA PnP/non-PnP. # snd_hda: Intel High Definition Audio (Controller) and # compatible. # snd_ich: Intel ICH PCI and some more audio controllers # embedded in a chipset, for example nVidia # nForce controllers. # snd_maestro: ESS Technology Maestro-1/2x PCI. # snd_maestro3: ESS Technology Maestro-3/Allegro PCI. # snd_mss: Microsoft Sound System ISA PnP/non-PnP. # snd_neomagic: Neomagic 256 AV/ZX PCI. # snd_sb16: Creative SoundBlaster16, to be used in # conjunction with snd_sbc. # snd_sb8: Creative SoundBlaster (pre-16), to be used in # conjunction with snd_sbc. # snd_sbc: Creative SoundBlaster ISA PnP/non-PnP. # Supports ESS and Avance ISA chips as well. # snd_spicds: SPI codec driver, needed by Envy24/Envy24HT drivers. # snd_solo: ESS Solo-1x PCI. # snd_t4dwave: Trident 4DWave DX/NX PCI, Sis 7018 PCI and Acer Labs # M5451 PCI. # snd_via8233: VIA VT8233x PCI. # snd_via82c686: VIA VT82C686A PCI. # snd_vibes: S3 Sonicvibes PCI. # snd_uaudio: USB audio. device snd_ad1816 device snd_als4000 device snd_atiixp #device snd_au88x0 #device snd_audiocs device snd_cmi device snd_cs4281 device snd_csa device snd_ds1 device snd_emu10k1 device snd_emu10kx device snd_envy24 device snd_envy24ht device snd_es137x device snd_ess device snd_fm801 device snd_gusc device snd_hda device snd_ich device snd_maestro device snd_maestro3 device snd_mss device snd_neomagic device snd_sb16 device snd_sb8 device snd_sbc device snd_solo device snd_spicds device snd_t4dwave device snd_via8233 device snd_via82c686 device snd_vibes device snd_uaudio # For non-PnP sound cards: hint.pcm.0.at="isa" hint.pcm.0.irq="10" hint.pcm.0.drq="1" hint.pcm.0.flags="0x0" hint.sbc.0.at="isa" hint.sbc.0.port="0x220" hint.sbc.0.irq="5" hint.sbc.0.drq="1" hint.sbc.0.flags="0x15" hint.gusc.0.at="isa" hint.gusc.0.port="0x220" hint.gusc.0.irq="5" hint.gusc.0.drq="1" hint.gusc.0.flags="0x13" # # IEEE-488 hardware: # pcii: PCIIA cards (uPD7210 based isa cards) # tnt4882: National Instruments PCI-GPIB card. device pcii hint.pcii.0.at="isa" hint.pcii.0.port="0x2e1" hint.pcii.0.irq="5" hint.pcii.0.drq="1" device tnt4882 # # Miscellaneous hardware: # # scd: Sony CD-ROM using proprietary (non-ATAPI) interface # mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # cy: Cyclades serial driver # joy: joystick (including IO DATA PCJOY PC Card joystick) # rc: RISCom/8 multiport card # rp: Comtrol Rocketport(ISA/PCI) - single card # si: Specialix SI/XIO 4-32 port terminal multiplexor # cmx: OmniKey CardMan 4040 pccard smartcard reader # Notes on the Comtrol Rocketport driver: # # The exact values used for rp0 depend on how many boards you have # in the system. The manufacturer's sample configs are listed as: # # device rp # core driver support # # Comtrol Rocketport ISA single card # hint.rp.0.at="isa" # hint.rp.0.port="0x280" # # If instead you have two ISA cards, one installed at 0x100 and the # second installed at 0x180, then you should add the following to # your kernel probe hints: # hint.rp.0.at="isa" # hint.rp.0.port="0x100" # hint.rp.1.at="isa" # hint.rp.1.port="0x180" # # For 4 ISA cards, it might be something like this: # hint.rp.0.at="isa" # hint.rp.0.port="0x180" # hint.rp.1.at="isa" # hint.rp.1.port="0x100" # hint.rp.2.at="isa" # hint.rp.2.port="0x340" # hint.rp.3.at="isa" # hint.rp.3.port="0x240" # # For PCI cards, you need no hints. # Mitsumi CD-ROM device mcd hint.mcd.0.at="isa" hint.mcd.0.port="0x300" # for the Sony CDU31/33A CDROM device scd hint.scd.0.at="isa" hint.scd.0.port="0x230" device joy # PnP aware, hints for non-PnP only hint.joy.0.at="isa" hint.joy.0.port="0x201" device rc hint.rc.0.at="isa" hint.rc.0.port="0x220" hint.rc.0.irq="12" device rp hint.rp.0.at="isa" hint.rp.0.port="0x280" device si options SI_DEBUG hint.si.0.at="isa" hint.si.0.maddr="0xd0000" hint.si.0.irq="12" device cmx # # The 'bktr' device is a PCI video capture device using the Brooktree # bt848/bt848a/bt849a/bt878/bt879 chipset. When used with a TV Tuner it forms a # TV card, e.g. Miro PC/TV, Hauppauge WinCast/TV WinTV, VideoLogic Captivator, # Intel Smart Video III, AverMedia, IMS Turbo, FlyVideo. # # options OVERRIDE_CARD=xxx # options OVERRIDE_TUNER=xxx # options OVERRIDE_MSP=1 # options OVERRIDE_DBX=1 # These options can be used to override the auto detection # The current values for xxx are found in src/sys/dev/bktr/bktr_card.h # Using sysctl(8) run-time overrides on a per-card basis can be made # # options BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_PAL # or # options BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_NTSC # Specifies the default video capture mode. # This is required for Dual Crystal (28&35Mhz) boards where PAL is used # to prevent hangs during initialisation, e.g. VideoLogic Captivator PCI. # # options BKTR_USE_PLL # This is required for PAL or SECAM boards with a 28Mhz crystal and no 35Mhz # crystal, e.g. some new Bt878 cards. # # options BKTR_GPIO_ACCESS # This enable IOCTLs which give user level access to the GPIO port. # # options BKTR_NO_MSP_RESET # Prevents the MSP34xx reset. Good if you initialise the MSP in another OS first # # options BKTR_430_FX_MODE # Switch Bt878/879 cards into Intel 430FX chipset compatibility mode. # # options BKTR_SIS_VIA_MODE # Switch Bt878/879 cards into SIS/VIA chipset compatibility mode which is # needed for some old SiS and VIA chipset motherboards. # This also allows Bt878/879 chips to work on old OPTi (<1997) chipset # motherboards and motherboards with bad or incomplete PCI 2.1 support. # As a rough guess, old = before 1998 # # options BKTR_NEW_MSP34XX_DRIVER # Use new, more complete initialization scheme for the msp34* soundchip. # Should fix stereo autodetection if the old driver does only output # mono sound. # # options BKTR_USE_FREEBSD_SMBUS # Compile with FreeBSD SMBus implementation # # Brooktree driver has been ported to the new I2C framework. Thus, # you'll need to have the following 3 lines in the kernel config. # device smbus # device iicbus # device iicbb # device iicsmb # The iic and smb devices are only needed if you want to control other # I2C slaves connected to the external connector of some cards. # device bktr # # PC Card/PCMCIA and Cardbus # # cbb: pci/cardbus bridge implementing YENTA interface # pccard: pccard slots # cardbus: cardbus slots device cbb device pccard device cardbus # # MMC/SD # # mmc: mmc bus # mmcsd: mmc memory and sd cards. #device mmc #device mmcsd # # SMB bus # # System Management Bus support is provided by the 'smbus' device. # Access to the SMBus device is via the 'smb' device (/dev/smb*), # which is a child of the 'smbus' device. # # Supported devices: # smb standard I/O through /dev/smb* # # Supported SMB interfaces: # iicsmb I2C to SMB bridge with any iicbus interface # bktr brooktree848 I2C hardware interface # intpm Intel PIIX4 (82371AB, 82443MX) Power Management Unit # alpm Acer Aladdin-IV/V/Pro2 Power Management Unit # ichsmb Intel ICH SMBus controller chips (82801AA, 82801AB, 82801BA) # viapm VIA VT82C586B/596B/686A and VT8233 Power Management Unit # amdpm AMD 756 Power Management Unit # amdsmb AMD 8111 SMBus 2.0 Controller # nfpm NVIDIA nForce Power Management Unit # nfsmb NVIDIA nForce2/3/4 MCP SMBus 2.0 Controller # device smbus # Bus support, required for smb below. device intpm device alpm device ichsmb device viapm device amdpm device amdsmb device nfpm device nfsmb device smb # # I2C Bus # # Philips i2c bus support is provided by the `iicbus' device. # # Supported devices: # ic i2c network interface # iic i2c standard io # iicsmb i2c to smb bridge. Allow i2c i/o with smb commands. # # Supported interfaces: # bktr brooktree848 I2C software interface # # Other: # iicbb generic I2C bit-banging code (needed by lpbb, bktr) # device iicbus # Bus support, required for ic/iic/iicsmb below. device iicbb device ic device iic device iicsmb # smb over i2c bridge # Parallel-Port Bus # # Parallel port bus support is provided by the `ppbus' device. # Multiple devices may be attached to the parallel port, devices # are automatically probed and attached when found. # # Supported devices: # vpo Iomega Zip Drive # Requires SCSI disk support ('scbus' and 'da'), best # performance is achieved with ports in EPP 1.9 mode. # lpt Parallel Printer # plip Parallel network interface # ppi General-purpose I/O ("Geek Port") + IEEE1284 I/O # pps Pulse per second Timing Interface # lpbb Philips official parallel port I2C bit-banging interface # # Supported interfaces: # ppc ISA-bus parallel port interfaces. # options PPC_PROBE_CHIPSET # Enable chipset specific detection # (see flags in ppc(4)) options DEBUG_1284 # IEEE1284 signaling protocol debug options PERIPH_1284 # Makes your computer act as an IEEE1284 # compliant peripheral options DONTPROBE_1284 # Avoid boot detection of PnP parallel devices options VP0_DEBUG # ZIP/ZIP+ debug options LPT_DEBUG # Printer driver debug options PPC_DEBUG # Parallel chipset level debug options PLIP_DEBUG # Parallel network IP interface debug options PCFCLOCK_VERBOSE # Verbose pcfclock driver options PCFCLOCK_MAX_RETRIES=5 # Maximum read tries (default 10) device ppc hint.ppc.0.at="isa" hint.ppc.0.irq="7" device ppbus device vpo device lpt device plip device ppi device pps device lpbb device pcfclock # Kernel BOOTP support options BOOTP # Use BOOTP to obtain IP address/hostname # Requires NFSCLIENT and NFS_ROOT options BOOTP_NFSROOT # NFS mount root filesystem using BOOTP info options BOOTP_NFSV3 # Use NFS v3 to NFS mount root options BOOTP_COMPAT # Workaround for broken bootp daemons. options BOOTP_WIRED_TO=fxp0 # Use interface fxp0 for BOOTP options BOOTP_BLOCKSIZE=8192 # Override NFS block size # # Add software watchdog routines. # options SW_WATCHDOG # # Disable swapping of stack pages. This option removes all # code which actually performs swapping, so it's not possible to turn # it back on at run-time. # # This is sometimes usable for systems which don't have any swap space # (see also sysctls "vm.defer_swapspace_pageouts" and # "vm.disable_swapspace_pageouts") # #options NO_SWAPPING # Set the number of sf_bufs to allocate. sf_bufs are virtual buffers # for sendfile(2) that are used to map file VM pages, and normally # default to a quantity that is roughly 16*MAXUSERS+512. You would # typically want about 4 of these for each simultaneous file send. # options NSFBUFS=1024 # # Enable extra debugging code for locks. This stores the filename and # line of whatever acquired the lock in the lock itself, and change a # number of function calls to pass around the relevant data. This is # not at all useful unless you are debugging lock code. Also note # that it is likely to break e.g. fstat(1) unless you recompile your # userland with -DDEBUG_LOCKS as well. # options DEBUG_LOCKS ##################################################################### # USB support # UHCI controller device uhci # OHCI controller device ohci # EHCI controller device ehci # SL811 Controller device slhci # General USB code (mandatory for USB) device usb # # USB Double Bulk Pipe devices device udbp # USB Fm Radio device ufm # Generic USB device driver device ugen # Human Interface Device (anything with buttons and dials) device uhid # USB keyboard device ukbd # USB printer device ulpt # USB Iomega Zip 100 Drive (Requires scbus and da) device umass # USB support for Belkin F5U109 and Magic Control Technology serial adapters device umct # USB modem support device umodem # USB mouse device ums # Diamond Rio 500 MP3 player device urio # USB scanners device uscanner # # USB serial support device ucom # USB support for Technologies ARK3116 based serial adapters device uark # USB support for Belkin F5U103 and compatible serial adapters device ubsa # USB support for BWCT console serial adapters device ubser # USB support for serial adapters based on the FT8U100AX and FT8U232AM device uftdi # USB support for some Windows CE based serial communication. device uipaq # USB support for Prolific PL-2303 serial adapters device uplcom # USB support for Silicon Laboratories CP2101/CP2102 based USB serial adapters device uslcom # USB Visor and Palm devices device uvisor # USB serial support for DDI pocket's PHS device uvscom # # ADMtek USB ethernet. Supports the LinkSys USB100TX, # the Billionton USB100, the Melco LU-ATX, the D-Link DSB-650TX # and the SMC 2202USB. Also works with the ADMtek AN986 Pegasus # eval board. device aue # ASIX Electronics AX88172 USB 2.0 ethernet driver. Used in the # LinkSys USB200M and various other adapters. device axe # # Devices which communicate using Ethernet over USB, particularly # Communication Device Class (CDC) Ethernet specification. Supports # Sharp Zaurus PDAs, some DOCSIS cable modems and so on. device cdce # # CATC USB-EL1201A USB ethernet. Supports the CATC Netmate # and Netmate II, and the Belkin F5U111. device cue # # Kawasaki LSI ethernet. Supports the LinkSys USB10T, # Entrega USB-NET-E45, Peracom Ethernet Adapter, the # 3Com 3c19250, the ADS Technologies USB-10BT, the ATen UC10T, # the Netgear EA101, the D-Link DSB-650, the SMC 2102USB # and 2104USB, and the Corega USB-T. device kue # # RealTek RTL8150 USB to fast ethernet. Supports the Melco LUA-KTX # and the GREEN HOUSE GH-USB100B. device rue # # Davicom DM9601E USB to fast ethernet. Supports the Corega FEther USB-TXC. device udav # # ZyDas ZD1211/ZD1211B wireless ethernet driver device zyd # # Ralink Technology RT2500USB chispet driver device ural # # Ralink Technology RT2501USB/RT2601USB chispet driver device rum # # debugging options for the USB subsystem # options USB_DEBUG # options for ukbd: options UKBD_DFLT_KEYMAP # specify the built-in keymap makeoptions UKBD_DFLT_KEYMAP=it.iso # options for uplcom: options UPLCOM_INTR_INTERVAL=100 # interrupt pipe interval # in milliseconds # options for uvscom: options UVSCOM_DEFAULT_OPKTSIZE=8 # default output packet size options UVSCOM_INTR_INTERVAL=100 # interrupt pipe interval # in milliseconds ##################################################################### # FireWire support device firewire # FireWire bus code device sbp # SCSI over Firewire (Requires scbus and da) device sbp_targ # SBP-2 Target mode (Requires scbus and targ) device fwe # Ethernet over FireWire (non-standard!) device fwip # IP over FireWire (RFC2734 and RFC3146) ##################################################################### # dcons support (Dumb Console Device) device dcons # dumb console driver device dcons_crom # FireWire attachment options DCONS_BUF_SIZE=16384 # buffer size options DCONS_POLL_HZ=100 # polling rate options DCONS_FORCE_CONSOLE=0 # force to be the primary console options DCONS_FORCE_GDB=1 # force to be the gdb device ##################################################################### # crypto subsystem # # This is a port of the OpenBSD crypto framework. Include this when # configuring IPSEC and when you have a h/w crypto device to accelerate # user applications that link to OpenSSL. # # Drivers are ports from OpenBSD with some simple enhancements that have # been fed back to OpenBSD. device crypto # core crypto support device cryptodev # /dev/crypto for access to h/w device rndtest # FIPS 140-2 entropy tester device hifn # Hifn 7951, 7781, etc. options HIFN_DEBUG # enable debugging support: hw.hifn.debug options HIFN_RNDTEST # enable rndtest support device ubsec # Broadcom 5501, 5601, 58xx options UBSEC_DEBUG # enable debugging support: hw.ubsec.debug options UBSEC_RNDTEST # enable rndtest support ##################################################################### # # Embedded system options: # # An embedded system might want to run something other than init. options INIT_PATH=/sbin/init:/stand/sysinstall # Debug options options BUS_DEBUG # enable newbus debugging options DEBUG_VFS_LOCKS # enable VFS lock debugging options SOCKBUF_DEBUG # enable sockbuf last record/mb tail checking # # Verbose SYSINIT # # Make the SYSINIT process performed by mi_startup() verbose. This is very # useful when porting to a new architecture. If DDB is also enabled, this # will print function names instead of addresses. options VERBOSE_SYSINIT ##################################################################### # SYSV IPC KERNEL PARAMETERS # # Maximum number of entries in a semaphore map. options SEMMAP=31 # Maximum number of System V semaphores that can be used on the system at # one time. options SEMMNI=11 # Total number of semaphores system wide options SEMMNS=61 # Total number of undo structures in system options SEMMNU=31 # Maximum number of System V semaphores that can be used by a single process # at one time. options SEMMSL=61 # Maximum number of operations that can be outstanding on a single System V # semaphore at one time. options SEMOPM=101 # Maximum number of undo operations that can be outstanding on a single # System V semaphore at one time. options SEMUME=11 # Maximum number of shared memory pages system wide. options SHMALL=1025 # Maximum size, in bytes, of a single System V shared memory region. options SHMMAX=(SHMMAXPGS*PAGE_SIZE+1) options SHMMAXPGS=1025 # Minimum size, in bytes, of a single System V shared memory region. options SHMMIN=2 # Maximum number of shared memory regions that can be used on the system # at one time. options SHMMNI=33 # Maximum number of System V shared memory regions that can be attached to # a single process at one time. options SHMSEG=9 # Set the amount of time (in seconds) the system will wait before # rebooting automatically when a kernel panic occurs. If set to (-1), # the system will wait indefinitely until a key is pressed on the # console. options PANIC_REBOOT_WAIT_TIME=16 # Attempt to bypass the buffer cache and put data directly into the # userland buffer for read operation when O_DIRECT flag is set on the # file. Both offset and length of the read operation must be # multiples of the physical media sector size. # options DIRECTIO # Specify a lower limit for the number of swap I/O buffers. They are # (among other things) used when bypassing the buffer cache due to # DIRECTIO kernel option enabled and O_DIRECT flag set on file. # options NSWBUF_MIN=120 ##################################################################### # More undocumented options for linting. # Note that documenting these are not considered an affront. options CAM_DEBUG_DELAY # VFS cluster debugging. options CLUSTERDEBUG options DEBUG # Kernel filelock debugging. options LOCKF_DEBUG # System V compatible message queues # Please note that the values provided here are used to test kernel # building. The defaults in the sources provide almost the same numbers. # MSGSSZ must be a power of 2 between 8 and 1024. options MSGMNB=2049 # Max number of chars in queue options MSGMNI=41 # Max number of message queue identifiers options MSGSEG=2049 # Max number of message segments options MSGSSZ=16 # Size of a message segment options MSGTQL=41 # Max number of messages in system options NBUF=512 # Number of buffer headers options SCSI_NCR_DEBUG options SCSI_NCR_MAX_SYNC=10000 options SCSI_NCR_MAX_WIDE=1 options SCSI_NCR_MYADDR=7 options SC_DEBUG_LEVEL=5 # Syscons debug level options SC_RENDER_DEBUG # syscons rendering debugging options SHOW_BUSYBUFS # List buffers that prevent root unmount options SLIP_IFF_OPTS options VFS_BIO_DEBUG # VFS buffer I/O debugging options KSTACK_MAX_PAGES=32 # Maximum pages to give the kernel stack # Adaptec Array Controller driver options options AAC_DEBUG # Debugging levels: # 0 - quiet, only emit warnings # 1 - noisy, emit major function # points and things done # 2 - extremely noisy, emit trace # items in loops, etc. # Yet more undocumented options for linting. # BKTR_ALLOC_PAGES has no effect except to cause warnings, and # BROOKTREE_ALLOC_PAGES hasn't actually been superseded by it, since the # driver still mostly spells this option BROOKTREE_ALLOC_PAGES. ##options BKTR_ALLOC_PAGES=(217*4+1) options BROOKTREE_ALLOC_PAGES=(217*4+1) options MAXFILES=999 Index: head/sys/conf/files =================================================================== --- head/sys/conf/files (revision 179307) +++ head/sys/conf/files (revision 179308) @@ -1,2490 +1,2387 @@ # $FreeBSD$ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and # dependency lines other than the first are silently ignored. # acpi_quirks.h optional acpi \ dependency "$S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ compile-with "${AWK} -f $S/tools/acpi_quirks2h.awk $S/dev/acpica/acpi_quirks" \ no-obj no-implicit-rule before-depend \ clean "acpi_quirks.h" aicasm optional ahc | ahd \ dependency "$S/dev/aic7xxx/aicasm/*.[chyl]" \ compile-with "CC='${CC}' ${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \ no-obj no-implicit-rule \ clean "aicasm* y.tab.h" aic7xxx_seq.h optional ahc \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic7xxx_seq.h" \ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic7xxx_reg.h optional ahc \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic7xxx_reg.h" \ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic7xxx_reg_print.c optional ahc \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i $S/dev/aic7xxx/aic7xxx_osm.h $S/dev/aic7xxx/aic7xxx.seq" \ no-obj no-implicit-rule local \ clean "aic7xxx_reg_print.c" \ dependency "$S/dev/aic7xxx/aic7xxx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic7xxx_reg_print.o optional ahc ahc_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local aic79xx_seq.h optional ahd pci \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic79xx_seq.h" \ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic79xx_reg.h optional ahd pci \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule before-depend local \ clean "aic79xx_reg.h" \ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic79xx_reg_print.c optional ahd pci \ compile-with "./aicasm ${INCLUDES} -I$S/cam/scsi -I$S/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i $S/dev/aic7xxx/aic79xx_osm.h $S/dev/aic7xxx/aic79xx.seq" \ no-obj no-implicit-rule local \ clean "aic79xx_reg_print.c" \ dependency "$S/dev/aic7xxx/aic79xx.{reg,seq} $S/cam/scsi/scsi_message.h aicasm" aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local emu10k1-alsa%diked.h optional snd_emu10k1 | snd_emu10kx \ dependency "$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "emu10k1-alsa%diked.h" p16v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "p16v-alsa%diked.h" p17v-alsa%diked.h optional snd_emu10kx pci \ dependency "$S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \ compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ no-obj no-implicit-rule before-depend \ clean "p17v-alsa%diked.h" miidevs.h optional miibus | mii \ dependency "$S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ compile-with "${AWK} -f $S/tools/miidevs2h.awk $S/dev/mii/miidevs" \ no-obj no-implicit-rule before-depend \ clean "miidevs.h" pccarddevs.h standard \ dependency "$S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ compile-with "${AWK} -f $S/tools/pccarddevs2h.awk $S/dev/pccard/pccarddevs" \ no-obj no-implicit-rule before-depend \ clean "pccarddevs.h" usbdevs.h optional usb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -h" \ no-obj no-implicit-rule before-depend \ clean "usbdevs.h" usbdevs_data.h optional usb \ dependency "$S/tools/usbdevs2h.awk $S/dev/usb/usbdevs" \ compile-with "${AWK} -f $S/tools/usbdevs2h.awk $S/dev/usb/usbdevs -d" \ no-obj no-implicit-rule before-depend \ clean "usbdevs_data.h" cam/cam.c optional scbus cam/cam_periph.c optional scbus cam/cam_queue.c optional scbus cam/cam_sim.c optional scbus cam/cam_xpt.c optional scbus cam/scsi/scsi_all.c optional scbus cam/scsi/scsi_cd.c optional cd cam/scsi/scsi_ch.c optional ch cam/scsi/scsi_da.c optional da cam/scsi/scsi_low.c optional ct | ncv | nsp | stg cam/scsi/scsi_low_pisa.c optional ct | ncv | nsp | stg cam/scsi/scsi_pass.c optional pass cam/scsi/scsi_pt.c optional pt cam/scsi/scsi_sa.c optional sa cam/scsi/scsi_ses.c optional ses cam/scsi/scsi_sg.c optional sg cam/scsi/scsi_targ_bh.c optional targbh cam/scsi/scsi_target.c optional targ contrib/altq/altq/altq_cbq.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/altq/altq/altq_cdnr.c optional altq contrib/altq/altq/altq_hfsc.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/altq/altq/altq_priq.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/altq/altq/altq_red.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/altq/altq/altq_rio.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/altq/altq/altq_rmclass.c optional altq contrib/altq/altq/altq_subr.c optional altq \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/dev/acpica/dbcmds.c optional acpi acpi_debug contrib/dev/acpica/dbdisply.c optional acpi acpi_debug contrib/dev/acpica/dbexec.c optional acpi acpi_debug contrib/dev/acpica/dbfileio.c optional acpi acpi_debug contrib/dev/acpica/dbhistry.c optional acpi acpi_debug contrib/dev/acpica/dbinput.c optional acpi acpi_debug contrib/dev/acpica/dbstats.c optional acpi acpi_debug contrib/dev/acpica/dbutils.c optional acpi acpi_debug contrib/dev/acpica/dbxface.c optional acpi acpi_debug contrib/dev/acpica/dmbuffer.c optional acpi acpi_debug contrib/dev/acpica/dmnames.c optional acpi acpi_debug contrib/dev/acpica/dmopcode.c optional acpi acpi_debug contrib/dev/acpica/dmobject.c optional acpi acpi_debug contrib/dev/acpica/dmresrc.c optional acpi acpi_debug contrib/dev/acpica/dmresrcl.c optional acpi acpi_debug contrib/dev/acpica/dmresrcs.c optional acpi acpi_debug contrib/dev/acpica/dmutils.c optional acpi acpi_debug contrib/dev/acpica/dmwalk.c optional acpi acpi_debug contrib/dev/acpica/dsfield.c optional acpi contrib/dev/acpica/dsinit.c optional acpi contrib/dev/acpica/dsmethod.c optional acpi contrib/dev/acpica/dsmthdat.c optional acpi contrib/dev/acpica/dsobject.c optional acpi contrib/dev/acpica/dsopcode.c optional acpi contrib/dev/acpica/dsutils.c optional acpi contrib/dev/acpica/dswexec.c optional acpi contrib/dev/acpica/dswload.c optional acpi contrib/dev/acpica/dswscope.c optional acpi contrib/dev/acpica/dswstate.c optional acpi contrib/dev/acpica/evevent.c optional acpi contrib/dev/acpica/evgpe.c optional acpi contrib/dev/acpica/evgpeblk.c optional acpi contrib/dev/acpica/evmisc.c optional acpi contrib/dev/acpica/evregion.c optional acpi contrib/dev/acpica/evrgnini.c optional acpi contrib/dev/acpica/evsci.c optional acpi contrib/dev/acpica/evxface.c optional acpi contrib/dev/acpica/evxfevnt.c optional acpi contrib/dev/acpica/evxfregn.c optional acpi contrib/dev/acpica/exconfig.c optional acpi contrib/dev/acpica/exconvrt.c optional acpi contrib/dev/acpica/excreate.c optional acpi contrib/dev/acpica/exdump.c optional acpi contrib/dev/acpica/exfield.c optional acpi contrib/dev/acpica/exfldio.c optional acpi contrib/dev/acpica/exmisc.c optional acpi contrib/dev/acpica/exmutex.c optional acpi contrib/dev/acpica/exnames.c optional acpi contrib/dev/acpica/exoparg1.c optional acpi contrib/dev/acpica/exoparg2.c optional acpi contrib/dev/acpica/exoparg3.c optional acpi contrib/dev/acpica/exoparg6.c optional acpi contrib/dev/acpica/exprep.c optional acpi contrib/dev/acpica/exregion.c optional acpi contrib/dev/acpica/exresnte.c optional acpi contrib/dev/acpica/exresolv.c optional acpi contrib/dev/acpica/exresop.c optional acpi contrib/dev/acpica/exstore.c optional acpi contrib/dev/acpica/exstoren.c optional acpi contrib/dev/acpica/exstorob.c optional acpi contrib/dev/acpica/exsystem.c optional acpi contrib/dev/acpica/exutils.c optional acpi contrib/dev/acpica/hwacpi.c optional acpi contrib/dev/acpica/hwgpe.c optional acpi contrib/dev/acpica/hwregs.c optional acpi contrib/dev/acpica/hwsleep.c optional acpi contrib/dev/acpica/hwtimer.c optional acpi contrib/dev/acpica/nsaccess.c optional acpi contrib/dev/acpica/nsalloc.c optional acpi contrib/dev/acpica/nsdump.c optional acpi contrib/dev/acpica/nseval.c optional acpi contrib/dev/acpica/nsinit.c optional acpi contrib/dev/acpica/nsload.c optional acpi contrib/dev/acpica/nsnames.c optional acpi contrib/dev/acpica/nsobject.c optional acpi contrib/dev/acpica/nsparse.c optional acpi contrib/dev/acpica/nssearch.c optional acpi contrib/dev/acpica/nsutils.c optional acpi contrib/dev/acpica/nswalk.c optional acpi contrib/dev/acpica/nsxfeval.c optional acpi contrib/dev/acpica/nsxfname.c optional acpi contrib/dev/acpica/nsxfobj.c optional acpi contrib/dev/acpica/psargs.c optional acpi contrib/dev/acpica/psloop.c optional acpi contrib/dev/acpica/psopcode.c optional acpi contrib/dev/acpica/psparse.c optional acpi contrib/dev/acpica/psscope.c optional acpi contrib/dev/acpica/pstree.c optional acpi contrib/dev/acpica/psutils.c optional acpi contrib/dev/acpica/pswalk.c optional acpi contrib/dev/acpica/psxface.c optional acpi contrib/dev/acpica/rsaddr.c optional acpi contrib/dev/acpica/rscalc.c optional acpi contrib/dev/acpica/rscreate.c optional acpi contrib/dev/acpica/rsdump.c optional acpi contrib/dev/acpica/rsinfo.c optional acpi contrib/dev/acpica/rsio.c optional acpi contrib/dev/acpica/rsirq.c optional acpi contrib/dev/acpica/rslist.c optional acpi contrib/dev/acpica/rsmemory.c optional acpi contrib/dev/acpica/rsmisc.c optional acpi contrib/dev/acpica/rsutils.c optional acpi contrib/dev/acpica/rsxface.c optional acpi contrib/dev/acpica/tbfadt.c optional acpi contrib/dev/acpica/tbfind.c optional acpi contrib/dev/acpica/tbinstal.c optional acpi contrib/dev/acpica/tbutils.c optional acpi contrib/dev/acpica/tbxface.c optional acpi contrib/dev/acpica/tbxfroot.c optional acpi contrib/dev/acpica/utalloc.c optional acpi contrib/dev/acpica/utcache.c optional acpi contrib/dev/acpica/utclib.c optional acpi contrib/dev/acpica/utcopy.c optional acpi contrib/dev/acpica/utdebug.c optional acpi contrib/dev/acpica/utdelete.c optional acpi contrib/dev/acpica/uteval.c optional acpi contrib/dev/acpica/utglobal.c optional acpi contrib/dev/acpica/utinit.c optional acpi contrib/dev/acpica/utmath.c optional acpi contrib/dev/acpica/utmisc.c optional acpi contrib/dev/acpica/utmutex.c optional acpi contrib/dev/acpica/utobject.c optional acpi contrib/dev/acpica/utresrc.c optional acpi contrib/dev/acpica/utstate.c optional acpi contrib/dev/acpica/utxface.c optional acpi contrib/ipfilter/netinet/fil.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_auth.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_fil_freebsd.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_frag.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_log.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_nat.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_proxy.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_state.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_lookup.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-error -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ compile-with "${NORMAL_C} -I$S/contrib/ipfilter" contrib/ngatm/netnatm/api/cc_conn.c optional ngatm_ccatm \ compile-with "${NORMAL_C_NOWERROR} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_data.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_dump.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_port.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_sig.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/cc_user.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/api/unisap.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/misc/straddr.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/misc/unimsg_common.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/msg/traffic.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/msg/uni_ie.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/msg/uni_msg.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/saal/saal_sscfu.c optional ngatm_sscfu \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/saal/saal_sscop.c optional ngatm_sscop \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_call.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_coord.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_party.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_print.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_reset.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_uni.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" contrib/pf/net/if_pflog.c optional pflog \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/if_pfsync.c optional pfsync \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_if.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_ioctl.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_norm.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_osfp.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_ruleset.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_subr.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/net/pf_table.c optional pf \ compile-with "${NORMAL_C} -I$S/contrib/pf" contrib/pf/netinet/in4_cksum.c optional pf inet crypto/blowfish/bf_ecb.c optional ipsec crypto/blowfish/bf_skey.c optional crypto | ipsec crypto/camellia/camellia.c optional crypto | ipsec crypto/camellia/camellia-api.c optional crypto | ipsec crypto/des/des_ecb.c optional crypto | ipsec | netsmb crypto/des/des_setkey.c optional crypto | ipsec | netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption crypto/rijndael/rijndael-alg-fst.c optional crypto | geom_bde | \ ipsec | random | wlan_ccmp crypto/rijndael/rijndael-api-fst.c optional geom_bde | random crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp crypto/sha1.c optional carp | crypto | ipsec | \ netgraph_mppc_encryption | sctp crypto/sha2/sha2.c optional crypto | geom_bde | ipsec | random | \ sctp ddb/db_access.c optional ddb ddb/db_break.c optional ddb ddb/db_capture.c optional ddb ddb/db_command.c optional ddb ddb/db_examine.c optional ddb ddb/db_expr.c optional ddb ddb/db_input.c optional ddb ddb/db_lex.c optional ddb ddb/db_main.c optional ddb ddb/db_output.c optional ddb ddb/db_print.c optional ddb ddb/db_ps.c optional ddb ddb/db_run.c optional ddb ddb/db_script.c optional ddb ddb/db_sym.c optional ddb ddb/db_thread.c optional ddb ddb/db_textdump.c optional ddb ddb/db_variables.c optional ddb ddb/db_watch.c optional ddb ddb/db_write_cmd.c optional ddb #dev/dpt/dpt_control.c optional dpt dev/aac/aac.c optional aac dev/aac/aac_cam.c optional aacp aac dev/aac/aac_debug.c optional aac dev/aac/aac_disk.c optional aac dev/aac/aac_linux.c optional aac compat_linux dev/aac/aac_pci.c optional aac pci dev/acpi_support/acpi_aiboost.c optional acpi_aiboost acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi dev/acpi_support/acpi_ibm.c optional acpi_ibm acpi dev/acpi_support/acpi_panasonic.c optional acpi_panasonic acpi dev/acpi_support/acpi_sony.c optional acpi_sony acpi dev/acpi_support/acpi_toshiba.c optional acpi_toshiba acpi dev/acpica/Osd/OsdDebug.c optional acpi dev/acpica/Osd/OsdHardware.c optional acpi dev/acpica/Osd/OsdInterrupt.c optional acpi dev/acpica/Osd/OsdMemory.c optional acpi dev/acpica/Osd/OsdSchedule.c optional acpi dev/acpica/Osd/OsdStream.c optional acpi dev/acpica/Osd/OsdSynch.c optional acpi dev/acpica/Osd/OsdTable.c optional acpi dev/acpica/acpi.c optional acpi dev/acpica/acpi_acad.c optional acpi dev/acpica/acpi_battery.c optional acpi dev/acpica/acpi_button.c optional acpi dev/acpica/acpi_cmbat.c optional acpi dev/acpica/acpi_cpu.c optional acpi dev/acpica/acpi_ec.c optional acpi dev/acpica/acpi_hpet.c optional acpi dev/acpica/acpi_isab.c optional acpi isa dev/acpica/acpi_lid.c optional acpi dev/acpica/acpi_package.c optional acpi dev/acpica/acpi_pci.c optional acpi pci dev/acpica/acpi_pci_link.c optional acpi pci dev/acpica/acpi_pcib.c optional acpi pci dev/acpica/acpi_pcib_acpi.c optional acpi pci dev/acpica/acpi_pcib_pci.c optional acpi pci dev/acpica/acpi_perf.c optional acpi dev/acpica/acpi_powerres.c optional acpi dev/acpica/acpi_quirk.c optional acpi dev/acpica/acpi_resource.c optional acpi dev/acpica/acpi_smbat.c optional acpi dev/acpica/acpi_thermal.c optional acpi dev/acpica/acpi_throttle.c optional acpi dev/acpica/acpi_timer.c optional acpi dev/acpica/acpi_video.c optional acpi_video acpi dev/acpica/acpi_dock.c optional acpi_dock acpi dev/adlink/adlink.c optional adlink dev/advansys/adv_eisa.c optional adv eisa dev/advansys/adv_pci.c optional adv pci dev/advansys/advansys.c optional adv dev/advansys/advlib.c optional adv dev/advansys/advmcode.c optional adv dev/advansys/adw_pci.c optional adw pci dev/advansys/adwcam.c optional adw dev/advansys/adwlib.c optional adw dev/advansys/adwmcode.c optional adw dev/age/if_age.c optional age pci dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci dev/aha/aha.c optional aha dev/aha/aha_isa.c optional aha isa dev/aha/aha_mca.c optional aha mca dev/ahb/ahb.c optional ahb eisa dev/aic/aic.c optional aic dev/aic/aic_pccard.c optional aic pccard dev/aic7xxx/ahc_eisa.c optional ahc eisa dev/aic7xxx/ahc_isa.c optional ahc isa dev/aic7xxx/ahc_pci.c optional ahc pci dev/aic7xxx/ahd_pci.c optional ahd pci dev/aic7xxx/aic7770.c optional ahc dev/aic7xxx/aic79xx.c optional ahd pci dev/aic7xxx/aic79xx_osm.c optional ahd pci dev/aic7xxx/aic79xx_pci.c optional ahd pci dev/aic7xxx/aic7xxx.c optional ahc dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/amd/amd.c optional amd dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amr dev/amr/amr_disk.c optional amr dev/amr/amr_linux.c optional amr compat_linux dev/amr/amr_pci.c optional amr pci dev/an/if_an.c optional an dev/an/if_an_isa.c optional an isa dev/an/if_an_pccard.c optional an pccard dev/an/if_an_pci.c optional an pci dev/asr/asr.c optional asr pci dev/ata/ata_if.m optional ata dev/ata/ata-all.c optional ata dev/ata/ata-card.c optional ata pccard dev/ata/ata-cbus.c optional ata pc98 dev/ata/ata-chipset.c optional ata pci dev/ata/ata-disk.c optional atadisk dev/ata/ata-dma.c optional ata pci dev/ata/ata-isa.c optional ata isa dev/ata/ata-lowlevel.c optional ata dev/ata/ata-pci.c optional ata pci dev/ata/ata-queue.c optional ata dev/ata/ata-raid.c optional ataraid dev/ata/ata-usb.c optional atausb dev/ata/atapi-cam.c optional atapicam dev/ata/atapi-cd.c optional atapicd dev/ata/atapi-fd.c optional atapifd dev/ata/atapi-tape.c optional atapist dev/ath/ah_osdep.c optional ath_hal \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_rate/onoe/onoe.c optional ath_rate_onoe \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_rate/sample/sample.c optional ath_rate_sample \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_pci.c optional ath pci \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/bce/if_bce.c optional bce dev/bfe/if_bfe.c optional bfe dev/bge/if_bge.c optional bge dev/bktr/bktr_audio.c optional bktr pci dev/bktr/bktr_card.c optional bktr pci dev/bktr/bktr_core.c optional bktr pci dev/bktr/bktr_i2c.c optional bktr pci smbus dev/bktr/bktr_os.c optional bktr pci dev/bktr/bktr_tuner.c optional bktr pci dev/bktr/msp34xx.c optional bktr pci dev/buslogic/bt.c optional bt dev/buslogic/bt_eisa.c optional bt eisa dev/buslogic/bt_isa.c optional bt isa dev/buslogic/bt_mca.c optional bt mca dev/buslogic/bt_pci.c optional bt pci dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus dev/ciss/ciss.c optional ciss dev/cm/smc90cx6.c optional cm dev/cmx/cmx.c optional cmx dev/cmx/cmx_pccard.c optional cmx pccard dev/cnw/if_cnw.c optional cnw pccard dev/cpufreq/ichss.c optional cpufreq dev/cs/if_cs.c optional cs dev/cs/if_cs_isa.c optional cs isa dev/cs/if_cs_pccard.c optional cs pccard dev/cxgb/cxgb_main.c optional cxgb pci dev/cxgb/cxgb_offload.c optional cxgb pci dev/cxgb/cxgb_lro.c optional cxgb pci dev/cxgb/cxgb_sge.c optional cxgb pci dev/cxgb/cxgb_multiq.c optional cxgb pci dev/cxgb/common/cxgb_mc5.c optional cxgb pci dev/cxgb/common/cxgb_vsc7323.c optional cxgb pci dev/cxgb/common/cxgb_vsc8211.c optional cxgb pci dev/cxgb/common/cxgb_ael1002.c optional cxgb pci dev/cxgb/common/cxgb_mv88e1xxx.c optional cxgb pci dev/cxgb/common/cxgb_xgmac.c optional cxgb pci dev/cxgb/common/cxgb_t3_hw.c optional cxgb pci dev/cxgb/sys/uipc_mvec.c optional cxgb pci dev/cxgb/sys/cxgb_support.c optional cxgb pci dev/cxgb/cxgb_t3fw.c optional cxgb cxgb_t3fw dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci dev/dc/if_dc.c optional dc pci dev/dc/dcphy.c optional dc pci dev/dc/pnphy.c optional dc pci dev/dcons/dcons.c optional dcons dev/dcons/dcons_crom.c optional dcons_crom dev/dcons/dcons_os.c optional dcons dev/de/if_de.c optional de pci dev/digi/CX.c optional digi_CX dev/digi/CX_PCI.c optional digi_CX_PCI dev/digi/EPCX.c optional digi_EPCX dev/digi/EPCX_PCI.c optional digi_EPCX_PCI dev/digi/Xe.c optional digi_Xe dev/digi/Xem.c optional digi_Xem dev/digi/Xr.c optional digi_Xr dev/digi/digi.c optional digi dev/digi/digi_isa.c optional digi isa dev/digi/digi_pci.c optional digi pci dev/dpt/dpt_eisa.c optional dpt eisa dev/dpt/dpt_pci.c optional dpt pci dev/dpt/dpt_scsi.c optional dpt dev/drm/ati_pcigart.c optional drm dev/drm/drm_agpsupport.c optional drm dev/drm/drm_auth.c optional drm dev/drm/drm_bufs.c optional drm dev/drm/drm_context.c optional drm dev/drm/drm_dma.c optional drm dev/drm/drm_drawable.c optional drm dev/drm/drm_drv.c optional drm dev/drm/drm_fops.c optional drm dev/drm/drm_ioctl.c optional drm dev/drm/drm_irq.c optional drm dev/drm/drm_lock.c optional drm dev/drm/drm_memory.c optional drm dev/drm/drm_pci.c optional drm dev/drm/drm_scatter.c optional drm dev/drm/drm_sysctl.c optional drm dev/drm/drm_vm.c optional drm dev/drm/i915_dma.c optional i915drm dev/drm/i915_drv.c optional i915drm dev/drm/i915_irq.c optional i915drm dev/drm/i915_mem.c optional i915drm dev/drm/mach64_dma.c optional mach64drm dev/drm/mach64_drv.c optional mach64drm dev/drm/mach64_irq.c optional mach64drm dev/drm/mach64_state.c optional mach64drm dev/drm/mga_dma.c optional mgadrm dev/drm/mga_drv.c optional mgadrm dev/drm/mga_irq.c optional mgadrm dev/drm/mga_state.c optional mgadrm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/mga_warp.c optional mgadrm dev/drm/r128_cce.c optional r128drm dev/drm/r128_drv.c optional r128drm dev/drm/r128_irq.c optional r128drm dev/drm/r128_state.c optional r128drm \ compile-with "${NORMAL_C} -finline-limit=13500" dev/drm/r300_cmdbuf.c optional radeondrm dev/drm/radeon_cp.c optional radeondrm dev/drm/radeon_drv.c optional radeondrm dev/drm/radeon_irq.c optional radeondrm dev/drm/radeon_mem.c optional radeondrm dev/drm/radeon_state.c optional radeondrm dev/drm/savage_bci.c optional savagedrm dev/drm/savage_drv.c optional savagedrm dev/drm/savage_state.c optional savagedrm dev/drm/sis_drv.c optional sisdrm dev/drm/sis_ds.c optional sisdrm dev/drm/sis_mm.c optional sisdrm dev/drm/tdfx_drv.c optional tdfxdrm dev/ed/if_ed.c optional ed dev/ed/if_ed_novell.c optional ed dev/ed/if_ed_rtl80x9.c optional ed dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/em/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_80003es2lan.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_82540.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_82541.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_82542.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_82543.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_82571.c optional em \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_api.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_ich8lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_mac.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_manage.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_nvm.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_phy.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/em/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/em" dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en dev/ep/if_ep.c optional ep dev/ep/if_ep_eisa.c optional ep eisa dev/ep/if_ep_isa.c optional ep isa dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep pccard dev/esp/ncr53c9x.c optional esp dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex pccard dev/exca/exca.c optional cbb dev/fatm/if_fatm.c optional fatm pci dev/fb/splash.c optional splash dev/fe/if_fe.c optional fe dev/fe/if_fe_pccard.c optional fe pccard dev/firewire/firewire.c optional firewire dev/firewire/fwcrom.c optional firewire dev/firewire/fwdev.c optional firewire dev/firewire/fwdma.c optional firewire dev/firewire/fwmem.c optional firewire dev/firewire/fwohci.c optional firewire dev/firewire/fwohci_pci.c optional firewire pci dev/firewire/if_fwe.c optional fwe dev/firewire/if_fwip.c optional fwip dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/flash/at45d.c optional at45d dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci -#dev/harp/if_harp.c optional harp pci dev/hatm/if_hatm.c optional hatm pci dev/hatm/if_hatm_intr.c optional hatm pci dev/hatm/if_hatm_ioctl.c optional hatm pci dev/hatm/if_hatm_rx.c optional hatm pci dev/hatm/if_hatm_tx.c optional hatm pci -#dev/hfa/fore_buffer.c optional hfa -#dev/hfa/fore_command.c optional hfa -#dev/hfa/fore_globals.c optional hfa -#dev/hfa/fore_if.c optional hfa -#dev/hfa/fore_init.c optional hfa -#dev/hfa/fore_intr.c optional hfa -#dev/hfa/fore_output.c optional hfa -#dev/hfa/fore_receive.c optional hfa -#dev/hfa/fore_stats.c optional hfa -#dev/hfa/fore_timer.c optional hfa -#dev/hfa/fore_transmit.c optional hfa -#dev/hfa/fore_vcm.c optional hfa -##dev/hfa/hfa_eisa.c optional hfa eisa -#dev/hfa/hfa_freebsd.c optional hfa -#dev/hfa/hfa_pci.c optional hfa pci -##dev/hfa/hfa_sbus.c optional hfa sbus dev/hifn/hifn7751.c optional hifn dev/hme/if_hme.c optional hme dev/hme/if_hme_pci.c optional hme pci dev/hme/if_hme_sbus.c optional hme sbus dev/hptiop/hptiop.c optional hptiop cam dev/hwpmc/hwpmc_logging.c optional hwpmc dev/hwpmc/hwpmc_mod.c optional hwpmc dev/ichsmb/ichsmb.c optional ichsmb dev/ichsmb/ichsmb_pci.c optional ichsmb pci dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida dev/ida/ida_eisa.c optional ida eisa dev/ida/ida_pci.c optional ida pci dev/ie/if_ie.c optional ie isa nowerror dev/ie/if_ie_isa.c optional ie isa dev/ieee488/ibfoo.c optional pcii | tnt4882 dev/ieee488/pcii.c optional pcii dev/ieee488/tnt4882.c optional tnt4882 dev/ieee488/upd7210.c optional pcii | tnt4882 dev/igb/if_igb.c optional igb \ compile-with "${NORMAL_C} -I$S/dev/igb" dev/igb/e1000_82575.c optional igb | em \ compile-with "${NORMAL_C} -I$S/dev/igb" dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1672.c optional ds1672 dev/iicbus/icee.c optional icee dev/iicbus/if_ic.c optional ic dev/iicbus/iic.c optional iic dev/iicbus/iicbb.c optional iicbb dev/iicbus/iicbb_if.m optional iicbb dev/iicbus/iicbus.c optional iicbus dev/iicbus/iicbus_if.m optional iicbus dev/iicbus/iiconf.c optional iicbus dev/iicbus/iicsmb.c optional iicsmb \ dependency "iicbus_if.h" dev/iir/iir.c optional iir dev/iir/iir_ctrl.c optional iir dev/iir/iir_pci.c optional iir pci dev/ips/ips.c optional ips dev/ips/ips_commands.c optional ips dev/ips/ips_disk.c optional ips dev/ips/ips_ioctl.c optional ips dev/ips/ips_pci.c optional ips pci dev/ipw/if_ipw.c optional ipw ipwbssfw.c optional ipwbssfw | ipwfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_bss.fw:ipw_bss:130 -lintel_ipw -mipw_bss -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ipwbssfw.c" ipw_bss.fwo optional ipwbssfw | ipwfw \ dependency "ipw_bss.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_bss.fw" \ no-implicit-rule \ clean "ipw_bss.fwo" ipw_bss.fw optional ipwbssfw | ipwfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_bss.fw" ipwibssfw.c optional ipwibssfw | ipwfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_ibss.fw:ipw_ibss:130 -lintel_ipw -mipw_ibss -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ipwibssfw.c" ipw_ibss.fwo optional ipwibssfw | ipwfw \ dependency "ipw_ibss.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_ibss.fw" \ no-implicit-rule \ clean "ipw_ibss.fwo" ipw_ibss.fw optional ipwibssfw | ipwfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-i.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_ibss.fw" ipwmonitorfw.c optional ipwmonitorfw | ipwfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk ipw_monitor.fw:ipw_monitor:130 -lintel_ipw -mipw_monitor -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "ipwmonitorfw.c" ipw_monitor.fwo optional ipwmonitorfw | ipwfw \ dependency "ipw_monitor.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ipw_monitor.fw" \ no-implicit-rule \ clean "ipw_monitor.fwo" ipw_monitor.fw optional ipwmonitorfw | ipwfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ipw/ipw2100-1.3-p.fw.uu" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" dev/iscsi/initiator/iscsi.c optional iscsi_initiator scbus dev/iscsi/initiator/iscsi_subr.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_cam.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_soc.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp dev/isp/isp_library.c optional isp dev/isp/isp_pci.c optional isp pci dev/isp/isp_sbus.c optional isp sbus dev/isp/isp_target.c optional isp dev/ispfw/ispfw.c optional ispfw dev/iwi/if_iwi.c optional iwi iwibssfw.c optional iwibssfw | iwifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_bss.fw:iwi_bss:300 -lintel_iwi -miwi_bss -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "iwibssfw.c" iwi_bss.fwo optional iwibssfw | iwifw \ dependency "iwi_bss.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_bss.fw" \ no-implicit-rule \ clean "iwi_bss.fwo" iwi_bss.fw optional iwibssfw | iwifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-bss.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_bss.fw" iwiibssfw.c optional iwiibssfw | iwifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_ibss.fw:iwi_ibss:300 -lintel_iwi -miwi_ibss -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "iwiibssfw.c" iwi_ibss.fwo optional iwiibssfw | iwifw \ dependency "iwi_ibss.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_ibss.fw" \ no-implicit-rule \ clean "iwi_ibss.fwo" iwi_ibss.fw optional iwiibssfw | iwifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-ibss.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_ibss.fw" iwimonitorfw.c optional iwimonitorfw | iwifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwi_monitor.fw:iwi_monitor:300 -lintel_iwi -miwi_monitor -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "iwimonitorfw.c" iwi_monitor.fwo optional iwimonitorfw | iwifw \ dependency "iwi_monitor.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwi_monitor.fw" \ no-implicit-rule \ clean "iwi_monitor.fwo" iwi_monitor.fw optional iwimonitorfw | iwifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwi/ipw2200-sniffer.fw.uu" \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwn/if_iwn.c optional iwn iwnfw.c optional iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn.fw:iwnfw:44417 -lintel_iwn -miwn -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "iwnfw.c" iwnfw.fwo optional iwnfw \ dependency "iwn.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} iwn.fw" \ no-implicit-rule \ clean "iwn.fwo" iwn.fw optional iwnfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/iwn/iwlwifi-4965-4.44.17.fw.uu" \ no-obj no-implicit-rule \ clean "iwn.fw" dev/ixgb/if_ixgb.c optional ixgb dev/ixgb/ixgb_ee.c optional ixgb dev/ixgb/ixgb_hw.c optional ixgb dev/ixgbe/ixgbe.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/tcp_lro.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_phy.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_api.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_common.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82598.c optional ixgbe \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa dev/joy/joy_pccard.c optional joy pccard dev/kbdmux/kbdmux.c optional kbdmux dev/le/am7990.c optional le dev/le/am79900.c optional le dev/le/if_le_pci.c optional le pci dev/le/lance.c optional le dev/led/led.c standard dev/lge/if_lge.c optional lge dev/lmc/if_lmc.c optional lmc dev/malo/if_malo.c optional malo dev/malo/if_malohal.c optional malo dev/malo/if_malo_pci.c optional malo pci dev/mc146818/mc146818.c optional mc146818 dev/mca/mca_bus.c optional mca dev/mcd/mcd.c optional mcd isa nowerror dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md dev/mem/memdev.c optional mem dev/mfi/mfi.c optional mfi dev/mfi/mfi_debug.c optional mfi dev/mfi/mfi_pci.c optional mfi pci dev/mfi/mfi_disk.c optional mfi dev/mfi/mfi_linux.c optional mfi compat_linux dev/mfi/mfi_cam.c optional mfip scbus dev/mii/acphy.c optional miibus | acphy dev/mii/amphy.c optional miibus | amphy dev/mii/atphy.c optional miibus | atphy dev/mii/bmtphy.c optional miibus | bmtphy dev/mii/brgphy.c optional miibus | brgphy dev/mii/ciphy.c optional miibus | ciphy dev/mii/e1000phy.c optional miibus | e1000phy # XXX only xl cards? dev/mii/exphy.c optional miibus | exphy dev/mii/gentbi.c optional miibus | gentbi dev/mii/icsphy.c optional miibus | icsphy # XXX only fxp cards? dev/mii/inphy.c optional miibus | inphy dev/mii/ip1000phy.c optional miibus | ip1000phy dev/mii/lxtphy.c optional miibus | lxtphy dev/mii/mii.c optional miibus | mii dev/mii/mii_physubr.c optional miibus | mii dev/mii/miibus_if.m optional miibus | mii dev/mii/mlphy.c optional miibus | mlphy dev/mii/nsgphy.c optional miibus | nsgphy dev/mii/nsphy.c optional miibus | nsphy dev/mii/nsphyter.c optional miibus | nsphyter dev/mii/pnaphy.c optional miibus | pnaphy dev/mii/qsphy.c optional miibus | qsphy dev/mii/rgephy.c optional miibus | rgephy dev/mii/rlphy.c optional miibus | rlphy dev/mii/rlswitch.c optional rlswitch # XXX rue only? dev/mii/ruephy.c optional miibus | ruephy dev/mii/tdkphy.c optional miibus | tdkphy dev/mii/tlphy.c optional miibus | tlphy dev/mii/ukphy.c optional miibus | mii dev/mii/ukphy_subr.c optional miibus | mii dev/mii/xmphy.c optional miibus | xmphy dev/mk48txx/mk48txx.c optional mk48txx dev/mlx/mlx.c optional mlx dev/mlx/mlx_disk.c optional mlx dev/mlx/mlx_pci.c optional mlx pci dev/mly/mly.c optional mly dev/mmc/mmc.c optional mmc dev/mmc/mmcbr_if.m standard dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mpt/mpt.c optional mpt dev/mpt/mpt_cam.c optional mpt dev/mpt/mpt_debug.c optional mpt dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt dev/msk/if_msk.c optional msk dev/mxge/if_mxge.c optional mxge pci dev/mxge/mxge_lro.c optional mxge pci dev/mxge/mxge_eth_z8e.c optional mxge pci dev/mxge/mxge_ethp_z8e.c optional mxge pci dev/mxge/mxge_rss_eth_z8e.c optional mxge pci dev/mxge/mxge_rss_ethp_z8e.c optional mxge pci dev/my/if_my.c optional my dev/ncv/ncr53c500.c optional ncv dev/ncv/ncr53c500_pccard.c optional ncv pccard dev/nge/if_nge.c optional nge dev/nxge/if_nxge.c optional nxge dev/nxge/xgehal/xgehal-device.c optional nxge dev/nxge/xgehal/xgehal-mm.c optional nxge dev/nxge/xgehal/xge-queue.c optional nxge dev/nxge/xgehal/xgehal-driver.c optional nxge dev/nxge/xgehal/xgehal-ring.c optional nxge dev/nxge/xgehal/xgehal-channel.c optional nxge dev/nxge/xgehal/xgehal-fifo.c optional nxge dev/nxge/xgehal/xgehal-stats.c optional nxge dev/nxge/xgehal/xgehal-config.c optional nxge dev/nxge/xgehal/xgehal-mgmt.c optional nxge dev/nmdm/nmdm.c optional nmdm dev/nsp/nsp.c optional nsp dev/nsp/nsp_pccard.c optional nsp pccard dev/null/null.c standard dev/patm/if_patm.c optional patm pci dev/patm/if_patm_attach.c optional patm pci dev/patm/if_patm_intr.c optional patm pci dev/patm/if_patm_ioctl.c optional patm pci dev/patm/if_patm_rtables.c optional patm pci dev/patm/if_patm_rx.c optional patm pci dev/patm/if_patm_tx.c optional patm pci dev/pbio/pbio.c optional pbio isa dev/pccard/card_if.m standard dev/pccard/pccard.c optional pccard dev/pccard/pccard_cis.c optional pccard dev/pccard/pccard_cis_quirks.c optional pccard dev/pccard/pccard_device.c optional pccard dev/pccard/power_if.m standard dev/pccbb/pccbb.c optional cbb dev/pccbb/pccbb_isa.c optional cbb isa dev/pccbb/pccbb_pci.c optional cbb pci dev/pcf/pcf.c optional pcf dev/pci/eisa_pci.c optional pci eisa dev/pci/fixup_pci.c optional pci dev/pci/hostb_pci.c optional pci dev/pci/ignore_pci.c optional pci dev/pci/isa_pci.c optional pci isa dev/pci/pci.c optional pci dev/pci/pci_if.m standard dev/pci/pci_pci.c optional pci dev/pci/pci_user.c optional pci dev/pci/pcib_if.m standard dev/pci/vga_pci.c optional pci dev/pdq/if_fea.c optional fea eisa dev/pdq/if_fpa.c optional fpa pci dev/pdq/pdq.c optional nowerror fea eisa | fpa pci dev/pdq/pdq_ifsubr.c optional nowerror fea eisa | fpa pci dev/ppbus/if_plip.c optional plip dev/ppbus/immio.c optional vpo dev/ppbus/lpbb.c optional lpbb dev/ppbus/lpt.c optional lpt dev/ppbus/pcfclock.c optional pcfclock dev/ppbus/ppb_1284.c optional ppbus dev/ppbus/ppb_base.c optional ppbus dev/ppbus/ppb_msq.c optional ppbus dev/ppbus/ppbconf.c optional ppbus dev/ppbus/ppbus_if.m optional ppbus dev/ppbus/ppi.c optional ppi dev/ppbus/pps.c optional pps dev/ppbus/vpo.c optional vpo dev/ppbus/vpoio.c optional vpo dev/ppc/ppc.c optional ppc dev/ppc/ppc_acpi.c optional ppc acpi dev/ppc/ppc_isa.c optional ppc isa dev/ppc/ppc_pci.c optional ppc pci dev/ppc/ppc_puc.c optional ppc puc dev/pst/pst-iop.c optional pst dev/pst/pst-pci.c optional pst pci dev/pst/pst-raid.c optional pst dev/puc/puc.c optional puc dev/puc/puc_cfg.c optional puc dev/puc/puc_pccard.c optional puc pccard dev/puc/puc_pci.c optional puc pci dev/puc/pucdata.c optional puc pci dev/quicc/quicc_core.c optional quicc dev/ral/rt2560.c optional ral dev/ral/rt2661.c optional ral dev/ral/if_ral_pci.c optional ral pci rt2561fw.c optional rt2561fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561.fw:rt2561fw -mrt2561 -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "rt2561fw.c" rt2561fw.fwo optional rt2561fw | ralfw \ dependency "rt2561.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561.fw" \ no-implicit-rule \ clean "rt2561.fwo" rt2561.fw optional rt2561fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561.fw.uu" \ no-obj no-implicit-rule \ clean "rt2561.fw" rt2561sfw.c optional rt2561sfw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2561s.fw:rt2561sfw -mrt2561s -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "rt2561sfw.c" rt2561sfw.fwo optional rt2561sfw | ralfw \ dependency "rt2561s.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2561s.fw" \ no-implicit-rule \ clean "rt2561s.fwo" rt2561s.fw optional rt2561sfw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2561s.fw.uu" \ no-obj no-implicit-rule \ clean "rt2561s.fw" rt2661fw.c optional rt2661fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2661.fw:rt2661fw -mrt2661 -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "rt2661fw.c" rt2661fw.fwo optional rt2661fw | ralfw \ dependency "rt2661.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2661.fw" \ no-implicit-rule \ clean "rt2661.fwo" rt2661.fw optional rt2661fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2661.fw.uu" \ no-obj no-implicit-rule \ clean "rt2661.fw" rt2860fw.c optional rt2860fw | ralfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rt2860.fw:rt2860fw -mrt2860 -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "rt2860fw.c" rt2860fw.fwo optional rt2860fw | ralfw \ dependency "rt2860.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} rt2860.fw" \ no-implicit-rule \ clean "rt2860.fwo" rt2860.fw optional rt2860fw | ralfw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/ral/rt2860.fw.uu" \ no-obj no-implicit-rule \ clean "rt2860.fw" dev/random/harvest.c standard dev/random/hash.c optional random dev/random/probe.c optional random dev/random/randomdev.c optional random dev/random/randomdev_soft.c optional random dev/random/yarrow.c optional random dev/ray/if_ray.c optional ray pccard dev/rc/rc.c optional rc dev/re/if_re.c optional re dev/rndtest/rndtest.c optional rndtest dev/rp/rp.c optional rp dev/rp/rp_isa.c optional rp isa dev/rp/rp_pci.c optional rp pci dev/safe/safe.c optional safe dev/sbsh/if_sbsh.c optional sbsh dev/scc/scc_if.m optional scc dev/scc/scc_bfe_ebus.c optional scc ebus dev/scc/scc_bfe_quicc.c optional scc quicc dev/scc/scc_bfe_sbus.c optional scc fhc | scc sbus dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc dev/scd/scd.c optional scd isa dev/scd/scd_isa.c optional scd isa dev/sf/if_sf.c optional sf pci dev/si/si.c optional si dev/si/si2_z280.c optional si dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci dev/sk/if_sk.c optional sk pci dev/smbus/smb.c optional smb dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus dev/smbus/smbus_if.m optional smbus dev/sn/if_sn.c optional sn dev/sn/if_sn_isa.c optional sn isa dev/sn/if_sn_pccard.c optional sn pccard dev/snp/snp.c optional snp dev/sound/clone.c optional sound dev/sound/unit.c optional sound dev/sound/isa/ad1816.c optional snd_ad1816 isa dev/sound/isa/ess.c optional snd_ess isa dev/sound/isa/gusc.c optional snd_gusc isa dev/sound/isa/mss.c optional snd_mss isa dev/sound/isa/sb16.c optional snd_sb16 isa dev/sound/isa/sb8.c optional snd_sb8 isa dev/sound/isa/sbc.c optional snd_sbc isa dev/sound/isa/sndbuf_dma.c optional sound isa dev/sound/pci/als4000.c optional snd_als4000 pci dev/sound/pci/atiixp.c optional snd_atiixp pci #dev/sound/pci/au88x0.c optional snd_au88x0 pci dev/sound/pci/cmi.c optional snd_cmi pci dev/sound/pci/cs4281.c optional snd_cs4281 pci dev/sound/pci/csa.c optional snd_csa pci \ warning "kernel contains GPL contaminated csaimg.h header" dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci \ dependency "emu10k1-alsa%diked.h" \ warning "kernel contains GPL contaminated emu10k1 headers" dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ dependency "p16v-alsa%diked.h" \ dependency "p17v-alsa%diked.h" \ warning "kernel contains GPL contaminated emu10kx headers" dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ dependency "p16v-alsa%diked.h" \ dependency "p17v-alsa%diked.h" \ warning "kernel contains GPL contaminated emu10kx headers" dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci \ dependency "emu10k1-alsa%diked.h" \ warning "kernel contains GPL contaminated emu10kx headers" dev/sound/pci/envy24.c optional snd_envy24 pci dev/sound/pci/envy24ht.c optional snd_envy24ht pci dev/sound/pci/es137x.c optional snd_es137x pci dev/sound/pci/fm801.c optional snd_fm801 pci dev/sound/pci/ich.c optional snd_ich pci dev/sound/pci/maestro.c optional snd_maestro pci dev/sound/pci/maestro3.c optional snd_maestro3 pci \ warning "kernel contains GPL contaminated maestro3 headers" dev/sound/pci/neomagic.c optional snd_neomagic pci dev/sound/pci/solo.c optional snd_solo pci dev/sound/pci/spicds.c optional snd_spicds pci dev/sound/pci/t4dwave.c optional snd_t4dwave pci dev/sound/pci/via8233.c optional snd_via8233 pci dev/sound/pci/via82c686.c optional snd_via82c686 pci dev/sound/pci/vibes.c optional snd_vibes pci dev/sound/pci/hda/hdac.c optional snd_hda pci dev/sound/pcm/ac97.c optional sound dev/sound/pcm/ac97_if.m optional sound dev/sound/pcm/ac97_patch.c optional sound dev/sound/pcm/buffer.c optional sound dev/sound/pcm/channel.c optional sound dev/sound/pcm/channel_if.m optional sound dev/sound/pcm/dsp.c optional sound dev/sound/pcm/fake.c optional sound dev/sound/pcm/feeder.c optional sound dev/sound/pcm/feeder_fmt.c optional sound dev/sound/pcm/feeder_if.m optional sound dev/sound/pcm/feeder_rate.c optional sound dev/sound/pcm/feeder_volume.c optional sound dev/sound/pcm/mixer.c optional sound dev/sound/pcm/mixer_if.m optional sound dev/sound/pcm/sndstat.c optional sound dev/sound/pcm/sound.c optional sound dev/sound/pcm/vchan.c optional sound #dev/sound/usb/upcm.c optional snd_upcm usb dev/sound/usb/uaudio.c optional snd_uaudio usb dev/sound/usb/uaudio_pcm.c optional snd_uaudio usb dev/sound/midi/midi.c optional sound dev/sound/midi/mpu401.c optional sound dev/sound/midi/mpu_if.m optional sound dev/sound/midi/mpufoi_if.m optional sound dev/sound/midi/sequencer.c optional sound dev/sound/midi/synth_if.m optional sound dev/spibus/spibus.c optional spibus \ dependency "spibus_if.h" dev/spibus/spibus_if.m optional spibus dev/sr/if_sr.c optional sr dev/sr/if_sr_pci.c optional sr pci dev/stg/tmc18c30.c optional stg dev/stg/tmc18c30_isa.c optional stg isa dev/stg/tmc18c30_pccard.c optional stg pccard dev/stg/tmc18c30_pci.c optional stg pci dev/stg/tmc18c30_subr.c optional stg dev/stge/if_stge.c optional stge dev/streams/streams.c optional streams dev/sym/sym_hipd.c optional sym \ dependency "$S/dev/sym/sym_{conf,defs}.h" dev/syscons/blank/blank_saver.c optional blank_saver dev/syscons/daemon/daemon_saver.c optional daemon_saver dev/syscons/dragon/dragon_saver.c optional dragon_saver dev/syscons/fade/fade_saver.c optional fade_saver dev/syscons/fire/fire_saver.c optional fire_saver dev/syscons/green/green_saver.c optional green_saver dev/syscons/logo/logo.c optional logo_saver dev/syscons/logo/logo_saver.c optional logo_saver dev/syscons/rain/rain_saver.c optional rain_saver dev/syscons/schistory.c optional sc dev/syscons/scmouse.c optional sc dev/syscons/scterm-dumb.c optional sc dev/syscons/scterm.c optional sc dev/syscons/scvidctl.c optional sc dev/syscons/snake/snake_saver.c optional snake_saver dev/syscons/star/star_saver.c optional star_saver dev/syscons/syscons.c optional sc dev/syscons/sysmouse.c optional sc dev/syscons/warp/warp_saver.c optional warp_saver dev/tdfx/tdfx_linux.c optional tdfx_linux tdfx compat_linux dev/tdfx/tdfx_pci.c optional tdfx pci dev/ti/if_ti.c optional ti pci dev/trm/trm.c optional trm dev/twa/tw_cl_init.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_cl_intr.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_cl_io.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_cl_misc.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_osl_cam.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twa/tw_osl_freebsd.c optional twa \ compile-with "${NORMAL_C} -I$S/dev/twa" dev/twe/twe.c optional twe dev/twe/twe_freebsd.c optional twe dev/tx/if_tx.c optional tx dev/txp/if_txp.c optional txp dev/uart/uart_bus_acpi.c optional uart acpi #dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus dev/uart/uart_bus_isa.c optional uart isa dev/uart/uart_bus_pccard.c optional uart pccard dev/uart/uart_bus_pci.c optional uart pci dev/uart/uart_bus_puc.c optional uart puc dev/uart/uart_bus_scc.c optional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.c optional uart gdb dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 dev/uart/uart_dev_quicc.c optional uart quicc dev/uart/uart_dev_sab82532.c optional uart uart_sab82532 dev/uart/uart_dev_sab82532.c optional uart scc dev/uart/uart_dev_z8530.c optional uart uart_z8530 dev/uart/uart_dev_z8530.c optional uart scc dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.c optional uart dev/ubsec/ubsec.c optional ubsec # # USB support dev/usb/ehci.c optional ehci dev/usb/ehci_pci.c optional ehci pci dev/usb/hid.c optional usb dev/usb/if_aue.c optional aue dev/usb/if_axe.c optional axe dev/usb/if_cdce.c optional cdce dev/usb/if_cue.c optional cue dev/usb/if_kue.c optional kue dev/usb/if_ural.c optional ural dev/usb/if_rue.c optional rue dev/usb/if_rum.c optional rum dev/usb/if_udav.c optional udav dev/usb/if_zyd.c optional zyd dev/usb/ohci.c optional ohci dev/usb/ohci_pci.c optional ohci pci dev/usb/sl811hs.c optional slhci dev/usb/slhci_pccard.c optional slhci pccard dev/usb/uark.c optional uark dev/usb/ubsa.c optional ubsa dev/usb/ubser.c optional ubser dev/usb/ucom.c optional ucom dev/usb/ucycom.c optional ucycom dev/usb/udbp.c optional udbp dev/usb/ufoma.c optional ufoma dev/usb/ufm.c optional ufm dev/usb/uftdi.c optional uftdi dev/usb/ugen.c optional ugen dev/usb/uhci.c optional uhci dev/usb/uhci_pci.c optional uhci pci dev/usb/uhid.c optional uhid dev/usb/uhub.c optional usb dev/usb/uipaq.c optional uipaq dev/usb/ukbd.c optional ukbd dev/usb/ulpt.c optional ulpt dev/usb/umass.c optional umass dev/usb/umct.c optional umct dev/usb/umodem.c optional umodem dev/usb/ums.c optional ums dev/usb/uplcom.c optional uplcom dev/usb/urio.c optional urio dev/usb/usb.c optional usb dev/usb/usb_ethersubr.c optional usb dev/usb/usb_if.m optional usb dev/usb/usb_mem.c optional usb dev/usb/usb_quirks.c optional usb dev/usb/usb_subr.c optional usb dev/usb/usbdi.c optional usb dev/usb/usbdi_util.c optional usb dev/usb/uscanner.c optional uscanner dev/usb/uslcom.c optional uslcom dev/usb/uvisor.c optional uvisor dev/usb/uvscom.c optional uvscom dev/utopia/idtphy.c optional utopia dev/utopia/suni.c optional utopia dev/utopia/utopia.c optional utopia dev/vge/if_vge.c optional vge dev/vkbd/vkbd.c optional vkbd dev/vr/if_vr.c optional vr pci dev/vx/if_vx.c optional vx dev/vx/if_vx_eisa.c optional vx eisa dev/vx/if_vx_pci.c optional vx pci dev/watchdog/watchdog.c standard dev/wds/wd7000.c optional wds isa dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci dev/wl/if_wl.c optional wl isa wpifw.c optional wpifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:2144 -lintel_wpi -mwpi -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "wpifw.c" wpifw.fwo optional wpifw \ dependency "wpi.fw" \ compile-with "${LD} -b binary -d -warn-common -r -d -o ${.TARGET} wpi.fw" \ no-implicit-rule \ clean "wpi.fwo" wpi.fw optional wpifw \ dependency ".PHONY" \ compile-with "uudecode -o ${.TARGET} $S/contrib/dev/wpi/iwlwifi-3945-2.14.4.fw.uu" \ no-obj no-implicit-rule \ clean "wpi.fw" dev/xe/if_xe.c optional xe dev/xe/if_xe_pccard.c optional xe pccard fs/coda/coda_fbsd.c optional vcoda fs/coda/coda_psdev.c optional vcoda fs/coda/coda_subr.c optional vcoda fs/coda/coda_venus.c optional vcoda fs/coda/coda_vfsops.c optional vcoda fs/coda/coda_vnops.c optional vcoda fs/deadfs/dead_vnops.c standard fs/devfs/devfs_devs.c standard fs/devfs/devfs_rule.c standard fs/devfs/devfs_vfsops.c standard fs/devfs/devfs_vnops.c standard fs/fdescfs/fdesc_vfsops.c optional fdescfs fs/fdescfs/fdesc_vnops.c optional fdescfs fs/fifofs/fifo_vnops.c standard fs/hpfs/hpfs_alsubr.c optional hpfs fs/hpfs/hpfs_lookup.c optional hpfs fs/hpfs/hpfs_subr.c optional hpfs fs/hpfs/hpfs_vfsops.c optional hpfs fs/hpfs/hpfs_vnops.c optional hpfs fs/msdosfs/msdosfs_conv.c optional msdosfs fs/msdosfs/msdosfs_denode.c optional msdosfs fs/msdosfs/msdosfs_fat.c optional msdosfs fs/msdosfs/msdosfs_fileno.c optional msdosfs fs/msdosfs/msdosfs_iconv.c optional msdosfs_iconv fs/msdosfs/msdosfs_lookup.c optional msdosfs fs/msdosfs/msdosfs_vfsops.c optional msdosfs fs/msdosfs/msdosfs_vnops.c optional msdosfs fs/ntfs/ntfs_compr.c optional ntfs fs/ntfs/ntfs_iconv.c optional ntfs_iconv fs/ntfs/ntfs_ihash.c optional ntfs fs/ntfs/ntfs_subr.c optional ntfs fs/ntfs/ntfs_vfsops.c optional ntfs fs/ntfs/ntfs_vnops.c optional ntfs fs/nullfs/null_subr.c optional nullfs fs/nullfs/null_vfsops.c optional nullfs fs/nullfs/null_vnops.c optional nullfs fs/nwfs/nwfs_io.c optional nwfs fs/nwfs/nwfs_ioctl.c optional nwfs fs/nwfs/nwfs_node.c optional nwfs fs/nwfs/nwfs_subr.c optional nwfs fs/nwfs/nwfs_vfsops.c optional nwfs fs/nwfs/nwfs_vnops.c optional nwfs fs/portalfs/portal_vfsops.c optional portalfs fs/portalfs/portal_vnops.c optional portalfs fs/procfs/procfs.c optional procfs fs/procfs/procfs_ctl.c optional procfs fs/procfs/procfs_dbregs.c optional procfs fs/procfs/procfs_fpregs.c optional procfs fs/procfs/procfs_ioctl.c optional procfs fs/procfs/procfs_map.c optional procfs fs/procfs/procfs_mem.c optional procfs fs/procfs/procfs_note.c optional procfs fs/procfs/procfs_regs.c optional procfs fs/procfs/procfs_rlimit.c optional procfs fs/procfs/procfs_status.c optional procfs fs/procfs/procfs_type.c optional procfs fs/pseudofs/pseudofs.c optional pseudofs fs/pseudofs/pseudofs_fileno.c optional pseudofs fs/pseudofs/pseudofs_vncache.c optional pseudofs fs/pseudofs/pseudofs_vnops.c optional pseudofs fs/smbfs/smbfs_io.c optional smbfs fs/smbfs/smbfs_node.c optional smbfs fs/smbfs/smbfs_smb.c optional smbfs fs/smbfs/smbfs_subr.c optional smbfs fs/smbfs/smbfs_vfsops.c optional smbfs fs/smbfs/smbfs_vnops.c optional smbfs fs/udf/osta.c optional udf fs/udf/udf_iconv.c optional udf_iconv fs/udf/udf_vfsops.c optional udf fs/udf/udf_vnops.c optional udf fs/unionfs/union_subr.c optional unionfs fs/unionfs/union_vfsops.c optional unionfs fs/unionfs/union_vnops.c optional unionfs fs/tmpfs/tmpfs_vnops.c optional tmpfs fs/tmpfs/tmpfs_fifoops.c optional tmpfs fs/tmpfs/tmpfs_vfsops.c optional tmpfs fs/tmpfs/tmpfs_subr.c optional tmpfs gdb/gdb_cons.c optional gdb gdb/gdb_main.c optional gdb gdb/gdb_packet.c optional gdb geom/bde/g_bde.c optional geom_bde geom/bde/g_bde_crypt.c optional geom_bde geom/bde/g_bde_lock.c optional geom_bde geom/bde/g_bde_work.c optional geom_bde geom/cache/g_cache.c optional geom_cache geom/concat/g_concat.c optional geom_concat geom/eli/g_eli.c optional geom_eli geom/eli/g_eli_crypto.c optional geom_eli geom/eli/g_eli_ctl.c optional geom_eli geom/eli/g_eli_integrity.c optional geom_eli geom/eli/g_eli_key.c optional geom_eli geom/eli/g_eli_privacy.c optional geom_eli geom/eli/pkcs5v2.c optional geom_eli geom/gate/g_gate.c optional geom_gate geom/geom_aes.c optional geom_aes geom/geom_bsd.c optional geom_bsd geom/geom_bsd_enc.c optional geom_bsd geom/geom_ccd.c optional ccd | geom_ccd geom/geom_ctl.c standard geom/geom_dev.c standard geom/geom_disk.c standard geom/geom_dump.c standard geom/geom_event.c standard geom/geom_fox.c optional geom_fox geom/geom_io.c standard geom/geom_kern.c standard geom/geom_mbr.c optional geom_mbr geom/geom_mbr_enc.c optional geom_mbr geom/geom_pc98.c optional geom_pc98 geom/geom_pc98_enc.c optional geom_pc98 geom/geom_slice.c standard geom/geom_subr.c standard geom/geom_sunlabel.c optional geom_sunlabel geom/geom_sunlabel_enc.c optional geom_sunlabel geom/geom_vfs.c standard geom/geom_vol_ffs.c optional geom_vol geom/journal/g_journal.c optional geom_journal geom/journal/g_journal_ufs.c optional geom_journal geom/label/g_label.c optional geom_label geom/label/g_label_ext2fs.c optional geom_label geom/label/g_label_iso9660.c optional geom_label geom/label/g_label_msdosfs.c optional geom_label geom/label/g_label_ntfs.c optional geom_label geom/label/g_label_reiserfs.c optional geom_label geom/label/g_label_ufs.c optional geom_label geom/linux_lvm/g_linux_lvm.c optional geom_linux_lvm geom/mirror/g_mirror.c optional geom_mirror geom/mirror/g_mirror_ctl.c optional geom_mirror geom/multipath/g_multipath.c optional geom_multipath geom/nop/g_nop.c optional geom_nop geom/part/g_part.c standard geom/part/g_part_if.m standard geom/part/g_part_apm.c optional geom_part_apm geom/part/g_part_bsd.c optional geom_part_bsd geom/part/g_part_gpt.c optional geom_part_gpt geom/part/g_part_mbr.c optional geom_part_mbr geom/part/g_part_pc98.c optional geom_part_pc98 geom/part/g_part_vtoc8.c optional geom_part_vtoc8 geom/raid3/g_raid3.c optional geom_raid3 geom/raid3/g_raid3_ctl.c optional geom_raid3 geom/shsec/g_shsec.c optional geom_shsec geom/stripe/g_stripe.c optional geom_stripe geom/uzip/g_uzip.c optional geom_uzip geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.c optional geom_virstor geom/zero/g_zero.c optional geom_zero gnu/fs/ext2fs/ext2_alloc.c optional ext2fs \ warning "kernel contains GPL contaminated ext2fs filesystem" gnu/fs/ext2fs/ext2_balloc.c optional ext2fs gnu/fs/ext2fs/ext2_bmap.c optional ext2fs gnu/fs/ext2fs/ext2_inode.c optional ext2fs gnu/fs/ext2fs/ext2_inode_cnv.c optional ext2fs gnu/fs/ext2fs/ext2_linux_balloc.c optional ext2fs gnu/fs/ext2fs/ext2_linux_ialloc.c optional ext2fs gnu/fs/ext2fs/ext2_lookup.c optional ext2fs gnu/fs/ext2fs/ext2_subr.c optional ext2fs gnu/fs/ext2fs/ext2_vfsops.c optional ext2fs gnu/fs/ext2fs/ext2_vnops.c optional ext2fs gnu/fs/reiserfs/reiserfs_hashes.c optional reiserfs \ warning "kernel contains GPL contaminated ReiserFS filesystem" gnu/fs/reiserfs/reiserfs_inode.c optional reiserfs gnu/fs/reiserfs/reiserfs_item_ops.c optional reiserfs gnu/fs/reiserfs/reiserfs_namei.c optional reiserfs gnu/fs/reiserfs/reiserfs_prints.c optional reiserfs gnu/fs/reiserfs/reiserfs_stree.c optional reiserfs gnu/fs/reiserfs/reiserfs_vfsops.c optional reiserfs gnu/fs/reiserfs/reiserfs_vnops.c optional reiserfs # # isdn4bsd device drivers # i4b/driver/i4b_trace.c optional i4btrc i4b/driver/i4b_rbch.c optional i4brbch i4b/driver/i4b_tel.c optional i4btel #XXXBZ#i4b/driver/i4b_ipr.c optional i4bipr net/slcompress.c optional i4bipr | i4bisppp i4b/driver/i4b_ctl.c optional i4bctl #XXXBZ#i4b/driver/i4b_ing.c optional i4bing #XXXBZ#i4b/driver/i4b_isppp.c optional i4bisppp # # isdn4bsd CAPI driver # i4b/capi/capi_l4if.c optional i4bcapi i4b/capi/capi_llif.c optional i4bcapi i4b/capi/capi_msgs.c optional i4bcapi # # isdn4bsd AVM B1/T1 CAPI driver # i4b/capi/iavc/iavc_pci.c optional iavc i4bcapi pci i4b/capi/iavc/iavc_isa.c optional iavc i4bcapi isa i4b/capi/iavc/iavc_lli.c optional iavc i4bcapi i4b/capi/iavc/iavc_card.c optional iavc i4bcapi # # isdn4bsd support # i4b/layer2/i4b_mbuf.c optional i4btrc # # isdn4bsd Q.921 handler # i4b/layer2/i4b_l2.c optional i4bq921 i4b/layer2/i4b_l2fsm.c optional i4bq921 i4b/layer2/i4b_uframe.c optional i4bq921 i4b/layer2/i4b_tei.c optional i4bq921 i4b/layer2/i4b_sframe.c optional i4bq921 i4b/layer2/i4b_iframe.c optional i4bq921 i4b/layer2/i4b_l2timer.c optional i4bq921 i4b/layer2/i4b_util.c optional i4bq921 i4b/layer2/i4b_lme.c optional i4bq921 # # isdn4bsd Q.931 handler # i4b/layer3/i4b_q931.c optional i4bq931 i4b/layer3/i4b_l3fsm.c optional i4bq931 i4b/layer3/i4b_l3timer.c optional i4bq931 i4b/layer3/i4b_l2if.c optional i4bq931 i4b/layer3/i4b_l4if.c optional i4bq931 i4b/layer3/i4b_q932fac.c optional i4bq931 # # isdn4bsd control device driver, interface to isdnd # i4b/layer4/i4b_i4bdrv.c optional i4b i4b/layer4/i4b_l4.c optional i4b i4b/layer4/i4b_l4mgmt.c optional i4b i4b/layer4/i4b_l4timer.c optional i4b # isa/isa_if.m standard isa/isa_common.c optional isa isa/isahint.c optional isa isa/orm.c optional isa isa/pnp.c optional isa isapnp isa/pnpparse.c optional isa isapnp fs/cd9660/cd9660_bmap.c optional cd9660 fs/cd9660/cd9660_lookup.c optional cd9660 fs/cd9660/cd9660_node.c optional cd9660 fs/cd9660/cd9660_rrip.c optional cd9660 fs/cd9660/cd9660_util.c optional cd9660 fs/cd9660/cd9660_vfsops.c optional cd9660 fs/cd9660/cd9660_vnops.c optional cd9660 fs/cd9660/cd9660_iconv.c optional cd9660_iconv kern/bus_if.m standard kern/clock_if.m standard kern/cpufreq_if.m standard kern/device_if.m standard kern/imgact_elf.c standard kern/imgact_shell.c standard kern/inflate.c optional gzip kern/init_main.c standard kern/init_sysent.c standard kern/ksched.c optional _kposix_priority_scheduling kern/kern_acct.c standard kern/kern_alq.c optional alq kern/kern_clock.c standard kern/kern_condvar.c standard kern/kern_conf.c standard kern/kern_cpu.c standard kern/kern_cpuset.c standard kern/kern_context.c standard kern/kern_descrip.c standard kern/kern_dtrace.c optional kdtrace_hooks kern/kern_environment.c standard kern/kern_event.c standard kern/kern_exec.c standard kern/kern_exit.c standard kern/kern_fork.c standard kern/kern_idle.c standard kern/kern_intr.c standard kern/kern_jail.c standard kern/kern_kthread.c standard kern/kern_ktr.c optional ktr kern/kern_ktrace.c standard kern/kern_linker.c standard kern/kern_lock.c standard kern/kern_lockf.c standard kern/kern_malloc.c standard kern/kern_mbuf.c standard kern/kern_mib.c standard kern/kern_module.c standard kern/kern_mtxpool.c standard kern/kern_mutex.c standard kern/kern_ntptime.c standard kern/kern_physio.c standard kern/kern_pmc.c standard kern/kern_poll.c optional device_polling kern/kern_priv.c standard kern/kern_proc.c standard kern/kern_prot.c standard kern/kern_resource.c standard kern/kern_rmlock.c standard kern/kern_rwlock.c standard kern/kern_sdt.c optional kdtrace_hooks kern/kern_sema.c standard kern/kern_shutdown.c standard kern/kern_sig.c standard kern/kern_subr.c standard kern/kern_switch.c standard kern/kern_sx.c standard kern/kern_synch.c standard kern/kern_syscalls.c standard kern/kern_sysctl.c standard kern/kern_tc.c standard kern/kern_thr.c standard kern/kern_thread.c standard kern/kern_time.c standard kern/kern_timeout.c standard kern/kern_umtx.c standard kern/kern_uuid.c standard kern/kern_xxx.c standard kern/link_elf.c standard kern/linker_if.m standard kern/md4c.c optional netsmb kern/md5c.c standard kern/p1003_1b.c standard kern/posix4_mib.c standard kern/sched_4bsd.c optional sched_4bsd kern/sched_ule.c optional sched_ule kern/serdev_if.m standard kern/subr_acl_posix1e.c standard kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_bus.c standard kern/subr_clock.c standard kern/subr_devstat.c standard kern/subr_disk.c standard kern/subr_eventhandler.c standard kern/subr_fattime.c standard kern/subr_firmware.c optional firmware kern/subr_hints.c standard kern/subr_kdb.c standard kern/subr_kobj.c standard kern/subr_lock.c standard kern/subr_log.c standard kern/subr_mbpool.c optional libmbpool kern/subr_mchain.c optional libmchain kern/subr_module.c standard kern/subr_msgbuf.c standard kern/subr_param.c standard kern/subr_pcpu.c standard kern/subr_power.c standard kern/subr_prf.c standard kern/subr_prof.c standard kern/subr_rman.c standard kern/subr_rtc.c standard kern/subr_sbuf.c standard kern/subr_scanf.c standard kern/subr_sleepqueue.c standard kern/subr_smp.c standard kern/subr_stack.c optional ddb | stack kern/subr_taskqueue.c standard kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_unit.c standard kern/subr_witness.c optional witness kern/sys_generic.c standard kern/sys_pipe.c standard kern/sys_process.c standard kern/sys_socket.c standard kern/syscalls.c optional witness | invariants | kdtrace_hooks kern/sysv_ipc.c standard kern/sysv_msg.c optional sysvmsg kern/sysv_sem.c optional sysvsem kern/sysv_shm.c optional sysvshm kern/tty.c standard kern/tty_compat.c optional compat_43tty kern/tty_conf.c standard kern/tty_cons.c standard kern/tty_pts.c optional pty kern/tty_pty.c optional pty kern/tty_subr.c standard kern/tty_tty.c standard kern/uipc_accf.c optional inet kern/uipc_cow.c optional zero_copy_sockets kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard kern/uipc_mbuf2.c standard kern/uipc_mqueue.c optional p1003_1b_mqueue kern/uipc_sem.c optional p1003_1b_semaphores kern/uipc_shm.c standard kern/uipc_sockbuf.c standard kern/uipc_socket.c standard kern/uipc_syscalls.c standard kern/uipc_usrreq.c standard kern/vfs_acl.c standard kern/vfs_aio.c optional vfs_aio kern/vfs_bio.c standard kern/vfs_cache.c standard kern/vfs_cluster.c standard kern/vfs_default.c standard kern/vfs_export.c standard kern/vfs_extattr.c standard kern/vfs_hash.c standard kern/vfs_init.c standard kern/vfs_lookup.c standard kern/vfs_mount.c standard kern/vfs_subr.c standard kern/vfs_syscalls.c standard kern/vfs_vnops.c standard # # These files in libkern/ are those needed by all architectures. Some # of the files in libkern/ are only needed on some architectures, e.g., # libkern/divdi3.c is needed by i386 but not alpha. Also, some of these # routines may be optimized for a particular platform. In either case, # the file should be moved to conf/files. from here. # libkern/arc4random.c standard libkern/bcd.c standard libkern/bsearch.c standard libkern/crc32.c standard libkern/fnmatch.c standard libkern/gets.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv libkern/iconv_xlat.c optional libiconv libkern/iconv_xlat16.c optional libiconv libkern/index.c standard libkern/inet_ntoa.c standard libkern/mcount.c optional profiling-routine libkern/qsort.c standard libkern/qsort_r.c standard libkern/random.c standard libkern/rindex.c standard libkern/scanc.c standard libkern/skpc.c standard libkern/strcasecmp.c standard libkern/strcat.c standard libkern/strcmp.c standard libkern/strcpy.c standard libkern/strdup.c standard libkern/strlcat.c standard libkern/strlcpy.c standard libkern/strlen.c standard libkern/strncmp.c standard libkern/strncpy.c standard libkern/strsep.c standard libkern/strspn.c standard libkern/strstr.c standard libkern/strtol.c standard libkern/strtoq.c standard libkern/strtoul.c standard libkern/strtouq.c standard libkern/strvalid.c standard net/bpf.c standard net/bpf_buffer.c optional bpf net/bpf_jitter.c optional bpf_jitter net/bpf_filter.c optional bpf | netgraph_bpf net/bpf_zerocopy.c optional bpf net/bridgestp.c optional bridge | if_bridge net/bsd_comp.c optional ppp_bsdcomp net/ieee8023ad_lacp.c optional lagg net/if.c standard net/if_arcsubr.c optional arcnet net/if_atmsubr.c optional atm net/if_bridge.c optional bridge | if_bridge net/if_clone.c standard net/if_disc.c optional disc net/if_edsc.c optional edsc net/if_ef.c optional ef net/if_enc.c optional enc net/if_ethersubr.c optional ether \ compile-with "${NORMAL_C} -I$S/contrib/pf" net/if_faith.c optional faith net/if_fddisubr.c optional fddi net/if_fwsubr.c optional fwip net/if_gif.c optional gif net/if_gre.c optional gre net/if_iso88025subr.c optional token net/if_lagg.c optional lagg net/if_loop.c optional loop net/if_media.c standard net/if_mib.c standard net/if_ppp.c optional ppp net/if_sl.c optional sl net/if_spppfr.c optional i4bisppp | sppp | netgraph_sppp net/if_spppsubr.c optional i4bisppp | sppp | netgraph_sppp net/if_stf.c optional stf net/if_tun.c optional tun net/if_tap.c optional tap net/if_vlan.c optional vlan net/mppcc.c optional netgraph_mppc_compression net/mppcd.c optional netgraph_mppc_compression net/netisr.c standard net/ppp_deflate.c optional ppp_deflate net/ppp_tty.c optional ppp net/pfil.c optional ether | inet net/radix.c standard net/radix_mpath.c standard net/raw_cb.c standard net/raw_usrreq.c standard net/route.c standard net/rtsock.c standard net/slcompress.c optional netgraph_vjc | ppp | sl | sppp | \ netgraph_sppp net/zlib.c optional crypto | geom_uzip | ipsec | \ mxge | ppp_deflate | netgraph_deflate | \ ddb_ctf net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan_acl net80211/ieee80211_adhoc.c optional wlan net80211/ieee80211_amrr.c optional wlan_amrr net80211/ieee80211_crypto.c optional wlan net80211/ieee80211_crypto_ccmp.c optional wlan_ccmp net80211/ieee80211_crypto_none.c optional wlan net80211/ieee80211_crypto_tkip.c optional wlan_tkip net80211/ieee80211_crypto_wep.c optional wlan_wep net80211/ieee80211_ddb.c optional wlan ddb net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan net80211/ieee80211_hostap.c optional wlan net80211/ieee80211_ht.c optional wlan net80211/ieee80211_input.c optional wlan net80211/ieee80211_ioctl.c optional wlan net80211/ieee80211_monitor.c optional wlan net80211/ieee80211_node.c optional wlan net80211/ieee80211_output.c optional wlan net80211/ieee80211_phy.c optional wlan net80211/ieee80211_power.c optional wlan net80211/ieee80211_proto.c optional wlan net80211/ieee80211_regdomain.c optional wlan net80211/ieee80211_rssadapt.c optional wlan_rssadapt net80211/ieee80211_scan.c optional wlan net80211/ieee80211_scan_sta.c optional wlan net80211/ieee80211_sta.c optional wlan net80211/ieee80211_wds.c optional wlan net80211/ieee80211_xauth.c optional wlan_xauth netatalk/aarp.c optional netatalk netatalk/at_control.c optional netatalk netatalk/at_proto.c optional netatalk netatalk/at_rmx.c optional netatalkdebug netatalk/ddp_input.c optional netatalk netatalk/ddp_output.c optional netatalk netatalk/ddp_pcb.c optional netatalk netatalk/ddp_usrreq.c optional netatalk -# -# netatm has been disconnected from the build until it is MPSAFE, or -# alternatively, until it is removed. -# -#netatm/atm_aal5.c optional atm_core -#netatm/atm_cm.c optional atm_core -#netatm/atm_device.c optional atm_core -#netatm/atm_if.c optional atm_core -#netatm/atm_proto.c optional atm_core -#netatm/atm_signal.c optional atm_core -#netatm/atm_socket.c optional atm_core -#netatm/atm_subr.c optional atm_core -#netatm/atm_usrreq.c optional atm_core -#netatm/ipatm/ipatm_event.c optional atm_ip atm_core -#netatm/ipatm/ipatm_if.c optional atm_ip atm_core -#netatm/ipatm/ipatm_input.c optional atm_ip atm_core -#netatm/ipatm/ipatm_load.c optional atm_ip atm_core -#netatm/ipatm/ipatm_output.c optional atm_ip atm_core -#netatm/ipatm/ipatm_usrreq.c optional atm_ip atm_core -#netatm/ipatm/ipatm_vcm.c optional atm_ip atm_core -#netatm/sigpvc/sigpvc_if.c optional atm_sigpvc atm_core -#netatm/sigpvc/sigpvc_subr.c optional atm_sigpvc atm_core -#netatm/spans/spans_arp.c optional atm_spans atm_core \ -# dependency "spans_xdr.h" -#netatm/spans/spans_cls.c optional atm_spans atm_core -#netatm/spans/spans_if.c optional atm_spans atm_core -#netatm/spans/spans_kxdr.c optional atm_spans atm_core -#netatm/spans/spans_msg.c optional atm_spans atm_core -#netatm/spans/spans_print.c optional atm_spans atm_core -#netatm/spans/spans_proto.c optional atm_spans atm_core -#netatm/spans/spans_subr.c optional atm_spans atm_core -#netatm/spans/spans_util.c optional atm_spans atm_core -#spans_xdr.h optional atm_spans atm_core \ -# before-depend \ -# dependency "$S/netatm/spans/spans_xdr.x" \ -# compile-with "rpcgen -h -C $S/netatm/spans/spans_xdr.x | grep -v rpc/rpc.h > spans_xdr.h" \ -# clean "spans_xdr.h" \ -# no-obj no-implicit-rule -#spans_xdr.c optional atm_spans atm_core \ -# before-depend \ -# dependency "$S/netatm/spans/spans_xdr.x" \ -# compile-with "rpcgen -c -C $S/netatm/spans/spans_xdr.x | grep -v rpc/rpc.h > spans_xdr.c" \ -# clean "spans_xdr.c" \ -# no-obj no-implicit-rule local -#spans_xdr.o optional atm_spans atm_core \ -# dependency "$S/netatm/spans/spans_xdr.x" \ -# compile-with "${NORMAL_C}" \ -# no-implicit-rule local -#netatm/uni/q2110_sigaa.c optional atm_uni atm_core -#netatm/uni/q2110_sigcpcs.c optional atm_uni atm_core -#netatm/uni/q2110_subr.c optional atm_uni atm_core -#netatm/uni/qsaal1_sigaa.c optional atm_uni atm_core -#netatm/uni/qsaal1_sigcpcs.c optional atm_uni atm_core -#netatm/uni/qsaal1_subr.c optional atm_uni atm_core -#netatm/uni/sscf_uni.c optional atm_uni atm_core -#netatm/uni/sscf_uni_lower.c optional atm_uni atm_core -#netatm/uni/sscf_uni_upper.c optional atm_uni atm_core -#netatm/uni/sscop.c optional atm_uni atm_core -#netatm/uni/sscop_lower.c optional atm_uni atm_core -#netatm/uni/sscop_pdu.c optional atm_uni atm_core -#netatm/uni/sscop_sigaa.c optional atm_uni atm_core -#netatm/uni/sscop_sigcpcs.c optional atm_uni atm_core -#netatm/uni/sscop_subr.c optional atm_uni atm_core -#netatm/uni/sscop_timer.c optional atm_uni atm_core -#netatm/uni/sscop_upper.c optional atm_uni atm_core -#netatm/uni/uni_load.c optional atm_uni atm_core -#netatm/uni/uniarp.c optional atm_uni atm_core -#netatm/uni/uniarp_cache.c optional atm_uni atm_core -#netatm/uni/uniarp_input.c optional atm_uni atm_core -#netatm/uni/uniarp_output.c optional atm_uni atm_core -#netatm/uni/uniarp_timer.c optional atm_uni atm_core -#netatm/uni/uniarp_vcm.c optional atm_uni atm_core -#netatm/uni/uniip.c optional atm_uni atm_core -#netatm/uni/unisig_decode.c optional atm_uni atm_core -#netatm/uni/unisig_encode.c optional atm_uni atm_core -#netatm/uni/unisig_if.c optional atm_uni atm_core -#netatm/uni/unisig_mbuf.c optional atm_uni atm_core -#netatm/uni/unisig_msg.c optional atm_uni atm_core -#netatm/uni/unisig_print.c optional atm_uni atm_core -#netatm/uni/unisig_proto.c optional atm_uni atm_core -#netatm/uni/unisig_sigmgr_state.c optional atm_uni atm_core -#netatm/uni/unisig_subr.c optional atm_uni atm_core -#netatm/uni/unisig_util.c optional atm_uni atm_core -#netatm/uni/unisig_vc_state.c optional atm_uni atm_core -#netgraph/atm/atmpif/ng_atmpif.c optional netgraph_atm_atmpif -#netgraph/atm/atmpif/ng_atmpif_harp.c optional netgraph_atm_atmpif netgraph/atm/ccatm/ng_ccatm.c optional ngatm_ccatm \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/atm/ng_atm.c optional ngatm_atm netgraph/atm/ngatmbase.c optional ngatm_atmbase \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/atm/sscfu/ng_sscfu.c optional ngatm_sscfu \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/atm/sscop/ng_sscop.c optional ngatm_sscop \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/atm/uni/ng_uni.c optional ngatm_uni \ compile-with "${NORMAL_C} -I$S/contrib/ngatm" netgraph/bluetooth/common/ng_bluetooth.c optional netgraph_bluetooth netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c optional netgraph_bluetooth_bt3c netgraph/bluetooth/drivers/h4/ng_h4.c optional netgraph_bluetooth_h4 netgraph/bluetooth/drivers/ubt/ng_ubt.c optional netgraph_bluetooth_ubt netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c optional netgraph_bluetooth_ubtbcmfw netgraph/bluetooth/hci/ng_hci_cmds.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_evnt.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_main.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_misc.c optional netgraph_bluetooth_hci netgraph/bluetooth/hci/ng_hci_ulpi.c optional netgraph_bluetooth_hci netgraph/bluetooth/l2cap/ng_l2cap_cmds.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/l2cap/ng_l2cap_evnt.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/l2cap/ng_l2cap_llpi.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/l2cap/ng_l2cap_main.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/l2cap/ng_l2cap_misc.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c optional netgraph_bluetooth_l2cap netgraph/bluetooth/socket/ng_btsocket.c optional netgraph_bluetooth_socket netgraph/bluetooth/socket/ng_btsocket_hci_raw.c optional netgraph_bluetooth_socket netgraph/bluetooth/socket/ng_btsocket_l2cap.c optional netgraph_bluetooth_socket netgraph/bluetooth/socket/ng_btsocket_l2cap_raw.c optional netgraph_bluetooth_socket netgraph/bluetooth/socket/ng_btsocket_rfcomm.c optional netgraph_bluetooth_socket netgraph/netflow/netflow.c optional netgraph_netflow netgraph/netflow/ng_netflow.c optional netgraph_netflow netgraph/ng_UI.c optional netgraph_UI netgraph/ng_async.c optional netgraph_async netgraph/ng_atmllc.c optional netgraph_atmllc netgraph/ng_base.c optional netgraph netgraph/ng_bpf.c optional netgraph_bpf netgraph/ng_bridge.c optional netgraph_bridge netgraph/ng_car.c optional netgraph_car netgraph/ng_cisco.c optional netgraph_cisco netgraph/ng_deflate.c optional netgraph_deflate netgraph/ng_device.c optional netgraph_device netgraph/ng_echo.c optional netgraph_echo netgraph/ng_eiface.c optional netgraph_eiface netgraph/ng_ether.c optional netgraph_ether netgraph/ng_fec.c optional netgraph_fec netgraph/ng_frame_relay.c optional netgraph_frame_relay netgraph/ng_gif.c optional netgraph_gif netgraph/ng_gif_demux.c optional netgraph_gif_demux netgraph/ng_hole.c optional netgraph_hole netgraph/ng_iface.c optional netgraph_iface netgraph/ng_ip_input.c optional netgraph_ip_input netgraph/ng_ipfw.c optional netgraph_ipfw netgraph/ng_ksocket.c optional netgraph_ksocket netgraph/ng_l2tp.c optional netgraph_l2tp netgraph/ng_lmi.c optional netgraph_lmi netgraph/ng_mppc.c optional netgraph_mppc_compression | \ netgraph_mppc_encryption netgraph/ng_nat.c optional netgraph_nat netgraph/ng_one2many.c optional netgraph_one2many netgraph/ng_parse.c optional netgraph netgraph/ng_ppp.c optional netgraph_ppp netgraph/ng_pppoe.c optional netgraph_pppoe netgraph/ng_pptpgre.c optional netgraph_pptpgre netgraph/ng_pred1.c optional netgraph_pred1 netgraph/ng_rfc1490.c optional netgraph_rfc1490 netgraph/ng_socket.c optional netgraph_socket netgraph/ng_split.c optional netgraph_split netgraph/ng_sppp.c optional netgraph_sppp netgraph/ng_tag.c optional netgraph_tag netgraph/ng_tcpmss.c optional netgraph_tcpmss netgraph/ng_tee.c optional netgraph_tee netgraph/ng_tty.c optional netgraph_tty netgraph/ng_vjc.c optional netgraph_vjc netinet/accf_data.c optional accept_filter_data netinet/accf_http.c optional accept_filter_http netinet/if_atm.c optional atm netinet/if_ether.c optional ether netinet/igmp.c optional inet netinet/in.c optional inet netinet/ip_carp.c optional carp netinet/in_gif.c optional gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet netinet/in_mcast.c optional inet netinet/in_pcb.c optional inet netinet/in_proto.c optional inet \ compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional ipdivert netinet/ip_dummynet.c optional dummynet netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 netinet/ip_fastfwd.c optional inet netinet/ip_fw2.c optional ipfirewall \ compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/ip_fw_pfil.c optional ipfirewall netinet/ip_fw_nat.c optional ipfirewall_nat netinet/ip_icmp.c optional inet netinet/ip_input.c optional inet netinet/ip_ipsec.c optional ipsec netinet/ip_mroute.c optional mrouting inet | mrouting inet6 netinet/ip_options.c optional inet netinet/ip_output.c optional inet netinet/raw_ip.c optional inet netinet/sctp_asconf.c optional inet sctp netinet/sctp_auth.c optional inet sctp netinet/sctp_bsd_addr.c optional inet sctp netinet/sctp_cc_functions.c optional inet sctp netinet/sctp_crc32.c optional inet sctp netinet/sctp_indata.c optional inet sctp netinet/sctp_input.c optional inet sctp netinet/sctp_output.c optional inet sctp netinet/sctp_pcb.c optional inet sctp netinet/sctp_peeloff.c optional inet sctp netinet/sctp_sysctl.c optional inet sctp netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp netinet/sctputil.c optional inet sctp netinet/tcp_debug.c optional tcpdebug netinet/tcp_hostcache.c optional inet netinet/tcp_input.c optional inet netinet/tcp_output.c optional inet netinet/tcp_offload.c optional inet netinet/tcp_reass.c optional inet netinet/tcp_sack.c optional inet netinet/tcp_subr.c optional inet netinet/tcp_syncache.c optional inet netinet/tcp_timer.c optional inet netinet/tcp_timewait.c optional inet netinet/tcp_usrreq.c optional inet netinet/udp_usrreq.c optional inet netinet/libalias/alias.c optional libalias | netgraph_nat netinet/libalias/alias_db.c optional libalias | netgraph_nat netinet/libalias/alias_mod.c optional libalias | netgraph_nat netinet/libalias/alias_proxy.c optional libalias | netgraph_nat netinet/libalias/alias_util.c optional libalias | netgraph_nat netinet6/dest6.c optional inet6 netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 netinet6/in6.c optional inet6 netinet6/in6_cksum.c optional inet6 netinet6/in6_gif.c optional gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_pcb.c optional inet6 netinet6/in6_proto.c optional inet6 netinet6/in6_rmx.c optional inet6 netinet6/in6_src.c optional inet6 netinet6/ip6_forward.c optional inet6 netinet6/ip6_id.c optional inet6 netinet6/ip6_input.c optional inet6 netinet6/ip6_mroute.c optional mrouting inet6 netinet6/ip6_output.c optional inet6 netinet6/ip6_ipsec.c optional inet6 ipsec netinet6/mld6.c optional inet6 netinet6/nd6.c optional inet6 netinet6/nd6_nbr.c optional inet6 netinet6/nd6_rtr.c optional inet6 netinet6/raw_ip6.c optional inet6 netinet6/route6.c optional inet6 netinet6/scope6.c optional inet6 netinet6/sctp6_usrreq.c optional inet6 sctp netinet6/udp6_usrreq.c optional inet6 netipsec/ipsec.c optional ipsec netipsec/ipsec_input.c optional ipsec netipsec/ipsec_mbuf.c optional ipsec netipsec/ipsec_output.c optional ipsec netipsec/key.c optional ipsec netipsec/key_debug.c optional ipsec netipsec/keysock.c optional ipsec netipsec/xform_ah.c optional ipsec netipsec/xform_esp.c optional ipsec netipsec/xform_ipcomp.c optional ipsec netipsec/xform_ipip.c optional ipsec netipsec/xform_tcp.c optional ipsec tcp_signature netipx/ipx.c optional ipx netipx/ipx_cksum.c optional ipx netipx/ipx_input.c optional ipx netipx/ipx_outputfl.c optional ipx netipx/ipx_pcb.c optional ipx netipx/ipx_proto.c optional ipx netipx/ipx_usrreq.c optional ipx netipx/spx_debug.c optional ipx netipx/spx_usrreq.c optional ipx netnatm/natm.c optional natm netnatm/natm_pcb.c optional natm netnatm/natm_proto.c optional natm netncp/ncp_conn.c optional ncp netncp/ncp_crypt.c optional ncp netncp/ncp_login.c optional ncp netncp/ncp_mod.c optional ncp netncp/ncp_ncp.c optional ncp netncp/ncp_nls.c optional ncp netncp/ncp_rq.c optional ncp netncp/ncp_sock.c optional ncp netncp/ncp_subr.c optional ncp netsmb/smb_conn.c optional netsmb netsmb/smb_crypt.c optional netsmb netsmb/smb_dev.c optional netsmb netsmb/smb_iod.c optional netsmb netsmb/smb_rq.c optional netsmb netsmb/smb_smb.c optional netsmb netsmb/smb_subr.c optional netsmb netsmb/smb_trantcp.c optional netsmb netsmb/smb_usr.c optional netsmb nfs/nfs_common.c optional nfsclient | nfsserver nfs4client/nfs4_dev.c optional nfsclient nfs4client/nfs4_idmap.c optional nfsclient nfs4client/nfs4_socket.c optional nfsclient nfs4client/nfs4_subs.c optional nfsclient nfs4client/nfs4_vfs_subs.c optional nfsclient nfs4client/nfs4_vfsops.c optional nfsclient nfs4client/nfs4_vn_subs.c optional nfsclient nfs4client/nfs4_vnops.c optional nfsclient nfsclient/bootp_subr.c optional bootp nfsclient nfsclient/krpc_subr.c optional bootp nfsclient nfsclient/nfs_bio.c optional nfsclient nfsclient/nfs_diskless.c optional nfsclient nfs_root nfsclient/nfs_node.c optional nfsclient nfsclient/nfs_socket.c optional nfsclient nfsclient/nfs_subs.c optional nfsclient nfsclient/nfs_nfsiod.c optional nfsclient nfsclient/nfs_vfsops.c optional nfsclient nfsclient/nfs_vnops.c optional nfsclient nfsclient/nfs_lock.c optional nfsclient nfsserver/nfs_serv.c optional nfsserver nfsserver/nfs_srvsock.c optional nfsserver nfsserver/nfs_srvcache.c optional nfsserver nfsserver/nfs_srvsubs.c optional nfsserver nfsserver/nfs_syscalls.c optional nfsserver nlm/nlm_prot_clnt.c optional nfslockd nlm/nlm_prot_impl.c optional nfslockd nlm/nlm_prot_server.c optional nfslockd nlm/nlm_prot_svc.c optional nfslockd nlm/nlm_prot_xdr.c optional nfslockd nlm/sm_inter_xdr.c optional nfslockd # crypto support opencrypto/cast.c optional crypto | ipsec opencrypto/criov.c optional crypto opencrypto/crypto.c optional crypto opencrypto/cryptodev.c optional cryptodev opencrypto/cryptodev_if.m optional crypto opencrypto/cryptosoft.c optional crypto opencrypto/deflate.c optional crypto opencrypto/rmd160.c optional crypto | ipsec opencrypto/skipjack.c optional crypto opencrypto/xform.c optional crypto pci/alpm.c optional alpm pci pci/amdpm.c optional amdpm pci | nfpm pci pci/amdsmb.c optional amdsmb pci pci/if_mn.c optional mn pci pci/if_pcn.c optional pcn pci pci/if_rl.c optional rl pci pci/if_sis.c optional sis pci pci/if_ste.c optional ste pci pci/if_tl.c optional tl pci pci/if_wb.c optional wb pci pci/if_xl.c optional xl pci pci/intpm.c optional intpm pci pci/ncr.c optional ncr pci pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd rpc/auth_unix.c optional krpc | nfslockd rpc/authunix_prot.c optional krpc | nfslockd rpc/clnt_dg.c optional krpc | nfslockd rpc/clnt_rc.c optional krpc | nfslockd rpc/clnt_vc.c optional krpc | nfslockd rpc/getnetconfig.c optional krpc | nfslockd rpc/inet_ntop.c optional krpc | nfslockd rpc/inet_pton.c optional krpc | nfslockd rpc/rpc_callmsg.c optional krpc | nfslockd rpc/rpc_generic.c optional krpc | nfslockd rpc/rpc_prot.c optional krpc | nfslockd rpc/rpcb_clnt.c optional krpc | nfslockd rpc/rpcb_prot.c optional krpc | nfslockd rpc/rpcclnt.c optional nfsclient rpc/svc.c optional krpc | nfslockd rpc/svc_auth.c optional krpc | nfslockd rpc/svc_auth_unix.c optional krpc | nfslockd rpc/svc_dg.c optional krpc | nfslockd rpc/svc_generic.c optional krpc | nfslockd rpc/svc_vc.c optional krpc | nfslockd security/audit/audit.c optional audit security/audit/audit_arg.c optional audit security/audit/audit_bsm.c optional audit security/audit/audit_bsm_klib.c optional audit security/audit/audit_bsm_token.c optional audit security/audit/audit_pipe.c optional audit security/audit/audit_syscalls.c standard security/audit/audit_trigger.c optional audit security/audit/audit_worker.c optional audit security/mac/mac_atalk.c optional mac netatalk security/mac/mac_audit.c optional mac audit security/mac/mac_framework.c optional mac security/mac/mac_inet.c optional mac inet security/mac/mac_inet6.c optional mac inet6 security/mac/mac_label.c optional mac security/mac/mac_net.c optional mac security/mac/mac_pipe.c optional mac security/mac/mac_posix_sem.c optional mac security/mac/mac_posix_shm.c optional mac security/mac/mac_priv.c optional mac security/mac/mac_process.c optional mac security/mac/mac_socket.c optional mac security/mac/mac_syscalls.c standard security/mac/mac_system.c optional mac security/mac/mac_sysv_msg.c optional mac security/mac/mac_sysv_sem.c optional mac security/mac/mac_sysv_shm.c optional mac security/mac/mac_vfs.c optional mac security/mac_biba/mac_biba.c optional mac_biba security/mac_bsdextended/mac_bsdextended.c optional mac_bsdextended security/mac_ifoff/mac_ifoff.c optional mac_ifoff security/mac_lomac/mac_lomac.c optional mac_lomac security/mac_mls/mac_mls.c optional mac_mls security/mac_none/mac_none.c optional mac_none security/mac_partition/mac_partition.c optional mac_partition security/mac_portacl/mac_portacl.c optional mac_portacl security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids security/mac_stub/mac_stub.c optional mac_stub security/mac_test/mac_test.c optional mac_test ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs ufs/ffs/ffs_inode.c optional ffs ufs/ffs/ffs_snapshot.c optional ffs ufs/ffs/ffs_softdep.c optional ffs ufs/ffs/ffs_subr.c optional ffs ufs/ffs/ffs_tables.c optional ffs ufs/ffs/ffs_vfsops.c optional ffs ufs/ffs/ffs_vnops.c optional ffs ufs/ffs/ffs_rawread.c optional directio ufs/ufs/ufs_acl.c optional ffs ufs/ufs/ufs_bmap.c optional ffs ufs/ufs/ufs_dirhash.c optional ffs ufs/ufs/ufs_extattr.c optional ffs ufs/ufs/ufs_gjournal.c optional ffs ufs/ufs/ufs_inode.c optional ffs ufs/ufs/ufs_lookup.c optional ffs ufs/ufs/ufs_quota.c optional ffs ufs/ufs/ufs_vfsops.c optional ffs ufs/ufs/ufs_vnops.c optional ffs vm/default_pager.c standard vm/device_pager.c standard vm/phys_pager.c standard vm/redzone.c optional DEBUG_REDZONE vm/swap_pager.c standard vm/uma_core.c standard vm/uma_dbg.c standard vm/vm_contig.c standard vm/memguard.c optional DEBUG_MEMGUARD vm/vm_fault.c standard vm/vm_glue.c standard vm/vm_init.c standard vm/vm_kern.c standard vm/vm_map.c standard vm/vm_meter.c standard vm/vm_mmap.c standard vm/vm_object.c standard vm/vm_page.c standard vm/vm_pageout.c standard vm/vm_pager.c standard vm/vm_phys.c standard vm/vm_reserv.c standard vm/vm_unix.c standard vm/vm_zeroidle.c standard vm/vnode_pager.c standard xdr/xdr.c optional krpc | nfslockd xdr/xdr_array.c optional krpc | nfslockd xdr/xdr_mbuf.c optional krpc | nfslockd xdr/xdr_mem.c optional krpc | nfslockd xdr/xdr_reference.c optional krpc | nfslockd xdr/xdr_sizeof.c optional krpc | nfslockd # gnu/fs/xfs/xfs_alloc.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \ warning "kernel contains GPL contaminated xfs filesystem" gnu/fs/xfs/xfs_alloc_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_bit.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_bmap.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_bmap_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_buf_item.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_da_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_block.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_data.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_leaf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_node.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_sf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir2_trace.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dir_leaf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_error.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_extfree_item.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_fsops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_ialloc.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_ialloc_btree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_inode.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_inode_item.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_iocore.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_itable.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dfrag.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_log.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_log_recover.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_mount.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_rename.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans_ail.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans_buf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans_extfree.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans_inode.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_trans_item.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_utils.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vfsops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_vnodeops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_rw.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_attr_leaf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_attr.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_dmops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_qmops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_iget.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_mountops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vnops.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_frw.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_buf.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_globals.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_dmistubs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_super.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_stats.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vfs.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_vnode.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_sysctl.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_fs_subr.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/xfs_ioctl.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/debug.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/ktrace.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/mrlock.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/uuid.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/FreeBSD/support/kmem.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_iomap.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" gnu/fs/xfs/xfs_behavior.c optional xfs \ compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" Index: head/sys/conf/options =================================================================== --- head/sys/conf/options (revision 179307) +++ head/sys/conf/options (revision 179308) @@ -1,782 +1,775 @@ # $FreeBSD$ # # On the handling of kernel options # # All kernel options should be listed in NOTES, with suitable # descriptions. Negative options (options that make some code not # compile) should be commented out; LINT (generated from NOTES) should # compile as much code as possible. Try to structure option-using # code so that a single option only switch code on, or only switch # code off, to make it possible to have a full compile-test. If # necessary, you can check for COMPILING_LINT to get maximum code # coverage. # # All new options shall also be listed in either "conf/options" or # "conf/options.". Options that affect a single source-file # .[c|s] should be directed into "opt_.h", while options # that affect multiple files should either go in "opt_global.h" if # this is a kernel-wide option (used just about everywhere), or in # "opt_.h" if it affects only some files. # Note that the effect of listing only an option without a # header-file-name in conf/options (and cousins) is that the last # convention is followed. # # This handling scheme is not yet fully implemented. # # # Format of this file: # Option name filename # # If filename is missing, the default is # opt_.h AAC_DEBUG opt_aac.h AHC_ALLOW_MEMIO opt_aic7xxx.h AHC_TMODE_ENABLE opt_aic7xxx.h AHC_DUMP_EEPROM opt_aic7xxx.h AHC_DEBUG opt_aic7xxx.h AHC_DEBUG_OPTS opt_aic7xxx.h AHC_REG_PRETTY_PRINT opt_aic7xxx.h AHD_DEBUG opt_aic79xx.h AHD_DEBUG_OPTS opt_aic79xx.h AHD_TMODE_ENABLE opt_aic79xx.h AHD_REG_PRETTY_PRINT opt_aic79xx.h ADW_ALLOW_MEMIO opt_adw.h TWA_DEBUG opt_twa.h TWA_FLASH_FIRMWARE opt_twa.h # Debugging options. DDB DDB_CAPTURE_DEFAULTBUFSIZE opt_ddb.h DDB_CAPTURE_MAXBUFSIZE opt_ddb.h DDB_CTF opt_ddb.h DDB_NUMSYM opt_ddb.h GDB KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h SYSCTL_DEBUG opt_sysctl.h NO_SYSCTL_DESCR opt_global.h # Miscellaneous options. ADAPTIVE_SX ALQ AUDIT opt_global.h CODA_COMPAT_5 opt_coda.h COMPAT_43 opt_compat.h COMPAT_43TTY opt_compat.h COMPAT_FREEBSD4 opt_compat.h COMPAT_FREEBSD5 opt_compat.h COMPAT_FREEBSD6 opt_compat.h COMPAT_FREEBSD7 opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR DIRECTIO FULL_PREEMPTION opt_sched.h IPI_PREEMPTION opt_sched.h GEOM_AES opt_geom.h GEOM_BDE opt_geom.h GEOM_BSD opt_geom.h GEOM_CACHE opt_geom.h GEOM_CONCAT opt_geom.h GEOM_ELI opt_geom.h GEOM_FOX opt_geom.h GEOM_GATE opt_geom.h GEOM_JOURNAL opt_geom.h GEOM_LABEL opt_geom.h GEOM_LINUX_LVM opt_geom.h GEOM_MBR opt_geom.h GEOM_MIRROR opt_geom.h GEOM_MULTIPATH opt_geom.h GEOM_NOP opt_geom.h GEOM_PART_APM opt_geom.h GEOM_PART_BSD opt_geom.h GEOM_PART_GPT opt_geom.h GEOM_PART_MBR opt_geom.h GEOM_PART_PC98 opt_geom.h GEOM_PART_VTOC8 opt_geom.h GEOM_PC98 opt_geom.h GEOM_RAID3 opt_geom.h GEOM_SHSEC opt_geom.h GEOM_STRIPE opt_geom.h GEOM_SUNLABEL opt_geom.h GEOM_UZIP opt_geom.h GEOM_VIRSTOR opt_geom.h GEOM_VOL opt_geom.h GEOM_ZERO opt_geom.h KDTRACE_HOOKS opt_kdtrace.h KSTACK_MAX_PAGES KSTACK_PAGES KTRACE KTRACE_REQUEST_POOL opt_ktrace.h LIBICONV MAC MAC_ALWAYS_LABEL_MBUF opt_mac.h MAC_BIBA opt_dontuse.h MAC_BSDEXTENDED opt_dontuse.h MAC_IFOFF opt_dontuse.h MAC_LOMAC opt_dontuse.h MAC_MLS opt_dontuse.h MAC_NONE opt_dontuse.h MAC_PARTITION opt_dontuse.h MAC_PORTACL opt_dontuse.h MAC_SEEOTHERUIDS opt_dontuse.h MAC_STATIC opt_mac.h MAC_STUB opt_dontuse.h MAC_TEST opt_dontuse.h MD_ROOT opt_md.h MD_ROOT_SIZE opt_md.h MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h MPROF_BUFFERS opt_mprof.h MPROF_HASH_SIZE opt_mprof.h NO_ADAPTIVE_MUTEXES opt_adaptive_mutexes.h NO_ADAPTIVE_RWLOCKS NSWBUF_MIN opt_swap.h MBUF_PACKET_ZONE_DISABLE opt_global.h PANIC_REBOOT_WAIT_TIME opt_panic.h PPC_DEBUG opt_ppc.h PPC_PROBE_CHIPSET opt_ppc.h PPS_SYNC opt_ntp.h PREEMPTION opt_sched.h QUOTA SCHED_4BSD opt_sched.h SCHED_STATS opt_sched.h SCHED_ULE opt_sched.h SHOW_BUSYBUFS SLEEPQUEUE_PROFILING SLHCI_DEBUG opt_slhci.h SPX_HACK STACK opt_stack.h SUIDDIR MSGMNB opt_sysvipc.h MSGMNI opt_sysvipc.h MSGSEG opt_sysvipc.h MSGSSZ opt_sysvipc.h MSGTQL opt_sysvipc.h SEMMAP opt_sysvipc.h SEMMNI opt_sysvipc.h SEMMNS opt_sysvipc.h SEMMNU opt_sysvipc.h SEMMSL opt_sysvipc.h SEMOPM opt_sysvipc.h SEMUME opt_sysvipc.h SHMALL opt_sysvipc.h SHMMAX opt_sysvipc.h SHMMAXPGS opt_sysvipc.h SHMMIN opt_sysvipc.h SHMMNI opt_sysvipc.h SHMSEG opt_sysvipc.h SYSVMSG opt_sysvipc.h SYSVSEM opt_sysvipc.h SYSVSHM opt_sysvipc.h SW_WATCHDOG opt_watchdog.h TURNSTILE_PROFILING TTYHOG opt_tty.h VFS_AIO VERBOSE_SYSINIT opt_global.h WLCACHE opt_wavelan.h WLDEBUG opt_wavelan.h # POSIX kernel options P1003_1B_MQUEUE opt_posix.h P1003_1B_SEMAPHORES opt_posix.h _KPOSIX_PRIORITY_SCHEDULING opt_posix.h # Do we want the config file compiled into the kernel? INCLUDE_CONFIG_FILE opt_config.h # Options for static filesystems. These should only be used at config # time, since the corresponding lkms cannot work if there are any static # dependencies. Unusability is enforced by hiding the defines for the # options in a never-included header. CD9660 opt_dontuse.h CODA opt_dontuse.h EXT2FS opt_dontuse.h FDESCFS opt_dontuse.h HPFS opt_dontuse.h MSDOSFS opt_dontuse.h NTFS opt_dontuse.h NULLFS opt_dontuse.h NWFS opt_dontuse.h PORTALFS opt_dontuse.h PROCFS opt_dontuse.h PSEUDOFS opt_dontuse.h REISERFS opt_dontuse.h SMBFS opt_dontuse.h TMPFS opt_dontuse.h UDF opt_dontuse.h UNIONFS opt_dontuse.h # Pseudofs debugging PSEUDOFS_TRACE opt_pseudofs.h # Broken - ffs_snapshot() dependency from ufs_lookup() :-( FFS opt_ffs_broken_fixme.h # These static filesystems have one slightly bogus static dependency in # sys/i386/i386/autoconf.c. If any of these filesystems are # statically compiled into the kernel, code for mounting them as root # filesystems will be enabled - but look below. NFSCLIENT opt_nfs.h NFSSERVER opt_nfs.h NFS4CLIENT opt_nfs.h # filesystems and libiconv bridge CD9660_ICONV opt_dontuse.h MSDOSFS_ICONV opt_dontuse.h NTFS_ICONV opt_dontuse.h UDF_ICONV opt_dontuse.h # If you are following the conditions in the copyright, # you can enable soft-updates which will speed up a lot of thigs # and make the system safer from crashes at the same time. # otherwise a STUB module will be compiled in. SOFTUPDATES opt_ffs.h # On small, embedded systems, it can be useful to turn off support for # snapshots. It saves about 30-40k for a feature that would be lightly # used, if it is used at all. NO_FFS_SNAPSHOT opt_ffs.h # Enabling this option turns on support for Access Control Lists in UFS, # which can be used to support high security configurations. Depends on # UFS_EXTATTR. UFS_ACL opt_ufs.h # Enabling this option turns on support for extended attributes in UFS-based # filesystems, which can be used to support high security configurations # as well as new filesystem features. UFS_EXTATTR opt_ufs.h UFS_EXTATTR_AUTOSTART opt_ufs.h # Enable fast hash lookups for large directories on UFS-based filesystems. UFS_DIRHASH opt_ufs.h # Enable gjournal-based UFS journal. UFS_GJOURNAL opt_ufs.h # The below sentence is not in English, and neither is this one. # We plan to remove the static dependences above, with a # _ROOT option to control if it usable as root. This list # allows these options to be present in config files already (though # they won't make any difference yet). NFS_ROOT opt_nfsroot.h # SMB/CIFS requester NETSMB opt_netsmb.h # Options used only in subr_param.c. HZ opt_param.h MAXFILES opt_param.h NBUF opt_param.h NSFBUFS opt_param.h VM_BCACHE_SIZE_MAX opt_param.h VM_SWZONE_SIZE_MAX opt_param.h MAXUSERS DFLDSIZ opt_param.h MAXDSIZ opt_param.h MAXSSIZ opt_param.h # Generic SCSI options. CAM_MAX_HIGHPOWER opt_cam.h CAMDEBUG opt_cam.h CAM_DEBUG_DELAY opt_cam.h CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h # Options used only in cam/scsi/scsi_cd.c CHANGER_MIN_BUSY_SECONDS opt_cd.h CHANGER_MAX_BUSY_SECONDS opt_cd.h # Options used only in cam/scsi/scsi_sa.c. SA_IO_TIMEOUT opt_sa.h SA_SPACE_TIMEOUT opt_sa.h SA_REWIND_TIMEOUT opt_sa.h SA_ERASE_TIMEOUT opt_sa.h SA_1FM_AT_EOD opt_sa.h # Options used only in cam/scsi/scsi_pt.c SCSI_PT_DEFAULT_TIMEOUT opt_pt.h # Options used only in cam/scsi/scsi_ses.c SES_ENABLE_PASSTHROUGH opt_ses.h # Options used in dev/sym/ (Symbios SCSI driver). SYM_SETUP_LP_PROBE_MAP opt_sym.h #-Low Priority Probe Map (bits) # Allows the ncr to take precedence # 1 (1<<0) -> 810a, 860 # 2 (1<<1) -> 825a, 875, 885, 895 # 4 (1<<2) -> 895a, 896, 1510d SYM_SETUP_SCSI_DIFF opt_sym.h #-HVD support for 825a, 875, 885 # disabled:0 (default), enabled:1 SYM_SETUP_PCI_PARITY opt_sym.h #-PCI parity checking # disabled:0, enabled:1 (default) SYM_SETUP_MAX_LUN opt_sym.h #-Number of LUNs supported # default:8, range:[1..64] # Options used only in pci/ncr.c SCSI_NCR_DEBUG opt_ncr.h SCSI_NCR_MAX_SYNC opt_ncr.h SCSI_NCR_MAX_WIDE opt_ncr.h SCSI_NCR_MYADDR opt_ncr.h # Options used only in dev/isp/* ISP_TARGET_MODE opt_isp.h ISP_FW_CRASH_DUMP opt_isp.h ISP_DEFAULT_ROLES opt_isp.h # Options used only in dev/iscsi ISCSI_INITIATOR_DEBUG opt_iscsi_initiator.h # Options used in the 'ata' ATA/ATAPI driver ATA_STATIC_ID opt_ata.h ATA_NOPCI opt_ata.h # Net stuff. ACCEPT_FILTER_DATA ACCEPT_FILTER_HTTP ALTQ opt_global.h ALTQ_CBQ opt_altq.h ALTQ_RED opt_altq.h ALTQ_RIO opt_altq.h ALTQ_HFSC opt_altq.h ALTQ_CDNR opt_altq.h ALTQ_PRIQ opt_altq.h ALTQ_NOPCC opt_altq.h ALTQ_DEBUG opt_altq.h BOOTP opt_bootp.h BOOTP_BLOCKSIZE opt_bootp.h BOOTP_COMPAT opt_bootp.h BOOTP_NFSROOT opt_bootp.h BOOTP_NFSV3 opt_bootp.h BOOTP_WIRED_TO opt_bootp.h DEVICE_POLLING DEV_ENC opt_enc.h DEV_PF opt_pf.h DEV_PFLOG opt_pf.h DEV_PFSYNC opt_pf.h ETHER_II opt_ef.h ETHER_8023 opt_ef.h ETHER_8022 opt_ef.h ETHER_SNAP opt_ef.h ROUTETABLES opt_route.h MROUTING opt_mrouting.h INET opt_inet.h INET6 opt_inet6.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h IPSEC_FILTERTUNNEL opt_ipsec.h IPDIVERT DUMMYNET opt_ipdn.h IPFILTER opt_ipfilter.h IPFILTER_LOG opt_ipfilter.h IPFILTER_LOOKUP opt_ipfilter.h IPFILTER_DEFAULT_BLOCK opt_ipfilter.h IPFIREWALL opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_FORWARD opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h IPSTEALTH IPX LIBMBPOOL LIBMCHAIN LIBALIAS MBUF_STRESS_TEST MBUF_PROFILING NCP NETATALK opt_atalk.h PPP_BSDCOMP opt_ppp.h PPP_DEFLATE opt_ppp.h PPP_FILTER opt_ppp.h RADIX_MPATH opt_mpath.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCP_SIGNATURE opt_inet.h DEV_VLAN opt_vlan.h VLAN_ARRAY opt_vlan.h XBONEHACK KRPC NFSLOCKD # # SCTP # SCTP opt_sctp.h SCTP_DEBUG opt_sctp.h # Enable debug printfs SCTP_WITH_NO_CSUM opt_sctp.h # Use this at your peril SCTP_LOCK_LOGGING opt_sctp.h # Log to KTR lock activity SCTP_MBUF_LOGGING opt_sctp.h # Log to KTR general mbuf aloc/free SCTP_MBCNT_LOGGING opt_sctp.h # Log to KTR mbcnt activity SCTP_PACKET_LOGGING opt_sctp.h # Log to a packet buffer last N packets SCTP_LTRACE_CHUNKS opt_sctp.h # Log to KTR chunks processed SCTP_LTRACE_ERRORS opt_sctp.h # Log to KTR error returns. # # # # Netgraph(4). Use option NETGRAPH to enable the base netgraph code. # Each netgraph node type can be either be compiled into the kernel # or loaded dynamically. To get the former, include the corresponding # option below. Each type has its own man page, e.g. ng_async(4). NETGRAPH NETGRAPH_DEBUG opt_netgraph.h NETGRAPH_ASYNC opt_netgraph.h NETGRAPH_ATMLLC opt_netgraph.h NETGRAPH_ATM_ATMPIF opt_netgraph.h NETGRAPH_BLUETOOTH opt_netgraph.h NETGRAPH_BLUETOOTH_BT3C opt_netgraph.h NETGRAPH_BLUETOOTH_H4 opt_netgraph.h NETGRAPH_BLUETOOTH_HCI opt_netgraph.h NETGRAPH_BLUETOOTH_L2CAP opt_netgraph.h NETGRAPH_BLUETOOTH_SOCKET opt_netgraph.h NETGRAPH_BLUETOOTH_UBT opt_netgraph.h NETGRAPH_BLUETOOTH_UBTBCMFW opt_netgraph.h NETGRAPH_BPF opt_netgraph.h NETGRAPH_BRIDGE opt_netgraph.h NETGRAPH_CAR opt_netgraph.h NETGRAPH_CISCO opt_netgraph.h NETGRAPH_DEFLATE opt_netgraph.h NETGRAPH_DEVICE opt_netgraph.h NETGRAPH_ECHO opt_netgraph.h NETGRAPH_EIFACE opt_netgraph.h NETGRAPH_ETHER opt_netgraph.h NETGRAPH_FEC opt_netgraph.h NETGRAPH_FRAME_RELAY opt_netgraph.h NETGRAPH_GIF opt_netgraph.h NETGRAPH_GIF_DEMUX opt_netgraph.h NETGRAPH_HOLE opt_netgraph.h NETGRAPH_IFACE opt_netgraph.h NETGRAPH_IP_INPUT opt_netgraph.h NETGRAPH_IPFW opt_netgraph.h NETGRAPH_KSOCKET opt_netgraph.h NETGRAPH_L2TP opt_netgraph.h NETGRAPH_LMI opt_netgraph.h # MPPC compression requires proprietary files (not included) NETGRAPH_MPPC_COMPRESSION opt_netgraph.h NETGRAPH_MPPC_ENCRYPTION opt_netgraph.h NETGRAPH_NAT opt_netgraph.h NETGRAPH_NETFLOW opt_netgraph.h NETGRAPH_ONE2MANY opt_netgraph.h NETGRAPH_PPP opt_netgraph.h NETGRAPH_PPPOE opt_netgraph.h NETGRAPH_PPTPGRE opt_netgraph.h NETGRAPH_PRED1 opt_netgraph.h NETGRAPH_RFC1490 opt_netgraph.h NETGRAPH_SOCKET opt_netgraph.h NETGRAPH_SPLIT opt_netgraph.h NETGRAPH_SPPP opt_netgraph.h NETGRAPH_TAG opt_netgraph.h NETGRAPH_TCPMSS opt_netgraph.h NETGRAPH_TEE opt_netgraph.h NETGRAPH_TTY opt_netgraph.h NETGRAPH_UI opt_netgraph.h NETGRAPH_VJC opt_netgraph.h # NgATM options NGATM_ATM opt_netgraph.h NGATM_ATMBASE opt_netgraph.h NGATM_SSCOP opt_netgraph.h NGATM_SSCFU opt_netgraph.h NGATM_UNI opt_netgraph.h NGATM_CCATM opt_netgraph.h # DRM options DRM_DEBUG opt_drm.h ZERO_COPY_SOCKETS opt_zero.h TI_PRIVATE_JUMBOS opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h -# ATM (HARP version) - disabled as not MPSAFE in 7.0 -#ATM_CORE opt_atm.h -#ATM_IP opt_atm.h -#ATM_SIGPVC opt_atm.h -#ATM_SPANS opt_atm.h -#ATM_UNI opt_atm.h - # XXX Conflict: # of devices vs network protocol (Native ATM). # This makes "atm.h" unusable. NATM # DPT driver debug flags DPT_MEASURE_PERFORMANCE opt_dpt.h DPT_HANDLE_TIMEOUTS opt_dpt.h DPT_TIMEOUT_FACTOR opt_dpt.h DPT_LOST_IRQ opt_dpt.h DPT_RESET_HBA opt_dpt.h # Misc debug flags. Most of these should probably be replaced with # 'DEBUG', and then let people recompile just the interesting modules # with 'make CC="cc -DDEBUG"'. CLUSTERDEBUG opt_debug_cluster.h DEBUG_1284 opt_ppb_1284.h VP0_DEBUG opt_vpo.h LPT_DEBUG opt_lpt.h PLIP_DEBUG opt_plip.h LOCKF_DEBUG opt_debug_lockf.h NETATALKDEBUG opt_atalk.h SI_DEBUG opt_debug_si.h # Fb options FB_DEBUG opt_fb.h FB_INSTALL_CDEV opt_fb.h # ppbus related options PERIPH_1284 opt_ppb_1284.h DONTPROBE_1284 opt_ppb_1284.h # smbus related options ENABLE_ALART opt_intpm.h # These cause changes all over the kernel BLKDEV_IOSIZE opt_global.h MAXPHYS opt_global.h DFLTPHYS opt_global.h BURN_BRIDGES opt_global.h DEBUG opt_global.h DEBUG_LOCKS opt_global.h DEBUG_VFS_LOCKS opt_global.h DIAGNOSTIC opt_global.h INVARIANT_SUPPORT opt_global.h INVARIANTS opt_global.h MCLSHIFT opt_global.h MUTEX_DEBUG opt_global.h MUTEX_NOINLINE opt_global.h LOCK_PROFILING opt_global.h LOCK_PROFILING_FAST opt_global.h MSIZE opt_global.h REGRESSION opt_global.h RESTARTABLE_PANICS opt_global.h RWLOCK_NOINLINE opt_global.h SX_NOINLINE opt_global.h VFS_BIO_DEBUG opt_global.h # These are VM related options VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h MALLOC_MAKE_FAILURES opt_vm.h MALLOC_PROFILE opt_vm.h # The MemGuard replacement allocator used for tamper-after-free detection DEBUG_MEMGUARD opt_vm.h # The RedZone malloc(9) protection DEBUG_REDZONE opt_vm.h # Standard SMP options SMP opt_global.h # Size of the kernel message buffer MSGBUF_SIZE opt_msgbuf.h # NFS options NFS_MINATTRTIMO opt_nfs.h NFS_MAXATTRTIMO opt_nfs.h NFS_MINDIRATTRTIMO opt_nfs.h NFS_MAXDIRATTRTIMO opt_nfs.h NFS_GATHERDELAY opt_nfs.h NFS_WDELAYHASHSIZ opt_nfs.h NFS_DEBUG opt_nfs.h # For the Bt848/Bt848A/Bt849/Bt878/Bt879 driver OVERRIDE_CARD opt_bktr.h OVERRIDE_TUNER opt_bktr.h OVERRIDE_DBX opt_bktr.h OVERRIDE_MSP opt_bktr.h BROOKTREE_SYSTEM_DEFAULT opt_bktr.h BROOKTREE_ALLOC_PAGES opt_bktr.h BKTR_OVERRIDE_CARD opt_bktr.h BKTR_OVERRIDE_TUNER opt_bktr.h BKTR_OVERRIDE_DBX opt_bktr.h BKTR_OVERRIDE_MSP opt_bktr.h BKTR_SYSTEM_DEFAULT opt_bktr.h BKTR_ALLOC_PAGES opt_bktr.h BKTR_USE_PLL opt_bktr.h BKTR_GPIO_ACCESS opt_bktr.h BKTR_NO_MSP_RESET opt_bktr.h BKTR_430_FX_MODE opt_bktr.h BKTR_SIS_VIA_MODE opt_bktr.h BKTR_USE_FREEBSD_SMBUS opt_bktr.h BKTR_NEW_MSP34XX_DRIVER opt_bktr.h BREAK_TO_DEBUGGER opt_comconsole.h ALT_BREAK_TO_DEBUGGER opt_comconsole.h # Options to support PPS UART_PPS_ON_CTS opt_uart.h # options for bus/device framework BUS_DEBUG opt_bus.h # options for USB support USB_DEBUG opt_usb.h USBVERBOSE opt_usb.h UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h UVSCOM_INTR_INTERVAL opt_uvscom.h # Embedded system options INIT_PATH ROOTDEVNAME FDC_DEBUG opt_fdc.h PCFCLOCK_VERBOSE opt_pcfclock.h PCFCLOCK_MAX_RETRIES opt_pcfclock.h KTR opt_global.h KTR_ALQ opt_ktr.h KTR_MASK opt_ktr.h KTR_CPUMASK opt_ktr.h KTR_COMPILE opt_global.h KTR_ENTRIES opt_global.h KTR_VERBOSE opt_ktr.h WITNESS opt_global.h WITNESS_KDB opt_witness.h WITNESS_SKIPSPIN opt_witness.h # options for ACPI support ACPI_DEBUG opt_acpi.h ACPI_MAX_THREADS opt_acpi.h ACPI_NO_SEMAPHORES opt_acpi.h # ISA support DEV_ISA opt_isa.h ISAPNP opt_isa.h # various 'device presence' options. DEV_BPF opt_bpf.h DEV_MCA opt_mca.h DEV_CARP opt_carp.h DEV_SPLASH opt_splash.h # EISA support DEV_EISA opt_eisa.h EISA_SLOTS opt_eisa.h # ed driver ED_HPP opt_ed.h ED_3C503 opt_ed.h ED_SIC opt_ed.h # bce driver BCE_DEBUG opt_bce.h # wi driver WI_SYMBOL_FIRMWARE opt_wi.h SOCKBUF_DEBUG opt_global.h # options for ubsec driver UBSEC_DEBUG opt_ubsec.h UBSEC_RNDTEST opt_ubsec.h UBSEC_NO_RNG opt_ubsec.h # options for hifn driver HIFN_DEBUG opt_hifn.h HIFN_RNDTEST opt_hifn.h # options for safenet driver SAFE_DEBUG opt_safe.h SAFE_NO_RNG opt_safe.h SAFE_RNDTEST opt_safe.h # syscons options MAXCONS opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h SC_DEBUG_LEVEL opt_syscons.h SC_DFLT_FONT opt_syscons.h SC_DISABLE_KDBKEY opt_syscons.h SC_DISABLE_REBOOT opt_syscons.h SC_HISTORY_SIZE opt_syscons.h SC_KERNEL_CONS_ATTR opt_syscons.h SC_KERNEL_CONS_REV_ATTR opt_syscons.h SC_MOUSE_CHAR opt_syscons.h SC_NO_CUTPASTE opt_syscons.h SC_NO_FONT_LOADING opt_syscons.h SC_NO_HISTORY opt_syscons.h SC_NO_MODE_CHANGE opt_syscons.h SC_NO_SUSPEND_VTYSWITCH opt_syscons.h SC_NO_SYSMOUSE opt_syscons.h SC_NORM_ATTR opt_syscons.h SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h # options for printf PRINTF_BUFR_SIZE opt_printf.h # kbd options KBD_DISABLE_KEYMAP_LOAD opt_kbd.h KBD_INSTALL_CDEV opt_kbd.h KBD_MAXRETRY opt_kbd.h KBD_MAXWAIT opt_kbd.h KBD_RESETDELAY opt_kbd.h KBDIO_DEBUG opt_kbd.h # options for the Atheros driver ATH_DEBUG opt_ath.h ATH_TXBUF opt_ath.h ATH_RXBUF opt_ath.h ATH_DIAGAPI opt_ath.h ATH_TX99_DIAG opt_ath.h # options for the Marvell 8335 wireless driver MALO_DEBUG opt_malo.h MALO_TXBUF opt_malo.h MALO_RXBUF opt_malo.h # dcons options DCONS_BUF_SIZE opt_dcons.h DCONS_POLL_HZ opt_dcons.h DCONS_FORCE_CONSOLE opt_dcons.h DCONS_FORCE_GDB opt_dcons.h # Static unit counts NI4BTRC opt_i4b.h NI4BRBCH opt_i4b.h NI4BTEL opt_i4b.h #XXXBZ#NI4BIPR opt_i4b.h #XXXBZ#NI4BING opt_i4b.h #XXXBZ#NI4BISPPP opt_i4b.h # VFS options LOOKUP_SHARED opt_vfs.h # HWPMC options HWPMC_HOOKS # XBOX options for FreeBSD/i386, but some files are MI XBOX opt_xbox.h # XFS XFS # Interrupt filtering INTR_FILTER # 802.11 support layer IEEE80211_DEBUG opt_wlan.h IEEE80211_DEBUG_REFCNT opt_wlan.h IEEE80211_AMPDU_AGE opt_wlan.h #Disable code to dispatch tcp offloading TCP_OFFLOAD_DISABLE opt_inet.h Index: head/sys/dev/idt/idt_harp.c =================================================================== --- head/sys/dev/idt/idt_harp.c (revision 179307) +++ head/sys/dev/idt/idt_harp.c (nonexistent) @@ -1,765 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Matriplex, inc. - * 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. - * - ****************************************************************************** - * - * This driver is derived from the Nicstar driver by Mark Tinguely, and - * some of the original driver still exists here. Those portions are... - * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely - * All rights reserved. - * - ****************************************************************************** - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/****************************************************************************** - * - * HARP-specific definitions - * - */ - -#define IDT_DEV_NAME "idt" - -#define IDT_IFF_MTU 9188 -#define IDT_MAX_VCI 1023 /* 0 - 1023 */ -#define IDT_MAX_VPI 0 - -#define iv_next iv_cmn.cv_next -#define iv_toku iv_cmn.cv_toku -#define iv_upper iv_cmn.cv_upper -#define iv_vccb iv_cmn.cv_connvc /* HARP 3.0 */ -#define iv_state iv_cmn.cv_state -#define iu_pif iu_cmn.cu_pif -#define iu_unit iu_cmn.cu_unit -#define iu_flags iu_cmn.cu_flags -#define iu_mtu iu_cmn.cu_mtu -#define iu_open_vcc iu_cmn.cu_open_vcc -#define iu_instvcc iu_cmn.cu_instvcc /* HARP 3.0 */ -#define iu_vcc iu_cmn.cu_vcc -#define iu_vcc_zone iu_cmn.cu_vcc_zone -#define iu_nif_zone iu_cmn.cu_nif_zone -#define iu_ioctl iu_cmn.cu_ioctl -#define iu_openvcc iu_cmn.cu_openvcc -#define iu_closevcc iu_cmn.cu_closevcc -#define iu_output iu_cmn.cu_output -#define iu_config iu_cmn.cu_config -#define iu_softc iu_cmn.cu_softc - -/* - * ATM Interface services - */ -static struct stack_defn idt_svaal5 = { - NULL, - SAP_CPCS_AAL5, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -static struct stack_defn idt_svaal4 = { - &idt_svaal5, - SAP_CPCS_AAL3_4, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -static struct stack_defn idt_svaal0 = { - &idt_svaal4, - SAP_ATM, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -struct stack_defn *idt_services = &idt_svaal0; - -extern uma_zone_t idt_nif_zone; -extern uma_zone_t idt_vcc_zone; - -static int idt_atm_bearerclass(struct attr_bearer *); -#ifdef T_ATM_BUFQUEUE -static CONNECTION *idt_atm_harpconn(Cmn_unit *, Cmn_vcc *); -#endif -static int idt_atm_ioctl(int, caddr_t, caddr_t); - -static void idt_output(Cmn_unit *, Cmn_vcc *, KBuffer *); -static int idt_openvcc(Cmn_unit *, Cmn_vcc *); -static int idt_closevcc(Cmn_unit *, Cmn_vcc *); -static int idt_instvcc(Cmn_unit *, Cmn_vcc *); - -static void idt_recv_stack(void *, KBuffer *); - -/****************************************************************************** - * - * HARP GLUE SECTION - * - ****************************************************************************** - * - * Handle netatm core service interface ioctl requests - * - * Called at splnet. - * - * Arguments: - * code ioctl function (sub)code - * data data to/from ioctl - * arg optional code-specific argument - * - * Returns: - * 0 request processed successfully - * error request failed - reason code - * - */ -static int -idt_atm_ioctl(int code, caddr_t addr, caddr_t arg) -{ -#ifdef T_ATM_BUFQUEUE - CONNECTION *connection; - TX_QUEUE *txq; - struct mbuf *m; - Cmn_unit *cup; - Cmn_vcc *cvp; - int retval; -#endif - - switch (code) { - -#ifdef T_ATM_BUFQUEUE - case T_ATM_BUFQUEUE: - cup = (Cmn_unit *) addr; - cvp = (Cmn_vcc *) arg; - connection = idt_atm_harpconn(cup, cvp); - if (connection == NULL) - return (-1); - retval = 0; - txq = connection->queue; - if (txq == NULL) - return (-1); - for (m = txq->mget; m != NULL; m = m->m_nextpkt) - retval += m->m_pkthdr.len; - return (retval); -#endif - } - - return (ENOSYS); -} - -#ifdef T_ATM_BUFQUEUE -/******************************************************************************* - * - * Get connection pointer from Cmn_unit and Cmn_vcc - * - * in: Cmn_unit and Cmn_vcc - * out: connection (NULL=error) - * - * Date first: 05/31/2001 last: 05/31/2001 - */ - -static CONNECTION * -idt_atm_harpconn(Cmn_unit * cup, Cmn_vcc * cvp) -{ - struct vccb *vccinf; /* from HARP struct */ - IDT *idt; - int vpi; - int vci; - - idt = (IDT *) cup; - if (idt == NULL || cvp == NULL) - return (NULL); - - if (cvp->cv_connvc == NULL) - return (NULL); - - vccinf = cvp->cv_connvc->cvc_vcc; - - if (vccinf == NULL) - return (NULL); - - vpi = vccinf->vc_vpi; - vci = vccinf->vc_vci; - - return (idt_connect_find(idt, vpi, vci)); -} -#endif /* T_ATM_BUFQUEUE */ - -/******************************************************************************* - * - * Get CBR/VBR/UBR class from bearer attribute - * - * in: - * out: NICCBR/NICVBR/NICABR/NICUBR - * - * Date first: 06/12/2001 last: 06/13/2001 - */ - -static int -idt_atm_bearerclass(struct attr_bearer * bearer) -{ - switch (bearer->v.bearer_class) { - case T_ATM_CLASS_A:return (NICCBR); - case T_ATM_CLASS_C: - if (idt_sysctl_vbriscbr) - return (NICCBR); /* use CBR slots for VBR VC's */ - else - return (NICVBR); - case T_ATM_CLASS_X: - if (bearer->v.traffic_type == T_ATM_CBR) - return (NICCBR); - if (bearer->v.traffic_type == T_ATM_VBR) - return (NICVBR); - return (NICUBR); - } - return (NICUBR); -} - -/* The flag idt_sysctl_vbriscbr allows us to set up a CBR VC as if it were - * VBR. This is primarily to avoid cell loss at a switch that cannot seem - * to buffer one or two cells of jitter. This jitter is created when many - * CBR slots have been taken, and a new CBR VC cannot use the optimally - * spaced slots, and has to use nearby slots instead. - * - * In this case, we want to use the VC SCR as the CBR value. The PCR and MBS - * is only of interest to the switch. - * - ******************************************************************************* - * - * Initialize HARP service - * called from device attach - */ - -int -idt_harp_init(nicstar_reg_t *idt) -{ - long long tsc_val; - u_char idt_mac[6]; - int i; - int error; - - error = 0; - - /* - * Start initializing it - */ - idt->iu_unit = device_get_unit(idt->dev); - idt->iu_mtu = IDT_IFF_MTU; - idt->iu_ioctl = idt_atm_ioctl; - idt->iu_openvcc = idt_openvcc; - idt->iu_instvcc = idt_instvcc; - idt->iu_closevcc = idt_closevcc; - idt->iu_output = idt_output; - idt->iu_vcc_zone = idt_vcc_zone; - idt->iu_nif_zone = idt_nif_zone; - idt->iu_softc = (void *)idt; - - /* - * Copy serial number into config space - */ - idt->iu_config.ac_serial = 0; - - idt->iu_config.ac_vendor = VENDOR_IDT; - idt->iu_config.ac_vendapi = VENDAPI_IDT_1; - idt->iu_config.ac_device = DEV_IDT_155; - idt->iu_config.ac_media = MEDIA_UNKNOWN; - idt->iu_config.ac_bustype = BUS_PCI; - - idt->iu_pif.pif_pcr = idt->cellrate_rmax; /* ATM_PCR_OC3C; */ - idt->iu_pif.pif_maxvpi = idt->conn_maxvpi; - idt->iu_pif.pif_maxvci = idt->conn_maxvci; - - snprintf(idt->iu_config.ac_hard_vers, - sizeof(idt->iu_config.ac_hard_vers), - idt->hardware); - snprintf(idt->iu_config.ac_firm_vers, - sizeof(idt->iu_config.ac_firm_vers), - IDT_VERSION); - /* - * Save device ram info for user-level programs NOTE: This really - * points to start of EEPROM and includes all the device registers - * in the lower 2 Megabytes. - */ - idt->iu_config.ac_ram = 0; - idt->iu_config.ac_ramsize = 0; - - for (i = 0; i < 6; i++) { - idt_mac[i] = nicstar_eeprom_rd(idt, (0x6c + i)); - } - - /* looks like bad MAC */ - if ((idt_mac[3] | idt_mac[4] | idt_mac[5]) == 0) { - GET_RDTSC(tsc_val); /* 24 bits on 500mhz CPU is about - * 30msec */ - idt_mac[0] = 0x00; - idt_mac[1] = 0x20; - idt_mac[2] = 0x48; /* use Fore prefix */ - idt_mac[3] = (tsc_val >> 16) & 0xff; - idt_mac[4] = (tsc_val >> 8) & 0xff; - idt_mac[5] = (tsc_val) & 0xff; - device_printf(idt->dev, - "Cannot read MAC address from EEPROM, generating it.\n"); - } - bcopy(&idt_mac, &idt->iu_pif.pif_macaddr.ma_data, sizeof(idt_mac)); - - device_printf(idt->dev, "MAC address %6D, HWrev=%d\n", - (u_int8_t *)&idt->iu_pif.pif_macaddr.ma_data, ":", - idt->pci_rev); - - idt->iu_config.ac_macaddr = idt->iu_pif.pif_macaddr; - - /* - * Register this interface with ATM core services - */ - error = atm_physif_register(&idt->iu_cmn, IDT_DEV_NAME, idt_services); - if (error != 0) { - /* - * Registration failed - back everything out - */ - - log(LOG_ERR, "%s(): atm_physif_register failed\n", __func__); - return (error); - } - idt->iu_flags |= CUF_INITED; - -#if BSD >= 199506 - /* - * Add hook to out shutdown function at_shutdown ( - * (bootlist_fn)idt_pci_shutdown, idt, SHUTDOWN_POST_SYNC ); - */ -#endif - - return (error); -} - -/******************************************************************************* - * - * Output data - */ - -static void -idt_output(Cmn_unit * cmnunit, Cmn_vcc * cmnvcc, KBuffer * m) -{ - struct vccb *vccinf; /* from HARP struct */ - IDT *idt; - int vpi; - int vci; - int flags; - - idt = (IDT *) cmnunit; - flags = 0; - - if (cmnvcc == NULL) { - device_printf(idt->dev, "idt_output arg error #1\n"); - goto bad; - } - if (cmnvcc->cv_connvc == NULL) { - device_printf(idt->dev, "idt_output arg error #2\n"); - goto bad; - } - vccinf = cmnvcc->cv_connvc->cvc_vcc; - if (vccinf == NULL) { - device_printf(idt->dev, "idt_output arg error #3\n"); - goto bad; - } - vpi = vccinf->vc_vpi; - vci = vccinf->vc_vci; - -#ifdef CVF_MPEG2TS /* option to split bufs into small TS bufs */ - if (cmnvcc->cv_flags & CVF_MPEG2TS) - flags = 1; -#endif - - idt_transmit(idt, m, vpi, vci, flags); - - return; -bad: - m_freem(m); - return; -} - -/******************************************************************************* - * - * Open VCC - */ - -static int -idt_openvcc(Cmn_unit * cmnunit, Cmn_vcc * cmnvcc) -{ - Atm_attributes *attrib; /* from HARP struct */ - struct vccb *vccinf; /* from HARP struct */ - CONNECTION *connection; - IDT *idt; - int vpi; - int vci; - int class; /* NICCBR, NICVBR, or NICUBR */ - - idt = (IDT *) cmnunit; - - if (cmnvcc == NULL || cmnvcc->cv_connvc == NULL) { - printf("idt_openvcc: bad request #1.\n"); - return (1); - } - attrib = &cmnvcc->cv_connvc->cvc_attr; - vccinf = cmnvcc->cv_connvc->cvc_vcc; - - if (attrib == NULL || vccinf == NULL) { - printf("idt_openvcc: bad request #2.\n"); - return (1); - } - vpi = vccinf->vc_vpi; - vci = vccinf->vc_vci; - - connection = idt_connect_find(idt, vpi, vci); - if (connection == NULL) { - printf("idt_openvcc: vpi/vci invalid: %d/%d\n", vpi, vci); - return (1); - } - if (connection->status) { - printf("idt_openvcc: connection already open %d/%d\n", vpi, vci); - return (1); - } - connection->status = 1; - connection->recv = NULL; - connection->rlen = 0; - connection->maxpdu = 20000; - connection->aal = IDTAAL5; - connection->traf_pcr = attrib->traffic.v.forward.PCR_all_traffic; - connection->traf_scr = attrib->traffic.v.forward.SCR_all_traffic; - connection->vccinf = vccinf; /* 12/15/2000 */ - - if (connection->traf_pcr <= 0) - connection->traf_pcr = connection->traf_scr; - if (connection->traf_scr <= 0) - connection->traf_scr = connection->traf_pcr; - - class = idt_atm_bearerclass(&attrib->bearer); - if (vpi == 0 && vci == 5) - class = NICABR; /* higher priority than UBR */ - if (vpi == 0 && vci == 16) - class = NICABR; - - if (connection->traf_pcr < 0) { /* neither PCR nor SCR given */ - connection->traf_pcr = 1; - connection->traf_scr = 1; - class = NICUBR; /* so give it lowest priority */ - } - connection->class = class; - - if (idt_connect_txopen(idt, connection)) { - device_printf(idt->dev, "cannot open connection for %d/%d\n", - vpi, vci); - return (1); - } - if (idt_sysctl_logvcs) - printf("idt_openvcc: %d/%d, PCR=%d, SCR=%d\n", vpi, vci, - connection->traf_pcr, connection->traf_scr); - idt_connect_opencls(idt, connection, 1); /* open entry in rcv - * connect table */ - - return (0); -} - -/* We really don't handle ABR, but use it as a higher priority UBR. The - * idea is that a UBR connection that gives a PCR (like 0/16) should - * be given preference over a UBR connection that wants "everything else". - * - * Note that CLASS_X is typically UBR, but the traffic type information - * element may still specify CBR or VBR. - * - ******************************************************************************* - * - * Close VCC - */ - -static int -idt_closevcc(Cmn_unit * cmnunit, Cmn_vcc * cmnvcc) -{ - CONNECTION *connection; - nicstar_reg_t *idt = (nicstar_reg_t *) cmnunit; - int vpi; - int vci; - - if (cmnvcc && cmnvcc->cv_connvc && cmnvcc->cv_connvc->cvc_vcc) { - vpi = cmnvcc->cv_connvc->cvc_vcc->vc_vpi; - vci = cmnvcc->cv_connvc->cvc_vcc->vc_vci; - } else { - printf("idt_closevcc: bad vcivpi\n"); - return (0); - } - connection = idt_connect_find(idt, vpi, vci); - - if (connection == NULL) { - printf("idt_closevcc: vpi/vci invalid: %d/%d\n", vpi, vci); - return (0); - } - idt_connect_opencls(idt, connection, 0); /* close entry in rcv - * connect table */ - - if (connection->status == 0) - printf("idt_closevcc: close on empty connection %d/%d\n", vpi, vci); - if (connection->recv != NULL) - m_freem(connection->recv); /* recycle mbuf of partial PDU */ - idt_connect_txclose(idt, connection); - connection->status = 0; - connection->recv = NULL; - connection->rlen = 0; - connection->maxpdu = 0; - connection->aal = 0; - connection->traf_pcr = 0; - connection->traf_scr = 0; - - if (idt_sysctl_logvcs) - printf("idt_closevcc: vpi=%d vci=%d\n", vpi, vci); - - return (0); -} - -/* - * - * VCC Stack Instantiation - * - * This function is called via the common driver code during a device VCC - * stack instantiation. The common code has already validated some of - * the request so we just need to check a few more IDT-specific details. - * - * Called at splnet. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 instantiation successful - * err instantiation failed - reason indicated - * - */ -static int -idt_instvcc(Cmn_unit * cmnunit, Cmn_vcc * cmnvcc) -{ - Atm_attributes *attrib; /* from HARP struct */ - IDT *idt; - int class, pcr, scr; - int slots_vc, slots_cur, slots_max; - - if (cmnvcc == NULL) - return (EINVAL); - if (cmnvcc->cv_connvc == NULL) - return (EINVAL); - - idt = (IDT *) cmnunit; - if (idt == NULL) - return (EINVAL); - - attrib = &cmnvcc->cv_connvc->cvc_attr; - - if (attrib == NULL) - return (EINVAL); - - pcr = attrib->traffic.v.forward.PCR_all_traffic; - scr = attrib->traffic.v.forward.SCR_all_traffic; - - if (pcr <= 0) - pcr = scr; /* if PCR missing, default to SCR */ - if (pcr <= 0) - pcr = 1; - if (scr <= 0) - scr = pcr; - - class = idt_atm_bearerclass(&attrib->bearer); - if (class == NICCBR) { - slots_max = idt->txslots_max; - slots_cur = idt->txslots_cur; - slots_vc = idt_slots_cbr(idt, scr); /* 06/13/2001: now using - * SCR */ - if (slots_vc + slots_cur > slots_max) { - if (idt_sysctl_logvcs) - device_printf(idt->dev, - "Insufficient bandwidth (vc=%d cur=%d max=%d)\n", - slots_vc, slots_cur, slots_max); - return (EINVAL); - } - } - /* This part was take from /sys/dev/hfa/fore_vcm.c */ - - switch (attrib->aal.type) { - case ATM_AAL0: - break; - case ATM_AAL3_4: - if ((attrib->aal.v.aal4.forward_max_SDU_size > IDT_IFF_MTU) || - (attrib->aal.v.aal4.backward_max_SDU_size > IDT_IFF_MTU)) - return (EINVAL); - break; - case ATM_AAL5: - if ((attrib->aal.v.aal5.forward_max_SDU_size > IDT_IFF_MTU) || - (attrib->aal.v.aal5.backward_max_SDU_size > IDT_IFF_MTU)) - return (EINVAL); - break; - default: - return (EINVAL); - } - return (0); -} - -/* - * Pass Incoming PDU up Stack - * - * This function is called via the core ATM interrupt queue callback - * set in fore_recv_drain(). It will pass the supplied incoming - * PDU up the incoming VCC's stack. - * - * Called at splnet. - * - * Arguments: - * tok token to identify stack instantiation - * m pointer to incoming PDU buffer chain - * - * Returns: - * none - */ -static void -idt_recv_stack(void *tok, KBuffer * m) -{ - Idt_vcc *ivp = (Idt_vcc *) tok; - int err; - - if ((m->m_flags & M_PKTHDR) == 0) { - printf("idt_recv_stack: Warning - mbuf chain has no header.\n"); - KB_FREEALL(m); - return; - } - /* - * Send the data up the stack - */ - STACK_CALL(CPCS_UNITDATA_SIG, ivp->iv_upper, - ivp->iv_toku, ivp->iv_vccb, (int)m, 0, err); - if (err) - KB_FREEALL(m); - - return; -} - -/****************************************************************************** - * - * Enqueue received PDU for HARP to handle - * - * in: IDT device, mbuf, vpi, vci - * - * Date last: 12/14/2000 - */ - -void -idt_receive(nicstar_reg_t * idt, struct mbuf * m, int vpi, int vci) -{ - caddr_t cp; - Cmn_vcc *vcc; - int space; - - /* - * The STACK_CALL needs to happen at splnet() in order for the stack - * sequence processing to work. Schedule an interrupt queue - * callback at splnet() since we are currently at device level. - */ - - /* - * Prepend callback function pointer and token value to buffer. We - * have already guaranteed that the space is available in the first - * buffer. - */ - - /* - * vcc = atm_dev_vcc_find(&idt->iu_cmn, (vpivci>> 16), vpivci & - * 0xffff, VCC_IN); - */ - - vcc = atm_dev_vcc_find(&idt->iu_cmn, vpi, vci, VCC_IN); - - if (vcc == NULL) { /* harp stack not ready or no vcc */ - printf("idt_receive: no VCC %d/%d\n", vpi, vci); - KB_FREEALL(m); - return; - } - space = m->m_data - idt_mbuf_base(m); - if (space < sizeof(atm_intr_func_t) + sizeof(int)) { - printf("idt_receive: NOT enough buffer space (%d).\n", space); - KB_FREEALL(m); - return; - } - KB_HEADADJ(m, sizeof(atm_intr_func_t) + sizeof(int)); - KB_DATASTART(m, cp, caddr_t); - *((atm_intr_func_t *) cp) = idt_recv_stack; - cp += sizeof(atm_intr_func_t); - - *((void **)cp) = (void *)vcc; - - /* - * Schedule callback - */ - netisr_queue(NETISR_ATM, m); /* mbuf is free'd on failure. */ -} Property changes on: head/sys/dev/idt/idt_harp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/idt/idt.c =================================================================== --- head/sys/dev/idt/idt.c (revision 179307) +++ head/sys/dev/idt/idt.c (nonexistent) @@ -1,3311 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Matriplex, inc. - * 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. - * - ****************************************************************************** - * - * This driver is derived from the Nicstar driver by Mark Tinguely, and - * some of the original driver still exists here. Those portions are... - * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely - * All rights reserved. - * - ****************************************************************************** - * - * This driver supports the Fore LE155, LE25, and IDT 77211 cards. - * - * ATM CBR connections are supported, and bandwidth is allocated in - * slots of 64k each. Three VBR queues handle traffic for VBR and - * UBR. Two UBR queues prioritize UBR traffic. ILMI and signalling - * get the higher priority queue, as well as UBR traffic that specifies - * a peak cell rate. All other UBR traffic goes into the lower queue. - * - ****************************************************************************** - * - * The following sysctl variables are used: - * - * hw.idt.log_bufstat (0) Log free buffers (every few minutes) - * hw.idt.log_vcs (0) Log VC opens, closes, and other events - * hw.idt.bufs_large (100) Max/target number of free 2k buffers - * hw.idt.bufs_small (200) Max/target number of free mbufs - * hw.idt.cur_large (R/O) Current number of free 2k buffers - * hw.idt.cur_small (R/O) Current number of free mbufs - * hw.idt.qptr_hold (1) Optimize TX queue buffer for lowest overhead - * - * Note that the read-only buffer counts will not work with multiple cards. - * - ****************************************************************************** - * - * Assumptions: - * - * 1. All mbuf clusters are 2048 bytes, and aligned. - * 2. All mbufs are 256 bytes, and aligned (see idt_intr_tsq). - * - * Bugs: - * - * 1. Function idt_detach() is unusuable because idt_release_mem() is - * incomplete. The mbufs held in the free buffer queues can be - * recovered from the "mcheck" hash table. - * 2. The memory allocation could be cleaned up quite a bit. - * - ****************************************************************************** - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include /* bootverbose */ - -#include -#include -#include -#include - -#include -#include - -/* Gross kludge to make lint compile again. This sucks, but oh well */ -#ifdef COMPILING_LINT -#undef MCLBYTES -#undef MCLSHIFT -#define MCLBYTES 2048 -#define MCLSHIFT 11 -#endif - -#if MCLBYTES != 2048 -#error "This nicstar driver depends on 2048 byte mbuf clusters." -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#define MAXCARDS 10 /* set to impossibly high */ - -/****************************************************************************** - * - * You may change IDT_LBUFS and IDT_SBUFS if you wish. - */ - -#define NICSTAR_LRG_SIZE 2048 /* must be power of two */ -#define IDT_LBUFS 100 /* default number of 2k buffers */ -#define IDT_SBUFS 200 /* default number of 96-byte buffers */ - -#define IDT_TST_START 0x1c000 /* transmit schedule table start */ -#define IDT_SCD_START 0x1d000 /* segmentation channel descriptors start */ -#define IDT_SCD_SIZE 509 /* max number of SCD entries */ - -#define NICSTAR_FIXPAGES 10 - -static int idt_sysctl_logbufs = 0; /* periodic buffer status messages */ - int idt_sysctl_logvcs = 0; /* log VC open & close events */ -static int idt_sysctl_buflarge = IDT_LBUFS; /* desired large buffer queue */ -static int idt_sysctl_bufsmall = IDT_SBUFS; /* desired small buffer queue */ -static int idt_sysctl_curlarge = 0; /* current large buffer queue */ -static int idt_sysctl_cursmall = 0; /* current small buffer queue */ -static int idt_sysctl_qptrhold = 1; /* hold TX queue pointer back */ - int idt_sysctl_vbriscbr = 0; /* use CBR slots for VBR VC's */ - -SYSCTL_NODE(_hw, OID_AUTO, idt, CTLFLAG_RW, 0, "IDT Nicstar"); - -SYSCTL_INT(_hw_idt, OID_AUTO, log_bufstat, CTLFLAG_RW, - &idt_sysctl_logbufs, 0, "Log buffer status"); -SYSCTL_INT(_hw_idt, OID_AUTO, log_vcs, CTLFLAG_RW, - &idt_sysctl_logvcs, 0, "Log VC open/close"); - -SYSCTL_INT(_hw_idt, OID_AUTO, bufs_large, CTLFLAG_RW, - &idt_sysctl_buflarge, IDT_LBUFS, "Large buffer queue"); -SYSCTL_INT(_hw_idt, OID_AUTO, bufs_small, CTLFLAG_RW, - &idt_sysctl_bufsmall, IDT_SBUFS, "Small buffer queue"); -SYSCTL_INT(_hw_idt, OID_AUTO, cur_large, CTLFLAG_RD, - &idt_sysctl_curlarge, 0, "Current large queue"); -SYSCTL_INT(_hw_idt, OID_AUTO, cur_small, CTLFLAG_RD, - &idt_sysctl_cursmall, 0, "Current small queue"); -SYSCTL_INT(_hw_idt, OID_AUTO, qptr_hold, CTLFLAG_RW, - &idt_sysctl_qptrhold, 1, "Optimize TX queue ptr"); -SYSCTL_INT(_hw_idt, OID_AUTO, vbr_is_cbr, CTLFLAG_RW, - &idt_sysctl_vbriscbr, 0, "Use CBR for VBR VC's"); - -/****************************************************************************** - * - * common VCI values - * - * 0/0 Idle cells - * 0/1 Meta signalling - * x/1 Meta signalling - * 0/2 Broadcast signalling - * x/2 Broadcast signalling - * x/3 Segment OAM F4 flow - * x/4 End-end OAM F4 flow - * 0/5 p-p signalling - * x/5 p-p signalling - * x/6 rate management - * 0/14 SPANS - * 0/15 SPANS - * 0/16 ILMI - * 0/18 PNNI - */ - -/******************************************************************************* - * - * fixbuf memory map: - * - * 0000 - 1fff: TSQ Transmit status queue 1024 entries * 8 bytes each - * 2000 - 3fff: RSQ Receive status queue, 512 entries * 16 bytes each - * 4000 - 5fff: VBR segmentation channel queue (highest priority) - * 6000 - 7fff: ABR segmentation channel queue (middle priority) - * 8000 - 9fff: UBR segmentation channel queue (lowest priority) - * - * IDT device memory map: - * - * 1fc00: RX large buffer queue (4k) - * 1f800: RX small buffer queue (4k) - * 1e800: RX cells FIFO (16k) - * 1e7f4: SCD0 - VBR (12) - * 1e7e8: SCD1 - ABR (12) - * 1e7dc: SCD2 - UBR (12) - * 1e7db: CBR SCD end (last word) - * 1d000: CBR SCD start (509 entries) - * 1cfff: TST end (4095 available slots) - * 1c000: TST start (first CBR slot) - * - */ - -static u_long idt_found = 0; - - /* -------- buffer management -------- */ -static int nicstar_sram_wr(nicstar_reg_t * const, u_long, - int, u_long, u_long, u_long, u_long); -static int nicstar_sram_rd(nicstar_reg_t * const, u_long, u_long *); -static int nicstar_add_buf(nicstar_reg_t * const, struct mbuf *, - struct mbuf *, u_long); -static int nicstar_util_rd(nicstar_reg_t * const, u_long, u_long *); -static int nicstar_util_wr(nicstar_reg_t * const, int, u_long, u_long); - void nicstar_ld_rcv_buf(nicstar_reg_t * const); - - /* -------- interface routines -------- */ -int nicstar_output(struct ifnet *, struct mbuf *, struct sockaddr *, - struct rtentry *); -void nicstar_start(struct ifnet *); - - /* -------- VCC open/close routines -------- */ -static void nicstar_itrx(nicstar_reg_t *); - - /* -------- receiving routines -------- */ -static void nicstar_rawc(nicstar_reg_t *); -static void nicstar_recv(nicstar_reg_t *); -static void nicstar_phys(nicstar_reg_t *); - -/******************************************************************************* - * - * New functions - */ - -static int idt_buffer_init(IDT *); -static struct mbuf *idt_mbufcl_get(void); - -static int idt_connect_init(IDT *, int); -static void idt_connect_newvbr(IDT *); - -static void idt_intr_tsq(IDT *); - -static vm_offset_t idt_malloc_contig(int); - -static int idt_mbuf_align(struct mbuf *, struct mbuf *); -static int idt_mbuf_append4(struct mbuf *, char *); -static struct mbuf *idt_mbuf_copy(IDT *, struct mbuf *); -static int idt_mbuf_prepend(struct mbuf *, char *, int); -static int idt_mbuf_used(struct mbuf *); - -static int idt_mcheck_add(IDT *, struct mbuf *); -static int idt_mcheck_rem(IDT *, struct mbuf *); -static int idt_mcheck_init(IDT *); - -static int idt_queue_flush(CONNECTION *); -static struct mbuf *idt_queue_get(TX_QUEUE *); -static int idt_queue_init(IDT *); -static int idt_queue_put(CONNECTION *, struct mbuf *); - -static int idt_receive_aal5(IDT *, struct mbuf *, struct mbuf *); -static void idt_transmit_drop(IDT *, struct mbuf *); -static void idt_transmit_top(IDT *, TX_QUEUE *); - -static int idt_slots_add(IDT *, TX_QUEUE *, int); -static int idt_slots_init(IDT *); -static int idt_slots_rem(IDT *, TX_QUEUE *); - -static int idt_phys_detect(IDT *); -static void idt_status_bufs(IDT *); -static int idt_status_wait(IDT *); - -/****************************************************************************** - * - * VBR queue divisor table - */ - -static unsigned char vbr_div_m[] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, - 1, 2, 2, 2, 3, 1, 2, 1, 3, 2, 3, 3, 4, 3, 3, 2, 4, 1, 3, 3, - 1, 5, 5, 4, 4, 5, 4, 4, 6, 5, 1, 5, 4, 6, 2, 6, 7, 7, 4, 1, - 3, 5, 7, 7, 5, 5, 7, 7, 7, 2, 7, 7, 7, 7, 2, 3, 6, 1, 6, 3, - 2, 3, 5, 1, 7, 4, 5, 2, 3, 4, 7, 1, 7, 4, 3, 2, 7, 7, 5, 7, - 1, 7, 5, 7, 5, 2, 7, 3, 4, 6, 7, 1, 1, 7, 4, 7, 5, 7, 2, 5, - 3, 4, 5, 7, 1, 1, 1, 7, 5, 4, 7, 3, 7, 2, 7, 5, 3, 7, 4, 5, - 7, 7, 1, 1, 1, 7, 7, 5, 4, 7, 3, 5, 7, 7, 2, 7, 5, 5, 3, 7, - 4, 5, 6, 7, 7, 1, 1, 1, 1, 7, 7, 7, 5, 5, 4, 7, 3, 3, 5, 5, - 7, 2, 2, 2, 7, 5, 5, 3, 3, 7, 4, 4, 5, 6, 7, 7, 7, 7, 1, 1, - 1, 1, 1, 7, 7, 7, 7, 6, 5, 5, 4, 4, 7, 7, 3, 3, 5, 5, 5, 7, - 7, 2, 2, 2, 2, 7, 7, 5, 5, 5, 3, 3, 3, 7, 7, 4, 4, 5, 5, 5, - 6, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, 7, - 7, 6, 6, 5, 5, 4, 4, 4, 7, 7, 7, 3, 3, 3, 3, 3, 5, 5, 5, 7, - 7, 7, 7, 2, 2, 2, 2, 2, 2, 7, 7, 7, 7, 5, 5, 5, 5, 5, 3, 3, - 3, 3, 3, 7, 7, 7, 7, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 5, 5, 5, 5, - 5, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, - 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, - 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -static unsigned char vbr_div_n[] = { - 127, 127, 127, 127, 127, 127, 127, 127, 125, 111, 100, 91, 83, 77, 71, - 67, 125, 59, 111, 105, 50, 95, 91, 87, 125, 40, 77, 37, 107, 69, - 100, 97, 125, 91, 88, 57, 111, 27, 79, 77, 25, 122, 119, 93, 91, - 111, 87, 85, 125, 102, 20, 98, 77, 113, 37, 109, 125, 123, 69, 17, - 50, 82, 113, 111, 78, 77, 106, 104, 103, 29, 100, 99, 97, 96, 27, - 40, 79, 13, 77, 38, 25, 37, 61, 12, 83, 47, 58, 23, 34, 45, - 78, 11, 76, 43, 32, 21, 73, 72, 51, 71, 10, 69, 49, 68, 48, - 19, 66, 28, 37, 55, 64, 9, 9, 62, 35, 61, 43, 60, 17, 42, - 25, 33, 41, 57, 8, 8, 8, 55, 39, 31, 54, 23, 53, 15, 52, - 37, 22, 51, 29, 36, 50, 50, 7, 7, 7, 48, 48, 34, 27, 47, - 20, 33, 46, 46, 13, 45, 32, 32, 19, 44, 25, 31, 37, 43, 43, - 6, 6, 6, 6, 41, 41, 41, 29, 29, 23, 40, 17, 17, 28, 28, - 39, 11, 11, 11, 38, 27, 27, 16, 16, 37, 21, 21, 26, 31, 36, - 36, 36, 36, 5, 5, 5, 5, 5, 34, 34, 34, 34, 29, 24, 24, - 19, 19, 33, 33, 14, 14, 23, 23, 23, 32, 32, 9, 9, 9, 9, - 31, 31, 22, 22, 22, 13, 13, 13, 30, 30, 17, 17, 21, 21, 21, - 25, 29, 29, 29, 29, 29, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 27, 27, 27, 27, 27, 27, 23, 23, 19, 19, 15, 15, 15, 26, 26, - 26, 11, 11, 11, 11, 11, 18, 18, 18, 25, 25, 25, 25, 7, 7, - 7, 7, 7, 7, 24, 24, 24, 24, 17, 17, 17, 17, 17, 10, 10, - 10, 10, 10, 23, 23, 23, 23, 13, 13, 13, 13, 16, 16, 16, 16, - 19, 19, 22, 22, 22, 22, 22, 22, 22, 22, 22, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 20, 17, 17, 17, 17, 14, 14, 14, 14, - 14, 11, 11, 11, 11, 11, 11, 19, 19, 19, 19, 19, 8, 8, 8, - 8, 8, 8, 8, 8, 13, 13, 13, 13, 13, 13, 13, 18, 18, 18, - 18, 18, 18, 18, 18, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 17, 17, 17, 17, 17, 17, 17, 17, 17, 12, 12, 12, 12, 12, - 12, 12, 12, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 16, - 16, 16, 16, 16, 16, 16, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 13, 13, 13, 13, 13, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 13, 13, 11, 11, 11, 11, 11, 11, 11, 11, 11, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 -}; - -/****************************************************************************** - * - * Stop the device (shutdown) - * - * in: IDT device - * - * Date first: 11/14/2000 last: 11/14/2000 - */ - -void -idt_device_stop(IDT * idt) -{ - u_long val; - int s; - - s = splimp(); - - *(idt->reg_cfg) = 0x80000000; /* put chip into reset */ - val = *(idt->reg_gp); /* wait... */ - val |= *(idt->reg_gp); /* wait... */ - val |= *(idt->reg_gp); /* wait... */ - *(idt->reg_cfg) = 0; /* out of reset */ - - splx(s); - - return; -} - -/****************************************************************************** - * - * Initialize the hardware - */ - -void -phys_init(nicstar_reg_t * const idt) -{ - int i; - u_long t; - -#ifdef NICSTAR_TESTSRAM - u_long z, s2, bad; -#endif - u_long x, s1; - volatile u_long *regCFG = (volatile u_long *)(idt->virt_baseaddr + REGCFG); - volatile u_long *regGP = (volatile u_long *)(idt->virt_baseaddr + REGGP); - volatile u_long stat_val; - - /* clean status bits */ - stat_val = *(volatile u_long *)idt->stat_reg; - *(volatile u_long *)idt->stat_reg = stat_val | 0xcc30; /* clear ints */ - - idt->flg_le25 = 0; /* is this FORE LE25 with 77105 PHY? */ - idt->flg_igcrc = 0; /* ignore receive CRC errors? */ - idt->hardware = "?"; - - /* start signalling SAR reset */ - *regCFG = 0x80000000; - - /* SAR reset--clear occurs at lease 2 PCI cycles after setting */ - t = *regGP; /* wait */ - t = *regCFG; - *regCFG = 0; /* clear reset */ - - *regGP = 0x00000000; /* clear PHYS reset */ - *regGP = 0x00000008; /* start PHYS reset */ - t = *regGP; /* wait */ - t = *regCFG; - *regGP = 0x00000001; /* set while changing SUNI settings */ - t = *regGP; /* wait */ - t = *regCFG; - - idt->flg_le25 = idt_phys_detect(idt); - - if (idt->flg_le25) { - idt->cellrate_rmax = 59259; - idt->cellrate_tmax = 59259; - idt->cellrate_rcur = 0; - idt->cellrate_tcur = 0; - idt->txslots_max = 348; /* use n*348 for higher resolution */ - idt->txslots_cur = 0; - nicstar_util_wr(idt, 0, 0x00, 0x00); /* synch (needed for - * 77105?) */ - nicstar_util_wr(idt, 1, 0x00, 0x09); /* enable interrupts */ - nicstar_util_wr(idt, 1, 0x02, 0x10); /* 77105 RFLUSH */ - nicstar_util_rd(idt, 0x01, &t); /* read/clear interrupt flag */ - } else { - idt->cellrate_rmax = 353207; /* 2075 slots of 1 DS0 each... */ - idt->cellrate_tmax = 353207; - idt->cellrate_rcur = 0; - idt->cellrate_tcur = 0; - idt->txslots_max = 2075; - idt->txslots_cur = 0; - - /* initialize the 155Mb SUNI */ - nicstar_util_wr(idt, 0, 0x00, 0x00); /* sync utopia with SAR */ - nicstar_util_wr(idt, 1, 0x00, 0x00); /* clear SW reset */ - *regGP = 0x00000000; /* clear when done with SUNI changes */ - } - -#ifdef NICSTAR_TESTSRAM - /* - * this will work with 32K and 128K word RAM because the pattern - * repeats every 4 words - */ - for (i = 0; i < 0x20000; i += 4) - (void)nicstar_sram_wr(idt, i, 4, 0xa5a5a5a5, 0x5a5a5a5a, - 0xa5a5a5a5, 0x5a5a5a5a); - for (i = 0; i < 0x20000; i += 2) { - s1 = nicstar_sram_rd(idt, i, &x); - s2 = nicstar_sram_rd(idt, i + 1, &z); - if (s1 || s2 || x != 0xa5a5a5a5 || z != 0x5a5a5a5a) { - printf("sram fail1 %d 0x%08x 0x%08x\n", i, x, z); - break; - } - } - for (i = 0; i < 0x20000; i += 4) - (void)nicstar_sram_wr(idt, i, 4, 0x5a5a5a5a, 0xa5a5a5a5, - 0x5a5a5a5a, 0xa5a5a5a5); - for (i = 0; i < 0x20000; i += 2) { - s1 = nicstar_sram_rd(idt, i, &z); - s2 = nicstar_sram_rd(idt, i + 1, &x); - if (s1 || s2 || x != 0xa5a5a5a5 || z != 0x5a5a5a5a) { - printf("sram fail2 %d 0x%08x 0x%08x\n", i, x, z); - break; - } - } -#endif - - /* flush SRAM */ - for (i = 0; i < 0x20000; i += 4) - (void)nicstar_sram_wr(idt, i, 4, 0, 0, 0, 0); - - /* - * the memory map for the 32K word card has the - * addresses 0x8000, 0x10000, 0x18000 mapped back - * to address 0, and 0x8001, ..., 0x18001 is mapped - * to address 1. address 0x4000 is mapped to 0x1c000 - */ - - /* write in the 0 word, see if we read it at 0x10000 */ - (void)nicstar_sram_wr(idt, 0x0, 1, 0xa5a5a5a5, 0, 0, 0); - s1 = nicstar_sram_rd(idt, 0x10000, &x); - (void)nicstar_sram_wr(idt, 0x0, 1, 0, 0, 0, 0); - if (!s1 && x == 0xa5a5a5a5) { - device_printf(idt->dev, "32K words of RAM\n"); - idt->sram = 0x4000; - } else { - device_printf(idt->dev, "128K words of RAM\n"); - idt->sram = 0x10000; - } -#ifdef NICSTAR_FORCE32K - idt->sram = 0x4000; - device_printf(idt->dev, "forced to 32K words of RAM\n"); -#endif - - return; -} - -/* Cellrate notes: - * The cellrate for OC3 is 353207.55, rounded down above. This makes - * 2075 slots of one DS0 (64003) each. - * - * The ATM25 rate is calculated from 25.6mb divided by 424 bits for - * cell plus 8 bits for "opcode" == 432 bits. 59259 * 432 = 25599888. - * This provides a 47-byte AAL1 bitrate of 22,281,384 bits/sec, or - * 348 slots of one DS0 (64027) each. If 8khz synch events are to - * be sent, then only 347 slots are available. - * - ****************************************************************************** - * - * Physical layer detect - * - * in: IDT device - * out: zero = LE155, NZ = LE25 - * - * Date first: 10/30/2000 last: 06/08/2001 - */ - -int -idt_phys_detect(IDT * idt) -{ - u_long t; - int retval; - - retval = 0; - - nicstar_util_wr(idt, 0, 0x00, 0x00); /* synch (needed for 77105?) */ - nicstar_util_rd(idt, 0x00, &t); /* get Master Control Register */ - - switch (t) { - /* 25.6 Mbps ATM PHY with TC & PMD */ - /* http://www.idt.com/products/pages/ATM_Products-77105.html */ - case 0x09: - device_printf(idt->dev, "ATM card is Fore LE25, PHY=77105\n"); - idt->hardware = "ATM25/77105"; - retval = 1; - break; - - /* S/UNI-155-LITE */ - /* http://www.pmc-sierra.com/products/details/pm5346/index.html */ - case 0x30: - device_printf(idt->dev, "ATM card is Fore LE155 or IDT, PHY=PM5346\n"); - idt->hardware = "ATM155/PM5346"; - break; - - /* S/UNI-155-ULTRA */ - /* http://www.pmc-sierra.com/products/details/pm5350/index.html */ - case 0x31: - case 0x70: - case 0x78: - device_printf(idt->dev, "ATM card is Fore LE155, PHY=PM5350\n"); - idt->hardware = "ATM155/PM5350"; - break; - - default: - device_printf(idt->dev, - "cannot figure out card type, assuming LE155 (reg=%d).\n", - (int)t); - idt->hardware = "unknown (LE155?)"; - break; - } - return (retval); -} - -/* Register 0 values: - * 77105 = 0x09 - * PM5346 = 0x30 - * PM5250 = 0x31 (actually observed) - * PM5350 = 0x70 or 0x78 (according to docs) - * - ****************************************************************************** - * - * Initialize the data structures - */ - -void -nicstar_init(nicstar_reg_t * const idt) -{ - int i; - vm_offset_t buf; - u_long *p; - - idt_connect_init(idt, 0); /* initialize for 0 VPI bits (12 VCI - * bits) */ - - /* allocate space for TSQ, RSQ, SCD for VBR,ABR, UBR */ - idt->fixbuf = (vm_offset_t)contigmalloc(NICSTAR_FIXPAGES * PAGE_SIZE, - M_DEVBUF, M_NOWAIT | M_ZERO, 0x100000, 0xffffffff, 0x2000, 0); - if (idt->fixbuf == 0) - return; /* no space card disabled */ - - if (idt_buffer_init(idt)) /* allocate large buffers */ - goto freemem; /* free memory and return */ - - if (idt_mcheck_init(idt)) - goto freemem; - - idt_found++; /* number of cards found on machine */ - - if (bootverbose) { - printf("nicstar: buffer size %d\n", 0); - } - idt_queue_init(idt); /* initialize all TX_QUEUE structures */ - idt_slots_init(idt); /* initialize CBR table slots */ - - /* initialize variable rate mbuf queues */ - - /* TSQ initialization */ - for (p = (u_long *)idt->fixbuf; p < (u_long *)(idt->fixbuf + 0x2000);) { - *p++ = 0x00000000; - *p++ = 0x80000000; /* set empty bit */ - } - - buf = vtophys(idt->fixbuf); - /* Transmit Status Queue Base */ - *(volatile u_long *)(idt->virt_baseaddr + REGTSQB) = buf; - /* Transmit Status Queue Head */ - *(volatile u_long *)(idt->virt_baseaddr + REGTSQH) = 0; /* 8k aligned */ - idt->tsq_base = (u_long *)idt->fixbuf; - idt->tsq_head = (u_long *)idt->fixbuf; - idt->tsq_size = 1024; - - /* Recieve Status Queue Base */ - *(volatile u_long *)(idt->virt_baseaddr + REGRSQB) = buf + 0x2000; - /* Transmit Status Queue Head */ - *(volatile u_long *)(idt->virt_baseaddr + REGRSQH) = 0; /* 8k aligned */ - idt->rsqh = 0; - - - /* Now load receive buffers into SRAM */ - nicstar_ld_rcv_buf(idt); - - /* load variable SCQ */ - (void)nicstar_sram_wr(idt, 0x1e7dc, 4, (u_long)(buf + 0x8000), 0, - 0xffffffff, 0); /* SD2 */ - (void)nicstar_sram_wr(idt, 0x1e7e0, 4, 0, 0, 0, 0); - (void)nicstar_sram_wr(idt, 0x1e7e4, 4, 0, 0, 0, 0); - - (void)nicstar_sram_wr(idt, 0x1e7e8, 4, (u_long)(buf + 0x6000), 0, - 0xffffffff, 0); /* SD1 */ - (void)nicstar_sram_wr(idt, 0x1e7ec, 4, 0, 0, 0, 0); - (void)nicstar_sram_wr(idt, 0x1e7f0, 4, 0, 0, 0, 0); - - (void)nicstar_sram_wr(idt, 0x1e7f4, 4, (u_long)(buf + 0x4000), 0, - 0xffffffff, 0); /* SD0 */ - (void)nicstar_sram_wr(idt, 0x1e7f8, 4, 0, 0, 0, 0); - (void)nicstar_sram_wr(idt, 0x1e7fc, 4, 0, 0, 0, 0); - - /* initialize RCT */ - for (i = 0; i < idt->sram; i += 4) { /* XXX ifdef table size */ - nicstar_sram_wr(idt, i, 4, 0x0, 0x0, 0x0, 0xffffffff); - } - - /* VPI/VCI mask is 0 */ - *(volatile u_long *)(idt->virt_baseaddr + REGVMSK) = 0; - - /* Set the Transmit Schedule Table base address */ - *(volatile u_long *)(idt->virt_baseaddr + REGTSTB) = IDT_TST_START; - - -/* Configuration Register settings: - * Bit(s) Meaning value - * 31 Software reset 0 - * 30 RESERVED 0 - * 29 Recieve Enabled 1 - * 28-27 Small Buffer Size (host memory) 01 (96 bytes) - * 26-25 Large Buffer Size (host memory) 00 (2048 bytes) - * 24 Interrupt on empty free buffer queue 1 - * - * 23-22 Recieve Status Queue Size (host memory) 10 (8192 bytes) - * 21 Accpect Invalid cells into Raw Queue 1 - * 20 Ignore General Flow control 1 - * - * 19-18 VPI/VCI Select 00 - * 17-16 Recieve Connect Table Size 00 (32K SRAM) - * 10 (128K SRAM) - * - * 15 Accpect non-open VPI/VCI to Raw Queue 1 - * 14-12 time to delay after Rx and interrupt 001 (0us) - * - * 11 Interrupt when a Raw Cell is added 1 - * 10 Interrupt when Recieve Queue near full 1 - * 9 Recieve RM (PTI = 110 or 111) 1 - * 8 RESERVED 0 - * - * 7 Interrupt on Timer rollover 1 - * 6 RESERVED 0 - * 5 Transmit Enabled 1 - * 4 Interrupt on Transmit Status Indicator 1 - * - * 3 Interrupt on transmit underruns 1 - * 2 UTOPIA cell/byte mode 0 (cell) - * 1 Interrupt on nearly full TSQ 1 - * 0 Enable Physical Interrupt 1 - */ - - /* original values: 0x31b09ebb and 0x31b29eb */ - /* - * 11/01/2000: changed from 0x31b09eb to 0x29b09eb for 96-byte - * sm-buf - */ - - if (idt->sram == 0x4000)/* 32K */ - *(volatile u_long *)(idt->virt_baseaddr + REGCFG) = 0x29b09ebb; - else /* 128K */ - *(volatile u_long *)(idt->virt_baseaddr + REGCFG) = 0x29b29ebb; - - return; - -freemem: - /* free memory and return */ - idt_release_mem(idt); - device_printf(idt->dev, "cannot allocate memory\n"); - return; /* no space card disabled */ -} - -/****************************************************************************** - * - * Release all allocated memory - * - * in: IDT device - * - * Date first: 11/14/2000 last: 11/14/2000 - */ - -void -idt_release_mem(IDT * idt) -{ - if (idt->fixbuf != 0) - kmem_free(kernel_map, idt->fixbuf, - (NICSTAR_FIXPAGES * PAGE_SIZE)); - - if (idt->cbr_base != 0) - kmem_free(kernel_map, (vm_offset_t)idt->cbr_base, idt->cbr_size); - - printf("%s() is NOT SAFE!\n", __func__); - - /* we also have idt->connection and idt->mcheck to do as well... */ -} - -/****************************************************************************** - * - * Write one to four words to SRAM - * - * writes one to four words into sram starting at "sram_location" - * - * returns -1 if sram location is out of range. - * returns count, if count is not in the range from 1-4. - * returns 0 if parameters were acceptable - */ - -static int -nicstar_sram_wr(nicstar_reg_t * const idt, u_long address, int count, - u_long data0, u_long data1, u_long data2, u_long data3) -{ - if (address >= 0x20000) /* bad address */ - return (-1); - - if (idt_status_wait(idt)) /* 12/06/2000 */ - return (-1); - - switch (--count) { - case 3: - *(idt->reg_data + 3) = data3; /* drop down to do others */ - case 2: - *(idt->reg_data + 2) = data2; /* drop down to do others */ - case 1: - *(idt->reg_data + 1) = data1; /* drop down to do others */ - case 0: - *idt->reg_data = data0; /* load last data item */ - break; /* done loading values */ - default: - return (count); /* nothing to do */ - } - /* write the word(s) */ - *idt->reg_cmd = 0x40000000 | (address << 2) | count; - - return (0); -} - -/* 05/31/2001: Removed wait between data register(s) and write command. - * The docs do not state it is helpful, and the example only has one - * wait, before the data register load. The wait time is very high - - * aproximately 6 microseconds per wait. - * - ****************************************************************************** - * - * Read one word from SRAM - * - * reads one word of sram at "sram_location" and places the value - * in "answer_pointer" - * - * returns -1 if sram location is out of range. - * returns 0 if parameters were acceptable - */ -static int -nicstar_sram_rd(nicstar_reg_t * const idt, u_long address, u_long *data0) -{ - if (address >= 0x20000) /* bad address */ - return (-1); - - if (idt_status_wait(idt)) - return (-1); - - *idt->reg_cmd = 0x50000000 | (address << 2); /* read a word */ - - if (idt_status_wait(idt)) - return (-1); - - *data0 = *idt->reg_data;/* save word */ - - return (0); -} - -/******************************************************************************* - * - * Open or Close connection in IDT Receive Connection Table - * - * in: IDT device, VPI, VCI, opflag (0 = close, 1 = open) - * out: zero = success - * - * Date first: 12/14/2000 last: 12/14/2000 - */ - -int -idt_connect_opencls(IDT * idt, CONNECTION * connection, int opflag) -{ - int address; - int word1; - - if (connection->vpi >= idt->conn_maxvpi || - connection->vci >= idt->conn_maxvci) - return (1); - - address = connection->vpi * idt->conn_maxvci + connection->vci; - address <<= 2; /* each entry is 4 words */ - - if (opflag) { - switch (connection->aal) { - case ATM_AAL0: - word1 = 0x00038000; - break; /* raw cell queue */ - case ATM_AAL1: - word1 = 0x00008000; - break; /* Nicstar "AAL0" */ - case ATM_AAL3_4: - word1 = 0x00018000; - break; - case ATM_AAL5: - word1 = 0x00028000; - break; - default: - return (1); - } - nicstar_sram_wr(idt, address, 4, word1, 0, 0, 0xffffffff); - opflag = 0x00080000; /* bit-19 set or clear */ - } - if (idt_status_wait(idt)) - return (1); - - *idt->reg_cmd = 0x20000000 | opflag | address << 2; - return (0); -} - -/******************************************************************************* - * - * nicstar_add_buf ( card, mbuf1, mbuf2, which_queue) - * - * This adds two buffers to the specified queue. This uses the - * mbuf address as handle and the buffer physical address must be - * the DMA address. - * - * returns -1 if queue is full, the address is not word aligned, or - * an invalid queue is specified. - * returns 0 if parameters were acceptable. - */ - -int -nicstar_add_buf(nicstar_reg_t * const idt, struct mbuf * buf0, - struct mbuf * buf1, u_long islrg) -{ - u_long stat_val; - u_long val0, val1, val2, val3; - - if (islrg > 1) /* bad buffer size */ - return (-1); - - stat_val = *idt->reg_stat; - - if (islrg) { - if (stat_val & 0x80) /* large queue is full */ - return (-1); - } else if (stat_val & 0x100) /* small queue is full */ - return (-1); - - if (!buf0 || !buf1 || ((u_long)(buf0->m_data) & 0x7) - || ((u_long)(buf1->m_data) & 0x7)) { - return (-1); /* buffers must word aligned */ - } - if (idt->raw_headm == NULL) /* raw cell buffer pointer not - * initialized */ - if (islrg) { - idt->raw_headm = buf0; - idt->raw_headp = vtophys(buf0->m_data); - } - if (idt_status_wait(idt)) /* 12/06/2000 */ - return (-1); - - val0 = (u_long)buf0; /* mbuf address is handle */ - val1 = vtophys(buf0->m_data); /* DMA addr of buff1 */ - val2 = (u_long)buf1; /* mbuf address is handle */ - val3 = vtophys(buf1->m_data); /* DMA addr of buff2 */ - - *(idt->reg_data + 0) = val0; - *(idt->reg_data + 1) = val1; - *(idt->reg_data + 2) = val2; - *(idt->reg_data + 3) = val3; - - *idt->reg_cmd = 0x60000000 | islrg; - - idt_mcheck_add(idt, buf0); - idt_mcheck_add(idt, buf1); - - return (0); -} - -/****************************************************************************** - * - * nicstar_util_rd ( card, util_location, answer_pointer ) - * - * reads one byte from the utility bus at "util_location" and places the - * value in "answer_pointer" - * - * returns -1 if util location is out of range. - * returns 0 if parameters were acceptable - */ -static int -nicstar_util_rd(nicstar_reg_t * const idt, u_long address, u_long *data) -{ - - if (address >= 0x81) /* bad address */ - return (-1); - - if (idt_status_wait(idt)) - return (-1); - - *idt->reg_cmd = 0x80000200 | address; /* read a word */ - - if (idt_status_wait(idt)) - return (-1); - - *data = *idt->reg_data & 0xff; /* save word */ - - return (0); -} - -/****************************************************************************** - * - * nicstar_util_wr ( card, util location, data ) - * - * writes one byte to the utility bus at "util_location" - * - * returns -1 if util location is out of range. - * returns 0 if parameters were acceptable - */ -static int -nicstar_util_wr(nicstar_reg_t * const idt, int cs, u_long address, u_long data) -{ - - if (address >= 0x81) /* bad address */ - return (-1); - if (cs > 1) - return (-1); - - if (idt_status_wait(idt)) - return (-1); - - *idt->reg_data = data & 0xff; /* load last data item */ - - if (cs == 0) - *idt->reg_cmd = 0x90000100 | address; /* write the byte, CS1 */ - else - *idt->reg_cmd = 0x90000200 | address; /* write the byte, CS2 */ - - return (0); -} - -/****************************************************************************** - * - * nicstar_eeprom_rd ( card , byte_location ) - * - * reads one byte from the utility bus at "byte_location" and return the - * value as an integer. this routint is only used to read the MAC address - * from the EEPROM at boot time. - */ -int -nicstar_eeprom_rd(nicstar_reg_t * const idt, u_long address) -{ - volatile u_long *regGP = (volatile u_long *)(idt->virt_baseaddr + REGGP); - volatile u_long gp = *regGP & 0xfffffff0; - int i, value = 0; - - DELAY(5); /* make sure idle */ - *regGP = gp | 0x06; /* CS and Clock high */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - /* toggle in READ CMD (00000011) */ - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp; /* CS and Clock low */ - DELAY(5); - *regGP = gp | 0x04; /* Clock high (data 0) */ - DELAY(5); - *regGP = gp | 0x01; /* CS and Clock low data 1 */ - DELAY(5); - *regGP = gp | 0x05; /* Clock high (data 1) */ - DELAY(5); - *regGP = gp | 0x01; /* CS and Clock low data 1 */ - DELAY(5); - *regGP = gp | 0x05; /* Clock high (data 1) */ - DELAY(5); - /* toggle in the address */ - for (i = 7; i >= 0; i--) { - *regGP = (gp | ((address >> i) & 1)); /* Clock low */ - DELAY(5); - *regGP = (gp | 0x04 | ((address >> i) & 1)); /* Clock high */ - DELAY(5); - } - /* read EEPROM data */ - for (i = 7; i >= 0; i--) { - *regGP = gp; /* Clock low */ - DELAY(5); - value |= ((*regGP & 0x10000) >> (16 - i)); - *regGP = gp | 0x04; /* Clock high */ - DELAY(5); - } - *regGP = gp; /* CS and Clock low */ - return (value); -} - -/******************************************************************************* - * - * Load the card receive buffers - * - * in: IDT device - * - * Date first: 11/01/2000 last: 05/25/2000 - */ - -void -nicstar_ld_rcv_buf(IDT * idt) -{ - struct mbuf *m1, *m2; - u_long stat_reg; - int card_small; - int card_large; - int s; - - s = splimp(); - - stat_reg = *(volatile u_long *)idt->stat_reg; - - card_small = (stat_reg & 0xff000000) >> 23; /* reg is number of - * pairs */ - card_large = (stat_reg & 0x00ff0000) >> 15; - - if (idt_sysctl_bufsmall > 510) - idt_sysctl_bufsmall = 510; - if (idt_sysctl_buflarge > 510) - idt_sysctl_buflarge = 510; - if (idt_sysctl_bufsmall < 10) - idt_sysctl_bufsmall = 10; - if (idt_sysctl_buflarge < 10) - idt_sysctl_buflarge = 10; - - while (card_small < idt_sysctl_bufsmall) { /* 05/25/2001 from fixed */ - MGETHDR(m1, M_DONTWAIT, MT_DATA); - if (m1 == NULL) - break; - MGETHDR(m2, M_DONTWAIT, MT_DATA); - if (m2 == NULL) { - m_free(m1); - break; - } - MH_ALIGN(m1, 96); /* word align & allow lots of - * prepending */ - MH_ALIGN(m2, 96); - if (nicstar_add_buf(idt, m1, m2, 0)) { - device_printf(idt->dev, - "Cannot add small buffers, size=%d.\n", - card_small); - m_free(m1); - m_free(m2); - break; - } - card_small += 2; - } - - while (card_large < idt_sysctl_buflarge) { /* 05/25/2001 from fixed */ - m1 = idt_mbufcl_get(); - if (m1 == NULL) - break; - m2 = idt_mbufcl_get(); - if (m2 == NULL) { - m_free(m1); - break; - } - if (nicstar_add_buf(idt, m1, m2, 1)) { - device_printf(idt->dev, - "Cannot add large buffers, size=%d.\n", - card_large); - m_free(m1); - m_free(m2); - break; - } - card_large += 2; - } - idt_sysctl_curlarge = card_large; - idt_sysctl_cursmall = card_small; - - splx(s); -} - -/******************************************************************************* - * - * Wait for command to finish - * - * in: IDT device - * out: zero = success - * - * Date first: 12/06/2000 last: 12/16/2000 - */ - -int -idt_status_wait(IDT * idt) -{ - int timeout; - - timeout = 33 * 100; /* allow 100 microseconds timeout */ - - while (*idt->reg_stat & 0x200) - if (--timeout == 0) { - device_printf(idt->dev, - "timeout waiting for device status.\n"); - idt->stats_cmderrors++; - return (1); - } - return (0); -} - -/******************************************************************************* - * - * Log status of system buffers - * - * in: IDT device - * - * Date first: 10/31/2000 last: 05/25/2001 - */ - -void -idt_status_bufs(IDT * idt) -{ - u_long stat_reg; - int card_small; - int card_large; - int s; - - s = splimp(); - - stat_reg = *(volatile u_long *)idt->stat_reg; - - card_small = (stat_reg & 0xff000000) >> 23; /* reg is number of - * pairs */ - card_large = (stat_reg & 0x00ff0000) >> 15; - - splx(s); - - device_printf(idt->dev, "BUFFER STATUS: small=%d/%d, large=%d/%d.\n", - card_small, idt_sysctl_bufsmall, - card_large, idt_sysctl_buflarge); -} - -/* Since this is called when the card timer wraps, we should only see - * this 16 times (LE155) or 10 (LE25) per hour. - * - ******************************************************************************* - * - * Add mbuf into "owned" list - * - * in: IDT device, mbuf - * out: zero = success - * - * Date first: 11/13/2000 last: 11/13/2000 - */ - -int -idt_mcheck_add(IDT * idt, struct mbuf * m) -{ - int hpos; - int s; - - hpos = (((int)m) >> 8) & 1023; - s = splimp(); - - m->m_next = idt->mcheck[hpos]; - idt->mcheck[hpos] = m; - - splx(s); - return (0); -} - -/****************************************************************************** - * - * Remove mbuf from "owned" list - * - * in: IDT device, mbuf - * out: zero = success - * - * Date first: 11/13/2000 last: 11/13/2000 - */ - -int -idt_mcheck_rem(IDT * idt, struct mbuf * m) -{ - struct mbuf *nbuf; - int hpos; - int s; - - hpos = (((int)m) >> 8) & 1023; - s = splimp(); - - nbuf = idt->mcheck[hpos]; - - if (nbuf == m) { - idt->mcheck[hpos] = m->m_next; - splx(s); - m->m_next = NULL; - return (0); - } - while (nbuf != NULL) { - if (nbuf->m_next != m) { - nbuf = nbuf->m_next; - continue; - } - nbuf->m_next = m->m_next; - splx(s); - m->m_next = NULL; - return (0); - } - - splx(s); - device_printf(idt->dev, "Card should not have this mbuf! %x\n", (int)m); - return (1); -} - -/****************************************************************************** - * - * Initialize mbuf "owned" list - * - * in: IDT device - * out: zero = success - * - * Date first: 11/13/2000 last: 05/26/2001 - */ - -int -idt_mcheck_init(IDT * idt) -{ - int size; - int x; - - size = round_page(sizeof(struct mbuf *) * 1024); - idt->mcheck = contigmalloc(size, M_DEVBUF, M_NOWAIT, - 0x100000, 0xffffffff, 0x2000, 0); - if (idt->mcheck == NULL) - return (1); - - for (x = 0; x < 1024; x++) - idt->mcheck[x] = NULL; - - return (0); -} - -/****************************************************************************** - * - * Allocate contiguous, fixed memory - * - * in: number of pages - * out: pointer, NULL = failure - * - * Date first: 11/29/2000 last: 11/29/2000 - */ - -vm_offset_t -idt_malloc_contig(int pages) -{ - vm_offset_t retval; - - retval = (vm_offset_t)contigmalloc(pages * PAGE_SIZE, - M_DEVBUF, M_NOWAIT, 0x100000, 0xffffffff, 0x2000, 0); -#ifdef UNDEF - printf("idt: vm_offset_t allocated %d pages at %x\n", pages, retval); -#endif - - return (retval); -} - -/******************************************************************************* - * - * Initialize all TX_QUEUE structures - * - * in: IDT device - * out: zero = succes - * - * Date first: 11/29/2000 last: 11/29/2000 - */ -static int -idt_queue_init(IDT * idt) -{ - TX_QUEUE *txqueue; - vm_offset_t scqbase; - int x; - - idt->cbr_size = IDT_MAX_CBRQUEUE * 16 * 64; - idt->cbr_base = idt_malloc_contig(idt->cbr_size / PAGE_SIZE); - scqbase = idt->cbr_base; - if (scqbase == 0) - return (1); - idt->cbr_freect = idt->cbr_size / (16 * 64); - - for (x = 0; x < idt->cbr_freect; x++) { - txqueue = &idt->cbr_txqb[x]; - txqueue->mget = NULL; - txqueue->mput = NULL; - txqueue->scd = IDT_SCD_START + x * 12; - txqueue->scq_base = (u_long *)scqbase; - txqueue->scq_next = txqueue->scq_base; - txqueue->scq_last = txqueue->scq_next; - txqueue->scq_len = 64; /* all CBR queues use 64 entries */ - txqueue->scq_cur = 0; - txqueue->rate = 0; - txqueue->vbr_m = 0; /* m & n set to zero for CBR */ - txqueue->vbr_n = 0; - idt->cbr_free[x] = txqueue; - scqbase += 64 * 16; - nicstar_sram_wr(idt, txqueue->scd, 4, - vtophys(txqueue->scq_base), 0, 0xffffffff, 0); - } - - txqueue = &idt->queue_vbr; /* VBR queue */ - txqueue->mget = NULL; - txqueue->mput = NULL; - txqueue->scd = 0x1e7f4; - txqueue->scq_base = (u_long *)(idt->fixbuf + 0x4000); - txqueue->scq_next = txqueue->scq_base; - txqueue->scq_last = txqueue->scq_next; - txqueue->scq_len = 512; /* all VBR queues use 512 entries */ - txqueue->scq_cur = 0; - txqueue->rate = 0; - txqueue->vbr_m = 1; - txqueue->vbr_n = 1; - nicstar_sram_wr(idt, txqueue->scd, 4, - vtophys(txqueue->scq_base), 0, 0xffffffff, 0); - - txqueue = &idt->queue_abr; /* ABR queue (not currently used) */ - txqueue->mget = NULL; - txqueue->mput = NULL; - txqueue->scd = 0x1e7e8; - txqueue->scq_base = (u_long *)(idt->fixbuf + 0x6000); - txqueue->scq_next = txqueue->scq_base; - txqueue->scq_last = txqueue->scq_next; - txqueue->scq_len = 512; - txqueue->scq_cur = 0; - txqueue->rate = 0; - txqueue->vbr_m = 1; - txqueue->vbr_n = 1; - nicstar_sram_wr(idt, txqueue->scd, 4, - vtophys(txqueue->scq_base), 0, 0xffffffff, 0); - - txqueue = &idt->queue_ubr; /* UBR queue */ - txqueue->mget = NULL; - txqueue->mput = NULL; - txqueue->scd = 0x1e7dc; - txqueue->scq_base = (u_long *)(idt->fixbuf + 0x8000); - txqueue->scq_next = txqueue->scq_base; - txqueue->scq_last = txqueue->scq_next; - txqueue->scq_len = 512; - txqueue->scq_cur = 0; - txqueue->rate = 0; - txqueue->vbr_m = 1; /* since the ABR queue is lowest priority, */ - txqueue->vbr_n = 1; /* these factors should never change */ - nicstar_sram_wr(idt, txqueue->scd, 4, - vtophys(txqueue->scq_base), 0, 0xffffffff, 0); - - return (0); -} - -/******************************************************************************* - * - * Get mbuf chain from TX_QUEUE - * - * in: CONNECTION - * out: mbuf, NULL = empty - * - * Date first: 12/03/2000 last: 12/03/2000 - */ -static struct mbuf * -idt_queue_get(TX_QUEUE * txqueue) -{ - struct mbuf *m1, *m2; - int s; - - if (txqueue == NULL) - return (NULL); - - s = splimp(); - - m1 = txqueue->mget; - if (m1 != NULL) { - m2 = m1->m_nextpkt; - txqueue->mget = m2; - if (m2 == NULL) /* is queue empty now? */ - txqueue->mput = NULL; - } - splx(s); - - return (m1); -} - -/******************************************************************************* - * - * Add mbuf chain to connection TX_QUEUE - * - * in: CONNECTION, mbuf chain - * out: zero = succes - * - * Date first: 12/03/2000 last: 06/01/2001 - */ -static int -idt_queue_put(CONNECTION * connection, struct mbuf * m) -{ - TX_QUEUE *txqueue; - int s; - - if (connection == NULL) { - m_freem(m); - return (1); - } - txqueue = connection->queue; - if (txqueue == NULL) { - m_freem(m); - return (1); - } - m->m_nextpkt = NULL; - m->m_pkthdr.rcvif = (void *) connection; - - s = splimp(); - - if (txqueue->mput != NULL) { - *txqueue->mput = m; - txqueue->mput = &m->m_nextpkt; - } else { /* queue is empty */ - txqueue->mget = m; - txqueue->mput = &m->m_nextpkt; - } - splx(s); - - return (0); -} - -/******************************************************************************* - * - * Flush all connection mbufs from TX_QUEUE - * - * in: CONNECTION - * out: zero = succes - * - * Date first: 12/03/2000 last: 12/03/2000 - */ -static int -idt_queue_flush(CONNECTION * connection) -{ - TX_QUEUE *txqueue; - struct mbuf **m0, *m1; - int s; - - if (connection == NULL) - return (1); - txqueue = connection->queue; - if (txqueue == NULL) - return (1); - - s = splimp(); - - m0 = &txqueue->mget; - m1 = *m0; - while (m1 != NULL) { - if (m1->m_pkthdr.rcvif == (void *) connection) { - *m0 = m1->m_nextpkt; - m_freem(m1); - m1 = *m0; - continue; - } - m0 = &m1->m_nextpkt; - m1 = *m0; - } - txqueue->mput = m0; - splx(s); - - return (0); -} - -/******************************************************************************* - * - * Calculate number of table positions for CBR connection - * - * in: IDT device, PCR (cells/second) - * out: table positions needed (minimum = 1) - * - * Date first: 11/29/2000 last: 06/12/2001 - */ -int -idt_slots_cbr(IDT * idt, int pcr) -{ - unsigned int bitrate; - unsigned int slots; - unsigned int rem; - - if (pcr == 171) { - if (idt_sysctl_logvcs) - device_printf(idt->dev, - "idt_slots_cbr: CBR channel=64000, 1 slot\n"); - return (1); - } - if (pcr < 171) { - if (idt_sysctl_logvcs) - device_printf(idt->dev, - "idt_slots_cbr: CBR pcr %d rounded up to 1 slot\n", pcr); - return (1); - } - bitrate = pcr * 47 * 8; - slots = bitrate / 64000; - rem = bitrate % 64000; - if (rem && idt_sysctl_logvcs) - device_printf(idt->dev, - "idt_slots_cbr: CBR cell rate rounded down to %d from %d\n", - ((slots * 64000) / 376), pcr); /* slots++; */ - - if (idt_sysctl_logvcs) - device_printf(idt->dev, - "idt_slots_cbr: CBR pcr=%d, slots=%d.\n", pcr, slots); - return (slots); -} - -/* The original algorithm rounded up or down by 32k, the goal being to - * map 64000 requests exactly. Unfortunately, this caused one particular - * SVC to be set one slot too low, causing mbuf cluster starvation. - * We can still handle the single 64k channel with a special case, and - * let all others fall where they may. - * - ******************************************************************************* - * - * Add TX QUEUE pointer to slots in CBR table - * - * in: IDT device, TX_QUEUE, number slots - * out: zero = success - * - * Date first: 11/29/2000 last: 06/11/2001 - */ -static int -idt_slots_add(IDT * idt, TX_QUEUE * queue, int slots) -{ - TX_QUEUE *curval; - int p_max; /* extra precision slots maximum */ - int p_spc; /* extra precision spacing value */ - int p_ptr; /* extra precision pointer */ - int qptr, qmax; - int qlast; - int scdval; - - if (slots < 1) - return (1); - - qmax = idt->txslots_max; - p_max = qmax << 8; - p_spc = p_max / slots; - p_ptr = p_spc >> 1; /* use half spacing for start point */ - qptr = p_ptr >> 8; - qlast = qptr; - - scdval = 0x20000000 | queue->scd; - - if (CBR_VERBOSE) { - printf("idt_slots_add: p_max = %d\n", p_max); - printf("idt_slots_add: p_spc = %d\n", p_spc); - printf("idt_slots_add: p_ptr = %d\n", p_ptr); - printf("idt_slots_add: qptr = %d\n", qptr); - } - while (slots) { - if (qptr >= qmax) /* handle wrap for empty slot choosing */ - qptr -= qmax; - curval = idt->cbr_slot[qptr]; - if (curval != NULL) { /* this slot has CBR, so try next */ - qptr++; /* next slot */ - continue; - } - if (CBR_VERBOSE) { - printf("idt_slots_add: using qptr %d (%d)\n", qptr, qptr - qlast); - qlast = qptr; - } - idt->cbr_slot[qptr] = queue; - nicstar_sram_wr(idt, qptr + IDT_TST_START, 1, scdval, 0, 0, 0); - slots--; - p_ptr += p_spc; - if (p_ptr >= p_max) /* main pointer wrap */ - p_ptr -= p_max; - qptr = p_ptr >> 8; - } - return (0); -} - -/* 06/11/2001: Extra precision pointer is used in order to handle cases where - * fractional slot spacing causes a large area of slots to be filled. - * This can cause further CBR circuits to get slots that have very - * poor spacing. - * - ******************************************************************************* - * - * Remove TX QUEUE pointer from slots in CBR table - * - * in: IDT device, TX_QUEUE - * out: number of CBR slots released - * - * Date first: 12/03/2000 last: 12/03/2000 - */ -static int -idt_slots_rem(IDT * idt, TX_QUEUE * queue) -{ - int qptr, qmax; - int slots; - - qmax = idt->txslots_max; - slots = 0; - - for (qptr = 0; qptr < qmax; qptr++) { - if (idt->cbr_slot[qptr] != queue) - continue; - idt->cbr_slot[qptr] = NULL; - nicstar_sram_wr(idt, qptr + IDT_TST_START, 1, 0x40000000, 0, 0, 0); - slots++; - } - return (slots); -} - -/******************************************************************************* - * - * Initialize slots in CBR table - * - * in: IDT device - * out: zero = success - * - * Date first: 11/29/2000 last: 11/29/2000 - */ -static int -idt_slots_init(IDT * idt) -{ - int start; /* table start pointer */ - int qptr; - - start = IDT_TST_START; - - /* first, fill up the TX CBR table with 'VBR' entries */ - - for (qptr = 0; qptr < idt->txslots_max; qptr++) { - idt->cbr_slot[qptr] = NULL; - nicstar_sram_wr(idt, qptr + start, 1, 0x40000000, 0, 0, 0); - } - - /* now write the jump back to the table start */ - - nicstar_sram_wr(idt, qptr + start, 1, 0x60000000 | start, 0, 0, 0); - - return (0); -} - -/******************************************************************************* - * - * Open output queue for connection - * - * in: IDT device, connection (class, traf_pcr, & traf_scr fields valid) - * out: zero = success - * - * Date first: 11/29/2000 last: 06/13/2001 - */ - -int -idt_connect_txopen(IDT * idt, CONNECTION * connection) -{ - TX_QUEUE *txqueue; - int cellrate; - int cbr_slots; - int s; - - cellrate = connection->traf_scr; /* 06/13/2001 use SCR instead - * of PCR */ - - if (connection->class == T_ATM_UBR) { /* UBR takes whatever is left - * over */ - connection->queue = &idt->queue_ubr; - if (idt_sysctl_logvcs) - printf("idt_connect_txopen: UBR connection for %d/%d\n", - connection->vpi, connection->vci); - return (0); - } - if (connection->class == T_ATM_ABR) { /* ABR treated as UBR-plus */ - connection->queue = &idt->queue_abr; - if (idt_sysctl_logvcs) - printf("idt_connect_txopen: UBR+ connection for %d/%d\n", - connection->vpi, connection->vci); - return (0); - } - if (connection->class == T_ATM_CBR) { - cbr_slots = idt_slots_cbr(idt, cellrate); - s = splimp(); - if (cbr_slots > (idt->txslots_max - idt->txslots_cur) || - idt->cbr_freect < 1) { - splx(s); - return (1); /* requested rate not available */ - } - idt->txslots_cur += cbr_slots; - idt->cellrate_tcur += cellrate; - idt->cbr_freect--; - txqueue = idt->cbr_free[idt->cbr_freect]; - txqueue->rate = cellrate; /* was connection->traf_pcr */ - - if (idt_slots_add(idt, txqueue, cbr_slots)) { - idt->txslots_cur -= cbr_slots; /* cannot add CBR slots */ - idt->cellrate_tcur -= cellrate; - idt->cbr_free[idt->cbr_freect] = txqueue; - idt->cbr_freect++; - splx(s); - return (1); - } - splx(s); - if (idt_sysctl_logvcs) - printf("idt_connect_txopen: CBR connection for %d/%d\n", - connection->vpi, connection->vci); - connection->queue = txqueue; - } - if (connection->class == T_ATM_VBR) { - txqueue = &idt->queue_vbr; - connection->queue = txqueue; - txqueue->rate += connection->traf_scr; /* from traf_pcr - * 12/17/2000 */ - if (idt_sysctl_logvcs) - printf("idt_connect_txopen: VBR connection for %d/%d\n", - connection->vpi, connection->vci); - } - idt_connect_newvbr(idt);/* recalculate VBR divisor values */ - - if (connection->class == T_ATM_CBR || - connection->class == T_ATM_VBR) - return (0); - - return (1); /* unknown class */ -} - -/******************************************************************************* - * - * Close connection output queue - * - * in: IDT device, connection (class, traf_pcr, & traf_scr fields valid) - * out: zero = success - * - * Date first: 12/03/2000 last: 12/03/2000 - */ -int -idt_connect_txclose(IDT * idt, CONNECTION * connection) -{ - TX_QUEUE *txqueue; - int cellrate; - int slots; - int s; - - cellrate = connection->traf_pcr; - txqueue = connection->queue; - if (idt_sysctl_logvcs) - printf("idt_connect_txclose: closing connection for %d/%d\n", - connection->vpi, connection->vci); - - idt_queue_flush(connection); /* flush all connection mbufs */ - - if (connection->class == T_ATM_UBR || /* UBR takes whatever is left - * over */ - connection->class == T_ATM_ABR) { /* ABR not supported, use UBR */ - connection->queue = NULL; - return (0); - } - if (connection->class == T_ATM_CBR) { - slots = idt_slots_rem(idt, txqueue); /* remove this queue - * from CBR slots */ - s = splimp(); - idt->txslots_cur -= slots; - idt->cellrate_tcur -= cellrate; - if (txqueue != NULL) { /* 06/12/2001 check for failure on - * open */ - idt->cbr_free[idt->cbr_freect] = txqueue; - idt->cbr_freect++; - } - splx(s); - connection->queue = NULL; - } - if (connection->class == T_ATM_VBR) { - txqueue = &idt->queue_vbr; - connection->queue = NULL; - txqueue->rate -= connection->traf_scr; /* from traf_pcr - * 12/17/2000 */ - } - idt_connect_newvbr(idt);/* recalculate VBR divisor values */ - - if (connection->class == T_ATM_CBR || - connection->class == T_ATM_VBR) - return (0); - - return (1); /* unknown class */ -} - -/******************************************************************************* - * - * Calculate new VBR divisor values - * - * in: IDT device - * - * Date first: 12/03/2000 last: 12/03/2000 - */ -static void -idt_connect_newvbr(IDT * idt) -{ - TX_QUEUE *txqueue; - int rate_newvbr; - int rate_noncbr; - int divisor; - - txqueue = &idt->queue_vbr; - - rate_newvbr = txqueue->rate; - rate_noncbr = idt->cellrate_tmax - idt->cellrate_tcur; - - if (rate_newvbr < 1) /* keep sane and prevent divide by zero */ - rate_newvbr = 1; - - if (rate_newvbr >= rate_noncbr) { - txqueue->vbr_m = 1; - txqueue->vbr_n = 1; - return; - } - divisor = rate_newvbr * 1000; /* size of lookup table */ - divisor += rate_newvbr >> 1; /* apply rounding to divide */ - divisor /= rate_noncbr; /* always < 1000, since newvbr < noncbr */ - - if (idt_sysctl_logvcs) - printf("idt_connect_newvbr: divisor=%d\n", divisor); - txqueue->vbr_m = vbr_div_m[divisor]; - txqueue->vbr_n = vbr_div_n[divisor]; - if (idt_sysctl_logvcs) - printf("idt_connect_newvbr: m=%d, n=%d\n", txqueue->vbr_m, txqueue->vbr_n); -} - -/* For VBR, we track the sum of all the VBR peak cellrates, and divide - * that from the "remaining" bandwidth, which is total minus current CBR. - * - * We will need to adjust the VBR divisor whenever we add a CBR or VBR. - * - * Because of the integer scalign (1000) preload, the cellrate for the - * VBR channel should not exceed 2 million (aprox 5 OC3s). This is - * protected by the check for rate_newvbr >= rate_noncbr. - * - ******************************************************************************* - * - * Initialize large buffers, indexes, and reference counts - * - * in: IDT device - * out: zero = success - * - * Date first: 11/01/2000 last: 05/25/2001 - */ - -int -idt_buffer_init(IDT * idt) -{ - - idt->raw_headm = NULL; /* nicstar_add_buf() will initialize */ - idt->raw_headp = 0; - - return (0); -} - -/******************************************************************************* - * - * Get large buffer from kernel pool - * - * out: mbuf, NULL = error - * - * Date first: 05/25/2001 last: 05/25/2001 - */ - -struct mbuf * -idt_mbufcl_get(void) -{ - struct mbuf *m; - - MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == NULL) - return (NULL); - - MCLGET(m, M_DONTWAIT); - if (m->m_flags & M_EXT) - return (m); - - m_freem(m); - return (NULL); -} - -/******************************************************************************* - * - * Initialize connection table - * - * in: IDT, number of VPI bits (0, 1, or 2) - * out: zero = success - * - * Date first: 10/29/2000 last: 12/10/2000 - */ - -int -idt_connect_init(IDT * idt, int vpibits) -{ - CONNECTION *connection; - int pages; - int vpi; - int vci; - - switch (vpibits) { - case 1: - idt->conn_maxvpi = 2; - idt->conn_maxvci = 2048; - break; - case 2: - idt->conn_maxvpi = 4; - idt->conn_maxvci = 1024; - break; - default: - idt->conn_maxvpi = 1; - idt->conn_maxvci = 4096; - } - - pages = (sizeof(CONNECTION) * MAX_CONNECTION) + PAGE_SIZE - 1; - pages /= PAGE_SIZE; - idt->connection = contigmalloc(pages * PAGE_SIZE, M_DEVBUF, M_NOWAIT, - 0x100000, 0xffffffff, 0x2000, 0); - if (idt->connection == NULL) - return (1); - - for (vpi = 0; vpi < idt->conn_maxvpi; vpi++) - for (vci = 0; vci < idt->conn_maxvci; vci++) { - connection = &idt->connection[vpi * idt->conn_maxvci + vci]; - connection->vccinf = NULL; /* may want to change to - * "unclaimed" */ - connection->status = 0; /* closed */ - connection->vpi = vpi; - connection->vci = vci; - connection->queue = NULL; /* no current TX queue */ - connection->recv = NULL; /* no current receive - * mbuf */ - connection->rlen = 0; - connection->maxpdu = 0; - connection->traf_pcr = 0; - connection->traf_scr = 0; - connection->aal = 0; - connection->class = 0; - connection->flg_mpeg2ts = 0; - connection->flg_clp = 0; - } - - return (0); -} - -/******************************************************************************* - * - * Look up a connection - * - * in: IDT, vpi, vci - * out: CONNECTION, NULL=invalid vpi/vci - * - * Date first: 10/29/2000 last: 10/29/2000 - */ - -CONNECTION * -idt_connect_find(IDT * idt, int vpi, int vci) -{ - if (vpi >= idt->conn_maxvpi) - return (NULL); - if (vci >= idt->conn_maxvci) - return (NULL); - - return (&idt->connection[vpi * idt->conn_maxvci + vci]); -} - -/****************************************************************************** - * - * MBUF SECTION - * - ****************************************************************************** - * - * Align data in mbuf (to 32-bit boundary) - * - * in: mbuf - * out: zero = success - * - * Date first: 11/08/2000 last: 11/15/2000 - */ - -int -idt_mbuf_align(struct mbuf * m, struct mbuf * prev) -{ - caddr_t buf_base; - int buf_size; - int offset; - int newlen; - int count; - - if (m == NULL) - return (1); - if (((int)m->m_data & 3) == 0) - return (0); - - if (m->m_flags & M_EXT) { /* external storage */ - buf_base = m->m_ext.ext_buf; - buf_size = m->m_ext.ext_size; - - /* - * we should really bail out at this point, since we cannot - * just shift the data in an external mbuf - */ - - } else { - if (m->m_flags & M_PKTHDR) { /* internal storage, packet - * header */ - buf_base = m->m_pktdat; - buf_size = MHLEN; - } else { - buf_base = m->m_dat; /* internal storage, no packet - * header */ - buf_size = MLEN; - } - } - offset = 4 - ((int)buf_base & 3); - offset &= 3; - buf_base += offset; /* new (aligned) buffer base */ - - if (m->m_len + offset > buf_size) /* not enough space to just - * move */ - if (prev != NULL) - if (idt_mbuf_append4(prev, m->m_data) == 0) { /* give word to prev - * mbuf */ - m->m_data += 4; - m->m_len -= 4; - } - if (m->m_len + offset > buf_size) /* still not enough space */ - if (m->m_next != NULL) { - newlen = buf_size - offset; /* maximum new length */ - newlen &= 0xfffffc; /* fix the length too... */ - count = buf_size - newlen; /* bytes we have to get - * rid of */ - if (idt_mbuf_prepend(m->m_next, m->m_data + newlen, count) == 0) - m->m_len = newlen; - } - if (m->m_len + offset > buf_size) /* we're stuck... */ - return (1); - - bcopy(m->m_data, buf_base, m->m_len); /* move data to aligned - * position */ - m->m_data = buf_base; - return (0); -} - -/******************************************************************************* - * - * Append 4 bytes to mbuf - * - * in: mbuf, data pointer - * out: zero = success - * - * Date first: 11/08/2000 last: 12/13/2000 - */ - -int -idt_mbuf_append4(struct mbuf * m, char *newdata) -{ - caddr_t buf_base; - int buf_size; - int align; - int space; - - if (m == NULL) - return (1); - - if (m->m_flags & M_EXT) /* external storage */ - return (1); /* 12/13/2000 we must not touch it */ - - if (m->m_flags & M_PKTHDR) { /* internal storage, packet header */ - buf_base = m->m_pktdat; - buf_size = MHLEN; - } else { - buf_base = m->m_dat; /* internal storage, no packet header */ - buf_size = MLEN; - } - - align = (4 - ((int)buf_base & 3)) & 3; - buf_base += align; - buf_size -= align; - buf_size &= 0xfffffc; - - space = buf_size - m->m_len; - if (space < 4) /* enough space to add 4 bytes? */ - return (1); - - space -= m->m_data - buf_base; /* get space at end */ - - if (space < 4) { - bcopy(m->m_data, buf_base, m->m_len); - m->m_data = buf_base; - } - bcopy(newdata, m->m_data + m->m_len, 4); - m->m_len += 4; - - return (0); -} - -/******************************************************************************* - * - * Get current base of data storage - * - * in: mbuf - * out: base - * - * Date first: 11/16/2000 last: 11/16/2000 - */ - -caddr_t -idt_mbuf_base(struct mbuf * m) -{ - if (m == NULL) - return (NULL); - - if (m->m_flags & M_EXT) /* external storage */ - return (m->m_ext.ext_buf); - - if (m->m_flags & M_PKTHDR) /* internal storage, packet header */ - return (m->m_pktdat); - - return (m->m_dat); /* internal storage, no packet header */ -} - -/******************************************************************************* - * - * Copy mbuf chain to new chain (aligned) - * - * in: mbuf - * out: new mbuf chain, NULL=error - * - * Date first: 11/19/2000 last: 05/25/2001 - */ - -struct mbuf * -idt_mbuf_copy(IDT * idt, struct mbuf * m) -{ - struct mbuf *nbuf, *dbuf, *sbuf; - u_char *sptr; - int slen; - int clen; - - nbuf = idt_mbufcl_get(); - if (nbuf == NULL) - return (NULL); - dbuf = nbuf; - dbuf->m_len = 0; - - for (sbuf = m; sbuf != NULL; sbuf = sbuf->m_next) { - sptr = sbuf->m_data; - slen = sbuf->m_len; - while (slen) { - clen = slen; - if (clen > NICSTAR_LRG_SIZE - dbuf->m_len) - clen = NICSTAR_LRG_SIZE - dbuf->m_len; - bcopy(sptr, dbuf->m_data + dbuf->m_len, clen); - sptr += clen; - slen -= clen; - dbuf->m_len += clen; - if (dbuf->m_len >= NICSTAR_LRG_SIZE) { - dbuf->m_next = idt_mbufcl_get(); - if (dbuf->m_next == NULL) { - m_freem(nbuf); - return (NULL); - } - dbuf = dbuf->m_next; - dbuf->m_len = 0; - } /* if need dest buf */ - } /* while(slen) */ - } /* for... source buf */ - m_freem(m); - return (nbuf); -} - -/******************************************************************************* - * - * Prepend data to mbuf (no alignment done) - * - * in: mbuf, data pointer, data length - * out: zero = success - * - * Date first: 11/15/2000 last: 12/13/2000 - */ - -int -idt_mbuf_prepend(struct mbuf * m, char *newdata, int newlen) -{ - caddr_t buf_base; - int buf_size; - int space; - - if (m == NULL) - return (1); - - if (m->m_flags & M_EXT) /* external storage */ - return (1); /* 12/13/2000 we must not touch it */ - - if (m->m_flags & M_PKTHDR) { /* internal storage, packet header */ - buf_base = m->m_pktdat; - buf_size = MHLEN; - } else { - buf_base = m->m_dat; /* internal storage, no packet header */ - buf_size = MLEN; - } - - space = m->m_data - buf_base; - - if (space >= newlen) { /* already space at head of mbuf */ - m->m_data -= newlen; - m->m_len += newlen; - bcopy(newdata, m->m_data, newlen); - return (0); - } - space = buf_size - m->m_len; /* can we get the space by shifting? */ - if (space < newlen) - return (1); - - bcopy(m->m_data, m->m_data + newlen, m->m_len); - bcopy(newdata, m->m_data, newlen); - m->m_len += newlen; - - return (0); -} - -/******************************************************************************* - * - * Get amount of data used in mbuf chain - * - * in: mbuf chain - * out: used space - * - * Date first: 11/10/2000 last: 11/10/2000 - */ - -int -idt_mbuf_used(struct mbuf * mfirst) -{ - struct mbuf *m1; - int mbuf_used; - - mbuf_used = 0; /* used mbuf space */ - - for (m1 = mfirst; m1 != NULL; m1 = m1->m_next) - mbuf_used += m1->m_len; - - return (mbuf_used); -} - -/******************************************************************************* - * - * Notes on transmit buffers: - * - * According to the IDT Nicstar User Manual (version 1.0 2/26/1997), we must - * follow these rules for the transmit buffers (page 66): - * - * 1. The buffer length must not be zero. - * 2. The buffer length must be a multiple of four bytes. - * 3. The sum of the buffer lengths must be a multiple of 48 bytes if - * it is a CS-PDU (eg AAL5). - * 4. All buffers for a CS-PDU must be contiguous and grouped (no other - * PDU buffers or even TSRs). - * 5. For AAL5 PDUs, the buffer lengths must include 8 bytes for the - * AAL5 length/control and CRC fields. - * 6. For AAL5 PDUs, the buffer length of the last buffer must be > 8 bytes. - * 7. For AAL5 PDUs, all buffers containing bytes for the last cell must - * have the END_CS_PDU bit set to 1. - * - * Also, from the IDT applications note ("FAQ") 77211_AN_97088.pdf file: - * Page 5, under "General Technical Questions" (copied EXACTLY): - * - * 5). Can the NicStar begin segmentation from a non-word aligned buffer? - * No, the transmit buffer must point to a word aligned buffer. - * - * Since the buffers MUST be word aligned and MUST be word lengths, we have - * two potential problems with M_EXT mbufs: - * - * 1. If the M_EXT mbuf has a non word aligned address, we have to copy - * the whole thing to a fresh buffer. Unless - the previous mbuf is - * not M_EXT, and it is short by exactly the same amount. Unlikely. - * - * 2. If the M_EXT mbuf has a non word length, we have to push those bytes - * to the next mbuf. If the next mbuf is also M_EXT, we are stuck. - * Unless - the extra bytes from both mbufs are exactly 4 bytes. Then - * we can MGET an empty buf to splice in between. - * - * Also, these rules mean that if any buffer is not word-length, all of the - * following buffers will need to be copied/shifted, unless one or more have - * lengths off by the right amount to fix the earlier buffer. - * - ******************************************************************************* - * - * Put mbuf chain on transmit queue - * - * in: IDT device, mbuf chain, vpi, vci, flags (2 MPEG2 TS == 8 AAL5 cells) - * out: (nothing) - * - * Date first: 11/08/2000 last: 05/30/2000 - */ - -void -idt_transmit(IDT * idt, struct mbuf * mfirst, int vpi, int vci, int flags) -{ - CONNECTION *connection; - struct mbuf *m1, *m0, *malign, *msend; - int tot_size, tot_scq, x; - int this_len; - int padding; - - connection = idt_connect_find(idt, vpi, vci); - if (connection == NULL) { /* this VPI/VCI not open */ - idt_transmit_drop(idt, mfirst); - return; - } - if (connection->queue == NULL) { - idt_transmit_drop(idt, mfirst); - connection->vccinf->vc_oerrors++; - return; - } - if (flags) - connection->flg_mpeg2ts = 1; - else - connection->flg_mpeg2ts = 0; - - /* - * New strategy: assume that all the buffers are aligned and word - * length. Drop out and handle exceptions below. - */ - - tot_size = 0; - tot_scq = 1; - malign = NULL; - - for (m1 = mfirst; m1 != NULL; m1 = m1->m_next) { - this_len = m1->m_len; - tot_size += this_len; - tot_scq++; - if (malign != NULL) - continue; - if ((int)(m1->m_data) & 3) { /* bad alignment */ - malign = m1; - continue; - } - if ((this_len & 3) == 0) /* mbuf length is ok */ - continue; - if (m1->m_next != NULL) { /* bad length (in middle) */ - malign = m1; - continue; - } - padding = 4 - (this_len & 3); - tot_size += padding; - m1->m_len += padding; - break; /* last mbuf, so avoid the loop test */ - } - if (malign == NULL) { /* perfect packet, no copy needed */ - mfirst->m_pkthdr.len = tot_size; - if (connection->flg_mpeg2ts) - tot_scq += tot_size / 376; /* more entries needed - * for split */ - mfirst->m_pkthdr.csum_data = tot_scq; - - if (idt_queue_put(connection, mfirst)) /* put packet on TX - * queue */ - device_printf(idt->dev, "Cannot queue packet for %d/%d.\n", vpi, vci); - if (connection->queue->mget == mfirst) /* was the queue empty? */ - idt_transmit_top(idt, connection->queue); /* IFF empty, prime it - * now */ - return; - } - /* - * Bad alignment or length, so fall through to old code... The first - * alignment problem is at 'malign' - */ - if (idt_sysctl_logvcs) - device_printf(idt->dev, "Bad TX buf alignment, len=%d.\n", tot_size); - - if (idt_mbuf_align(mfirst, NULL)) { - printf("idt_transmit: cannot align first mbuf.\n"); - idt_transmit_drop(idt, mfirst); - connection->vccinf->vc_oerrors++; - return; - } - /* find first mbuf with bad alignment (if any) */ - - m0 = mfirst; - for (m1 = mfirst->m_next; m1 != NULL; m0 = m1, m1 = m1->m_next) { - if (m1->m_len & 3) - break; - if ((int)(m1->m_data) & 3) - break; - } - if (m1 != NULL) { - m1 = idt_mbuf_copy(idt, m1); /* copy the rest into new - * mbufs */ - m0->m_next = m1; - if (m1 == NULL) { - printf("idt_transmit: could not copy buffers.\n"); - idt_transmit_drop(idt, mfirst); - connection->vccinf->vc_oerrors++; - return; /* FIX THIS - this path has been taken */ - } - } - msend = mfirst; - - /* The mbuf chain is aligned, now we need to pad to word length */ - - tot_size = idt_mbuf_used(msend); /* forget the pkthdr length... */ - msend->m_pkthdr.len = tot_size; - - padding = (4 - (tot_size & 3)) & 3; - if (padding) { - for (m1 = msend; m1->m_next != NULL; m1 = m1->m_next); - m1->m_len += padding; - } - x = 1; /* now calculate the SCQ entries needed */ - for (m1 = msend; m1 != NULL; m1 = m1->m_next) - x++; - if (connection->flg_mpeg2ts) - x += tot_size / 376; /* more entries needed for split */ - msend->m_pkthdr.csum_data = x; - - /* now we have an mbuf chain, from *msend to *m1 ready to go */ - - if (idt_queue_put(connection, msend)) /* put packet on TX queue */ - device_printf(idt->dev, "Cannot queue packet for %d/%d.\n", vpi, vci); - - if (connection->queue->mget == msend) /* was the queue empty? */ - idt_transmit_top(idt, connection->queue); /* IFF empty, prime it - * now */ -} - -/* Notes on mbuf usage in the transmit queue: - * - * m_pkthdr.rcvif Connection pointer (set by idt_queue_put) - * m_pkthdr.len Length of PDU - * m_pkthdr.header TX queue pointer (06/01/2001) - * m_pkthdr.csum_flags Unused, keep zero - * m_pkthdr.csum_data Number of SCQ entries needed or used - * - ******************************************************************************* - * - * Drop transmit mbuf chain and update counters - * - * in: IDT device, mbuf chain - * out: (nothing) - * - * Date first: 11/08/2000 last: 11/08/2000 - */ - -void -idt_transmit_drop(IDT * idt, struct mbuf * mfirst) -{ - struct mbuf *next; - int mesglen; - - mesglen = 0; - while (mfirst != NULL) { - mesglen += mfirst->m_len; - next = m_free(mfirst); - mfirst = next; - } - device_printf(idt->dev, "dropping transmit packet, size=%d\n", mesglen); - idt->stats_oerrors++; /* 12/15/2000 */ -} - -/******************************************************************************* - * - * Put mbuf chain on transmit queue - * - * in: IDT device, TX_QUEUE - * out: (nothing) - * - * Date first: 12/03/2000 last: 06/01/2001 - */ - -void -idt_transmit_top(IDT * idt, TX_QUEUE * txqueue) -{ - CONNECTION *connection; - struct mbuf *top, *m; - static int padding[13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; - int scq_space; - int val, val1, val3, val4; - int count, mlen, tlen, pad; - char *mptr; - int pdulen; - int vci, vpi; - int s; - - if (txqueue == NULL) /* 12/12/2000 */ - return; - if (txqueue->mget == NULL) /* check for empty queue */ - return; - - s = splimp(); - - scq_space = txqueue->scq_len - txqueue->scq_cur; - - /* Now we can add the queue entries for the PDUs */ - - count = 0; - - for (;;) { - top = txqueue->mget; /* next available mbuf */ - if (top == NULL) - break; - - if (top->m_pkthdr.csum_data + 4 > scq_space) - break; /* not enough space for this PDU */ - - top = idt_queue_get(txqueue); - if (top == NULL) - break; - connection = (CONNECTION *) top->m_pkthdr.rcvif; - vpi = connection->vpi; - vci = connection->vci; - top->m_pkthdr.header = (void *)connection->queue; - - top->m_pkthdr.csum_data = 0; /* track actual number of SCQ - * entries used */ - - tlen = top->m_pkthdr.len; - switch (connection->aal) { - case ATM_AAL0: - val = 0; - break; - case ATM_AAL3_4: - val = 0x04000000; - break; - case ATM_AAL5: - val = 0x08000000; - break; - default: - device_printf(idt->dev, "bad AAL for %d/%d\n", vpi, vci); - m_freem(top); - connection->vccinf->vc_oerrors++; - continue; - } - val |= txqueue->vbr_m << 23; - val |= txqueue->vbr_n << 16; - val4 = (vpi << 20) | (vci << 4); - if (connection->flg_clp) - val4 |= 1; /* set CLP flag */ - - /* - * Now we are ready to start mapping the mbuf(s) to transmit - * buffer descriptors. If the MPEG2TS flag is set, we want - * to create AAL5 PDUs of exactly 384 data bytes each. - */ - - pdulen = top->m_pkthdr.len; /* default case: don't split - * PDU */ - pad = 0; - if (connection->flg_mpeg2ts) { - if ((pdulen % 376) == 0) { /* correct multiple */ - pdulen = 376; /* cut off every pdu at 374 - * data bytes */ - pad = 8; - } else - device_printf(idt->dev, "Bad MPEG2 PDU buffer (%d bytes).\n", pdulen); - } - val3 = pdulen; /* actual (unpadded) PDU length */ - - pdulen += (4 - (pdulen & 3)) & 3; - - if (pad == 0) { /* normal padding (PDU not split) */ - pad = pdulen; - if (connection->aal == ATM_AAL5) - pad += 8; - pad = 48 - (pad % 48); - if (pad == 48) - pad = 0; - if (connection->aal == ATM_AAL5) - pad += 8; /* pad of up to 52 is - * possible/neccessary */ - } - tlen = 0; - for (m = top; m != NULL; m = m->m_next) { - while ((mlen = m->m_len)) { - if (mlen + tlen > pdulen) - mlen = pdulen - tlen; /* how much of this - * buffer can we use? */ - mptr = m->m_data; - tlen += mlen; /* length of this PDU */ - m->m_len -= mlen; /* bytes remaining in - * mbuf */ - m->m_data += mlen; /* new data pointer */ - - val1 = val; - if (tlen > pdulen + pad - 48) /* is this buffer in the - * last cell? */ - val1 |= 0x40000000; /* last buffer in PDU */ - - if (tlen == pdulen) { /* end of PDU, so figure - * padding needed */ - idt->stats_opdus++; /* 12/15/2000 */ - idt->stats_obytes += pdulen; /* 12/15/2000 */ - connection->vccinf->vc_opdus++; - connection->vccinf->vc_obytes += pdulen; - tlen = 0; - if (pad <= 8) - mlen += pad; /* just "add" padding to - * this buffer */ - } - *txqueue->scq_next++ = val1 | mlen; - *txqueue->scq_next++ = vtophys(mptr); - *txqueue->scq_next++ = val3; - *txqueue->scq_next++ = val4; - if (txqueue->scq_next - txqueue->scq_base >= txqueue->scq_len * 4) - txqueue->scq_next = txqueue->scq_base; - scq_space--; - top->m_pkthdr.csum_data++; /* 12/22/2000 */ - - /* - * if we need more than 8 bytes of padding, - * use the zero-filled buffer defined above. - */ - if (tlen == 0 && pad > 8) { /* end of PDU, do we - * need padding? */ - val1 |= 0x40000000; /* last buffer in PDU */ - *txqueue->scq_next++ = val1 | pad; - *txqueue->scq_next++ = vtophys(padding); - *txqueue->scq_next++ = val3; - *txqueue->scq_next++ = val4; - if (txqueue->scq_next - txqueue->scq_base >= txqueue->scq_len * 4) - txqueue->scq_next = txqueue->scq_base; - scq_space--; - top->m_pkthdr.csum_data++; /* 12/22/2000 */ - } - } - } - - /* - * Now that we have set up the descriptors, add the entry - * for Transmit Status Request so we know when the PDU(s) - * are done. - */ - - *txqueue->scq_next++ = 0xa0000000; /* TSR with interrupt */ - *txqueue->scq_next++ = (u_long)top; - *txqueue->scq_next++ = 0; - *txqueue->scq_next++ = 0; - - if (txqueue->scq_next - txqueue->scq_base >= txqueue->scq_len * 4) - txqueue->scq_next = txqueue->scq_base; - scq_space--; - top->m_pkthdr.csum_data++; /* 12/22/2000 */ - count++; - - txqueue->scq_cur += top->m_pkthdr.csum_data; - } - - /* - * 05/31/2001: Optimization: Since writing to SRAM is very - * expensive, we will only do this when the pointer is stale (half - * of the queue). If the queue is less than 1/4 full, then write the - * pointer anyway. - */ - - if (idt_sysctl_qptrhold) { - scq_space = txqueue->scq_next - txqueue->scq_last; /* number pending */ - scq_space /= 4; - if (scq_space < 0) - scq_space += txqueue->scq_len; - if (scq_space * 2 < txqueue->scq_len && /* less than half - * pending */ - txqueue->scq_cur > txqueue->scq_len / 4) /* and queue is active */ - count = 0; - } - if (count) { /* we need to update the queue pointer */ - nicstar_sram_wr(idt, txqueue->scd, 1, vtophys(txqueue->scq_next), 0, 0, 0); - txqueue->scq_last = txqueue->scq_next; - } - splx(s); - - return; -} - -/* Once a packet has been put in the Segmentation Channel Queue, it will - * be sent, and then the mbuf will harvested by idt_intr_tsq(). While it - * is in the SCQ, m_pkthdr.header is the pointer to the TX queue. This is - * important because if the connection is closed while there are still - * mbufs in the SCQ, idt_intr_tsq() still needs to update the TX queue. - * - ****************************************************************************** - * - * Handle entries in Transmit Status Queue (end of PDU interrupt or TSQ full) - * - * in: IDT device - * - * Date first: 12/04/2000 last: 06/10/2001 - */ -static void -idt_intr_tsq(IDT * idt) -{ - CONNECTION *connection; - TX_QUEUE *txqueue; - u_long *tsq_ptr; - u_long val; - struct mbuf *m; - int count, s; - - s = splimp(); - - tsq_ptr = idt->tsq_head; - - count = 0; - while ((tsq_ptr[1] & 0x80000000) == 0) { - m = (struct mbuf *) tsq_ptr[0]; - if (m != NULL) {/* first test for timer rollover entry */ - if (((int)m & 0x000000ff)) /* now do sanity check - * on the mbuf ptr */ - device_printf(idt->dev, - "DANGER! bad mbuf (%x), stamp=%x\n", - (int)m, (int)tsq_ptr[1]); - else { - connection = (CONNECTION *) m->m_pkthdr.rcvif; - txqueue = (TX_QUEUE *) m->m_pkthdr.header; - txqueue->scq_cur -= m->m_pkthdr.csum_data; - if (txqueue->scq_cur < 0 || txqueue->scq_cur > txqueue->scq_len) - device_printf(idt->dev, "DANGER! scq_cur is %d\n", txqueue->scq_len); - m->m_pkthdr.header = NULL; - m_freem(m); - idt_transmit_top(idt, txqueue); /* move more into queue */ - } - } - tsq_ptr[0] = 0; - tsq_ptr[1] = 0x80000000; /* reset TSQ entry */ - tsq_ptr += 2; - if (tsq_ptr >= idt->tsq_base + idt->tsq_size * 2) - tsq_ptr = idt->tsq_base; - count++; - } - idt->tsq_head = tsq_ptr; - - if (count) { - val = (int)tsq_ptr - (int)idt->tsq_base; - val -= 8; /* always stay one behind */ - val &= 0x001ff8; - *idt->reg_tsqh = val; - } - splx(s); -} - -/* There is a problem with the pointer rollover where the SAR will think the - * TSQ buffer is full (forever?) unless we hold the head pointer back. - * This is not mentioned in the 77211 docs, but is a resolved issue in - * revision D of the 77252 chips (see 77252 errata). - * - * If a connection is closed while there are still mbufs in the TX queue, - * the connection TX queue pointer will be NULL. That is why we have a - * special copy of the pointer in m_pkthdr.header. Also, idt_transmit_top() - * will allow the TX queue for that connection to empty properly. - * - * It is possible for a TSQ entry to be 0x00ffffff/0x00ffffff, which is - * obviously not an mbuf and not a timer rollover entry. We now have an - * mbuf sanity check for this. - * - ****************************************************************************** - * - * nicstar_itrx ( card ) - * - * service error in transmitting PDU interrupt. - * -*/ -static void -nicstar_itrx(nicstar_reg_t * idt) -{ - /* trace mbuf and release */ -} - -/****************************************************************************** - * - * Raw cell receive interrupt - * - * service raw cell reception interrupt. - * - */ - -static void -nicstar_rawc(nicstar_reg_t * idt) -{ - u_long ptr_tail; - struct mbuf *qmbuf; - u_long *qptr; - u_long next_mbuf; - u_long next_phys; - - if (idt->raw_headm == NULL || - idt->raw_headp == 0) { - device_printf(idt->dev, - "RAW cell received, buffers not ready (%x/%x).\n", - (int)idt->raw_headm, (int)idt->raw_headp); - return; - } - ptr_tail = *(volatile u_long *)(idt->virt_baseaddr + REGRAWT); - if ((ptr_tail & 0xfffff800) == idt->raw_headp) - return; /* still in the same large buffer */ - - if ((ptr_tail & 0x7ff) < 64) /* wait until something in new buffer */ - return; - - qmbuf = idt->raw_headm; - qptr = (u_long *)qmbuf->m_data; - - next_mbuf = qptr[31 * 16 + 1]; /* next handle (virtual) */ - next_phys = qptr[31 * 16 + 0]; /* next physical address */ - - /* if we want to do anything with the raw data, this is the place */ - - idt_mcheck_rem(idt, qmbuf); - m_free(qmbuf); - - idt->raw_headm = (struct mbuf *) next_mbuf; - idt->raw_headp = next_phys; -} - -/***************************************************************************** - * - * Handle AAL5 PDU length - * - * in: IDT device, first mbuf in chain, last mbuf - * out: zero = success, nz = failure (mbuf chain freed) - * - * Date first: 11/18/2000 last: 12/14/2000 - */ - -int -idt_receive_aal5(IDT * idt, struct mbuf * mfirst, struct mbuf * mdata) -{ - struct mbuf *m2; - unsigned char *aal5len; - int plen; - int diff; - - aal5len = mdata->m_data + mdata->m_len - 6; /* aal5 length = 16 bits */ - plen = aal5len[0] * 256 + aal5len[1]; - diff = mfirst->m_pkthdr.len - plen; /* number of bytes to trim */ - - if (diff == 0) - return (0); - - if (diff < 0) { - device_printf(idt->dev, - "AAL5 PDU length (%d) greater than cells (%d), discarding\n", - plen, mfirst->m_pkthdr.len); - m_freem(mfirst); - return (1); - } - while (mdata->m_len < diff) { /* last mbuf not big enough */ - diff -= mdata->m_len; - m2 = mdata; - m_free(mdata); - if (mdata == mfirst) { /* we just tossed the whole PDU */ - device_printf(idt->dev, "AAL5 PDU length failed, discarding.\n"); - return (1); /* the packetheadr length was bad! */ - } - for (mdata = mfirst; mdata->m_next != m2; mdata = mdata->m_next); - mdata->m_next = NULL; /* remove old link to free'd mbuf */ - } - mdata->m_len -= diff; /* trim last mbuf */ - mfirst->m_pkthdr.len = plen; - - return (0); -} - -/* 12/14/2000: Removed "pruning" log message. - * - ***************************************************************************** - * - * nicstar_recv ( card ) - * - * rebuilds PDUs from entries in the Recieve Status Queue. - * - */ -struct rsq_entry { - u_long vpivci; - struct mbuf *mdata; - u_long crc; - u_long flags; -}; - -static void -nicstar_recv(nicstar_reg_t * idt) -{ - CONNECTION *connection; - volatile u_long *regh = (volatile u_long *)(idt->virt_baseaddr + REGRSQH); - struct rsq_entry *rsq; - struct mbuf *mdata, *mptr; - u_long flags; - u_long crc; - int vpi; - int vci; - int clen; - int x, s; - - s = splimp(); - - rsq = (struct rsq_entry *) (idt->fixbuf + 0x2000 + (idt->rsqh & 0x1ffc)); - - if ((rsq->flags & 0x80000000) == 0) { - splx(s); - return; - } - while (rsq->flags & 0x80000000) { - vpi = rsq->vpivci >> 16; /* first, grab the RSQ data */ - vci = rsq->vpivci & 0xffff; - mdata = rsq->mdata; - crc = rsq->crc; - flags = rsq->flags; - clen = (flags & 0x1ff) * 48; - - rsq->vpivci = 0;/* now recycle the RSQ entry */ - rsq->mdata = NULL; - rsq->crc = 0; - rsq->flags = 0; /* turn off valid bit */ - rsq++; - if (rsq == (struct rsq_entry *) (idt->fixbuf + 0x4000)) - rsq = (struct rsq_entry *) (idt->fixbuf + 0x2000); - - idt_mcheck_rem(idt, mdata); - - connection = idt_connect_find(idt, vpi, vci); - if (connection == NULL) { /* we don't want this PDU */ - printf("nicstar_recv: No connection %d/%d - discarding packet.\n", - vpi, vci); - m_free(mdata); /* throw mbuf away */ - continue; - } - mdata->m_len = clen; - - mptr = connection->recv; - if (mptr == NULL) { - if (mdata->m_flags & M_PKTHDR) - connection->recv = mdata; - else { - idt->stats_ierrors++; /* 12/15/2000 */ - connection->vccinf->vc_ierrors++; - m_free(mdata); - continue; - } - } else { - x = 0; - while (mptr->m_next != NULL) { /* find last mbuf in - * chain */ - mptr = mptr->m_next; - x++; - if (x > 25) - break; - } - if (x > 25) { - mptr = connection->recv; - printf("nicstar_recv: invalid mbuf chain - probable corruption!\n"); - m_free(mdata); - idt->stats_ierrors++; /* 12/15/2000 */ - connection->vccinf->vc_ierrors++; - connection->recv = NULL; - connection->rlen = 0; - continue; - } - mptr->m_next = mdata; - } - connection->rlen += clen; - - if (flags & 0x2000) { /* end of PDU */ - mptr = connection->recv; /* one or more mbufs - * will be here */ - clen = connection->rlen; /* length based on cell - * count */ - connection->recv = NULL; - connection->rlen = 0; - - mptr->m_pkthdr.len = clen; - mptr->m_pkthdr.rcvif = NULL; - mptr->m_nextpkt = NULL; - - if (mptr->m_pkthdr.csum_flags) { - device_printf(idt->dev, - "received pkthdr.csum_flags=%x\n", - mptr->m_pkthdr.csum_flags); - mptr->m_pkthdr.csum_flags = 0; - } - if (flags & 0x200 && /* bad CRC */ - idt->flg_igcrc == 0) { - printf("nicstar_recv: Bad CRC - discarding PDU: %d/%d\n", vpi, vci); - idt->stats_ierrors++; /* 12/15/2000 */ - connection->vccinf->vc_ierrors++; - m_freem(mptr); - continue; - } - if (connection->aal == ATM_AAL5) { - if (idt_receive_aal5(idt, mptr, mdata)) /* adjust for AAL5 - * length */ - continue; - } - idt->stats_ipdus++; /* 12/15/2000 */ - idt->stats_ibytes += mptr->m_pkthdr.len; /* 12/15/2000 */ - connection->vccinf->vc_ipdus++; - connection->vccinf->vc_ibytes += mptr->m_pkthdr.len; - idt_receive(idt, mptr, vpi, vci); - } else if (connection->rlen > connection->maxpdu) { /* this packet is insane */ - printf("nicstar_recv: Bad packet, len=%d - discarding.\n", - connection->rlen); - connection->recv = NULL; - connection->rlen = 0; - idt->stats_ierrors++; /* 12/15/2000 */ - connection->vccinf->vc_ierrors++; - m_freem(mptr); - } /* end of PDU */ - } - - idt->rsqh = vtophys((u_long)rsq) & 0x1ffc; - *regh = (idt->rsqh - sizeof(struct rsq_entry)) & 0x1ff0; - - splx(s); -} - -/****************************************************************************** - * - * Physical Interrupt handler - * - * service phyical interrupt. - * - */ - -static void -nicstar_phys(nicstar_reg_t * idt) -{ - u_long t; - - if (idt->flg_le25) { - nicstar_util_rd(idt, 0x01, &t); /* get interrupt cause */ - if (t & 0x01) { - nicstar_util_wr(idt, 1, 0x02, 0x10); /* reset rx fifo */ - device_printf(idt->dev, "PHY cleared.\n"); - } - } else - device_printf(idt->dev, "Physical interrupt.\n"); -} - -/****************************************************************************** - * - * Status register values - */ - -#define STAT_REG_RSQAF 0x0002 /* receive status queue almost full */ -#define STAT_REG_LBMT 0x0004 /* large buffer queue empty */ -#define STAT_REG_SBMT 0x0008 /* small buffer queue empty */ -#define STAT_REG_RAWC 0x0010 /* raw cell interrupt */ -#define STAT_REG_EPDU 0x0020 /* end of PDU interrupt */ -#define STAT_REG_PHY 0x0400 /* physical interrupt */ -#define STAT_REG_TIME 0x0800 /* timer overflow interrupt */ -#define STAT_REG_TSQAF 0x1000 /* transmit status queue almost full */ -#define STAT_REG_TXIN 0x4000 /* TX PDU incomplete */ -#define STAT_REG_TXOK 0x8000 /* TX status indicator */ - -/****************************************************************************** - * - * Interrupt handler - * - * service card interrupt. - * - * nicstar_intr ( card ) - */ - -void -nicstar_intr(void *arg) -{ - IDT *idt; - volatile u_long stat_val, config_val; - int int_flags; - volatile int i; - int s; - - idt = (IDT *) arg; - - i = 0; - - s = splnet(); - - config_val = *idt->reg_cfg; - stat_val = *idt->reg_stat; - - int_flags = - STAT_REG_TSQAF | /* transmit status queue almost full */ - STAT_REG_RSQAF | /* receive status queue almost full */ - STAT_REG_RAWC | /* raw cell interrupt */ - STAT_REG_EPDU | /* end of PDU interrupt */ - STAT_REG_TIME | /* timer overflow interrupt */ - STAT_REG_TXIN | /* TX PDU incomplete */ - STAT_REG_TXOK; /* TX status indicator */ - - if (idt->flg_le25) - int_flags |= STAT_REG_PHY; /* include flag for physical - * interrupt */ - - if (stat_val & (STAT_REG_LBMT | STAT_REG_SBMT)) { /* buffer queue(s) empty */ - if (stat_val & STAT_REG_SBMT) - device_printf(idt->dev, "small free buffer queue empty.\n"); - if (stat_val & STAT_REG_LBMT) - device_printf(idt->dev, "large free buffer queue empty.\n"); - nicstar_ld_rcv_buf(idt); - - if (*idt->reg_stat & STAT_REG_LBMT) { /* still empty, so - * disable IRQ */ - config_val &= ~0x01000000; - *idt->reg_cfg = config_val; - } - } - /* loop until no more interrupts to service */ - - while (stat_val & int_flags) { - i++; - if (i < 0 || i > 100) - break; - - *idt->reg_stat = stat_val & int_flags; /* clear status bits */ - - if (stat_val & STAT_REG_EPDU) { /* receive PDU */ - nicstar_recv(idt); - nicstar_ld_rcv_buf(idt); /* replace buffers, - * moved here 11/14/2000 */ - } - if (stat_val & STAT_REG_RAWC) { /* raw cell */ - nicstar_rawc(idt); - } - if (stat_val & STAT_REG_TXOK) { /* transmit complete */ - idt_intr_tsq(idt); - } - if (stat_val & STAT_REG_TXIN) { /* bad transmit */ - nicstar_itrx(idt); - device_printf(idt->dev, "Bad transmit.\n"); - } - if (stat_val & STAT_REG_TIME) { /* timer wrap */ - idt->timer_wrap++; - idt_intr_tsq(idt); /* check the TSQ */ - nicstar_recv(idt); /* check the receive queue */ - if (idt_sysctl_logbufs) - idt_status_bufs(idt); /* show the buffer - * status */ - } - if (stat_val & STAT_REG_PHY) { /* physical interrupt */ - nicstar_phys(idt); - *idt->reg_stat = STAT_REG_PHY; /* clear the int flag */ - } - if (stat_val & STAT_REG_RSQAF) { /* RSQ almost full */ - nicstar_recv(idt); - device_printf(idt->dev, "warning, RSQ almost full.\n"); - if (*idt->reg_stat & STAT_REG_RSQAF) { /* RSQ full */ - printf("RSQ is full, disabling interrupt.\n"); - config_val &= 0x00000800; - *idt->reg_cfg = config_val; - } - } - if (stat_val & STAT_REG_TSQAF) { /* TSQ almost full */ - idt_intr_tsq(idt); - device_printf(idt->dev, "warning, TSQ almost full.\n"); - if (*idt->reg_stat & STAT_REG_TSQAF) { - printf("TSQ is full, disabling interrupt.\n"); - config_val &= ~0x00000002; - *idt->reg_cfg = config_val; - } - } - stat_val = *idt->reg_stat; - } - - splx(s); - if (i < 1 || i > 50) - device_printf(idt->dev, "i=%3d, status=%08x\n", i, (int)stat_val); -} Property changes on: head/sys/dev/idt/idt.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/idt/idt_pci.c =================================================================== --- head/sys/dev/idt/idt_pci.c (revision 179307) +++ head/sys/dev/idt/idt_pci.c (nonexistent) @@ -1,323 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Matriplex, inc. - * 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. - * - ****************************************************************************** - * - * This driver is derived from the Nicstar driver by Mark Tinguely, and - * some of the original driver still exists here. Those portions are... - * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely - * All rights reserved. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#define IDT_VID 0x111d -#define IDT_NICSTAR_DID 0x0001 - -struct pci_type { - u_int16_t pci_vid; - u_int16_t pci_did; - char * pci_name; -} pci_devs[] = { - { IDT_VID, IDT_NICSTAR_DID, "IDT IDT77201/211 NICStAR ATM Adapter" }, - { 0, 0, NULL } -}; - -uma_zone_t idt_nif_zone; -uma_zone_t idt_vcc_zone; - -static int idt_probe (device_t); -static int idt_attach (device_t); -static int idt_detach (device_t); -static int idt_shutdown (device_t); -static void idt_free (device_t); -static int idt_modevent (module_t, int, void *); - -static int -idt_probe(device_t dev) -{ - struct pci_type *t = pci_devs; - - while(t->pci_name != NULL) { - if ((pci_get_vendor(dev) == t->pci_vid) && - (pci_get_device(dev) == t->pci_did)) { - device_set_desc(dev, t->pci_name); - return(BUS_PROBE_DEFAULT); - } - t++; - } - - return(ENXIO); -} - -/****************************************************************************** - * - * Attach device - * - * Date first: 11/14/2000 last: 06/10/2001 - */ - -static int -idt_attach(device_t dev) -{ - struct idt_softc *sc; - int error; - - sc = device_get_softc(dev); - sc->dev = dev; - error = 0; - - pci_enable_busmaster(dev); - - /* count = 2 (times 32 PCI clocks) */ - pci_write_config(dev, PCIR_LATTIMER, 0x20, 1); - - /* Map IDT registers */ - sc->mem_rid = 0x14; - sc->mem_type = SYS_RES_MEMORY; - sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, - RF_ACTIVE); - if (sc->mem == NULL) { - device_printf(dev, "could not map registers.\n"); - error = ENXIO; - goto fail; - } - sc->bustag = rman_get_bustag(sc->mem); - sc->bushandle = rman_get_bushandle(sc->mem); - - /* Map interrupt */ - sc->irq_rid = 0; - sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, - RF_ACTIVE | RF_SHAREABLE); - if (sc->irq == NULL) { - device_printf(dev, "could not map interrupt.\n"); - error = ENXIO; - goto fail; - } - - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, NULL, nicstar_intr, - sc, &sc->irq_ih); - if (error) { - device_printf(dev, "could not setup irq.\n"); - error = ENXIO; - goto fail; - } - - sc->virt_baseaddr = (vm_offset_t)rman_get_virtual(sc->mem); - sc->cmd_reg = sc->virt_baseaddr + REGCMD; /* old reg */ - sc->stat_reg = sc->virt_baseaddr + REGSTAT; /* old reg */ - sc->reg_cmd = (u_long *)(sc->virt_baseaddr + REGCMD); - sc->reg_stat = (u_long *)(sc->virt_baseaddr + REGSTAT); - sc->reg_cfg = (u_long *)(sc->virt_baseaddr + REGCFG); - sc->reg_data = (u_long *)(sc->virt_baseaddr + 0); - sc->reg_tsqh = (u_long *)(sc->virt_baseaddr + REGTSQH); - sc->reg_gp = (u_long *)(sc->virt_baseaddr + REGGP); - sc->pci_rev = pci_get_revid(dev); - sc->timer_wrap = 0; - - callout_handle_init(&sc->ch); - - phys_init(sc); /* initialize the hardware */ - nicstar_init(sc); /* allocate and initialize */ - - error = idt_harp_init(sc); - if (error) - goto fail; - - return (0); -fail: - idt_free(dev); - return (error); -} - -/****************************************************************************** - * - * Detach device - * - * Date first: 11/14/2000 last: 11/14/2000 - */ - -static int -idt_detach(device_t dev) -{ - struct idt_softc *sc; - int error; - - sc = device_get_softc(dev); - error = 0; - - /* - * De-Register this interface with ATM core services - */ - error = atm_physif_deregister(&sc->iu_cmn); - - idt_device_stop(sc); /* Stop the device */ - - /* - * Lock out all device interrupts. - */ - DEVICE_LOCK(&sc->iu_cmn); - idt_free(dev); - idt_release_mem(sc); - DEVICE_UNLOCK(&sc->iu_cmn); - - return (error); -} - -/****************************************************************************** - * - * Shutdown device - * - * Date first: 11/14/2000 last: 11/14/2000 - */ - -static int -idt_shutdown(device_t dev) -{ - - struct idt_softc *sc; - - sc = device_get_softc(dev); - - idt_device_stop(sc); /* Stop the device */ - - return (0); -} - -static void -idt_free (device_t dev) -{ - struct idt_softc *sc; - - sc = device_get_softc(dev); - - if (sc->irq_ih) - bus_teardown_intr(dev, sc->irq, sc->irq_ih); - if (sc->irq) - bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); - if (sc->mem) - bus_release_resource(dev, sc->mem_type, sc->mem_rid, sc->mem); - - return; -} - -static int -idt_modevent (module_t mod, int type, void *data) -{ - int error; - - error = 0; - - switch (type) { - case MOD_LOAD: - idt_nif_zone = uma_zcreate("idt nif", - sizeof(struct atm_nif), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (idt_nif_zone == NULL) - panic("hfa_modevent:uma_zcreate nif"); - uma_zone_set_max(idt_nif_zone, 20); - - idt_vcc_zone = uma_zcreate("idt vcc", - sizeof(Idt_vcc), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (idt_vcc_zone == NULL) - panic("hfa_modevent: uma_zcreate vcc"); - uma_zone_set_max(idt_vcc_zone, 100); - - break; - - case MOD_UNLOAD: - uma_zdestroy(idt_nif_zone); - uma_zdestroy(idt_vcc_zone); - - break; - default: - break; - } - - return (error); -} - -static device_method_t idt_methods[] = { - DEVMETHOD(device_probe, idt_probe), - DEVMETHOD(device_attach, idt_attach), - DEVMETHOD(device_detach, idt_detach), - DEVMETHOD(device_shutdown, idt_shutdown), - {0, 0} -}; - -static driver_t idt_driver = { - "idt", - idt_methods, - sizeof(struct idt_softc) -}; - -static devclass_t idt_devclass; - -DRIVER_MODULE(idt, pci, idt_driver, idt_devclass, idt_modevent, 0); -MODULE_VERSION(idt, 1); Property changes on: head/sys/dev/idt/idt_pci.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/idt/idtvar.h =================================================================== --- head/sys/dev/idt/idtvar.h (revision 179307) +++ head/sys/dev/idt/idtvar.h (nonexistent) @@ -1,228 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Matriplex, inc. - * 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. - * - ****************************************************************************** - * - * This driver is derived from the Nicstar driver by Mark Tinguely, and - * some of the original driver still exists here. Those portions are... - * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely - * All rights reserved. - * - ****************************************************************************** - * - * This driver supports the Fore LE155, LE25, and IDT 77211 cards. - * - * ATM CBR connections are supported, and bandwidth is allocated in - * slots of 64k each. Three VBR queues handle traffic for VBR and - * UBR. Two UBR queues prioritize UBR traffic. ILMI and signalling - * get the higher priority queue, as well as UBR traffic that specifies - * a peak cell rate. All other UBR traffic goes into the lower queue. - * - ****************************************************************************** - * - * $FreeBSD$ - */ - -/******************************************************************************* - * - * New data types - */ - -typedef struct { - struct mbuf *mget; /* head of mbuf queue, pull mbufs from here */ - struct mbuf **mput; /* tail (ptr to m_nextpkt) put mbufs here */ - u_long scd; /* segmentation channel descriptor address */ - u_long *scq_base; /* segmentation channel queue base address */ - u_long *scq_next; /* next address */ - u_long *scq_last; /* last address written */ - int scq_len; /* size of SCQ buffer (64 or 512) */ - int scq_cur; /* current number entries in SCQ buffer */ - int rate; /* cells per second allocated to this queue */ - int vbr_m; /* VBR m/n = max duty cycle for queue */ - int vbr_n; /* 1 <= m <= 7 and 1 <= n <= 127 */ -} TX_QUEUE; - -/* To avoid expensive SRAM reads, scq_cur tracks the number of SCQ entries - * in use. Only idt_transmit_top may increase this, and only idt_intr_tsq - * may decrease it. - */ - -/* mbuf chains on the queue use the fields: - * m_next is the usual pointer to next mbuf - * m_nextpkt is the next packet on the queue - * m_pkthdr.rcvif is a pointer to the connection - * m_pkthdr.header is a pointer to the TX queue - */ - -typedef struct { - struct vccb *vccinf; - char status; /* zero if closed */ - char vpi; - u_short vci; - TX_QUEUE *queue; /* transmit queue for this connection */ - struct mbuf *recv; /* current receive mbuf, or NULL */ - int rlen; /* current receive length */ - int maxpdu; /* largest PDU we will ever see */ - int traf_pcr; /* peak cell rate */ - int traf_scr; /* sustained cell rate */ - u_char aal; /* AAL for this connection */ - u_char class; /* T_ATM_CBR, T_ATM_VBR, or T_ATM_UBR */ - u_char flg_mpeg2ts:1; /* send data as 2 TS == 8 AAL5 cells */ - u_char flg_clp:1; /* CLP flag for outbound cells */ -} CONNECTION; - -#define MAX_CONNECTION 4096 /* max number of connections */ - -#define GET_RDTSC(var) {__asm__ volatile("rdtsc":"=A"(var)); } - -/******************************************************************************* - * - * Device softc structure - */ - -struct idt_softc { - /* HARP data */ - /* XXX: must be first member of struct. */ - Cmn_unit iu_cmn; /* Common unit stuff */ - -#if 0 - struct arpcom idt_ac; /* ifnet for device */ -#endif - - /* Device data */ - device_t dev; - int debug; - - struct resource * mem; - int mem_rid; - int mem_type; - bus_space_tag_t bustag; - bus_space_handle_t bushandle; - - struct resource * irq; - int irq_rid; - void * irq_ih; - - struct callout_handle ch; - - struct mtx mtx; - - vm_offset_t virt_baseaddr; /* nicstar register virtual address */ - vm_offset_t cmd_reg; /* command register offset 0x14 */ - vm_offset_t stat_reg; /* status register offset 0x60 */ - vm_offset_t fixbuf; /* buffer that holds TSQ, RSQ, variable SCQ */ - - u_long timer_wrap; /* keep track of wrapped timers */ - u_long rsqh; /* Recieve Status Queue, reg is write-only */ - - CONNECTION *connection; /* connection table */ - int conn_maxvpi; /* number of VPI values */ - int conn_maxvci; /* number of VCI values */ - int cellrate_rmax; /* max RX cells per second */ - int cellrate_tmax; /* max TX cells per second */ - int cellrate_rcur; /* current committed RX cellrate */ - int cellrate_tcur; /* current committed TX cellrate */ - int txslots_max; /* number of CBR TX slots for interface */ - int txslots_cur; /* current CBR TX slots in use */ - TX_QUEUE cbr_txqb[IDT_MAX_CBRQUEUE]; - TX_QUEUE *cbr_slot[IDT_MAX_CBRSLOTS]; - TX_QUEUE *cbr_free[IDT_MAX_CBRQUEUE]; - TX_QUEUE queue_vbr; - TX_QUEUE queue_abr; - TX_QUEUE queue_ubr; - vm_offset_t cbr_base; /* base of memory for CBR TX queues */ - int cbr_size; /* size of memory for CBR TX queues */ - int cbr_freect; - u_long raw_headp; /* head of raw cell queue, physical */ - struct mbuf *raw_headm; /* head of raw cell queue, virtual */ - u_long *tsq_base; /* virtual TSQ base address */ - u_long *tsq_head; /* virtual TSQ head pointer */ - int tsq_size; /* number of TSQ entries (1024) */ - volatile u_long *reg_cfg; - volatile u_long *reg_cmd; - volatile u_long *reg_data; - volatile u_long *reg_tsqh; - volatile u_long *reg_gp; - volatile u_long *reg_stat; - struct mbuf **mcheck; - - int sram; /* amount of SRAM */ - int pci_rev; /* hardware revision ID */ - char *hardware; /* hardware description string */ - u_char flg_le25:1; /* flag indicates LE25 instead of LE155 */ - u_char flg_igcrc:1; /* ignore receive CRC errors */ -}; - -typedef struct idt_softc nicstar_reg_t; -typedef struct idt_softc IDT; - -#define iu_pif iu_cmn.cu_pif -#define stats_ipdus iu_pif.pif_ipdus -#define stats_opdus iu_pif.pif_opdus -#define stats_ibytes iu_pif.pif_ibytes -#define stats_obytes iu_pif.pif_obytes -#define stats_ierrors iu_pif.pif_ierrors -#define stats_oerrors iu_pif.pif_oerrors -#define stats_cmderrors iu_pif.pif_cmderrors - -/* - * Device VCC Entry - * - * Contains the common and IDT-specific information for each VCC - * which is opened through an IDT device. - */ -struct nidt_vcc { - struct cmn_vcc iv_cmn; /* Common VCC stuff */ -}; - -typedef struct nidt_vcc Idt_vcc; - -extern int idt_sysctl_logvcs; -extern int idt_sysctl_vbriscbr; - -void nicstar_intr(void *); -void phys_init(nicstar_reg_t * const); -void nicstar_init(nicstar_reg_t * const); -int idt_harp_init(nicstar_reg_t * const); -void idt_device_stop(IDT *); -void idt_release_mem(IDT *); - -CONNECTION *idt_connect_find(IDT *, int, int); -caddr_t idt_mbuf_base(struct mbuf *); -int idt_slots_cbr(IDT *, int); - -int idt_connect_opencls(IDT *, CONNECTION *, int); -int idt_connect_txopen(IDT *, CONNECTION *); -int idt_connect_txclose(IDT *, CONNECTION *); - -int nicstar_eeprom_rd(nicstar_reg_t * const, u_long); - -void idt_receive(IDT *, struct mbuf *, int, int); -void idt_transmit(IDT *, struct mbuf *, int, int, int); Property changes on: head/sys/dev/idt/idtvar.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/idt/idtreg.h =================================================================== --- head/sys/dev/idt/idtreg.h (revision 179307) +++ head/sys/dev/idt/idtreg.h (nonexistent) @@ -1,77 +0,0 @@ -/*- - * Copyright (c) 2000, 2001 Richard Hodges and Matriplex, inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Matriplex, inc. - * 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. - * - ****************************************************************************** - * - * This driver is derived from the Nicstar driver by Mark Tinguely, and - * some of the original driver still exists here. Those portions are... - * Copyright (c) 1996, 1997, 1998, 1999 Mark Tinguely - * All rights reserved. - * - ****************************************************************************** - * - * $FreeBSD$ - */ - -#define IDT_VERSION "IDT 1.101" -#define CBR_VERBOSE 1 /* show CBR time slots */ - -#define IDT_MAX_CBRSLOTS 2100 /* no smaller than value assigned to card */ -#define IDT_MAX_CBRQUEUE 64 /* max number of CBR connections: 1k each */ - -/* AAL types */ -#define IDTAAL0 0 -#define IDTAAL1 1 -#define IDTAAL3_4 3 -#define IDTAAL5 5 - -#define NICCBR 1 -#define NICVBR 2 -#define NICABR 3 -#define NICUBR 4 - -/* NICStAR Operation Registers */ -#define REGCMD 0x10 /* command w */ -#define REGCFG 0x14 /* configuration r/w */ -#define REGSTAT 0x18 /* status r/w */ -#define REGRSQB 0x1c /* RSQ base w */ -#define REGRSQT 0x20 /* RSQ tail r */ -#define REGRSQH 0x24 /* RSQ head w */ -#define REGCDC 0x28 /* cell drop cnt r/c */ -#define REGVPEC 0x2c /* vci/vpi er cnt r/c */ -#define REGICC 0x30 /* invalid cell r/c */ -#define REGRAWT 0x34 /* raw cell tail r */ -#define REGTMR 0x38 /* timer r */ -#define REGTSTB 0x3c /* TST base r/w */ -#define REGTSQB 0x40 /* TSQ base w */ -#define REGTSQT 0x44 /* TSQ tail r */ -#define REGTSQH 0x48 /* TSQ head w */ -#define REGGP 0x4c /* general purp r/w */ -#define REGVMSK 0x50 /* vci/vpi mask w */ Property changes on: head/sys/dev/idt/idtreg.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/harp/if_harp.c =================================================================== --- head/sys/dev/harp/if_harp.c (revision 179307) +++ head/sys/dev/harp/if_harp.c (nonexistent) @@ -1,661 +0,0 @@ -/*- - * Copyright (c) 2003 - * Fraunhofer Institute for Open Communication Systems (FhG Fokus). - * 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. - * - * Author: Harti Brandt - * - * HARP pseudo-driver. This driver when loaded attaches to all ngATM drivers - * in the system and creates a HARP physical interface for each of them. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#define HARP_MTU 9188 - -/* - * Physical interface softc - */ -struct harp_softc { - Cmn_unit cmn; - struct ifnet *parent; - LIST_ENTRY(harp_softc) link; -}; - -struct harp_vcc { - struct cmn_vcc cmn; -}; - -MODULE_VERSION(harp, 1); -MODULE_DEPEND(harp, atm, 1, 1, 1); - -/* hooks from if_atmsubr.c */ -extern void (*atm_harp_input_p)(struct ifnet *ifp, struct mbuf **m, - struct atm_pseudohdr *ah, void *rxhand); -extern void (*atm_harp_attach_p)(struct ifnet *); -extern void (*atm_harp_detach_p)(struct ifnet *); - -static MALLOC_DEFINE(M_HARP, "harp", "Harp pseudo interface"); - -static uma_zone_t harp_nif_zone; -static uma_zone_t harp_vcc_zone; - -/* List of all existing 'harp' interfaces */ -static LIST_HEAD(, harp_softc) harp_softc_list = - LIST_HEAD_INITIALIZER(harp_softc_list); - -static struct stack_defn harp_svaal5 = { - NULL, - SAP_CPCS_AAL5, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; - -static struct stack_defn *harp_services = &harp_svaal5; - -/* - * Map between constants - */ -static const struct { - u_int vendor; - u_int api; - u_int dev; -} map_devs[] = { - [ATM_DEVICE_UNKNOWN] = - { VENDOR_UNKNOWN, VENDAPI_UNKNOWN, DEV_UNKNOWN }, - [ATM_DEVICE_PCA200E] = - { VENDOR_FORE, VENDAPI_FORE_1, DEV_FORE_PCA200E }, - [ATM_DEVICE_HE155] = - { VENDOR_FORE, VENDAPI_FORE_2, DEV_FORE_HE155 }, - [ATM_DEVICE_HE622] = - { VENDOR_FORE, VENDAPI_FORE_2, DEV_FORE_HE622 }, - [ATM_DEVICE_ENI155P] = - { VENDOR_ENI, VENDAPI_ENI_1, DEV_ENI_155P }, - [ATM_DEVICE_ADP155P] = - { VENDOR_ENI, VENDAPI_ENI_1, DEV_ENI_155P }, - [ATM_DEVICE_FORELE25] = - { VENDOR_FORE, VENDAPI_IDT_1, DEV_FORE_LE25 }, - [ATM_DEVICE_FORELE155] = - { VENDOR_FORE, VENDAPI_IDT_1, DEV_FORE_LE155 }, - [ATM_DEVICE_NICSTAR25] = - { VENDOR_IDT, VENDAPI_IDT_1, DEV_IDT_25 }, - [ATM_DEVICE_NICSTAR155] = - { VENDOR_IDT, VENDAPI_IDT_1, DEV_IDT_155 }, - [ATM_DEVICE_IDTABR25] = - { VENDOR_IDT, VENDAPI_IDT_2, DEV_IDTABR_25 }, - [ATM_DEVICE_IDTABR155] = - { VENDOR_IDT, VENDAPI_IDT_2, DEV_IDTABR_155 }, - [ATM_DEVICE_PROATM25] = - { VENDOR_PROSUM, VENDAPI_IDT_2, DEV_PROATM_25 }, - [ATM_DEVICE_PROATM155] = - { VENDOR_PROSUM, VENDAPI_IDT_2, DEV_PROATM_155 }, -}; - -/* - * Return zero if this interface is ok for us. - * XXX This should go away when we have full ngATM-ified the en driver. - */ -static int -harp_check_if(const struct ifnet *ifp) -{ - if (ifp->if_type == IFT_ATM && strcmp(ifp->if_dname, "en")) - return (0); - else - return (-1); -} - -/* - * Instantiate a VCC stack. - * - * Could check for correct attributes here. - */ -static int -harp_instvcc(Cmn_unit *up, Cmn_vcc *vp) -{ - struct harp_softc *sc; - - if (up == NULL || vp == NULL || vp->cv_connvc == NULL) - return (EINVAL); - - sc = (struct harp_softc *)up; - - return (0); -} - -/* - * Open a VCC. - */ -static int -harp_openvcc(Cmn_unit *up, Cmn_vcc *vp) -{ - struct harp_softc *sc; - struct atmio_openvcc data; - Atm_attributes *attrib; - struct vccb *vccinf; - const struct ifatm_mib *mib; - int err; - - if (up == NULL || vp == NULL || vp->cv_connvc == NULL) - return (EINVAL); - - sc = (struct harp_softc *)up; - mib = sc->parent->if_linkmib; - - attrib = &vp->cv_connvc->cvc_attr; - vccinf = vp->cv_connvc->cvc_vcc; - - if (attrib == NULL || vccinf == NULL) - return (EINVAL); - - if (vccinf->vc_vpi >= (1 << mib->vpi_bits) || - vccinf->vc_vci >= (1 << mib->vci_bits)) - return (EINVAL); - - memset(&data, 0, sizeof(data)); - - switch (attrib->aal.type) { - - case ATM_AAL0: - data.param.aal = ATMIO_AAL_0; - break; - - case ATM_AAL5: - data.param.aal = ATMIO_AAL_5; - break; - - default: - return (EINVAL); - } - data.param.vpi = vccinf->vc_vpi; - data.param.vci = vccinf->vc_vci; - data.param.rmtu = HARP_MTU; - data.param.tmtu = HARP_MTU; - - switch (attrib->bearer.v.bearer_class) { - - case T_ATM_CLASS_C: - data.param.traffic = ATMIO_TRAFFIC_VBR; - break; - - case T_ATM_CLASS_X: - switch (attrib->bearer.v.traffic_type) { - - case T_ATM_CBR: - data.param.traffic = ATMIO_TRAFFIC_CBR; - break; - - case T_ATM_VBR: - data.param.traffic = ATMIO_TRAFFIC_VBR; - break; - - case T_ATM_ABR: - /* not really supported by HARP */ - return (EINVAL); - - default: - case T_ATM_UBR: - data.param.traffic = ATMIO_TRAFFIC_UBR; - break; - } - break; - - default: - return (EINVAL); - } - data.param.tparam.pcr = attrib->traffic.v.forward.PCR_all_traffic; - data.param.tparam.scr = attrib->traffic.v.forward.SCR_all_traffic; - data.param.tparam.mbs = attrib->traffic.v.forward.MBS_all_traffic; - - data.rxhand = sc; - data.param.flags = ATMIO_FLAG_HARP; - - err = (*sc->parent->if_ioctl)(sc->parent, SIOCATMOPENVCC, - (caddr_t)&data); - - return (err); -} - -/* - * Close VCC - */ -static int -harp_closevcc(Cmn_unit *up, Cmn_vcc *vp) -{ - struct harp_softc *sc; - struct atmio_closevcc data; - int err; - - if (vp == NULL || vp->cv_connvc == NULL || - vp->cv_connvc->cvc_vcc == NULL) - return (EINVAL); - - sc = (struct harp_softc *)up; - - data.vpi = vp->cv_connvc->cvc_vcc->vc_vpi; - data.vci = vp->cv_connvc->cvc_vcc->vc_vci; - - err = (*sc->parent->if_ioctl)(sc->parent, SIOCATMCLOSEVCC, - (caddr_t)&data); - - return (err); -} - -/* - * IOCTLs - */ -static int -harp_ioctl(int code, caddr_t addr, caddr_t arg) -{ - return (ENOSYS); -} - -/* - * Output data - */ -static void -harp_output(Cmn_unit *cu, Cmn_vcc *cv, KBuffer *m) -{ - struct harp_softc *sc = (struct harp_softc *)cu; - struct atm_pseudohdr *aph; - int error; - int mlen; - - if (cv == NULL || cv->cv_connvc == NULL || - cv->cv_connvc->cvc_vcc == NULL) { - m_freem(m); - return; - } - M_ASSERTPKTHDR(m); - - /* - * Harp seems very broken with regard to mbuf handling. The length - * in the packet header is mostly broken here so recompute it. - */ - m->m_pkthdr.len = mlen = m_length(m, NULL); - - /* - * Prepend pseudo-hdr. Drivers don't care about the flags. - */ - M_PREPEND(m, sizeof(*aph), M_DONTWAIT); - if (m == NULL) - return; - - aph = mtod(m, struct atm_pseudohdr *); - ATM_PH_VPI(aph) = cv->cv_connvc->cvc_vcc->vc_vpi; - ATM_PH_SETVCI(aph, cv->cv_connvc->cvc_vcc->vc_vci); - ATM_PH_FLAGS(aph) = 0; - - error = atm_output(sc->parent, m, NULL, NULL); - - if (error) { - printf("%s: error %d\n", __func__, error); - sc->cmn.cu_pif.pif_oerrors++; - cv->cv_connvc->cvc_vcc->vc_oerrors++; - if (cv->cv_connvc->cvc_vcc->vc_nif) - ANIF2IFP(cv->cv_connvc->cvc_vcc->vc_nif)->if_oerrors++; - return; - } - - /* statistics */ - sc->cmn.cu_pif.pif_opdus++; - sc->cmn.cu_pif.pif_obytes += mlen; - cv->cv_connvc->cvc_vcc->vc_opdus++; - cv->cv_connvc->cvc_vcc->vc_obytes += mlen; - if (cv->cv_connvc->cvc_vcc->vc_nif) { - cv->cv_connvc->cvc_vcc->vc_nif->nif_obytes += mlen; - ANIF2IFP(cv->cv_connvc->cvc_vcc->vc_nif)->if_obytes += mlen; - ANIF2IFP(cv->cv_connvc->cvc_vcc->vc_nif)->if_opackets++; - } -} - -/* - * Attach a new interface - */ -static void -harp_attach(struct ifnet *parent) -{ - struct harp_softc *sc; - const struct ifatm_mib *mib; - int error; - - if (harp_check_if(parent) != 0) - return; - - sc = malloc(sizeof(*sc), M_HARP, M_WAITOK | M_ZERO); - - sc->parent = parent; - sc->cmn.cu_unit = parent->if_dunit; - sc->cmn.cu_mtu = HARP_MTU; - sc->cmn.cu_ioctl = harp_ioctl; - sc->cmn.cu_instvcc = harp_instvcc; - sc->cmn.cu_openvcc = harp_openvcc; - sc->cmn.cu_closevcc = harp_closevcc; - sc->cmn.cu_output = harp_output; - sc->cmn.cu_vcc_zone = harp_vcc_zone; - sc->cmn.cu_nif_zone = harp_nif_zone; - sc->cmn.cu_softc = sc; - - /* config */ - mib = parent->if_linkmib; - if (mib->device >= sizeof(map_devs) / sizeof(map_devs[0])) { - sc->cmn.cu_config.ac_vendor = VENDOR_UNKNOWN; - sc->cmn.cu_config.ac_vendapi = VENDAPI_UNKNOWN; - sc->cmn.cu_config.ac_device = DEV_UNKNOWN; - } else { - sc->cmn.cu_config.ac_vendor = map_devs[mib->device].vendor; - sc->cmn.cu_config.ac_vendapi = map_devs[mib->device].api; - sc->cmn.cu_config.ac_device = map_devs[mib->device].dev; - } - - switch (mib->media) { - - case IFM_ATM_UTP_25: - sc->cmn.cu_config.ac_media = MEDIA_UTP25;; - break; - - case IFM_ATM_TAXI_100: - sc->cmn.cu_config.ac_media = MEDIA_TAXI_100; - break; - - case IFM_ATM_TAXI_140: - sc->cmn.cu_config.ac_media = MEDIA_TAXI_140; - break; - - case IFM_ATM_MM_155: - case IFM_ATM_SM_155: - sc->cmn.cu_config.ac_media = MEDIA_OC3C; - break; - - case IFM_ATM_MM_622: - case IFM_ATM_SM_622: - sc->cmn.cu_config.ac_media = MEDIA_OC12C; - break; - - case IFM_ATM_UTP_155: - sc->cmn.cu_config.ac_media = MEDIA_UTP155; - break; - - default: - sc->cmn.cu_config.ac_media = MEDIA_UNKNOWN; - break; - } - sc->cmn.cu_config.ac_bustype = BUS_PCI; - sc->cmn.cu_pif.pif_pcr = mib->pcr; - sc->cmn.cu_pif.pif_maxvpi = (1 << mib->vpi_bits) - 1; - sc->cmn.cu_pif.pif_maxvci = (1 << mib->vci_bits) - 1; - - snprintf(sc->cmn.cu_config.ac_hard_vers, - sizeof(sc->cmn.cu_config.ac_hard_vers), "0x%lx", - (u_long)mib->hw_version); - snprintf(sc->cmn.cu_config.ac_firm_vers, - sizeof(sc->cmn.cu_config.ac_firm_vers), "0x%lx", - (u_long)mib->sw_version); - sc->cmn.cu_config.ac_serial = mib->serial; - sc->cmn.cu_config.ac_ram = 0; - sc->cmn.cu_config.ac_ramsize = 0; - - sc->cmn.cu_config.ac_macaddr.ma_data[0] = - sc->cmn.cu_pif.pif_macaddr.ma_data[0] = mib->esi[0]; - sc->cmn.cu_config.ac_macaddr.ma_data[1] = - sc->cmn.cu_pif.pif_macaddr.ma_data[1] = mib->esi[1]; - sc->cmn.cu_config.ac_macaddr.ma_data[2] = - sc->cmn.cu_pif.pif_macaddr.ma_data[2] = mib->esi[2]; - sc->cmn.cu_config.ac_macaddr.ma_data[3] = - sc->cmn.cu_pif.pif_macaddr.ma_data[3] = mib->esi[3]; - sc->cmn.cu_config.ac_macaddr.ma_data[4] = - sc->cmn.cu_pif.pif_macaddr.ma_data[4] = mib->esi[4]; - sc->cmn.cu_config.ac_macaddr.ma_data[5] = - sc->cmn.cu_pif.pif_macaddr.ma_data[5] = mib->esi[5]; - - error = atm_physif_register(&sc->cmn, parent->if_dname, harp_services); - if (error) { - log(LOG_ERR, "%s: pif registration failed %d\n", - parent->if_dname, error); - free(sc, M_HARP); - return; - } - LIST_INSERT_HEAD(&harp_softc_list, sc, link); - - sc->cmn.cu_flags |= CUF_INITED; -} - -/* - * Destroy a cloned device - */ -static void -harp_detach(struct ifnet *ifp) -{ - struct harp_softc *sc; - int error; - - LIST_FOREACH(sc, &harp_softc_list, link) - if (sc->parent == ifp) - break; - if (sc == NULL) - return; - - error = atm_physif_deregister(&sc->cmn); - if (error) - log(LOG_ERR, "%s: de-registration failed %d\n", ifp->if_dname, - error); - - LIST_REMOVE(sc, link); - - free(sc, M_HARP); -} - -/* - * Pass PDU up the stack - */ -static void -harp_recv_stack(void *tok, KBuffer *m) -{ - Cmn_vcc *vcc = tok; - int err; - - M_ASSERTPKTHDR(m); - STACK_CALL(CPCS_UNITDATA_SIG, vcc->cv_upper, vcc->cv_toku, - vcc->cv_connvc, (intptr_t)m, 0, err); - if (err) { - printf("%s: error %d\n", __func__, err); - KB_FREEALL(m); - } -} - -/* - * Possible input from NATM - */ -static void -harp_input(struct ifnet *ifp, struct mbuf **mp, struct atm_pseudohdr *ah, - void *rxhand) -{ - struct harp_softc *sc = rxhand; - Cmn_vcc *vcc; - char *cp; - u_int pfxlen; - struct mbuf *m, *m0; - int mlen; - - if ((ATM_PH_FLAGS(ah) & ATMIO_FLAG_HARP) == 0) - return; - - /* grab the packet */ - m = *mp; - *mp = NULL; - - if (sc->parent != ifp) { - printf("%s: parent=%p ifp=%p\n", __func__, sc->parent, ifp); - goto drop; - } - - vcc = atm_dev_vcc_find(&sc->cmn, ATM_PH_VPI(ah), - ATM_PH_VCI(ah), VCC_IN); - if (vcc == NULL) { - printf("%s: VCC %u/%u not found\n", __func__,ATM_PH_VPI(ah), - ATM_PH_VCI(ah)); - goto drop; - } - - /* fit two pointers into the mbuf - assume, that the the data is - * pointer aligned. If it doesn't fit into the first mbuf, prepend - * another one. - * Don't count the new fields in the packet length (XXX) - */ - mlen = m->m_pkthdr.len; - pfxlen = sizeof(atm_intr_func_t) + sizeof(void *); - if (M_LEADINGSPACE(m) < pfxlen) { - MGETHDR(m0, 0, MT_DATA); - if (m0 == NULL) { - printf("%s: no leading space in buffer\n", __func__); - goto drop; - } - m0->m_len = 0; - m0->m_next = m; - - M_MOVE_PKTHDR(m0, m); - - m = m0; - } - m->m_len += pfxlen; - m->m_data -= pfxlen; - cp = mtod(m, char *); - *((atm_intr_func_t *)cp) = harp_recv_stack; - cp += sizeof(atm_intr_func_t); - *((void **)cp) = (void *)vcc; - - /* count the packet */ - sc->cmn.cu_pif.pif_ipdus++; - sc->cmn.cu_pif.pif_ibytes += mlen; - vcc->cv_connvc->cvc_vcc->vc_ipdus++; - vcc->cv_connvc->cvc_vcc->vc_ibytes += mlen; - if (vcc->cv_connvc->cvc_vcc->vc_nif) { - vcc->cv_connvc->cvc_vcc->vc_nif->nif_ibytes += mlen; - ANIF2IFP(vcc->cv_connvc->cvc_vcc->vc_nif)->if_ipackets++; - ANIF2IFP(vcc->cv_connvc->cvc_vcc->vc_nif)->if_ibytes += mlen; - } - - /* hand it off */ - netisr_dispatch(NETISR_ATM, m); - return; - - drop: - m_freem(m); -} - -/* - * Module loading/unloading - */ -static int -harp_modevent(module_t mod, int event, void *data) -{ - struct ifnet *ifp; - - switch (event) { - - case MOD_LOAD: - harp_nif_zone = uma_zcreate("harp nif", sizeof(struct atm_nif), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (harp_nif_zone == NULL) - panic("%s: nif_zone", __func__); - - harp_vcc_zone = uma_zcreate("harp vcc", sizeof(struct harp_vcc), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (harp_vcc_zone == NULL) - panic("%s: vcc_zone", __func__); - - /* Create harp interfaces for all existing ATM interfaces */ - TAILQ_FOREACH(ifp, &ifnet, if_link) - harp_attach(ifp); - - atm_harp_attach_p = harp_attach; - atm_harp_detach_p = harp_detach; - atm_harp_input_p = harp_input; - break; - - case MOD_UNLOAD: - atm_harp_attach_p = NULL; - atm_harp_detach_p = NULL; - atm_harp_input_p = NULL; - - while (!LIST_EMPTY(&harp_softc_list)) - harp_detach(LIST_FIRST(&harp_softc_list)->parent); - - uma_zdestroy(harp_nif_zone); - uma_zdestroy(harp_vcc_zone); - - break; - default: - return (EOPNOTSUPP); - } - return (0); -} - -static moduledata_t harp_mod = { - "if_harp", - harp_modevent, - 0 -}; - -DECLARE_MODULE(harp, harp_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Property changes on: head/sys/dev/harp/if_harp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_vcm.c =================================================================== --- head/sys/dev/hfa/fore_vcm.c (revision 179307) +++ head/sys/dev/hfa/fore_vcm.c (nonexistent) @@ -1,531 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Virtual Channel Management - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * VCC Stack Instantiation - * - * This function is called via the common driver code during a device VCC - * stack instantiation. The common code has already validated some of - * the request so we just need to check a few more Fore-specific details. - * - * Called at splnet. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 instantiation successful - * err instantiation failed - reason indicated - * - */ -int -fore_instvcc(cup, cvp) - Cmn_unit *cup; - Cmn_vcc *cvp; -{ - Fore_vcc *fvp = (Fore_vcc *)cvp; - Atm_attributes *ap = &fvp->fv_connvc->cvc_attr; - - /* - * Validate requested AAL - */ - switch (ap->aal.type) { - - case ATM_AAL0: - fvp->fv_aal = FORE_AAL_0; - break; - - case ATM_AAL3_4: - fvp->fv_aal = FORE_AAL_4; - if ((ap->aal.v.aal4.forward_max_SDU_size > FORE_IFF_MTU) || - (ap->aal.v.aal4.backward_max_SDU_size > FORE_IFF_MTU)) - return (EINVAL); - break; - - case ATM_AAL5: - fvp->fv_aal = FORE_AAL_5; - if ((ap->aal.v.aal5.forward_max_SDU_size > FORE_IFF_MTU) || - (ap->aal.v.aal5.backward_max_SDU_size > FORE_IFF_MTU)) - return (EINVAL); - break; - - default: - return (EINVAL); - } - - return (0); -} - -static const u_int rate_tab[255] = { - 353207, /* 0 */ - 312501, /* 1 */ 312501, /* 2 */ - 312501, /* 3 */ 312501, /* 4 */ - 312501, /* 5 */ 312501, /* 6 */ - 312501, /* 7 */ 312501, /* 8 */ - 312501, /* 9 */ 312501, /* 10 */ - 312501, /* 11 */ 312501, /* 12 */ - 312501, /* 13 */ 312501, /* 14 */ - 312501, /* 15 */ 312501, /* 16 */ - 312501, /* 17 */ 284091, /* 18 */ - 284091, /* 19 */ 284091, /* 20 */ - 284091, /* 21 */ 284091, /* 22 */ - 284091, /* 23 */ 284091, /* 24 */ - 284091, /* 25 */ 284091, /* 26 */ - 284091, /* 27 */ 284091, /* 28 */ - 284091, /* 29 */ 284091, /* 30 */ - 284091, /* 31 */ 284091, /* 32 */ - 284091, /* 33 */ 284091, /* 34 */ - 284091, /* 35 */ 284091, /* 36 */ - 284091, /* 37 */ 284091, /* 38 */ - 260417, /* 39 */ 260417, /* 40 */ - 260417, /* 41 */ 260417, /* 42 */ - 260417, /* 43 */ 260417, /* 44 */ - 260417, /* 45 */ 260417, /* 46 */ - 260417, /* 47 */ 260417, /* 48 */ - 260417, /* 49 */ 260417, /* 50 */ - 260417, /* 51 */ 260417, /* 52 */ - 260417, /* 53 */ 260417, /* 54 */ - 260417, /* 55 */ 240385, /* 56 */ - 240385, /* 57 */ 240385, /* 58 */ - 240385, /* 59 */ 240385, /* 60 */ - 240385, /* 61 */ 240385, /* 62 */ - 240385, /* 63 */ 240385, /* 64 */ - 240385, /* 65 */ 240385, /* 66 */ - 240385, /* 67 */ 240385, /* 68 */ - 240385, /* 69 */ 240385, /* 70 */ - 223215, /* 71 */ 223215, /* 72 */ - 223215, /* 73 */ 223215, /* 74 */ - 223215, /* 75 */ 223215, /* 76 */ - 223215, /* 77 */ 223215, /* 78 */ - 223215, /* 79 */ 223215, /* 80 */ - 223215, /* 81 */ 223215, /* 82 */ - 223215, /* 83 */ 208334, /* 84 */ - 208334, /* 85 */ 208334, /* 86 */ - 208334, /* 87 */ 208334, /* 88 */ - 208334, /* 89 */ 208334, /* 90 */ - 208334, /* 91 */ 208334, /* 92 */ - 208334, /* 93 */ 208334, /* 94 */ - 195313, /* 95 */ 195313, /* 96 */ - 195313, /* 97 */ 195313, /* 98 */ - 195313, /* 101 */ 195313, /* 102 */ - 195313, /* 103 */ 183824, /* 104 */ - 183824, /* 105 */ 183824, /* 106 */ - 183824, /* 107 */ 183824, /* 108 */ - 183824, /* 109 */ 183824, /* 110 */ - 183824, /* 111 */ 183824, /* 112 */ - 173612, /* 113 */ 173612, /* 114 */ - 173612, /* 115 */ 173612, /* 116 */ - 173612, /* 117 */ 173612, /* 118 */ - 173612, /* 119 */ 173612, /* 120 */ - 164474, /* 121 */ 164474, /* 122 */ - 164474, /* 123 */ 164474, /* 124 */ - 164474, /* 125 */ 164474, /* 126 */ - 164474, /* 127 */ 156250, /* 128 */ - 156250, /* 129 */ 156250, /* 130 */ - 156250, /* 131 */ 156250, /* 132 */ - 156250, /* 133 */ 148810, /* 134 */ - 148810, /* 135 */ 148810, /* 136 */ - 148810, /* 137 */ 148810, /* 138 */ - 148810, /* 139 */ 142046, /* 140 */ - 142046, /* 141 */ 142046, /* 142 */ - 142046, /* 143 */ 142046, /* 144 */ - 135870, /* 145 */ 135870, /* 146 */ - 135870, /* 147 */ 135870, /* 148 */ - 130209, /* 149 */ 130209, /* 150 */ - 130209, /* 151 */ 130209, /* 152 */ - 130209, /* 153 */ 125000, /* 154 */ - 125000, /* 155 */ 125000, /* 156 */ - 125000, /* 157 */ 120193, /* 158 */ - 120193, /* 159 */ 120193, /* 160 */ - 115741, /* 161 */ 115741, /* 162 */ - 115741, /* 163 */ 115741, /* 164 */ - 111608, /* 165 */ 111608, /* 166 */ - 111608, /* 167 */ 107759, /* 168 */ - 107759, /* 169 */ 107759, /* 170 */ - 104167, /* 171 */ 104167, /* 172 */ - 104167, /* 173 */ 100807, /* 174 */ - 100807, /* 175 */ 97657, /* 176 */ - 97657, /* 177 */ 97657, /* 178 */ - 94697, /* 179 */ 94697, /* 180 */ - 91912, /* 181 */ 91912, /* 182 */ - 89286, /* 183 */ 89286, /* 184 */ - 86806, /* 185 */ 86806, /* 186 */ - 84460, /* 187 */ 84460, /* 188 */ - 82237, /* 189 */ 82237, /* 190 */ - 80129, /* 191 */ 78125, /* 192 */ - 78126, /* 193 */ 76220, /* 194 */ - 74405, /* 195 */ 74405, /* 196 */ - 72675, /* 197 */ 71023, /* 198 */ - 69445, /* 199 */ 69445, /* 200 */ - 67935, /* 201 */ 66490, /* 202 */ - 65105, /* 203 */ 63776, /* 204 */ - 62500, /* 205 */ 61275, /* 206 */ - 60097, /* 207 */ 58963, /* 208 */ - 57871, /* 209 */ 56819, /* 210 */ - 54825, /* 211 */ 53880, /* 212 */ - 52967, /* 213 */ 51230, /* 214 */ - 50404, /* 215 */ 48829, /* 216 */ - 47349, /* 217 */ 46642, /* 218 */ - 45290, /* 219 */ 44015, /* 220 */ - 42809, /* 221 */ 41119, /* 222 */ - 40065, /* 223 */ 39063, /* 224 */ - 37651, /* 225 */ 36338, /* 226 */ - 35113, /* 227 */ 33968, /* 228 */ - 32553, /* 229 */ 31250, /* 230 */ - 30049, /* 231 */ 28936, /* 232 */ - 27655, /* 233 */ 26261, /* 234 */ - 25000, /* 235 */ 23855, /* 236 */ - 22645, /* 237 */ 21259, /* 238 */ - 20033, /* 239 */ 18826, /* 240 */ - 17557, /* 241 */ 16277, /* 242 */ - 15025, /* 243 */ 13767, /* 244 */ - 12551, /* 245 */ 11282, /* 246 */ - 10017, /* 247 */ 8779, /* 248 */ - 7531, /* 249 */ 6263, /* 250 */ - 5017, /* 251 */ 3761, /* 252 */ - 2509, /* 253 */ 1254, /* 254 */ -}; - -/* - * Find the best match of the high part of the Rate Control Information - * - * This function is called when a VC is opened in order to help - * in converting Fore's rate to PCR. - * The Fore's Rate Control Information is encoded as 32-bit field - * comprised of two 16-bit subfields. - * - * Arguments: - * *pcr Peak Cell Rate, will be updated with actual value - * - * Returns: - * descr the rate descriptor - * - */ -static uint32_t -pcr2rate(int32_t *pcr) -{ - u_int i; - - if (*pcr >= rate_tab[0]) { - /* special case link rate */ - *pcr = rate_tab[0]; - return (0); - } - - for (i = 0; i < sizeof(rate_tab) / sizeof(rate_tab[0]); i++) - if (*pcr >= rate_tab[i]) - break; - if (i == sizeof(rate_tab) / sizeof(rate_tab[0])) { - /* smaller than smallest */ - i--; - } - /* update with the actual value */ - *pcr = rate_tab[i]; - return ((255 - i) << 16) | i; -} - -/* - * Open a VCC - * - * This function is called via the common driver code after receiving a - * stack *_INIT command. The common code has already validated most of - * the request so we just need to check a few more Fore-specific details. - * Then we just issue the command to the CP. Note that we can't wait around - * for the CP to process the command, so we return success for now and abort - * the connection if the command later fails. - * - * Called at splimp. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 open successful - * else open failed - * - */ -int -fore_openvcc(cup, cvp) - Cmn_unit *cup; - Cmn_vcc *cvp; -{ - Fore_unit *fup = (Fore_unit *)cup; - Fore_vcc *fvp = (Fore_vcc *)cvp; - H_cmd_queue *hcp; - Cmd_queue *cqp; - struct vccb *vcp; - - vcp = fvp->fv_connvc->cvc_vcc; - - ATM_DEBUG4("fore_openvcc: fup=%p, fvp=%p, vcc=(%d,%d)\n", - fup, fvp, vcp->vc_vpi, vcp->vc_vci); - - /* - * Validate the VPI and VCI values - */ - if ((vcp->vc_vpi > fup->fu_pif.pif_maxvpi) || - (vcp->vc_vci > fup->fu_pif.pif_maxvci)) { - return (1); - } - - /* - * Compute the PCR (but only for outgoing VCCs) - */ - fvp->rate = FORE_DEF_RATE; - if ((vcp->vc_type & VCC_OUT) && cvp->cv_connvc) { - Atm_attributes *attr = &cvp->cv_connvc->cvc_attr; - - if (attr && attr->traffic.v.forward.PCR_all_traffic > 0 && - attr->traffic.v.forward.PCR_all_traffic < rate_tab[0] && - (fup->fu_shape == FUS_SHAPE_ALL || - (fup->fu_shape == FUS_SHAPE_ONE && - fup->fu_num_shaped == 0))) { - fvp->rate = pcr2rate(&attr->traffic.v.forward. - PCR_all_traffic); - fup->fu_num_shaped++; - } - } - - /* - * Only need to tell the CP about incoming VCCs - */ - if ((vcp->vc_type & VCC_IN) == 0) { - DEVICE_LOCK((Cmn_unit *)fup); - fup->fu_open_vcc++; - fvp->fv_state = CVS_ACTIVE; - DEVICE_UNLOCK((Cmn_unit *)fup); - return (0); - } - - /* - * Queue command at end of command queue - */ - hcp = fup->fu_cmd_tail; - if ((*hcp->hcq_status) & QSTAT_FREE) { - - /* - * Queue entry available, so set our view of things up - */ - hcp->hcq_code = CMD_ACT_VCCIN; - hcp->hcq_arg = fvp; - fup->fu_cmd_tail = hcp->hcq_next; - fvp->fv_flags |= FVF_ACTCMD; - - /* - * Now set the CP-resident queue entry - the CP will grab - * the command when the op-code is set. - */ - cqp = hcp->hcq_cpelem; - (*hcp->hcq_status) = QSTAT_PENDING; - cqp->cmdq_act.act_vccid = CP_WRITE(vcp->vc_vci); - if (fvp->fv_aal == FORE_AAL_0) - cqp->cmdq_act.act_batch = CP_WRITE(1); - cqp->cmdq_act.act_spec = CP_WRITE( - ACT_SET_SPEC(BUF_STRAT_1, fvp->fv_aal, - CMD_ACT_VCCIN | CMD_INTR_REQ)); - } else { - /* - * Command queue full - */ - fup->fu_stats->st_drv.drv_cm_full++; - return (1); - } - - return (0); -} - - -/* - * Close a VCC - * - * This function is called via the common driver code after receiving a - * stack *_TERM command. The common code has already validated most of - * the request so we just need to check a few more Fore-specific details. - * Then we just issue the command to the CP. Note that we can't wait around - * for the CP to process the command, so we return success for now and whine - * if the command later fails. - * - * Called at splimp. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 close successful - * else close failed - * - */ -int -fore_closevcc(cup, cvp) - Cmn_unit *cup; - Cmn_vcc *cvp; -{ - Fore_unit *fup = (Fore_unit *)cup; - Fore_vcc *fvp = (Fore_vcc *)cvp; - H_xmit_queue *hxp; - H_cmd_queue *hcp; - Cmd_queue *cqp; - struct vccb *vcp; - int i, err = 0; - - vcp = fvp->fv_connvc->cvc_vcc; - - ATM_DEBUG4("fore_closevcc: fup=%p, fvp=%p, vcc=(%d,%d)\n", - fup, fvp, vcp->vc_vpi, vcp->vc_vci); - - DEVICE_LOCK((Cmn_unit *)fup); - - /* - * Clear any references to this VCC in our transmit queue - */ - for (hxp = fup->fu_xmit_head, i = 0; - (*hxp->hxq_status != QSTAT_FREE) && (i < XMIT_QUELEN); - hxp = hxp->hxq_next, i++) { - if (hxp->hxq_vcc == fvp) { - hxp->hxq_vcc = NULL; - } - } - - /* - * Clear any references to this VCC in our command queue - */ - for (hcp = fup->fu_cmd_head, i = 0; - (*hcp->hcq_status != QSTAT_FREE) && (i < CMD_QUELEN); - hcp = hcp->hcq_next, i++) { - switch (hcp->hcq_code) { - - case CMD_ACT_VCCIN: - case CMD_ACT_VCCOUT: - if (hcp->hcq_arg == fvp) { - hcp->hcq_arg = NULL; - } - break; - } - } - - /* - * If this VCC has been previously activated, then we need to tell - * the CP to deactivate it. - */ - if (fvp->fv_flags & FVF_ACTCMD) { - - /* - * Queue command at end of command queue - */ - hcp = fup->fu_cmd_tail; - if ((*hcp->hcq_status) & QSTAT_FREE) { - - /* - * Queue entry available, so set our view of things up - */ - hcp->hcq_code = CMD_DACT_VCCIN; - hcp->hcq_arg = fvp; - fup->fu_cmd_tail = hcp->hcq_next; - - /* - * Now set the CP-resident queue entry - the CP will - * grab the command when the op-code is set. - */ - cqp = hcp->hcq_cpelem; - (*hcp->hcq_status) = QSTAT_PENDING; - cqp->cmdq_dact.dact_vccid = CP_WRITE(vcp->vc_vci); - cqp->cmdq_dact.dact_cmd = - CP_WRITE(CMD_DACT_VCCIN|CMD_INTR_REQ); - } else { - /* - * Command queue full - * - * If we get here, we'll be getting out-of-sync with - * the CP because we can't (for now at least) do - * anything about close errors in the common code. - * This won't be too bad, since we'll just toss any - * PDUs received from the VCC and the sigmgr's will - * always get open failures when trying to use this - * (vpi,vci)...oh, well...always gotta have that one - * last bug to fix! XXX - */ - fup->fu_stats->st_drv.drv_cm_full++; - err = 1; - } - } - - /* - * Finish up... - */ - if (fvp->fv_state == CVS_ACTIVE) - fup->fu_open_vcc--; - - if (fvp->rate != 0) - fup->fu_num_shaped--; - - DEVICE_UNLOCK((Cmn_unit *)fup); - - return (err); -} - Property changes on: head/sys/dev/hfa/fore_vcm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_transmit.c =================================================================== --- head/sys/dev/hfa/fore_transmit.c (revision 179307) +++ head/sys/dev/hfa/fore_transmit.c (nonexistent) @@ -1,383 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Transmit queue management - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Allocate Transmit Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * 0 allocations successful - * else allocation failed - */ -int -fore_xmit_allocate(fup) - Fore_unit *fup; -{ - void *memp; - vm_paddr_t pmemp; - H_xmit_queue *hxp; - int i; - - /* - * Allocate non-cacheable memory for transmit status words - */ - memp = atm_dev_alloc(sizeof(Q_status) * XMIT_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); - if (memp == NULL) { - return (1); - } - fup->fu_xmit_stat = (Q_status *) memp; - - pmemp = vtophys(fup->fu_xmit_stat); - if (pmemp == 0) { - return (1); - } - fup->fu_xmit_statd = pmemp; - - /* - * Allocate memory for transmit descriptors - * - * We will allocate the transmit descriptors individually rather than - * as a single memory block, which will often be larger than a memory - * page. On some systems (eg. FreeBSD) the physical addresses of - * adjacent virtual memory pages are not contiguous. - */ - hxp = fup->fu_xmit_q; - for (i = 0; i < XMIT_QUELEN; i++, hxp++) { - - /* - * Allocate a transmit descriptor for this queue entry - */ - hxp->hxq_descr = atm_dev_alloc(sizeof(Xmit_descr), - XMIT_DESCR_ALIGN, 0); - if (hxp->hxq_descr == NULL) { - return (1); - } - - hxp->hxq_descr_dma = vtophys(hxp->hxq_descr); - if (hxp->hxq_descr_dma == 0) { - return (1); - } - } - - return (0); -} - - -/* - * Transmit Queue Initialization - * - * Allocate and initialize the host-resident transmit queue structures - * and then initialize the CP-resident queue structures. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_xmit_initialize(fup) - Fore_unit *fup; -{ - Aali *aap = fup->fu_aali; - Xmit_queue *cqp; - H_xmit_queue *hxp; - Q_status *qsp; - vm_paddr_t qsp_dma; - int i; - - /* - * Point to CP-resident transmit queue - */ - cqp = (Xmit_queue *)(fup->fu_ram + CP_READ(aap->aali_xmit_q)); - - /* - * Point to host-resident transmit queue structures - */ - hxp = fup->fu_xmit_q; - qsp = fup->fu_xmit_stat; - qsp_dma = fup->fu_xmit_statd; - - /* - * Loop thru all queue entries and do whatever needs doing - */ - for (i = 0; i < XMIT_QUELEN; i++) { - - /* - * Set queue status word to free - */ - *qsp = QSTAT_FREE; - - /* - * Set up host queue entry and link into ring - */ - hxp->hxq_cpelem = cqp; - hxp->hxq_status = qsp; - if (i == (XMIT_QUELEN - 1)) - hxp->hxq_next = fup->fu_xmit_q; - else - hxp->hxq_next = hxp + 1; - - /* - * Now let the CP into the game - */ - cqp->cq_status = (CP_dma) CP_WRITE(qsp_dma); - - /* - * Bump all queue pointers - */ - hxp++; - qsp++; - qsp_dma += sizeof(Q_status); - cqp++; - } - - /* - * Initialize queue pointers - */ - fup->fu_xmit_head = fup->fu_xmit_tail = fup->fu_xmit_q; - - return; -} - - -/* - * Drain Transmit Queue - * - * This function will free all completed entries at the head of the - * transmit queue. Freeing the entry includes releasing the transmit - * buffers (buffer chain) back to the kernel. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_xmit_drain(fup) - Fore_unit *fup; -{ - H_xmit_queue *hxp; - H_dma *sdmap; - Fore_vcc *fvp; - struct vccb *vcp; - KBuffer *m; - - /* - * Process each completed entry - */ - while (*fup->fu_xmit_head->hxq_status & QSTAT_COMPLETED) { - - hxp = fup->fu_xmit_head; - - /* - * Release the entry's DMA addresses and buffer chain - */ - for (m = hxp->hxq_buf, sdmap = hxp->hxq_dma; m; - m = KB_NEXT(m), sdmap++) { - caddr_t cp; - - KB_DATASTART(m, cp, caddr_t); - } - KB_FREEALL(hxp->hxq_buf); - - /* - * Get VCC over which data was sent (may be null if - * VCC has been closed in the meantime) - */ - fvp = hxp->hxq_vcc; - - /* - * Now collect some statistics - */ - if (*hxp->hxq_status & QSTAT_ERROR) { - /* - * CP ran into problems, not much we can do - * other than record the event - */ - fup->fu_pif.pif_oerrors++; - if (fvp) { - vcp = fvp->fv_connvc->cvc_vcc; - vcp->vc_oerrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_oerrors++; - } - } else { - /* - * Good transmission - */ - int len = XDS_GET_LEN(hxp->hxq_descr->xd_spec); - - fup->fu_pif.pif_opdus++; - fup->fu_pif.pif_obytes += len; - if (fvp) { - vcp = fvp->fv_connvc->cvc_vcc; - vcp->vc_opdus++; - vcp->vc_obytes += len; - if (vcp->vc_nif) { - vcp->vc_nif->nif_obytes += len; - ANIF2IFP(vcp->vc_nif)->if_opackets++; -#if (defined(BSD) && (BSD >= 199103)) - ANIF2IFP(vcp->vc_nif)->if_obytes += len; -#endif - } - } - } - - /* - * Mark this entry free for use and bump head pointer - * to the next entry in the queue - */ - *hxp->hxq_status = QSTAT_FREE; - fup->fu_xmit_head = hxp->hxq_next; - } - - return; -} - - -/* - * Free Transmit Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_xmit_free(fup) - Fore_unit *fup; -{ - H_xmit_queue *hxp; - H_dma *sdmap; - KBuffer *m; - int i; - - /* - * Free any transmit buffers left on the queue - */ - if (fup->fu_flags & CUF_INITED) { - while (*fup->fu_xmit_head->hxq_status != QSTAT_FREE) { - - hxp = fup->fu_xmit_head; - - /* - * Release the entry's DMA addresses and buffer chain - */ - for (m = hxp->hxq_buf, sdmap = hxp->hxq_dma; m; - m = KB_NEXT(m), sdmap++) { - caddr_t cp; - - KB_DATASTART(m, cp, caddr_t); - } - KB_FREEALL(hxp->hxq_buf); - - *hxp->hxq_status = QSTAT_FREE; - fup->fu_xmit_head = hxp->hxq_next; - } - } - - /* - * Free the status words - */ - if (fup->fu_xmit_stat) { - atm_dev_free((volatile void *)fup->fu_xmit_stat); - fup->fu_xmit_stat = NULL; - fup->fu_xmit_statd = 0; - } - - /* - * Free the transmit descriptors - */ - hxp = fup->fu_xmit_q; - for (i = 0; i < XMIT_QUELEN; i++, hxp++) { - - /* - * Free the transmit descriptor for this queue entry - */ - if (hxp->hxq_descr_dma) { - hxp->hxq_descr_dma = 0; - } - - if (hxp->hxq_descr) { - atm_dev_free(hxp->hxq_descr); - hxp->hxq_descr = NULL; - } - } - - return; -} - Property changes on: head/sys/dev/hfa/fore_transmit.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_receive.c =================================================================== --- head/sys/dev/hfa/fore_receive.c (revision 179307) +++ head/sys/dev/hfa/fore_receive.c (nonexistent) @@ -1,595 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Receive queue management - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local functions - */ -static void fore_recv_stack(void *, KBuffer *); - - -/* - * Allocate Receive Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * 0 allocations successful - * else allocation failed - */ -int -fore_recv_allocate(fup) - Fore_unit *fup; -{ - caddr_t memp; - vm_paddr_t pmemp; - - /* - * Allocate non-cacheable memory for receive status words - */ - memp = atm_dev_alloc(sizeof(Q_status) * RECV_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); - if (memp == NULL) { - return (1); - } - fup->fu_recv_stat = (Q_status *) memp; - - pmemp = vtophys(fup->fu_recv_stat); - if (pmemp == 0) { - return (1); - } - fup->fu_recv_statd = pmemp; - - /* - * Allocate memory for receive descriptors - */ - memp = atm_dev_alloc(sizeof(Recv_descr) * RECV_QUELEN, - RECV_DESCR_ALIGN, 0); - if (memp == NULL) { - return (1); - } - fup->fu_recv_desc = (Recv_descr *) memp; - - pmemp = vtophys(fup->fu_recv_desc); - if (pmemp == 0) { - return (1); - } - fup->fu_recv_descd = pmemp; - - return (0); -} - - -/* - * Receive Queue Initialization - * - * Allocate and initialize the host-resident receive queue structures - * and then initialize the CP-resident queue structures. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_recv_initialize(fup) - Fore_unit *fup; -{ - Aali *aap = fup->fu_aali; - Recv_queue *cqp; - H_recv_queue *hrp; - Recv_descr *rdp; - vm_paddr_t rdp_dma; - Q_status *qsp; - vm_paddr_t qsp_dma; - int i; - - /* - * Point to CP-resident receive queue - */ - cqp = (Recv_queue *)(fup->fu_ram + CP_READ(aap->aali_recv_q)); - - /* - * Point to host-resident receive queue structures - */ - hrp = fup->fu_recv_q; - qsp = fup->fu_recv_stat; - qsp_dma = fup->fu_recv_statd; - rdp = fup->fu_recv_desc; - rdp_dma = fup->fu_recv_descd; - - /* - * Loop thru all queue entries and do whatever needs doing - */ - for (i = 0; i < RECV_QUELEN; i++) { - - /* - * Set queue status word to free - */ - *qsp = QSTAT_FREE; - - /* - * Set up host queue entry and link into ring - */ - hrp->hrq_cpelem = cqp; - hrp->hrq_status = qsp; - hrp->hrq_descr = rdp; - hrp->hrq_descr_dma = rdp_dma; - if (i == (RECV_QUELEN - 1)) - hrp->hrq_next = fup->fu_recv_q; - else - hrp->hrq_next = hrp + 1; - - /* - * Now let the CP into the game - */ - cqp->cq_descr = (CP_dma) CP_WRITE(rdp_dma); - cqp->cq_status = (CP_dma) CP_WRITE(qsp_dma); - - /* - * Bump all queue pointers - */ - hrp++; - qsp++; - qsp_dma += sizeof(Q_status); - rdp++; - rdp_dma += sizeof(Recv_descr); - cqp++; - } - - /* - * Initialize queue pointers - */ - fup->fu_recv_head = fup->fu_recv_q; - - return; -} - - -/* - * Drain Receive Queue - * - * This function will process all completed entries at the head of the - * receive queue. The received segments will be linked into a received - * PDU buffer chain and it will then be passed up the PDU's VCC stack for - * processing by the next higher protocol layer. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_recv_drain(fup) - Fore_unit *fup; -{ - H_recv_queue *hrp = NULL; - Recv_descr *rdp; - Recv_seg_descr *rsp; - Buf_handle *bhp; - Fore_vcc *fvp; - struct vccb *vcp; - KBuffer *m, *mhead, *mtail; - caddr_t cp; - u_long hdr, nsegs; - u_int seglen, type0; - int i, pdulen, retries = 0, error; - - /* Silence the compiler */ - mtail = NULL; - type0 = 0; - - /* - * Process each completed entry - */ -retry: - while (*fup->fu_recv_head->hrq_status & QSTAT_COMPLETED) { - - /* - * Get completed entry's receive descriptor - */ - hrp = fup->fu_recv_head; - rdp = hrp->hrq_descr; - -#ifdef VAC - /* - * Cache flush receive descriptor - */ - if (vac) { - vac_flush((addr_t)rdp, sizeof(Recv_descr)); - } -#endif - - hdr = rdp->rd_cell_hdr; - nsegs = rdp->rd_nsegs; - - pdulen = 0; - error = 0; - mhead = NULL; - - /* - * Locate incoming VCC for this PDU - */ - fvp = (Fore_vcc *) atm_dev_vcc_find((Cmn_unit *)fup, - ATM_HDR_GET_VPI(hdr), ATM_HDR_GET_VCI(hdr), VCC_IN); - - /* - * Check for a receive error - * - * Apparently the receive descriptor itself contains valid - * information, but the received pdu data is probably bogus. - * We'll arrange for the receive buffer segments to be tossed. - */ - if (*hrp->hrq_status & QSTAT_ERROR) { - - fup->fu_pif.pif_ierrors++; - if (fvp) { - vcp = fvp->fv_connvc->cvc_vcc; - vcp->vc_ierrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_ierrors++; - } - ATM_DEBUG1("fore receive error: hdr=0x%lx\n", hdr); - error = 1; - } - - /* - * Build PDU buffer chain from receive segments - */ - for (i = 0, rsp = rdp->rd_seg; i < nsegs; i++, rsp++) { - - bhp = rsp->rsd_handle; - seglen = rsp->rsd_len; - - /* - * Remove buffer from our supplied queue and get - * to the underlying buffer - */ - switch (bhp->bh_type) { - - case BHT_S1_SMALL: - DEQUEUE(bhp, Buf_handle, bh_qelem, - fup->fu_buf1s_bq); - fup->fu_buf1s_cnt--; - m = (KBuffer *) ((caddr_t)bhp - BUF1_SM_HOFF); - KB_DATASTART(m, cp, caddr_t); - break; - - case BHT_S1_LARGE: - DEQUEUE(bhp, Buf_handle, bh_qelem, - fup->fu_buf1l_bq); - fup->fu_buf1l_cnt--; - m = (KBuffer *) ((caddr_t)bhp - BUF1_LG_HOFF); - KB_DATASTART(m, cp, caddr_t); - break; - - default: - log(LOG_ERR, - "fore_recv_drain: bhp=%p type=0x%x\n", - bhp, bhp->bh_type); - panic("fore_recv_drain: bad buffer type"); - } - - /* - * Toss any zero-length or receive error buffers - */ - if ((seglen == 0) || error) { - KB_FREEALL(m); - continue; - } - - /* - * Link buffer into chain - */ - if (mhead == NULL) { - type0 = bhp->bh_type; - KB_LINKHEAD(m, mhead); - mhead = m; - } else { - KB_LINK(m, mtail); - } - KB_LEN(m) = seglen; - pdulen += seglen; - mtail = m; - - /* - * Flush received buffer data - */ -#ifdef VAC - if (vac) { - addr_t dp; - - KB_DATASTART(m, dp, addr_t); - vac_pageflush(dp); - } -#endif - } - - /* - * Make sure we've got a non-null PDU - */ - if (mhead == NULL) { - goto free_ent; - } - - /* - * We only support user data PDUs (for now) - */ - if (hdr & ATM_HDR_SET_PT(ATM_PT_NONUSER)) { - KB_FREEALL(mhead); - goto free_ent; - } - - /* - * Toss the data if there's no VCC - */ - if (fvp == NULL) { - fup->fu_stats->st_drv.drv_rv_novcc++; - KB_FREEALL(mhead); - goto free_ent; - } - -#ifdef DIAGNOSTIC - if (atm_dev_print) - atm_dev_pdu_print((Cmn_unit *)fup, (Cmn_vcc *)fvp, - mhead, "fore_recv"); -#endif - - /* - * Make sure we have our queueing headroom at the front - * of the buffer chain - */ - if (type0 != BHT_S1_SMALL) { - - /* - * Small buffers already have headroom built-in, but - * if CP had to use a large buffer for the first - * buffer, then we have to allocate a buffer here to - * contain the headroom. - */ - fup->fu_stats->st_drv.drv_rv_nosbf++; - - KB_ALLOCPKT(m, BUF1_SM_SIZE, KB_F_NOWAIT, KB_T_DATA); - if (m == NULL) { - fup->fu_stats->st_drv.drv_rv_nomb++; - KB_FREEALL(mhead); - goto free_ent; - } - - /* - * Put new buffer at head of PDU chain - */ - KB_LINKHEAD(m, mhead); - KB_LEN(m) = 0; - KB_HEADSET(m, BUF1_SM_DOFF); - mhead = m; - } - - /* - * It looks like we've got a valid PDU - count it quick!! - */ - mhead->m_pkthdr.rcvif = NULL; - mhead->m_pkthdr.csum_flags = 0; - SLIST_INIT(&mhead->m_pkthdr.tags); - KB_PLENSET(mhead, pdulen); - fup->fu_pif.pif_ipdus++; - fup->fu_pif.pif_ibytes += pdulen; - vcp = fvp->fv_connvc->cvc_vcc; - vcp->vc_ipdus++; - vcp->vc_ibytes += pdulen; - if (vcp->vc_nif) { - vcp->vc_nif->nif_ibytes += pdulen; - ANIF2IFP(vcp->vc_nif)->if_ipackets++; -#if (defined(BSD) && (BSD >= 199103)) - ANIF2IFP(vcp->vc_nif)->if_ibytes += pdulen; -#endif - } - - /* - * The STACK_CALL needs to happen at splnet() in order - * for the stack sequence processing to work. Schedule an - * interrupt queue callback at splnet() since we are - * currently at device level. - */ - - /* - * Prepend callback function pointer and token value to buffer. - * We have already guaranteed that the space is available - * in the first buffer. - * Don't count this extra fields in m_pkthdr.len (XXX) - */ - mhead->m_data -= sizeof(atm_intr_func_t) + sizeof(void *); - mhead->m_len += sizeof(atm_intr_func_t) + sizeof(void *); - cp = mtod(mhead, caddr_t); - *((atm_intr_func_t *)cp) = fore_recv_stack; - cp += sizeof(atm_intr_func_t); - *((void **)cp) = (void *)fvp; - - /* - * Schedule callback - */ - if (netisr_queue(NETISR_ATM, mhead)) { /* (0) on success. */ - fup->fu_stats->st_drv.drv_rv_ifull++; - goto free_ent; - } - -free_ent: - /* - * Mark this entry free for use and bump head pointer - * to the next entry in the queue - */ - *hrp->hrq_status = QSTAT_FREE; - hrp->hrq_cpelem->cq_descr = - (CP_dma) CP_WRITE((u_long)hrp->hrq_descr_dma); - fup->fu_recv_head = hrp->hrq_next; - } - - /* - * Nearly all of the interrupts generated by the CP will be due - * to PDU reception. However, we may receive an interrupt before - * the CP has completed the status word DMA to host memory. Thus, - * if we haven't processed any PDUs during this interrupt, we will - * wait a bit for completed work on the receive queue, rather than - * having to field an extra interrupt very soon. - */ - if (hrp == NULL) { - if (++retries <= FORE_RECV_RETRY) { - DELAY(FORE_RECV_DELAY); - goto retry; - } - } - - return; -} - - -/* - * Pass Incoming PDU up Stack - * - * This function is called via the core ATM interrupt queue callback - * set in fore_recv_drain(). It will pass the supplied incoming - * PDU up the incoming VCC's stack. - * - * Called at splnet. - * - * Arguments: - * tok token to identify stack instantiation - * m pointer to incoming PDU buffer chain - * - * Returns: - * none - */ -static void -fore_recv_stack(tok, m) - void *tok; - KBuffer *m; -{ - Fore_vcc *fvp = (Fore_vcc *)tok; - int err; - - /* - * Send the data up the stack - */ - STACK_CALL(CPCS_UNITDATA_SIG, fvp->fv_upper, - fvp->fv_toku, fvp->fv_connvc, (intptr_t)m, 0, err); - if (err) - KB_FREEALL(m); - - return; -} - - -/* - * Free Receive Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_recv_free(fup) - Fore_unit *fup; -{ - /* - * We'll just let fore_buf_free() take care of freeing any - * buffers sitting on the receive queue (which are also still - * on the fu_*_bq queue). - */ - if (fup->fu_flags & CUF_INITED) { - } - - /* - * Free the status words - */ - if (fup->fu_recv_stat) { - atm_dev_free((volatile void *)fup->fu_recv_stat); - fup->fu_recv_stat = NULL; - fup->fu_recv_statd = 0; - } - - /* - * Free the receive descriptors - */ - if (fup->fu_recv_desc) { - atm_dev_free(fup->fu_recv_desc); - fup->fu_recv_desc = NULL; - fup->fu_recv_descd = 0; - } - - return; -} - Property changes on: head/sys/dev/hfa/fore_receive.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_slave.h =================================================================== --- head/sys/dev/hfa/fore_slave.h (revision 179307) +++ head/sys/dev/hfa/fore_slave.h (nonexistent) @@ -1,190 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Slave Interface definitions - * - */ - -#ifndef _FORE_SLAVE_H -#define _FORE_SLAVE_H - -/* - * This file contains the (mostly hardware) definitions for each of the - * supported 200-series slave interfaces. - */ - - -/* - * Structure defining the supported FORE 200-series interfaces - */ -struct fore_device { - char *fd_name; /* Device name (from PROM) */ - Atm_device fd_devtyp; /* Device type */ -}; -typedef struct fore_device Fore_device; - - - -/* - * Common definitions - * ------------------ - */ -#define MON960_BASE 0x400 /* Address offset of Mon960 */ -#define AALI_BASE 0x4d40 /* Address offset of Aali */ - -typedef volatile unsigned int Fore_reg; /* Slave control register */ -typedef volatile unsigned char Fore_mem; /* Slave memory */ - - -/* - * SBA-200E SBus Slave Interface - * ----------------------------- - */ - -#define SBA200E_PROM_NAME "FORE,sba-200e" - -/* - * SBA-200E Host Control Register (HCR) - */ -#define SBA200E_READ_BITS 0x1ff /* Valid read data bits */ -#define SBA200E_WRITE_BITS 0x01f /* Valid write data bits */ -#define SBA200E_STICKY_BITS 0x013 /* Sticky data bits */ - -/* Read access */ -#define SBA200E_SBUS_INTR_RD 0x100 /* State of SBus interrupt */ -#define SBA200E_TEST_MODE 0x080 /* Device is in test-mode */ -#define SBA200E_IFIFO_FULL 0x040 /* Input FIFO almost full (when 0) */ -#define SBA200E_ESP_HOLD_RD 0x020 /* State of ESP bus hold */ -#define SBA200E_SBUS_ENA_RD 0x010 /* State of SBus interrupt enable */ -#define SBA200E_OFIFO_FULL 0x008 /* Output FIFO almost full */ -#define SBA200E_SELFTEST_FAIL 0x004 /* i960 self-test failed (when 0) */ -#define SBA200E_HOLD_LOCK_RD 0x002 /* State of i960 hold lock signal */ -#define SBA200E_RESET_RD 0x001 /* State of board reset signal */ - -/* Write access - bit set (clear) */ -#define SBA200E_SBUS_ENA 0x010 /* Enable (disable) SBus interrupts */ -#define SBA200E_CLR_SBUS_INTR 0x008 /* Clear SBus interrupt */ -#define SBA200E_I960_INTR 0x004 /* Issue interrupt to i960 */ -#define SBA200E_HOLD_LOCK 0x002 /* Set (clear) i960 hold lock signal */ -#define SBA200E_RESET 0x001 /* Set (clear) board reset signal */ - -#define SBA200E_HCR_INIT(hcr,bits) \ - ((hcr) = (SBA200E_WRITE_BITS & (bits))) -#define SBA200E_HCR_SET(hcr,bits) \ - ((hcr) = (((hcr) & SBA200E_STICKY_BITS) | (bits))) -#define SBA200E_HCR_CLR(hcr,bits) \ - ((hcr) = ((hcr) & (SBA200E_STICKY_BITS ^ (bits)))) - - - -/* - * SBA-200 SBus Slave Interface - * ---------------------------- - */ - -#define SBA200_PROM_NAME "FORE,sba-200" - -/* - * SBA-200 Board Control Register (BCR) - */ -/* Write access - bit set */ -#define SBA200_CLR_SBUS_INTR 0x04 /* Clear SBus interrupt */ -#define SBA200_RESET 0x01 /* Assert board reset signal */ - -/* Write access - bit clear */ -#define SBA200_RESET_CLR 0x00 /* Clear board reset signal */ - - - -/* - * PCA-200E PCI Bus Slave Interface - * -------------------------------- - */ - -/* - * PCI Identifiers - */ -#define FORE_VENDOR_ID 0x1127 - -/* - * PCA-200E PCI Configuration Space - */ -#define PCA200E_PCI_MEMBASE 0x10 /* Memory base address */ -#define PCA200E_PCI_MCTL 0x40 /* Master control */ - -/* - * PCA-200E Address Space - */ -#define PCA200E_RAM_SIZE 0x100000 -#define PCA200E_HCR_OFFSET 0x100000 -#define PCA200E_IMASK_OFFSET 0x100004 -#define PCA200E_PSR_OFFSET 0x100008 -#define PCA200E_MMAP_SIZE 0x10000c - -/* - * PCA-200E Master Control - */ -#define PCA200E_MCTL_SWAP 0x4000 /* Convert Slave endianess */ - -/* - * PCA-200E Host Control Register (HCR) - */ -#define PCA200E_READ_BITS 0x0ff /* Valid read data bits */ -#define PCA200E_WRITE_BITS 0x01f /* Valid write data bits */ -#define PCA200E_STICKY_BITS 0x000 /* Sticky data bits */ - -/* Read access */ -#define PCA200E_TEST_MODE 0x080 /* Device is in test-mode */ -#define PCA200E_IFIFO_FULL 0x040 /* Input FIFO almost full */ -#define PCA200E_ESP_HOLD_RD 0x020 /* State of ESP hold bus */ -#define PCA200E_OFIFO_FULL 0x010 /* Output FIFO almost full */ -#define PCA200E_HOLD_ACK 0x008 /* State of Hold Ack */ -#define PCA200E_SELFTEST_FAIL 0x004 /* i960 self-test failed */ -#define PCA200E_HOLD_LOCK_RD 0x002 /* State of i960 hold lock signal */ -#define PCA200E_RESET_BD 0x001 /* State of board reset signal */ - -/* Write access */ -#define PCA200E_CLR_HBUS_INT 0x010 /* Clear host bus interrupt */ -#define PCA200E_I960_INTRA 0x008 /* Set slave interrupt A */ -#define PCA200E_I960_INTRB 0x004 /* Set slave interrupt B */ -#define PCA200E_HOLD_LOCK 0x002 /* Set (clear) i960 hold lock signal */ -#define PCA200E_RESET 0x001 /* Set (clear) board reset signal */ - -#define PCA200E_HCR_INIT(hcr,bits) \ - ((hcr) = (PCA200E_WRITE_BITS & (bits))) -#define PCA200E_HCR_SET(hcr,bits) \ - ((hcr) = (bits)) -#define PCA200E_HCR_CLR(hcr,bits) \ - ((hcr) = 0) - -#endif /* _FORE_SLAVE_H */ Property changes on: head/sys/dev/hfa/fore_slave.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_stats.c =================================================================== --- head/sys/dev/hfa/fore_stats.c (revision 179307) +++ head/sys/dev/hfa/fore_stats.c (nonexistent) @@ -1,184 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Device statistics routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Get device statistics from CP - * - * This function will issue a GET_STATS command to the CP in order to - * initiate the DMA transfer of the CP's statistics structure to the host. - * We will then sleep pending command completion. This must only be called - * from the ioctl system call handler. - * - * Called at splnet. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * 0 stats retrieval successful - * errno stats retrieval failed - reason indicated - * - */ -int -fore_get_stats(fup) - Fore_unit *fup; -{ - H_cmd_queue *hcp; - Cmd_queue *cqp; - int s, sst; - - ATM_DEBUG1("fore_get_stats: fup=%p\n", fup); - - /* - * Make sure device has been initialized - */ - if ((fup->fu_flags & CUF_INITED) == 0) { - return (EIO); - } - - /* - * If someone has already initiated a stats request, we'll - * just wait for that one to complete - */ - s = splimp(); - if (fup->fu_flags & FUF_STATCMD) { - -#if (defined(BSD) && (BSD >= 199103)) - sst = tsleep((caddr_t)&fup->fu_stats, PWAIT|PCATCH, "fore", 0); -#else - sst = sleep((caddr_t)&fup->fu_stats, PWAIT|PCATCH); - if (sst != 0) - sst = EINTR; -#endif - (void) splx(s); - return (sst ? sst : fup->fu_stats_ret); - } - - /* - * Limit stats gathering to once a second or so - */ - if (time_second == fup->fu_stats_time) { - (void) splx(s); - return (0); - } else - fup->fu_stats_time = time_second; - - /* - * Queue command at end of command queue - */ - hcp = fup->fu_cmd_tail; - if ((*hcp->hcq_status) & QSTAT_FREE) { - vm_paddr_t dma; - - /* - * Queue entry available, so set our view of things up - */ - hcp->hcq_code = CMD_GET_STATS; - hcp->hcq_arg = NULL; - fup->fu_cmd_tail = hcp->hcq_next; - - /* - * Now set the CP-resident queue entry - the CP will grab - * the command when the op-code is set. - */ - cqp = hcp->hcq_cpelem; - (*hcp->hcq_status) = QSTAT_PENDING; - - dma = vtophys(fup->fu_stats); - if (dma == 0) { - fup->fu_stats->st_drv.drv_cm_nodma++; - (void) splx(s); - return (EIO); - } - fup->fu_statsd = dma; - cqp->cmdq_stats.stats_buffer = (CP_dma) CP_WRITE(dma); - - fup->fu_flags |= FUF_STATCMD; - cqp->cmdq_stats.stats_cmd = - CP_WRITE(CMD_GET_STATS | CMD_INTR_REQ); - - /* - * Now wait for command to finish - */ -#if (defined(BSD) && (BSD >= 199103)) - sst = tsleep((caddr_t)&fup->fu_stats, PWAIT|PCATCH, "fore", 0); -#else - sst = sleep((caddr_t)&fup->fu_stats, PWAIT|PCATCH); - if (sst != 0) - sst = EINTR; -#endif - (void) splx(s); - return (sst ? sst : fup->fu_stats_ret); - - } else { - /* - * Command queue full - */ - fup->fu_stats->st_drv.drv_cm_full++; - (void) splx(s); - return (EIO); - } -} - Property changes on: head/sys/dev/hfa/fore_stats.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_stats.h =================================================================== --- head/sys/dev/hfa/fore_stats.h (revision 179307) +++ head/sys/dev/hfa/fore_stats.h (nonexistent) @@ -1,83 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Driver statistics definitions - * - */ - -#ifndef _FORE_STATS_H -#define _FORE_STATS_H - - -/* - * Fore Driver Statistics - */ -struct Stats_driver { - u_long drv_xm_notact; /* PDU drops out - VCC not active */ - u_long drv_xm_full; /* Xmit queue full */ - u_long drv_xm_maxpdu; /* PDU drops out - max segment/size */ - u_long drv_xm_segnoal; /* Non-aligned segments */ - u_long drv_xm_seglen; /* Padded length segments */ - u_long drv_xm_segdma; /* PDU drops out - no dma address */ - u_long drv_rv_novcc; /* PDU drops in - no VCC */ - u_long drv_rv_nosbf; /* No small buffers */ - u_long drv_rv_nomb; /* PDU drops in - no buffer */ - u_long drv_rv_ifull; /* PDU drops in - intr queue full */ - u_long drv_bf_segdma; /* Buffer supply - no dma address */ - u_long drv_cm_full; /* Command queue full */ - u_long drv_cm_nodma; /* Command failed - no dma address */ -}; -typedef struct Stats_driver Stats_driver; - - -/* - * Fore Device Statistics - * - * This structure is used by pass all statistics (including CP maintained - * and driver maintained) data to user space (atm command). - */ -struct fore_stats { - Fore_cp_stats st_cpstat; /* CP stats */ - Stats_driver st_drv; /* Driver maintained stats */ -}; -typedef struct fore_stats Fore_stats; - -#define st_taxi st_cpstat.st_cp_taxi -#define st_oc3 st_cpstat.st_cp_oc3 -#define st_atm st_cpstat.st_cp_atm -#define st_aal0 st_cpstat.st_cp_aal0 -#define st_aal4 st_cpstat.st_cp_aal4 -#define st_aal5 st_cpstat.st_cp_aal5 -#define st_misc st_cpstat.st_cp_misc - -#endif /* _FORE_STATS_H */ Property changes on: head/sys/dev/hfa/fore_stats.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_var.h =================================================================== --- head/sys/dev/hfa/fore_var.h (revision 179307) +++ head/sys/dev/hfa/fore_var.h (nonexistent) @@ -1,274 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Host protocol control blocks - * - */ - -#ifndef _FORE_VAR_H -#define _FORE_VAR_H - -/* - * Device VCC Entry - * - * Contains the common and Fore-specific information for each VCC - * which is opened through a Fore device. - */ -struct fore_vcc { - struct cmn_vcc fv_cmn; /* Common VCC stuff */ - Fore_aal fv_aal; /* CP version of AAL */ - uint32_t rate; /* Rate control (data/idle cell ratio) */ -}; -typedef struct fore_vcc Fore_vcc; - -#define fv_next fv_cmn.cv_next -#define fv_toku fv_cmn.cv_toku -#define fv_upper fv_cmn.cv_upper -#define fv_connvc fv_cmn.cv_connvc -#define fv_state fv_cmn.cv_state -#define fv_flags fv_cmn.cv_flags - -/* - * VCC Flags - */ -#define FVF_ACTCMD 0x01 /* Activate command issued */ - - -/* - * Host Transmit Queue Element - * - * Defines the host's view of the CP PDU Transmit Queue - */ -struct h_xmit_queue { - struct h_xmit_queue *hxq_next; /* Next element in queue */ - Xmit_queue *hxq_cpelem; /* CP queue element */ - Q_status *hxq_status; /* Element status word */ - Xmit_descr *hxq_descr; /* Element's transmit descriptor */ - vm_paddr_t hxq_descr_dma; /* Element's transmit descriptor */ - Fore_vcc *hxq_vcc; /* Data's VCC */ - KBuffer *hxq_buf; /* Data's buffer chain head */ - H_dma hxq_dma[XMIT_MAX_SEGS]; /* DMA addresses for segments */ -}; -typedef struct h_xmit_queue H_xmit_queue; - - - -/* - * Host Receive Queue Element - * - * Defines the host's view of the CP PDU Receive Queue - */ -struct h_recv_queue { - struct h_recv_queue *hrq_next; /* Next element in queue */ - Recv_queue *hrq_cpelem; /* CP queue element */ - Q_status *hrq_status; /* Element status word */ - Recv_descr *hrq_descr; /* Element's receive descriptor */ - vm_paddr_t hrq_descr_dma; /* Element's receive descriptor */ -}; -typedef struct h_recv_queue H_recv_queue; - - - -/* - * Host Buffer Supply Queue Element - * - * Defines the host's view of the CP Buffer Supply Queue - */ -struct h_buf_queue { - struct h_buf_queue *hbq_next; /* Next element in queue */ - Buf_queue *hbq_cpelem; /* CP queue element */ - Q_status *hbq_status; /* Element status word */ - Buf_descr *hbq_descr; /* Element's buffer descriptor array */ - vm_paddr_t hbq_descr_dma; /* Element's buffer descriptor array */ -}; -typedef struct h_buf_queue H_buf_queue; - - - -/* - * Host Command Queue Element - * - * Defines the host's view of the CP Command Queue - */ -struct h_cmd_queue { - struct h_cmd_queue *hcq_next; /* Next element in queue */ - Cmd_queue *hcq_cpelem; /* CP queue element */ - Q_status *hcq_status; /* Element status word */ - Cmd_code hcq_code; /* Command code */ - void *hcq_arg; /* Command-specific argument */ -}; -typedef struct h_cmd_queue H_cmd_queue; - - - -/* - * Host Buffer Handle - * - * For each buffer supplied to the CP, there will be one of these structures - * embedded into the non-data portion of the buffer. This will allow us to - * track which buffers are currently "controlled" by the CP. The address of - * this structure will supplied to/returned from the CP as the buffer handle. - */ -struct buf_handle { - Qelem_t bh_qelem; /* Queuing element */ - u_int bh_type; /* Buffer type (see below) */ - H_dma bh_dma; /* Buffer DMA address */ -}; -typedef struct buf_handle Buf_handle; -#define SIZEOF_Buf_handle 16 - -/* - * Buffer Types - */ -#define BHT_S1_SMALL 1 /* Buffer strategy 1, small */ -#define BHT_S1_LARGE 2 /* Buffer strategy 1, large */ -#define BHT_S2_SMALL 3 /* Buffer strategy 2, small */ -#define BHT_S2_LARGE 4 /* Buffer strategy 2, large */ - - - -/* - * Device Unit Structure - * - * Contains all the information for a single device (adapter). - */ -struct fore_unit { - Cmn_unit fu_cmn; /* Common unit stuff */ - Fore_reg *fu_ctlreg; /* Device control register */ - Fore_reg *fu_imask; /* Interrupt mask register */ - Fore_reg *fu_psr; /* PCI specific register */ -#ifdef COMPAT_OLDPCI - pcici_t fu_pcitag; /* PCI tag */ -#endif - Fore_mem *fu_ram; /* Device RAM */ - u_int fu_ramsize; /* Size of device RAM */ - Mon960 *fu_mon; /* Monitor program interface */ - Aali *fu_aali; /* Microcode program interface */ - u_int fu_timer; /* Watchdog timer value */ - - /* Transmit Queue */ - H_xmit_queue fu_xmit_q[XMIT_QUELEN]; /* Host queue */ - H_xmit_queue *fu_xmit_head; /* Queue head */ - H_xmit_queue *fu_xmit_tail; /* Queue tail */ - Q_status *fu_xmit_stat; /* Status array (host) */ - vm_paddr_t fu_xmit_statd; /* Status array (DMA) */ - - /* Receive Queue */ - H_recv_queue fu_recv_q[RECV_QUELEN]; /* Host queue */ - H_recv_queue *fu_recv_head; /* Queue head */ - Q_status *fu_recv_stat; /* Status array (host) */ - vm_paddr_t fu_recv_statd; /* Status array (DMA) */ - Recv_descr *fu_recv_desc; /* Descriptor array (host) */ - vm_paddr_t fu_recv_descd; /* Descriptor array (DMA) */ - - /* Buffer Supply Queue - Strategy 1 Small */ - H_buf_queue fu_buf1s_q[BUF1_SM_QUELEN]; /* Host queue */ - H_buf_queue *fu_buf1s_head; /* Queue head */ - H_buf_queue *fu_buf1s_tail; /* Queue tail */ - Q_status *fu_buf1s_stat; /* Status array (host) */ - vm_paddr_t fu_buf1s_statd;/* Status array (DMA) */ - Buf_descr *fu_buf1s_desc; /* Descriptor array (host) */ - vm_paddr_t fu_buf1s_descd;/* Descriptor array (DMA) */ - Queue_t fu_buf1s_bq; /* Queue of supplied buffers */ - u_int fu_buf1s_cnt; /* Count of supplied buffers */ - - /* Buffer Supply Queue - Strategy 1 Large */ - H_buf_queue fu_buf1l_q[BUF1_LG_QUELEN]; /* Host queue */ - H_buf_queue *fu_buf1l_head; /* Queue head */ - H_buf_queue *fu_buf1l_tail; /* Queue tail */ - Q_status *fu_buf1l_stat; /* Status array (host) */ - vm_paddr_t fu_buf1l_statd;/* Status array (DMA) */ - Buf_descr *fu_buf1l_desc; /* Descriptor array (host) */ - vm_paddr_t fu_buf1l_descd;/* Descriptor array (DMA) */ - Queue_t fu_buf1l_bq; /* Queue of supplied buffers */ - u_int fu_buf1l_cnt; /* Count of supplied buffers */ - - /* Command Queue */ - H_cmd_queue fu_cmd_q[CMD_QUELEN]; /* Host queue */ - H_cmd_queue *fu_cmd_head; /* Queue head */ - H_cmd_queue *fu_cmd_tail; /* Queue tail */ - Q_status *fu_cmd_stat; /* Status array (host) */ - vm_paddr_t fu_cmd_statd; /* Status array (DMA) */ - - Fore_stats *fu_stats; /* Device statistics buffer */ - vm_paddr_t fu_statsd; /* Device statistics buffer (DMA) */ - time_t fu_stats_time; /* Last stats request timestamp */ - int fu_stats_ret; /* Stats request return code */ - Fore_prom *fu_prom; /* Device PROM buffer */ - vm_paddr_t fu_promd; /* Device PROM buffer (DMA) */ - struct callout_handle fu_thandle; /* Timer handle */ - int fu_ft4; /* Running ForeThought 4 firmware */ - - /* shaping enable */ - u_int fu_shape; - u_int fu_num_shaped; /* number of shaped VCCs */ -}; -typedef struct fore_unit Fore_unit; - -#define fu_pif fu_cmn.cu_pif -#define fu_unit fu_cmn.cu_unit -#define fu_flags fu_cmn.cu_flags -#define fu_mtu fu_cmn.cu_mtu -#define fu_open_vcc fu_cmn.cu_open_vcc -#define fu_vcc fu_cmn.cu_vcc -#define fu_intrpri fu_cmn.cu_intrpri -#define fu_savepri fu_cmn.cu_savepri -#define fu_vcc_zone fu_cmn.cu_vcc_zone -#define fu_nif_zone fu_cmn.cu_nif_zone -#define fu_ioctl fu_cmn.cu_ioctl -#define fu_instvcc fu_cmn.cu_instvcc -#define fu_openvcc fu_cmn.cu_openvcc -#define fu_closevcc fu_cmn.cu_closevcc -#define fu_output fu_cmn.cu_output -#define fu_config fu_cmn.cu_config -#define fu_softc fu_cmn.cu_softc - -/* - * Device flags (in addition to CUF_* flags) - */ -#define FUF_STATCMD 0x80 /* Statistics request in progress */ - -/* - * Shaping values - */ -#define FUS_NO_SHAPING 0 -#define FUS_SHAPE_ONE 1 -#define FUS_SHAPE_ALL 2 - -/* - * Macros to access CP memory - */ -#define CP_READ(x) ntohl((u_long)(x)) -#define CP_WRITE(x) htonl((u_long)(x)) - -#endif /* _FORE_VAR_H */ Property changes on: head/sys/dev/hfa/fore_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_output.c =================================================================== --- head/sys/dev/hfa/fore_output.c (revision 179307) +++ head/sys/dev/hfa/fore_output.c (nonexistent) @@ -1,479 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * PDU output processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local functions - */ -static KBuffer * fore_xmit_segment(Fore_unit *, KBuffer *, - H_xmit_queue *, int *, int *); -static void fore_seg_dma_free(H_xmit_queue *, KBuffer *, int); - - -/* - * Output a PDU - * - * This function is called via the common driver code after receiving a - * stack *_DATA* command. The common code has already validated most of - * the request so we just need to check a few more Fore-specific details. - * Then we just build a transmit descriptor request for the PDU and issue - * the command to the CP. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * m pointer to output PDU buffer chain head - * - * Returns: - * none - * - */ -void -fore_output(cup, cvp, m) - Cmn_unit *cup; - Cmn_vcc *cvp; - KBuffer *m; -{ - Fore_unit *fup = (Fore_unit *)cup; - Fore_vcc *fvp = (Fore_vcc *)cvp; - struct vccb *vcp; - H_xmit_queue *hxp; - Xmit_queue *cqp; - Xmit_descr *xdp; - int retry, nsegs, pdulen; - int s; - -#ifdef DIAGNOSTIC - if (atm_dev_print) - atm_dev_pdu_print(cup, cvp, m, "fore_output"); -#endif - - vcp = fvp->fv_connvc->cvc_vcc; - - /* - * If we're still waiting for activation to finish, delay for - * a little while before we toss the PDU - */ - if (fvp->fv_state == CVS_INITED) { - retry = 3; - while (retry-- && (fvp->fv_state == CVS_INITED)) - DELAY(1000); - if (fvp->fv_state != CVS_ACTIVE) { - /* - * Activation still hasn't finished, oh well.... - */ - fup->fu_stats->st_drv.drv_xm_notact++; - vcp->vc_oerrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_oerrors++; - KB_FREEALL(m); - return; - } - } - - /* - * Queue PDU at end of transmit queue - * - * If queue is full we'll delay a bit before tossing the PDU - */ - s = splnet(); - hxp = fup->fu_xmit_tail; - if (!((*hxp->hxq_status) & QSTAT_FREE)) { - - fup->fu_stats->st_drv.drv_xm_full++; - retry = 3; - do { - DELAY(1000); - - DEVICE_LOCK((Cmn_unit *)fup); - fore_xmit_drain(fup); - DEVICE_UNLOCK((Cmn_unit *)fup); - - } while (--retry && (!((*hxp->hxq_status) & QSTAT_FREE))); - - if (!((*hxp->hxq_status) & QSTAT_FREE)) { - /* - * Queue is still full, bye-bye PDU - */ - fup->fu_pif.pif_oerrors++; - vcp->vc_oerrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_oerrors++; - KB_FREEALL(m); - (void) splx(s); - return; - } - } - - /* - * We've got a free transmit queue entry - */ - - /* - * Now build the transmit segment descriptors for this PDU - */ - m = fore_xmit_segment(fup, m, hxp, &nsegs, &pdulen); - if (m == NULL) { - /* - * The build failed, buffer chain has been freed - */ - vcp->vc_oerrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_oerrors++; - (void) splx(s); - return; - } - - /* - * Set up the descriptor header - */ - xdp = hxp->hxq_descr; - xdp->xd_cell_hdr = ATM_HDR_SET(vcp->vc_vpi, vcp->vc_vci, 0, 0); - xdp->xd_spec = XDS_SET_SPEC(0, fvp->fv_aal, nsegs, pdulen); - xdp->xd_rate = fvp->rate; - - /* - * Everything is ready to go, so officially claim the host queue - * entry and setup the CP-resident queue entry. The CP will grab - * the PDU when the descriptor pointer is set. - */ - fup->fu_xmit_tail = hxp->hxq_next; - hxp->hxq_buf = m; - hxp->hxq_vcc = fvp; - (*hxp->hxq_status) = QSTAT_PENDING; - cqp = hxp->hxq_cpelem; - cqp->cq_descr = (CP_dma) - CP_WRITE((u_long)hxp->hxq_descr_dma | XMIT_SEGS_TO_BLKS(nsegs)); - - (void) splx(s); - - /* - * See if there are any completed queue entries - */ - DEVICE_LOCK((Cmn_unit *)fup); - fore_xmit_drain(fup); - DEVICE_UNLOCK((Cmn_unit *)fup); - - return; -} - - -/* - * Build Transmit Segment Descriptors - * - * This function will take a supplied buffer chain of data to be transmitted - * and build the transmit segment descriptors for the data. This will include - * the dreaded operation of ensuring that the data for each transmit segment - * is full-word aligned and (except for the last segment) is an integral number - * of words in length. If the data isn't already aligned and sized as - * required, then the data must be shifted (copied) into place - a sure - * performance killer. Note that we rely on the fact that all buffer data - * areas are allocated with (at least) full-word alignments/lengths. - * - * If any errors are encountered, the buffer chain will be freed. - * - * Arguments: - * fup pointer to device unit - * m pointer to output PDU buffer chain head - * hxp pointer to host transmit queue entry - * segp pointer to return the number of transmit segments - * lenp pointer to return the pdu length - * - * Returns: - * m build successful, pointer to (possibly new) head of - * output PDU buffer chain - * NULL build failed, buffer chain freed - * - */ -static KBuffer * -fore_xmit_segment(fup, m, hxp, segp, lenp) - Fore_unit *fup; - KBuffer *m; - H_xmit_queue *hxp; - int *segp; - int *lenp; -{ - Xmit_descr *xdp = hxp->hxq_descr; - Xmit_seg_descr *xsp; - H_dma *sdmap; - KBuffer *m0, *m1, *mprev; - caddr_t cp, bfr; - vm_paddr_t dma; - int pdulen, nsegs, len, align; - int compressed = 0; - - m0 = m; - -retry: - xsp = xdp->xd_seg; - sdmap = hxp->hxq_dma; - mprev = NULL; - pdulen = 0; - nsegs = 0; - - /* - * Loop thru each buffer in the chain, performing the necessary - * data positioning and then building a segment descriptor for - * that data. - */ - while (m) { - /* - * Get rid of any zero-length buffers - */ - if (KB_LEN(m) == 0) { - if (mprev) { - KB_UNLINK(m, mprev, m1); - } else { - KB_UNLINKHEAD(m, m1); - m0 = m1; - } - m = m1; - continue; - } - - /* - * Make sure we don't try to use too many segments - */ - if (nsegs >= XMIT_MAX_SEGS) { - /* - * First, free already allocated DMA addresses - */ - fore_seg_dma_free(hxp, m0, nsegs); - - /* - * Try to compress buffer chain (but only once) - */ - if (compressed) { - KB_FREEALL(m0); - return (NULL); - } - - fup->fu_stats->st_drv.drv_xm_maxpdu++; - - m = atm_dev_compress(m0); - if (m == NULL) { - return (NULL); - } - - /* - * Build segment descriptors for compressed chain - */ - m0 = m; - compressed = 1; - goto retry; - } - - /* - * Get start of data onto full-word alignment - */ - KB_DATASTART(m, cp, caddr_t); - if ((align = ((uintptr_t)cp) & (XMIT_SEG_ALIGN - 1)) != 0) { - /* - * Gotta slide the data up - */ - fup->fu_stats->st_drv.drv_xm_segnoal++; - bfr = cp - align; - bcopy(cp, bfr, KB_LEN(m)); - KB_HEADMOVE(m, -align); - } else { - /* - * Data already aligned - */ - bfr = cp; - } - - /* - * Now work on getting the data length correct - */ - len = KB_LEN(m); - while ((align = (len & (XMIT_SEG_ALIGN - 1))) && - (m1 = KB_NEXT(m))) { - - /* - * Have to move some data from following buffer(s) - * to word-fill this buffer - */ - int ncopy = MIN(XMIT_SEG_ALIGN - align, KB_LEN(m1)); - - if (ncopy) { - /* - * Move data to current buffer - */ - caddr_t dest; - - fup->fu_stats->st_drv.drv_xm_seglen++; - KB_DATASTART(m1, cp, caddr_t); - dest = bfr + len; - KB_HEADADJ(m1, -ncopy); - KB_TAILADJ(m, ncopy); - len += ncopy; - while (ncopy--) { - *dest++ = *cp++; - } - } - - /* - * If we've drained the buffer, free it - */ - if (KB_LEN(m1) == 0) { - KBuffer *m2; - - KB_UNLINK(m1, m, m2); - } - } - - /* - * Finally, build the segment descriptor - */ - - /* - * Round last segment to fullword length (if needed) - */ - if (len & (XMIT_SEG_ALIGN - 1)) - xsp->xsd_len = KB_LEN(m) = - (len + XMIT_SEG_ALIGN) & ~(XMIT_SEG_ALIGN - 1); - else - xsp->xsd_len = KB_LEN(m) = len; - - /* - * Get a DMA address for the data - */ - dma = vtophys(bfr); - if (dma == 0) { - fup->fu_stats->st_drv.drv_xm_segdma++; - fore_seg_dma_free(hxp, m0, nsegs); - KB_FREEALL(m0); - return (NULL); - } - - /* - * Now we're really ready to call it a segment - */ - *sdmap++ = xsp->xsd_buffer = (H_dma) dma; - - /* - * Bump counters and get ready for next buffer - */ - pdulen += len; - nsegs++; - xsp++; - mprev = m; - m = KB_NEXT(m); - } - - /* - * Validate PDU length - */ - if (pdulen > XMIT_MAX_PDULEN) { - fup->fu_stats->st_drv.drv_xm_maxpdu++; - fore_seg_dma_free(hxp, m0, nsegs); - KB_FREEALL(m0); - return (NULL); - } - - /* - * Return the good news to the caller - */ - *segp = nsegs; - *lenp = pdulen; - - return (m0); -} - - -/* - * Free Transmit Segment Queue DMA addresses - * - * Arguments: - * hxp pointer to host transmit queue entry - * m0 pointer to output PDU buffer chain head - * nsegs number of processed transmit segments - * - * Returns: - * none - * - */ -static void -fore_seg_dma_free(hxp, m0, nsegs) - H_xmit_queue *hxp; - KBuffer *m0; - int nsegs; -{ - KBuffer *m = m0; - H_dma *sdmap = hxp->hxq_dma; - caddr_t cp; - int i; - - for (i = 0; i < nsegs; i++) { - KB_DATASTART(m, cp, caddr_t); - m = KB_NEXT(m); - sdmap++; - } -} - Property changes on: head/sys/dev/hfa/fore_output.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/hfa_freebsd.c =================================================================== --- head/sys/dev/hfa/hfa_freebsd.c (revision 179307) +++ head/sys/dev/hfa/hfa_freebsd.c (nonexistent) @@ -1,466 +0,0 @@ -/*- - * Copyright (c) 2002 Matthew N. Dodd - * 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$ - */ - -/* - * - * =================================== - * 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. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -devclass_t hfa_devclass; - -static int hfa_modevent(module_t, int, void *); - -SYSCTL_DECL(_hw_atm); - -/* - * Sysctl handler for the traffic shaping option - */ -static int -hfa_sysctl_shape(SYSCTL_HANDLER_ARGS) -{ - struct hfa_softc *sc = arg1; - int error; - u_int new; - - error = SYSCTL_OUT(req, &sc->fup.fu_shape , sizeof(sc->fup.fu_shape)); - if (error != 0 || req->newptr == NULL) { - return (error); - } - - error = SYSCTL_IN(req, &new, sizeof(new)); - if (error != 0) { - return (error); - } - - if (new > FUS_SHAPE_ALL) { - return (EINVAL); - } - - sc->fup.fu_shape = new; - return (0); -} - -int -hfa_alloc (device_t dev) -{ - struct hfa_softc *sc; - int error; - - sc = (struct hfa_softc *)device_get_softc(dev); - error = 0; - - sc->mem = bus_alloc_resource_any(dev, sc->mem_type, &sc->mem_rid, - RF_ACTIVE); - if (sc->mem == NULL) { - device_printf(dev, "Unable to allocate memory resource.\n"); - error = ENXIO; - goto fail; - } - - sc->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->irq_rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->irq == NULL) { - device_printf(dev, "Unable to allocate interrupt resource.\n"); - error = ENXIO; - goto fail; - } - - /* - * Make the sysctl tree - */ - if ((sc->sysctl_tree = SYSCTL_ADD_NODE(&sc->sysctl_ctx, - SYSCTL_STATIC_CHILDREN(_hw_atm), OID_AUTO, - device_get_nameunit(dev), CTLFLAG_RW, 0, "")) == NULL) - goto fail; - - if (SYSCTL_ADD_PROC(&sc->sysctl_ctx, SYSCTL_CHILDREN(sc->sysctl_tree), - OID_AUTO, "shape", CTLFLAG_RW | CTLTYPE_UINT, sc, 0, - hfa_sysctl_shape, "IU", "traffic shaping") == NULL) - goto fail; - - mtx_init(&sc->mtx, device_get_nameunit(dev), "Interrupt lock", MTX_DEF|MTX_RECURSE); - -fail: - return (error); -} - -int -hfa_free (device_t dev) -{ - struct hfa_softc *sc; - - sc = (struct hfa_softc *)device_get_softc(dev); - - if (sc->mem) - bus_release_resource(dev, sc->mem_type, sc->mem_rid, sc->mem); - if (sc->irq_ih) - bus_teardown_intr(dev, sc->irq, sc->irq_ih); - if (sc->irq) - bus_release_resource(dev, SYS_RES_IRQ, sc->irq_rid, sc->irq); - - /* - * Destroy the mutex. - */ - if (mtx_initialized(&sc->mtx) != 0) - mtx_destroy(&sc->mtx); - - return (0); -} - -int -hfa_attach (device_t dev) -{ - struct hfa_softc *sc; - Fore_unit *fup; - int error; - int err_count; - - sc = (struct hfa_softc *)device_get_softc(dev); - fup = &sc->fup; - error = 0; - err_count = BOOT_LOOPS; - - /* - * Start initializing it - */ - fup->fu_unit = device_get_unit(dev); - fup->fu_mtu = FORE_IFF_MTU; - fup->fu_vcc_zone = fore_vcc_zone; - fup->fu_nif_zone = fore_nif_zone; - fup->fu_ioctl = fore_atm_ioctl; - fup->fu_instvcc = fore_instvcc; - fup->fu_openvcc = fore_openvcc; - fup->fu_closevcc = fore_closevcc; - fup->fu_output = fore_output; - fup->fu_softc = (void *)sc; - - callout_handle_init(&fup->fu_thandle); - - /* - * Poke the hardware - boot the CP and prepare it for downloading - */ - hfa_reset(dev); - - /* - * Wait for the monitor to perform self-test - */ - while (CP_READ(fup->fu_mon->mon_bstat) != BOOT_MONREADY) { - if (CP_READ(fup->fu_mon->mon_bstat) == BOOT_FAILTEST) { - device_printf(dev, "failed self-test\n"); - goto fail; - } else if ( --err_count == 0 ) { - device_printf(dev, "unable to boot - status=0x%lx\n", - (u_long)CP_READ(fup->fu_mon->mon_bstat)); - goto fail; - } - DELAY ( BOOT_DELAY ); - } - - /* - * Setup the adapter config info - at least as much as we can - */ - fup->fu_config.ac_vendor = VENDOR_FORE; - fup->fu_config.ac_vendapi = VENDAPI_FORE_1; - fup->fu_config.ac_media = MEDIA_OC3C; - fup->fu_pif.pif_pcr = ATM_PCR_OC3C; - - /* - * Save device ram info for user-level programs - */ - fup->fu_config.ac_ram = (long)fup->fu_ram; - fup->fu_config.ac_ramsize = fup->fu_ramsize; - - /* - * Set device capabilities - */ - fup->fu_pif.pif_maxvpi = FORE_MAX_VPI; - fup->fu_pif.pif_maxvci = FORE_MAX_VCI; - - /* - * Register this interface with ATM core services - */ - error = atm_physif_register((Cmn_unit *)fup, FORE_DEV_NAME, fore_services); - if (error) - goto fail; - - fore_units[device_get_unit(dev)] = fup; - fore_nunits++; - - /* - * Initialize the CP microcode program. - */ - fore_initialize(fup); - -fail: - return (error); -} - -int -hfa_detach (device_t dev) -{ - struct hfa_softc *sc; - Fore_unit *fup; - int error; - - sc = (struct hfa_softc *)device_get_softc(dev); - fup = &sc->fup; - error = 0; - - /* - * De-Register this interface with ATM core services - */ - error = atm_physif_deregister((Cmn_unit *)fup); - - /* - * Reset the board and return it to cold_start state. - * Hopefully, this will prevent use of resources as - * we're trying to free things up. - */ - hfa_reset(dev); - - /* - * Lock out all device interrupts - */ - DEVICE_LOCK((Cmn_unit *)fup); - - /* - * Remove any pending timeout()'s - */ - (void)untimeout((KTimeout_ret(*)(void *))fore_initialize, - (void *)fup, fup->fu_thandle); - - hfa_free(dev); - - DEVICE_UNLOCK((Cmn_unit *)fup); - - /* - * Free any Fore-specific device resources - */ - fore_interface_free(fup); - - return (error); -} - -void -hfa_intr (void * arg) -{ - struct hfa_softc *sc; - - sc = (struct hfa_softc *)arg; - - HFA_LOCK(sc); - fore_intr(&sc->fup); - HFA_UNLOCK(sc); - - return; -} - -void -hfa_reset (device_t dev) -{ - struct hfa_softc *sc; - Fore_unit *fup; - - sc = (struct hfa_softc *)device_get_softc(dev); - fup = &sc->fup; - HFA_LOCK(sc); - - /* - * Reset the board and return it to cold_start state - */ - if (fup->fu_mon) - fup->fu_mon->mon_bstat = CP_WRITE(BOOT_COLDSTART); - - if (fup->fu_ctlreg) { - - switch (fup->fu_config.ac_device) { - case DEV_FORE_ESA200E: - - break; - - case DEV_FORE_SBA200E: - /* - * Reset i960 by setting and clearing RESET - */ - SBA200E_HCR_INIT(*fup->fu_ctlreg, SBA200E_RESET); - SBA200E_HCR_CLR(*fup->fu_ctlreg, SBA200E_RESET); - break; - - case DEV_FORE_SBA200: - /* - * Reset i960 by setting and clearing RESET - * - * SBA200 will NOT reset if bit is OR'd in! - */ - *fup->fu_ctlreg = SBA200_RESET; - *fup->fu_ctlreg = SBA200_RESET_CLR; - break; - - case DEV_FORE_PCA200E: - /* - * Reset i960 by setting and clearing RESET - */ - PCA200E_HCR_INIT(*fup->fu_ctlreg, PCA200E_RESET); - DELAY(10000); - PCA200E_HCR_CLR(*fup->fu_ctlreg, PCA200E_RESET); - break; - default: - break; - } - } - - HFA_UNLOCK(sc); - return; -} - -static int -hfa_modevent (module_t mod, int type, void *data) -{ - int error; - - error = 0; - - switch (type) { - case MOD_LOAD: - /* - * Verify software version - */ - if (atm_version != ATM_VERSION) { - printf("hfa: version mismatch: fore=%d.%d kernel=%d.%d\n", - ATM_VERS_MAJ(ATM_VERSION), - ATM_VERS_MIN(ATM_VERSION), - ATM_VERS_MAJ(atm_version), - ATM_VERS_MIN(atm_version)); - error = EINVAL; - break; - } - - fore_nif_zone = uma_zcreate("fore nif", sizeof(struct atm_nif), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (fore_nif_zone == NULL) - panic("hfa_modevent:uma_zcreate nif"); - uma_zone_set_max(fore_nif_zone, 52); - - fore_vcc_zone = uma_zcreate("fore vcc", sizeof(Fore_vcc), NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (fore_vcc_zone == NULL) - panic("hfa_modevent: uma_zcreate vcc"); - uma_zone_set_max(fore_vcc_zone, 100); - - /* - * Start up watchdog timer - */ - atm_timeout(&fore_timer, ATM_HZ * FORE_TIME_TICK, fore_timeout); - - break; - case MOD_UNLOAD: - /* - * Stop watchdog timer - */ - atm_untimeout(&fore_timer); - - uma_zdestroy(fore_nif_zone); - uma_zdestroy(fore_vcc_zone); - - break; - default: - return (EOPNOTSUPP); - break; - } - - return (error); -} - -static moduledata_t hfa_moduledata = { - "hfa", - hfa_modevent, - NULL -}; -DECLARE_MODULE(hfa, hfa_moduledata, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -MODULE_VERSION(hfa, 1); Property changes on: head/sys/dev/hfa/hfa_freebsd.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/hfa_eisa.c =================================================================== --- head/sys/dev/hfa/hfa_eisa.c (revision 179307) +++ head/sys/dev/hfa/hfa_eisa.c (nonexistent) @@ -1,134 +0,0 @@ -/*- - * Copyright (c) 2002 Matthew N. Dodd - * 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. - * - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * - * =================================== - * 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. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -static int hfa_eisa_probe(device_t); -static int hfa_eisa_attach(device_t); - -static int -hfa_eisa_probe (device_t dev) -{ - - return (ENXIO); -} - -static int -hfa_eisa_attach (device_t dev) -{ - - return (ENXIO); -} - -static device_method_t hfa_eisa_methods[] = { - DEVMETHOD(device_probe, hfa_eisa_probe), - DEVMETHOD(device_attach, hfa_eisa_attach), - - DEVMETHOD(device_detach, hfa_detach), - - { 0, 0 } -}; - -static driver_t hfa_eisa_driver = { - "hfa", - hfa_eisa_methods, - sizeof(struct hfa_softc) -}; - -DRIVER_MODULE(hfa, eisa, hfa_eisa_driver, hfa_devclass, 0, 0); -MODULE_DEPEND(hfa, hfa, 1, 1, 1); -MODULE_DEPEND(hfa, eisa, 1, 1, 1); Property changes on: head/sys/dev/hfa/hfa_eisa.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_include.h =================================================================== --- head/sys/dev/hfa/fore_include.h (revision 179307) +++ head/sys/dev/hfa/fore_include.h (nonexistent) @@ -1,108 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Local driver include files and global declarations - * - */ - -#ifndef _FORE_INCLUDE_H -#define _FORE_INCLUDE_H - -/* - * Global function declarations - */ - /* fore_buffer.c */ -int fore_buf_allocate(Fore_unit *); -void fore_buf_initialize(Fore_unit *); -void fore_buf_supply(Fore_unit *); -void fore_buf_free(Fore_unit *); - - /* fore_command.c */ -int fore_cmd_allocate(Fore_unit *); -void fore_cmd_initialize(Fore_unit *); -void fore_cmd_drain(Fore_unit *); -void fore_cmd_free(Fore_unit *); - - /* fore_if.c */ -int fore_atm_ioctl(int, caddr_t, caddr_t); -void fore_interface_free(Fore_unit *); - - /* fore_init.c */ -void fore_initialize(Fore_unit *); -void fore_initialize_complete(Fore_unit *); - - /* fore_intr.c */ -void fore_intr(void *); -void fore_watchdog(Fore_unit *); - - /* fore_load.c */ - - /* fore_output.c */ -void fore_output(Cmn_unit *, Cmn_vcc *, KBuffer *); - - /* fore_receive.c */ -int fore_recv_allocate(Fore_unit *); -void fore_recv_initialize(Fore_unit *); -void fore_recv_drain(Fore_unit *); -void fore_recv_free(Fore_unit *); - - /* fore_stats.c */ -int fore_get_stats(Fore_unit *); - - /* fore_timer.c */ -void fore_timeout(struct atm_time *); - - /* fore_transmit.c */ -int fore_xmit_allocate(Fore_unit *); -void fore_xmit_initialize(Fore_unit *); -void fore_xmit_drain(Fore_unit *); -void fore_xmit_free(Fore_unit *); - - /* fore_vcm.c */ -int fore_instvcc(Cmn_unit *, Cmn_vcc *); -int fore_openvcc(Cmn_unit *, Cmn_vcc *); -int fore_closevcc(Cmn_unit *, Cmn_vcc *); - - -/* - * Global variable declarations - */ -extern Fore_device fore_devices[]; -extern Fore_unit *fore_units[]; -extern int fore_nunits; -extern struct stack_defn *fore_services; -extern uma_zone_t fore_nif_zone; -extern uma_zone_t fore_vcc_zone; -extern struct atm_time fore_timer; - -#endif /* _FORE_INCLUDE_H */ Property changes on: head/sys/dev/hfa/fore_include.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_command.c =================================================================== --- head/sys/dev/hfa/fore_command.c (revision 179307) +++ head/sys/dev/hfa/fore_command.c (nonexistent) @@ -1,466 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Command queue management - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - -/* - * Local variables - */ -static struct t_atm_cause fore_cause = { - T_ATM_ITU_CODING, - T_ATM_LOC_USER, - T_ATM_CAUSE_TEMPORARY_FAILURE, - {0, 0, 0, 0} -}; - - -/* - * Allocate Command Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * 0 allocations successful - * else allocation failed - */ -int -fore_cmd_allocate(fup) - Fore_unit *fup; -{ - caddr_t memp; - vm_paddr_t pmemp; - - /* - * Allocate non-cacheable memory for command status words - */ - memp = atm_dev_alloc(sizeof(Q_status) * CMD_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); - if (memp == NULL) { - return (1); - } - fup->fu_cmd_stat = (Q_status *) memp; - - pmemp = vtophys(fup->fu_cmd_stat); - if (pmemp == 0) { - return (1); - } - fup->fu_cmd_statd = pmemp; - - /* - * Allocate memory for statistics buffer - */ - memp = atm_dev_alloc(sizeof(Fore_stats), FORE_STATS_ALIGN, 0); - if (memp == NULL) { - return (1); - } - fup->fu_stats = (Fore_stats *) memp; - - /* - * Allocate memory for PROM buffer - */ - memp = atm_dev_alloc(sizeof(Fore_prom), FORE_PROM_ALIGN, 0); - if (memp == NULL) { - return (1); - } - fup->fu_prom = (Fore_prom *) memp; - - return (0); -} - - -/* - * Command Queue Initialization - * - * Allocate and initialize the host-resident command queue structures - * and then initialize the CP-resident queue structures. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_cmd_initialize(fup) - Fore_unit *fup; -{ - Aali *aap = fup->fu_aali; - Cmd_queue *cqp; - H_cmd_queue *hcp; - Q_status *qsp; - vm_paddr_t qsp_dma; - int i; - - /* - * Point to CP-resident command queue - */ - cqp = (Cmd_queue *)(fup->fu_ram + CP_READ(aap->aali_cmd_q)); - - /* - * Point to host-resident command queue structures - */ - hcp = fup->fu_cmd_q; - qsp = fup->fu_cmd_stat; - qsp_dma = fup->fu_cmd_statd; - - /* - * Loop thru all queue entries and do whatever needs doing - */ - for (i = 0; i < CMD_QUELEN; i++) { - - /* - * Set queue status word to free - */ - *qsp = QSTAT_FREE; - - /* - * Set up host queue entry and link into ring - */ - hcp->hcq_cpelem = cqp; - hcp->hcq_status = qsp; - if (i == (CMD_QUELEN - 1)) - hcp->hcq_next = fup->fu_cmd_q; - else - hcp->hcq_next = hcp + 1; - - /* - * Now let the CP into the game - */ - cqp->cmdq_status = (CP_dma) CP_WRITE(qsp_dma); - - /* - * Bump all queue pointers - */ - hcp++; - qsp++; - qsp_dma += sizeof(Q_status); - cqp++; - } - - /* - * Initialize queue pointers - */ - fup->fu_cmd_head = fup->fu_cmd_tail = fup->fu_cmd_q; - - return; -} - - -/* - * Drain Command Queue - * - * This function will process and free all completed entries at the head - * of the command queue. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_cmd_drain(fup) - Fore_unit *fup; -{ - H_cmd_queue *hcp; - Fore_vcc *fvp; - - /* - * Process each completed entry - * ForeThought 4 may set QSTAT_ERROR without QSTAT_COMPLETED. - */ - while (*fup->fu_cmd_head->hcq_status & (QSTAT_COMPLETED | QSTAT_ERROR)) { - - hcp = fup->fu_cmd_head; - - /* - * Process command completion - */ - switch (hcp->hcq_code) { - - case CMD_ACT_VCCIN: - case CMD_ACT_VCCOUT: - fvp = hcp->hcq_arg; - if (*hcp->hcq_status & QSTAT_ERROR) { - /* - * VCC activation failed - just abort vcc - */ - if (fvp) - atm_cm_abort(fvp->fv_connvc, - &fore_cause); - fup->fu_pif.pif_cmderrors++; - } else { - /* - * Successful VCC activation - */ - if (fvp) { - fvp->fv_state = CVS_ACTIVE; - fup->fu_open_vcc++; - } - } - break; - - case CMD_DACT_VCCIN: - case CMD_DACT_VCCOUT: - fvp = hcp->hcq_arg; - if (*hcp->hcq_status & QSTAT_ERROR) { - /* - * VCC dactivation failed - whine - */ - log(LOG_ERR, - "fore_cmd_drain: DACT failed, vcc=(%d,%d)\n", - fvp->fv_connvc->cvc_vcc->vc_vpi, - fvp->fv_connvc->cvc_vcc->vc_vci); - fup->fu_pif.pif_cmderrors++; - } else { - /* - * Successful VCC dactivation - so what? - */ - } - break; - - case CMD_GET_STATS: - if (*hcp->hcq_status & QSTAT_ERROR) { - /* - * Couldn't get stats - */ - fup->fu_pif.pif_cmderrors++; - fup->fu_stats_ret = EIO; - } else { - /* - * Stats are now in unit buffer - */ - fup->fu_stats_ret = 0; - } - fup->fu_flags &= ~FUF_STATCMD; - - /* - * Flush received stats data - */ -#ifdef VAC - if (vac) - vac_pageflush((addr_t)fup->fu_stats); -#endif - -#if BYTE_ORDER == LITTLE_ENDIAN - /* - * Little endian machines receives the stats in - * wrong byte order. Instead of swapping in user - * land, swap here so that everything going out - * of the kernel is in correct host order. - */ - { - u_long *bp = (u_long *)fup->fu_stats; - int loop; - - for ( loop = 0; loop < sizeof(Fore_cp_stats)/ - sizeof(long); loop++, bp++ ) - *bp = ntohl(*bp); - } -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ - - /* - * Poke whoever is waiting on the stats - */ - wakeup(&fup->fu_stats); - break; - - case CMD_GET_PROM: - if (fup->fu_ft4) - goto unknown; - goto prom; - - case CMD_GET_PROM4: - if (!fup->fu_ft4) - goto unknown; - prom: - if (*hcp->hcq_status & QSTAT_ERROR) { - /* - * Couldn't get PROM data - */ - fup->fu_pif.pif_cmderrors++; - log(LOG_ERR, - "fore_cmd_drain: %s%d: GET_PROM failed\n", - fup->fu_pif.pif_name, - fup->fu_pif.pif_unit); - } else { - Fore_prom *fp = fup->fu_prom; - - /* - * Flush received PROM data - */ -#ifdef VAC - if (vac) - vac_pageflush((addr_t)fp); -#endif - /* - * Copy PROM info into config areas - */ - bcopy(&fp->pr_mac[2], - &fup->fu_pif.pif_macaddr, - sizeof(struct mac_addr)); - fup->fu_config.ac_macaddr = - fup->fu_pif.pif_macaddr; - snprintf(fup->fu_config.ac_hard_vers, - sizeof(fup->fu_config.ac_hard_vers), - "%ld.%ld.%ld", - (fp->pr_hwver >> 16) & 0xff, - (fp->pr_hwver >> 8) & 0xff, - fp->pr_hwver & 0xff); - fup->fu_config.ac_serial = fp->pr_serno; - } - break; - - default: - unknown: - log(LOG_ERR, "fore_cmd_drain: unknown command %ld\n", - hcp->hcq_code); - } - - /* - * Mark this entry free for use and bump head pointer - * to the next entry in the queue - */ - *hcp->hcq_status = QSTAT_FREE; - fup->fu_cmd_head = hcp->hcq_next; - } - - return; -} - - -/* - * Free Command Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_cmd_free(fup) - Fore_unit *fup; -{ - H_cmd_queue *hcp; - - /* - * Deal with any commands left on the queue - */ - if (fup->fu_flags & CUF_INITED) { - while (*fup->fu_cmd_head->hcq_status != QSTAT_FREE) { - hcp = fup->fu_cmd_head; - - switch (hcp->hcq_code) { - - case CMD_GET_STATS: - /* - * Just in case someone is sleeping on this - */ - fup->fu_stats_ret = EIO; - wakeup(&fup->fu_stats); - break; - } - - *hcp->hcq_status = QSTAT_FREE; - fup->fu_cmd_head = hcp->hcq_next; - } - } - - /* - * Free the statistics buffer - */ - if (fup->fu_stats) { - atm_dev_free(fup->fu_stats); - fup->fu_stats = NULL; - } - - /* - * Free the PROM buffer - */ - if (fup->fu_prom) { - atm_dev_free(fup->fu_prom); - fup->fu_prom = NULL; - } - - /* - * Free the status words - */ - if (fup->fu_cmd_stat) { - atm_dev_free((volatile void *)fup->fu_cmd_stat); - fup->fu_cmd_stat = NULL; - fup->fu_cmd_statd = 0; - } - - return; -} - Property changes on: head/sys/dev/hfa/fore_command.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/hfa_freebsd.h =================================================================== --- head/sys/dev/hfa/hfa_freebsd.h (revision 179307) +++ head/sys/dev/hfa/hfa_freebsd.h (nonexistent) @@ -1,61 +0,0 @@ -/*- - * Copyright (c) 2002 Matthew N. Dodd - * 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$ - */ - -struct hfa_softc { - device_t dev; - - struct resource * mem; - int mem_rid; - int mem_type; - - struct resource * irq; - int irq_rid; - void * irq_ih; - - struct mtx mtx; - - Fore_unit fup; - - /* sysctl support */ - struct sysctl_ctx_list sysctl_ctx; - struct sysctl_oid * sysctl_tree; -}; - -#define HFA_LOCK(_sc) mtx_lock(&(_sc)->mtx) -#define HFA_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) - -extern devclass_t hfa_devclass; - -int hfa_alloc (device_t); -int hfa_free (device_t); - -int hfa_attach (device_t); -int hfa_detach (device_t); - -void hfa_intr (void *); -void hfa_reset (device_t); Property changes on: head/sys/dev/hfa/hfa_freebsd.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_aali.h =================================================================== --- head/sys/dev/hfa/fore_aali.h (revision 179307) +++ head/sys/dev/hfa/fore_aali.h (nonexistent) @@ -1,606 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * ATM Adaptation Layer Interface (AALI) definitions - * - */ - -#ifndef _FORE_AALI_H -#define _FORE_AALI_H - -/* - * This file contains the definitions required by the FORE ATM Adaptation - * Layer Interface (AALI) specification. - */ - - -/* - * Addressing/Pointer definitions - * - * The CP memory only supports 32-bit word accesses (read and write) - thus, - * all memory must be defined and accessed as 32-bit words. Also, since the - * data transfers are word-sized, we must take care of byte-swapping issues - * from/to little-endian hosts (the CP is an i960 processor, ie big-endian). - * - * All pointers to CP memory areas are actually offsets from the start of - * the adapter RAM address space. - * - * All CP-resident data structures are declared volatile. - */ -typedef void * H_addr; /* Host-resident address */ -typedef unsigned long H_dma; /* Host-resident DMA address */ -typedef unsigned long CP_word; /* CP-resident word */ -typedef unsigned long CP_addr; /* CP-resident CP memory offset */ -typedef unsigned long CP_dma; /* CP-resident DMA address */ - - -/* - * Structure defining the CP's shared memory interface to the mon960 program - */ -struct mon960 { - CP_word mon_xmitmon; /* Uart - host to mon960 (see below) */ - CP_word mon_xmithost; /* Uart - mon960 to host (see below) */ - CP_word mon_bstat; /* Boot status word (see below) */ - CP_addr mon_appl; /* Pointer to application memory area */ - CP_word mon_ver; /* Mon960 firmware version */ -}; -typedef volatile struct mon960 Mon960; - -/* - * Pseudo-UART usage - */ -#define UART_READY 0x00000000 /* UART is ready for more data */ -#define UART_VALID 0x01000000 /* UART character is valid */ -#define UART_DATAMASK 0x000000ff /* UART character data mask */ - -/* - * Boot Status Word - */ -#define BOOT_COLDSTART 0xc01dc01d /* CP is performing cold start */ -#define BOOT_MONREADY 0x02201958 /* Monitor is waiting for commands */ -#define BOOT_FAILTEST 0xadbadbad /* Monitor failed self-test */ -#define BOOT_RUNNING 0xce11feed /* Microcode downloaded and running */ - -#define BOOT_LOOPS 20 /* Loops to wait for CP to boot */ -#define BOOT_DELAY 100000 /* Delay (us) for each boot loop */ - - -/* - * Supported AALs - */ -enum fore_aal { - FORE_AAL_0 = 0, /* Cell Service */ - FORE_AAL_4 = 4, /* AAL 3/4 */ - FORE_AAL_5 = 5 /* AAL 5 */ -}; -typedef enum fore_aal Fore_aal; - - -/* - * Buffer strategy definition - */ -struct buf_strategy { - CP_word bfs_quelen; /* Buffer supply queue entries */ - CP_word bfs_bufsize; /* Buffer size */ - CP_word bfs_cppool; /* Buffers in CP-resident pool */ - CP_word bfs_entsize; /* Buffers in each supply queue entry */ -}; -typedef volatile struct buf_strategy Buf_strategy; - -/* - * Buffer strategy id - */ -#define BUF_STRAT_1 0 /* Buffer strategy one */ -#define BUF_STRAT_2 1 /* Buffer strategy two */ - - - -#ifdef _KERNEL -/* - * Common Queue Element - * - * Used for Transmit, Receive and Buffer Supply Queues - */ -struct com_queue { - CP_dma cq_descr; /* Pointer to element descriptor */ - CP_dma cq_status; /* Pointer to element status word */ -}; -typedef volatile struct com_queue Com_queue; - - -/* - * Queue element status word - */ -typedef volatile unsigned long Q_status; - -#define QSTAT_PENDING 0x01 /* Operation is pending */ -#define QSTAT_COMPLETED 0x02 /* Operation successfully completed */ -#define QSTAT_FREE 0x04 /* Queue element is free/unused */ -#define QSTAT_ERROR 0x08 /* Operation encountered an error */ - -#define QSTAT_ALIGN 4 - - -/* - * PDU Transmit Queue - */ - -/* - * PDU Transmit Queue Element - */ -typedef volatile struct com_queue Xmit_queue; - - -/* - * PDU Transmit buffer segment descriptor - */ -struct xmit_seg_descr { - H_dma xsd_buffer; /* Buffer's DMA address */ - u_int xsd_len; /* Data length in buffer */ -}; -typedef struct xmit_seg_descr Xmit_seg_descr; - -#define XMIT_SEG_ALIGN 4 - - -/* - * PDU Transmit descriptor header - */ -struct xmit_descr_hdr { - u_long xdh_cell_hdr; /* Cell header (minus HEC) */ - u_long xdh_spec; /* Transmit specification (see below) */ - u_long xdh_rate; /* Rate control (data/idle cell ratio)*/ - u_long xdh_pad; /* Pad to quad-word boundary */ -}; -typedef struct xmit_descr_hdr Xmit_descr_hdr; - - -#define XMIT_BLK_BITS 5 /* Bits to encode block size */ -#define XMIT_MAX_BLK_BITS 4 /* Max bits we can use */ -#define XMIT_BLK_SIZE (1 << XMIT_BLK_BITS) -#define XMIT_SEGS_TO_BLKS(nseg) \ - ((((nseg) * sizeof(Xmit_seg_descr)) \ - + sizeof(Xmit_descr_hdr) + (XMIT_BLK_SIZE - 1)) \ - >> XMIT_BLK_BITS) -#define XMIT_MAX_BLKS ((1 << XMIT_MAX_BLK_BITS) - 1) -#define XMIT_HDR_SEGS ((XMIT_BLK_SIZE - sizeof(Xmit_descr_hdr)) \ - / sizeof(Xmit_seg_descr)) -#define XMIT_BLK_SEGS (XMIT_BLK_SIZE / sizeof(Xmit_seg_descr)) -#define XMIT_EXTRA_SEGS ((XMIT_MAX_BLKS - 1) * XMIT_BLK_SEGS) -#define XMIT_MAX_SEGS (XMIT_EXTRA_SEGS + XMIT_HDR_SEGS) - - -/* - * PDU Transmit descriptor - */ -struct xmit_descr { - Xmit_descr_hdr xd_hdr; /* Descriptor header */ - Xmit_seg_descr xd_seg[XMIT_MAX_SEGS]; /* PDU segments */ -}; -typedef struct xmit_descr Xmit_descr; - -#define xd_cell_hdr xd_hdr.xdh_cell_hdr -#define xd_spec xd_hdr.xdh_spec -#define xd_rate xd_hdr.xdh_rate - -/* - * Transmit specification - * - * Bits 0-15 - Total PDU length - * Bits 16-23 - Number of transmit segments - * Bits 24-27 - AAL type - * Bits 28-31 - Interrupt flag - */ -#define XDS_SET_SPEC(i,a,n,l) (((i) << 28) | ((a) << 24) | ((n) << 16) | (l)) -#define XDS_GET_LEN(s) ((s) & 0xffff) -#define XDS_GET_SEGS(s) (((s) >> 16) & 0xff) -#define XDS_GET_AAL(s) (((s) >> 24) & 0xf) -#define XDS_GET_INTR(s) (((s) >> 28) & 0xf) - -#define XMIT_MAX_PDULEN 65535 -#define XMIT_DESCR_ALIGN 32 - - - -/* - * PDU Receive Queue - */ - -/* - * PDU Receive Queue Element - */ -typedef volatile struct com_queue Recv_queue; - - -/* - * Receive PDU buffer segment description - */ -struct recv_seg_descr { - H_addr rsd_handle; /* Buffer handle (from supply) */ - u_int rsd_len; /* Data length in buffer */ -}; -typedef struct recv_seg_descr Recv_seg_descr; - - -/* - * PDU Receive descriptor header - */ -struct recv_descr_hdr { - u_long rdh_cell_hdr; /* Cell header (minus HEC) */ - u_long rdh_nsegs; /* Number of receive segments */ -}; -typedef struct recv_descr_hdr Recv_descr_hdr; - - -#define RECV_BLK_SIZE 32 -#define RECV_HDR_SEGS ((RECV_BLK_SIZE - sizeof(Recv_descr_hdr)) \ - / sizeof(Recv_seg_descr)) -#define RECV_BLK_SEGS (RECV_BLK_SIZE / sizeof(Recv_seg_descr)) -#define RECV_MAX_LG_SEGS ((FORE_IFF_MTU - BUF1_SM_SIZE \ - + (BUF1_LG_SIZE - 1)) / BUF1_LG_SIZE) -#define RECV_EXTRA_BLKS (((RECV_MAX_LG_SEGS + 1 - RECV_HDR_SEGS) \ - + (RECV_BLK_SEGS - 1)) / RECV_BLK_SEGS) -#define RECV_EXTRA_SEGS (RECV_EXTRA_BLKS * RECV_BLK_SEGS) -#define RECV_MAX_SEGS (RECV_EXTRA_SEGS + RECV_HDR_SEGS) - - -/* - * PDU Receive descriptor - */ -struct recv_descr { - Recv_descr_hdr rd_hdr; /* Descriptor header */ - Recv_seg_descr rd_seg[RECV_MAX_SEGS]; /* PDU segments */ -}; -typedef struct recv_descr Recv_descr; - -#define rd_cell_hdr rd_hdr.rdh_cell_hdr -#define rd_nsegs rd_hdr.rdh_nsegs - -#define RECV_DESCR_ALIGN 32 - - - -/* - * Buffer Supply Queue - */ - -/* - * Buffer Supply Queue Element - */ -typedef volatile struct com_queue Buf_queue; - - -/* - * Buffer supply descriptor for supplying receive buffers - */ -struct buf_descr { - H_addr bsd_handle; /* Host-specific buffer handle */ - H_dma bsd_buffer; /* Buffer DMA address */ -}; -typedef struct buf_descr Buf_descr; - -#define BUF_DESCR_ALIGN 32 - - - -/* - * Command Queue - */ - -/* - * Command Codes - */ -typedef volatile unsigned long Cmd_code; - -#define CMD_INIT 0x01 /* Initialize microcode */ -#define CMD_ACT_VCCIN 0x02 /* Activate incoming VCC */ -#define CMD_ACT_VCCOUT 0x03 /* Activate outgoing VCC */ -#define CMD_DACT_VCCIN 0x04 /* Deactivate incoming VCC */ -#define CMD_DACT_VCCOUT 0x05 /* Deactivate outgoing VCC */ -#define CMD_GET_STATS 0x06 /* Get adapter statistics */ -#define CMD_SET_OC3_REG 0x07 /* Set SUNI OC3 registers */ -#define CMD_GET_OC3_REG 0x08 /* Get SUNI OC3 registers */ -#define CMD_GET_PROM 0x09 /* Get PROM data */ -#define CMD_ZERO_STATS4 0x09 /* FT 4 Zero stats (unimpl) */ -#define CMD_GET_PROM4 0x0a /* FT 4 Get PROM data */ -#define CMD_INTR_REQ 0x80 /* Request host interrupt */ - -#endif /* _KERNEL */ - - -/* - * Structure defining the parameters for the Initialize command - */ -struct init_parms { - CP_word init_cmd; /* Command code */ - CP_word init_status; /* Completion status */ - CP_word init_indisc; /* Not used */ - CP_word init_numvcc; /* Number of VCC's supported */ - CP_word init_cmd_elem; /* # of command queue elements */ - CP_word init_xmit_elem; /* # of transmit queue elements */ - CP_word init_recv_elem; /* # of receive queue elements */ - CP_word init_recv_ext; /* # of extra receive descr SEGMENTS */ - CP_word init_xmit_ext; /* # of extra transmit descr SEGMENTS */ - CP_word init_cls_vcc; /* Not used */ - CP_word init_pad[2]; /* Pad to quad-word boundary */ - Buf_strategy init_buf1s; /* Buffer strategy - 1 small */ - Buf_strategy init_buf1l; /* Buffer strategy - 1 large */ - Buf_strategy init_buf2s; /* Buffer strategy - 2 small */ - Buf_strategy init_buf2l; /* Buffer strategy - 2 large */ -}; -typedef volatile struct init_parms Init_parms; - - -#ifdef _KERNEL -/* - * Structure defining the parameters for the Activate commands - */ -struct activate_parms { - CP_word act_spec; /* Command specification (see below) */ - CP_word act_vccid; /* VCC id (VPI=0,VCI=id) */ - CP_word act_batch; /* # cells in batch (AAL=NULL) */ - CP_word act_pad; /* Pad to quad-word boundary */ -}; -typedef volatile struct activate_parms Activate_parms; - -/* - * Activate command specification - * - * Bits 0-7 - command code - * Bits 8-15 - AAL type - * Bits 16-23 - buffer strategy - * Bits 24-31 - reserved - */ -#define ACT_SET_SPEC(b,a,c) (((b) << 16) | ((a) << 8) | (c)) -#define ACT_GET_CMD(s) ((s) & 0xff) -#define ACT_GET_AAL(s) (((s) >> 8) & 0xff) -#define ACT_GET_STRAT(s) (((s) >> 16) & 0xff) - - -/* - * Structure defining the parameters for the Deactivate commands - */ -struct dactivate_parms { - CP_word dact_cmd; /* Command code */ - CP_word dact_vccid; /* VCC id (VPI=0,VCI=id) */ - CP_word dact_pad[2]; /* Pad to quad-word boundary */ -}; -typedef volatile struct dactivate_parms Dactivate_parms; - - -/* - * Structure defining the parameters for the Get Statistics command - */ -struct stats_parms { - CP_word stats_cmd; /* Command code */ - CP_dma stats_buffer; /* DMA address of host stats buffer */ - CP_word stats_pad[2]; /* Pad to quad-word boundary */ -}; -typedef volatile struct stats_parms Stats_parms; - - -/* - * Structure defining the parameters for the SUNI OC3 commands - */ -struct suni_parms { - CP_word suni_spec; /* Command specification (see below) */ - CP_dma suni_buffer; /* DMA address of host SUNI buffer */ - CP_word suni_pad[2]; /* Pad to quad-word boundary */ -}; -typedef volatile struct suni_parms Suni_parms; - -/* - * SUNI OC3 command specification - * - * Bits 0-7 - command code - * Bits 8-15 - SUNI register number - * Bits 16-23 - Value(s) to set in register - * Bits 24-31 - Mask selecting value bits - */ -#define SUNI_SET_SPEC(m,v,r,c) (((m) << 24) | ((v) << 16) | ((r) << 8) | (c)) -#define SUNI_GET_CMD(s) ((s) & 0xff) -#define SUNI_GET_REG(s) (((s) >> 8) & 0xff) -#define SUNI_GET_VALUE(s) (((s) >> 16) & 0xff) -#define SUNI_GET_MASK(s) (((s) >> 24) & 0xff) - - -/* - * Structure defining the parameters for the Get Prom command - */ -struct prom_parms { - CP_word prom_cmd; /* Command code */ - CP_dma prom_buffer; /* DMA address of host prom buffer */ - CP_word prom_pad[2]; /* Pad to quad-word boundary */ -}; -typedef volatile struct prom_parms Prom_parms; - - -/* - * Command Queue Element - */ -struct cmd_queue { - union { /* Command-specific parameters */ - Activate_parms cmdqu_act; - Dactivate_parms cmdqu_dact; - Stats_parms cmdqu_stats; - Suni_parms cmdqu_suni; - Prom_parms cmdqu_prom; - } cmdq_u; - CP_dma cmdq_status; /* Pointer to element status word */ - CP_word cmdq_pad[3]; /* Pad to quad-word boundary */ -}; -#define cmdq_act cmdq_u.cmdqu_act -#define cmdq_dact cmdq_u.cmdqu_dact -#define cmdq_stats cmdq_u.cmdqu_stats -#define cmdq_suni cmdq_u.cmdqu_suni -#define cmdq_prom cmdq_u.cmdqu_prom -typedef volatile struct cmd_queue Cmd_queue; - -#endif /* _KERNEL */ - - - -/* - * Structure defining the CP's shared memory interface to the - * AALI firmware program (downloaded microcode) - */ -struct aali { - CP_addr aali_cmd_q; /* Pointer to command queue */ - CP_addr aali_xmit_q; /* Pointer to transmit queue */ - CP_addr aali_recv_q; /* Pointer to receive queue */ - CP_addr aali_buf1s_q; /* Pointer to strategy-1 small queue */ - CP_addr aali_buf1l_q; /* Pointer to strategy-1 large queue */ - CP_addr aali_buf2s_q; /* Pointer to strategy-2 small queue */ - CP_addr aali_buf2l_q; /* Pointer to strategy-2 large queue */ - CP_word aali_intr_ena; /* Enables interrupts if non-zero */ - CP_word aali_intr_sent; /* Interrupt issued if non-zero */ - CP_addr aali_heap; /* Pointer to application heap */ - CP_word aali_heaplen; /* Length of application heap */ - CP_word aali_hostlog; /* FORE internal use */ - CP_word aali_heartbeat; /* Monitor microcode health */ - CP_word aali_ucode_ver; /* Microcode firmware version */ - CP_word aali_mon_ver; /* Mon960 version */ - CP_word aali_xmit_tput; /* FORE internal use */ - - /* This must be on a quad-word boundary */ - Init_parms aali_init; /* Initialize command parameters */ -}; -typedef volatile struct aali Aali; - - -/* - * CP maintained statistics - DMA'd to host with CMD_GET_STATS command - */ -struct stats_taxi { - u_long taxi_bad_crc; /* Bad header CRC errors */ - u_long taxi_framing; /* Framing errors */ - u_long taxi_pad[2]; /* Pad to quad-word boundary */ -}; -typedef struct stats_taxi Stats_taxi; - -struct stats_oc3 { - u_long oc3_sect_bip8; /* Section 8-bit intrlv parity errors */ - u_long oc3_path_bip8; /* Path 8-bit intrlv parity errors */ - u_long oc3_line_bip24; /* Line 24-bit intrlv parity errors */ - u_long oc3_line_febe; /* Line far-end block errors */ - u_long oc3_path_febe; /* Path far-end block errors */ - u_long oc3_hec_corr; /* Correctible HEC errors */ - u_long oc3_hec_uncorr; /* Uncorrectible HEC errors */ - u_long oc3_pad; /* Pad to quad-word boundary */ -}; -typedef struct stats_oc3 Stats_oc3; - -struct stats_atm { - u_long atm_xmit; /* Cells transmitted */ - u_long atm_rcvd; /* Cells received */ - u_long atm_vpi_range; /* Cell drops - VPI out of range */ - u_long atm_vpi_noconn; /* Cell drops - no connect for VPI */ - u_long atm_vci_range; /* Cell drops - VCI out of range */ - u_long atm_vci_noconn; /* Cell drops - no connect for VCI */ - u_long atm_pad[2]; /* Pad to quad-word boundary */ -}; -typedef struct stats_atm Stats_atm; - -struct stats_aal0 { - u_long aal0_xmit; /* Cells transmitted */ - u_long aal0_rcvd; /* Cells received */ - u_long aal0_drops; /* Cell drops */ - u_long aal0_pad; /* Pad to quad-word boundary */ -}; -typedef struct stats_aal0 Stats_aal0; - -struct stats_aal4 { - u_long aal4_xmit; /* Cells transmitted */ - u_long aal4_rcvd; /* Cells received */ - u_long aal4_crc; /* Cells with payload CRC errors */ - u_long aal4_sar_cs; /* Cells with SAR/CS errors */ - u_long aal4_drops; /* Cell drops */ - u_long aal4_pdu_xmit; /* CS PDUs transmitted */ - u_long aal4_pdu_rcvd; /* CS PDUs received */ - u_long aal4_pdu_errs; /* CS layer protocol errors */ - u_long aal4_pdu_drops; /* CS PDUs dropped */ - u_long aal4_pad[3]; /* Pad to quad-word boundary */ -}; -typedef struct stats_aal4 Stats_aal4; - -struct stats_aal5 { - u_long aal5_xmit; /* Cells transmitted */ - u_long aal5_rcvd; /* Cells received */ - u_long aal5_crc_len; /* Cells with CRC/length errors */ - u_long aal5_drops; /* Cell drops */ - u_long aal5_pdu_xmit; /* CS PDUs transmitted */ - u_long aal5_pdu_rcvd; /* CS PDUs received */ - u_long aal5_pdu_crc; /* CS PDUs with CRC errors */ - u_long aal5_pdu_errs; /* CS layer protocol errors */ - u_long aal5_pdu_drops; /* CS PDUs dropped */ - u_long aal5_pad[3]; /* Pad to quad-word boundary */ -}; -typedef struct stats_aal5 Stats_aal5; - -struct stats_misc { - u_long buf1_sm_fail; /* Alloc fail: buffer strat 1 small */ - u_long buf1_lg_fail; /* Alloc fail: buffer strat 1 large */ - u_long buf2_sm_fail; /* Alloc fail: buffer strat 2 small */ - u_long buf2_lg_fail; /* Alloc fail: buffer strat 2 large */ - u_long rcvd_pdu_fail; /* Received PDU allocation failure */ - u_long carrier_status; /* Carrier status */ - u_long misc_pad[2]; /* Pad to quad-word boundary */ -}; -typedef struct stats_misc Stats_misc; - -struct fore_cp_stats { - Stats_taxi st_cp_taxi; /* TAXI layer statistics */ - Stats_oc3 st_cp_oc3; /* OC3 layer statistics */ - Stats_atm st_cp_atm; /* ATM layer statistics */ - Stats_aal0 st_cp_aal0; /* AAL0 layer statistics */ - Stats_aal4 st_cp_aal4; /* AAL3/4 layer statistics */ - Stats_aal5 st_cp_aal5; /* AAL5 layer statistics */ - Stats_misc st_cp_misc; /* Miscellaneous statistics */ -}; -typedef struct fore_cp_stats Fore_cp_stats; - -#define FORE_STATS_ALIGN 32 - -/* - * CP PROM data - DMA'd to host with CMD_GET_PROM command - */ -struct fore_prom { - u_long pr_hwver; /* Hardware version number */ - u_long pr_serno; /* Serial number */ - u_char pr_mac[8]; /* MAC address */ -}; -typedef struct fore_prom Fore_prom; - -#define FORE_PROM_ALIGN 32 - -#endif /* _FORE_AALI_H */ Property changes on: head/sys/dev/hfa/fore_aali.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_timer.c =================================================================== --- head/sys/dev/hfa/fore_timer.c (revision 179307) +++ head/sys/dev/hfa/fore_timer.c (nonexistent) @@ -1,116 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Timer processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Process a Fore timer tick - * - * This function is called every FORE_TIME_TICK seconds in order to update - * all of the unit watchdog timers. - * - * Called at splnet. - * - * Arguments: - * tip pointer to fore timer control block - * - * Returns: - * none - * - */ -void -fore_timeout(tip) - struct atm_time *tip; -{ - Fore_unit *fup; - int i; - - - /* - * Schedule next timeout - */ - atm_timeout(&fore_timer, ATM_HZ * FORE_TIME_TICK, fore_timeout); - - /* - * Run through all units, updating each active timer. - * If an expired timer is found, notify that unit. - */ - for (i = 0; i < fore_nunits; i++) { - - if ((fup = fore_units[i]) == NULL) - continue; - - /* - * Decrement timer, if it's active - */ - if (fup->fu_timer && (--fup->fu_timer == 0)) { - - /* - * Timeout occurred - go check out the queues - */ - ATM_DEBUG0("fore_timeout\n"); - DEVICE_LOCK((Cmn_unit *)fup); - fore_watchdog(fup); - DEVICE_UNLOCK((Cmn_unit *)fup); - } - } -} - Property changes on: head/sys/dev/hfa/fore_timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_if.c =================================================================== --- head/sys/dev/hfa/fore_if.c (revision 179307) +++ head/sys/dev/hfa/fore_if.c (nonexistent) @@ -1,228 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Network interface layer support - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Handle netatm core service interface ioctl requests - * - * Called at splnet. - * - * Arguments: - * code ioctl function (sub)code - * data data to/from ioctl - * arg optional code-specific argument - * - * Returns: - * 0 request processed successfully - * error request failed - reason code - */ -int -fore_atm_ioctl(code, data, arg) - int code; - caddr_t data; - caddr_t arg; -{ - struct atminfreq *aip = (struct atminfreq *)data; - struct atm_pif *pip; - Fore_unit *fup; - caddr_t buf = aip->air_buf_addr; - struct air_vinfo_rsp *avr; - size_t count; - size_t len; - size_t buf_len = aip->air_buf_len; - int err = 0; - char ifname[2*IFNAMSIZ]; - - - ATM_DEBUG2("fore_atm_ioctl: code=%d, opcode=%d\n", - code, aip->air_opcode); - - switch ( aip->air_opcode ) { - - case AIOCS_INF_VST: - /* - * Get vendor statistics - */ - pip = (struct atm_pif *)arg; - fup = (Fore_unit *)pip; - if ( pip == NULL ) - return ( ENXIO ); - snprintf ( ifname, sizeof(ifname), - "%s%d", pip->pif_name, pip->pif_unit ); - - /* - * Cast response structure onto user's buffer - */ - avr = (struct air_vinfo_rsp *)buf; - - /* - * How large is the response structure? - */ - len = sizeof(struct air_vinfo_rsp); - - /* - * Sanity check - enough room for response structure? - */ - if ( buf_len < len ) - return ( ENOSPC ); - - /* - * Copy interface name into response structure - */ - if ((err = copyout ( ifname, avr->avsp_intf, IFNAMSIZ)) != 0) - break; - - /* - * Advance the buffer address and decrement the size - */ - buf += len; - buf_len -= len; - - /* - * Get the vendor stats from the hardware - */ - count = 0; - if ( ( err = fore_get_stats ( fup ) ) == 0 ) - { - /* - * Stick as much of it as we have room for - * into the response - */ - count = min ( sizeof(Fore_stats), buf_len ); - - /* - * Copy stats into user's buffer. Return value is - * amount of data copied. - */ - if ((err = copyout((caddr_t)fup->fu_stats, buf, count)) != 0) - break; - buf += count; - buf_len -= count; - if ( count < sizeof(Fore_stats) ) - err = ENOSPC; - } - - /* - * Record amount we're returning as vendor info... - */ - if ((err = copyout(&count, &avr->avsp_len, sizeof(count))) != 0) - break; - - /* - * Update the reply pointers and lengths - */ - aip->air_buf_addr = buf; - aip->air_buf_len = buf_len; - break; - - default: - err = ENOSYS; /* Operation not supported */ - break; - } - - return (err); -} - - -/* - * Free Fore-specific device resources - * - * Frees all dynamically acquired resources for a device unit. Before - * this function is called, the CP will have been reset and our interrupt - * vectors removed. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - * - */ -void -fore_interface_free(fup) - Fore_unit *fup; -{ - - /* - * Free up all of our allocated memory - */ - fore_xmit_free(fup); - fore_recv_free(fup); - fore_buf_free(fup); - fore_cmd_free(fup); - - /* - * Clear device initialized - */ - if (fup->fu_flags & CUF_INITED) { - fup->fu_flags &= ~CUF_INITED; - } - - if (fup->fu_flags & FUF_STATCMD) { - fup->fu_flags &= ~FUF_STATCMD; - } - return; -} - Property changes on: head/sys/dev/hfa/fore_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore.h =================================================================== --- head/sys/dev/hfa/fore.h (revision 179307) +++ head/sys/dev/hfa/fore.h (nonexistent) @@ -1,114 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Protocol and implementation definitions - * - */ - -#ifndef _FORE_H -#define _FORE_H - -#ifndef FORE_DEV_NAME -#define FORE_DEV_NAME "hfa" -#endif - -#define FORE_MAX_UNITS 8 /* Maximum number of devices we support */ -#define FORE_MIN_UCODE 0x20300 /* Minimum microcode version we support */ - -#define FORE_IFF_MTU 9188 /* Network interface MTU */ -#define FORE_MAX_VCC 1024 /* Maximum number of open VCCs */ -#define FORE_MAX_VPI 0 /* Maximum VPI value */ -#define FORE_MAX_VCI 1023 /* Maximum VCI value */ -#define FORE_DEF_RATE 0x00000000 /* Default rate control = disabled */ - -#define XMIT_QUELEN 32 /* Length of transmit queue */ -#define RECV_QUELEN 32 /* Length of receive queue */ -#define CMD_QUELEN 8 /* Length of command queue */ - -#define FORE_TIME_TICK 5 /* Watchdog timer tick (seconds) */ -#define FORE_WATCHDOG 3 /* Device watchdog timeout (ticks) */ -#define FORE_RECV_RETRY 3 /* Wait for receive queue entry retry count */ -#define FORE_RECV_DELAY 10 /* Wait for receive queue entry delay (usec) */ - - -/* - * Receive Buffer strategies - */ -#define BUF_MIN_VCC 4 /* Minimum for buffer supply calculations */ - -#define BUF_DATA_ALIGN 4 /* Fore-required data alignment */ - -/* - * Strategy 1 Small - mbuf - * Strategy 1 Large - cluster mbuf - * - * XXX buffer controls - the RECV_MAX_SEGS calculation comes out wrong - * using the true buffer size values if the CP really only does full-cell - * filling of a particular buffer - we must clarify this...it also appears - * the minimum buffer size is 64, even if the CP can only fit in 1 cell. - */ -#define SIZEOF_Buf_handle 16 /* XXX sizeof(Buf_handle) */ - -#undef m_ext -typedef struct m_ext M_ext; -#define m_ext M_dat.MH.MH_dat.MH_ext -#define BUF1_SM_HOFF (sizeof(struct m_hdr)) /* Buffer-to-handle offset */ -#define BUF1_SM_HDR (sizeof(struct m_hdr) + sizeof(struct pkthdr)) -#define BUF1_SM_LEN (MHLEN) -#define BUF1_LG_HOFF (sizeof(struct m_hdr) + sizeof(struct pkthdr) \ - + sizeof(M_ext)) /* Buffer-to-handle offset */ -/* - * BUF1_SM_DOFF - CP data offset into buffer data space - * BUF1_SM_SIZE - Buffer size - * - * These should be defined as follows, but we need compile-time constants: - * - * #define BUF1_SM_DOFF (roundup(BUF1_SM_HOFF + SIZEOF_Buf_handle, - * BUF_DATA_ALIGN) - BUF1_SM_HDR) - * #define BUF1_SM_SIZE MAX(BUF1_SM_LEN - BUF1_SM_DOFF, 64) - * - */ -#define BUF1_SM_DOFF (SIZEOF_Buf_handle) -#define BUF1_SM_SIZE (BUF1_SM_LEN - BUF1_SM_DOFF) - -#define BUF1_SM_QUELEN 16 /* Entries in supply queue */ -#define BUF1_SM_CPPOOL 256 /* Buffers in CP-resident pool */ -#define BUF1_SM_ENTSIZE 8 /* Buffers in each supply queue entry */ - -#define BUF1_LG_DOFF 0 /* CP data offset into mbuf data space */ -#define BUF1_LG_SIZE MCLBYTES /* Buffer size */ -#define BUF1_LG_QUELEN 16 /* Entries in supply queue */ -#define BUF1_LG_CPPOOL 512 /* Buffers in CP-resident pool */ -#define BUF1_LG_ENTSIZE 8 /* Buffers in each supply queue entry */ - -#endif /* _FORE_H */ Property changes on: head/sys/dev/hfa/fore.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/hfa_sbus.c =================================================================== --- head/sys/dev/hfa/hfa_sbus.c (revision 179307) +++ head/sys/dev/hfa/hfa_sbus.c (nonexistent) @@ -1,133 +0,0 @@ -/*- - * Copyright (c) 2002 Matthew N. Dodd - * 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. - */ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -static int hfa_sbus_probe(device_t); -static int hfa_sbus_attach(device_t); - -static int -hfa_sbus_probe (device_t dev) -{ - - return (ENXIO); -} - -static int -hfa_sbus_attach (device_t dev) -{ - - return (ENXIO); -} - -static device_method_t hfa_sbus_methods[] = { - DEVMETHOD(device_probe, hfa_sbus_probe), - DEVMETHOD(device_attach, hfa_sbus_attach), - - DEVMETHOD(device_detach, hfa_detach), - - { 0, 0 } -}; - -static driver_t hfa_sbus_driver = { - "hfa", - hfa_sbus_methods, - sizeof(struct hfa_softc) -}; - -DRIVER_MODULE(hfa, sbus, hfa_sbus_driver, hfa_devclass, 0, 0); -MODULE_DEPEND(hfa, hfa, 1, 1, 1); -MODULE_DEPEND(hfa, sbus, 1, 1, 1); Property changes on: head/sys/dev/hfa/hfa_sbus.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_intr.c =================================================================== --- head/sys/dev/hfa/fore_intr.c (revision 179307) +++ head/sys/dev/hfa/fore_intr.c (nonexistent) @@ -1,268 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Interrupt processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - -#if defined(sun) -/* - * Polling interrupt routine - * - * Polling interrupts are handled by calling all interrupt service - * routines for a given level until someone claims to have "handled" the - * interrupt. - * - * Called at interrupt level. - * - * Arguments: - * none - * - * Returns: - * 1 an interrupt has been serviced - * 0 no interrupts serviced - * - */ -int -fore_poll() -{ - int serviced = 0; - int unit; - - /* - * See if any of our devices are interrupting - */ - for ( unit = 0; unit < fore_nunits; unit++ ) - { - Fore_unit *fup = fore_units[unit]; - - if (fup == NULL) - continue; - - serviced += fore_intr((void *)fup); - } - - /* - * Indicate if we handled an interrupt - */ - return (serviced ? 1 : 0); -} -#endif /* defined(sun) */ - - -/* - * Device interrupt routine - * - * Called at interrupt level. - * - * Arguments: - * arg pointer to device unit structure - * - * Returns: - * 1 device interrupt was serviced - * 0 no interrupts serviced - * - */ -#if (defined(BSD) && (BSD <= 199306)) -int -#else -void -#endif -fore_intr(arg) - void *arg; -{ - Fore_unit *fup = arg; - Aali *aap; -#if (defined(BSD) && (BSD <= 199306)) - int serviced = 0; -#endif - - /* - * Try to prevent stuff happening after we've paniced - */ - if (panicstr) { - goto done; - } - - /* - * Get to the microcode shared memory interface - */ - if ((aap = fup->fu_aali) == NULL) - goto done; - - /* - * Has this card issued an interrupt?? - */ - if (*fup->fu_psr) { - - /* - * Indicate that we've serviced an interrupt. - */ -#if (defined(BSD) && (BSD <= 199306)) - serviced = 1; -#endif - - /* - * Clear the device interrupt - */ - if (fup->fu_config.ac_device == DEV_FORE_PCA200E) - PCA200E_HCR_SET(*fup->fu_ctlreg, PCA200E_CLR_HBUS_INT); - aap->aali_intr_sent = CP_WRITE(0); - - /* - * Reset the watchdog timer - */ - fup->fu_timer = FORE_WATCHDOG; - - /* - * Device initialization handled separately - */ - if ((fup->fu_flags & CUF_INITED) == 0) { - - if (fup->fu_ft4) - /* may not happen */ - goto done; - - /* - * We're just initializing device now, so see if - * the initialization command has completed - */ - if (CP_READ(aap->aali_init.init_status) & - QSTAT_COMPLETED) - fore_initialize_complete(fup); - - /* - * If we're still not inited, none of the host - * queues are setup yet - */ - if ((fup->fu_flags & CUF_INITED) == 0) - goto done; - } - - /* - * Drain the queues of completed work - */ - fore_cmd_drain(fup); - fore_recv_drain(fup); - fore_xmit_drain(fup); - - /* - * Supply more buffers to the CP - */ - fore_buf_supply(fup); - } - -done: -#if (defined(BSD) && (BSD <= 199306)) - return(serviced); -#else - return; -#endif -} - - -/* - * Watchdog timeout routine - * - * Called when we haven't heard from the card in a while. Just in case - * we missed an interrupt, we'll drain the queues and try to resupply the - * CP with more receive buffers. If the CP is partially wedged, hopefully - * this will be enough to get it going again. - * - * Called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - * - */ -void -fore_watchdog(fup) - Fore_unit *fup; -{ - /* - * Try to prevent stuff happening after we've paniced - */ - if (panicstr) { - return; - } - - /* - * Reset the watchdog timer - */ - fup->fu_timer = FORE_WATCHDOG; - - /* - * If the device is initialized, nudge it (wink, wink) - */ - if (fup->fu_flags & CUF_INITED) { - - /* - * Drain the queues of completed work - */ - fore_cmd_drain(fup); - fore_recv_drain(fup); - fore_xmit_drain(fup); - - /* - * Supply more buffers to the CP - */ - fore_buf_supply(fup); - } - - return; -} Property changes on: head/sys/dev/hfa/fore_intr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_init.c =================================================================== --- head/sys/dev/hfa/fore_init.c (revision 179307) +++ head/sys/dev/hfa/fore_init.c (nonexistent) @@ -1,380 +0,0 @@ -/*- - * - * =================================== - * 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$ - * - */ - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Cell Processor (CP) initialization routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local functions - */ -static void fore_get_prom(Fore_unit *); - - -/* - * Begin CP Initialization - * - * This function will poll for the successful downloading and starting of - * the CP microcode program. After the microcode is running, we will allocate - * any needed kernel memory (must do it in non-interrupt mode), build the CP - * queue configurations and issue an Initialize command to the CP. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_initialize(fup) - Fore_unit *fup; -{ - Aali *aap; - Init_parms *inp; - caddr_t errmsg; - u_long vers; - u_int c, wait; -#define MAX_WAIT 100 - - /* - * Must wait until firmware has been downloaded and is running - */ - if (CP_READ(fup->fu_mon->mon_bstat) != BOOT_RUNNING) { - - /* - * Try again later - */ - fup->fu_thandle = - timeout((KTimeout_ret(*)(void *))fore_initialize, - (void *)fup, hz); - return; - } else - callout_handle_init(&fup->fu_thandle); - - /* - * Allocate queues and whatever else is needed - */ - if (fore_xmit_allocate(fup)) { - errmsg = "transmit queue allocation"; - goto failed; - } - if (fore_recv_allocate(fup)) { - errmsg = "receive queue allocation"; - goto failed; - } - if (fore_buf_allocate(fup)) { - errmsg = "buffer supply queue allocation"; - goto failed; - } - if (fore_cmd_allocate(fup)) { - errmsg = "command queue allocation"; - goto failed; - } - - /* - * CP microcode is downloaded - locate shared memory interface - */ - aap = (Aali *)(fup->fu_ram + CP_READ(fup->fu_mon->mon_appl)); - fup->fu_aali = aap; - - /* - * Pick out any interesting info from the microcode - */ - vers = CP_READ(aap->aali_ucode_ver); - if (vers < FORE_MIN_UCODE) { - errmsg = "unsupported microcode version"; - goto failed; - } - snprintf(fup->fu_config.ac_firm_vers, - sizeof(fup->fu_config.ac_firm_vers), "%ld.%ld.%ld", - (vers >> 16) & 0xff, (vers >> 8) & 0xff, vers & 0xff); - - if (((vers >> 16) & 0xff) == 4) - fup->fu_ft4 = 1; - else - fup->fu_ft4 = 0; - -#ifdef notdef - /* - * Turn on CP debugging - */ - aap->aali_hostlog = 1; -#endif - - /* - * Build the initialization block - */ - inp = &aap->aali_init; - inp->init_numvcc = CP_WRITE(FORE_MAX_VCC); - inp->init_cmd_elem = CP_WRITE(CMD_QUELEN); - inp->init_xmit_elem = CP_WRITE(XMIT_QUELEN); - inp->init_recv_elem = CP_WRITE(RECV_QUELEN); - inp->init_recv_ext = CP_WRITE(RECV_EXTRA_SEGS); - inp->init_xmit_ext = CP_WRITE(XMIT_EXTRA_SEGS); - inp->init_buf1s.bfs_quelen = CP_WRITE(BUF1_SM_QUELEN); - inp->init_buf1s.bfs_bufsize = CP_WRITE(BUF1_SM_SIZE); - inp->init_buf1s.bfs_cppool = CP_WRITE(BUF1_SM_CPPOOL); - inp->init_buf1s.bfs_entsize = CP_WRITE(BUF1_SM_ENTSIZE); - inp->init_buf1l.bfs_quelen = CP_WRITE(BUF1_LG_QUELEN); - inp->init_buf1l.bfs_bufsize = CP_WRITE(BUF1_LG_SIZE); - inp->init_buf1l.bfs_cppool = CP_WRITE(BUF1_LG_CPPOOL); - inp->init_buf1l.bfs_entsize = CP_WRITE(BUF1_LG_ENTSIZE); - inp->init_buf2s.bfs_quelen = CP_WRITE(0); - inp->init_buf2s.bfs_bufsize = CP_WRITE(0); - inp->init_buf2s.bfs_cppool = CP_WRITE(0); - inp->init_buf2s.bfs_entsize = CP_WRITE(0); - inp->init_buf2l.bfs_quelen = CP_WRITE(0); - inp->init_buf2l.bfs_bufsize = CP_WRITE(0); - inp->init_buf2l.bfs_cppool = CP_WRITE(0); - inp->init_buf2l.bfs_entsize = CP_WRITE(0); - - /* - * Enable device interrupts - */ - aap->aali_intr_ena = CP_WRITE(1); - - /* - * Issue the Initialize command to the CP and wait for - * the CP to interrupt to signal completion - */ - inp->init_status = CP_WRITE(QSTAT_PENDING); - - if (!fup->fu_ft4) { - inp->init_cmd = CP_WRITE(CMD_INIT | CMD_INTR_REQ); - return; - } - inp->init_cmd = CP_WRITE(CMD_INIT); - - /* - * With the ForeThought 4.X image it appears that we need to - * busy wait on the initializisation command to complete. - * Otherwise the command queue address (the first word - * of the queue structure) will be mangled. - */ - c = 0; - for (wait = 0; wait < MAX_WAIT; wait++) { - c = CP_READ(inp->init_status); - if (c & QSTAT_COMPLETED) - break; - DELAY(1000); - } - if (c & QSTAT_ERROR) { - log(LOG_ERR, "fore initialization failed: intf=%s%d, " - "hbeat=0x%lx\n", fup->fu_pif.pif_name, - fup->fu_pif.pif_unit, (u_long)CP_READ(aap->aali_heartbeat)); - fore_interface_free(fup); - return; - } - if (!(c & QSTAT_COMPLETED)) { - log(LOG_ERR, "fore initialization timed out: intf=%s%d, " - "hbeat=0x%lx\n", fup->fu_pif.pif_name, fup->fu_pif.pif_unit, - (u_long)CP_READ(aap->aali_heartbeat)); - fore_interface_free(fup); - return; - } - fore_initialize_complete(fup); - return; - -failed: - /* - * Initialization failure - */ - fore_interface_free(fup); - log(LOG_ERR, "fore initialization failed: intf=%s%d, err=%s\n", - fup->fu_pif.pif_name, fup->fu_pif.pif_unit, errmsg); - return; -} - - -/* - * Complete CP Initialization - * - * Called after the CP has successfully completed processing of the - * Initialize command. We will now finish off our part of the - * initialization process by setting up all the host-based queue - * management structures. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_initialize_complete(fup) - Fore_unit *fup; -{ - Aali *aap = fup->fu_aali; - - /* - * Log an initialization failure - */ - if (CP_READ(aap->aali_init.init_status) & QSTAT_ERROR) { - - log(LOG_ERR, - "fore initialization failed: intf=%s%d, hbeat=0x%lx\n", - fup->fu_pif.pif_name, fup->fu_pif.pif_unit, - (u_long)CP_READ(aap->aali_heartbeat)); - return; - } - - ATM_DEBUG1("heap=0x%lx\n", aap->aali_heap); - ATM_DEBUG1("heaplen=0x%lx\n", aap->aali_heaplen); - ATM_DEBUG1("cmd_q=0x%lx\n", aap->aali_cmd_q); - ATM_DEBUG1("xmit_q=0x%lx\n", aap->aali_xmit_q); - ATM_DEBUG1("recv_q=0x%lx\n", aap->aali_recv_q); - ATM_DEBUG1("buf1s_q=0x%lx\n", aap->aali_buf1s_q); - ATM_DEBUG1("buf1l_q=0x%lx\n", aap->aali_buf1l_q); - ATM_DEBUG1("buf2s_q=0x%lx\n", aap->aali_buf2s_q); - ATM_DEBUG1("buf2l_q=0x%lx\n", aap->aali_buf2l_q); - - /* - * Initialize all of our queues - */ - fore_xmit_initialize(fup); - fore_recv_initialize(fup); - fore_buf_initialize(fup); - fore_cmd_initialize(fup); - - /* - * Mark device initialization completed - */ - fup->fu_flags |= CUF_INITED; - - fore_get_prom(fup); - return; -} - - -/* - * Get device PROM values from CP - * - * This function will issue a GET_PROM command to the CP in order to - * initiate the DMA transfer of the CP's PROM structure to the host. - * This will be called after CP initialization has completed. - * There is (currently) no retry if this fails. - * - * It took me some time to find out that FT3 and FT4 use different - * operation codes for GET_PROM. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - * - */ -static void -fore_get_prom(fup) - Fore_unit *fup; -{ - H_cmd_queue *hcp; - Cmd_queue *cqp; - - /* - * Queue command at end of command queue - */ - hcp = fup->fu_cmd_tail; - if ((*hcp->hcq_status) & QSTAT_FREE) { - - /* - * Queue entry available, so set our view of things up - */ - if (fup->fu_ft4) - hcp->hcq_code = CMD_GET_PROM4; - else - hcp->hcq_code = CMD_GET_PROM; - hcp->hcq_arg = NULL; - fup->fu_cmd_tail = hcp->hcq_next; - - /* - * Now set the CP-resident queue entry - the CP will grab - * the command when the op-code is set. - */ - cqp = hcp->hcq_cpelem; - (*hcp->hcq_status) = QSTAT_PENDING; - - fup->fu_promd = vtophys(fup->fu_prom); - if (fup->fu_promd == 0) { - fup->fu_stats->st_drv.drv_cm_nodma++; - return; - } - cqp->cmdq_prom.prom_buffer = (CP_dma) CP_WRITE(fup->fu_promd); - cqp->cmdq_prom.prom_cmd = CP_WRITE(hcp->hcq_code | CMD_INTR_REQ); - - } else { - /* - * Command queue full - */ - fup->fu_stats->st_drv.drv_cm_full++; - } - - return; -} - Property changes on: head/sys/dev/hfa/fore_init.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_buffer.c =================================================================== --- head/sys/dev/hfa/fore_buffer.c (revision 179307) +++ head/sys/dev/hfa/fore_buffer.c (nonexistent) @@ -1,786 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Buffer Supply queue management - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local functions - */ -static void fore_buf_drain(Fore_unit *); -static void fore_buf_supply_1s(Fore_unit *); -static void fore_buf_supply_1l(Fore_unit *); - - -/* - * Allocate Buffer Supply Queues Data Structures - * - * Here we are allocating memory for both Strategy 1 Small and Large - * structures contiguously. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * 0 allocations successful - * else allocation failed - */ -int -fore_buf_allocate(fup) - Fore_unit *fup; -{ - caddr_t memp; - vm_paddr_t pmemp; - - /* - * Allocate non-cacheable memory for buffer supply status words - */ - memp = atm_dev_alloc( - sizeof(Q_status) * (BUF1_SM_QUELEN + BUF1_LG_QUELEN), - QSTAT_ALIGN, ATM_DEV_NONCACHE); - if (memp == NULL) { - return (1); - } - fup->fu_buf1s_stat = (Q_status *) memp; - fup->fu_buf1l_stat = ((Q_status *) memp) + BUF1_SM_QUELEN; - - pmemp = vtophys(fup->fu_buf1s_stat); - if (pmemp == 0) { - return (1); - } - fup->fu_buf1s_statd = pmemp; - - pmemp = vtophys(fup->fu_buf1l_stat); - if (pmemp == 0) { - return (1); - } - fup->fu_buf1l_statd = pmemp; - - /* - * Allocate memory for buffer supply descriptors - */ - memp = atm_dev_alloc(sizeof(Buf_descr) * - ((BUF1_SM_QUELEN * BUF1_SM_ENTSIZE) + - (BUF1_LG_QUELEN * BUF1_LG_ENTSIZE)), - BUF_DESCR_ALIGN, 0); - if (memp == NULL) { - return (1); - } - fup->fu_buf1s_desc = (Buf_descr *) memp; - fup->fu_buf1l_desc = ((Buf_descr *) memp) + - (BUF1_SM_QUELEN * BUF1_SM_ENTSIZE); - - pmemp = vtophys(fup->fu_buf1s_desc); - if (pmemp == 0) { - return (1); - } - fup->fu_buf1s_descd = pmemp; - - pmemp = vtophys(fup->fu_buf1l_desc); - if (pmemp == 0) { - return (1); - } - fup->fu_buf1l_descd = pmemp; - - return (0); -} - - -/* - * Buffer Supply Queues Initialization - * - * Allocate and initialize the host-resident buffer supply queue structures - * and then initialize the CP-resident queue structures. - * - * Called at interrupt level. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_buf_initialize(fup) - Fore_unit *fup; -{ - Aali *aap = fup->fu_aali; - Buf_queue *cqp; - H_buf_queue *hbp; - Buf_descr *bdp; - vm_paddr_t bdp_dma; - Q_status *qsp; - vm_paddr_t qsp_dma; - int i; - - /* - * Initialize Strategy 1 Small Queues - */ - - /* - * Point to CP-resident buffer supply queue - */ - cqp = (Buf_queue *)(fup->fu_ram + CP_READ(aap->aali_buf1s_q)); - - /* - * Point to host-resident buffer supply queue structures - */ - hbp = fup->fu_buf1s_q; - qsp = fup->fu_buf1s_stat; - qsp_dma = fup->fu_buf1s_statd; - bdp = fup->fu_buf1s_desc; - bdp_dma = fup->fu_buf1s_descd; - - /* - * Loop thru all queue entries and do whatever needs doing - */ - for (i = 0; i < BUF1_SM_QUELEN; i++) { - - /* - * Set queue status word to free - */ - *qsp = QSTAT_FREE; - - /* - * Set up host queue entry and link into ring - */ - hbp->hbq_cpelem = cqp; - hbp->hbq_status = qsp; - hbp->hbq_descr = bdp; - hbp->hbq_descr_dma = bdp_dma; - if (i == (BUF1_SM_QUELEN - 1)) - hbp->hbq_next = fup->fu_buf1s_q; - else - hbp->hbq_next = hbp + 1; - - /* - * Now let the CP into the game - */ - cqp->cq_status = (CP_dma) CP_WRITE(qsp_dma); - - /* - * Bump all queue pointers - */ - hbp++; - qsp++; - qsp_dma += sizeof(Q_status); - bdp += BUF1_SM_ENTSIZE; - bdp_dma += BUF1_SM_ENTSIZE * sizeof(Buf_descr); - cqp++; - } - - /* - * Initialize queue pointers - */ - fup->fu_buf1s_head = fup->fu_buf1s_tail = fup->fu_buf1s_q; - - - /* - * Initialize Strategy 1 Large Queues - */ - - /* - * Point to CP-resident buffer supply queue - */ - cqp = (Buf_queue *)(fup->fu_ram + CP_READ(aap->aali_buf1l_q)); - - /* - * Point to host-resident buffer supply queue structures - */ - hbp = fup->fu_buf1l_q; - qsp = fup->fu_buf1l_stat; - qsp_dma = fup->fu_buf1l_statd; - bdp = fup->fu_buf1l_desc; - bdp_dma = fup->fu_buf1l_descd; - - /* - * Loop thru all queue entries and do whatever needs doing - */ - for (i = 0; i < BUF1_LG_QUELEN; i++) { - - /* - * Set queue status word to free - */ - *qsp = QSTAT_FREE; - - /* - * Set up host queue entry and link into ring - */ - hbp->hbq_cpelem = cqp; - hbp->hbq_status = qsp; - hbp->hbq_descr = bdp; - hbp->hbq_descr_dma = bdp_dma; - if (i == (BUF1_LG_QUELEN - 1)) - hbp->hbq_next = fup->fu_buf1l_q; - else - hbp->hbq_next = hbp + 1; - - /* - * Now let the CP into the game - */ - cqp->cq_status = (CP_dma) CP_WRITE(qsp_dma); - - /* - * Bump all queue pointers - */ - hbp++; - qsp++; - qsp_dma += sizeof(Q_status); - bdp += BUF1_LG_ENTSIZE; - bdp_dma += BUF1_LG_ENTSIZE * sizeof(Buf_descr); - cqp++; - } - - /* - * Initialize queue pointers - */ - fup->fu_buf1l_head = fup->fu_buf1l_tail = fup->fu_buf1l_q; - - return; -} - - -/* - * Supply Buffers to CP - * - * This function will resupply the CP with buffers to be used to - * store incoming data. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_buf_supply(fup) - Fore_unit *fup; -{ - - /* - * First, clean out the supply queues - */ - fore_buf_drain(fup); - - /* - * Then, supply the buffers for each queue - */ - fore_buf_supply_1s(fup); - fore_buf_supply_1l(fup); - - return; -} - - -/* - * Supply Strategy 1 Small Buffers to CP - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -static void -fore_buf_supply_1s(fup) - Fore_unit *fup; -{ - H_buf_queue *hbp; - Buf_queue *cqp; - Buf_descr *bdp; - Buf_handle *bhp; - KBuffer *m; - int nvcc, nbuf, i; - - /* - * Figure out how many buffers we should be giving to the CP. - * We're basing this calculation on the current number of open - * VCCs thru this device, with certain minimum and maximum values - * enforced. This will then allow us to figure out how many more - * buffers we need to supply to the CP. This will be rounded up - * to fill a supply queue entry. - */ - nvcc = MAX(fup->fu_open_vcc, BUF_MIN_VCC); - nbuf = nvcc * 4; - nbuf = MIN(nbuf, BUF1_SM_CPPOOL); - nbuf -= fup->fu_buf1s_cnt; - nbuf = roundup(nbuf, BUF1_SM_ENTSIZE); - - /* - * OK, now supply the buffers to the CP - */ - while (nbuf > 0) { - - /* - * Acquire a supply queue entry - */ - hbp = fup->fu_buf1s_tail; - if (!((*hbp->hbq_status) & QSTAT_FREE)) - break; - bdp = hbp->hbq_descr; - - /* - * Get a buffer for each descriptor in the queue entry - */ - for (i = 0; i < BUF1_SM_ENTSIZE; i++, bdp++) { - caddr_t cp; - - /* - * Get a small buffer - */ - KB_ALLOCPKT(m, BUF1_SM_SIZE, KB_F_NOWAIT, KB_T_DATA); - if (m == 0) { - break; - } - KB_HEADSET(m, BUF1_SM_DOFF); - - /* - * Point to buffer handle structure - */ - bhp = (Buf_handle *)((caddr_t)m + BUF1_SM_HOFF); - bhp->bh_type = BHT_S1_SMALL; - - /* - * Setup buffer descriptor - */ - bdp->bsd_handle = bhp; - KB_DATASTART(m, cp, caddr_t); - bhp->bh_dma = bdp->bsd_buffer = vtophys(cp); - if (bdp->bsd_buffer == 0) { - /* - * Unable to assign dma address - free up - * this descriptor's buffer - */ - fup->fu_stats->st_drv.drv_bf_segdma++; - KB_FREEALL(m); - break; - } - - /* - * All set, so queue buffer (handle) - */ - ENQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1s_bq); - } - - /* - * If we we're not able to fill all the descriptors for - * an entry, free up what's been partially built - */ - if (i != BUF1_SM_ENTSIZE) { - caddr_t cp; - - /* - * Clean up each used descriptor - */ - for (bdp = hbp->hbq_descr; i; i--, bdp++) { - - bhp = bdp->bsd_handle; - - DEQUEUE(bhp, Buf_handle, bh_qelem, - fup->fu_buf1s_bq); - - m = (KBuffer *) - ((caddr_t)bhp - BUF1_SM_HOFF); - KB_DATASTART(m, cp, caddr_t); - KB_FREEALL(m); - } - break; - } - - /* - * Finally, we've got an entry ready for the CP. - * So claim the host queue entry and setup the CP-resident - * queue entry. The CP will (potentially) grab the supplied - * buffers when the descriptor pointer is set. - */ - fup->fu_buf1s_tail = hbp->hbq_next; - (*hbp->hbq_status) = QSTAT_PENDING; - cqp = hbp->hbq_cpelem; - cqp->cq_descr = (CP_dma) CP_WRITE((u_long)hbp->hbq_descr_dma); - - /* - * Update counters, etc for supplied buffers - */ - fup->fu_buf1s_cnt += BUF1_SM_ENTSIZE; - nbuf -= BUF1_SM_ENTSIZE; - } - - return; -} - - -/* - * Supply Strategy 1 Large Buffers to CP - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -static void -fore_buf_supply_1l(fup) - Fore_unit *fup; -{ - H_buf_queue *hbp; - Buf_queue *cqp; - Buf_descr *bdp; - Buf_handle *bhp; - KBuffer *m; - int nvcc, nbuf, i; - - /* - * Figure out how many buffers we should be giving to the CP. - * We're basing this calculation on the current number of open - * VCCs thru this device, with certain minimum and maximum values - * enforced. This will then allow us to figure out how many more - * buffers we need to supply to the CP. This will be rounded up - * to fill a supply queue entry. - */ - nvcc = MAX(fup->fu_open_vcc, BUF_MIN_VCC); - nbuf = nvcc * 4 * RECV_MAX_SEGS; - nbuf = MIN(nbuf, BUF1_LG_CPPOOL); - nbuf -= fup->fu_buf1l_cnt; - nbuf = roundup(nbuf, BUF1_LG_ENTSIZE); - - /* - * OK, now supply the buffers to the CP - */ - while (nbuf > 0) { - - /* - * Acquire a supply queue entry - */ - hbp = fup->fu_buf1l_tail; - if (!((*hbp->hbq_status) & QSTAT_FREE)) - break; - bdp = hbp->hbq_descr; - - /* - * Get a buffer for each descriptor in the queue entry - */ - for (i = 0; i < BUF1_LG_ENTSIZE; i++, bdp++) { - caddr_t cp; - - /* - * Get a cluster buffer - */ - KB_ALLOCEXT(m, BUF1_LG_SIZE, KB_F_NOWAIT, KB_T_DATA); - if (m == 0) { - break; - } - KB_HEADSET(m, BUF1_LG_DOFF); - - /* - * Point to buffer handle structure - */ - bhp = (Buf_handle *)((caddr_t)m + BUF1_LG_HOFF); - bhp->bh_type = BHT_S1_LARGE; - - /* - * Setup buffer descriptor - */ - bdp->bsd_handle = bhp; - KB_DATASTART(m, cp, caddr_t); - bhp->bh_dma = bdp->bsd_buffer = vtophys(cp); - if (bdp->bsd_buffer == 0) { - /* - * Unable to assign dma address - free up - * this descriptor's buffer - */ - fup->fu_stats->st_drv.drv_bf_segdma++; - KB_FREEALL(m); - break; - } - - /* - * All set, so queue buffer (handle) - */ - ENQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1l_bq); - } - - /* - * If we we're not able to fill all the descriptors for - * an entry, free up what's been partially built - */ - if (i != BUF1_LG_ENTSIZE) { - caddr_t cp; - - /* - * Clean up each used descriptor - */ - for (bdp = hbp->hbq_descr; i; i--, bdp++) { - bhp = bdp->bsd_handle; - - DEQUEUE(bhp, Buf_handle, bh_qelem, - fup->fu_buf1l_bq); - - m = (KBuffer *) - ((caddr_t)bhp - BUF1_LG_HOFF); - KB_DATASTART(m, cp, caddr_t); - KB_FREEALL(m); - } - break; - } - - /* - * Finally, we've got an entry ready for the CP. - * So claim the host queue entry and setup the CP-resident - * queue entry. The CP will (potentially) grab the supplied - * buffers when the descriptor pointer is set. - */ - fup->fu_buf1l_tail = hbp->hbq_next; - (*hbp->hbq_status) = QSTAT_PENDING; - cqp = hbp->hbq_cpelem; - cqp->cq_descr = (CP_dma) CP_WRITE((u_long)hbp->hbq_descr_dma); - - /* - * Update counters, etc for supplied buffers - */ - fup->fu_buf1l_cnt += BUF1_LG_ENTSIZE; - nbuf -= BUF1_LG_ENTSIZE; - } - - return; -} - - -/* - * Drain Buffer Supply Queues - * - * This function will free all completed entries at the head of each - * buffer supply queue. Since we consider the CP to "own" the buffers - * once we put them on a supply queue and since a completed supply queue - * entry is only telling us that the CP has accepted the buffers that we - * gave to it, there's not much to do here. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -static void -fore_buf_drain(fup) - Fore_unit *fup; -{ - H_buf_queue *hbp; - - /* - * Drain Strategy 1 Small Queue - */ - - /* - * Process each completed entry - */ - while (*fup->fu_buf1s_head->hbq_status & QSTAT_COMPLETED) { - - hbp = fup->fu_buf1s_head; - - if (*hbp->hbq_status & QSTAT_ERROR) { - /* - * XXX - what does this mean??? - */ - log(LOG_ERR, "fore_buf_drain: buf1s queue error\n"); - } - - /* - * Mark this entry free for use and bump head pointer - * to the next entry in the queue - */ - *hbp->hbq_status = QSTAT_FREE; - fup->fu_buf1s_head = hbp->hbq_next; - } - - - /* - * Drain Strategy 1 Large Queue - */ - - /* - * Process each completed entry - */ - while (*fup->fu_buf1l_head->hbq_status & QSTAT_COMPLETED) { - - hbp = fup->fu_buf1l_head; - - if (*hbp->hbq_status & QSTAT_ERROR) { - /* - * XXX - what does this mean??? - */ - log(LOG_ERR, "fore_buf_drain: buf1l queue error\n"); - } - - /* - * Mark this entry free for use and bump head pointer - * to the next entry in the queue - */ - *hbp->hbq_status = QSTAT_FREE; - fup->fu_buf1l_head = hbp->hbq_next; - } - - return; -} - - -/* - * Free Buffer Supply Queue Data Structures - * - * Arguments: - * fup pointer to device unit structure - * - * Returns: - * none - */ -void -fore_buf_free(fup) - Fore_unit *fup; -{ - Buf_handle *bhp; - KBuffer *m; - - /* - * Free any previously supplied and not returned buffers - */ - if (fup->fu_flags & CUF_INITED) { - - /* - * Run through Strategy 1 Small queue - */ - while ((bhp = Q_HEAD(fup->fu_buf1s_bq, Buf_handle)) != NULL) { - caddr_t cp; - - /* - * Back off to buffer - */ - m = (KBuffer *)((caddr_t)bhp - BUF1_SM_HOFF); - - /* - * Dequeue handle and free buffer - */ - DEQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1s_bq); - - KB_DATASTART(m, cp, caddr_t); - KB_FREEALL(m); - } - - /* - * Run through Strategy 1 Large queue - */ - while ((bhp = Q_HEAD(fup->fu_buf1l_bq, Buf_handle)) != NULL) { - caddr_t cp; - - /* - * Back off to buffer - */ - m = (KBuffer *)((caddr_t)bhp - BUF1_LG_HOFF); - - /* - * Dequeue handle and free buffer - */ - DEQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1l_bq); - - KB_DATASTART(m, cp, caddr_t); - KB_FREEALL(m); - } - } - - /* - * Free the status words - */ - if (fup->fu_buf1s_stat) { - atm_dev_free((volatile void *)fup->fu_buf1s_stat); - fup->fu_buf1s_stat = NULL; - fup->fu_buf1s_statd = 0; - fup->fu_buf1l_stat = NULL; - fup->fu_buf1l_statd = 0; - } - - /* - * Free the transmit descriptors - */ - if (fup->fu_buf1s_desc) { - atm_dev_free(fup->fu_buf1s_desc); - fup->fu_buf1s_desc = NULL; - fup->fu_buf1s_descd = 0; - fup->fu_buf1l_desc = NULL; - fup->fu_buf1l_descd = 0; - } - - return; -} - Property changes on: head/sys/dev/hfa/fore_buffer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/fore_globals.c =================================================================== --- head/sys/dev/hfa/fore_globals.c (revision 179307) +++ head/sys/dev/hfa/fore_globals.c (nonexistent) @@ -1,114 +0,0 @@ -/*- - * =================================== - * 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. - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * FORE Systems 200-Series Adapter Support - * --------------------------------------- - * - * Global variable definitions - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - -/* - * Device unit table - */ -Fore_unit *fore_units[FORE_MAX_UNITS] = {NULL}; -int fore_nunits = 0; - - -/* - * ATM Interface services - */ -static struct stack_defn fore_svaal5 = { - NULL, - SAP_CPCS_AAL5, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -static struct stack_defn fore_svaal4 = { - &fore_svaal5, - SAP_CPCS_AAL3_4, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -static struct stack_defn fore_svaal0 = { - &fore_svaal4, - SAP_ATM, - SDF_TERM, - atm_dev_inst, - atm_dev_lower, - NULL, - 0, -}; -struct stack_defn *fore_services = &fore_svaal0; - - -/* - * Storage pools - */ -uma_zone_t fore_nif_zone; -uma_zone_t fore_vcc_zone; - -/* - * Watchdog timer - */ -struct atm_time fore_timer = {0, 0}; - Property changes on: head/sys/dev/hfa/fore_globals.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/dev/hfa/hfa_pci.c =================================================================== --- head/sys/dev/hfa/hfa_pci.c (revision 179307) +++ head/sys/dev/hfa/hfa_pci.c (nonexistent) @@ -1,213 +0,0 @@ -/*- - * Copyright (c) 2002 Matthew N. Dodd - * 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. - * - */ - -#include -__FBSDID("$FreeBSD$"); - -/* - * - * =================================== - * 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. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -static int hfa_pci_probe(device_t); -static int hfa_pci_attach(device_t); - -#define FORE_PCA200EPC_ID 0x0300 - -static int -hfa_pci_probe (dev) - device_t dev; -{ - if ((pci_get_vendor(dev) == FORE_VENDOR_ID) && - (pci_get_device(dev) == FORE_PCA200EPC_ID)) { - device_set_desc(dev, "FORE Systems PCA-200EPC ATM"); - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); -} - -static int -hfa_pci_attach (dev) - device_t dev; -{ - struct hfa_softc *sc; - Fore_unit *fup; - u_int32_t command; - vm_offset_t va; - int error; - - sc = device_get_softc(dev); - fup = &sc->fup; - error = 0; - - pci_enable_busmaster(dev); - - sc->mem_rid = PCA200E_PCI_MEMBASE; - sc->mem_type = SYS_RES_MEMORY; - sc->irq_rid = 0; - - error = hfa_alloc(dev); - if (error) { - device_printf(dev, "hfa_alloc() failed.\n"); - goto fail; - } - - va = (vm_offset_t) rman_get_virtual(sc->mem); - - fup->fu_ram = (Fore_mem *)va; - fup->fu_ramsize = PCA200E_RAM_SIZE; - fup->fu_mon = (Mon960 *)(fup->fu_ram + MON960_BASE); - fup->fu_ctlreg = (Fore_reg *)(va + PCA200E_HCR_OFFSET); - fup->fu_imask = (Fore_reg *)(va + PCA200E_IMASK_OFFSET); - fup->fu_psr = (Fore_reg *)(va + PCA200E_PSR_OFFSET); - - /* - * Convert Endianess of Slave RAM accesses - */ - command = pci_read_config(dev, PCA200E_PCI_MCTL, 4); - command |= PCA200E_MCTL_SWAP; - pci_write_config(dev, PCA200E_PCI_MCTL, command, 4); - - /* - * Map interrupt in - */ - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - NULL, hfa_intr, sc, &sc->irq_ih); - if (error) { - device_printf(dev, "Interrupt handler setup failed.\n"); - goto fail; - } - - fup->fu_config.ac_bustype = BUS_PCI; - fup->fu_config.ac_busslot = (pci_get_bus(dev) << 8)| pci_get_slot(dev); - - switch (pci_get_device(dev)) { - case FORE_PCA200EPC_ID: - fup->fu_config.ac_device = DEV_FORE_PCA200E; - break; - default: - fup->fu_config.ac_device = DEV_UNKNOWN; - break; - } - - error = hfa_attach(dev); - if (error) { - device_printf(dev, "hfa_attach() failed.\n"); - goto fail; - } - - return (0); - -fail: - hfa_detach(dev); - - return (error); -} - -static device_method_t hfa_pci_methods[] = { - DEVMETHOD(device_probe, hfa_pci_probe), - DEVMETHOD(device_attach, hfa_pci_attach), - - DEVMETHOD(device_detach, hfa_detach), - - { 0, 0 } -}; - -static driver_t hfa_pci_driver = { - "hfa", - hfa_pci_methods, - sizeof(struct hfa_softc) -}; - -DRIVER_MODULE(hfa, pci, hfa_pci_driver, hfa_devclass, 0, 0); -MODULE_DEPEND(hfa, hfa, 1, 1, 1); -MODULE_DEPEND(hfa, pci, 1, 1, 1); Property changes on: head/sys/dev/hfa/hfa_pci.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/kern/Make.tags.inc =================================================================== --- head/sys/kern/Make.tags.inc (revision 179307) +++ head/sys/kern/Make.tags.inc (revision 179308) @@ -1,103 +1,101 @@ # $FreeBSD$ # @(#)Make.tags.inc 8.1 (Berkeley) 6/11/93 SYS?= ${.CURDIR}/.. # Common files for "make tags", included by the Makefile for each # architecture. # Put the /sys/sys include files at the end so that subroutine definitions # win when there is a struct tag with the same name (e.g., vmmeter). The # better solution would be for ctags to generate "struct vmmeter" tags. COMM= ${SYS}/dev/advansys/*.[ch] \ ${SYS}/dev/aha/*.[ch] \ ${SYS}/dev/aic7xxx/*.[ch] \ ${SYS}/dev/buslogic/*.[ch] \ ${SYS}/dev/dpt/*.[ch] \ ${SYS}/dev/en/*.[ch] \ ${SYS}/dev/hfa/*.[ch] \ ${SYS}/dev/iicbus/*.[ch] \ ${SYS}/dev/isp/*.[ch] \ ${SYS}/dev/pdq/*.[ch] \ ${SYS}/dev/ppbus/*.[ch] \ ${SYS}/dev/smbus/*.[ch] \ ${SYS}/dev/vx/*.[ch] \ ${SYS}/fs/cd9660/*.[ch] \ ${SYS}/fs/deadfs/*.[ch] \ ${SYS}/fs/devfs/*.[ch] \ ${SYS}/fs/fdescfs/*.[ch] \ ${SYS}/fs/fifofs/*.[ch] \ ${SYS}/fs/hpfs/*.[ch] \ ${SYS}/fs/msdosfs/*.[ch] \ ${SYS}/fs/ntfs/*.[ch] \ ${SYS}/fs/nullfs/*.[ch] \ ${SYS}/fs/nwfs/*.[ch] \ ${SYS}/fs/portalfs/*.[ch] \ ${SYS}/fs/procfs/*.[ch] \ ${SYS}/fs/smbfs/*.[ch] \ ${SYS}/fs/udf/*.[ch] \ ${SYS}/fs/unionfs/*.[ch] \ ${SYS}/kern/*.[ch] \ ${SYS}/net/*.[ch] \ ${SYS}/netatalk/*.[ch] \ - ${SYS}/netatm/*.[ch] \ ${SYS}/netinet/*.[ch] \ ${SYS}/netinet6/*.[ch] \ ${SYS}/netipsec/*.[ch] \ ${SYS}/netipx/*.[ch] \ ${SYS}/netnatm/*.[ch] \ ${SYS}/nfs/*.[ch] \ ${SYS}/nfsclient/*.[ch] \ ${SYS}/nfsserver/*.[ch] \ ${SYS}/pci/*.[ch] \ ${SYS}/ufs/ffs/*.[ch] \ ${SYS}/ufs/ufs/*.[ch] \ ${SYS}/vm/*.[ch] \ ${SYS}/sys/*.[ch] COMMDIR1= ${SYS}/conf \ ${SYS}/kern \ ${SYS}/net \ ${SYS}/netatalk \ - ${SYS}/netatm \ ${SYS}/netinet \ ${SYS}/netinet6 \ ${SYS}/netipsec \ ${SYS}/netipx \ ${SYS}/netnatm \ ${SYS}/nfs \ ${SYS}/pci \ ${SYS}/vm \ ${SYS}/sys COMMDIR2= ${SYS}/dev/advansys \ ${SYS}/dev/aha \ ${SYS}/dev/aic7xxx \ ${SYS}/dev/buslogic \ ${SYS}/dev/ccd \ ${SYS}/dev/dec \ ${SYS}/dev/dpt \ ${SYS}/dev/en \ ${SYS}/dev/hea \ ${SYS}/dev/hfa \ ${SYS}/dev/iicbus \ ${SYS}/dev/isp \ ${SYS}/dev/pdq \ ${SYS}/dev/ppbus \ ${SYS}/dev/smbus \ ${SYS}/dev/vn \ ${SYS}/dev/vx \ ${SYS}/fs/deadfs \ ${SYS}/fs/devfs \ ${SYS}/fs/fdescfs \ ${SYS}/fs/fifofs \ ${SYS}/fs/msdosfs \ ${SYS}/fs/nullfs \ ${SYS}/fs/portalfs \ ${SYS}/fs/procfs \ ${SYS}/fs/specfs \ ${SYS}/fs/unionfs \ ${SYS}/fs/cd9660 \ ${SYS}/ufs/ffs \ ${SYS}/ufs/ufs Index: head/sys/modules/idt/Makefile =================================================================== --- head/sys/modules/idt/Makefile (revision 179307) +++ head/sys/modules/idt/Makefile (nonexistent) @@ -1,9 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../dev/idt - -KMOD= idt -SRCS= idt_pci.c idt_harp.c idt.c -SRCS+= pci_if.h device_if.h bus_if.h - -.include Property changes on: head/sys/modules/idt/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/harp/Makefile =================================================================== --- head/sys/modules/harp/Makefile (revision 179307) +++ head/sys/modules/harp/Makefile (nonexistent) @@ -1,13 +0,0 @@ -# $FreeBSD$ -# -# Author: Harti Brandt -# -.PATH: ${.CURDIR}/../../dev/harp - -KMOD= if_harp -SRCS= if_harp.c device_if.h - -CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../include -CFLAGS+= -DDEBUG -DINVARIANTS - -.include Property changes on: head/sys/modules/harp/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/Makefile.inc =================================================================== --- head/sys/modules/hfa/Makefile.inc (revision 179307) +++ head/sys/modules/hfa/Makefile.inc (nonexistent) @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" Property changes on: head/sys/modules/hfa/Makefile.inc ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/pci/Makefile =================================================================== --- head/sys/modules/hfa/pci/Makefile (revision 179307) +++ head/sys/modules/hfa/pci/Makefile (nonexistent) @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../dev/hfa - -KMOD= hfa_pci -SRCS= hfa_pci.c pci_if.h device_if.h bus_if.h - -.include Property changes on: head/sys/modules/hfa/pci/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/sbus/Makefile =================================================================== --- head/sys/modules/hfa/sbus/Makefile (revision 179307) +++ head/sys/modules/hfa/sbus/Makefile (nonexistent) @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../dev/hfa - -KMOD= hfa_sbus -SRCS= hfa_sbus.c device_if.h bus_if.h - -.include Property changes on: head/sys/modules/hfa/sbus/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/Makefile =================================================================== --- head/sys/modules/hfa/Makefile (revision 179307) +++ head/sys/modules/hfa/Makefile (nonexistent) @@ -1,15 +0,0 @@ -# $FreeBSD$ - -SUBDIR= ${eisa} hfa pci ${sbus} - -.ifdef notyet -.if ${MACHINE_ARCH} == "i386" -eisa= eisa -.endif - -.if ${MACHINE} == "sparc64" -sbus= sbus -.endif -.endif - -.include Property changes on: head/sys/modules/hfa/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/eisa/Makefile =================================================================== --- head/sys/modules/hfa/eisa/Makefile (revision 179307) +++ head/sys/modules/hfa/eisa/Makefile (nonexistent) @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../dev/hfa - -KMOD= hfa_eisa -SRCS= hfa_eisa.c eisa_if.h device_if.h bus_if.h - -.include Property changes on: head/sys/modules/hfa/eisa/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/hfa/hfa/Makefile =================================================================== --- head/sys/modules/hfa/hfa/Makefile (revision 179307) +++ head/sys/modules/hfa/hfa/Makefile (nonexistent) @@ -1,13 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../dev/hfa - -KMOD= hfa -SRCS= hfa_freebsd.c \ - fore_buffer.c fore_init.c fore_receive.c fore_vcm.c \ - fore_command.c fore_intr.c fore_stats.c \ - fore_globals.c fore_timer.c \ - fore_if.c fore_output.c fore_transmit.c \ - device_if.h bus_if.h - -.include Property changes on: head/sys/modules/hfa/hfa/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/Makefile =================================================================== --- head/sys/modules/Makefile (revision 179307) +++ head/sys/modules/Makefile (revision 179308) @@ -1,675 +1,662 @@ # $FreeBSD$ .include SUBDIR= ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ accf_data \ accf_http \ ${_acpi} \ age \ ${_agp} \ aha \ ${_ahb} \ ${_aic} \ aic7xxx \ aio \ ${_amd} \ amr \ ${_an} \ ${_aout} \ ${_apm} \ ${_ar} \ ${_arcmsr} \ ${_arcnet} \ ${_arl} \ ${_asmc} \ ${_asr} \ ata \ ${_ath} \ ${_ath_hal} \ ${_ath_rate_amrr} \ ${_ath_rate_onoe} \ ${_ath_rate_sample} \ aue \ ${_auxio} \ axe \ bce \ bfe \ bge \ ${_bios} \ ${_bktr} \ bridgestp \ cam \ ${_canbepm} \ ${_canbus} \ ${_cardbus} \ ${_cbb} \ cd9660 \ cd9660_iconv \ cdce \ ${_ce} \ ${_ciss} \ ${_cm} \ ${_cmx} \ coda \ coda5 \ ${_coff} \ ${_coretemp} \ ${_cp} \ ${_cpufreq} \ ${_crypto} \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ cue \ ${_cx} \ cxgb \ ${_cyclic} \ dc \ dcons \ dcons_crom \ de \ ${_digi} \ ${_dpt} \ ${_drm} \ ${_dtrace} \ dummynet \ ${_ed} \ ${_elink} \ ${_em} \ en \ ${_ep} \ ${_ex} \ ${_exca} \ ${_ext2fs} \ fatm \ fdc \ fdescfs \ ${_fe} \ firewire \ firmware \ fxp \ gem \ geom \ - ${_harp} \ hatm \ - ${_hfa} \ hifn \ hme \ ${_hptiop} \ ${_hptmv} \ ${_hptrr} \ hwpmc \ ${_i2c} \ ${_ibcs2} \ ${_ichwd} \ ${_ida} \ - ${_idt} \ ${_ie} \ if_bridge \ if_disc \ if_edsc \ if_ef \ if_faith \ if_gif \ if_gre \ if_lagg \ ${_if_ndis} \ if_ppp \ if_sl \ if_stf \ if_tap \ if_tun \ if_vlan \ ${_igb} \ ${_iir} \ ${_io} \ ipdivert \ ${_ipfilter} \ ipfw \ ipfw_nat \ ${_ipmi} \ ip_mroute_mod \ ${_ips} \ ${_ipw} \ ${_ipwfw} \ iscsi \ isp \ ispfw \ ${_iwi} \ ${_iwifw} \ ${_iwn} \ ${_iwnfw} \ ${_ixgb} \ joy \ ${_k8temp} \ kbdmux \ krpc \ kue \ le \ lge \ libalias \ libiconv \ libmbpool \ libmchain \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ lmc \ lpt \ mac_biba \ mac_bsdextended \ mac_ifoff \ mac_lomac \ mac_mls \ mac_none \ mac_partition \ mac_portacl \ mac_seeotheruids \ mac_stub \ mac_test \ malo \ mcd \ md \ mem \ mfi \ mii \ mlx \ ${_mly} \ mpt \ mqueue \ msdosfs \ msdosfs_iconv \ ${_mse} \ msk \ mxge \ my \ ${_ncp} \ ${_ncv} \ ${_ndis} \ netgraph \ ${_nfe} \ nfsclient \ nfslockd \ nfsserver \ nge \ nmdm \ ${_nsp} \ ntfs \ ntfs_iconv \ nullfs \ ${_nve} \ ${_nvram} \ ${_nwfs} \ ${_nxge} \ ${_oltr} \ ${_opensolaris} \ ${_padlock} \ patm \ ${_pccard} \ ${_pcfclock} \ pcn \ ${_pecoff} \ ${_pf} \ ${_pflog} \ plip \ ${_pmc} \ portalfs \ ppbus \ ppc \ ppi \ pps \ procfs \ pseudofs \ ${_pst} \ puc \ ral \ ${_random} \ ${_ray} \ rc \ rc4 \ ${_rdma} \ re \ reiserfs \ rl \ rp \ rue \ rum \ ${_s3} \ ${_safe} \ ${_sbni} \ sbsh \ scc \ scd \ ${_scsi_low} \ sem \ sf \ ${_sio} \ sis \ sk \ ${_smbfs} \ sn \ ${_snc} \ snp \ ${_sound} \ ${_speaker} \ ${_splash} \ ${_sppp} \ ${_sr} \ ste \ ${_stg} \ stge \ ${_streams} \ sym \ ${_syscons} \ sysvipc \ ti \ tl \ ${_tmpfs} \ trm \ ${_twa} \ twe \ tx \ txp \ uark \ uart \ ubsa \ ubsec \ ubser \ ucom \ ucycom \ udav \ udbp \ udf \ udf_iconv \ ufm \ ${_ufs} \ ufoma \ uftdi \ ugen \ uhid \ ukbd \ ulpt \ umass \ umct \ umodem \ ums \ unionfs \ uplcom \ ural \ urio \ usb \ uscanner \ uslcom \ utopia \ uvisor \ uvscom \ ${_vesa} \ vge \ vkbd \ ${_vpo} \ vr \ vx \ wb \ ${_wi} \ wlan \ wlan_acl \ wlan_amrr \ wlan_ccmp \ wlan_rssadapt \ wlan_tkip \ wlan_wep \ wlan_xauth \ ${_wpi} \ ${_wpifw} \ ${_xe} \ xfs \ xl \ ${_zfs} \ zlib \ zyd .if ${MACHINE_ARCH} != "powerpc" _syscons= syscons _vpo= vpo .endif .if defined(ALL_MODULES) _ufs= ufs .endif -# Disabled in 7.0 as netatm is not MPSAFE. -#if ${MK_ATM} != "no" -#_harp= harp -#.endif - .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) _crypto= crypto _cryptodev= cryptodev .endif .if exists(${.CURDIR}/../crypto) _random= random .endif .endif .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) _ipfilter= ipfilter .endif .if ${MK_PF} != "no" || defined(ALL_MODULES) _pf= pf _pflog= pflog .endif .if ${MACHINE_ARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed # XXX some of these can move now, but are untested on other architectures. _3dfx= 3dfx _3dfx_linux= 3dfx_linux _agp= agp _aic= aic _amd= amd _an= an _aout= aout _apm= apm _ar= ar _arcnet= arcnet _ath= ath _ath_hal= ath_hal _ath_rate_amrr= ath_rate_amrr _ath_rate_onoe= ath_rate_onoe _ath_rate_sample=ath_rate_sample _bktr= bktr _cardbus= cardbus _cbb= cbb _ce= ce _coff= coff _cp= cp _cpufreq= cpufreq _cs= cs .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _cyclic= cyclic .endif _digi= digi _drm= drm .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif _ed= ed _elink= elink _em= em _ep= ep _exca= exca _ext2fs= ext2fs _fe= fe -# Disabled due to non-MPSAFEty in 7.0 -#_hfa= hfa _i2c= i2c _ibcs2= ibcs2 _ie= ie _if_ndis= if_ndis _igb= igb _io= io _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux _mse= mse .if ${MK_NCP} != "no" _ncp= ncp .endif _ncv= ncv _ndis= ndis _nsp= nsp .if ${MK_NCP} != "no" _nwfs= nwfs .endif _oltr= oltr .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif _pccard= pccard _pcfclock= pcfclock _pecoff= pecoff _pst= pst _ray= ray _rdma= rdma _safe= safe _sbni= sbni _scsi_low= scsi_low _sio= sio _smbfs= smbfs _sound= sound _speaker= speaker _splash= splash _sppp= sppp _sr= sr _stg= stg _streams= streams _tmpfs= tmpfs _wi= wi _xe= xe .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif .if ${MACHINE} == "i386" _aac= aac _acpi= acpi _ahb= ahb _arcmsr= arcmsr _arl= arl _asmc= asmc _asr= asr _bios= bios _ciss= ciss _cm= cm _cmx= cmx _coretemp= coretemp _ctau= ctau _cx= cx _dpt= dpt _ex= ex _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr _ichwd= ichwd _ida= ida -# Disabled due to non-MPSAFEty in 7.0 -#_idt= idt _iir= iir _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw _iwi= iwi _iwifw= iwifw _iwn= iwn _iwnfw= iwnfw _ixgb= ixgb _mly= mly _nfe= nfe _nve= nve _nvram= nvram _nxge= nxge _wpi= wpi _wpifw= wpifw .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${.CURDIR}/../crypto/via) _padlock= padlock .endif .endif _s3= s3 _twa= twa _vesa= vesa .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus _pmc= pmc _snc= snc .endif .endif .if ${MACHINE_ARCH} == "amd64" _aac= aac _acpi= acpi _agp= agp _an= an _arcmsr= arcmsr _asmc= asmc _ath= ath _ath_hal= ath_hal _ath_rate_amrr= ath_rate_amrr _ath_rate_onoe= ath_rate_onoe _ath_rate_sample=ath_rate_sample _cardbus= cardbus _cbb= cbb _cmx= cmx _ciss= ciss _coretemp= coretemp _cpufreq= cpufreq .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _cyclic= cyclic .endif _digi= digi _drm= drm .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _dtrace= dtrace .endif _ed= ed _em= em _exca= exca _ext2fs= ext2fs _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr _i2c= i2c _ichwd= ichwd _ida= ida _if_ndis= if_ndis _igb= igb _iir= iir _io= io _ipmi= ipmi _ips= ips _ipw= ipw _ipwfw= ipwfw _iwn= iwn _iwnfw= iwnfw _ixgb= ixgb _k8temp= k8temp _linprocfs= linprocfs _linsysfs= linsysfs _linux= linux _mly= mly _ndis= ndis _nfe= nfe _nve= nve _nvram= nvram _nxge= nxge .if ${MK_CDDL} != "no" || defined(ALL_MODULES) _opensolaris= opensolaris .endif _pccard= pccard _rdma= rdma _safe= safe _scsi_low= scsi_low _smbfs= smbfs _sound= sound _speaker= speaker _sppp= sppp _tmpfs= tmpfs _twa= twa _wi= wi _wpi= wpi _wpifw= wpifw .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif .endif .if ${MACHINE_ARCH} == "ia64" # Modules not enabled on ia64 (as compared to i386) include: # aac acpi aout apm atspeaker drm ibcs2 linprocfs linux ncv # nsp oltr pecoff s3 sbni stg vesa # acpi is not enabled because it is broken as a module on ia64 _aic= aic #_ar= ar not 64-bit clean _an= an _arcnet= arcnet _asr= asr _bktr= bktr _cardbus= cardbus _cbb= cbb _ciss= ciss _cm= cm _cmx= cmx _coff= coff _cpufreq= cpufreq _em= em _ep= ep _exca= exca _fe= fe -_hfa= hfa _igb= igb _iir= iir _mly= mly _pccard= pccard _scsi_low= scsi_low _smbfs= smbfs _sound= sound _splash= splash _sppp= sppp #_sr= sr not 64bit clean _streams= streams _wi= wi _xe= xe .endif .if ${MACHINE_ARCH} == "powerpc" _an= an _ath= ath _ath_hal= ath_hal _ath_rate_amrr= ath_rate_amrr _ath_rate_onoe= ath_rate_onoe _ath_rate_sample=ath_rate_sample _nvram= powermac_nvram _smbfs= smbfs .endif .if ${MACHINE_ARCH} == "sparc64" _ath= ath _ath_hal= ath_hal _ath_rate_amrr= ath_rate_amrr _ath_rate_onoe= ath_rate_onoe _ath_rate_sample=ath_rate_sample _auxio= auxio _em= em _i2c= i2c _igb= igb _sound= sound .if ${MK_ZFS} != "no" || defined(ALL_MODULES) _zfs= zfs .endif .endif .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) SUBDIR=${MODULES_OVERRIDE} .endif .for reject in ${WITHOUT_MODULES} SUBDIR:= ${SUBDIR:N${reject}} .endfor # Calling kldxref(8) for each module is expensive. .if !defined(NO_XREF) .MAKEFLAGS+= -DNO_XREF afterinstall: @if type kldxref >/dev/null 2>&1; then \ ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \ kldxref ${DESTDIR}${KMODDIR}; \ fi .endif .include Index: head/sys/modules/netgraph/atm/atmpif/Makefile =================================================================== --- head/sys/modules/netgraph/atm/atmpif/Makefile (revision 179307) +++ head/sys/modules/netgraph/atm/atmpif/Makefile (nonexistent) @@ -1,10 +0,0 @@ -# $FreeBSD$ -# -# Author: Harti Brandt -# -.PATH: ${.CURDIR}/../../../../netgraph/atm/atmpif - -KMOD= ng_atmpif -SRCS= ng_atmpif.c ng_atmpif_harp.c - -.include Property changes on: head/sys/modules/netgraph/atm/atmpif/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/modules/netgraph/atm/Makefile =================================================================== --- head/sys/modules/netgraph/atm/Makefile (revision 179307) +++ head/sys/modules/netgraph/atm/Makefile (revision 179308) @@ -1,14 +1,11 @@ # $FreeBSD$ SUBDIR= \ atm \ atmbase \ ccatm \ sscfu \ sscop \ uni -# atmpif disabled due to non-MPSAFEty in 7.0 -# atmpif \ - .include Index: head/sys/netgraph/atm/ng_atmpif.h =================================================================== --- head/sys/netgraph/atm/ng_atmpif.h (revision 179307) +++ head/sys/netgraph/atm/ng_atmpif.h (nonexistent) @@ -1,175 +0,0 @@ -/*- - * Copyright (c) 2003 Harti Brandt. - * Copyright (c) 2003 Vincent Jardin. - * 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$ - */ - -#ifndef _NETGRAPH_ATM_NG_ATMPIF_H_ -#define _NETGRAPH_ATM_NG_ATMPIF_H_ - -/* Node type name and magic cookie */ -#define NG_ATMPIF_NODE_TYPE "atmpif" -#define NGM_ATMPIF_COOKIE 967239456 - -/* - * Physical device name - used to configure HARP devices - */ -#ifndef VATMPIF_DEV_NAME -#define VATMPIF_DEV_NAME "hva" /* HARP Virtual ATM */ -#endif - -#define VATMPIF_MAX_VCI 65535 -#define VATMPIF_MAX_VPI 255 - -/* Hook name */ -#define NG_ATMPIF_HOOK_LINK "link" /* virtual link hook */ - -/* - * Node configuration structure - */ -struct ng_vatmpif_config { - uint8_t debug; /* debug bit field (see below) */ - uint32_t pcr; /* peak cell rate */ - Mac_addr macaddr; /* Mac Address */ -}; -/* Keep this in sync with the above structure definition */ -#define NG_ATMPIF_CONFIG_TYPE_INFO { \ - { "debug", &ng_parse_uint8_type }, \ - { "pcr", &ng_parse_uint32_type }, \ - { "macaddr", &ng_mac_addr_type }, \ - { NULL } \ -} - -/* - * Debug bit-fields - */ -#define VATMPIF_DEBUG_NONE 0x00 -#define VATMPIF_DEBUG_PACKET 0x01 /* enable ng_atmpif debugging */ - -#define IS_VATMPIF_DEBUG_PACKET(a) ( (a) \ - && ((a)->conf.debug & VATMPIF_DEBUG_PACKET) ) - -/* - * Statistics - */ -struct hva_stats_ng { - uint32_t ng_errseq; /* Duplicate or out of order */ - uint32_t ng_lostpdu; /* PDU lost detected */ - uint32_t ng_badpdu; /* Unknown PDU type */ - uint32_t ng_rx_novcc; /* Draining PDU on closed VCC */ - uint32_t ng_rx_iqfull; /* PDU drops, no room in atm_intrq */ - uint32_t ng_tx_rawcell; /* PDU raw cells transmitted */ - uint32_t ng_rx_rawcell; /* PDU raw cells received */ - uint64_t ng_tx_pdu; /* PDU transmitted */ - uint64_t ng_rx_pdu; /* PDU received */ -}; -typedef struct hva_stats_ng Hva_Stats_ng; -/* Keep this in sync with the above structure definition */ -#define HVA_STATS_NG_TYPE_INFO \ - { "errSeqOrder", &ng_parse_uint32_type }, \ - { "errLostPDU", &ng_parse_uint32_type }, \ - { "recvBadPDU", &ng_parse_uint32_type }, \ - { "ErrATMVC", &ng_parse_uint32_type }, \ - { "ErrQfull", &ng_parse_uint32_type }, \ - { "xmitRawCell", &ng_parse_uint32_type }, \ - { "recvRawCell", &ng_parse_uint32_type }, \ - { "xmitPDU", &ng_parse_uint64_type }, \ - { "recvPDU", &ng_parse_uint64_type }, - - -struct hva_stats_atm { - uint64_t atm_xmit; /* Cells transmitted */ - uint64_t atm_rcvd; /* Cells received */ -}; -typedef struct hva_stats_atm Hva_Stats_atm; -/* Keep this in sync with the above structure definition */ -#define HVA_STATS_ATM_NG_TYPE_INFO \ - { "xmitATMCells", &ng_parse_uint64_type }, \ - { "recvATMCells", &ng_parse_uint64_type }, - -struct hva_stats_aal5 { - uint64_t aal5_xmit; /* Cells transmitted */ - uint64_t aal5_rcvd; /* Cells received */ - uint32_t aal5_crc_len; /* Cells with CRC/length errors */ - uint32_t aal5_drops; /* Cell drops */ - uint64_t aal5_pdu_xmit; /* CS PDUs transmitted */ - uint64_t aal5_pdu_rcvd; /* CS PDUs received */ - uint32_t aal5_pdu_crc; /* CS PDUs with CRC errors */ - uint32_t aal5_pdu_errs; /* CS layer protocol errors */ - uint32_t aal5_pdu_drops; /* CS PDUs dropped */ -}; -typedef struct hva_stats_aal5 Hva_Stats_aal5; -/* Keep this in sync with the above structure definition */ -#define HVA_STATS_AAL5_NG_TYPE_INFO \ - { "xmitAAL5Cells", &ng_parse_uint64_type }, \ - { "recvAAL5Cells", &ng_parse_uint64_type }, \ - { "AAL5ErrCRCCells", &ng_parse_uint32_type }, \ - { "AAL5DropsCells", &ng_parse_uint32_type }, \ - { "xmitAAL5PDU", &ng_parse_uint64_type }, \ - { "recvAAL5PDU", &ng_parse_uint64_type }, \ - { "AAL5CRCPDU", &ng_parse_uint32_type }, \ - { "AAL5ErrPDU", &ng_parse_uint32_type }, \ - { "AAL5DropsPDU", &ng_parse_uint32_type }, - -struct vatmpif_stats { - Hva_Stats_ng hva_st_ng; /* Netgraph layer stats */ - Hva_Stats_atm hva_st_atm; /* ATM layer stats */ - Hva_Stats_aal5 hva_st_aal5; /* AAL5 layer stats */ -}; -typedef struct vatmpif_stats Vatmpif_stats; -/* Keep this in sync with the above structure definition */ -#define NG_ATMPIF_STATS_TYPE_INFO { \ - HVA_STATS_NG_TYPE_INFO \ - HVA_STATS_ATM_NG_TYPE_INFO \ - HVA_STATS_AAL5_NG_TYPE_INFO \ - { NULL } \ -} - -/* Structure returned by NGM_ATMPIF_GET_LINK_STATUS */ -struct ng_atmpif_link_status { - uint32_t InSeq; /* last received sequence number + 1 */ - uint32_t OutSeq; /* last sent sequence number */ - uint32_t cur_pcr; /* slot's reserved PCR */ -}; -/* Keep this in sync with the above structure definition */ -#define NG_ATMPIF_LINK_STATUS_TYPE_INFO { \ - { "InSeq", &ng_parse_uint32_type }, \ - { "OutSeq", &ng_parse_uint32_type }, \ - { "cur_pcr", &ng_parse_uint32_type }, \ - { NULL } \ -} - -/* Netgraph control messages */ -enum { - NGM_ATMPIF_SET_CONFIG = 1, /* set node configuration */ - NGM_ATMPIF_GET_CONFIG, /* get node configuration */ - NGM_ATMPIF_GET_LINK_STATUS, /* get link status */ - NGM_ATMPIF_GET_STATS, /* get link stats */ - NGM_ATMPIF_CLR_STATS, /* clear link stats */ - NGM_ATMPIF_GETCLR_STATS, /* atomically get & clear link stats */ -}; - -#endif /* _NETGRAPH_NG_ATMPIF_H_ */ Property changes on: head/sys/netgraph/atm/ng_atmpif.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netgraph/atm/atmpif/ng_atmpif.c =================================================================== --- head/sys/netgraph/atm/atmpif/ng_atmpif.c (revision 179307) +++ head/sys/netgraph/atm/atmpif/ng_atmpif.c (nonexistent) @@ -1,706 +0,0 @@ -/*- - * Copyright 2003 Harti Brandt - * Copyright 2003 Vincent Jardin - * 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. - */ - -/* - * ATM Virtal Adapter Support - * -------------------------- - * - * Loadable kernel module and netgraph support - * - */ -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#ifdef NG_SEPARATE_MALLOC -MALLOC_DEFINE(M_NETGRAPH_ATMPIF, "netgraph_vatmpif", - "netgraph HARP virtual Physical Interface"); -#else -#define M_NETGRAPH_ATMPIF M_NETGRAPH -#endif - -/* - * Local definitions - */ - -/* - * Protocol header - */ -struct vatmpif_header { - /* The cell header (minus the HEC) is contained in the least-significant - * 32-bits of a word. - */ - uint32_t cellhdr; /* Stored in network order */ - /* Let's use cellhdr = htonl(ATM_HDR_SET(vpi, vci, pt, clp)) - * and vpi = ATM_HDR_GET_VPI(ntohl(cellhdr)) - * vci = ATM_HDR_GET_VCI(ntohl(cellhdr)) - * pt = ATM_HDR_GET_PT (ntohl(cellhdr)) - * clp = ATM_HDR_GET_CLP(ntohl(cellhdr)) - */ - int32_t seq; /* sequence number in network byte order */ - uint64_t cookie; /* optional field */ - uint8_t aal; /* AAL */ - uint8_t __pad[3]; -}; - -/* - * Local functions - */ - -/* Parse type for a MAC address */ -static ng_parse_t ng_macaddr_parse; -static ng_unparse_t ng_macaddr_unparse; -const struct ng_parse_type ng_mac_addr_type = { - parse: ng_macaddr_parse, - unparse: ng_macaddr_unparse, -}; - - -/* Parse type for struct ng_atmpif_config */ -static const struct ng_parse_struct_field - ng_atmpif_config_type_fields[] = NG_ATMPIF_CONFIG_TYPE_INFO; -static const struct ng_parse_type ng_atmpif_config_type = { - &ng_parse_struct_type, - &ng_atmpif_config_type_fields, -}; - -/* Parse type for struct ng_atmpif_link_status */ -static const struct ng_parse_struct_field - ng_atmpif_link_status_type_fields[] = NG_ATMPIF_LINK_STATUS_TYPE_INFO; -static const struct ng_parse_type ng_atmpif_link_status_type = { - &ng_parse_struct_type, - &ng_atmpif_link_status_type_fields, -}; - -/* Parse type for struct ng_atmpif_stats */ -static const struct ng_parse_struct_field - ng_atmpif_stats_type_fields[] = NG_ATMPIF_STATS_TYPE_INFO; -static const struct ng_parse_type ng_atmpif_stats_type = { - &ng_parse_struct_type, - &ng_atmpif_stats_type_fields, -}; - -static const struct ng_cmdlist ng_atmpif_cmdlist[] = { - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_SET_CONFIG, - "setconfig", - mesgType: &ng_atmpif_config_type, - respType: NULL - }, - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_GET_CONFIG, - "getconfig", - mesgType: NULL, - respType: &ng_atmpif_config_type - }, - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_GET_LINK_STATUS, - "getlinkstatus", - mesgType: NULL, - respType: &ng_atmpif_link_status_type - }, - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_GET_STATS, - "getstats", - mesgType: NULL, - respType: &ng_atmpif_stats_type - }, - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_CLR_STATS, - "clrstats", - mesgType: NULL, - respType: NULL - }, - { - NGM_ATMPIF_COOKIE, - NGM_ATMPIF_GETCLR_STATS, - "getclrstats", - mesgType: NULL, - respType: &ng_atmpif_stats_type - }, - - { 0 } -}; - -uma_zone_t vatmpif_nif_zone; -uma_zone_t vatmpif_vcc_zone; - -/* - * Netgraph node methods - */ -static ng_constructor_t ng_atmpif_constructor; -static ng_rcvmsg_t ng_atmpif_rcvmsg; -static ng_shutdown_t ng_atmpif_rmnode; -static ng_newhook_t ng_atmpif_newhook; -static ng_rcvdata_t ng_atmpif_rcvdata; -static ng_disconnect_t ng_atmpif_disconnect; -static int ng_atmpif_mod_event(module_t, int, void *); - -/* - * Node type descriptor - */ -static struct ng_type ng_atmpif_typestruct = { - .version = NG_ABI_VERSION, - .name = NG_ATMPIF_NODE_TYPE, - .mod_event = ng_atmpif_mod_event, - .constructor = ng_atmpif_constructor, - .rcvmsg = ng_atmpif_rcvmsg, - .shutdown = ng_atmpif_rmnode, - .newhook = ng_atmpif_newhook, - .rcvdata = ng_atmpif_rcvdata, - .disconnect = ng_atmpif_disconnect, - .cmdlist = ng_atmpif_cmdlist, -}; -NETGRAPH_INIT(atmpif, &ng_atmpif_typestruct); - -/****************************************************************** - NETGRAPH NODE METHODS -******************************************************************/ - -/* - * Node constructor - * - * Called at splnet() - */ -static int -ng_atmpif_constructor(node_p nodep) -{ - priv_p priv; - - /* - * Allocate and initialize private info - */ - priv = malloc(sizeof(*priv), M_NETGRAPH_ATMPIF, M_NOWAIT | M_ZERO); - if (priv == NULL) - return (ENOMEM); - - priv->conf.debug = 0x00; - priv->conf.pcr = ATM_PCR_OC3C; - priv->conf.macaddr.ma_data[0] = 0x02; /* XXX : non unique bit */ - priv->conf.macaddr.ma_data[1] = 0x09; /* XXX */ - priv->conf.macaddr.ma_data[2] = 0xc0; /* XXX */ - priv->conf.macaddr.ma_data[3] = (u_char)((random() & 0xff0000) >> 16); - priv->conf.macaddr.ma_data[4] = (u_char)((random() & 0x00ff00) >> 8); - priv->conf.macaddr.ma_data[5] = (u_char)((random() & 0x0000ff) >> 0); - - NG_NODE_SET_PRIVATE(nodep, priv); - priv->node = nodep; - - /* Done */ - return (0); -} - -/* - * Method for attaching a new hook - * A hook is a virtual ATM link. - */ -static int -ng_atmpif_newhook(node_p node, hook_p hook, const char *name) -{ - const priv_p priv = NG_NODE_PRIVATE(node); - - /* - * Check for a link hook - */ - if (strcmp(name, NG_ATMPIF_HOOK_LINK) == 0) { - int error; - - /* - * Do not create twice a link hook - */ - if (priv->link != NULL) - return (EEXIST); - - priv->link = malloc(sizeof(*priv->link), - M_NETGRAPH_ATMPIF, M_NOWAIT | M_ZERO); - if (priv->link == NULL) - return (ENOMEM); - - /* - * Register as an HARP device - */ - if ((error = vatmpif_harp_attach(node))) { - free(priv->link, M_NETGRAPH_ATMPIF); - priv->link = NULL; - return (error); - } - - priv->link->hook = hook; - return (0); - } - - /* Unknown hook name */ - return (EINVAL); -} - -/* - * Receive a control message from ngctl or the netgraph's API - */ -static int -ng_atmpif_rcvmsg(node_p node, item_p item, hook_p lasthook) -{ - const priv_p priv = NG_NODE_PRIVATE(node); - struct ng_mesg *msg; - struct ng_mesg *resp = NULL; - int error = 0; - - NGI_GET_MSG(item, msg); - - switch (msg->header.typecookie) { - case NGM_ATMPIF_COOKIE: - switch (msg->header.cmd) { - case NGM_ATMPIF_GET_CONFIG: - { - struct ng_vatmpif_config *conf; - - NG_MKRESPONSE(resp, msg, - sizeof(struct ng_vatmpif_config), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - conf = (struct ng_vatmpif_config *)resp->data; - *conf = priv->conf; /* no sanity checking needed */ - break; - } - case NGM_ATMPIF_SET_CONFIG: - { - struct ng_vatmpif_config *conf; - - if (msg->header.arglen != sizeof(*conf)) { - error = EINVAL; - break; - } - conf = (struct ng_vatmpif_config *)msg->data; - priv->conf = *conf; - break; - } - case NGM_ATMPIF_GET_LINK_STATUS: - { - struct ng_vatmpif_hook *link; - struct ng_atmpif_link_status *status; - - if ((link = priv->link) == NULL) { - error = ENOTCONN; - break; - } - - NG_MKRESPONSE(resp, msg, sizeof(*status), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - status = (struct ng_atmpif_link_status *)resp->data; - status->InSeq = link->InSeq; - status->OutSeq = link->OutSeq; - status->cur_pcr = link->cur_pcr; - break; - } - case NGM_ATMPIF_GET_STATS: - case NGM_ATMPIF_CLR_STATS: - case NGM_ATMPIF_GETCLR_STATS: - { - struct ng_vatmpif_hook *link; - - if ((link = priv->link) == NULL) { - error = ENOTCONN; - break; - } - - /* Get/clear stats */ - if (msg->header.cmd != NGM_ATMPIF_CLR_STATS) { - NG_MKRESPONSE(resp, msg, - sizeof(link->stats), M_NOWAIT); - if (resp == NULL) { - error = ENOMEM; - break; - } - bcopy(&link->stats, - resp->data, sizeof(link->stats)); - } - if (msg->header.cmd != NGM_ATMPIF_GET_STATS) - bzero(&link->stats, sizeof(link->stats)); - break; - } - default: - error = EINVAL; - break; - } - break; - default: - error = EINVAL; - break; - } - - /* Done */ - NG_RESPOND_MSG(error, node, item, resp); - NG_FREE_MSG(msg); - return (error); -} - -/* - * Hook disconnection. - * It shutdown the virtual ATM link however the node is kept. - */ -static int -ng_atmpif_disconnect(hook_p hook) -{ - const node_p node = NG_HOOK_NODE(hook); - const priv_p priv = NG_NODE_PRIVATE(node); - - /* - * Deregister from the HARP stack - */ - vatmpif_harp_detach(node); - - /* - * Free associated link information - */ - KASSERT(priv->link != NULL, ("%s: no link", __func__)); - FREE(priv->link, M_NETGRAPH_ATMPIF); - priv->link = NULL; - - /* Shutdown the physical interface */ - priv->vu_pif.pif_flags &= ~PIF_UP; - - /* No more hooks, however I prefer to keep the node - * instead of going away - * However, if we are interested in removing it, let's - * call ng_rmnode(hook->node); here. - */ - return (0); -} - -/* - * Shutdown node - * - * Free the private data. - */ -static int -ng_atmpif_rmnode(node_p node) -{ - const priv_p priv = NG_NODE_PRIVATE(node); - - /* Free private data */ - FREE(priv, M_NETGRAPH_ATMPIF); - NG_NODE_SET_PRIVATE(node, NULL); - - /* Unref node */ - NG_NODE_UNREF(node); - - return (0); -} - -/* - * Receive data - * - * Then vatmpif_harp_recv_drain will schedule a call into the kernel - * to process the atm_intrq. - * It means that it should be processing at splimp() if - * the node was a regular hw driver. - */ -static int -ng_atmpif_rcvdata(hook_p hook, item_p item) -{ - const node_p node = NG_HOOK_NODE(hook); - const priv_p priv = NG_NODE_PRIVATE(node); - struct vatmpif_header *h; - struct vatmpif_header hdrbuf; - int error = 0; - struct mbuf *m; - - NGI_GET_M(item, m); - NG_FREE_ITEM(item); - - /* Is the Physical Interface UP ? */ - if (!(priv->vu_pif.pif_flags & PIF_UP)) { - log(LOG_ERR, "%s%d: down while %s", - priv->vu_pif.pif_name, priv->vu_pif.pif_unit, __func__); - error = ENETDOWN; - goto drop; - } - - /* Sanity check header length */ - if (m->m_pkthdr.len < sizeof(*h)) { - priv->link->stats.hva_st_ng.ng_badpdu++; - error = EINVAL; - goto drop; - } - - /* Get the Virtual ATM Physical Interface header */ - if (m->m_len >= sizeof(*h)) { /* the common case */ - h = mtod(m, struct vatmpif_header *); - } else { - m_copydata(m, 0, sizeof(*h), (caddr_t)&hdrbuf); - h = &hdrbuf; /* allocated on the stack */ - } - - /* - * Consume the vatmpif header - */ - m_adj(m, sizeof(*h)); - - /* - * Parse the header h - */ - - /* - * duplication and out of order test. - * - * . let's SEQ_MAX be the highest sequence number - * . let's assume that h->seq = SEQ_MAX, (1) - */ - if (ntohl(h->seq) < priv->link->InSeq) { - /* . is false due to (1) */ - /* duplicate or out of order */ - priv->link->stats.hva_st_ng.ng_errseq++; - error = EINVAL; - goto drop; - } - /* . then the mbuf is not dropped */ - - /* PDUs have been lost ?? */ - if (priv->link->InSeq < ntohl(h->seq)) { - /* . it is true only if a PDU has been lost, - * . else due to (1) priv->link->InSeq is - * . already equal to SEQ_MAX. - */ - priv->link->stats.hva_st_ng.ng_lostpdu++; - priv->link->InSeq = ntohl(h->seq); - } - - /* Save the sequence number */ - priv->link->InSeq = ntohl(h->seq) + 1; - /* . it leads to InSeq = SEQ_MAX + 1 = SEQ_MIN */ - - /* . it means that InSeq is always the next intended - * . sequence number if none is lost, doesn't it ? - */ - - /* - * Send the packet to the stack. - */ - priv->link->stats.hva_st_ng.ng_rx_pdu++; - error = vatmpif_harp_recv_drain(priv, m, - ATM_HDR_GET_VPI(ntohl(h->cellhdr)), - ATM_HDR_GET_VCI(ntohl(h->cellhdr)), - ATM_HDR_GET_PT (ntohl(h->cellhdr)), - ATM_HDR_GET_CLP(ntohl(h->cellhdr)), h->aal); - - return (error); - -drop: - m_freem(m); - return (error); -} - -/* - * Transmit data. Called by the HARP's outpout function. You should - * notice that the return value is not returned upward by the HARP - * stack. It is only used in order to update the stats. - */ -int -ng_atmpif_transmit(const priv_p priv, struct mbuf *m, - uint8_t vpi, uint16_t vci, uint8_t pt, uint8_t clp, Vatmpif_aal aal) -{ - struct vatmpif_header *h; - int error = 0; - - /* Is the Physical Interface UP ? */ - if (!(priv->vu_pif.pif_flags & PIF_UP)) { - log(LOG_ERR, "%s%d: down while %s", - priv->vu_pif.pif_name, priv->vu_pif.pif_unit, __func__); - error = ENETDOWN; - goto drop; - } - - /* If the hook is not connected, free the mbuf */ - if (priv->link == NULL) { - log(LOG_ERR, "%s%d: no hook while %s", - priv->vu_pif.pif_name, priv->vu_pif.pif_unit, __func__); - error = ENETDOWN; - goto drop; - } - - M_PREPEND(m, sizeof(*h), M_DONTWAIT); - if (m == NULL) { - error = ENOBUFS; - goto drop; - } - m = m_pullup(m, sizeof(*h)); - if (m == NULL) { - error = ENOBUFS; - goto drop; - } - h = mtod(m, struct vatmpif_header *); - - /* htonl is linear */ - h->cellhdr = htonl(ATM_HDR_SET_VPI(vpi)); - h->cellhdr += htonl(ATM_HDR_SET_VCI(vci)); - h->cellhdr += htonl(ATM_HDR_SET_PT (pt)); - h->cellhdr += htonl(ATM_HDR_SET_CLP(clp)); - h->aal = aal; - priv->link->OutSeq++; - h->seq = htonl(priv->link->OutSeq); - h->cookie = 0; - - if (IS_VATMPIF_DEBUG_PACKET(priv)) - atm_pdu_print(m, __func__); - - /* Send it out to the "link" hook */ - priv->link->stats.hva_st_ng.ng_tx_pdu++; - NG_SEND_DATA_ONLY(error, priv->link->hook, m); - - return (error); - -drop: - if (m != NULL) - m_freem(m); - return (error); -} - -/****************************************************************** - MAC Address parser - *****************************************************************/ -static int -ng_macaddr_parse(const struct ng_parse_type *type, const char *s, - int *const off, const u_char *const start, u_char *const buf, - int *const buflen) -{ - char *eptr; - u_long val; - int i; - - if (*buflen < 6) - return (ERANGE); - for (i = 0; i < 6; i++) { - val = strtoul(s + *off, &eptr, 16); - if (val > 0xff || eptr == s + *off) - return (EINVAL); - buf[i] = (u_char)val; - *off = (eptr - s); - if (i < 6 - 1) { - if (*eptr != ':') - return (EINVAL); - (*off)++; - } - } - *buflen = 6; - return (0); -} - -static int -ng_macaddr_unparse(const struct ng_parse_type *type, const u_char *data, - int *off, char *cbuf, int cbuflen) -{ - int len; - - len = snprintf(cbuf, cbuflen, "%02x:%02x:%02x:%02x:%02x:%02x", - data[*off], data[*off + 1], data[*off + 2], - data[*off + 3], data[*off + 4], data[*off + 5]); - if (len >= cbuflen) - return (ERANGE); - *off += 6; - return (0); -} - -/* - * this holds all the stuff that should be done at load time - */ -static int -ng_atmpif_mod_event(module_t mod, int event, void *data) -{ - int error = 0; - - switch (event) { - - case MOD_LOAD: - vatmpif_nif_zone = uma_zcreate("vatmpif nif", - sizeof(struct atm_nif), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - if (vatmpif_nif_zone == NULL) { - error = ENOMEM; - break; - } - - vatmpif_vcc_zone = uma_zcreate("vatmpif vcc", - sizeof(Vatmpif_vcc), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); - if (vatmpif_vcc_zone == NULL) { - uma_zdestroy(vatmpif_nif_zone); - error = ENOMEM; - break; - } - break; - - case MOD_UNLOAD: - uma_zdestroy(vatmpif_nif_zone); - uma_zdestroy(vatmpif_vcc_zone); - break; - - default: - error = EOPNOTSUPP; - break; - } - - return (error); -} Property changes on: head/sys/netgraph/atm/atmpif/ng_atmpif.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netgraph/atm/atmpif/ng_atmpif_var.h =================================================================== --- head/sys/netgraph/atm/atmpif/ng_atmpif_var.h (revision 179307) +++ head/sys/netgraph/atm/atmpif/ng_atmpif_var.h (nonexistent) @@ -1,147 +0,0 @@ -/*- - * Copyright (c) 2003 Harti Brandt. - * Copyright (c) 2003 Vincent Jardin. - * 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$ - */ - -/* - * Supported AALs - */ -enum vatmpif_aal { - VATMPIF_AAL_0 = 0, /* Cell Service */ - VATMPIF_AAL_4 = 4, /* AAL 3/4 */ - VATMPIF_AAL_5 = 5, /* AAL 5 */ -}; -typedef enum vatmpif_aal Vatmpif_aal; - -/* - * Supported traffic type - */ -enum vatmpif_traffic_type { - VATMPIF_TRAF_CBR = 0x01, /* Constant bit rate */ - VATMPIF_TRAF_VBR = 0x02, /* Variable bit rate */ - VATMPIF_TRAF_ABR = 0x03, /* Available Bit Rate */ - VATMPIF_TRAF_UBR = 0x04, /* Unspecified bit rate */ -}; -typedef enum vatmpif_traffic_type Vatmpif_traffic_type; - -typedef struct t_atm_traffic Vatmpif_traffic; - -/* - * Host protocol control blocks - * - */ -/* - * Device VCC Entry - * - * Contains the common (vv_cmn) and specific information for each VCC - * which is opened through a ATM PIF node. - * It is a virtual VCC. From the Netgraph poit of view it is a - * per-node's hook private data. - * - * It is a polymorph object with the instances of Cmn_vcc. - */ -struct vatmpif_vcc { - Cmn_vcc vv_cmn; /* Common VCC stuff */ - Vatmpif_aal vv_aal; /* AAL */ - Vatmpif_traffic vv_traffic; /* forward and backward ATM traffic */ - Vatmpif_traffic_type vv_traffic_type;/* CBR, VBR, UBR, ... */ -}; -typedef struct vatmpif_vcc Vatmpif_vcc; - -#define vv_next vv_cmn.cv_next -#define vv_toku vv_cmn.cv_toku -#define vv_upper vv_cmn.cv_upper -#define vv_connvc vv_cmn.cv_connvc -#define vv_state vv_cmn.cv_state - -/* - * The hook structure describes a virtual link - */ -struct ng_vatmpif_hook { - hook_p hook; /* netgraph hook */ - Vatmpif_stats stats; /* link stats */ - uint32_t InSeq; /* last received sequence number + 1 */ - uint32_t OutSeq; /* last sent sequence number */ - uint32_t cur_pcr; /* slot's reserved PCR */ -}; - -/* - * Device Virtual Unit Structure - * - * Contains all the information for a single device (adapter). - * It is a virtual device. From the Netgraph point of view it is - * a per-node private data. - * - * It is a polymorph object with the instances of Cmn_unit. - */ -struct vatmpif_unit { - Cmn_unit vu_cmn; /* Common unit stuff */ - node_p node; /* netgraph node */ - struct ng_vatmpif_hook* link; /* virtual link hoook */ - struct ng_vatmpif_config conf; /* node configuration */ -}; -typedef struct vatmpif_unit Vatmpif_unit; - -#define ng_vatmpif_private vatmpif_unit -typedef struct ng_vatmpif_private *priv_p; - -#define vu_pif vu_cmn.cu_pif -#define vu_unit vu_cmn.cu_unit -#define vu_flags vu_cmn.cu_flags -#define vu_mtu vu_cmn.cu_mtu -#define vu_open_vcc vu_cmn.cu_open_vcc -#define vu_vcc vu_cmn.cu_vcc -#define vu_vcc_zone vu_cmn.cu_vcc_zone -#define vu_nif_zone vu_cmn.cu_nif_zone -#define vu_ioctl vu_cmn.cu_ioctl -#define vu_instvcc vu_cmn.cu_instvcc -#define vu_openvcc vu_cmn.cu_openvcc -#define vu_closevcc vu_cmn.cu_closevcc -#define vu_output vu_cmn.cu_output -#define vu_config vu_cmn.cu_config -#define vu_softc vu_cmn.cu_softc - -#define vu_stats link->stats -#define vu_cur_pcr link->cur_pcr - -/* - * Netgraph to HARP API - */ -int vatmpif_harp_attach(node_p node); -int vatmpif_harp_detach(node_p node); - -int vatmpif_harp_recv_drain(Vatmpif_unit *vup, KBuffer *m, - uint8_t vpi, uint16_t vci, uint8_t pt, uint8_t clp, Vatmpif_aal aal); - -/* - * HARP to Netgraph API - */ -int ng_atmpif_transmit(const priv_p priv, struct mbuf *m, - uint8_t vpi, uint16_t vci, uint8_t pt, uint8_t clp, Vatmpif_aal aal); - -extern uma_zone_t vatmpif_nif_zone; -extern uma_zone_t vatmpif_vcc_zone; Property changes on: head/sys/netgraph/atm/atmpif/ng_atmpif_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/sys/netgraph/atm/atmpif/ng_atmpif_harp.c =================================================================== --- head/sys/netgraph/atm/atmpif/ng_atmpif_harp.c (revision 179307) +++ head/sys/netgraph/atm/atmpif/ng_atmpif_harp.c (nonexistent) @@ -1,933 +0,0 @@ -/*- - * Copyright 2003 Harti Brandt - * Copyright 2003 Vincent Jardin - * 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. - */ - -/* - * ATM Virtal Adapter Support - * -------------------------- - * - * API between HARP and Netgraph - * - */ -#include -__FBSDID("$FreeBSD$"); - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -/* - * Local definitions - */ - -/* - * Local methods - */ - -static int vatmpif_nunits = 0; - -/* - * ATM Interface services - * - * this virtual device does not use a soft SAR of the AAL5 PDU, neither - * of the AAL3/4 PDU. - */ -static struct stack_defn vatmpif_svaal5 = { - sd_next: NULL, - sd_sap: SAP_CPCS_AAL5, - sd_flag: SDF_TERM, /* no soft SAR */ - sd_inst: atm_dev_inst, - sd_lower: atm_dev_lower, - sd_upper: NULL, - sd_toku: 0, -}; -static struct stack_defn vatmpif_svaal4 = { - sd_next: &vatmpif_svaal5, - sd_sap: SAP_CPCS_AAL3_4, - sd_flag: SDF_TERM, /* no soft SAR */ - sd_inst: atm_dev_inst, - sd_lower: atm_dev_lower, - sd_upper: NULL, - sd_toku: 0, -}; -static struct stack_defn vatmpif_svaal0 = { - sd_next: &vatmpif_svaal4, - sd_sap: SAP_ATM, - sd_flag: SDF_TERM, /* no soft SAR */ - sd_inst: atm_dev_inst, - sd_lower: atm_dev_lower, - sd_upper: NULL, - sd_toku: 0, -}; -static struct stack_defn *vatmpif_services = &vatmpif_svaal0; - -/****************************************************************** - HARP API METHODS -******************************************************************/ - -/* - * Local methods - */ -static int vatmpif_harp_ioctl(int code, caddr_t data, caddr_t arg); -static int vatmpif_harp_instvcc(Cmn_unit *cup, Cmn_vcc *cvp); -static int vatmpif_harp_openvcc(Cmn_unit *cup, Cmn_vcc *cvp); -static int vatmpif_harp_closevcc(Cmn_unit *cup, Cmn_vcc *cvp); -static void vatmpif_harp_output(Cmn_unit *cup, Cmn_vcc *cvp, KBuffer *m); -static atm_intr_t vatmpif_harp_recv_stack; - -/* - * Attach an virtual ATM physical inteface with the HARP stack - * - * Each virtual ATM device interface must register itself here - * upon completing the netgraph node constructor. - * - * Arguments: - * node pointer on the netgraph node - * - * Returns: - * 0 successful - * errno failed - reason indicated - */ -int -vatmpif_harp_attach(node_p node) -{ - Vatmpif_unit *vup; - static int unit = 0; - int err; - - /* - * Sanity check - */ - if (node == NULL) - return (EINVAL); - - /* - * Get the virtual unit structure - */ - vup = (Vatmpif_unit *)NG_NODE_PRIVATE(node); - if (vup == NULL) - return (EINVAL); - - /* - * Start initializing the HARP binding - */ - vup->vu_unit = unit; - /* 9188 bytes: Default ATM network interface MTU + LLC/SNAP header */ - vup->vu_mtu = ATM_NIF_MTU + 8; - vup->vu_vcc_zone = vatmpif_vcc_zone; - vup->vu_nif_zone = vatmpif_nif_zone; - vup->vu_ioctl = vatmpif_harp_ioctl; - vup->vu_instvcc = vatmpif_harp_instvcc; - vup->vu_openvcc = vatmpif_harp_openvcc; - vup->vu_closevcc = vatmpif_harp_closevcc; - vup->vu_output = vatmpif_harp_output; - vup->vu_softc = vup; - - /* - * Consider this virtual unit assigned - */ - unit++; - - /* - * Get our device type and setup the adapter config info - * - at least as much as we can - */ - vup->vu_config.ac_vendor = VENDOR_NETGRAPH; - vup->vu_config.ac_vendapi = VENDAPI_NETGRAPH_1; - vup->vu_config.ac_device = DEV_VATMPIF; - vup->vu_config.ac_media = MEDIA_VIRTUAL; - vup->vu_config.ac_serial = (u_long)node; - vup->vu_config.ac_bustype = BUS_VIRTUAL; - vup->vu_config.ac_busslot = NGM_ATMPIF_COOKIE; - vup->vu_config.ac_ram = (u_long)node; - vup->vu_config.ac_ramsize = sizeof(*node); - vup->vu_config.ac_macaddr = vup->conf.macaddr; - snprintf(vup->vu_config.ac_hard_vers, - sizeof(vup->vu_config.ac_hard_vers), - "%s", "Virt. ATM 1.0"); - snprintf(vup->vu_config.ac_firm_vers, - sizeof(vup->vu_config.ac_firm_vers), - "%d", __FreeBSD__); - - /* - * Set the interface capabilities - */ - vup->vu_pif.pif_maxvpi = VATMPIF_MAX_VPI; - vup->vu_pif.pif_maxvci = VATMPIF_MAX_VCI; - vup->vu_pif.pif_pcr = vup->conf.pcr; - - /* - * Register this interface with ATM core services - */ - if ((err = atm_physif_register((Cmn_unit *)vup, - VATMPIF_DEV_NAME, vatmpif_services)) != 0 ) { - /* - * Registration failed - back everything out - * - * The netgraph node must not be created. - */ - return (err); - } - - vatmpif_nunits++; - - /* - * Mark device initialization completed - */ - vup->vu_flags |= CUF_INITED; - - /* Done */ - return (0); -} - -/* - * Halt driver processing - * - * This will be called just prior the destruction of the Netgraph's node. - * - * Arguments: - * node pointer on the netgraph node - * - * Returns: - * 0 detach was successful - * errno detach failed - reason indicated - */ -int -vatmpif_harp_detach(node_p node) -{ - Vatmpif_unit *vup = (Vatmpif_unit *)NG_NODE_PRIVATE(node); - int err; - - /* - * Deregister device from kernel services - */ - if ((err = atm_physif_deregister((Cmn_unit *)vup))) - return (err); - - vatmpif_nunits--; - - /* - * Clear device initialized - */ - vup->vu_flags &= ~CUF_INITED; - - /* Done */ - return (0); -} - -/* - * Handle netatm core service interface ioctl requests - * - * Arguments: - * code ioctl function (sub)code - * data data to/from ioctl - * arg optional code-specific argument - * - * Returns: - * 0 request processed successfully - * errno request failed - reason code - */ -static int -vatmpif_harp_ioctl(int code, caddr_t data, caddr_t arg) -{ - struct atminfreq *aip = (struct atminfreq *)data; - struct atm_pif *pip; - Vatmpif_unit *vup; - caddr_t buf = aip->air_buf_addr; - struct air_vinfo_rsp *avr; - size_t count, len, buf_len = aip->air_buf_len; - int err = 0; - char ifname[2 * IFNAMSIZ]; - - ATM_DEBUG3("%s: code=%d, opcode=%d\n", __func__, code, aip->air_opcode); - - switch (aip->air_opcode) { - - case AIOCS_INF_VST: - /* - * Get vendor statistics - */ - pip = (struct atm_pif *)arg; - vup = (Vatmpif_unit *)pip; - if (pip == NULL) - return (ENXIO); - snprintf(ifname, sizeof(ifname), "%s%d", - pip->pif_name, pip->pif_unit); - - /* - * Cast response structure onto user's buffer - */ - avr = (struct air_vinfo_rsp *)(void *)buf; - - /* - * How lare is the response structure ? - */ - len = sizeof(struct air_vinfo_rsp); - - /* - * Sanity check - enough room for response structure - */ - if (buf_len < len) - return ENOSPC; - - /* - * Copy interface name into response structure - */ - if ((err = copyout(ifname, avr->avsp_intf, IFNAMSIZ)) != 0) - break; - - /* - * Advance the buffer address and decrement the size - */ - buf += len; - buf_len -= len; - - /* - * Get the vendor stats - */ - /* vup->vu_stats */ - - /* - * Stick as much of it as we have room for - * into the response - */ - count = MIN(sizeof(Vatmpif_stats), buf_len); - - /* - * Copy stats into user's buffer. Return value is - * amount of data copied. - */ - if ((err = copyout((caddr_t)&vup->vu_stats, buf, - buf_len)) != 0) - break; - buf += count; - buf_len -= count; - if (count < sizeof(Vatmpif_stats)) - err = ENOSPC; - - /* - * Record amount we are returning as vendor info... - */ - if ((err = copyout(&count, &avr->avsp_len, sizeof(count))) != 0) - break; - - /* - * Update the reply pointers and lengths - */ - aip->air_buf_addr = buf; - aip->air_buf_len = buf_len; - break; - - default: - err = ENOSYS; - break; - } - - return (err); -} - -/* - * Get CBR/VBR/ABR/UBR from bearer attribute - * - * Arguments: - * bearer T_ATM_BEARER_CAP option value structure - * - * Returns: - * Driver traffic class - */ -static Vatmpif_traffic_type -vatmpif_bearerclass(struct attr_bearer *bearer) -{ - switch (bearer->v.bearer_class) { - case T_ATM_CLASS_A: - return (VATMPIF_TRAF_CBR); - case T_ATM_CLASS_C: - return (VATMPIF_TRAF_VBR); - case T_ATM_CLASS_X: - switch (bearer->v.traffic_type) { - case T_ATM_CBR: - return (VATMPIF_TRAF_CBR); - case T_ATM_VBR: - return (VATMPIF_TRAF_VBR); - case T_ATM_ABR: - return (VATMPIF_TRAF_ABR); - case T_ATM_NULL: - case T_ATM_UBR: - return (VATMPIF_TRAF_UBR); - } - break; - } - - /* never reached */ - log(LOG_ERR, "%s: could not determine the traffic type.\n", __func__); - return (VATMPIF_TRAF_UBR); -} - -/* - * VCC Stack Instantiation - * - * This function is called via the common driver code during a device VCC - * stack instantiation. The common code has already validated some of - * the request so we just need to check a few more VATMPIF-specific details. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 instantiation successful - * errno instantiation failed - reason indicated - */ -static int -vatmpif_harp_instvcc(Cmn_unit *cup, Cmn_vcc *cvp) -{ - Vatmpif_unit *vup = (Vatmpif_unit *)cup; - Vatmpif_vcc *vvp = (Vatmpif_vcc *)cvp; - Atm_attributes *ap = &vvp->vv_connvc->cvc_attr; - int32_t pcr = 0; - int32_t scr = 0; - Vatmpif_traffic_type traffic = VATMPIF_TRAF_UBR; - - ATM_DEBUG3("%s: vup=%p, vvp=%p\n", __func__, vup, vvp); - - if (ap->traffic.tag == T_ATM_PRESENT) { - pcr = ap->traffic.v.forward.PCR_all_traffic; - scr = ap->traffic.v.forward.SCR_all_traffic; - } - if (pcr < 0) - pcr = 0; - if (scr < 0) - scr = 0; - - KASSERT(ap->bearer.tag == T_ATM_PRESENT, ("Bearer tag is required")); - traffic = vatmpif_bearerclass(&ap->bearer); - /* Guarantee PCR of the PVC with CBR */ - if (traffic == VATMPIF_TRAF_CBR && - vup->vu_cur_pcr + pcr > vup->vu_pif.pif_pcr) { - return (EINVAL); - } - /* Guarantee SCR of the PVC with VBR */ - if (traffic == VATMPIF_TRAF_VBR && - vup->vu_cur_pcr + scr > vup->vu_pif.pif_pcr) { - return (EINVAL); - } - - /* - * Validate requested AAL - */ - KASSERT(ap->aal.tag == T_ATM_PRESENT, ("AAL tag is required")); - switch (ap->aal.type) { - case ATM_AAL0: - break; - - case ATM_AAL1: - break; - - case ATM_AAL2: - return (EINVAL); - - case ATM_AAL3_4: - if (ap->aal.v.aal4.forward_max_SDU_size > vup->vu_mtu || - ap->aal.v.aal4.backward_max_SDU_size > vup->vu_mtu) - return (EINVAL); - break; - - case ATM_AAL5: - if (ap->aal.v.aal5.forward_max_SDU_size > vup->vu_mtu || - ap->aal.v.aal5.backward_max_SDU_size > vup->vu_mtu) - return (EINVAL); - break; - - default: - return (EINVAL); - } - /* Done */ - return (0); -} - -/* - * Open a VCC - * - * This function is called via the common driver code after receiving a - * stack *_INIT command. The common has already validated most of - * the request so we just need to check a few more VATMPIF-specific details. - * Then we just forward to the Netgraph node. - * - * Called at splimp. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 open successful - * errno open failed - reason indicated - */ -static int -vatmpif_harp_openvcc(Cmn_unit *cup, Cmn_vcc *cvp) -{ - Vatmpif_unit *vup = (Vatmpif_unit *)cup; - Vatmpif_vcc *vvp = (Vatmpif_vcc *)cvp; - struct vccb *vcp = vvp->vv_connvc->cvc_vcc; - Atm_attributes *ap = &vvp->vv_connvc->cvc_attr; - - ATM_DEBUG5("%s: vup=%p, vvp=%p, vcc=(%d,%d)\n", __func__, - vup, vvp, vcp->vc_vpi, vcp->vc_vci); - - /* - * We only need to open incoming VC's so outbound VC's - * just get set to CVS_ACTIVE state. - */ - if ((vcp->vc_type & VCC_IN) == 0) { - /* - * Set the state and return - nothing else needed - */ - vvp->vv_state = CVS_ACTIVE; - return (0); - } - - /* - * Set the AAL and traffic - */ - switch (ap->aal.type) { - case ATM_AAL0: - vvp->vv_aal = VATMPIF_AAL_0; - break; - case ATM_AAL2: - return (EINVAL); - case ATM_AAL3_4: - vvp->vv_aal = VATMPIF_AAL_4; - break; - case ATM_AAL5: - vvp->vv_aal = VATMPIF_AAL_5; - break; - default: - return (EINVAL); - } - vvp->vv_traffic_type = vatmpif_bearerclass(&ap->bearer); - vvp->vv_traffic = ap->traffic.v; - - switch (vvp->vv_traffic_type) { - case VATMPIF_TRAF_ABR: - /* TODO */ - case VATMPIF_TRAF_UBR: - break; - case VATMPIF_TRAF_VBR: - vup->vu_cur_pcr += vvp->vv_traffic.forward.SCR_all_traffic; - break; - case VATMPIF_TRAF_CBR: - vup->vu_cur_pcr += vvp->vv_traffic.forward.PCR_all_traffic; - break; - } - - /* - * Indicate VC active - */ - vvp->vv_state = CVS_ACTIVE; - - /* Done */ - return (0); -} - -/* - * Close a VCC - * - * This function is called via the common driver code after receiving a - * stack *_TERM command. The common code has already validated most of - * the request so we just need to check a few more VATMPIF-specific detail. - * Then we just remove the entry from the list. - * - * Arguments: - * cup pointer to device common unit - * cvp pointer to common VCC entry - * - * Returns: - * 0 close successful - * errno close failed - reason indicated - */ -static int -vatmpif_harp_closevcc(Cmn_unit *cup, Cmn_vcc *cvp) -{ - Vatmpif_unit *vup = (Vatmpif_unit *)cup; - Vatmpif_vcc *vvp = (Vatmpif_vcc *)cvp; - struct vccb *vcp = vvp->vv_connvc->cvc_vcc; - - /* - * If this is an outbound only VCI, then we can close - * immediately. - */ - if ((vcp->vc_type & VCC_IN) == 0) { - /* - * The state will be set to TERM when we return - * to the *_TERM caller. - */ - return (0); - } - - switch (vvp->vv_traffic_type) { - case VATMPIF_TRAF_ABR: - /* TODO */ - case VATMPIF_TRAF_UBR: - break; - case VATMPIF_TRAF_VBR: - vup->vu_cur_pcr -= vvp->vv_traffic.forward.SCR_all_traffic; - break; - case VATMPIF_TRAF_CBR: - vup->vu_cur_pcr -= vvp->vv_traffic.forward.PCR_all_traffic; - break; - } - - return (0); -} - -/* - * Output a PDU - * - * This function is called via the common driver code after receiving a - * stack *_DATA* command. The command code has already validated most of - * the request so we just need to check a few more VATMPIF-specific detail. - * Then we just forward the transmit mbuf to the Netgraph node. - * - * Arguments: - * cup pointer to device common - * cvp pointer to common VCC entry - * m pointer to output PDU buffer chain head - * - * Returns: - * none - */ -static void -vatmpif_harp_output(Cmn_unit *cup, Cmn_vcc *cvp, KBuffer *m) -{ - Vatmpif_unit *vup = (Vatmpif_unit *)cup; - Vatmpif_vcc *vvp = (Vatmpif_vcc *)cvp; - struct vccb *vcp = vvp->vv_connvc->cvc_vcc; - Atm_attributes *ap = &vvp->vv_connvc->cvc_attr; - int err = 0; - u_long pdulen = 0; - - if (IS_VATMPIF_DEBUG_PACKET(vup)) - atm_dev_pdu_print(cup, cvp, m, __func__); - - /* - * Get packet PDU length - */ - KB_PLENGET (m, pdulen); - - err = ng_atmpif_transmit(vup, m, vcp->vc_vpi, vcp->vc_vci, - 0, 0, ap->aal.type); - - /* - * Now collect some statistics - */ - if (err) { - vup->vu_pif.pif_oerrors++; - vcp->vc_oerrors++; - if (vcp->vc_nif) - ANIF2IFP(vcp->vc_nif)->if_oerrors++; - } else { - /* - * Good transmission - */ - - switch (ap->aal.type) { - case VATMPIF_AAL_0: - vup->vu_stats.hva_st_ng.ng_tx_rawcell++; - break; - case VATMPIF_AAL_4: - /* TODO */ - break; - case VATMPIF_AAL_5: - vup->vu_stats.hva_st_aal5.aal5_xmit += - (pdulen + 47) / 48; - vup->vu_stats.hva_st_aal5.aal5_pdu_xmit++; - break; - default: - log(LOG_ERR, "%s%d: unknown AAL while %s", - vup->vu_pif.pif_name, vup->vu_pif.pif_unit, - __func__); - } - - vup->vu_pif.pif_opdus++; - vup->vu_pif.pif_obytes += pdulen; - if (vvp) { - vcp = vvp->vv_connvc->cvc_vcc; - vcp->vc_opdus++; - vcp->vc_obytes += pdulen; - if (vcp->vc_nif) { - vcp->vc_nif->nif_obytes += pdulen; - ANIF2IFP(vcp->vc_nif)->if_opackets++; - ANIF2IFP(vcp->vc_nif)->if_obytes += pdulen; - } - } - } -} - -/* - * Pass Incoming PDU up to the HARP stack - * - * This function is called via the core ATM interrupt queue callback - * set in vatmpif_harp_recv_drain(). It will pass the supplied incoming - * PDU up the incoming VCC's stack. - * - * Arguments: - * tok token to identify stack instantiation - * m pointer to incoming PDU buffer chain - * - * Returns: - * none - */ -static void -vatmpif_harp_recv_stack(void *tok, KBuffer *m) -{ - Vatmpif_vcc *vvp = (Vatmpif_vcc *)tok; - int err; - - /* - * Send the data up the stack - */ - STACK_CALL(CPCS_UNITDATA_SIG, vvp->vv_upper, - vvp->vv_toku, vvp->vv_connvc, (intptr_t)m, 0, err); - if (err) - KB_FREEALL(m); -} - -/* - * Drain Receive Queue - * - * The function will process all completed entries at the head of the - * receive queue. The received segments will be linked into a received - * PDU buffer cahin and it will then be passed up the PDU's VCC stack - * function processing by the next higher protocol layer. - * - * May be called in interrupt state. - * Must be called with interrupts locked out. - * - * Arguments: - * vup pointer to the virtual device structure - * m pointer to incoming PDU buffer chain - * vpi Virtual Path Identifier - * vci Virtual Channel Identifier (host order) - * pt Payload Type Identifier (3 bit) - * ATM_PT_USER_SDU0 - * ATM_PT_USER_SDU1 - * ATM_PT_USER_CONG_SDU0 - * ATM_PT_USER_CONG_SDU1 - * ATM_PT_NONUSER - * ATM_PT_OAMF5_SEG - * ATM_PT_OAMF5_E2E - * clp Cell Loss Priority (1 bit) - * - * Returns: - * 0 close successful - * errno close failed - reason indicated - */ -int -vatmpif_harp_recv_drain(Vatmpif_unit *vup, KBuffer *m, - uint8_t vpi, uint16_t vci, uint8_t pt, uint8_t clp, Vatmpif_aal aal) -{ - Vatmpif_vcc *vvp; - struct vccb *vcp; - u_long pdulen = 0; - caddr_t cp; - int err = 0; - - /* - * Locate incoming VCC for this PDU - */ - vvp = (Vatmpif_vcc *)atm_dev_vcc_find((Cmn_unit *)vup, - vpi, vci, VCC_IN); - - if (vvp == NULL) { - vup->vu_stats.hva_st_ng.ng_rx_novcc++; - vup->vu_pif.pif_ierrors++; - KB_FREEALL(m); - err = EIO; - goto failed; - } - - switch (aal) { - case VATMPIF_AAL_0: - vup->vu_stats.hva_st_ng.ng_rx_rawcell++; - break; - case VATMPIF_AAL_4: - /* TODO */ - break; - case VATMPIF_AAL_5: - vup->vu_stats.hva_st_aal5.aal5_rcvd += (pdulen + 47) / 48; - vup->vu_stats.hva_st_aal5.aal5_pdu_rcvd++; - break; - default: - vup->vu_stats.hva_st_ng.ng_badpdu++; - vup->vu_pif.pif_ierrors++; - KB_FREEALL(m); - err = EINVAL; - goto failed; - } - - /* - * TODO: - * For now, only user data PDUs are supported - */ - if (pt & ATM_HDR_SET_PT(ATM_PT_NONUSER)) { - vup->vu_stats.hva_st_ng.ng_badpdu++; - vup->vu_pif.pif_ierrors++; - if (aal == VATMPIF_AAL_5) { - vup->vu_stats.hva_st_aal5.aal5_drops += - (pdulen + 47) / 48; - vup->vu_stats.hva_st_aal5.aal5_pdu_drops++; - } - err = EINVAL; - goto failed; - } - - if (IS_VATMPIF_DEBUG_PACKET(vup)) - atm_dev_pdu_print((Cmn_unit *)vup, (Cmn_vcc *)vvp, m, - __func__); - - /* - * Get packet PDU length - */ - KB_PLENGET(m, pdulen); - - /* - * Only try queueing this if there is data - * to be handed up to the next layer. - */ - if (pdulen == 0) { - /* - * Free zero-length buffer - */ - vup->vu_stats.hva_st_ng.ng_badpdu++; - vup->vu_pif.pif_ierrors++; - if (aal == VATMPIF_AAL_5) - vup->vu_stats.hva_st_aal5.aal5_pdu_errs++; - err = EIO; - KB_FREEALL(m); - goto failed; - } - - /* TODO: process the AAL4 CRC, AAL5 CRC, - * then update aal5_crc_len, aal5_drops, aal5_pdu_crc, - * aal5_pdu_errs, aal5_pdu_drops ... - */ - - /* - * Quick count the PDU - */ - vup->vu_pif.pif_ipdus++; - vup->vu_pif.pif_ibytes += pdulen; - - vup->vu_stats.hva_st_ng.ng_rx_pdu++; - vup->vu_stats.hva_st_atm.atm_rcvd += (pdulen + 47) / 48; - - /* - * Update the VCC statistics: - * XXX: This code should not be into the driver. - */ - vcp = vvp->vv_connvc->cvc_vcc; - if (vcp) { - vcp->vc_ipdus++; - vcp->vc_ibytes += pdulen; - /* - * Update the NIF statistics if any - * XXX: beurk ! - */ - if (vcp->vc_nif) { - vcp->vc_nif->nif_ibytes += pdulen; - ANIF2IFP(vcp->vc_nif)->if_ipackets++; - ANIF2IFP(vcp->vc_nif)->if_ibytes += pdulen; - } - } - - /* - * The STACK_CALL needs to happen at splnet() in order - * for the stack sequence processing to work. Schedule an - * interrupt queue callback at splnet(). - */ - - /* - * Prepend callback function pointer and token value to buffer. - * We have already guaranteed that the space is available in the - * first buffer because the vatmpif_header structure is greater - * than our callback pointer. - * XXX - */ - KB_HEADADJ(m, sizeof(atm_intr_func_t) + sizeof(void *)); - KB_DATASTART(m, cp, caddr_t); - *((atm_intr_func_t *) cp) = vatmpif_harp_recv_stack; - cp += sizeof (atm_intr_func_t); - *((void **)cp) = (void *)vvp; - - /* - * Schedule callback - */ - if ((err = netisr_queue(NETISR_ATM, m))) { /* (0) on success. */ - /* - * queue is full. Unable to pass up to the HARP stack - * Update the stats. - */ - vup->vu_stats.hva_st_ng.ng_rx_iqfull++; - vup->vu_pif.pif_ierrors++; - goto failed; - } - - /* Done */ - return (0); - -failed: - return (err); -} Property changes on: head/sys/netgraph/atm/atmpif/ng_atmpif_harp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.bin/kdump/kdump.c =================================================================== --- head/usr.bin/kdump/kdump.c (revision 179307) +++ head/usr.bin/kdump/kdump.c (revision 179308) @@ -1,1366 +1,1364 @@ /*- * Copyright (c) 1988, 1993 * The Regents of the University of California. 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 the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. */ #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint #if 0 static char sccsid[] = "@(#)kdump.c 8.1 (Berkeley) 6/6/93"; #endif #endif /* not lint */ #include __FBSDID("$FreeBSD$"); #define _KERNEL extern int errno; #include #undef _KERNEL #include #include #define _KERNEL #include #undef _KERNEL #include #include #include #include #include #include #ifdef IPX #include #include #endif #ifdef NETATALK #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ktrace.h" #include "kdump_subr.h" int fread_tail(void *, int, int); void dumpheader(struct ktr_header *); void ktrsyscall(struct ktr_syscall *); void ktrsysret(struct ktr_sysret *); void ktrnamei(char *, int); void hexdump(char *, int, int); void visdump(char *, int, int); void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktruser(int, unsigned char *); void ktrsockaddr(struct sockaddr *); void ktrstat(struct stat *); void ktrstruct(char *, size_t); void usage(void); const char *ioctlname(u_long); int timestamp, decimal, fancy = 1, suppressdata, tail, threads, maxdata, resolv = 0; const char *tracefile = DEF_TRACEFILE; struct ktr_header ktr_header; #define TIME_FORMAT "%b %e %T %Y" #define eqs(s1, s2) (strcmp((s1), (s2)) == 0) int main(int argc, char *argv[]) { int ch, ktrlen, size; void *m; int trpoints = ALL_POINTS; int drop_logged; pid_t pid = 0; (void) setlocale(LC_CTYPE, ""); while ((ch = getopt(argc,argv,"f:dElm:np:HRrsTt:")) != -1) switch((char)ch) { case 'f': tracefile = optarg; break; case 'd': decimal = 1; break; case 'l': tail = 1; break; case 'm': maxdata = atoi(optarg); break; case 'n': fancy = 0; break; case 'p': pid = atoi(optarg); break; case 'r': resolv = 1; break; case 's': suppressdata = 1; break; case 'E': timestamp = 3; /* elapsed timestamp */ break; case 'H': threads = 1; break; case 'R': timestamp = 2; /* relative timestamp */ break; case 'T': timestamp = 1; break; case 't': trpoints = getpoints(optarg); if (trpoints < 0) errx(1, "unknown trace point in %s", optarg); break; default: usage(); } if (argc > optind) usage(); m = (void *)malloc(size = 1025); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); if (!freopen(tracefile, "r", stdin)) err(1, "%s", tracefile); drop_logged = 0; while (fread_tail(&ktr_header, sizeof(struct ktr_header), 1)) { if (ktr_header.ktr_type & KTR_DROP) { ktr_header.ktr_type &= ~KTR_DROP; if (!drop_logged && threads) { (void)printf("%6d %6d %-8.*s Events dropped.\n", ktr_header.ktr_pid, ktr_header.ktr_tid > 0 ? ktr_header.ktr_tid : 0, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } else if (!drop_logged) { (void)printf("%6d %-8.*s Events dropped.\n", ktr_header.ktr_pid, MAXCOMLEN, ktr_header.ktr_comm); drop_logged = 1; } } if (trpoints & (1< size) { m = (void *)realloc(m, ktrlen+1); if (m == NULL) errx(1, "%s", strerror(ENOMEM)); size = ktrlen; } if (ktrlen && fread_tail(m, ktrlen, 1) == 0) errx(1, "data too short"); if (pid && ktr_header.ktr_pid != pid) continue; if ((trpoints & (1<ktr_type) { case KTR_SYSCALL: type = "CALL"; break; case KTR_SYSRET: type = "RET "; break; case KTR_NAMEI: type = "NAMI"; break; case KTR_GENIO: type = "GIO "; break; case KTR_PSIG: type = "PSIG"; break; case KTR_CSW: type = "CSW "; break; case KTR_USER: type = "USER"; break; case KTR_STRUCT: type = "STRU"; break; default: (void)sprintf(unknown, "UNKNOWN(%d)", kth->ktr_type); type = unknown; } /* * The ktr_tid field was previously the ktr_buffer field, which held * the kernel pointer value for the buffer associated with data * following the record header. It now holds a threadid, but only * for trace files after the change. Older trace files still contain * kernel pointers. Detect this and suppress the results by printing * negative tid's as 0. */ if (threads) (void)printf("%6d %6d %-8.*s ", kth->ktr_pid, kth->ktr_tid > 0 ? kth->ktr_tid : 0, MAXCOMLEN, kth->ktr_comm); else (void)printf("%6d %-8.*s ", kth->ktr_pid, MAXCOMLEN, kth->ktr_comm); if (timestamp) { if (timestamp == 3) { if (prevtime.tv_sec == 0) prevtime = kth->ktr_time; timevalsub(&kth->ktr_time, &prevtime); } if (timestamp == 2) { temp = kth->ktr_time; timevalsub(&kth->ktr_time, &prevtime); prevtime = temp; } (void)printf("%ld.%06ld ", kth->ktr_time.tv_sec, kth->ktr_time.tv_usec); } (void)printf("%s ", type); } #include #define KTRACE #include #undef KTRACE int nsyscalls = sizeof (syscallnames) / sizeof (syscallnames[0]); void ktrsyscall(struct ktr_syscall *ktr) { int narg = ktr->ktr_narg; register_t *ip; if (ktr->ktr_code >= nsyscalls || ktr->ktr_code < 0) (void)printf("[%d]", ktr->ktr_code); else (void)printf("%s", syscallnames[ktr->ktr_code]); ip = &ktr->ktr_args[0]; if (narg) { char c = '('; if (fancy) { #define print_number(i,n,c) do { \ if (decimal) \ (void)printf("%c%ld", c, (long)*i); \ else \ (void)printf("%c%#lx", c, (long)*i); \ i++; \ n--; \ c = ','; \ } while (0); if (ktr->ktr_code == SYS_ioctl) { const char *cp; print_number(ip,narg,c); if ((cp = ioctlname(*ip)) != NULL) (void)printf(",%s", cp); else { if (decimal) (void)printf(",%ld", (long)*ip); else (void)printf(",%#lx ", (long)*ip); } c = ','; ip++; narg--; } else if (ktr->ktr_code == SYS_ptrace) { (void)putchar('('); ptraceopname ((int)*ip); c = ','; ip++; narg--; } else if (ktr->ktr_code == SYS_access || ktr->ktr_code == SYS_eaccess) { print_number(ip,narg,c); (void)putchar(','); accessmodename ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_open) { int flags; int mode; print_number(ip,narg,c); flags = *ip; mode = *++ip; (void)putchar(','); flagsandmodename (flags, mode, decimal); ip++; narg-=2; } else if (ktr->ktr_code == SYS_wait4) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); wait4optname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_chmod || ktr->ktr_code == SYS_fchmod || ktr->ktr_code == SYS_lchmod) { print_number(ip,narg,c); (void)putchar(','); modename ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_mknod) { print_number(ip,narg,c); (void)putchar(','); modename ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_getfsstat) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); getfsstatflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_mount) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); mountflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_unmount) { print_number(ip,narg,c); (void)putchar(','); mountflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_recvmsg || ktr->ktr_code == SYS_sendmsg) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); sendrecvflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_recvfrom || ktr->ktr_code == SYS_sendto) { print_number(ip,narg,c); print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); sendrecvflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_chflags || ktr->ktr_code == SYS_fchflags || ktr->ktr_code == SYS_lchflags) { print_number(ip,narg,c); (void)putchar(','); modename((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_kill) { print_number(ip,narg,c); (void)putchar(','); signame((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_reboot) { (void)putchar('('); rebootoptname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_umask) { (void)putchar('('); modename((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_msync) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); msyncflagsname((int)*ip); ip++; narg--; #ifdef SYS_freebsd6_mmap } else if (ktr->ktr_code == SYS_freebsd6_mmap) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); mmapprotname ((int)*ip); (void)putchar(','); ip++; narg--; mmapflagsname ((int)*ip); ip++; narg--; #endif } else if (ktr->ktr_code == SYS_mmap) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); mmapprotname ((int)*ip); (void)putchar(','); ip++; narg--; mmapflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_mprotect) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); mmapprotname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_madvise) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); madvisebehavname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_setpriority) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); prioname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_fcntl) { int cmd; int arg; print_number(ip,narg,c); cmd = *ip; arg = *++ip; (void)putchar(','); fcntlcmdname(cmd, arg, decimal); ip++; narg-=2; } else if (ktr->ktr_code == SYS_socket) { int sockdomain; (void)putchar('('); sockdomain=(int)*ip; sockdomainname(sockdomain); ip++; narg--; (void)putchar(','); socktypename((int)*ip); ip++; narg--; if (sockdomain == PF_INET || sockdomain == PF_INET6) { (void)putchar(','); sockipprotoname((int)*ip); ip++; narg--; } c = ','; } else if (ktr->ktr_code == SYS_setsockopt || ktr->ktr_code == SYS_getsockopt) { print_number(ip,narg,c); (void)putchar(','); sockoptlevelname((int)*ip, decimal); if ((int)*ip == SOL_SOCKET) { ip++; narg--; (void)putchar(','); sockoptname((int)*ip); } ip++; narg--; #ifdef SYS_freebsd6_lseek } else if (ktr->ktr_code == SYS_freebsd6_lseek) { print_number(ip,narg,c); /* Hidden 'pad' argument, not in lseek(2) */ print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); whencename ((int)*ip); ip++; narg--; #endif } else if (ktr->ktr_code == SYS_lseek) { print_number(ip,narg,c); /* Hidden 'pad' argument, not in lseek(2) */ print_number(ip,narg,c); (void)putchar(','); whencename ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_flock) { print_number(ip,narg,c); (void)putchar(','); flockname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_mkfifo || ktr->ktr_code == SYS_mkdir) { print_number(ip,narg,c); (void)putchar(','); modename((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_shutdown) { print_number(ip,narg,c); (void)putchar(','); shutdownhowname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_socketpair) { (void)putchar('('); sockdomainname((int)*ip); ip++; narg--; (void)putchar(','); socktypename((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_getrlimit || ktr->ktr_code == SYS_setrlimit) { (void)putchar('('); rlimitname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_quotactl) { print_number(ip,narg,c); (void)putchar(','); quotactlname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_nfssvc) { (void)putchar('('); nfssvcname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_rtprio) { (void)putchar('('); rtprioname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS___semctl) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); semctlname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_semget) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); semgetname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_msgctl) { print_number(ip,narg,c); (void)putchar(','); shmctlname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_shmat) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); shmatname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_shmctl) { print_number(ip,narg,c); (void)putchar(','); shmctlname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_minherit) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); minheritname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_rfork) { (void)putchar('('); rforkname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_lio_listio) { (void)putchar('('); lio_listioname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_mlockall) { (void)putchar('('); mlockallname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_sched_setscheduler) { print_number(ip,narg,c); (void)putchar(','); schedpolicyname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_sched_get_priority_max || ktr->ktr_code == SYS_sched_get_priority_min) { (void)putchar('('); schedpolicyname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_sendfile) { print_number(ip,narg,c); print_number(ip,narg,c); print_number(ip,narg,c); print_number(ip,narg,c); print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); sendfileflagsname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_kldsym) { print_number(ip,narg,c); (void)putchar(','); kldsymcmdname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_sigprocmask) { (void)putchar('('); sigprocmaskhowname((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS___acl_get_file || ktr->ktr_code == SYS___acl_set_file || ktr->ktr_code == SYS___acl_get_fd || ktr->ktr_code == SYS___acl_set_fd || ktr->ktr_code == SYS___acl_delete_file || ktr->ktr_code == SYS___acl_delete_fd || ktr->ktr_code == SYS___acl_aclcheck_file || ktr->ktr_code == SYS___acl_aclcheck_fd || ktr->ktr_code == SYS___acl_get_link || ktr->ktr_code == SYS___acl_set_link || ktr->ktr_code == SYS___acl_delete_link || ktr->ktr_code == SYS___acl_aclcheck_link) { print_number(ip,narg,c); (void)putchar(','); acltypename((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_sigaction) { (void)putchar('('); signame((int)*ip); ip++; narg--; c = ','; } else if (ktr->ktr_code == SYS_extattrctl) { print_number(ip,narg,c); (void)putchar(','); extattrctlname((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_nmount) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); mountflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_thr_create) { print_number(ip,narg,c); print_number(ip,narg,c); (void)putchar(','); thrcreateflagsname ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_thr_kill) { print_number(ip,narg,c); (void)putchar(','); signame ((int)*ip); ip++; narg--; } else if (ktr->ktr_code == SYS_kldunloadf) { print_number(ip,narg,c); (void)putchar(','); kldunloadfflagsname ((int)*ip); ip++; narg--; } } while (narg) { print_number(ip,narg,c); } (void)putchar(')'); } (void)putchar('\n'); } void ktrsysret(struct ktr_sysret *ktr) { register_t ret = ktr->ktr_retval; int error = ktr->ktr_error; int code = ktr->ktr_code; if (code >= nsyscalls || code < 0) (void)printf("[%d] ", code); else (void)printf("%s ", syscallnames[code]); if (error == 0) { if (fancy) { (void)printf("%d", ret); if (ret < 0 || ret > 9) (void)printf("/%#lx", (long)ret); } else { if (decimal) (void)printf("%ld", (long)ret); else (void)printf("%#lx", (long)ret); } } else if (error == ERESTART) (void)printf("RESTART"); else if (error == EJUSTRETURN) (void)printf("JUSTRETURN"); else { (void)printf("-1 errno %d", ktr->ktr_error); if (fancy) (void)printf(" %s", strerror(ktr->ktr_error)); } (void)putchar('\n'); } void ktrnamei(char *cp, int len) { (void)printf("\"%.*s\"\n", len, cp); } void hexdump(char *p, int len, int screenwidth) { int n, i; int width; width = 0; do { width += 2; i = 13; /* base offset */ i += (width / 2) + 1; /* spaces every second byte */ i += (width * 2); /* width of bytes */ i += 3; /* " |" */ i += width; /* each byte */ i += 1; /* "|" */ } while (i < screenwidth); width -= 2; for (n = 0; n < len; n += width) { for (i = n; i < n + width; i++) { if ((i % width) == 0) { /* beginning of line */ printf(" 0x%04x", i); } if ((i % 2) == 0) { printf(" "); } if (i < len) printf("%02x", p[i] & 0xff); else printf(" "); } printf(" |"); for (i = n; i < n + width; i++) { if (i >= len) break; if (p[i] >= ' ' && p[i] <= '~') printf("%c", p[i]); else printf("."); } printf("|\n"); } if ((i % width) != 0) printf("\n"); } void visdump(char *dp, int datalen, int screenwidth) { int col = 0; char *cp; int width; char visbuf[5]; (void)printf(" \""); col = 8; for (;datalen > 0; datalen--, dp++) { (void) vis(visbuf, *dp, VIS_CSTYLE, *(dp+1)); cp = visbuf; /* * Keep track of printables and * space chars (like fold(1)). */ if (col == 0) { (void)putchar('\t'); col = 8; } switch(*cp) { case '\n': col = 0; (void)putchar('\n'); continue; case '\t': width = 8 - (col&07); break; default: width = strlen(cp); } if (col + width > (screenwidth-2)) { (void)printf("\\\n\t"); col = 8; } col += width; do { (void)putchar(*cp++); } while (*cp); } if (col == 0) (void)printf(" "); (void)printf("\"\n"); } void ktrgenio(struct ktr_genio *ktr, int len) { int datalen = len - sizeof (struct ktr_genio); char *dp = (char *)ktr + sizeof (struct ktr_genio); static int screenwidth = 0; int i, binary; if (screenwidth == 0) { struct winsize ws; if (fancy && ioctl(fileno(stderr), TIOCGWINSZ, &ws) != -1 && ws.ws_col > 8) screenwidth = ws.ws_col; else screenwidth = 80; } printf("fd %d %s %d byte%s\n", ktr->ktr_fd, ktr->ktr_rw == UIO_READ ? "read" : "wrote", datalen, datalen == 1 ? "" : "s"); if (suppressdata) return; if (maxdata && datalen > maxdata) datalen = maxdata; for (i = 0, binary = 0; i < datalen && binary == 0; i++) { if (dp[i] >= 32 && dp[i] < 127) continue; if (dp[i] == 10 || dp[i] == 13 || dp[i] == 0 || dp[i] == 9) continue; binary = 1; } if (binary) hexdump(dp, datalen, screenwidth); else visdump(dp, datalen, screenwidth); } const char *signames[] = { "NULL", "HUP", "INT", "QUIT", "ILL", "TRAP", "IOT", /* 1 - 6 */ "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", /* 7 - 12 */ "PIPE", "ALRM", "TERM", "URG", "STOP", "TSTP", /* 13 - 18 */ "CONT", "CHLD", "TTIN", "TTOU", "IO", "XCPU", /* 19 - 24 */ "XFSZ", "VTALRM", "PROF", "WINCH", "29", "USR1", /* 25 - 30 */ "USR2", NULL, /* 31 - 32 */ }; void ktrpsig(struct ktr_psig *psig) { if (psig->signo > 0 && psig->signo < NSIG) (void)printf("SIG%s ", signames[psig->signo]); else (void)printf("SIG %d ", psig->signo); if (psig->action == SIG_DFL) (void)printf("SIG_DFL\n"); else { (void)printf("caught handler=0x%lx mask=0x%x code=0x%x\n", (u_long)psig->action, psig->mask.__bits[0], psig->code); } } void ktrcsw(struct ktr_csw *cs) { (void)printf("%s %s\n", cs->out ? "stop" : "resume", cs->user ? "user" : "kernel"); } #define UTRACE_DLOPEN_START 1 #define UTRACE_DLOPEN_STOP 2 #define UTRACE_DLCLOSE_START 3 #define UTRACE_DLCLOSE_STOP 4 #define UTRACE_LOAD_OBJECT 5 #define UTRACE_UNLOAD_OBJECT 6 #define UTRACE_ADD_RUNDEP 7 #define UTRACE_PRELOAD_FINISHED 8 #define UTRACE_INIT_CALL 9 #define UTRACE_FINI_CALL 10 struct utrace_rtld { char sig[4]; /* 'RTLD' */ int event; void *handle; void *mapbase; size_t mapsize; int refcnt; char name[MAXPATHLEN]; }; void ktruser_rtld(int len, unsigned char *p) { struct utrace_rtld *ut = (struct utrace_rtld *)p; void *parent; int mode; switch (ut->event) { case UTRACE_DLOPEN_START: mode = ut->refcnt; printf("dlopen(%s, ", ut->name); switch (mode & RTLD_MODEMASK) { case RTLD_NOW: printf("RTLD_NOW"); break; case RTLD_LAZY: printf("RTLD_LAZY"); break; default: printf("%#x", mode & RTLD_MODEMASK); } if (mode & RTLD_GLOBAL) printf(" | RTLD_GLOBAL"); if (mode & RTLD_TRACE) printf(" | RTLD_TRACE"); if (mode & ~(RTLD_MODEMASK | RTLD_GLOBAL | RTLD_TRACE)) printf(" | %#x", mode & ~(RTLD_MODEMASK | RTLD_GLOBAL | RTLD_TRACE)); printf(")\n"); break; case UTRACE_DLOPEN_STOP: printf("%p = dlopen(%s) ref %d\n", ut->handle, ut->name, ut->refcnt); break; case UTRACE_DLCLOSE_START: printf("dlclose(%p) (%s, %d)\n", ut->handle, ut->name, ut->refcnt); break; case UTRACE_DLCLOSE_STOP: printf("dlclose(%p) finished\n", ut->handle); break; case UTRACE_LOAD_OBJECT: printf("RTLD: loaded %p @ %p - %p (%s)\n", ut->handle, ut->mapbase, (char *)ut->mapbase + ut->mapsize - 1, ut->name); break; case UTRACE_UNLOAD_OBJECT: printf("RTLD: unloaded %p @ %p - %p (%s)\n", ut->handle, ut->mapbase, (char *)ut->mapbase + ut->mapsize - 1, ut->name); break; case UTRACE_ADD_RUNDEP: parent = ut->mapbase; printf("RTLD: %p now depends on %p (%s, %d)\n", parent, ut->handle, ut->name, ut->refcnt); break; case UTRACE_PRELOAD_FINISHED: printf("RTLD: LD_PRELOAD finished\n"); break; case UTRACE_INIT_CALL: printf("RTLD: init %p for %p (%s)\n", ut->mapbase, ut->handle, ut->name); break; case UTRACE_FINI_CALL: printf("RTLD: fini %p for %p (%s)\n", ut->mapbase, ut->handle, ut->name); break; default: p += 4; len -= 4; printf("RTLD: %d ", len); while (len--) if (decimal) printf(" %d", *p++); else printf(" %02x", *p++); printf("\n"); } } struct utrace_malloc { void *p; size_t s; void *r; }; void ktruser_malloc(int len, unsigned char *p) { struct utrace_malloc *ut = (struct utrace_malloc *)p; if (ut->p == NULL) { if (ut->s == 0 && ut->r == NULL) printf("malloc_init()\n"); else printf("%p = malloc(%zu)\n", ut->r, ut->s); } else { if (ut->s == 0) printf("free(%p)\n", ut->p); else printf("%p = realloc(%p, %zu)\n", ut->r, ut->p, ut->s); } } void ktruser(int len, unsigned char *p) { if (len >= 8 && bcmp(p, "RTLD", 4) == 0) { ktruser_rtld(len, p); return; } if (len == sizeof(struct utrace_malloc)) { ktruser_malloc(len, p); return; } (void)printf("%d ", len); while (len--) if (decimal) (void)printf(" %d", *p++); else (void)printf(" %02x", *p++); (void)printf("\n"); } void ktrsockaddr(struct sockaddr *sa) { /* TODO: Support additional address families - #include - struct sockaddr_atm *atm; #include struct sockaddr_natm *natm; #include struct sockaddr_nb *nb; */ char addr[64]; /* * note: ktrstruct() has already verified that sa points to a * buffer at least sizeof(struct sockaddr) bytes long and exactly * sa->sa_len bytes long. */ printf("struct sockaddr { "); sockfamilyname(sa->sa_family); printf(", "); #define check_sockaddr_len(n) \ if (sa_##n->s##n##_len < sizeof(struct sockaddr_##n)) { \ printf("invalid"); \ break; \ } switch(sa->sa_family) { case AF_INET: { struct sockaddr_in *sa_in; sa_in = (struct sockaddr_in *)sa; check_sockaddr_len(in); inet_ntop(AF_INET, &sa_in->sin_addr, addr, sizeof addr); printf("%s:%u", addr, ntohs(sa_in->sin_port)); break; } #ifdef NETATALK case AF_APPLETALK: { struct sockaddr_at *sa_at; struct netrange *nr; sa_at = (struct sockaddr_at *)sa; check_sockaddr_len(at); nr = &sa_at->sat_range.r_netrange; printf("%d.%d, %d-%d, %d", ntohs(sa_at->sat_addr.s_net), sa_at->sat_addr.s_node, ntohs(nr->nr_firstnet), ntohs(nr->nr_lastnet), nr->nr_phase); break; } #endif case AF_INET6: { struct sockaddr_in6 *sa_in6; sa_in6 = (struct sockaddr_in6 *)sa; check_sockaddr_len(in6); inet_ntop(AF_INET6, &sa_in6->sin6_addr, addr, sizeof addr); printf("[%s]:%u", addr, htons(sa_in6->sin6_port)); break; } #ifdef IPX case AF_IPX: { struct sockaddr_ipx *sa_ipx; sa_ipx = (struct sockaddr_ipx *)sa; check_sockaddr_len(ipx); /* XXX wish we had ipx_ntop */ printf("%s", ipx_ntoa(sa_ipx->sipx_addr)); break; } #endif case AF_UNIX: { struct sockaddr_un *sa_un; sa_un = (struct sockaddr_un *)sa; check_sockaddr_len(un); printf("%.*s", (int)sizeof(sa_un->sun_path), sa_un->sun_path); break; } default: printf("unknown address family"); } printf(" }\n"); } void ktrstat(struct stat *statp) { char mode[12], timestr[PATH_MAX + 4]; struct passwd *pwd; struct group *grp; struct tm *tm; /* * note: ktrstruct() has already verified that statp points to a * buffer exactly sizeof(struct stat) bytes long. */ printf("struct stat {"); strmode(statp->st_mode, mode); printf("dev=%ju, ino=%ju, mode=%s, nlink=%ju, ", (uintmax_t)statp->st_dev, (uintmax_t)statp->st_ino, mode, (uintmax_t)statp->st_nlink); if (resolv == 0 || (pwd = getpwuid(statp->st_uid)) == NULL) printf("uid=%ju, ", (uintmax_t)statp->st_uid); else printf("uid=\"%s\", ", pwd->pw_name); if (resolv == 0 || (grp = getgrgid(statp->st_gid)) == NULL) printf("gid=%ju, ", (uintmax_t)statp->st_gid); else printf("gid=\"%s\", ", grp->gr_name); printf("rdev=%ju, ", (uintmax_t)statp->st_rdev); printf("atime="); if (resolv == 0) printf("%ld", statp->st_atimespec.tv_sec); else { tm = localtime(&statp->st_atimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); printf("\"%s\"", timestr); } if (statp->st_atimespec.tv_nsec != 0) printf(".%09ld, ", statp->st_atimespec.tv_nsec); else printf(", "); printf("stime="); if (resolv == 0) printf("%ld", statp->st_mtimespec.tv_sec); else { tm = localtime(&statp->st_mtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); printf("\"%s\"", timestr); } if (statp->st_mtimespec.tv_nsec != 0) printf(".%09ld, ", statp->st_mtimespec.tv_nsec); else printf(", "); printf("ctime="); if (resolv == 0) printf("%ld", statp->st_ctimespec.tv_sec); else { tm = localtime(&statp->st_ctimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); printf("\"%s\"", timestr); } if (statp->st_ctimespec.tv_nsec != 0) printf(".%09ld, ", statp->st_ctimespec.tv_nsec); else printf(", "); printf("birthtime="); if (resolv == 0) printf("%ld", statp->st_birthtimespec.tv_sec); else { tm = localtime(&statp->st_birthtimespec.tv_sec); (void)strftime(timestr, sizeof(timestr), TIME_FORMAT, tm); printf("\"%s\"", timestr); } if (statp->st_birthtimespec.tv_nsec != 0) printf(".%09ld, ", statp->st_birthtimespec.tv_nsec); else printf(", "); printf("size=%jd, blksize=%ju, blocks=%jd, flags=0x%x", (uintmax_t)statp->st_size, (uintmax_t)statp->st_blksize, (intmax_t)statp->st_blocks, statp->st_flags); printf(" }\n"); } void ktrstruct(char *buf, size_t buflen) { char *name, *data; size_t namelen, datalen; int i; for (name = buf, namelen = 0; namelen < buflen && name[namelen] != '\0'; ++namelen) /* nothing */; if (namelen == buflen) goto invalid; if (name[namelen] != '\0') goto invalid; data = buf + namelen + 1; datalen = buflen - namelen - 1; if (datalen == 0) goto invalid; /* sanity check */ for (i = 0; i < namelen; ++i) if (!isalpha((unsigned char)name[i])) goto invalid; if (strcmp(name, "stat") == 0) { if (datalen != sizeof(struct stat)) goto invalid; ktrstat((struct stat *)data); } else if (strcmp(name, "sockaddr") == 0) { if (datalen < sizeof(struct sockaddr) || datalen != ((struct sockaddr *)(data))->sa_len) goto invalid; ktrsockaddr((struct sockaddr *)data); } else { printf("unknown structure\n"); } return; invalid: printf("invalid record\n"); } void usage(void) { fprintf(stderr, "usage: kdump [-dEnlHRrsT] [-f trfile] " "[-m maxdata] [-p pid] [-t trstr]\n"); exit(1); } Index: head/usr.bin/kdump/mkioctls =================================================================== --- head/usr.bin/kdump/mkioctls (revision 179307) +++ head/usr.bin/kdump/mkioctls (revision 179308) @@ -1,94 +1,89 @@ #!/bin/sh # # $FreeBSD$ set -e if [ "x$1" = "x-s" ]; then use_switch=1 shift else use_switch=0 fi if [ -z "$1" ]; then echo "usage: sh $0 [-s] include-dir" exit 1 fi LC_ALL=C; export LC_ALL # Build a list of headers that have ioctls in them. # XXX should we use an ANSI cpp? ioctl_includes=` cd $1 find -H -s * -name '*.h' | xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\\\n", $1)}' ` awk -v x="$ioctl_includes" 'BEGIN {print x}' | gcc -E -I$1 -dM - | awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" ' BEGIN { print "/* XXX obnoxious prerequisites. */" print "#define COMPAT_43" print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " -# Disabled in 7.0 as netatm is not MPSAFE. -# print "#include " -# print "#include " -# print "#include " -# print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "#include " print "" print "const char *ioctlname(u_long val);" print "" print ioctl_includes print "" print "const char *" print "ioctlname(u_long val)" print "{" print "" if (use_switch) print "\tswitch(val) {" } /^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO/ { # find where the name starts for (i = 1; i <= NF; i++) if ($i ~ /define/) break; ++i; # if (use_switch) printf("\tcase %s:\n\t\treturn(\"%s\");\n", $i, $i); else printf("\tif (val == %s)\n\t\treturn(\"%s\");\n", $i, $i); } END { if (use_switch) print "\t}" print "\n\treturn(NULL);" print "}" } ' Index: head/usr.sbin/atm/scspd/scspd.c =================================================================== --- head/usr.sbin/atm/scspd/scspd.c (revision 179307) +++ head/usr.sbin/atm/scspd/scspd.c (nonexistent) @@ -1,547 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP server daemon main line code - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Global variables - */ -char *prog; -char *scsp_config_file = SCSPD_CONFIG; -FILE *scsp_log_file = (FILE *)0; -int scsp_log_syslog = 0; -Scsp_server *scsp_server_head = (Scsp_server *)0; -Scsp_pending *scsp_pending_head = (Scsp_pending *)0; -int scsp_max_socket = -1; -int scsp_debug_mode = 0; -int scsp_trace_mode = 0; - - -/* - * Local variables - */ -static int scsp_hup_signal = 0; -static int scsp_int_signal = 0; - - -/* - * SIGHUP signal handler - * - * Arguments: - * sig signal number - * - * Returns: - * none - * - */ -void -scsp_sighup(sig) - int sig; -{ - /* - * Flag the signal - */ - scsp_hup_signal = 1; -} - - -/* - * SIGINT signal handler - * - * Arguments: - * sig signal number - * - * Returns: - * none - * - */ -void -scsp_sigint(sig) - int sig; -{ - /* - * Flag the signal - */ - scsp_int_signal = 1; -} - - -/* - * Process command line parameters - * - * Arguments: - * argc number of command-line arguments - * argv list of pointers to command-line arguments - * - * Returns: - * none - * - */ -void -initialize(argc, argv) - int argc; - char **argv; -{ - int i; - char *cp; - - /* - * Save program name, ignoring any path components - */ - if ((prog = (char *)strrchr(argv[0], '/')) != NULL) - prog++; - else - prog = argv[0]; - - /* - * Make sure we're being invoked by the super user - */ - i = getuid(); - if (i != 0) { - fprintf(stderr, "%s: You must be root to run this program\n", - prog); - exit(1); - } - - /* - * Check for command-line options - */ - for (i = 1; i < argc; i++) { - if (strcmp(argv[i], "-d") == 0) { - /* - * -d option -- set debug mode - */ - scsp_debug_mode = 1; - } else if (strcmp(argv[i], "-f") == 0) { - /* - * -f option -- set config file name - */ - i++; - if (i >= argc) { - fprintf(stderr, "%s: Configuration file name missing\n", - prog); - exit(1); - } - scsp_config_file = argv[i]; - } else if (strncmp(argv[i], "-T", 2) == 0) { - /* - * -T option -- trace options - */ - for (cp = &argv[i][2]; *cp; cp++) { - if (*cp == 'c') - scsp_trace_mode |= SCSP_TRACE_CAFSM; - else if (*cp == 'h') - scsp_trace_mode |= SCSP_TRACE_HFSM; - else if (*cp == 'i') - scsp_trace_mode |= SCSP_TRACE_CFSM; - else if (*cp == 'C') - scsp_trace_mode |= SCSP_TRACE_CA_MSG; - else if (*cp == 'H') - scsp_trace_mode |= SCSP_TRACE_HELLO_MSG; - else if (*cp == 'I') - scsp_trace_mode |= SCSP_TRACE_IF_MSG; - else - fprintf(stderr, "Invalid trace specification '%c' ignored\n", - *cp); - } - } else { - /* - * Error -- unrecognized option - */ - fprintf(stderr, "%s: Unrecognized option \"%s\"\n", - prog, argv[i]); - exit(1); - } - } -} - - -/* - * Daemon housekeeping - * - * Arguments: - * None - * - * Returns: - * None - * - */ -static void -start_daemon() - -{ - int dpid, fd, file_count, rc; - - /* - * Ignore selected signals - */ -#ifdef SIGTTOU - signal(SIGTTOU, SIG_IGN); -#endif -#ifdef SIGTTIN - signal(SIGTTIN, SIG_IGN); -#endif -#ifdef SIGTSTP - signal(SIGTSTP, SIG_IGN); -#endif -#ifdef SIGPIPE - signal(SIGPIPE, SIG_IGN); -#endif - - - /* - * Don't put the daemon into the background if - * we're in debug mode - */ - if (scsp_debug_mode) - goto daemon_bypass; - - /* - * Put the daemon into the background - */ - dpid = fork(); - if (dpid < 0) { - scsp_log(LOG_ERR, "fork failed"); - abort(); - } - if (dpid > 0) { - /* - * This is the parent process--just exit and let - * the daughter do all the work - */ - exit(0); - } - - /* - * Disassociate from any controlling terminal - */ - rc = setpgrp(0, getpid()); - if (rc <0) { - scsp_log(LOG_ERR, "can't change process group"); - exit(1); - } - fd = open(_PATH_TTY, O_RDWR); - if (fd >= 0) { - ioctl(fd, TIOCNOTTY, (char *)0); - close(fd); - } - - /* - * Close all open file descriptors - */ - file_count = getdtablesize(); - for (fd=0; fdss_next) { - if (ssp->ss_dcs_lsock != -1) - FD_SET(ssp->ss_dcs_lsock, &read_set); - if (ssp->ss_sock != -1) - FD_SET(ssp->ss_sock, &read_set); - for (dcsp = ssp->ss_dcs; dcsp; - dcsp = dcsp->sd_next) { - if (dcsp->sd_sock != -1) { - if (dcsp->sd_hello_state == - SCSP_HFSM_DOWN ) - FD_SET(dcsp->sd_sock, - &write_set); - else - FD_SET(dcsp->sd_sock, - &read_set); - } - } - } - for (psp = scsp_pending_head; psp; psp = psp->sp_next) { - FD_SET(psp->sp_sock, &read_set); - } - rc = select(scsp_max_socket + 1, &read_set, - &write_set, &except_set, - (struct timeval *)0); - if (rc < 0) { - /* - * Select error--check for possible signals - */ - if (harp_timer_exec) { - /* - * Timer tick--process it - */ - timer_proc(); - continue; - } else if (scsp_hup_signal) { - /* - * SIGHUP signal--reconfigure - */ - scsp_hup_signal = 0; - scsp_reconfigure(); - continue; - } else if (scsp_int_signal) { - /* - * SIGINT signal--dump control blocks - */ - print_scsp_dump(); - scsp_int_signal = 0; - continue; - } else if (errno == EINTR) { - /* - * EINTR--just ignore it - */ - continue; - } else { - /* - * Other error--this is a problem - */ - scsp_log(LOG_ERR, "Select failed"); - abort(); - } - } - - /* - * Check the read set for connections from servers - */ - if (FD_ISSET(scsp_server_lsock, &read_set)) { - FD_CLR(scsp_server_lsock, &read_set); - rc = scsp_server_accept(scsp_server_lsock); - } - - /* - * Check the write set for new connections to DCSs - */ - for (i = 0; i <= scsp_max_socket; i++) { - if (FD_ISSET(i, &write_set)) { - FD_CLR(i, &write_set); - if ((dcsp = scsp_find_dcs(i)) != NULL) { - rc = scsp_hfsm(dcsp, - SCSP_HFSM_VC_ESTAB, - (Scsp_msg *)0); - } - } - } - - /* - * Check the read set for connections from DCSs - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - if (ssp->ss_dcs_lsock != -1 && - FD_ISSET(ssp->ss_dcs_lsock, - &read_set)) { - FD_CLR(ssp->ss_dcs_lsock, &read_set); - dcsp = scsp_dcs_accept(ssp); - if (dcsp) { - rc = scsp_hfsm(dcsp, - SCSP_HFSM_VC_ESTAB, - (Scsp_msg *)0); - } - } - } - - /* - * Check the read set for data from pending servers - */ - for (psp = scsp_pending_head; psp; psp = next_psp) { - next_psp = psp->sp_next; - if (FD_ISSET(psp->sp_sock, &read_set)) { - FD_CLR(psp->sp_sock, &read_set); - rc = scsp_pending_read(psp); - } - } - - /* - * Check the read set for data from servers or DCSs - */ - for (i = 0; i <= scsp_max_socket; i++) { - if (FD_ISSET(i, &read_set)) { - if ((ssp = scsp_find_server(i)) != NULL) { - rc = scsp_server_read(ssp); - } else if ((dcsp = scsp_find_dcs(i)) != NULL) { - rc = scsp_dcs_read(dcsp); - } - } - } - } -} Property changes on: head/usr.sbin/atm/scspd/scspd.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_if.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_if.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_if.c (nonexistent) @@ -1,626 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Interface to client server protocol - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * SCSP client server interface FSM actions - */ -#define SCSP_CIFSM_ACTION_CNT 11 -int scsp_client_act_00(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_01(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_02(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_03(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_04(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_05(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_06(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_07(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_08(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_09(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); -int scsp_client_act_10(Scsp_dcs *, Scsp_msg *, Scsp_if_msg *); - -static int (*scsp_action_vector[SCSP_CIFSM_ACTION_CNT])() = { - scsp_client_act_00, - scsp_client_act_01, - scsp_client_act_02, - scsp_client_act_03, - scsp_client_act_04, - scsp_client_act_05, - scsp_client_act_06, - scsp_client_act_07, - scsp_client_act_08, - scsp_client_act_09, - scsp_client_act_10 -}; - - -/* - * Client server interface FSM state table - */ -static int client_state_table[SCSP_CIFSM_EVENT_CNT][SCSP_CIFSM_STATE_CNT] = { - /* 0 1 2 3 */ - { 1, 3, 3, 3 }, /* 0 */ - { 2, 5, 5, 5 }, /* 1 */ - { 0, 4, 0, 0 }, /* 2 */ - { 0, 6, 6, 1 }, /* 3 */ - { 1, 0, 7, 7 }, /* 4 */ - { 7, 7, 7, 7 }, /* 5 */ - { 1, 1, 8, 8 }, /* 6 */ - { 0, 0, 10, 10 }, /* 7 */ - { 0, 0, 1, 1 }, /* 8 */ - { 0, 0, 9, 9 } /* 9 */ -}; - - -/* - * SCSP client server interface finite state machine - * - * Arguments: - * ssp pointer to server control block - * event the event which has occurred - * msg pointer to message from DCS, if there is one - * cmsg pointer to message from server, if there is one - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_cfsm(dcsp, event, msg, cmsg) - Scsp_dcs *dcsp; - int event; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int action, rc, state; - - /* - * Select an action from the state table - */ - state = dcsp->sd_client_state; - action = client_state_table[event][state]; - if (scsp_trace_mode & SCSP_TRACE_CFSM) { - scsp_trace("Server I/F FSM: state=%d, event=%d, action=%d\n", - state, event, action); - } - if (action >= SCSP_CIFSM_ACTION_CNT || action <= 0) { - scsp_log(LOG_ERR, "Server I/F FSM--invalid action %d; state=%d, event=%d", - action, dcsp->sd_client_state, event); - exit(1); - } - - /* - * Perform the selected action - */ - rc = scsp_action_vector[action](dcsp, msg, cmsg); - - return(rc); -} - - -/* - * SCSP client server interface finite state machine action 0 - * Unexpected action -- log an error message - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS (ignored) - * cmsg pointer to message from server (ignored) - * - * Returns: - * EOPNOTSUPP always returns EOPNOTSUPP - * - */ -int -scsp_client_act_00(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - scsp_log(LOG_ERR, "Server I/F FSM error--unexpected action, state=%d", - dcsp->sd_client_state); - return(EOPNOTSUPP); -} - - -/* - * SCSP client server interface finite state machine action 1 - * - * Ignore an event - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 always returns 0 - * - */ -int -scsp_client_act_01(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - return(0); -} - - -/* - * SCSP client server interface finite state machine action 2 - * - * CA FSM went to Cache Summarize state--go to Summarize - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_02(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - /* - * Set the new state - */ - dcsp->sd_client_state = SCSP_CIFSM_SUM; - - return(0); -} - - -/* - * SCSP client server interface finite state machine action 3 - * - * CA FSM went down--clean up and go to Null - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_03(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - /* - * Set the new state - */ - dcsp->sd_client_state = SCSP_CIFSM_NULL; - - return(0); -} - - -/* - * SCSP client server interface finite state machine action 4 - * - * CA FSM went to Update Cache state--go to Update state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_04(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - /* - * Set the new state - */ - dcsp->sd_client_state = SCSP_CIFSM_UPD; - - return(0); -} - - -/* - * SCSP client server interface finite state machine action 5 - * - * The CA FSM went to Cache Summarize state from Summarize, - * Update, or Aligned, implying that the CA FSM went down and came - * back up--copy the server's cache to the DCSs CSAS list and go to - * Summarize state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_05(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int i; - Scsp_cse *csep, *ncsep; - - /* - * Copy the cache summmary to the CSAS list - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - for (csep = dcsp->sd_server->ss_cache[i]; csep; - csep = csep->sc_next) { - ncsep = scsp_dup_cse(csep); - LINK2TAIL(ncsep, Scsp_cse, dcsp->sd_ca_csas, - sc_next); - } - } - - /* - * Set the new state - */ - dcsp->sd_client_state = SCSP_CIFSM_SUM; - - return(0); -} - - -/* - * SCSP client server interface finite state machine action 6 - * - * CA FSM went to Aligned state--go to Aligned - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_06(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - /* - * Set the new state - */ - dcsp->sd_client_state = SCSP_CIFSM_ALIGN; - - return(0); -} - - -/* - * SCSP client server interface finite state machine action 7 - * - * We received a Solicit Rsp or Update Req from the server--pass it - * to the CA FSM - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_07(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int rc; - Scsp_csa *csap; - Scsp_atmarp_csa *acp; - - /* - * Allocate memory for a CSA record - */ - csap = calloc(1, sizeof(Scsp_csa)); - if (csap == NULL) - scsp_mem_err("scsp_client_act_07: sizeof(Scsp_csa)"); - acp = calloc(1, sizeof(Scsp_atmarp_csa)); - if (acp == NULL) - scsp_mem_err("scsp_client_act_07: sizeof(Scsp_atmarp_csa)"); - - /* - * Build a CSA record from the server's message - */ - csap->hops = dcsp->sd_hops; - csap->null = (cmsg->si_atmarp.sa_state == SCSP_ASTATE_DEL) || - (cmsg->si_type == SCSP_SOLICIT_RSP && - cmsg->si_rc != SCSP_RSP_OK); - csap->seq = cmsg->si_atmarp.sa_seq; - csap->key = cmsg->si_atmarp.sa_key; - csap->oid = cmsg->si_atmarp.sa_oid; - csap->atmarp_data = acp; - acp->sa_state = cmsg->si_atmarp.sa_state; - acp->sa_sha = cmsg->si_atmarp.sa_cha; - acp->sa_ssa = cmsg->si_atmarp.sa_csa; - acp->sa_spa = cmsg->si_atmarp.sa_cpa; - acp->sa_tpa = cmsg->si_atmarp.sa_cpa; - - /* - * Call the CA FSM - */ - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CACHE_UPD, (void *)csap); - - return(rc); -} - - -/* - * SCSP client server interface finite state machine action 8 - * - * Update Rsp from server--pass the update to the CA FSM. - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_08(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int rc; - - /* - * Pass the response to the CA FSM - */ - switch (dcsp->sd_server->ss_pid) { - case SCSP_PROTO_ATMARP: - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CACHE_RSP, cmsg); - break; - default: - rc = EPROTONOSUPPORT; - } - - return(rc); -} - - -/* - * SCSP client server interface finite state machine action 9 - * - * CSU Solicit from DCS--pass Solicit Ind to server - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_09(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int rc, rrc = 0; - Scsp_csa *csap; - Scsp_if_msg *csip; - - /* - * Get memory for a Solicit Ind - */ - csip = calloc(1, sizeof(Scsp_if_msg)); - if (csip == NULL) - scsp_mem_err("scsp_client_act_09: sizeof(Scsp_if_msg)"); - - /* - * Loop through list of CSAs - */ - for (csap = msg->sc_csu_msg->csu_csa_rec; csap; - csap = csap->next) { - /* - * Fill out the Solicit Indication - */ - bzero(csip, sizeof(Scsp_if_msg)); - csip->si_type = SCSP_SOLICIT_IND; - csip->si_proto = dcsp->sd_server->ss_pid; - csip->si_tok = (u_long)dcsp; - csip->si_len = sizeof(Scsp_if_msg_hdr) + - sizeof(Scsp_sum_msg); - csip->si_sum.ss_hops = csap->hops; - csip->si_sum.ss_null = csap->null; - csip->si_sum.ss_seq = csap->seq; - csip->si_sum.ss_key = csap->key; - csip->si_sum.ss_oid = csap->oid; - - /* - * Send the Solicit Ind to the server - */ - rc = scsp_if_sock_write(dcsp->sd_server->ss_sock, csip); - if (rc) { - rrc = rc; - } - } - free(csip); - return(rrc); -} - - -/* - * SCSP client server interface finite state machine action 10 - * - * CSU Request from DCS--pass it to the server as a Cache Update - * Indication - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message from DCS - * cmsg pointer to message from server - * - * Returns: - * 0 success - * else errno describing error - * - */ -int -scsp_client_act_10(dcsp, msg, cmsg) - Scsp_dcs *dcsp; - Scsp_msg *msg; - Scsp_if_msg *cmsg; -{ - int rc, rrc = 0; - Scsp_csa *csap; - Scsp_atmarp_csa *acp; - Scsp_if_msg *cuip; - - /* - * Get memory for a Cache Update Ind - */ - cuip = malloc(sizeof(Scsp_if_msg)); - if (cuip == NULL) - scsp_mem_err("scsp_client_act_10: sizeof(Scsp_if_msg)"); - - /* - * Loop through CSAs in message - */ - for (csap = msg->sc_csu_msg->csu_csa_rec; csap; - csap = csap->next) { - acp = csap->atmarp_data; - if (!acp) - continue; - - /* - * Fill out the Cache Update Ind - */ - bzero(cuip, sizeof(Scsp_if_msg)); - cuip->si_type = SCSP_UPDATE_IND; - cuip->si_proto = dcsp->sd_server->ss_pid; - cuip->si_tok = (u_long)dcsp; - switch(dcsp->sd_server->ss_pid) { - case SCSP_PROTO_ATMARP: - cuip->si_len = sizeof(Scsp_if_msg_hdr) + - sizeof(Scsp_atmarp_msg); - cuip->si_atmarp.sa_state = acp->sa_state; - cuip->si_atmarp.sa_cpa = acp->sa_spa; - cuip->si_atmarp.sa_cha = acp->sa_sha; - cuip->si_atmarp.sa_csa = acp->sa_ssa; - cuip->si_atmarp.sa_key = csap->key; - cuip->si_atmarp.sa_oid = csap->oid; - cuip->si_atmarp.sa_seq = csap->seq; - break; - case SCSP_PROTO_NHRP: - /* - * Not implemented yet - */ - break; - } - - /* - * Send the Cache Update Ind to the server - */ - rc = scsp_if_sock_write(dcsp->sd_server->ss_sock, cuip); - if (rc) { - rrc = rc; - } - } - free(cuip); - return(rrc); -} Property changes on: head/usr.sbin/atm/scspd/scsp_if.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_cafsm.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_cafsm.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_cafsm.c (nonexistent) @@ -1,1439 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Cache Alignment finite state machine - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * CA FSM actions - */ -#define CA_ACTION_CNT 20 -int scsp_ca_act_00(Scsp_dcs *, void *); -int scsp_ca_act_01(Scsp_dcs *, void *); -int scsp_ca_act_02(Scsp_dcs *, void *); -int scsp_ca_act_03(Scsp_dcs *, void *); -int scsp_ca_act_04(Scsp_dcs *, void *); -int scsp_ca_act_05(Scsp_dcs *, void *); -int scsp_ca_act_06(Scsp_dcs *, void *); -int scsp_ca_act_07(Scsp_dcs *, void *); -int scsp_ca_act_08(Scsp_dcs *, void *); -int scsp_ca_act_09(Scsp_dcs *, void *); -int scsp_ca_act_10(Scsp_dcs *, void *); -int scsp_ca_act_11(Scsp_dcs *, void *); -int scsp_ca_act_12(Scsp_dcs *, void *); -int scsp_ca_act_13(Scsp_dcs *, void *); -int scsp_ca_act_14(Scsp_dcs *, void *); -int scsp_ca_act_15(Scsp_dcs *, void *); -int scsp_ca_act_16(Scsp_dcs *, void *); -int scsp_ca_act_17(Scsp_dcs *, void *); -int scsp_ca_act_18(Scsp_dcs *, void *); -int scsp_ca_act_19(Scsp_dcs *, void *); - -static int (*scsp_ca_act_vec[CA_ACTION_CNT])() = { - scsp_ca_act_00, - scsp_ca_act_01, - scsp_ca_act_02, - scsp_ca_act_03, - scsp_ca_act_04, - scsp_ca_act_05, - scsp_ca_act_06, - scsp_ca_act_07, - scsp_ca_act_08, - scsp_ca_act_09, - scsp_ca_act_10, - scsp_ca_act_11, - scsp_ca_act_12, - scsp_ca_act_13, - scsp_ca_act_14, - scsp_ca_act_15, - scsp_ca_act_16, - scsp_ca_act_17, - scsp_ca_act_18, - scsp_ca_act_19 -}; - -/* - * CA FSM state table - */ -static int ca_state_table[SCSP_CAFSM_EVENT_CNT][SCSP_CAFSM_STATE_CNT] = { - /* 0 1 2 3 4 5 */ - { 1, 1, 1, 1, 1, 1 }, /* 0 */ - { 2, 2, 2, 2, 2, 2 }, /* 1 */ - { 0, 3, 4, 5, 15, 15 }, /* 2 */ - { 0, 17, 17, 17, 7, 7 }, /* 3 */ - { 0, 17, 17, 17, 8, 8 }, /* 4 */ - { 0, 17, 17, 17, 10, 10 }, /* 5 */ - { 0, 6, 6, 0, 9, 9 }, /* 6 */ - { 0, 0, 0, 0, 12, 12 }, /* 7 */ - { 0, 0, 0, 0, 13, 13 }, /* 8 */ - { 18, 14, 14, 14, 11, 11 }, /* 9 */ - { 0, 19, 0, 0, 16, 16 }, /* 10 */ -}; - - -/* - * Cache Alignment finite state machine - * - * Arguments: - * dcsp pointer to a DCS control block for the neighbor - * event the event which has occurred - * p pointer to further parameter, if there is one - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_cafsm(dcsp, event, p) - Scsp_dcs *dcsp; - int event; - void *p; -{ - int action, rc, state; - - /* - * Select an action from the state table - */ - state = dcsp->sd_ca_state; - action = ca_state_table[event][state]; - if (scsp_trace_mode & SCSP_TRACE_CAFSM) { - scsp_trace("CAFSM: state=%d, event=%d, action=%d\n", - state, event, action); - } - if (action >= CA_ACTION_CNT || action < 0) { - scsp_log(LOG_ERR, "CA FSM--invalid action state=%d, event=%d, action=%d", - state, event, action); - abort(); - } - - /* - * Perform the selected action - */ - rc = scsp_ca_act_vec[action](dcsp, p); - - return(rc); -} - - -/* - * CA finite state machine action 0 - * Unexpected action -- log an error message and go to Master/Slave - * Negotiation. The unexpected action is probably from a protocol - * error. - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * EOPNOTSUPP always returns EOPNOTSUPP - * - */ -int -scsp_ca_act_00(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - - /* - * Log an error message - */ - scsp_log(LOG_ERR, "CA FSM error--unexpected action, state=%d", - dcsp->sd_ca_state); - - /* - * Set the new state - */ - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - - /* - * Clear out the DCS block - */ - scsp_dcs_cleanup(dcsp); - - /* - * Notify the client I/F FSM - */ - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_DOWN, (Scsp_msg *)0, - (Scsp_if_msg *)0); - - return(rc); -} - - -/* - * CA finite state machine action 1 - * Hello FSM has reached Bidirectional state -- go to Master/Slave - * Negotiation state, make a copy of the client's cache, send first CA - * message. - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_01(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int i, rc; - Scsp_cse *csep, *dupp; - - /* - * Set the new state - */ - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - - /* - * Make a copy of client's cache entries for cache alignment - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - for (csep = dcsp->sd_server->ss_cache[i]; - csep; csep = csep->sc_next) { - dupp = scsp_dup_cse(csep); - LINK2TAIL(dupp, Scsp_cse, dcsp->sd_ca_csas, - sc_next); - } - } - - /* - * Select an initial sequence number - */ - dcsp->sd_ca_seq = (int)time((time_t *)0); - - /* - * Send a CA message - */ - rc = scsp_send_ca(dcsp); - if (rc == 0) { - HARP_TIMER(&dcsp->sd_ca_rexmt_t, dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - } - - return(rc); -} - - -/* - * CA finite state machine action 2 - * Hello FSM has gone down -- go to Down state - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_02(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - - /* - * Set the new state - */ - dcsp->sd_ca_state = SCSP_CAFSM_DOWN; - - /* - * Clear out the DCS block - */ - scsp_dcs_cleanup(dcsp); - - /* - * Notify the client I/F FSM - */ - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_DOWN, (Scsp_msg *)0, - (Scsp_if_msg *)0); - - return(rc); -} - - -/* - * CA finite state machine action 3 - * CA message received -- select Cache Summarize Master or Slave state - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_03(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc = 0; - Scsp_msg *msg = (Scsp_msg *)p; - - /* - * Check for slave role for LS - */ - if (msg->sc_ca->ca_m && - msg->sc_ca->ca_i && - msg->sc_ca->ca_o && - msg->sc_ca->ca_mcp.rec_cnt == 0 && - scsp_cmp_id(&msg->sc_ca->ca_mcp.sid, - &msg->sc_ca->ca_mcp.rid) > 0) { - - /* - * Stop the retransmit timer - */ - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - - /* - * Set the new state - */ - dcsp->sd_ca_state = SCSP_CAFSM_SLAVE; - (void)scsp_cfsm(dcsp, SCSP_CIFSM_CA_SUMM, - (Scsp_msg *)0, (Scsp_if_msg *)0); - - /* - * Save the master's sequence number - */ - dcsp->sd_ca_seq = msg->sc_ca->ca_seq; - - /* - * Send a CA message - */ - rc = scsp_send_ca(dcsp); - } else - /* - * Check for master role for LS - */ - if (!msg->sc_ca->ca_m && - !msg->sc_ca->ca_i && - scsp_cmp_id(&msg->sc_ca->ca_mcp.sid, - &msg->sc_ca->ca_mcp.rid) < 0) { - /* - * Stop the retransmit timer - */ - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - - /* - * Set the new state - */ - dcsp->sd_ca_state = SCSP_CAFSM_MASTER; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_SUMM, - (Scsp_msg *)0, (Scsp_if_msg *)0); - - /* - * Process the CA message - */ - scsp_process_ca(dcsp, msg->sc_ca); - - /* - * Increment the sequence number - */ - dcsp->sd_ca_seq++; - - /* - * Send a CA in reply - */ - rc = scsp_send_ca(dcsp); - if (rc == 0) { - HARP_TIMER(&dcsp->sd_ca_rexmt_t, - dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - } - } else { - /* - * Ignore the message, go to Master/Slave Negotiation - */ - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - } - - return(rc); -} - - -/* - * CA finite state machine action 4 - * CA message received while in Cache Summarize Master state -- process - * CA message - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_04(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc = 0; - Scsp_msg *msg = (Scsp_msg *)p; - - /* - * If the other side thinks he's the master, or if the - * initialization bit is set, or if the message is out - * of sequence, go back to Master/Slave Negotiation state - */ - if (msg->sc_ca->ca_m || msg->sc_ca->ca_i || - msg->sc_ca->ca_seq < dcsp->sd_ca_seq - 1 || - msg->sc_ca->ca_seq > dcsp->sd_ca_seq) { - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - scsp_dcs_cleanup(dcsp); - return(scsp_ca_act_01(dcsp, (Scsp_msg *)0)); - } - - /* - * Ignore any duplicate messages - */ - if (msg->sc_ca->ca_seq == dcsp->sd_ca_seq - 1) { - return(0); - } - - /* - * Stop the retransmission timer - */ - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - - /* - * Process the CA message - */ - scsp_process_ca(dcsp, msg->sc_ca); - - /* - * Increment the CA sequence number - */ - dcsp->sd_ca_seq++; - - /* - * If we have no more CSAS records to send and the slave sent - * a message with the 'O' bit off, we're done with Summarize - * state - */ - if (!dcsp->sd_ca_csas && !msg->sc_ca->ca_o) { - /* - * Free any CA message saved for retransmission - */ - if (dcsp->sd_ca_rexmt_msg) { - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - dcsp->sd_ca_rexmt_msg = (Scsp_msg *)0; - } - - /* - * If the CRL is empty, we go directly to Aligned state; - * otherwise, we go to Update Cache and send a CSUS - */ - if (!dcsp->sd_crl) { - /* - * Go to Aligned state - */ - dcsp->sd_ca_state = SCSP_CAFSM_ALIGNED; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_ALIGN, - (Scsp_msg *)0, - (Scsp_if_msg *)0); - } else { - /* - * Go to Cache Update state - */ - dcsp->sd_ca_state = SCSP_CAFSM_UPDATE; - (void)scsp_cfsm(dcsp, SCSP_CIFSM_CA_UPD, - (Scsp_msg *)0, - (Scsp_if_msg *)0); - rc = scsp_send_csus(dcsp); - } - } else { - /* - * There are more CSAS records to be exchanged-- - * continue the cache exchange - */ - rc = scsp_send_ca(dcsp); - } - - return(rc); -} - - -/* - * CA finite state machine action 5 - * CA message received while in Cache Summarize Slave state -- process - * CA message - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_05(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc = 0; - Scsp_msg *msg = (Scsp_msg *)p; - - /* - * If the other side thinks we're the master, or if the - * initialization bit is set, or if the message is out - * of sequence, go back to Master/Slave Negotiation state - */ - if (!msg->sc_ca->ca_m || msg->sc_ca->ca_i || - msg->sc_ca->ca_seq < dcsp->sd_ca_seq || - msg->sc_ca->ca_seq > dcsp->sd_ca_seq + 1) { - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - scsp_dcs_cleanup(dcsp); - return(scsp_ca_act_01(dcsp, (Scsp_msg *)0)); - } - - /* - * If this is a duplicate, retransmit the last message - */ - if (msg->sc_ca->ca_seq == dcsp->sd_ca_seq) { - if (dcsp->sd_ca_rexmt_msg) { - rc = scsp_send_msg(dcsp, dcsp->sd_ca_rexmt_msg); - if (rc == 0) { - HARP_TIMER(&dcsp->sd_ca_rexmt_t, - dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - } - } - return(rc); - } - - /* - * Free the last CA message - */ - if (dcsp->sd_ca_rexmt_msg) { - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - dcsp->sd_ca_rexmt_msg = (Scsp_msg *)0; - } - - /* - * Process the CA message - */ - scsp_process_ca(dcsp, msg->sc_ca); - - /* - * Increment the CA sequence number - */ - dcsp->sd_ca_seq++; - - /* - * Answer the CA message - */ - rc = scsp_send_ca(dcsp); - if (rc) - return(rc); - - /* - * If we're done sending CSAS records and the other side is, - * too, we're done with Summarize state - */ - if (!dcsp->sd_ca_csas && !msg->sc_ca->ca_o) { - /* - * If the CRL is empty, we go directly to Aligned state; - * otherwise, we go to Update Cache and send a CSUS - */ - if (!dcsp->sd_crl) { - /* - * Go to Aligned state - */ - dcsp->sd_ca_state = SCSP_CAFSM_ALIGNED; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_ALIGN, - (Scsp_msg *)0, - (Scsp_if_msg *)0); - } else { - /* - * Go to Cache Update state - */ - dcsp->sd_ca_state = SCSP_CAFSM_UPDATE; - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - HARP_TIMER(&dcsp->sd_ca_rexmt_t, - dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - (void)scsp_cfsm(dcsp, SCSP_CIFSM_CA_UPD, - (Scsp_msg *)0, - (Scsp_if_msg *)0); - rc = scsp_send_csus(dcsp); - } - } - - return(rc); -} - - -/* - * CA finite state machine action 6 - * Retransmit timer expired -- retransmit last CA message - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_06(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - - /* - * Resend the CA message - */ - rc = scsp_send_msg(dcsp, dcsp->sd_ca_rexmt_msg); - - /* - * Restart the retransmit timer - */ - if (rc == 0) { - HARP_TIMER(&dcsp->sd_ca_rexmt_t, dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - } - - return(rc); -} - - -/* - * CA finite state machine action 7 - * CSU Solicit received -- send it to the client interface FSM - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_07(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - Scsp_msg *msg = (Scsp_msg *)p; - - /* - * Cancel the CA retransmit timer and free any CA message - * saved for retransmission - */ - if (dcsp->sd_ca_rexmt_msg) { - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - dcsp->sd_ca_rexmt_msg = (Scsp_msg *)0; - } - - /* - * Pass the CSUS to the client interface FSM - */ - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CSU_SOL, msg, - (Scsp_if_msg *)0); - - return(rc); -} - - -/* - * CA finite state machine action 8 - * CSU Request received -- pass it to the client interface FSM - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_08(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - Scsp_msg *msg = (Scsp_msg *)p; - Scsp_csa *csap; - - /* - * Check whether this messages answers a CSUS - */ - scsp_csus_ack(dcsp, msg); - - /* - * If all CSAs requestd in CSUS messages have been - * received, the cache is aligned, so go to Aligned State - */ - if (!dcsp->sd_csus_rexmt_msg && !dcsp->sd_crl && - dcsp->sd_ca_state != SCSP_CAFSM_ALIGNED) { - dcsp->sd_ca_state = SCSP_CAFSM_ALIGNED; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CA_ALIGN, - (Scsp_msg *)0, (Scsp_if_msg *)0); - } - - /* - * Pass the CSU Req to the client interface FSM - */ - rc = scsp_cfsm(dcsp, SCSP_CIFSM_CSU_REQ, msg, - (Scsp_if_msg *)0); - - /* - * Move the CSA chain from the message to the list of - * requests that need acknowledgements - */ - for (csap = msg->sc_csu_msg->csu_csa_rec; csap; - csap = csap->next) { - LINK2TAIL(csap, Scsp_csa, dcsp->sd_csu_ack_pend, next); - } - msg->sc_csu_msg->csu_csa_rec = (Scsp_csa *)0; - - return(rc); -} - - -/* - * CA finite state machine action 9 - * CA Retransmit timer expired in Update Cache or Aligned state--free - * the saved CA message - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_09(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - /* - * Free any CA message saved for retransmission - */ - if (dcsp->sd_ca_rexmt_msg) { - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - dcsp->sd_ca_rexmt_msg = (Scsp_msg *)0; - } - - return(0); -} - - -/* - * CA finite state machine action 10 - * CSU Reply received -- Process the message - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_10(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc = 0; - Scsp_msg *msg = (Scsp_msg *)p; - Scsp_csu_rexmt *rxp, *next_rxp; - Scsp_csa *csap, *next_csap, *mcp; - - /* - * Dequeue acknowledged CSAs. For each CSAS in the received - * message, find the corresponding CSA on the CSU Request - * retransmit queue. Remove the CSA from the queue; if this - * results in the retransmit queue entry being empty, delete - * the entry. If the DCS has a newer CSA, send a CSUS to - * request it. - * - * Caution--potentially confusing lack of indentation ahead. - */ - for (mcp = msg->sc_csu_msg->csu_csa_rec; mcp; - mcp = mcp->next) { - for (rxp = dcsp->sd_csu_rexmt; rxp; rxp = next_rxp) { - next_rxp = rxp->sr_next; - for (csap = rxp->sr_csa; csap; csap = next_csap) { - next_csap = csap->next; - if (scsp_cmp_key(&csap->key, &mcp->key) || - scsp_cmp_id(&csap->oid, &mcp->oid)) - continue; - /* - * Found a CSA whose key and ID are equal to - * those in the CSU Reply - */ - if (csap->seq == mcp->seq) { - /* - * The queued seq no is equal to the - * received seq no--the CSA is acknowledged - */ - UNLINK(csap, Scsp_csa, rxp->sr_csa, next); - SCSP_FREE_CSA(csap); - } else if (csap->seq < mcp->seq) { - /* - * Queued seq no is less than received. - * We must dequeue the CSA and send a - * CSUS to request the more-up-to-date - * cache entry. - */ - UNLINK(mcp, Scsp_csa, - msg->sc_csu_msg->csu_csa_rec, - next); - LINK2TAIL(mcp, Scsp_csa, dcsp->sd_crl, next); - UNLINK(csap, Scsp_csa, rxp->sr_csa, next); - SCSP_FREE_CSA(csap); - if (!dcsp->sd_csus_rexmt_msg) { - rc = scsp_send_csus(dcsp); - if (rc) { - return(rc); - } - } - } - /* - * Queued seq no is greater than - * received. Ignore the received CSAS. - */ - - /* - * If the retransmission block is empty, stop the - * timer and free it - */ - if (!rxp->sr_csa) { - HARP_CANCEL(&rxp->sr_t); - UNLINK(rxp, Scsp_csu_rexmt, - dcsp->sd_csu_rexmt, sr_next); - free(rxp); - } - - break; - } /* for (csap = ... */ - } /* for (rxp = ... */ - } /* for (mcp = ... */ - - return(rc); -} - - -/* - * CA finite state machine action 11 - * Updated cache entry -- update the summary cache and send a - * CSU Request - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to CSA describing new cache entry - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_11(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc, state; - Scsp_csa *csap = (Scsp_csa *)p; - Scsp_cse *csep; - - /* - * Get the state of the CSA - */ - switch(dcsp->sd_server->ss_pid) { - case SCSP_PROTO_ATMARP: - state = csap->atmarp_data->sa_state; - break; - default: - SCSP_FREE_CSA(csap); - return(EINVAL); - } - - if (state < SCSP_ASTATE_NEW || state > SCSP_ASTATE_DEL) { - SCSP_FREE_CSA(csap); - return(EINVAL); - } - - /* - * Look up the cache summary entry for the CSA - */ - SCSP_LOOKUP(dcsp->sd_server, &csap->key, csep); - - /* - * Process ATMARP entries - */ - if (dcsp->sd_server->ss_pid == SCSP_PROTO_ATMARP) { - switch(state) { - case SCSP_ASTATE_NEW: - case SCSP_ASTATE_UPD: - /* - * Add the entry if we don't have it already - */ - if (!csep) { - csep = calloc(1, sizeof(Scsp_cse)); - if (csep == NULL) - scsp_mem_err("scsp_ca_act_11: sizeof(Scsp_cse)"); - - csep->sc_key = csap->key; - SCSP_ADD(dcsp->sd_server, csep); - } - - /* - * Update the cache summary entry - */ - csep->sc_seq = csap->seq; - csep->sc_oid = csap->oid; - break; - case SCSP_ASTATE_DEL: - /* - * Delete any entry, but don't send the - * delete to the DCS - */ - if (csep) { - SCSP_DELETE(dcsp->sd_server, csep); - free(csep); - } - - SCSP_FREE_CSA(csap); - return(0); - } - } - - /* - * Send the CSA in a CSU Request - */ - csap->trans_ct = 0; - rc = scsp_send_csu_req(dcsp, csap); - - return(rc); -} - - -/* - * CA finite state machine action 12 - * CSUS retransmit timer expired--send a CSUS with any pending CSA - * records - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_12(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - - rc = scsp_send_csus(dcsp); - - return(rc); -} - - -/* - * CA finite state machine action 13 - * CSU retransmit timer fired in Update or Aligned state-- - * retransmit CSU Req - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to retransmission block whose timer fired - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_13(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc = 0; - Scsp_csu_rexmt *rxp = (Scsp_csu_rexmt *)p; - Scsp_csa *csap, *csap1, *next_csap; - - /* - * Unlink and free the retransmit request block - */ - csap = rxp->sr_csa; - UNLINK(rxp, Scsp_csu_rexmt, dcsp->sd_csu_rexmt, sr_next); - free(rxp); - - /* - * Increment the transmission count for the CSAs in the request - */ - for (csap1 = csap; csap1; csap1 = next_csap) { - next_csap = csap1->next; - csap1->trans_ct++; - if (csap1->trans_ct >= dcsp->sd_csu_rexmt_max) { - /* - * We've already sent this as many times as - * the limit allows. Drop this CSA. - */ - UNLINK(csap1, Scsp_csa, csap, next); - SCSP_FREE_CSA(csap1); - } - } - - /* - * Send another CSU Request with the CSA list, if it isn't - * empty now - */ - if (csap) { - rc = scsp_send_csu_req(dcsp, csap); - } - - return(rc); -} - - -/* - * CA finite state machine action 14 - * Updated cache entry in Master/Slave Negotiation, Master, or - * Slave state--add entry to cache and CSA list - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to new cache summary entry - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_14(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - Scsp_csa *csap = (Scsp_csa *)p; - Scsp_cse *csep, *csep1; - - /* - * Check to see whether we already have this - */ - SCSP_LOOKUP(dcsp->sd_server, &csap->key, csep); - - /* - * If we don't already have it and it's not being deleted, - * build a new cache summary entry - */ - if (!csep && !csap->null) { - /* - * Get memory for a new entry - */ - csep = calloc(1, sizeof(Scsp_cse)); - if (csep == NULL) - scsp_mem_err("scsp_ca_act_14: sizeof(Scsp_cse)"); - - /* - * Fill out the new cache entry - */ - csep->sc_seq = csap->seq; - csep->sc_key = csap->key; - csep->sc_oid = csap->oid; - - /* - * Duplicate the new cache entry - */ - csep1 = scsp_dup_cse(csep); - - /* - * Add entry to the summary cache and the CSAS list - */ - SCSP_ADD(dcsp->sd_server, csep); - LINK2TAIL(csep1, Scsp_cse, dcsp->sd_ca_csas, sc_next); - } else { - /* - * We already have the entry. Find it on the CSAS - * list. - */ - for (csep1 = dcsp->sd_ca_csas; csep1; - csep1 = csep1->sc_next) { - if (scsp_cmp_key(&csep->sc_key, - &csep1->sc_key) == 0) - break; - } - - /* - * Update or delete the entry - */ - if (csap->null) { - /* - * The null flag is set--delete the entry - */ - SCSP_DELETE(dcsp->sd_server, csep); - free(csep); - if (csep1) { - UNLINK(csep1, Scsp_cse, - dcsp->sd_ca_csas, - sc_next); - free(csep1); - } - } else { - /* - * Update the entry - */ - csep->sc_seq = csap->seq; - csep->sc_oid = csap->oid; - if (!csep1) { - csep1 = scsp_dup_cse(csep); - LINK2TAIL(csep1, Scsp_cse, - dcsp->sd_ca_csas, sc_next); - } else { - csep1->sc_seq = csap->seq; - csep1->sc_oid = csap->oid; - } - } - } - - return(0); -} - - -/* - * CA finite state machine action 15 - * CA message received in Update Cache state--if we have a saved CA - * message, retransmit it; otherwise, go to Master/Slave Negotiation - * state - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_15(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int rc; - Scsp_msg *msg = (Scsp_msg *)p; - - /* - * If we don't have a saved CA message, or the sequence no. in - * the received message isn't right, fall back to Master/Slave - * Negotiation state - */ - if (!dcsp->sd_ca_rexmt_msg || - msg->sc_ca->ca_seq != dcsp->sd_ca_seq) { - dcsp->sd_ca_state = SCSP_CAFSM_NEG; - scsp_dcs_cleanup(dcsp); - rc = scsp_ca_act_01(dcsp, (Scsp_msg *)0); - } else { - /* - * Retransmit the saved CA message and reset the - * CA timer - */ - rc = scsp_send_msg(dcsp, dcsp->sd_ca_rexmt_msg); - if (rc == 0) { - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - HARP_TIMER(&dcsp->sd_ca_rexmt_t, - dcsp->sd_ca_rexmt_int, - scsp_ca_retran_timeout); - } - } - - return(rc); -} - - -/* - * CA finite state machine action 16 - * Update Response received from client in Update Cache or Aligned - * state. Move the acknowledged CSA to the acknowledged queue. If - * the list of CSAs pending acknowledgement is empty, send a CSU - * Reply. - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to message from client - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_16(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - int found, rc = 0; - Scsp_if_msg *cmsg = (Scsp_if_msg *)p; - Scsp_csa *csap; - - /* - * Find the acknowledged CSA - */ - for (csap = dcsp->sd_csu_ack_pend, found = 0; csap && !found; - csap = csap->next) { - switch (dcsp->sd_server->ss_pid) { - case SCSP_PROTO_ATMARP: - found = ((scsp_cmp_key(&csap->key, - &cmsg->si_atmarp.sa_key) == 0) && - (scsp_cmp_id(&csap->oid, - &cmsg->si_atmarp.sa_oid) == 0)); - break; - default: - /* - * Protocol not implemented - */ - return(EPROTONOSUPPORT); - } - if (found) - break; - } - - if (!found) { - if (scsp_trace_mode & SCSP_TRACE_CAFSM) { - scsp_trace("scsp_ca_act_16: can't find CSA entry for Update Response\n"); - } - return(0); - } - - if (cmsg->si_rc == SCSP_RSP_OK) { - /* - * The server accepted the cache entry - */ - - /* - * Update SCSP's cache - */ - scsp_update_cache(dcsp, csap); - - /* - * Send this CSA to any other DCSs in the server group - */ - rc = scsp_propagate_csa(dcsp, csap); - } - - /* - * Move the CSA from the ACK pending queue to the - * acknowledged queue - */ - UNLINK(csap, Scsp_csa, dcsp->sd_csu_ack_pend, next); - LINK2TAIL(csap, Scsp_csa, dcsp->sd_csu_ack, next); - if (!dcsp->sd_csu_ack_pend) { - /* - * ACK pending list is empty--send a CSU Reply - */ - csap = dcsp->sd_csu_ack; - dcsp->sd_csu_ack = (Scsp_csa *)0; - rc = scsp_send_csu_reply(dcsp, csap); - } - - return(rc); -} - - -/* - * CA finite state machine action 17 - * Ignore an event. - * - * Arguments: - * dcsp pointer to DCS control block - * p ignored - * - * Returns: - * always returns 0 - * - */ -int -scsp_ca_act_17(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - return(0); -} - - -/* - * CA finite state machine action 18 - * Updated cache entry in Down state--add entry to summary cache - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to new cache summary entry - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_18(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - Scsp_csa *csap = (Scsp_csa *)p; - - /* - * Update the cache as appropriate - */ - scsp_update_cache(dcsp, csap); - - return(0); -} - - -/* - * CA finite state machine action 19 - * Update Response received from client in Master/Slave Negotiation - * state. Update the cache as appropriate. - * - * Arguments: - * dcsp pointer to DCS control block - * p pointer to message from client - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_ca_act_19(dcsp, p) - Scsp_dcs *dcsp; - void *p; -{ - Scsp_if_msg *cmsg = (Scsp_if_msg *)p; - Scsp_csa *csap; - - /* - * Ignore the message if the client rejected the update - */ - if (cmsg->si_rc != SCSP_RSP_OK) { - return(0); - } - - /* - * Create a CSAS from the client's update - */ - csap = calloc(1, sizeof(Scsp_csa)); - if (csap == NULL) - scsp_mem_err("scsp_ca_act_19: sizeof(Scsp_csa)"); - csap->hops = 1; - switch (dcsp->sd_server->ss_pid) { - case SCSP_PROTO_ATMARP: - csap->null = cmsg->si_atmarp.sa_state == - SCSP_ASTATE_DEL; - csap->seq = cmsg->si_atmarp.sa_seq; - csap->key = cmsg->si_atmarp.sa_key; - csap->oid = cmsg->si_atmarp.sa_oid; - break; - default: - return(EINVAL); - } - - /* - * Update SCSP's cache - */ - scsp_update_cache(dcsp, csap); - - return(0); -} Property changes on: head/usr.sbin/atm/scspd/scsp_cafsm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_config_lex.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_config_lex.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_config_lex.c (nonexistent) @@ -1,530 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Parse a configuration file into tokens - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" -#include "scsp_config_parse.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Global variables - */ -int parse_line = 1; - -/* - * Local definitions - */ -#define TOK_MAX_LEN 128 - -/* - * Character classes - */ -#define CHAR_INVALID 0 /* Not allowed */ -#define CHAR_ALPHA 1 /* G-W, Y, Z */ -#define CHAR_HEX_DIGIT 2 /* A-F */ -#define CHAR_X 3 /* X */ -#define CHAR_0 4 /* '0' */ -#define CHAR_DIGIT 5 /* 1-9 */ -#define CHAR_SPACE 6 /* space, tab */ -#define CHAR_DECIMAL 7 /* period */ -#define CHAR_SLASH 8 /* slash */ -#define CHAR_ASTERISK 9 /* asterisk */ -#define CHAR_HASH 10 /* pound sign */ -#define CHAR_SPECIAL 11 /* semicolon, braces */ -#define CHAR_MISC 12 /* chars allowd in file names */ -#define CHAR_EOL 13 /* new line */ -#define CHAR_EOF 14 /* EOF */ -#define CHAR_CNT CHAR_EOF + 1 - -/* - * Character class table (initialized by init_class_tbl()) - */ -static char class_tbl[128]; - -/* - * State table element structure - */ -struct state_entry { - int action; - int next; -}; - -/* - * Scanner states - */ -#define TS_INIT 0 -#define TS_ALPHA 1 -#define TS_INT_1 2 -#define TS_INT 3 -#define TS_HEX 4 -#define TS_SLASH_1 5 -#define TS_COMMENT 6 -#define TS_COMMENT_1 7 -#define TS_FLUSH 8 -#define TS_HEX_1 9 -#define TS_CNT TS_HEX_1 + 1 - -/* - * Token scanner state table - */ -static struct state_entry token_state_tbl[CHAR_CNT][TS_CNT] = { -/* 0 1 2 3 4 5 6 7 8 9 */ -/* bad */{{2,0},{2,0},{2,0},{2,0},{2,0},{2,0},{0,6},{0,6},{0,8},{2,0}}, -/* g-z */{{1,1},{1,1},{1,1},{1,1},{2,0},{1,1},{0,6},{0,6},{0,8},{2,0}}, -/* a-f */{{1,1},{1,1},{1,1},{1,1},{1,9},{1,1},{0,6},{0,6},{0,8},{1,4}}, -/* x */{{1,1},{1,1},{1,4},{1,4},{2,0},{1,1},{0,6},{0,6},{0,8},{2,0}}, -/* 0 */{{1,2},{1,1},{1,3},{1,3},{1,9},{1,1},{0,6},{0,6},{0,8},{1,4}}, -/* 1-9 */{{1,3},{1,1},{1,3},{1,3},{1,9},{1,1},{0,6},{0,6},{0,8},{1,4}}, -/* sp */{{0,0},{6,0},{8,0},{8,0},{7,0},{6,0},{0,6},{0,6},{0,8},{2,0}}, -/* . */{{2,0},{1,1},{1,1},{1,1},{1,4},{1,1},{0,6},{0,6},{0,8},{2,0}}, -/* / */{{1,5},{1,1},{1,1},{1,1},{7,0},{4,8},{0,6},{0,0},{0,8},{2,0}}, -/* * */{{2,0},{6,0},{8,0},{8,0},{7,0},{4,6},{0,7},{0,7},{0,8},{2,0}}, -/* # */{{0,8},{6,0},{8,0},{8,0},{7,0},{6,0},{0,6},{0,6},{0,8},{2,0}}, -/* ;{} */{{3,0},{6,0},{8,0},{8,0},{7,0},{6,0},{0,6},{0,6},{0,8},{2,0}}, -/* Msc */{{2,0},{1,1},{1,1},{1,1},{2,0},{1,1},{0,6},{0,6},{0,8},{2,0}}, -/* EOL */{{0,0},{6,0},{8,0},{8,0},{7,0},{6,0},{0,6},{0,6},{0,0},{2,0}}, -/* EOF */{{9,0},{6,0},{8,0},{8,0},{7,0},{6,0},{2,0},{2,0},{9,0},{2,0}}, -}; - - -/* - * Reserved words - */ -static struct { - char *word; - int token; -} rsvd_word_tbl[] = { - { "ATMaddr", TOK_DCS_ADDR }, - { "ATMARP", TOK_ATMARP }, - { "CAReXmitInt", TOK_DCS_CA_REXMIT_INT }, - { "CSUSReXmitInt", TOK_DCS_CSUS_REXMIT_INT }, - { "CSUReXmitInt", TOK_DCS_CSU_REXMIT_INT }, - { "CSUReXmitMax", TOK_DCS_CSU_REXMIT_MAX }, - { "DCS", TOK_DCS }, - { "DHCP", TOK_DHCP }, - { "familyID", TOK_FAMILY }, - { "file", TOK_LFN }, - { "hops", TOK_DCS_HOP_CNT }, - { "HelloDead", TOK_DCS_HELLO_DF }, - { "HelloInt", TOK_DCS_HELLO_INT }, - { "ID", TOK_DCS_ID }, - { "LNNI", TOK_LNNI }, - { "log", TOK_LOG }, - { "MARS", TOK_MARS }, - { "netif", TOK_NETIF }, - { "NHRP", TOK_NHRP }, - { "protocol", TOK_PROTOCOL }, - { "server", TOK_SERVER }, - { "ServerGroupID", TOK_SRVGRP }, - { "syslog", TOK_SYSLOG }, - { (char *)0, 0 }, -}; - - -/* - * Copy a character string - * - * Make a copy of a character string, using strdup. If strdup fails, - * meaning we're out of memory, then print an error message and exit. - * - * Arguments: - * s string to be copied - * - * Returns: - * char * pointer to area provided by strdup - * - */ -static char * -copy_buffer(s) - char *s; -{ - char *t; - - t = strdup(s); - - if (!t) { - fprintf(stderr, "%s: strdup failed\n", prog); - exit(1); - } - - return(t); -} - - -/* - * Push a character back onto the input stream. - * - * Arguments: - * c character to be pushed - * - * Returns: - * none - * - */ -static void -push_char(c) - char c; -{ - if (c == '\n') - parse_line--; - - ungetc(c, cfg_file); -} - - -/* - * Initialize the character class table. - * - * Set each entry in the character class table to the class - * corresponding to the character. - * - * Arguments: - * tbl pointer to table to be initialized - * - * Returns: - * None - */ -static void -init_class_tbl(tbl) - char *tbl; -{ - int i; - char c; - - /* - * Set up the table for all ASCII characters - */ - for (i=0; isascii((char)i); i++) { - /* - * Clear entry - */ - tbl[i] = CHAR_INVALID; - - /* - * Set entries depending on character type - */ - c = (char)i; - if (c == 'a' || c == 'b' || c == 'c' || - c == 'd' || c == 'e' || c == 'f' || - c == 'A' || c == 'B' || c == 'C' || - c == 'D' || c == 'E' || c == 'F') - tbl[i] = CHAR_HEX_DIGIT; - else if (c == 'x' || c == 'X') - tbl[i] = CHAR_X; - else if (isalpha(c)) - tbl[i] = CHAR_ALPHA; - else if (c == '0') - tbl[i] = CHAR_0; - else if (isdigit(c)) - tbl[i] = CHAR_DIGIT; - else if (c == '\n') - tbl[i] = CHAR_EOL; - else if (c == ' ' || c == '\t') - tbl[i] = CHAR_SPACE; - else if (c == '#') - tbl[i] = CHAR_HASH; - else if (c == '*') - tbl[i] = CHAR_ASTERISK; - else if (c == '.') - tbl[i] = CHAR_DECIMAL; - else if (c == '/') - tbl[i] = CHAR_SLASH; - else if (c == ';' || c == '{' || c == '}') - tbl[i] = CHAR_SPECIAL; - else if (c == '-' || c == '_' || c == '&' || c == '@' || - c == '~') - tbl[i] = CHAR_MISC; - } -} - - -/* - * Get the class of a character. - * - * Arguments: - * c character being scanned - * - * Returns: - * int character class - */ -static int -char_class(c) - char c; -{ - int class = CHAR_INVALID; - - if (c == EOF) { - class = CHAR_EOF; - } else if (c < 0 || !isascii(c)) { - class = CHAR_INVALID; - } else { - class = class_tbl[(int)c]; - } - - return(class); -} - - -/* - * Print an error message when the scanner finds an error - * - * Arguments: - * c character on which the error was recognized - * state scanner state at error - * - * Returns: - * None - */ -static void -scan_error(c, state) - char c; - int state; -{ - /* - * Check for invalid character - */ - if (char_class(c) == CHAR_INVALID) { - parse_error("Invalid character 0x%x encountered", - c); - return; - } - - /* - * Check for unexpected EOF - */ - if (char_class(c) == CHAR_EOF) { - parse_error("Unexpected end of file"); - return; - } - - /* - * Error depends on state - */ - switch(state) { - case TS_INIT: - parse_error("Syntax error at '%c'", c); - break; - case TS_ALPHA: - case TS_INT_1: - case TS_INT: - case TS_SLASH_1: - case TS_COMMENT: - case TS_COMMENT_1: - case TS_FLUSH: - parse_error("Syntax error"); - break; - case TS_HEX: - case TS_HEX_1: - parse_error("Syntax error in hex string"); - break; - } -} - - -/* - * Assemble a token - * - * Read a character at a time from the input file, assembling the - * characters into tokens as specified by the token scanner state - * table. Return the completed token. - * - * Arguments: - * None - * - * Returns: - * token the type of the token found - */ -int -yylex() -{ - int i, state; - char c, token_buffer[TOK_MAX_LEN]; - - /* - * Initialize - */ - if (class_tbl['A'] != CHAR_HEX_DIGIT) - init_class_tbl(class_tbl); - state = TS_INIT; - bzero(token_buffer, sizeof(token_buffer)); - bzero(&yylval, sizeof(yylval)); - - /* - * Handle a character at a time until a token is built - */ - while(1) { - /* - * Read a character from the input file. - */ - c = (char)getc(cfg_file); - if (c == '\n') { - parse_line++; - } - -#ifdef NOTDEF - printf("token_state: state=%d, char=%c, class=%d, action=%d, next=%d\n", - state, - c, - char_class(c), - token_state_tbl[char_class][state].action, - token_state_tbl[char_class][state].next); -#endif - - /* - * Perform an action based on the state table - */ - switch(token_state_tbl[char_class(c)][state].action) { - case 0: - /* - * Ignore the character - */ - break; - case 1: - /* - * Add character to buffer - */ - if (strlen(token_buffer) < TOK_MAX_LEN) { - token_buffer[strlen(token_buffer)] = c; - } - break; - case 2: - /* - * Error--print a message and start over - */ - scan_error(c, state); - break; - case 3: - /* - * Return special character - */ - return(c); - break; - case 4: - /* - * Clear the token buffer - */ - bzero(token_buffer, sizeof(token_buffer)); - break; - case 5: - /* - * Not used - */ - break; - case 6: - /* - * Return character token - */ - push_char(c); - - /* - * Check for reserved words - */ - for (i=0; rsvd_word_tbl[i].word; i++) { - if (strcasecmp(token_buffer, - rsvd_word_tbl[i].word) == 0) - break; - } - if (rsvd_word_tbl[i].word) { - return(rsvd_word_tbl[i].token); - } - - /* - * Word isn't reserved, return alpha string - */ - yylval.tv_alpha = copy_buffer(token_buffer); - return(TOK_NAME); - break; - case 7: - /* - * Return hex string (ATM address) - */ - push_char(c); - yylval.tv_hex = copy_buffer(token_buffer); - return(TOK_HEX); - break; - case 8: - /* - * Return integer - */ - push_char(c); - yylval.tv_int = atoi(token_buffer); - return(TOK_INTEGER); - break; - case 9: - /* - * Return EOF - */ - return(0); - break; - default: - fprintf(stderr, "Invalid action indicator, state=%d, char=0x%02x\n", - state, c); - break; - } - - /* - * Set the next state and bump to the next character - */ - state = token_state_tbl[char_class(c)][state].next; - } -} Property changes on: head/usr.sbin/atm/scspd/scsp_config_lex.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_if.h =================================================================== --- head/usr.sbin/atm/scspd/scsp_if.h (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_if.h (nonexistent) @@ -1,194 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Interface to server clients of SCSP - * - */ - -#ifndef _SCSP_SCSP_IF_H -#define _SCSP_SCSP_IF_H - - -/* - * SCSP configuration message - */ -struct scsp_cfg_msg { - char atmarp_netif[IFNAMSIZ]; -}; -typedef struct scsp_cfg_msg Scsp_cfg_msg; - - -/* - * SCSP cache summary - */ -struct scsp_sum_msg { - u_short ss_hops; /* Hop count */ - u_char ss_null; /* Null flag */ - long ss_seq; /* CSA seq. no. */ - Scsp_ckey ss_key; /* Cache key */ - Scsp_id ss_oid; /* Originator ID */ -}; -typedef struct scsp_sum_msg Scsp_sum_msg; - - -/* - * SCSP constants for ATMARP - */ -#define SCSP_ATMARP_PROTO 1 -#define SCSP_ATMARP_SIDL 4 -#define SCSP_ATMARP_RIDL 4 -#define SCSP_ATMARP_CKL 4 -#define SCSP_ATMARP_OIDL 4 - - -/* - * SCSP ATMARP message - */ -struct scsp_atmarp_msg { - u_char sa_state; /* Cache entry state (below) */ - struct in_addr sa_cpa; /* Cached protocol address */ - Atm_addr sa_cha; /* Cached ATM address */ - Atm_addr sa_csa; /* Cached ATM subaddress */ - Scsp_ckey sa_key; /* Cache key for entry */ - Scsp_id sa_oid; /* Originator ID */ - long sa_seq; /* Sequence no. */ -}; -typedef struct scsp_atmarp_msg Scsp_atmarp_msg; - -#define SCSP_ASTATE_NEW 0 /* ATMARP new server registration */ -#define SCSP_ASTATE_UPD 1 /* ATMARP server refreshed */ -#define SCSP_ASTATE_DEL 2 /* ATMARP server data deleted */ - - -/* - * SCSP constants for NHRP - */ -#define SCSP_NHRP_PROTO 2 -#define SCSP_NHRP_SIDL 4 -#define SCSP_NHRP_RIDL 4 -#define SCSP_NHRP_CKL 4 -#define SCSP_NHRP_OIDL 4 - - -/* - * SCSP NHRP message - */ -struct scsp_nhrp_msg { - u_short sn_af; /* Address family */ - u_short sn_proto; /* NHRP protocol type */ - u_char sn_snap[5]; /* SNAP */ - u_char sn_ver; /* NHRP version number */ - u_short sn_flags; /* Flags */ - u_long sn_rid; /* Request ID */ - u_char sn_state; /* State */ - u_char sn_prel; /* Prefix length */ - u_short sn_mtu; /* Maximum transmission unit */ - u_short sn_hold; /* Holding time */ - Atm_addr sn_addr; /* Server network address */ - Atm_addr sn_saddr; /* Server network subaddress */ - struct in_addr sn_paddr; /* Server protocol address */ - Scsp_ckey sn_key; /* Cache key for entry */ - Scsp_id sn_oid; /* Originator ID */ -}; -typedef struct scsp_nhrp_msg Scsp_nhrp_msg; - -#define SCSP_NSTATE_NEW 0 /* New NHRP server */ -#define SCSP_NSTATE_UPD 1 /* NHRP server re-registered */ -#define SCSP_NSTATE_DEL 2 /* NHRP server data purged */ -#define SCSP_NSTATE_NSD 3 /* NHRP no such data in server */ - - -/* - * SCSP/server message header - */ -struct scsp_if_msg_hdr { - u_char sh_type; /* Message type */ - u_char sh_rc; /* Response code */ - u_short sh_proto; /* SCSP protocol ID */ - int sh_len; /* Length of message */ - u_long sh_tok; /* Token from SCSP daemon */ -}; -typedef struct scsp_if_msg_hdr Scsp_if_msg_hdr; - - -/* - * SCSP-server message - */ -struct scsp_if_msg { - Scsp_if_msg_hdr si_hdr; /* Header fields */ - union { - Scsp_cfg_msg siu_cfg; /* Config data */ - Scsp_sum_msg siu_sum; /* Cache summary */ - Scsp_atmarp_msg siu_atmarp; /* ATMARP update */ - Scsp_nhrp_msg siu_nhrp; /* NHRP update */ - } si_u; -}; -typedef struct scsp_if_msg Scsp_if_msg; - -#define si_type si_hdr.sh_type -#define si_rc si_hdr.sh_rc -#define si_proto si_hdr.sh_proto -#define si_len si_hdr.sh_len -#define si_tok si_hdr.sh_tok - -#define si_cfg si_u.siu_cfg -#define si_sum si_u.siu_sum -#define si_atmarp si_u.siu_atmarp -#define si_nhrp si_u.siu_nhrp - - -/* - * Message types - */ -#define SCSP_NOP_REQ 1 -#define SCSP_CFG_REQ 2 -#define SCSP_CFG_RSP 3 -#define SCSP_CACHE_IND 4 -#define SCSP_CACHE_RSP 5 -#define SCSP_SOLICIT_IND 6 -#define SCSP_SOLICIT_RSP 7 -#define SCSP_UPDATE_IND 8 -#define SCSP_UPDATE_REQ 9 -#define SCSP_UPDATE_RSP 10 - - -/* - * Response codes - */ -#define SCSP_RSP_OK 0 -#define SCSP_RSP_ERR 1 -#define SCSP_RSP_REJ 2 -#define SCSP_RSP_NOT_FOUND 3 - - -#endif /* _SCSP_SCSP_IF_H */ Property changes on: head/usr.sbin/atm/scspd/scsp_if.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_subr.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_subr.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_subr.c (nonexistent) @@ -1,1113 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP subroutines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Hash an SCSP cache key - * - * Arguments: - * ckp pointer to an SCSP cache key structure - * - * Returns: - * hashed value - * - */ -int -scsp_hash(ckp) - Scsp_ckey *ckp; -{ - int i, j, h; - - /* - * Turn cache key into a positive integer - */ - h = 0; - for (i = ckp->key_len-1, j = 0; - i > 0 && j < sizeof(int); - i--, j++) - h = (h << 8) + ckp->key[i]; - h = abs(h); - - /* - * Return the hashed value - */ - return(h % SCSP_HASHSZ); -} - - -/* - * Compare two SCSP IDs - * - * Arguments: - * id1p pointer to an SCSP ID structure - * id2p pointer to an SCSP ID structure - * - * Returns: - * < 0 id1 is less than id2 - * 0 id1 and id2 are equal - * > 0 id1 is greater than id2 - * - */ -int -scsp_cmp_id(id1p, id2p) - Scsp_id *id1p; - Scsp_id *id2p; -{ - int diff, i; - - /* - * Compare the two IDs, byte for byte - */ - for (i = 0; i < id1p->id_len && i < id2p->id_len; i++) { - diff = id1p->id[i] - id2p->id[i]; - if (diff) { - return(diff); - } - } - - /* - * IDs are equal. If lengths differ, the longer ID is - * greater than the shorter. - */ - return(id1p->id_len - id2p->id_len); -} - - -/* - * Compare two SCSP cache keys - * - * Arguments: - * ck1p pointer to an SCSP cache key structure - * ck2p pointer to an SCSP cache key structure - * - * Returns: - * < 0 ck1 is less than ck2 - * 0 ck1 and ck2 are equal - * > 0 ck1 is greater than ck2 - * - */ -int -scsp_cmp_key(ck1p, ck2p) - Scsp_ckey *ck1p; - Scsp_ckey *ck2p; -{ - int diff, i; - - /* - * Compare the two keys, byte for byte - */ - for (i = 0; i < ck1p->key_len && i < ck2p->key_len; i++) { - diff = ck1p->key[i] - ck2p->key[i]; - if (diff) - return(diff); - } - - /* - * Keys are equal. If lengths differ, the longer key is - * greater than the shorter. - */ - return(ck1p->key_len - ck2p->key_len); -} - - -/* - * Check whether the host system is an ATMARP server for - * the LIS associated with a given interface - * - * Arguments: - * netif pointer to the network interface name - * - * Returns: - * 1 host is a server - * 0 host is not a server - * - */ -int -scsp_is_atmarp_server(netif) - char *netif; -{ - int rc; - size_t buf_len; - struct atminfreq air; - struct air_asrv_rsp *asrv_info; - - /* - * Get interface information from the kernel - */ - strcpy(air.air_int_intf, netif); - air.air_opcode = AIOCS_INF_ASV; - buf_len = do_info_ioctl(&air, sizeof(struct air_asrv_rsp)); - if ((ssize_t)buf_len == -1) - return(0); - - /* - * Check the interface's ATMARP server address - */ - asrv_info = (struct air_asrv_rsp *) air.air_buf_addr; - rc = (asrv_info->asp_addr.address_format == T_ATM_ABSENT) && - (asrv_info->asp_subaddr.address_format == - T_ATM_ABSENT); - free(asrv_info); - return(rc); -} - - -/* - * Make a copy of a cache summary entry - * - * Arguments: - * csep pointer to CSE entry to copy - * - * Returns: - * 0 copy failed - * else pointer to new CSE entry - * - */ -Scsp_cse * -scsp_dup_cse(csep) - Scsp_cse *csep; -{ - Scsp_cse *dupp; - - /* - * Allocate memory for the duplicate - */ - dupp = malloc(sizeof(Scsp_cse)); - if (dupp == NULL) - scsp_mem_err("scsp_dup_cse: sizeof(Scsp_cse)"); - - /* - * Copy data to the duplicate - */ - bcopy(csep, dupp, sizeof(Scsp_cse)); - dupp->sc_next = (Scsp_cse *)0; - return(dupp); -} - - -/* - * Make a copy of a CSA or CSAS record - * - * Arguments: - * csap pointer to CSE entry to copy - * - * Returns: - * 0 copy failed - * else pointer to new CSA or CSAS record - * - */ -Scsp_csa * -scsp_dup_csa(csap) - Scsp_csa *csap; -{ - Scsp_csa *dupp; - Scsp_atmarp_csa *adp; - - /* - * Allocate memory for the duplicate - */ - dupp = malloc(sizeof(Scsp_csa)); - if (dupp == NULL) - scsp_mem_err("scsp_dup_csa: sizeof(Scsp_csa)"); - - /* - * Copy data to the duplicate - */ - bcopy(csap, dupp, sizeof(Scsp_csa)); - dupp->next = (Scsp_csa *)0; - - /* - * Copy protocol-specific data, if it's present - */ - if (csap->atmarp_data) { - adp = malloc(sizeof(Scsp_atmarp_csa)); - if (adp == NULL) - scsp_mem_err("scsp_dup_csa: sizeof(Scsp_atmarp_csa)"); - bcopy(csap->atmarp_data, adp, sizeof(Scsp_atmarp_csa)); - dupp->atmarp_data = adp; - } - return(dupp); -} - - -/* - * Copy a cache summary entry into a CSAS - * - * Arguments: - * csep pointer to CSE entry to copy - * - * Returns: - * 0 copy failed - * else pointer to CSAS record summarizing the entry - * - */ -Scsp_csa * -scsp_cse2csas(csep) - Scsp_cse *csep; -{ - Scsp_csa *csap; - - /* - * Allocate memory for the duplicate - */ - csap = calloc(1, sizeof(Scsp_csa)); - if (csap == NULL) - scsp_mem_err("scsp_cse2csas: sizeof(Scsp_csa)"); - - /* - * Copy data to the CSAS entry - */ - csap->seq = csep->sc_seq; - csap->key = csep->sc_key; - csap->oid = csep->sc_oid; - - return(csap); -} - - -/* - * Copy an ATMARP cache entry into a cache summary entry - * - * Arguments: - * aap pointer to ATMARP cache entry to copy - * - * Returns: - * 0 copy failed - * else pointer to CSE record summarizing the entry - * - */ -Scsp_cse * -scsp_atmarp2cse(aap) - Scsp_atmarp_msg *aap; -{ - Scsp_cse *csep; - - /* - * Allocate memory for the duplicate - */ - csep = calloc(1, sizeof(Scsp_cse)); - if (csep == NULL) - scsp_mem_err("scsp_atmarp2cse: sizeof(Scsp_cse)"); - - /* - * Copy data to the CSE entry - */ - csep->sc_seq = aap->sa_seq; - csep->sc_key = aap->sa_key; - csep->sc_oid = aap->sa_oid; - - return(csep); -} - - -/* - * Clean up a DCS block. This routine is called to clear out any - * lingering state information when the CA FSM reverts to an 'earlier' - * state (Down or Master/Slave Negotiation). - * - * Arguments: - * dcsp pointer to a DCS control block for the neighbor - * - * Returns: - * none - * - */ -void -scsp_dcs_cleanup(dcsp) - Scsp_dcs *dcsp; -{ - Scsp_cse *csep, *ncsep; - Scsp_csa *csap, *next_csap; - Scsp_csu_rexmt *rxp, *rx_next; - - /* - * Free any CSAS entries waiting to be sent - */ - for (csep = dcsp->sd_ca_csas; csep; csep = ncsep) { - ncsep = csep->sc_next; - UNLINK(csep, Scsp_cse, dcsp->sd_ca_csas, sc_next); - free(csep); - } - - /* - * Free any entries on the CRL - */ - for (csap = dcsp->sd_crl; csap; csap = next_csap) { - next_csap = csap->next; - UNLINK(csap, Scsp_csa, dcsp->sd_crl, next); - SCSP_FREE_CSA(csap); - } - - /* - * Free any saved CA message and cancel the CA - * retransmission timer - */ - if (dcsp->sd_ca_rexmt_msg) { - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - dcsp->sd_ca_rexmt_msg = (Scsp_msg *)0; - } - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - - /* - * Free any saved CSU Solicit message and cancel the CSUS - * retransmission timer - */ - if (dcsp->sd_csus_rexmt_msg) { - scsp_free_msg(dcsp->sd_csus_rexmt_msg); - dcsp->sd_csus_rexmt_msg = (Scsp_msg *)0; - } - HARP_CANCEL(&dcsp->sd_csus_rexmt_t); - - /* - * Free any entries on the CSU Request retransmission queue - */ - for (rxp = dcsp->sd_csu_rexmt; rxp; rxp = rx_next) { - rx_next = rxp->sr_next; - HARP_CANCEL(&rxp->sr_t); - for (csap = rxp->sr_csa; csap; csap = next_csap) { - next_csap = csap->next; - SCSP_FREE_CSA(csap); - } - UNLINK(rxp, Scsp_csu_rexmt, dcsp->sd_csu_rexmt, - sr_next); - free(rxp); - } -} - - -/* - * Delete an SCSP DCS block and any associated information - * - * Arguments: - * dcsp pointer to a DCS control block to delete - * - * Returns: - * none - * - */ -void -scsp_dcs_delete(dcsp) - Scsp_dcs *dcsp; -{ - Scsp_cse *csep, *next_cse; - Scsp_csu_rexmt *rxp, *next_rxp; - Scsp_csa *csap, *next_csa; - - /* - * Cancel any pending DCS timers - */ - HARP_CANCEL(&dcsp->sd_open_t); - HARP_CANCEL(&dcsp->sd_hello_h_t); - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - HARP_CANCEL(&dcsp->sd_ca_rexmt_t); - HARP_CANCEL(&dcsp->sd_csus_rexmt_t); - - /* - * Unlink the DCS block from the server block - */ - UNLINK(dcsp, Scsp_dcs, dcsp->sd_server->ss_dcs, sd_next); - - /* - * Close the VCC to the DCS, if one is open - */ - if (dcsp->sd_sock != -1) { - (void)close(dcsp->sd_sock); - } - - /* - * Free any saved CA message - */ - if (dcsp->sd_ca_rexmt_msg) { - scsp_free_msg(dcsp->sd_ca_rexmt_msg); - } - - /* - * Free any pending CSAs waiting for cache alignment - */ - for (csep = dcsp->sd_ca_csas; csep; csep = next_cse) { - next_cse = csep->sc_next; - free(csep); - } - - /* - * Free anything on the cache request list - */ - for (csap = dcsp->sd_crl; csap; csap = next_csa) { - next_csa = csap->next; - SCSP_FREE_CSA(csap); - } - - /* - * Free any saved CSUS message - */ - if (dcsp->sd_csus_rexmt_msg) { - scsp_free_msg(dcsp->sd_csus_rexmt_msg); - } - - /* - * Free anything on the CSU Request retransmit queue - */ - for (rxp = dcsp->sd_csu_rexmt; rxp; rxp = next_rxp) { - /* - * Cancel the retransmit timer - */ - HARP_CANCEL(&rxp->sr_t); - - /* - * Free the CSAs to be retransmitted - */ - for (csap = rxp->sr_csa; csap; csap = next_csa) { - next_csa = csap->next; - SCSP_FREE_CSA(csap); - } - - /* - * Free the CSU Req retransmission control block - */ - next_rxp = rxp->sr_next; - free(rxp); - } - - /* - * Free the DCS block - */ - free(dcsp); -} - - -/* - * Shut down a server. This routine is called when a connection to - * a server is lost. It will clear the server's state without deleting - * the server. - * - * Arguments: - * ssp pointer to a server control block - * - * Returns: - * none - * - */ -void -scsp_server_shutdown(ssp) - Scsp_server *ssp; -{ - int i; - Scsp_dcs *dcsp; - Scsp_cse *csep; - - /* - * Trace the shutdown - */ - if (scsp_trace_mode & (SCSP_TRACE_IF_MSG | SCSP_TRACE_CFSM)) { - scsp_trace("Server %s being shut down\n", - ssp->ss_name); - } - - /* - * Terminate up all the DCS connections and clean - * up the control blocks - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = dcsp->sd_next) { - if (dcsp->sd_sock != -1) { - (void)close(dcsp->sd_sock); - dcsp->sd_sock = -1; - } - HARP_CANCEL(&dcsp->sd_open_t); - HARP_CANCEL(&dcsp->sd_hello_h_t); - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - scsp_dcs_cleanup(dcsp); - dcsp->sd_hello_state = SCSP_HFSM_DOWN; - dcsp->sd_ca_state = SCSP_CAFSM_DOWN; - dcsp->sd_client_state = SCSP_CIFSM_NULL; - } - - /* - * Clean up the server control block - */ - if (ssp->ss_sock != -1) { - (void)close(ssp->ss_sock); - ssp->ss_sock = -1; - } - if (ssp->ss_dcs_lsock != -1) { - (void)close(ssp->ss_dcs_lsock); - ssp->ss_dcs_lsock = -1; - } - ssp->ss_state = SCSP_SS_NULL; - - /* - * Free the entries in the server's summary cache - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - while (ssp->ss_cache[i]) { - csep = ssp->ss_cache[i]; - UNLINK(csep, Scsp_cse, ssp->ss_cache[i], - sc_next); - free(csep); - } - } -} - - -/* - * Delete an SCSP server block and any associated information - * - * Arguments: - * ssp pointer to a server control block to delete - * - * Returns: - * none - * - */ -void -scsp_server_delete(ssp) - Scsp_server *ssp; -{ - int i; - Scsp_dcs *dcsp, *next_dcs; - Scsp_cse *csep, *next_cse; - - /* - * Unlink the server block from the chain - */ - UNLINK(ssp, Scsp_server, scsp_server_head, ss_next); - - /* - * Free the DCS blocks associated with the server - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = next_dcs) { - next_dcs = dcsp->sd_next; - scsp_dcs_delete(dcsp); - } - - /* - * Free the entries in the server's summary cache - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - for (csep = ssp->ss_cache[i]; csep; csep = next_cse) { - next_cse = csep->sc_next; - free(csep); - } - } - - /* - * Free the server block - */ - free(ssp->ss_name); - free(ssp); -} - - -/* - * Get informtion about a server from the kernel - * - * Arguments: - * ssp pointer to the server block - * - * Returns: - * 0 server info is OK - * errno server is not ready - * - */ -int -scsp_get_server_info(ssp) - Scsp_server *ssp; -{ - int i, mtu, rc, sel; - size_t len; - struct atminfreq air; - struct air_netif_rsp *netif_rsp = (struct air_netif_rsp *)0; - struct air_int_rsp *intf_rsp = (struct air_int_rsp *)0; - struct air_cfg_rsp *cfg_rsp = (struct air_cfg_rsp *)0; - struct sockaddr_in *ip_addr; - Atm_addr_nsap *anp; - - /* - * Make sure we're the server for the interface - */ - if (!scsp_is_atmarp_server(ssp->ss_intf)) { - rc = EINVAL; - goto server_info_done; - } - - /* - * Get the IP address and physical interface name - * associated with the network interface - */ - bzero(&air, sizeof(struct atminfreq)); - air.air_opcode = AIOCS_INF_NIF; - strcpy(air.air_netif_intf, ssp->ss_intf); - len = do_info_ioctl(&air, sizeof(struct air_netif_rsp)); - if ((ssize_t)len == -1 || len == 0) { - rc = EIO; - goto server_info_done; - } - netif_rsp = (struct air_netif_rsp *)air.air_buf_addr; - - ip_addr = (struct sockaddr_in *)&netif_rsp->anp_proto_addr; - if (ip_addr->sin_family != AF_INET || - ip_addr->sin_addr.s_addr == 0) { - rc = EADDRNOTAVAIL; - goto server_info_done; - } - - /* - * Get the MTU for the network interface - */ - mtu = get_mtu(ssp->ss_intf); - if (mtu < 0) { - rc = EIO; - goto server_info_done; - } - - /* - * Get the ATM address associated with the - * physical interface - */ - bzero(&air, sizeof(struct atminfreq)); - air.air_opcode = AIOCS_INF_INT; - strcpy(air.air_int_intf, netif_rsp->anp_phy_intf); - len = do_info_ioctl(&air, sizeof(struct air_int_rsp)); - if ((ssize_t)len == -1 || len == 0) { - rc = EIO; - goto server_info_done; - } - intf_rsp = (struct air_int_rsp *)air.air_buf_addr; - - /* - * Make sure we're running UNI signalling - */ - if (intf_rsp->anp_sig_proto != ATM_SIG_UNI30 && - intf_rsp->anp_sig_proto != ATM_SIG_UNI31 && - intf_rsp->anp_sig_proto != ATM_SIG_UNI40) { - rc = EINVAL; - goto server_info_done; - } - - /* - * Check the physical interface's state - */ - if (intf_rsp->anp_sig_state != UNISIG_ACTIVE) { - rc = EHOSTDOWN; - goto server_info_done; - } - - /* - * Make sure the interface's address is valid - */ - if (intf_rsp->anp_addr.address_format != T_ATM_ENDSYS_ADDR && - !(intf_rsp->anp_addr.address_format == - T_ATM_E164_ADDR && - intf_rsp->anp_subaddr.address_format == - T_ATM_ENDSYS_ADDR)) { - rc = EINVAL; - goto server_info_done; - } - - /* - * Find the selector byte value for the interface - */ - for (i=0; iss_intf); i++) { - if (ssp->ss_intf[i] >= '0' && - ssp->ss_intf[i] <= '9') - break; - } - sel = atoi(&ssp->ss_intf[i]); - - /* - * Get configuration information associated with the - * physical interface - */ - bzero(&air, sizeof(struct atminfreq)); - air.air_opcode = AIOCS_INF_CFG; - strcpy(air.air_int_intf, netif_rsp->anp_phy_intf); - len = do_info_ioctl(&air, sizeof(struct air_cfg_rsp)); - if ((ssize_t)len == -1 || len == 0) { - rc = EIO; - goto server_info_done; - } - cfg_rsp = (struct air_cfg_rsp *)air.air_buf_addr; - - /* - * Update the server entry - */ - bcopy(&ip_addr->sin_addr, ssp->ss_lsid.id, ssp->ss_id_len); - ssp->ss_lsid.id_len = ssp->ss_id_len; - ssp->ss_mtu = mtu + 8; - ATM_ADDR_COPY(&intf_rsp->anp_addr, &ssp->ss_addr); - ATM_ADDR_COPY(&intf_rsp->anp_subaddr, &ssp->ss_subaddr); - if (ssp->ss_addr.address_format == T_ATM_ENDSYS_ADDR) { - anp = (Atm_addr_nsap *)ssp->ss_addr.address; - anp->aan_sel = sel; - } else if (ssp->ss_addr.address_format == T_ATM_E164_ADDR && - ssp->ss_subaddr.address_format == - T_ATM_ENDSYS_ADDR) { - anp = (Atm_addr_nsap *)ssp->ss_subaddr.address; - anp->aan_sel = sel; - } - ssp->ss_media = cfg_rsp->acp_cfg.ac_media; - rc = 0; - - /* - * Free dynamic data - */ -server_info_done: - if (netif_rsp) - free(netif_rsp); - if (intf_rsp) - free(intf_rsp); - if (cfg_rsp) - free(cfg_rsp); - - return(rc); -} - - -/* - * Process a CA message - * - * Arguments: - * dcsp pointer to a DCS control block for the neighbor - * cap pointer to the CA part of the received message - * - * Returns: - * none - * - */ -void -scsp_process_ca(dcsp, cap) - Scsp_dcs *dcsp; - Scsp_ca *cap; -{ - Scsp_csa *csap, *next_csap; - Scsp_cse *csep; - Scsp_server *ssp = dcsp->sd_server; - - /* - * Process CSAS records from the CA message - */ - for (csap = cap->ca_csa_rec; csap; csap = next_csap) { - next_csap = csap->next; - SCSP_LOOKUP(ssp, &csap->key, csep); - if (!csep || (scsp_cmp_id(&csap->oid, - &csep->sc_oid) == 0 && - csap->seq > csep->sc_seq)) { - /* - * CSAS entry not in cache or more - * up to date than cache, add it to CRL - */ - UNLINK(csap, Scsp_csa, cap->ca_csa_rec, next); - LINK2TAIL(csap, Scsp_csa, dcsp->sd_crl, next); - } - } -} - - -/* - * Process a Cache Response message from a server - * - * Arguments: - * ssp pointer to the server block - * smp pointer to the message - * - * Returns: - * none - * - */ -void -scsp_process_cache_rsp(ssp, smp) - Scsp_server *ssp; - Scsp_if_msg *smp; -{ - int len; - Scsp_atmarp_msg *aap; - Scsp_cse *csep; - - /* - * Loop through the message, processing each cache entry - */ - len = smp->si_len; - len -= sizeof(Scsp_if_msg_hdr); - aap = &smp->si_atmarp; - while (len > 0) { - switch(smp->si_proto) { - case SCSP_ATMARP_PROTO: - /* - * If we already have an entry with this key, - * delete it - */ - SCSP_LOOKUP(ssp, &aap->sa_key, csep); - if (csep) { - SCSP_DELETE(ssp, csep); - free(csep); - } - - /* - * Copy the data from the server to a cache - * summary entry - */ - csep = scsp_atmarp2cse(aap); - - /* - * Point past this entry - */ - len -= sizeof(Scsp_atmarp_msg); - aap++; - break; - case SCSP_NHRP_PROTO: - default: - /* - * Not implemented yet - */ - return; - } - - /* - * Add the new summary entry to the cache - */ - SCSP_ADD(ssp, csep); - } -} - - -/* - * Propagate a CSA to all the DCSs in the server group except - * the one the CSA was received from - * - * Arguments: - * dcsp pointer to a the DCS the CSA came from - * csap pointer to a the CSA - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_propagate_csa(dcsp, csap) - Scsp_dcs *dcsp; - Scsp_csa *csap; -{ - int rc, ret_rc = 0; - Scsp_server *ssp = dcsp->sd_server; - Scsp_dcs *dcsp1; - Scsp_csa *csap1; - - /* - * Check the hop count in the CSA - */ - if (csap->hops <= 1) - return(0); - - /* - * Pass the cache entry on to the server's other DCSs - */ - for (dcsp1 = ssp->ss_dcs; dcsp1; dcsp1 = dcsp1->sd_next) { - /* - * Skip this DCS if it's the one we got - * the entry from - */ - if (dcsp1 == dcsp) - continue; - - /* - * Copy the CSA - */ - csap1 = scsp_dup_csa(csap); - - /* - * Decrement the hop count - */ - csap1->hops--; - - /* - * Send the copy of the CSA to the CA FSM for the DCS - */ - rc = scsp_cafsm(dcsp1, SCSP_CAFSM_CACHE_UPD, - (void *) csap1); - if (rc) - ret_rc = rc; - } - - return(ret_rc); -} - - -/* - * Update SCSP's cache given a CSA or CSAS - * - * Arguments: - * dcsp pointer to a DCS - * csap pointer to a CSA - * - * Returns: - * none - * - */ -void -scsp_update_cache(dcsp, csap) - Scsp_dcs *dcsp; - Scsp_csa *csap; -{ - Scsp_cse *csep; - - /* - * Check whether we already have this in the cache - */ - SCSP_LOOKUP(dcsp->sd_server, &csap->key, csep); - - /* - * If we don't already have it and it's not being deleted, - * build a new cache summary entry - */ - if (!csep && !csap->null) { - /* - * Get memory for a new entry - */ - csep = calloc(1, sizeof(Scsp_cse)); - if (csep == NULL) - scsp_mem_err("scsp_update_cache: sizeof(Scsp_cse)"); - - /* - * Fill out the new cache summary entry - */ - csep->sc_seq = csap->seq; - csep->sc_key = csap->key; - csep->sc_oid = csap->oid; - - /* - * Add the new entry to the cache - */ - SCSP_ADD(dcsp->sd_server, csep); - } - - /* - * Update or delete the entry - */ - if (csap->null) { - /* - * The null flag is set--delete the entry - */ - if (csep) { - SCSP_DELETE(dcsp->sd_server, csep); - free(csep); - } - } else { - /* - * Update the existing entry - */ - csep->sc_seq = csap->seq; - csep->sc_oid = csap->oid; - } -} - - -/* - * Reconfigure SCSP - * - * Called as the result of a SIGHUP interrupt. Reread the - * configuration file and solicit the cache from the server. - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -scsp_reconfigure() -{ - int rc; - Scsp_server *ssp; - - /* - * Log a message saying we're reconfiguring - */ - scsp_log(LOG_ERR, "Reconfiguring ..."); - - /* - * Re-read the configuration file - */ - rc = scsp_config(scsp_config_file); - if (rc) { - scsp_log(LOG_ERR, "Found %d error%s in configuration file", - rc, ((rc == 1) ? "" : "s")); - exit(1); - } - - /* - * If a connection to a server is open, get the cache from - * the server - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - if (ssp->ss_sock != -1) { - rc = scsp_send_cache_ind(ssp); - } - } -} Property changes on: head/usr.sbin/atm/scspd/scsp_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_print.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_print.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_print.c (nonexistent) @@ -1,1301 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Print routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Indent string - */ -#define MIN_INDENT 2 -#define MAX_INDENT 64 -static char indent[MAX_INDENT + 1]; - - -/* - * Value-name translation table entry - */ -struct type_name { - char *name; - u_char type; -}; -typedef struct type_name Type_name; - - -/* - * SCSP name-type tables - */ -static Type_name if_msg_types[] = { - { "Config Request", SCSP_CFG_REQ }, - { "Config Response", SCSP_CFG_RSP }, - { "Cache Indication", SCSP_CACHE_IND }, - { "Cache Response", SCSP_CACHE_RSP }, - { "Solicit Indication", SCSP_SOLICIT_IND }, - { "Solicit Response", SCSP_SOLICIT_RSP }, - { "Cache Update Indication", SCSP_UPDATE_IND }, - { "Cache Update Request", SCSP_UPDATE_REQ }, - { "Cache Update Response", SCSP_UPDATE_RSP }, - { (char *)0, 0 } -}; - -static Type_name msg_types[] = { - { "Cache Alignment", SCSP_CA_MSG }, - { "CSU Request", SCSP_CSU_REQ_MSG }, - { "CSU Reply", SCSP_CSU_REPLY_MSG }, - { "CSU Solicit", SCSP_CSUS_MSG }, - { "Hello", SCSP_HELLO_MSG }, - { (char *)0, 0 } -}; - -static Type_name proto_types[] = { - { "ATMARP", SCSP_PROTO_ATMARP }, - { "NHRP", SCSP_PROTO_NHRP }, - { "MARS", SCSP_PROTO_MARS }, - { "DHCP", SCSP_PROTO_DHCP }, - { "LNNI", SCSP_PROTO_LNNI }, - { (char *)0, 0 } -}; - -static Type_name ext_types[] = { - { "End of Extensions", SCSP_EXT_END }, - { "Authentication", SCSP_EXT_AUTH }, - { "Vendor Private", SCSP_EXT_VENDOR }, - { (char *)0, 0 } -}; - -static Type_name hfsm_state_names[] = { - { "Down", SCSP_HFSM_DOWN }, - { "Waiting", SCSP_HFSM_WAITING }, - { "Unidirectional", SCSP_HFSM_UNI_DIR }, - { "Bidirectional", SCSP_HFSM_BI_DIR }, - { (char *)0, 0 } -}; - -static Type_name hfsm_event_names[] = { - { "VC open", SCSP_HFSM_VC_ESTAB }, - { "VC closed", SCSP_HFSM_VC_CLOSED }, - { "Hello timer", SCSP_HFSM_HELLO_T }, - { "Receive timer", SCSP_HFSM_RCV_T }, - { "Msg received", SCSP_HFSM_RCVD }, - { (char *)0, 0 } -}; - -static Type_name cafsm_state_names[] = { - { "Down", SCSP_CAFSM_DOWN }, - { "Master/Slave negotiation", SCSP_CAFSM_NEG }, - { "Master", SCSP_CAFSM_MASTER }, - { "Slave", SCSP_CAFSM_SLAVE }, - { "Update cache", SCSP_CAFSM_UPDATE }, - { "Aligned", SCSP_CAFSM_ALIGNED }, - { (char *)0, 0 } -}; - -static Type_name cafsm_event_names[] = { - { "Hello FSM up", SCSP_CAFSM_HELLO_UP }, - { "Hello FSM down", SCSP_CAFSM_HELLO_DOWN }, - { "CA received", SCSP_CAFSM_CA_MSG }, - { "CSU Solicit received", SCSP_CAFSM_CSUS_MSG }, - { "CSU Request received", SCSP_CAFSM_CSU_REQ }, - { "CSU Reply received", SCSP_CAFSM_CSU_REPLY }, - { "CA timer", SCSP_CAFSM_CA_T }, - { "CSUS timer", SCSP_CAFSM_CSUS_T }, - { "CSU timer", SCSP_CAFSM_CSU_T }, - { "Cache Update", SCSP_CAFSM_CACHE_UPD }, - { "Cache Response", SCSP_CAFSM_CACHE_RSP }, - { (char *)0, 0 } -}; - -static Type_name cifsm_state_names[] = { - { "Null", SCSP_CIFSM_NULL }, - { "Summarize", SCSP_CIFSM_SUM }, - { "Update", SCSP_CIFSM_UPD }, - { "Aligned", SCSP_CIFSM_ALIGN }, - { (char *)0, 0 } -}; - -static Type_name cifsm_event_names[] = { - { "CA FSM down", SCSP_CIFSM_CA_DOWN }, - { "CA FSM to Summarize",SCSP_CIFSM_CA_SUMM }, - { "CA FSM to Update", SCSP_CIFSM_CA_UPD }, - { "CA FSM to Aligned", SCSP_CIFSM_CA_ALIGN }, - { "Solicit Rsp", SCSP_CIFSM_SOL_RSP }, - { "Update Req", SCSP_CIFSM_UPD_REQ }, - { "Update Rsp", SCSP_CIFSM_UPD_RSP }, - { "CSU Request", SCSP_CIFSM_CSU_REQ }, - { "CSU Reply", SCSP_CIFSM_CSU_REPLY }, - { "CSU Solicit", SCSP_CIFSM_CSU_SOL }, - { (char *)0, 0 } -}; - -static Type_name atmarp_state_names[] = { - { "New", SCSP_ASTATE_NEW }, - { "Updated", SCSP_ASTATE_UPD }, - { "Deleted", SCSP_ASTATE_DEL }, - { (char *)0, 0 } -}; - - -/* - * Initialize the indent string - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -init_indent() -{ - indent[0] = '\0'; -} - - -/* - * Increment the indent string - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -inc_indent() -{ - if (strlen(indent) >= MAX_INDENT) - return; - strcat(indent, " "); -} - - -/* - * Decrement the indent string - * - * Arguments: - * none - * - * Returns: - * none - * - */ -static void -dec_indent() -{ - if (strlen(indent) < MIN_INDENT) - return; - indent[strlen(indent) - 2] = '\0'; -} - - - -/* - * Search for a type in a name-type table - * - * Arguments: - * type the value being searched for - * tbl pointer to the table to search - * - * Returns: - * pointer to a string identifying the type - * - */ -static char * -scsp_type_name(type, tbl) - u_char type; - Type_name *tbl; -{ - int i; - - /* - * Search the table - */ - for (i = 0; tbl[i].name != (char *)0 && tbl[i].type != type; - i++) - ; - - /* - * Check the result and return the appropriate value - */ - if (tbl[i].name) - return(tbl[i].name); - else - return("-"); -} - - -/* - * Format a Hello FSM state name - * - * Arguments: - * state the state - * - * Returns: - * pointer to a string identifying the state - * - */ -char * -format_hfsm_state(state) - int state; -{ - return(scsp_type_name((u_char)state, hfsm_state_names)); -} - - -/* - * Format a Hello FSM event name - * - * Arguments: - * event the event - * - * Returns: - * pointer to a string identifying the event - * - */ -char * -format_hfsm_event(event) - int event; -{ - char *cp; - - cp = scsp_type_name((u_char)event, hfsm_event_names); - return(cp); -} - - -/* - * Format a CA FSM state name - * - * Arguments: - * state the state - * - * Returns: - * pointer to a string identifying the state - * - */ -char * -format_cafsm_state(state) - int state; -{ - return(scsp_type_name((u_char)state, cafsm_state_names)); -} - - -/* - * Format a CA FSM event name - * - * Arguments: - * event the event - * - * Returns: - * pointer to a string identifying the event - * - */ -char * -format_cafsm_event(event) - int event; -{ - return(scsp_type_name((u_char)event, cafsm_event_names)); -} - - -/* - * Format a client interface FSM state name - * - * Arguments: - * state the state - * - * Returns: - * pointer to a string identifying the state - * - */ -char * -format_cifsm_state(state) - int state; -{ - return(scsp_type_name((u_char)state, cifsm_state_names)); -} - - -/* - * Format a client interface FSM event name - * - * Arguments: - * event the event - * - * Returns: - * pointer to a string identifying the event - * - */ -char * -format_cifsm_event(event) - int event; -{ - return(scsp_type_name((u_char)event, cifsm_event_names)); -} - - -/* - * Print a Sender or Receiver ID structure - * - * Arguments: - * fp file to print message to - * idp pointer to ID to be printed - * - * Returns: - * none - * - */ -void -print_scsp_id(fp, idp) - FILE *fp; - Scsp_id *idp; -{ - int i; - - inc_indent(); - fprintf(fp, "%sNext: %p\n", indent, idp->next); - fprintf(fp, "%sLength: %d\n", indent, - idp->id_len); - fprintf(fp, "%sID: 0x", indent); - for (i = 0; i < idp->id_len; i++) - fprintf(fp, "%02x ", idp->id[i]); - fprintf(fp, "\n"); - dec_indent(); -} - - -/* - * Print a Cache Key structure - * - * Arguments: - * fp file to print message to - * ckp pointer to cache key structure - * - * Returns: - * none - * - */ -void -print_scsp_cache_key(fp, ckp) - FILE *fp; - Scsp_ckey *ckp; -{ - int i; - - inc_indent(); - fprintf(fp, "%sLength: %d\n", indent, - ckp->key_len); - fprintf(fp, "%sKey: 0x", indent); - for (i = 0; i < ckp->key_len; i++) - fprintf(fp, "%02x ", ckp->key[i]); - fprintf(fp, "\n"); - dec_indent(); -} - - -/* - * Print the mandatory common part of a message - * - * Arguments: - * fp file to print message to - * mcp pointer to mandatory common part structure - * - * Returns: - * none - * - */ -static void -print_scsp_mcp(fp, mcp) - FILE *fp; - Scsp_mcp *mcp; -{ - inc_indent(); - fprintf(fp, "%sProtocol ID: %s (0x%02x)\n", indent, - scsp_type_name(mcp->pid, proto_types), - mcp->pid); - fprintf(fp, "%sServer Group ID: %d\n", indent, mcp->sgid); - fprintf(fp, "%sFlags: 0x%04x\n", indent, - mcp->flags); - fprintf(fp, "%sRecord Count: %d\n", indent, - mcp->rec_cnt); - fprintf(fp, "%sSender ID:\n", indent); - print_scsp_id(fp, &mcp->sid); - fprintf(fp, "%sReceiver ID:\n", indent); - print_scsp_id(fp, &mcp->rid); - dec_indent(); -} - - -/* - * Print an extension - * - * Arguments: - * fp file to print message to - * exp pointer to extension - * - * Returns: - * none - * - */ -static void -print_scsp_ext(fp, exp) - FILE *fp; - Scsp_ext *exp; -{ - int i; - u_char *cp; - - inc_indent(); - fprintf(fp, "%sNext: %p\n", indent, exp->next); - fprintf(fp, "%sType: %s (0x%02x)\n", indent, - scsp_type_name(exp->type, ext_types), - exp->type); - fprintf(fp, "%sLength: %d\n", indent, exp->len); - if (exp->len) { - fprintf(fp, "%sValue: 0x", indent); - cp = (u_char *)((caddr_t)exp + sizeof(Scsp_ext)); - for (i = 0; i < exp->len; i++) - fprintf(fp, "%02x ", *cp++); - fprintf(fp, "\n"); - } - dec_indent(); -} - - -/* - * Print an ATMARP Cache State Advertisement record - * - * Arguments: - * fp file to print message to - * acsp pointer to extension - * - * Returns: - * none - * - */ -static void -print_scsp_atmarp_csa(fp, acsp) - FILE *fp; - Scsp_atmarp_csa *acsp; -{ - inc_indent(); - fprintf(fp, "%sState: %s (%d)\n", indent, - scsp_type_name(acsp->sa_state, - atmarp_state_names), - acsp->sa_state); - fprintf(fp, "%sSource ATM addr: %s\n", indent, - format_atm_addr(&acsp->sa_sha)); - fprintf(fp, "%sSource ATM subaddr: %s\n", indent, - format_atm_addr(&acsp->sa_ssa)); - fprintf(fp, "%sSource IP addr: %s\n", indent, - format_ip_addr(&acsp->sa_spa)); - fprintf(fp, "%sTarget ATM addr: %s\n", indent, - format_atm_addr(&acsp->sa_tha)); - fprintf(fp, "%sTarget ATM subaddr: %s\n", indent, - format_atm_addr(&acsp->sa_tsa)); - fprintf(fp, "%sTarget IP addr: %s\n", indent, - format_ip_addr(&acsp->sa_tpa)); - dec_indent(); -} - - -/* - * Print a Cache State Advertisement record or - * Cache State Advertisement Summary record - * - * Arguments: - * fp file to print message to - * csap pointer to CSA or CSAS - * - * Returns: - * none - * - */ -static void -print_scsp_csa(fp, csap) - FILE *fp; - Scsp_csa *csap; -{ - inc_indent(); - fprintf(fp, "%sNext: %p\n", indent, csap->next); - fprintf(fp, "%sHops: %d\n", indent, csap->hops); - fprintf(fp, "%sNull Flag: %s\n", indent, - csap->null ? "True" : "False"); - fprintf(fp, "%sSequence no.: %ld (0x%lx)\n", - indent, csap->seq, csap->seq); - fprintf(fp, "%sCache Key:\n", indent); - print_scsp_cache_key(fp, &csap->key); - fprintf(fp, "%sOriginator ID:\n", indent); - print_scsp_id(fp, &csap->oid); - if (csap->atmarp_data) { - fprintf(fp, "%sATMARP data:\n", indent); - print_scsp_atmarp_csa(fp, csap->atmarp_data); - } - dec_indent(); -} - - -/* - * Print a Cache Alignment message - * - * Arguments: - * fp file to print message to - * cap pointer to extension - * - * Returns: - * none - * - */ -static void -print_scsp_ca(fp, cap) - FILE *fp; - Scsp_ca *cap; -{ - int n; - Scsp_csa *csap; - - inc_indent(); - fprintf(fp, "%sCA Seq. No.: %ld\n", indent, - cap->ca_seq); - fprintf(fp, "%sM bit: %s\n", indent, - cap->ca_m ? "True" : "False"); - fprintf(fp, "%sI bit: %s\n", indent, - cap->ca_i ? "True" : "False"); - fprintf(fp, "%sO bit: %s\n", indent, - cap->ca_o ? "True" : "False"); - fprintf(fp, "%sMandatory Common Part:\n", indent); - print_scsp_mcp(fp, &cap->ca_mcp); - for (csap = cap->ca_csa_rec, n = 1; csap; - csap = csap->next, n++) { - fprintf(fp, "%sCSA Record %d (%p):\n", indent, n, csap); - print_scsp_csa(fp, csap); - } - dec_indent(); -} - - -/* - * Print a Cache State Update Request, Cache State Update Reply, or - * Cache State Update Solicit message - * - * Arguments: - * fp file to print message to - * csup pointer to CSU message - * - * Returns: - * none - * - */ -static void -print_scsp_csu(fp, csup) - FILE *fp; - Scsp_csu_msg *csup; -{ - int i; - Scsp_csa *csap; - - inc_indent(); - fprintf(fp, "%sMandatory Common Part:\n", indent); - print_scsp_mcp(fp, &csup->csu_mcp); - for (csap = csup->csu_csa_rec, i = 1; csap; - csap = csap->next, i++) { - fprintf(fp, "%sCSA Record %d:\n", indent, i); - print_scsp_csa(fp, csap); - } - dec_indent(); -} - - -/* - * Print a Hello message - * - * Arguments: - * fp file to print message to - * hp pointer to hello message - * - * Returns: - * none - * - */ -static void -print_scsp_hello(fp, hp) - FILE *fp; - Scsp_hello *hp; -{ - Scsp_id *ridp; - - inc_indent(); - fprintf(fp, "%sHello Interval: %d\n", indent, - hp->hello_int); - fprintf(fp, "%sDead Factor: %d\n", indent, - hp->dead_factor); - fprintf(fp, "%sFamily ID: %d\n", indent, - hp->family_id); - fprintf(fp, "%sMandatory Common Part:\n", indent); - print_scsp_mcp(fp, &hp->hello_mcp); - ridp = hp->hello_mcp.rid.next; - if (ridp) { - fprintf(fp, "%sAdditional Receiver IDs:\n", indent); - for (; ridp; ridp = ridp->next) - print_scsp_id(fp, ridp); - } - dec_indent(); -} - - -#ifdef NOTDEF -/* - * NHRP-specific Cache State Advertisement record - */ -struct scsp_nhrp_csa { - u_char req_id; /* Request ID */ - u_char state; /* State */ - u_char pref_len; /* Prefix length */ - u_short flags; /* See below */ - u_short mtu; /* Maximim transmission unit */ - u_short hold_time; /* Entry holding time */ - u_char caddr_tlen; /* Client addr type/length */ - u_char csaddr_tlen; /* Client subaddr type/length */ - u_char cproto_len; /* Client proto addr length */ - u_char pref; /* Preference */ - Atm_addr caddr; /* Client address */ - Atm_addr csaddr; /* Client subaddress */ - struct in_addr cproto_addr; /* Client protocol address */ -}; -typedef struct scsp_nhrp Scsp_nhrp; - -#define SCSP_NHRP_UNIQ 0x8000 -#define SCSP_NHRP_ARP 0x4000 - -#endif - - -/* - * Print an SCSP message - * - * Arguments: - * fp file to print message to - * msg pointer to message to be printed - * - * Returns: - * none - * - */ -void -print_scsp_msg(fp, msg) - FILE *fp; - Scsp_msg *msg; -{ - int n; - Scsp_ext *exp; - - /* - * Initialize - */ - init_indent(); - - /* - * Print the message type - */ - inc_indent(); - fprintf(fp, "%sMessage type: %s (0x%02x)\n", indent, - scsp_type_name(msg->sc_msg_type, msg_types), - msg->sc_msg_type); - - /* - * Print the body of the message - */ - switch(msg->sc_msg_type) { - case SCSP_CA_MSG: - print_scsp_ca(fp, msg->sc_ca); - break; - case SCSP_CSU_REQ_MSG: - case SCSP_CSU_REPLY_MSG: - case SCSP_CSUS_MSG: - print_scsp_csu(fp, msg->sc_csu_msg); - break; - case SCSP_HELLO_MSG: - print_scsp_hello(fp, msg->sc_hello); - break; - } - - /* - * Print any extensions - */ - for (exp = msg->sc_ext, n = 1; exp; exp = exp->next, n++) { - fprintf(fp, "%sExtension %d:\n", indent, n); - print_scsp_ext(fp, exp); - } - dec_indent(); - - (void)fflush(fp); -} - - -/* - * Print an SCSP ATMARP message - * - * Arguments: - * fp file to print message to - * acp pointer to ATMARP message - * - * Returns: - * none - * - */ -static void -print_scsp_if_atmarp(fp, amp) - FILE *fp; - Scsp_atmarp_msg *amp; -{ - inc_indent(); - fprintf(fp, "%sState: %s (%d)\n", indent, - scsp_type_name(amp->sa_state, - atmarp_state_names), - amp->sa_state); - fprintf(fp, "%sCached protocol addr: %s\n", indent, - format_ip_addr(&->sa_cpa)); - fprintf(fp, "%sCached ATM addr: %s\n", indent, - format_atm_addr(&->sa_cha)); - fprintf(fp, "%sCached ATM subaddr: %s\n", indent, - format_atm_addr(&->sa_csa)); - fprintf(fp, "%sCache key:\n", indent); - print_scsp_cache_key(fp, &->sa_key); - fprintf(fp, "%sOriginator ID:\n", indent); - print_scsp_id(fp, &->sa_oid); - fprintf(fp, "%sSequence number: %ld (0x%08lx)\n", indent, - amp->sa_seq, (u_long)amp->sa_seq); - dec_indent(); -} - - -/* - * Print an SCSP client interface message - * - * Arguments: - * fp file to print message to - * imsg pointer to message to be printed - * - * Returns: - * none - * - */ -void -print_scsp_if_msg(fp, imsg) - FILE *fp; - Scsp_if_msg *imsg; -{ - int len; - Scsp_atmarp_msg *ap; - - /* - * Initialize - */ - init_indent(); - fprintf(fp, "SCSP Client Interface Message at %p\n", imsg); - - /* - * Print the message header - */ - inc_indent(); - fprintf(fp, "%sMessage type: %s (0x%02x)\n", indent, - scsp_type_name(imsg->si_type, if_msg_types), - imsg->si_type); - fprintf(fp, "%sResponse code: %d\n", indent, - imsg->si_rc); - fprintf(fp, "%sProtocol type: %s (%d)\n", indent, - scsp_type_name(imsg->si_proto, proto_types), - imsg->si_proto); - fprintf(fp, "%sLength: %d\n", indent, - imsg->si_len); - fprintf(fp, "%sToken: 0x%lx\n", indent, - imsg->si_tok); - - /* - * Print the body of the message - */ - switch(imsg->si_type) { - case SCSP_CFG_REQ: - fprintf(fp, "%sInterface: %s\n", indent, - imsg->si_cfg.atmarp_netif); - break; - case SCSP_CACHE_RSP: - case SCSP_UPDATE_IND: - case SCSP_UPDATE_REQ: - len = imsg->si_len - sizeof(Scsp_if_msg_hdr); - ap = &imsg->si_atmarp; - while (len) { - switch(imsg->si_proto) { - case SCSP_PROTO_ATMARP: - fprintf(fp, "%sATMARP CSA:\n", indent); - print_scsp_if_atmarp(fp, ap); - len -= sizeof(Scsp_atmarp_msg); - ap++; - break; - case SCSP_PROTO_NHRP: - case SCSP_PROTO_MARS: - case SCSP_PROTO_DHCP: - case SCSP_PROTO_LNNI: - default: - fprintf(fp, "Protocol type not implemented\n"); - break; - } - } - break; - } - dec_indent(); - - (void)fflush(fp); -} - - -/* - * Print an SCSP pending connection block - * - * Arguments: - * fp file to print message to - * pp pointer to pending control block - * - * Returns: - * none - * - */ -void -print_scsp_pending(fp, pp) - FILE *fp; - Scsp_pending *pp; -{ - /* - * Initialize - */ - init_indent(); - - /* - * Print a header - */ - fprintf(fp, "Pending control block at %p\n", pp); - - /* - * Print the fields of the control block - */ - inc_indent(); - fprintf(fp, "%sNext: %p\n", indent, pp->sp_next); - fprintf(fp, "%sSocket: %d\n", indent, - pp->sp_sock); - - dec_indent(); -} - - -/* - * Print an SCSP server control block - * - * Arguments: - * fp file to print message to - * ssp pointer to server control block - * - * Returns: - * none - * - */ -void -print_scsp_server(fp, ssp) - FILE *fp; - Scsp_server *ssp; -{ - /* - * Initialize - */ - init_indent(); - - /* - * Print a header - */ - fprintf(fp, "Server control block at %p\n", ssp); - - /* - * Print the fields of the client control block - */ - inc_indent(); - fprintf(fp, "%sNext: %p\n", indent, - ssp->ss_next); - fprintf(fp, "%sName: %s\n", indent, - ssp->ss_name); - fprintf(fp, "%sNetwork Interface: %s\n", indent, - ssp->ss_intf); - fprintf(fp, "%sState: %d\n", indent, - ssp->ss_state); - fprintf(fp, "%sProtocol ID: 0x%lx\n", indent, - ssp->ss_pid); - fprintf(fp, "%sID length: %d\n", indent, - ssp->ss_id_len); - fprintf(fp, "%sCache key length: %d\n", indent, - ssp->ss_ckey_len); - fprintf(fp, "%sServer Group ID: 0x%lx\n", indent, - ssp->ss_sgid); - fprintf(fp, "%sFamily ID: 0x%lx\n", indent, - ssp->ss_fid); - fprintf(fp, "%sSocket: %d\n", indent, - ssp->ss_sock); - fprintf(fp, "%sDCS Listen Socket: %d\n", indent, - ssp->ss_dcs_lsock); - fprintf(fp, "%sLocal Server ID:\n", indent); - print_scsp_id(fp, &ssp->ss_lsid); - fprintf(fp, "%sATM address: %s\n", indent, - format_atm_addr(&ssp->ss_addr)); - fprintf(fp, "%sATM subaddress: %s\n", indent, - format_atm_addr(&ssp->ss_subaddr)); - fprintf(fp, "%sInterface MTU: %d\n", indent, - ssp->ss_mtu); - fprintf(fp, "%sMark: %d\n", indent, - ssp->ss_mark); - dec_indent(); -} - - -/* - * Print an SCSP client cache summary entry control block - * - * Arguments: - * fp file to print message to - * csep pointer to summary entry - * - * Returns: - * none - * - */ -void -print_scsp_cse(fp, csep) - FILE *fp; - Scsp_cse *csep; -{ - /* - * Print the fields of the cache summary entry - */ - inc_indent(); - fprintf(fp, "%sNext CSE: %p\n", indent, csep->sc_next); - fprintf(fp, "%sCSA sequence no.: %ld (0x%lx)\n", indent, - csep->sc_seq, csep->sc_seq); - fprintf(fp, "%sCache key:\n", indent); - print_scsp_cache_key(fp, &csep->sc_key); - fprintf(fp, "%sOrigin ID:\n", indent); - print_scsp_id(fp, &csep->sc_oid); - dec_indent(); -} - - -/* - * Print an SCSP CSU Request retransmission control block - * - * Arguments: - * fp file to print message to - * csurp pointer to retransmission entry - * - * Returns: - * none - * - */ -void -print_scsp_csu_rexmt(fp, rxp) - FILE *fp; - Scsp_csu_rexmt *rxp; -{ - int i; - Scsp_csa *csap; - - inc_indent(); - fprintf(fp, "%sNext CSU Req rexmt: %p\n", indent, rxp->sr_next); - fprintf(fp, "%sDCS address: %p\n", indent, rxp->sr_dcs); - for (csap = rxp->sr_csa, i = 1; csap; - csap = csap->next, i++) { - fprintf(fp, "%sCSA %d:\n", indent, i); - print_scsp_csa(fp, csap); - } - dec_indent(); -} - - -/* - * Print an SCSP DCS control block - * - * Arguments: - * fp file to print message to - * dcsp pointer to DCS control block - * - * Returns: - * none - * - */ -void -print_scsp_dcs(fp, dcsp) - FILE *fp; - Scsp_dcs *dcsp; -{ - Scsp_csa *csap; - Scsp_cse *csep; - Scsp_csu_rexmt *rxp; - - /* - * Initialize - */ - init_indent(); - - /* - * Print a header - */ - fprintf(fp, "DCS control block at %p\n", dcsp); - - /* - * Print the fields of the DCS control block - */ - inc_indent(); - fprintf(fp, "%sNext DCS block: %p\n", indent, dcsp->sd_next); - fprintf(fp, "%sServer control block: %p\n", indent, dcsp->sd_server); - fprintf(fp, "%sDCS ID:\n", indent); - print_scsp_id(fp, &dcsp->sd_dcsid); - fprintf(fp, "%sDCS address: %s\n", indent, - format_atm_addr(&dcsp->sd_addr)); - fprintf(fp, "%sDCS subaddress %s\n", indent, - format_atm_addr(&dcsp->sd_subaddr)); - fprintf(fp, "%sSocket: %d\n", indent, - dcsp->sd_sock); - fprintf(fp, "%sOpen VCC Retry Timer:\n", indent); - fprintf(fp, "%sHello FSM State: %s\n", indent, - format_hfsm_state(dcsp->sd_hello_state)); - fprintf(fp, "%sHello Interval: %d\n", indent, - dcsp->sd_hello_int); - fprintf(fp, "%sHello Dead Factor: %d\n", indent, - dcsp->sd_hello_df); - fprintf(fp, "%sHello Rcvd: %d\n", indent, - dcsp->sd_hello_rcvd); - fprintf(fp, "%sCA FSM State: %s\n", indent, - format_cafsm_state(dcsp->sd_ca_state)); - fprintf(fp, "%sCA Seq. No.: 0x%lx\n", indent, - dcsp->sd_ca_seq); - fprintf(fp, "%sCA Rexmit Int: %d\n", indent, - dcsp->sd_ca_rexmt_int); - fprintf(fp, "%sCA Retransmit Msg: %p\n", indent, - dcsp->sd_ca_rexmt_msg); - fprintf(fp, "%sCSASs to send: ", indent); - if (dcsp->sd_ca_csas == (Scsp_cse *)0) { - fprintf(fp, "Empty\n"); - } else { - fprintf(fp, "%p\n", dcsp->sd_ca_csas); - } - fprintf(fp, "%sCSUS Rexmit Int: %d\n", indent, - dcsp->sd_csus_rexmt_int); - fprintf(fp, "%sCache Request List: ", indent); - if (dcsp->sd_crl == (Scsp_csa *)0) { - fprintf(fp, "Empty\n"); - } else { - fprintf(fp, "%p\n", dcsp->sd_crl); - } - fprintf(fp, "%sCSUS Rexmit Msg: %p\n", indent, - dcsp->sd_csus_rexmt_msg); - fprintf(fp, "%sCSA Hop count: %d\n", indent, - dcsp->sd_hops); - fprintf(fp, "%sCSAs Pending ACK: %p\n", indent, - dcsp->sd_csu_ack_pend); - fprintf(fp, "%sCSAs ACKed: %p\n", indent, - dcsp->sd_csu_ack); - fprintf(fp, "%sCSU Req Rexmit Int: %d\n", indent, - dcsp->sd_csu_rexmt_int); - fprintf(fp, "%sCSU Req Rexmit Max: %d\n", indent, - dcsp->sd_csu_rexmt_max); - fprintf(fp, "%sCSU Req Rexmit Queue ", indent); - if (!dcsp->sd_csu_rexmt) { - fprintf(fp, "Empty\n"); - } else { - fprintf(fp, "%p\n", dcsp->sd_csu_rexmt); - } - fprintf(fp, "%sClient I/F state: %d\n", indent, - dcsp->sd_client_state); - - /* - * Print the list of CSASs waiting to be sent - */ - if (dcsp->sd_ca_csas) { - fprintf(fp, "\n%sCSASs to send:", indent); - inc_indent(); - for (csep = dcsp->sd_ca_csas; csep; - csep = csep->sc_next) { - fprintf(fp, "%sCache summary entry at %p\n", - indent, csep); - print_scsp_cse(fp, csep); - } - dec_indent(); - } - - /* - * Print the Cache Request List - */ - if (dcsp->sd_crl) { - fprintf(fp, "\n%sCache Request List:\n", indent); - inc_indent(); - for (csap = dcsp->sd_crl; csap; csap = csap->next) { - fprintf(fp, "%sCSA at %p\n", indent, csap); - print_scsp_csa(fp, csap); - } - dec_indent(); - } - - /* - * Print the CSU retransmit queue - */ - if (dcsp->sd_csu_rexmt) { - fprintf(fp, "\n%sCSU Req Rexmit Queue:\n", indent); - inc_indent(); - for (rxp = dcsp->sd_csu_rexmt; rxp; - rxp = rxp->sr_next) { - fprintf(fp, "%sCSU Rexmit Block at %p\n", - indent, rxp); - print_scsp_csu_rexmt(fp, rxp); - } - dec_indent(); - } - - dec_indent(); -} - - -/* - * Print SCSP's control blocks - * - * Arguments: - * none - * - * Returns: - * None - * - */ -void -print_scsp_dump() -{ - int i; - Scsp_server *ssp; - Scsp_dcs *dcsp; - Scsp_cse *scp; - Scsp_pending *pp; - FILE *df; - char fname[64]; - static int dump_no = 0; - - /* - * Build a file name - */ - bzero(fname, sizeof(fname)); - sprintf(fname, "/tmp/scspd.%d.%03d.out", getpid(), dump_no++); - - /* - * Open the output file - */ - df = fopen(fname, "w"); - if (df == (FILE *)0) - return; - - /* - * Dump the server control blocks - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - print_scsp_server(df, ssp); - fprintf(df, "\n"); - - /* - * Print the client's cache summary - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - for (scp = ssp->ss_cache[i]; scp; - scp = scp->sc_next) { - print_scsp_cse(df, scp); - fprintf(df, "\n"); - } - } - - /* - * Print the client's DCS control blocks - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = dcsp->sd_next) { - print_scsp_dcs(df, dcsp); - fprintf(df, "\n\n"); - } - fprintf(df, "\n\n"); - } - - /* - * Print the pending connection blocks - */ - for (pp = scsp_pending_head; pp; pp = pp->sp_next) { - print_scsp_pending(df, pp); - fprintf(df, "\n"); - } - - /* - * Close the output file - */ - (void)fclose(df); -} Property changes on: head/usr.sbin/atm/scspd/scsp_print.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_socket.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_socket.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_socket.c (nonexistent) @@ -1,1344 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP socket management routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Local variables - */ -static struct t_atm_llc llc_scsp = { - T_ATM_LLC_SHARING, - 8, - {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x5e, 0x00, 0x05} -}; - -static struct t_atm_aal5 aal5 = { - 0, /* forward_max_SDU_size */ - 0, /* backward_max_SDU_size */ - 0 /* SSCS_type */ -}; - -static struct t_atm_traffic traffic = { - { /* forward */ - T_ATM_ABSENT, /* PCR_high_priority */ - 0, /* PCR_all_traffic */ - T_ATM_ABSENT, /* SCR_high_priority */ - T_ATM_ABSENT, /* SCR_all_traffic */ - T_ATM_ABSENT, /* MBS_high_priority */ - T_ATM_ABSENT, /* MBS_all_traffic */ - T_NO /* tagging */ - }, - { /* backward */ - T_ATM_ABSENT, /* PCR_high_priority */ - 0, /* PCR_all_traffic */ - T_ATM_ABSENT, /* SCR_high_priority */ - T_ATM_ABSENT, /* SCR_all_traffic */ - T_ATM_ABSENT, /* MBS_high_priority */ - T_ATM_ABSENT, /* MBS_all_traffic */ - T_NO /* tagging */ - }, - T_YES /* best_effort */ -}; - -static struct t_atm_bearer bearer = { - T_ATM_CLASS_X, /* bearer_class */ - T_ATM_NULL, /* traffic_type */ - T_ATM_NULL, /* timing_requirements */ - T_NO, /* clipping_susceptibility */ - T_ATM_1_TO_1 /* connection_configuration */ -}; - -static struct t_atm_qos qos = { - T_ATM_NETWORK_CODING, /* coding_standard */ - { /* forward */ - T_ATM_QOS_CLASS_0 /* qos_class */ - }, - { /* backward */ - T_ATM_QOS_CLASS_0 /* qos_class */ - } -}; - -static struct t_atm_app_name appname = { - "SCSP" -}; - - -/* - * Find a DCS, given its socket - * - * Arguments: - * sd socket descriptor - * - * Returns: - * 0 not found - * address of DCS block corresponding to socket - * - */ -Scsp_dcs * -scsp_find_dcs(sd) - int sd; -{ - Scsp_server *ssp; - Scsp_dcs *dcsp = NULL; - - /* - * Loop through the list of servers - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - /* - * Check all the DCSs chained from each server - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = dcsp->sd_next) { - if (dcsp->sd_sock == sd) - break; - } - } - - return(dcsp); -} - - -/* - * Find a server, given its socket - * - * Arguments: - * sd socket descriptor - * - * Returns: - * 0 not found - * address of server block corresponding to socket - * - */ -Scsp_server * -scsp_find_server(sd) - int sd; -{ - Scsp_server *ssp; - - /* - * Loop through the list of servers - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - if (ssp->ss_sock == sd) - break; - } - - return(ssp); -} - - -/* - * Connect to a directly connected server - * - * Arguments: - * dcsp pointer to DCS block for server - * - * Returns: - * 0 success (dcsp->sd_sock is set) - * else errno indicating reason for failure - * - */ -int -scsp_dcs_connect(dcsp) - Scsp_dcs *dcsp; - -{ - int rc, sd; - struct sockaddr_atm DCS_addr; - - /* - * If the DCS already has an open connection, just return - */ - if (dcsp->sd_sock != -1) { - return(0); - } - - /* - * Open an ATM socket - */ - sd = socket(PF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5); - if (sd == -1) { - return(ESOCKTNOSUPPORT); - } - if (sd > scsp_max_socket) { - scsp_max_socket = sd; - } - - /* - * Set up connection parameters for SCSP connection - */ - bzero(&DCS_addr, sizeof(DCS_addr)); -#if (defined(BSD) && (BSD >= 199103)) - DCS_addr.satm_len = sizeof(DCS_addr); -#endif - DCS_addr.satm_family = AF_ATM; - DCS_addr.satm_addr.t_atm_sap_addr.SVE_tag_addr = - T_ATM_PRESENT; - DCS_addr.satm_addr.t_atm_sap_addr.SVE_tag_selector = - T_ATM_PRESENT; - DCS_addr.satm_addr.t_atm_sap_addr.address_format = - dcsp->sd_addr.address_format; - DCS_addr.satm_addr.t_atm_sap_addr.address_length = - dcsp->sd_addr.address_length; - bcopy(dcsp->sd_addr.address, - DCS_addr.satm_addr.t_atm_sap_addr.address, - dcsp->sd_addr.address_length); - - DCS_addr.satm_addr.t_atm_sap_layer2.SVE_tag = - T_ATM_PRESENT; - DCS_addr.satm_addr.t_atm_sap_layer2.ID_type = - T_ATM_SIMPLE_ID; - DCS_addr.satm_addr.t_atm_sap_layer2.ID.simple_ID = - T_ATM_BLLI2_I8802; - - DCS_addr.satm_addr.t_atm_sap_layer3.SVE_tag = - T_ATM_ABSENT; - DCS_addr.satm_addr.t_atm_sap_appl.SVE_tag = - T_ATM_ABSENT; - - /* - * Bind the socket to our address - */ - if (bind(sd, (struct sockaddr *)&DCS_addr, - sizeof(DCS_addr))) { - rc = errno; - goto connect_fail; - } - - /* - * Set non-blocking operation - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - scsp_log(LOG_ERR, "scsp_dcs_connect: fcntl failed"); - rc = errno; - goto connect_fail; - } - - /* - * Set AAL 5 options - */ - aal5.forward_max_SDU_size = dcsp->sd_server->ss_mtu; - aal5.backward_max_SDU_size = dcsp->sd_server->ss_mtu; - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5, - sizeof(aal5)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Set traffic options - */ - switch(dcsp->sd_server->ss_media) { - case MEDIA_TAXI_100: - traffic.forward.PCR_all_traffic = ATM_PCR_TAXI100; - traffic.backward.PCR_all_traffic = ATM_PCR_TAXI100; - break; - case MEDIA_TAXI_140: - traffic.forward.PCR_all_traffic = ATM_PCR_TAXI140; - traffic.backward.PCR_all_traffic = ATM_PCR_TAXI140; - break; - case MEDIA_OC3C: - case MEDIA_UTP155: - traffic.forward.PCR_all_traffic = ATM_PCR_OC3C; - traffic.backward.PCR_all_traffic = ATM_PCR_OC3C; - break; - case MEDIA_OC12C: - traffic.forward.PCR_all_traffic = ATM_PCR_OC12C; - traffic.backward.PCR_all_traffic = ATM_PCR_OC12C; - break; - case MEDIA_UNKNOWN: - break; - } - - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_TRAFFIC, - (caddr_t)&traffic, sizeof(traffic)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Set bearer capability options - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_BEARER_CAP, - (caddr_t)&bearer, sizeof(bearer)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Set QOS options - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_QOS, - (caddr_t)&qos, sizeof(qos)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Set LLC identifier - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_LLC, - (caddr_t)&llc_scsp, sizeof(llc_scsp)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Set application name - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_APP_NAME, - (caddr_t)&appname, sizeof(appname)) < 0) { - rc = EOPNOTSUPP; - goto connect_fail; - } - - /* - * Connect to DCS - */ - if (connect(sd, (struct sockaddr *)&DCS_addr, - sizeof(DCS_addr)) < 0 && - errno != EINPROGRESS) { - rc = errno; - goto connect_fail; - } - - /* - * Set return values - */ - dcsp->sd_sock = sd; - return(0); - -connect_fail: - /* - * Close the socket if something didn't work - */ - (void)close(sd); - dcsp->sd_sock = -1; - if (rc == 0) - rc = EFAULT; - return(rc); -} - - -/* - * Listen for ATM connections from DCSs - * - * Arguments: - * None - * - * Returns: - * sock socket which is listening (also set in - ssp->ss_dcs_lsock) - * -1 error encountered (reason in errno) - * - */ -int -scsp_dcs_listen(ssp) - Scsp_server *ssp; -{ - int rc, sd; - struct sockaddr_atm ls_addr; - - /* - * Open a socket - */ - sd = socket(PF_ATM, SOCK_SEQPACKET, ATM_PROTO_AAL5); - if (sd == -1) { - rc = errno; - goto listen_fail; - } - if (sd > scsp_max_socket) { - scsp_max_socket = sd; - } - - /* - * Set up our address - */ - bzero(&ls_addr, sizeof(ls_addr)); -#if (defined(BSD) && (BSD >= 199103)) - ls_addr.satm_len = sizeof(ls_addr); -#endif - ls_addr.satm_family = AF_ATM; - ls_addr.satm_addr.t_atm_sap_addr.SVE_tag_addr = T_ATM_PRESENT; - ls_addr.satm_addr.t_atm_sap_addr.SVE_tag_selector = - T_ATM_PRESENT; - ls_addr.satm_addr.t_atm_sap_addr.address_format = - ssp->ss_addr.address_format; - ls_addr.satm_addr.t_atm_sap_addr.address_length = - ssp->ss_addr.address_length; - bcopy(ssp->ss_addr.address, - ls_addr.satm_addr.t_atm_sap_addr.address, - ssp->ss_addr.address_length); - - ls_addr.satm_addr.t_atm_sap_layer2.SVE_tag = T_ATM_PRESENT; - ls_addr.satm_addr.t_atm_sap_layer2.ID_type = T_ATM_SIMPLE_ID; - ls_addr.satm_addr.t_atm_sap_layer2.ID.simple_ID = - T_ATM_BLLI2_I8802; - - ls_addr.satm_addr.t_atm_sap_layer3.SVE_tag = T_ATM_ABSENT; - ls_addr.satm_addr.t_atm_sap_appl.SVE_tag = T_ATM_ABSENT; - - /* - * Bind the socket to our address - */ - rc = bind(sd, (struct sockaddr *)&ls_addr, sizeof(ls_addr)); - if (rc == -1) { - rc = errno; - goto listen_fail; - } - - /* - * Set non-blocking I/O - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - scsp_log(LOG_ERR, "scsp_dcs_listen: fcntl failed"); - rc = errno; - goto listen_fail; - } - - /* - * Set AAL 5 options - */ - aal5.forward_max_SDU_size = ssp->ss_mtu; - aal5.backward_max_SDU_size = ssp->ss_mtu; - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_AAL5, (caddr_t)&aal5, - sizeof(aal5)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Set traffic options - */ - switch(ssp->ss_media) { - case MEDIA_TAXI_100: - traffic.forward.PCR_all_traffic = ATM_PCR_TAXI100; - traffic.backward.PCR_all_traffic = ATM_PCR_TAXI100; - break; - case MEDIA_TAXI_140: - traffic.forward.PCR_all_traffic = ATM_PCR_TAXI140; - traffic.backward.PCR_all_traffic = ATM_PCR_TAXI140; - break; - case MEDIA_OC3C: - case MEDIA_UTP155: - traffic.forward.PCR_all_traffic = ATM_PCR_OC3C; - traffic.backward.PCR_all_traffic = ATM_PCR_OC3C; - break; - case MEDIA_OC12C: - traffic.forward.PCR_all_traffic = ATM_PCR_OC12C; - traffic.backward.PCR_all_traffic = ATM_PCR_OC12C; - break; - case MEDIA_UNKNOWN: - break; - } - - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_TRAFFIC, - (caddr_t)&traffic, sizeof(traffic)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Set bearer capability options - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_BEARER_CAP, - (caddr_t)&bearer, sizeof(bearer)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Set QOS options - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_QOS, - (caddr_t)&qos, sizeof(qos)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Set LLC identifier - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_LLC, - (caddr_t)&llc_scsp, sizeof(llc_scsp)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Set application name - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_APP_NAME, - (caddr_t)&appname, sizeof(appname)) < 0) { - rc = EOPNOTSUPP; - goto listen_fail; - } - - /* - * Listen for new connections - */ - if (listen(sd, 5) < 0) { - rc = errno; - goto listen_fail; - } - - ssp->ss_dcs_lsock = sd; - return(sd); - -listen_fail: - /* - * Close the socket if anything didn't work - */ - (void)close(sd); - if (rc == 0) - errno = EFAULT; - else - errno = rc; - ssp->ss_dcs_lsock = -1; - return(-1); -} - - -/* - * Accept a connection from a DCS - * - * Arguments: - * ssp pointer to server block - * - * Returns: - * address of DCS with new connection - * 0 failure (errno has reason) - * - */ -Scsp_dcs * -scsp_dcs_accept(ssp) - Scsp_server *ssp; -{ - int len, rc, sd; - struct sockaddr_atm dcs_sockaddr; - struct t_atm_sap_addr *dcs_addr = &dcs_sockaddr.satm_addr.t_atm_sap_addr; - Atm_addr dcs_atmaddr; - Scsp_dcs *dcsp; - - /* - * Accept the new connection - */ - len = sizeof(dcs_sockaddr); - sd = accept(ssp->ss_dcs_lsock, - (struct sockaddr *)&dcs_sockaddr, &len); - if (sd < 0) { - return((Scsp_dcs *)0); - } - if (sd > scsp_max_socket) { - scsp_max_socket = sd; - } - - /* - * Copy the DCS's address from the sockaddr to an Atm_addr - */ - if (dcs_addr->SVE_tag_addr != T_ATM_PRESENT) { - dcs_atmaddr.address_format = T_ATM_ABSENT; - dcs_atmaddr.address_length = 0; - } else { - dcs_atmaddr.address_format = dcs_addr->address_format; - dcs_atmaddr.address_length = dcs_addr->address_length; - bcopy(dcs_addr->address, dcs_atmaddr.address, - dcs_addr->address_length); - } - - /* - * Find out which DCS this connection is for - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = dcsp->sd_next) { - /* - * Compare DCS's address to address - * configured by user - */ - if (ATM_ADDR_EQUAL(&dcsp->sd_addr, - &dcs_atmaddr)) - break; - } - - /* - * Make sure we have this DCS configured - */ - if (!dcsp) { - errno = EINVAL; - goto dcs_accept_fail; - } - - /* - * Make sure we are in a state to accept the connection - */ - if (ssp->ss_state != SCSP_SS_ACTIVE) { - errno = EACCES; - goto dcs_accept_fail; - } - - /* - * Make sure we don't already have a connection to this DCS - */ - if (dcsp->sd_sock != -1) { - errno = EALREADY; - goto dcs_accept_fail; - } - - /* - * Set application name - */ - if (setsockopt(sd, T_ATM_SIGNALING, T_ATM_APP_NAME, - (caddr_t)&appname, sizeof(appname)) < 0) { - rc = EOPNOTSUPP; - goto dcs_accept_fail; - } - - /* - * Set non-blocking I/O - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - goto dcs_accept_fail; - } - - /* - * Cancel the open retry timer - */ - HARP_CANCEL(&dcsp->sd_open_t); - - /* - * Save the socket address and return the - * address of the DCS - */ - dcsp->sd_sock = sd; - return(dcsp); - -dcs_accept_fail: - /* - * An error has occured--clean up and return - */ - (void)close(sd); - return((Scsp_dcs *)0); -} - - -/* - * Read an SCSP message from a directly connected server - * - * Arguments: - * dcsp pointer to DCS block that has data - * - * Returns: - * 0 success - * else errno indicating reason for failure - * - */ -int -scsp_dcs_read(dcsp) - Scsp_dcs *dcsp; - -{ - int len, rc; - char *buff = (char *)0; - Scsp_server *ssp = dcsp->sd_server; - Scsp_msg *msg; - - /* - * Get a buffer to hold the entire message - */ - len = ssp->ss_mtu; - buff = calloc(1, len); - if (buff == NULL) - scsp_mem_err("scsp_dcs_read: ssp->ss_mtu"); - - /* - * Read the message - */ - len = read(dcsp->sd_sock, buff, len); - if (len < 0) { - goto dcs_read_fail; - } - - /* - * Parse the input message and pass it to the Hello FSM - */ - msg = scsp_parse_msg(buff, len); - if (msg) { - /* - * Write the message to the trace file if - * it's of a type we're tracing - */ - if (((scsp_trace_mode & SCSP_TRACE_HELLO_MSG) && - msg->sc_msg_type == SCSP_HELLO_MSG) || - ((scsp_trace_mode & SCSP_TRACE_CA_MSG) && - msg->sc_msg_type != SCSP_HELLO_MSG)) { - scsp_trace_msg(dcsp, msg, 1); - scsp_trace("\n"); - } - - /* - * Pass the message to the Hello FSM - */ - rc = scsp_hfsm(dcsp, SCSP_HFSM_RCVD, msg); - scsp_free_msg(msg); - } else { - /* - * Message was invalid. Write it to the trace file - * if we're tracing messages. - */ - if (scsp_trace_mode & (SCSP_TRACE_HELLO_MSG & - SCSP_TRACE_CA_MSG)) { - int i; - scsp_trace("Invalid message received:\n"); - scsp_trace("0x"); - for (i = 0; i < len; i++) { - scsp_trace("%02x ", (u_char)buff[i]); - } - scsp_trace("\n"); - } - } - free(buff); - - return(0); - -dcs_read_fail: - /* - * Error on read--check for special conditions - */ - rc = errno; - if (errno == ECONNRESET) { - /* - * VCC has been closed--pass the event to - * the Hello FSM - */ - rc = scsp_hfsm(dcsp, SCSP_HFSM_VC_CLOSED, - (Scsp_msg *)0); - } - if (errno == ECONNREFUSED) { - /* - * VCC open failed--set a timer and try - * again when it fires - */ - HARP_TIMER(&dcsp->sd_open_t, - SCSP_Open_Interval, - scsp_open_timeout); - rc = 0; - } - - if (buff) - free(buff); - return(rc); -} - - -/* - * Listen for Unix connections from SCSP client servers - * - * Arguments: - * None - * - * Returns: - * sock socket which is listening - * -1 error (reason in errno) - * - */ -int -scsp_server_listen() -{ - int rc, sd; - - static struct sockaddr scsp_addr = { -#if (defined(BSD) && (BSD >= 199103)) - sizeof(struct sockaddr), /* sa_len */ -#endif - AF_UNIX, /* sa_family */ - SCSPD_SOCK_NAME /* sa_data */ - }; - - /* - * Unlink any old socket - */ - rc = unlink(SCSPD_SOCK_NAME); - if (rc < 0 && errno != ENOENT) - return(-1); - - /* - * Open a socket - */ - sd = socket(PF_UNIX, SOCK_STREAM, 0); - if (sd == -1) { - return(-1); - } - if (sd > scsp_max_socket) { - scsp_max_socket = sd; - } - - /* - * Bind the socket's address - */ - rc = bind(sd, &scsp_addr, sizeof(scsp_addr)); - if (rc == -1) { - (void)close(sd); - return(-1); - } - - /* - * Set non-blocking I/O - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - (void)close(sd); - return(-1); - } - - /* - * Listen for new connections - */ - if (listen(sd, 5) < 0) { - (void)close(sd); - return(-1); - } - - return(sd); -} - - -/* - * Accept a connection from a server - * - * We accept a connection, but we won't know which server it is - * from until we get the configuration data from the server. We - * put the connection on a 'pending' queue and will assign it to - * a server when the config data arrives. - * - * Arguments: - * ls listening socket to accept from - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -scsp_server_accept(ls) - int ls; - -{ - int len, rc, sd; - struct sockaddr server_addr; - Scsp_pending *psp; - - /* - * Accept the new connection - */ - len = sizeof(server_addr); - sd = accept(ls, (struct sockaddr *)&server_addr, &len); - if (sd < 0) { - return(errno); - } - if (sd > scsp_max_socket) { - scsp_max_socket = sd; - } - - /* - * Set non-blocking operation - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - (void)close(sd); - rc = errno; - } - - /* - * Put the new socket on the 'pending' queue - */ - psp = calloc(1, sizeof(Scsp_pending)); - if (!psp) - scsp_mem_err("scsp_server_accept: sizeof(Scsp_pending)"); - psp->sp_sock = sd; - LINK2TAIL(psp, Scsp_pending, scsp_pending_head, sp_next); - - return(0); -} - - -/* - * Read a server interface message from a socket - * - * Arguments: - * sd socket to read from - * - * Returns: - * msg pointer to message read - * 0 failure (errno has reason) - * - */ -Scsp_if_msg * -scsp_if_sock_read(sd) - int sd; - -{ - int len; - char *buff = (char *)0; - Scsp_if_msg *msg; - Scsp_if_msg_hdr msg_hdr; - - /* - * Read the message header from the socket - */ - len = read(sd, (char *)&msg_hdr, sizeof(msg_hdr)); - if (len != sizeof(msg_hdr)) { - if (len >= 0) - errno = EINVAL; - goto socket_read_fail; - } - - /* - * Get a buffer and read the rest of the message into it - */ - buff = malloc(msg_hdr.sh_len); - if (buff == NULL) - scsp_mem_err("scsp_if_sock_read: msg_hdr.sh_len"); - msg = (Scsp_if_msg *)buff; - msg->si_hdr = msg_hdr; - len = read(sd, &buff[sizeof(Scsp_if_msg_hdr)], - msg->si_len - sizeof(Scsp_if_msg_hdr)); - if (len != msg->si_len - sizeof(Scsp_if_msg_hdr)) { - if (len >= 0) { - errno = EINVAL; - } - goto socket_read_fail; - } - - /* - * Trace the message - */ - if (scsp_trace_mode & SCSP_TRACE_IF_MSG) { - scsp_trace("Received server I/F message:\n"); - print_scsp_if_msg(scsp_trace_file, msg); - scsp_trace("\n"); - } - - return(msg); - -socket_read_fail: - if (buff) - free(buff); - return((Scsp_if_msg *)0); -} - - -/* - * Write a server interface message to a socket - * - * Arguments: - * sd socket to write to - * msg pointer to message to write - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -scsp_if_sock_write(sd, msg) - int sd; - Scsp_if_msg *msg; -{ - int len, rc; - - /* - * Trace the message - */ - if (scsp_trace_mode & SCSP_TRACE_IF_MSG) { - scsp_trace("Writing server I/F message:\n"); - print_scsp_if_msg(scsp_trace_file, msg); - scsp_trace("\n"); - } - - /* - * Write the message to the indicated socket - */ - len = write(sd, (char *)msg, msg->si_len); - if (len != msg->si_len) { - if (len < 0) - rc = errno; - else - rc = EINVAL; - } else { - rc = 0; - } - - return(rc); -} - - -/* - * Read data from a local server - * - * Arguments: - * ssp pointer to server block that has data - * - * Returns: - * 0 success - * else errno indicating reason for failure - * - */ -int -scsp_server_read(ssp) - Scsp_server *ssp; -{ - int rc; - Scsp_dcs *dcsp; - Scsp_if_msg *msg; - - /* - * Read the message - */ - msg = scsp_if_sock_read(ssp->ss_sock); - if (!msg) { - if (errno == EWOULDBLOCK) { - /* - * Nothing to read--just return - */ - return(0); - } else { - /* - * Error--shut down the server entry - */ - scsp_server_shutdown(ssp); - } - return(errno); - } - - /* - * Process the received message - */ - switch(msg->si_type) { - case SCSP_NOP_REQ: - /* - * Ignore a NOP - */ - break; - case SCSP_CACHE_RSP: - /* - * Summarize the server's cache and try to open - * connections to all of its DCSs - */ - scsp_process_cache_rsp(ssp, msg); - ssp->ss_state = SCSP_SS_ACTIVE; - for (dcsp = ssp->ss_dcs; dcsp; dcsp = dcsp->sd_next) { - if (scsp_dcs_connect(dcsp)) { - /* - * Connect failed -- the DCS may not - * be up yet, so we'll try again later - */ - HARP_TIMER(&dcsp->sd_open_t, - SCSP_Open_Interval, - scsp_open_timeout); - } - } - ssp->ss_state = SCSP_SS_ACTIVE; - break; - case SCSP_SOLICIT_RSP: - /* - * The server has answered our request for a particular - * entry from its cache - */ - dcsp = (Scsp_dcs *)msg->si_tok; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_SOL_RSP, (Scsp_msg *)0, - msg); - break; - case SCSP_UPDATE_REQ: - /* - * Pass the update request to the FSMs for all - * DCSs associated with the server - */ - if (ssp->ss_state == SCSP_SS_ACTIVE) { - for (dcsp = ssp->ss_dcs; dcsp; - dcsp = dcsp->sd_next) { - rc = scsp_cfsm(dcsp, SCSP_CIFSM_UPD_REQ, - (Scsp_msg *)0, msg); - } - } - break; - case SCSP_UPDATE_RSP: - /* - * Pass the update response to the FSM for the - * DCS associated with the request - */ - dcsp = (Scsp_dcs *)msg->si_tok; - rc = scsp_cfsm(dcsp, SCSP_CIFSM_UPD_RSP, - (Scsp_msg *)0, msg); - break; - default: - scsp_log(LOG_ERR, "invalid message type %d from server", - msg->si_type); - return(EINVAL); - } - - free(msg); - return(0); -} - - -/* - * Send a Cache Indication to a server - * - * Arguments: - * ssp pointer to server block block - * - * Returns: - * 0 success - * else errno indicating reason for failure - * - */ -int -scsp_send_cache_ind(ssp) - Scsp_server *ssp; -{ - int rc; - Scsp_if_msg *msg; - - /* - * Get storage for a server interface message - */ - msg = calloc(1, sizeof(Scsp_if_msg)); - if (msg == NULL) - scsp_mem_err("scsp_send_cache_ind: sizeof(Scsp_if_msg)"); - /* - * Fill out the message - */ - msg->si_type = SCSP_CACHE_IND; - msg->si_proto = ssp->ss_pid; - msg->si_len = sizeof(Scsp_if_msg_hdr); - msg->si_tok = (u_long)ssp; - - /* - * Send the message - */ - rc = scsp_if_sock_write(ssp->ss_sock, msg); - free(msg); - return(rc); -} - - -/* - * Read data from a pending server connection - * - * Arguments: - * psp pointer to pending block that has data - * - * Returns: - * 0 success - * else errno indicating reason for failure - * - */ -int -scsp_pending_read(psp) - Scsp_pending *psp; - -{ - int rc; - Scsp_server *ssp; - Scsp_if_msg *msg; - - /* - * Read the message from the pending socket - */ - msg = scsp_if_sock_read(psp->sp_sock); - if (!msg) { - rc = errno; - goto pending_read_fail; - } - - /* - * Make sure this is configuration data - */ - if (msg->si_type != SCSP_CFG_REQ) { - scsp_log(LOG_ERR, "invalid message type %d from pending server", - msg->si_type); - rc = EINVAL; - goto pending_read_fail; - } - - /* - * Find the server this message is for - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - if (strcmp(ssp->ss_intf, msg->si_cfg.atmarp_netif) == 0) - break; - } - if (!ssp) { - scsp_log(LOG_ERR, "refused connection from server for %s", - msg->si_cfg.atmarp_netif); - rc = EINVAL; - goto config_reject; - } - - /* - * Make sure the server is ready to go - */ - rc = scsp_get_server_info(ssp); - if (rc) { - goto config_reject; - } - - /* - * Save the socket - */ - ssp->ss_sock = psp->sp_sock; - ssp->ss_state = SCSP_SS_CFG; - UNLINK(psp, Scsp_pending, scsp_pending_head, sp_next); - free(psp); - - /* - * Listen for connections from the server's DCSs - */ - rc = scsp_dcs_listen(ssp); - if (rc < 0) { - rc = errno; - goto config_reject; - } - - /* - * Respond to the configuration message - */ - msg->si_type = SCSP_CFG_RSP; - msg->si_rc = SCSP_RSP_OK; - msg->si_len = sizeof(Scsp_if_msg_hdr); - rc = scsp_if_sock_write(ssp->ss_sock, msg); - if (rc) { - goto config_error;; - } - - /* - * Ask the server to send us its cache - */ - rc = scsp_send_cache_ind(ssp); - if (rc) { - goto config_error; - } - - free(msg); - return(0); - -config_reject: - /* - * Respond to the configuration message - */ - msg->si_type = SCSP_CFG_RSP; - msg->si_rc = SCSP_RSP_REJ; - msg->si_len = sizeof(Scsp_if_msg_hdr); - (void)scsp_if_sock_write(ssp->ss_sock, msg); - -config_error: - if (ssp->ss_sock != -1) { - (void)close(ssp->ss_sock); - ssp->ss_sock = -1; - } - if (ssp->ss_dcs_lsock != -1) { - (void)close(ssp->ss_dcs_lsock); - ssp->ss_sock = -1; - } - ssp->ss_state = SCSP_SS_NULL; - free(msg); - - return(rc); - -pending_read_fail: - /* - * Close the socket and free the pending read block - */ - (void)close(psp->sp_sock); - UNLINK(psp, Scsp_pending, scsp_pending_head, sp_next); - free(psp); - if (msg) - free(msg); - return(rc); -} Property changes on: head/usr.sbin/atm/scspd/scsp_socket.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_input.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_input.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_input.c (nonexistent) @@ -1,1088 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Input packet processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -static int scsp_parse_atmarp(char *, int, Scsp_atmarp_csa **); - - -/* - * Get a long ingeter - * - * This routine is provided to handle long integers that may not - * be word-aligned in the input buffer. - * - * Arguments: - * cp pointer to long int in message - * - * Returns: - * int long int in host order - * - */ -static u_long -get_long(cp) - u_char *cp; -{ - int i; - u_long l; - - /* - * Read the long out of the input buffer - */ - l = 0; - for (i = 0; i < sizeof(u_long); i++) - l = (l << 8) + *cp++; - - /* - * Return the value in host order - */ - return(l); -} - - -/* - * Free an SCSP Cache Alignment message in internal format - * - * Arguments: - * cap pointer to CA message - * - * Returns: - * None - * - */ -static void -scsp_free_ca(cap) - Scsp_ca *cap; -{ - Scsp_csa *csap, *ncsap; - - /* - * Return if there's nothing to free - */ - if (cap == (Scsp_ca *)0) - return; - - /* - * Free the CSAS records - */ - for (csap = cap->ca_csa_rec; csap; csap = ncsap) { - ncsap = csap->next; - SCSP_FREE_CSA(csap); - } - /* - * Free the CA message structure - */ - free(cap); -} - - -/* - * Free an SCSP Cache State Update Request, Cache State Update Reply, - * or Cache State Update Solicit message in internal format - * - * Arguments: - * csup pointer to CSU message - * - * Returns: - * None - * - */ -static void -scsp_free_csu(csup) - Scsp_csu_msg *csup; -{ - Scsp_csa *csap, *ncsap; - - /* - * Return if there's nothing to free - */ - if (csup == (Scsp_csu_msg *)0) - return; - - /* - * Free the CSA records - */ - for (csap = csup->csu_csa_rec; csap; csap = ncsap) { - ncsap = csap->next; - SCSP_FREE_CSA(csap); - } - - /* - * Free the CSU message structure - */ - free(csup); -} - - -/* - * Free an SCSP Hello message in internal format - * - * Arguments: - * hp pointer to Hello message - * - * Returns: - * None - * - */ -static void -scsp_free_hello(hp) - Scsp_hello *hp; -{ - /* - * Return if there's nothing to free - */ - if (hp == (Scsp_hello *)0) - return; - - /* - * Free the Hello message structure - */ - free(hp); -} - - -/* - * Free an SCSP message in internal format - * - * Arguments: - * msg pointer to input packet - * - * Returns: - * None - * - */ -void -scsp_free_msg(msg) - Scsp_msg *msg; -{ - Scsp_ext *exp, *nexp; - - /* - * Return if there's nothing to free - */ - if (msg == (Scsp_msg *)0) - return; - - /* - * Free the message body - */ - switch(msg->sc_msg_type) { - case SCSP_CA_MSG: - scsp_free_ca(msg->sc_ca); - break; - case SCSP_CSU_REQ_MSG: - case SCSP_CSU_REPLY_MSG: - case SCSP_CSUS_MSG: - scsp_free_csu(msg->sc_csu_msg); - break; - case SCSP_HELLO_MSG: - scsp_free_hello(msg->sc_hello); - break; - } - - /* - * Free any extensions - */ - for (exp = msg->sc_ext; exp; exp = nexp) { - nexp = exp->next; - free(exp); - } - - /* - * Free the message structure - */ - free(msg); -} - - -/* - * Parse a Sender or Receiver ID - * - * Arguments: - * buff pointer to ID - * id_len length of ID - * idp pointer to structure to receive the ID - * - * Returns: - * 0 input was invalid - * else length of ID processed - * - */ -static int -scsp_parse_id(buff, id_len, idp) - char *buff; - int id_len; - Scsp_id *idp; -{ - /* - * Sanity check - */ - if (!buff || - id_len == 0 || id_len > SCSP_MAX_ID_LEN || - !idp) { - return(0); - } - - /* - * Save the ID length - */ - idp->id_len = id_len; - - /* - * Get the ID - */ - bcopy(buff, idp->id, id_len); - - /* - * Return the ID length - */ - return(id_len); -} - - -/* - * Parse the Mandatory Common Part of an SCSP input packet - * - * Arguments: - * buff pointer to mandatory common part - * pdu_len length of input packet - * mcp pointer to location of MCP in decoded record - * - * Returns: - * 0 input was invalid - * else length of MCP in message - * - */ -static int -scsp_parse_mcp(buff, pdu_len, mcp) - char *buff; - int pdu_len; - Scsp_mcp *mcp; -{ - int len; - u_char *idp; - struct scsp_nmcp *smp; - - /* - * Get the protocol ID - */ - smp = (struct scsp_nmcp *)buff; - mcp->pid = ntohs(smp->sm_pid); - if (mcp->pid < SCSP_PROTO_ATMARP || - mcp->pid > SCSP_PROTO_LNNI) { - /* Protocol ID is invalid */ - goto mcp_invalid; - } - - /* - * Get the server group ID - */ - mcp->sgid = ntohs(smp->sm_sgid); - - /* - * Get the flags - */ - mcp->flags = ntohs(smp->sm_flags); - - /* - * Get the sender ID and length - */ - idp = (u_char *) ((caddr_t)smp + sizeof(struct scsp_nmcp)); - len = scsp_parse_id(idp, smp->sm_sid_len, &mcp->sid); - if (len == 0) { - goto mcp_invalid; - } - - /* - * Get the receiver ID and length - */ - idp += len; - len = scsp_parse_id(idp, smp->sm_rid_len, &mcp->rid); - if (len == 0) { - goto mcp_invalid; - } - - /* - * Get the record count - */ - mcp->rec_cnt = ntohs(smp->sm_rec_cnt); - - /* - * Return the length of data we processed - */ - return(sizeof(struct scsp_nmcp) + smp->sm_sid_len + - smp->sm_rid_len); - -mcp_invalid: - return(0); -} - - -/* - * Parse an Extension - * - * Arguments: - * buff pointer to Extension - * pdu_len length of buffer - * expp pointer to location to receive pointer to the Extension - * - * Returns: - * 0 input was invalid - * else length of Extension processed - * - */ -static int -scsp_parse_ext(buff, pdu_len, expp) - char *buff; - int pdu_len; - Scsp_ext **expp; -{ - int len; - struct scsp_next *sep; - Scsp_ext *exp; - - /* - * Get memory for the extension - */ - sep = (struct scsp_next *)buff; - len = sizeof(Scsp_ext) + ntohs(sep->se_len); - exp = calloc(1, len); - if (exp == NULL) - goto ext_invalid; - - /* - * Get the type - */ - exp->type = ntohs(sep->se_type); - - /* - * Get the length - */ - exp->len = ntohs(sep->se_len); - - /* - * Get the value - */ - if (exp->len > 0) { - bcopy((caddr_t)sep + sizeof(struct scsp_next), - (caddr_t)exp + sizeof(Scsp_ext), - exp->len); - } - - /* - * Save a pointer to the extension and return the - * number of bytes processed - */ - *expp = exp; - return(sizeof(struct scsp_next) + exp->len); - -ext_invalid: - if (exp) { - free(exp); - } - return(0); -} - - -/* - * Parse a Cache State Advertisement or Cache State Advertisement - * Summary record - * - * Arguments: - * buff pointer to CSA or CSAS record - * pdu_len length of input packet - * csapp pointer to location to put pointer to CSA or CSAS - * - * Returns: - * 0 input was invalid - * else length of record processed - * - */ -static int -scsp_parse_csa(buff, pdu_len, csapp) - char *buff; - int pdu_len; - Scsp_csa **csapp; -{ - int len; - char *idp; - struct scsp_ncsa *scp; - Scsp_csa *csap = NULL; - - /* - * Check the record length - */ - scp = (struct scsp_ncsa *)buff; - if (ntohs(scp->scs_len) < (sizeof(struct scsp_ncsa) + - scp->scs_ck_len + scp->scs_oid_len)) { - goto csa_invalid; - } - - /* - * Get memory for the returned structure - */ - len = sizeof(Scsp_csa) + ntohs(scp->scs_len) - - sizeof(struct scsp_ncsa) - scp->scs_ck_len - - scp->scs_oid_len; - csap = calloc(1, len); - if (csap == NULL) - goto csa_invalid; - - /* - * Get the hop count - */ - csap->hops = ntohs(scp->scs_hop_cnt); - - /* - * Set the null flag - */ - csap->null = (ntohs(scp->scs_nfill) & SCSP_CSAS_NULL) != 0; - - /* - * Get the sequence number - */ - csap->seq = get_long((u_char *)&scp->scs_seq); - - /* - * Get the cache key - */ - if (scp->scs_ck_len == 0 || - scp->scs_ck_len > SCSP_MAX_KEY_LEN) { - goto csa_invalid; - } - csap->key.key_len = scp->scs_ck_len; - idp = (char *) ((caddr_t)scp + sizeof(struct scsp_ncsa)); - bcopy(idp, csap->key.key, scp->scs_ck_len); - - /* - * Get the originator ID - */ - idp += scp->scs_ck_len; - len = scsp_parse_id(idp, scp->scs_oid_len, &csap->oid); - if (len == 0) { - goto csa_invalid; - } - - /* - * Get the protocol-specific data, if present - */ - len = ntohs(scp->scs_len) - (sizeof(struct scsp_ncsa) + - scp->scs_ck_len + scp->scs_oid_len); - if (len > 0) { - idp += scp->scs_oid_len; - len = scsp_parse_atmarp(idp, len, &csap->atmarp_data); - if (len == 0) - goto csa_invalid; - } - - /* - * Set a pointer to the MCP and return the length - * of data we processed - */ - *csapp = csap; - return(ntohs(scp->scs_len)); - -csa_invalid: - if (csap) - SCSP_FREE_CSA(csap); - return(0); -} - - -/* - * Parse a Cache Alignment message - * - * Arguments: - * buff pointer to start of CA in message - * pdu_len length of input packet - * capp pointer to location to put pointer to CA message - * - * Returns: - * 0 input was invalid - * else length of CA message processed - * - */ -static int -scsp_parse_ca(buff, pdu_len, capp) - char *buff; - int pdu_len; - Scsp_ca **capp; -{ - int i, len, proc_len; - struct scsp_nca *scap; - Scsp_ca *cap; - Scsp_csa **csapp; - - /* - * Get memory for the returned structure - */ - scap = (struct scsp_nca *)buff; - cap = calloc(1, sizeof(Scsp_ca)); - if (cap == NULL) - goto ca_invalid; - - /* - * Get the sequence number - */ - cap->ca_seq = get_long((u_char *)&scap->sca_seq); - proc_len = sizeof(scap->sca_seq); - buff += sizeof(scap->sca_seq); - - /* - * Process the mandatory common part of the message - */ - len = scsp_parse_mcp(buff, - pdu_len - proc_len, - &cap->ca_mcp); - if (len == 0) - goto ca_invalid; - buff += len; - proc_len += len; - - /* - * Set the flags - */ - cap->ca_m = (cap->ca_mcp.flags & SCSP_CA_M) != 0; - cap->ca_i = (cap->ca_mcp.flags & SCSP_CA_I) != 0; - cap->ca_o = (cap->ca_mcp.flags & SCSP_CA_O) != 0; - - /* - * Get the CSAS records from the message - */ - for (i = 0, csapp = &cap->ca_csa_rec; i < cap->ca_mcp.rec_cnt; - i++, csapp = &(*csapp)->next) { - len = scsp_parse_csa(buff, pdu_len - proc_len, csapp); - buff += len; - proc_len += len; - } - - /* - * Set the address of the CA message and - * return the length of processed data - */ - *capp = cap; - return(proc_len); - -ca_invalid: - if (cap) - scsp_free_ca(cap); - return(0); -} - - -/* - * Parse the ATMARP-specific part of a CSA record - * - * Arguments: - * buff pointer to ATMARP part of CSU message - * pdu_len length of data to process - * acspp pointer to location to put pointer to CSU message - * - * Returns: - * 0 input was invalid - * else length of CSU Req message processed - * - */ -static int -scsp_parse_atmarp(buff, pdu_len, acspp) - char *buff; - int pdu_len; - Scsp_atmarp_csa **acspp; -{ - int len, proc_len; - struct scsp_atmarp_ncsa *sacp; - Scsp_atmarp_csa *acsp = NULL; - - /* - * Initial packet verification - */ - sacp = (struct scsp_atmarp_ncsa *)buff; - if ((sacp->sa_hrd != ntohs(ARP_ATMFORUM)) || - (sacp->sa_pro != ntohs(ETHERTYPE_IP))) - goto acs_invalid; - - /* - * Get memory for the returned structure - */ - acsp = calloc(1, sizeof(Scsp_atmarp_csa)); - if (acsp == NULL) - goto acs_invalid; - - /* - * Get state code - */ - acsp->sa_state = sacp->sa_state; - proc_len = sizeof(struct scsp_atmarp_ncsa); - - /* - * Verify/gather source ATM address - */ - acsp->sa_sha.address_format = T_ATM_ABSENT; - acsp->sa_sha.address_length = 0; - if ((len = (sacp->sa_shtl & ARP_TL_LMASK)) != 0) { - if (sacp->sa_shtl & ARP_TL_E164) { - if (len > sizeof(Atm_addr_e164)) - goto acs_invalid; - acsp->sa_sha.address_format = T_ATM_E164_ADDR; - } else { - if (len != sizeof(Atm_addr_nsap)) - goto acs_invalid; - acsp->sa_sha.address_format = T_ATM_ENDSYS_ADDR; - } - acsp->sa_sha.address_length = len; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)acsp->sa_sha.address, - len); - proc_len += len; - } - - /* - * Verify/gather source ATM subaddress - */ - acsp->sa_ssa.address_format = T_ATM_ABSENT; - acsp->sa_ssa.address_length = 0; - if ((len = (sacp->sa_sstl & ARP_TL_LMASK)) != 0) { - if (((sacp->sa_sstl & ARP_TL_TMASK) != ARP_TL_NSAPA) || - (len != sizeof(Atm_addr_nsap))) - goto acs_invalid; - acsp->sa_ssa.address_format = T_ATM_ENDSYS_ADDR; - acsp->sa_ssa.address_length = len; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)acsp->sa_ssa.address, - len); - proc_len += len; - } - - /* - * Verify/gather source IP address - */ - if ((len = sacp->sa_spln) != 0) { - if (len != sizeof(struct in_addr)) - goto acs_invalid; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)&acsp->sa_spa, len); - proc_len += len; - } else { - acsp->sa_spa.s_addr = 0; - } - - /* - * Verify/gather target ATM address - */ - acsp->sa_tha.address_format = T_ATM_ABSENT; - acsp->sa_tha.address_length = 0; - if ((len = (sacp->sa_thtl & ARP_TL_LMASK)) != 0) { - if (sacp->sa_thtl & ARP_TL_E164) { - if (len > sizeof(Atm_addr_e164)) - goto acs_invalid; - acsp->sa_tha.address_format = T_ATM_E164_ADDR; - } else { - if (len != sizeof(Atm_addr_nsap)) - goto acs_invalid; - acsp->sa_tha.address_format = T_ATM_ENDSYS_ADDR; - } - acsp->sa_tha.address_length = len; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)acsp->sa_tha.address, - len); - proc_len += len; - } - - /* - * Verify/gather target ATM subaddress - */ - acsp->sa_tsa.address_format = T_ATM_ABSENT; - acsp->sa_tsa.address_length = 0; - if ((len = (sacp->sa_tstl & ARP_TL_LMASK)) != 0) { - if (((sacp->sa_tstl & ARP_TL_TMASK) != ARP_TL_NSAPA) || - (len != sizeof(Atm_addr_nsap))) - goto acs_invalid; - acsp->sa_tsa.address_format = T_ATM_ENDSYS_ADDR; - acsp->sa_tsa.address_length = len; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)acsp->sa_tsa.address, - len); - proc_len += len; - } - - /* - * Verify/gather target IP address - */ - if ((len = sacp->sa_tpln) != 0) { - if (len != sizeof(struct in_addr)) - goto acs_invalid; - if (pdu_len < proc_len + len) - goto acs_invalid; - bcopy(&buff[proc_len], (char *)&acsp->sa_tpa, len); - proc_len += len; - } else { - acsp->sa_tpa.s_addr = 0; - } - - /* - * Verify packet length - */ - if (proc_len != pdu_len) - goto acs_invalid; - - *acspp = acsp; - return(proc_len); - -acs_invalid: - if (acsp) - free(acsp); - return(0); -} - - -/* - * Parse a Cache State Update Request, Cache State Update Reply, or - * Cache State Update Solicit message. These all have the same format, - * a Mandatory Common Part followed by a number of CSA or CSAS records. - * - * Arguments: - * buff pointer to start of CSU message - * pdu_len length of input packet - * csupp pointer to location to put pointer to CSU message - * - * Returns: - * 0 input was invalid - * else length of CSU Req message processed - * - */ -static int -scsp_parse_csu(buff, pdu_len, csupp) - char *buff; - int pdu_len; - Scsp_csu_msg **csupp; -{ - int i, len, proc_len; - Scsp_csu_msg *csup; - Scsp_csa **csapp; - - /* - * Get memory for the returned structure - */ - csup = calloc(1, sizeof(Scsp_csu_msg)); - if (csup == NULL) - goto csu_invalid; - - /* - * Process the mandatory common part of the message - */ - len = scsp_parse_mcp(buff, pdu_len, &csup->csu_mcp); - if (len == 0) - goto csu_invalid; - buff += len; - proc_len = len; - - /* - * Get the CSAS records from the message - */ - for (i = 0, csapp = &csup->csu_csa_rec; - i < csup->csu_mcp.rec_cnt; - i++, csapp = &(*csapp)->next) { - len = scsp_parse_csa(buff, pdu_len - proc_len, csapp); - buff += len; - proc_len += len; - } - - /* - * Set the address of the CSU Req message and - * return the length of processed data - */ - *csupp = csup; - return(proc_len); - -csu_invalid: - if (csup) - scsp_free_csu(csup); - return(0); -} - - -/* - * Parse a Hello message - * - * Arguments: - * buff pointer to start of Hello in message - * pdu_len length of input packet - * hpp pointer to location to put pointer to Hello message - * - * Returns: - * 0 input was invalid - * else length of Hello message processed - * - */ -static int -scsp_parse_hello(buff, pdu_len, hpp) - char *buff; - int pdu_len; - Scsp_hello **hpp; -{ - int i, len, proc_len; - struct scsp_nhello *shp = (struct scsp_nhello *)buff; - Scsp_hello *hp; - Scsp_id *idp; - Scsp_id **ridpp; - - /* - * Get memory for the returned structure - */ - hp = calloc(1, sizeof(Scsp_hello)); - if (hp == NULL) - goto hello_invalid; - - /* - * Get the hello interval - */ - hp->hello_int = ntohs(shp->sch_hi); - - /* - * Get the dead factor - */ - hp->dead_factor = ntohs(shp->sch_df); - - /* - * Get the family ID - */ - hp->family_id = ntohs(shp->sch_fid); - - /* - * Process the mandatory common part of the message - */ - proc_len = sizeof(struct scsp_nhello) - - sizeof(struct scsp_nmcp); - buff += proc_len; - len = scsp_parse_mcp(buff, pdu_len - proc_len, - &hp->hello_mcp); - if (len == 0) - goto hello_invalid; - buff += len; - proc_len += len; - - /* - * Get additional receiver ID records from the message - */ - for (i = 0, ridpp = &hp->hello_mcp.rid.next; - i < hp->hello_mcp.rec_cnt; - i++, ridpp = &idp->next) { - idp = calloc(1, sizeof(Scsp_id)); - if (idp == NULL) - goto hello_invalid; - len = scsp_parse_id(buff, - hp->hello_mcp.rid.id_len, - idp); - if (len == 0) { - free(idp); - goto hello_invalid; - } - buff += len; - proc_len += len; - *ridpp = idp; - } - - /* - * Set the address of the CA message and - * return the length of processed data - */ - *hpp = hp; - return(proc_len); - -hello_invalid: - if (hp) - scsp_free_hello(hp); - return(0); -} - - -/* - * Parse an SCSP input packet - * - * Arguments: - * buff pointer to input packet - * pdu_len length of input packet - * - * Returns: - * NULL input packet was invalid - * else pointer to packet in internal format - * - */ -Scsp_msg * -scsp_parse_msg(buff, pdu_len) - char *buff; - int pdu_len; -{ - int ext_off, len, plen; - struct scsp_nhdr *shp; - Scsp_msg *msg = (Scsp_msg *)0; - Scsp_ext **expp; - - /* - * Check the message checksum - */ - if (ip_checksum(buff, pdu_len) != 0) { - /* - * Checksum was bad--discard the message - */ - goto ignore; - } - - /* - * Allocate storage for the message - */ - msg = calloc(1, sizeof(Scsp_msg)); - if (msg == NULL) - goto ignore; - - /* - * Decode the fixed header - * - * Check the version - */ - shp = (struct scsp_nhdr *)buff; - if (shp->sh_ver != SCSP_VER_1) - goto ignore; - - /* - * Get the message type - */ - msg->sc_msg_type = shp->sh_type; - - /* - * Get and check the length - */ - len = ntohs(shp->sh_len); - if (len != pdu_len) - goto ignore; - - /* - * Get the extension offset - */ - ext_off = ntohs(shp->sh_ext_off); - - /* - * Decode the body of the message, depending on the type - */ - buff += sizeof(struct scsp_nhdr); - len -= sizeof(struct scsp_nhdr); - switch(msg->sc_msg_type) { - case SCSP_CA_MSG: - plen = scsp_parse_ca(buff, len, &msg->sc_ca); - break; - case SCSP_CSU_REQ_MSG: - case SCSP_CSU_REPLY_MSG: - case SCSP_CSUS_MSG: - plen = scsp_parse_csu(buff, len, &msg->sc_csu_msg); - break; - case SCSP_HELLO_MSG: - plen = scsp_parse_hello(buff, len, &msg->sc_hello); - break; - default: - goto ignore; - } - if (plen == 0) { - goto ignore; - } - buff += plen; - len -= plen; - - /* - * Decode any extensions - */ - if (ext_off != 0) { - for (expp = &msg->sc_ext; len > 0; - expp = &(*expp)->next) { - plen = scsp_parse_ext(buff, len, expp); - if (plen == 0) { - goto ignore; - } - buff += plen; - len -= plen; - } - } - - /* - * Make sure we handled the whole message - */ - if (len != 0) { - goto ignore; - } - - /* - * Return the address of the SCSP message in internal format - */ - return(msg); - -ignore: - if (msg) - scsp_free_msg(msg); - return(Scsp_msg *)0; -} Property changes on: head/usr.sbin/atm/scspd/scsp_input.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_config_parse.y =================================================================== --- head/usr.sbin/atm/scspd/scsp_config_parse.y (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_config_parse.y (nonexistent) @@ -1,412 +0,0 @@ -%{ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * YACC input for configuration file processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#if __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -void yyerror(char *); -%} - - -/* - * Token value definition - */ -%union { - char *tv_alpha; - int tv_int; - char *tv_hex; -} - - -/* - * Token types returned by scanner - */ -%token TOK_NAME -%token TOK_INTEGER -%token TOK_HEX - -/* - * Reserved words - */ -%token TOK_ATMARP -%token TOK_DCS -%token TOK_DCS_ADDR -%token TOK_DCS_CA_REXMIT_INT -%token TOK_DCS_CSUS_REXMIT_INT -%token TOK_DCS_CSU_REXMIT_INT -%token TOK_DCS_CSU_REXMIT_MAX -%token TOK_DCS_HELLO_DF -%token TOK_DCS_HELLO_INT -%token TOK_DCS_HOP_CNT -%token TOK_DCS_ID -%token TOK_DHCP -%token TOK_FAMILY -%token TOK_LFN -%token TOK_LNNI -%token TOK_LOG -%token TOK_MARS -%token TOK_NETIF -%token TOK_NHRP -%token TOK_PROTOCOL -%token TOK_SERVER -%token TOK_SRVGRP -%token TOK_SYSLOG - - -%% -cfg_file: /* Empty */ - | stmt_seq - -stmt_seq: stmt - | stmt_seq stmt - ; - -stmt: server_stmt ';' - | log_stmt ';' - ; - -/* - * SCSP server definition statements - */ -server_stmt: TOK_SERVER TOK_NAME - { - int rc; - - rc = start_server($2); - free($2); - if (rc) - return(rc); - } - '{' server_def '}' - { - int rc; - - rc = finish_server(); - if (rc) - return(rc); - } - ; - -server_def: server_spec ';' - | server_def server_spec ';' - ; - -server_spec: /* Nothing */ - | dcs_stmt - | TOK_NETIF TOK_NAME - { - int rc; - - /* - * Configure the network interface - */ - rc = set_intf($2); - free($2); - if (rc) - return(rc); - } - | TOK_PROTOCOL TOK_ATMARP - { - int rc; - - /* - * Configure the protocol - */ - rc = set_protocol(SCSP_PROTO_ATMARP); - if (rc) - return(rc); - } - | TOK_PROTOCOL TOK_DHCP | TOK_LNNI | TOK_MARS | TOK_NHRP - { - yyerror("Protocol not implemented"); - return(1); - } - | TOK_SRVGRP TOK_INTEGER - { - int rc; - - /* - * Configure the SCSP server group ID - */ - rc = set_server_group($2); - if (rc) - return(rc); - } - ; - -/* - * SCSP DCS definition statements - */ -dcs_stmt: TOK_DCS - { - int rc; - - rc = start_dcs(); - if (rc) - return(rc); - } - '{' dcs_def '}' - { - int rc; - - rc = finish_dcs(); - if (rc) - return(rc); - } - ; - -dcs_def: dcs_spec ';' - | dcs_def dcs_spec ';' - ; - -dcs_spec: /* Nothing */ - | TOK_DCS_ADDR TOK_HEX - { - int rc; - - /* - * Set DCS address - */ - rc = set_dcs_addr($2, (char *)0); - free($2); - if (rc) - return(rc); - } - | TOK_DCS_ADDR TOK_HEX TOK_HEX - { - int rc; - - /* - * Set DCS address and subaddress - */ - rc = set_dcs_addr($2, $3); - free($2); - free($3); - if (rc) - return(rc); - } - | TOK_DCS_CA_REXMIT_INT TOK_INTEGER - { - int rc; - - /* - * Configure the CA retransmit interval - */ - rc = set_dcs_ca_rexmit($2); - if (rc) - return(rc); - } - | TOK_DCS_CSUS_REXMIT_INT TOK_INTEGER - { - int rc; - - /* - * Configure the CSUS retransmit interval - */ - rc = set_dcs_csus_rexmit($2); - if (rc) - return(rc); - } - | TOK_DCS_CSU_REXMIT_INT TOK_INTEGER - { - int rc; - - /* - * Configure the CSU retransmit interval - */ - rc = set_dcs_csu_rexmit($2); - if (rc) - return(rc); - } - | TOK_DCS_CSU_REXMIT_MAX TOK_INTEGER - { - int rc; - - /* - * Configure the CSU retransmit limit - */ - rc = set_dcs_csu_rexmit_max($2); - if (rc) - return(rc); - } - | TOK_DCS_HELLO_DF TOK_INTEGER - { - int rc; - - /* - * Configure the Hello dead factor - */ - rc = set_dcs_hello_df($2); - if (rc) - return(rc); - } - | TOK_DCS_HELLO_INT TOK_INTEGER - { - int rc; - - /* - * Configure the Hello interval - */ - rc = set_dcs_hello_int($2); - if (rc) - return(rc); - } - | TOK_DCS_HOP_CNT TOK_INTEGER - { - int rc; - - /* - * Configure the hop count - */ - rc = set_dcs_hops($2); - if (rc) - return(rc); - } - | TOK_DCS_ID TOK_NAME - { - int rc; - - /* - * Configure the DCS ID - */ - rc = set_dcs_id($2); - free($2); - if (rc) - return(rc); - } - ; - - -/* - * Logging option statements - */ -log_stmt: TOK_LOG - '{' log_spec '}' - ; - -log_spec: /* Nothing */ - | TOK_LFN TOK_NAME ';' - { - /* - * Configure the log file name - */ - int rc; - - rc = set_log_file($2); - free($2); - if (rc) - return(rc); - } - ; - | TOK_SYSLOG ';' - { - /* - * Configure logging to syslog - */ - scsp_log_syslog = 1; - } - ; - -%% - -void -#if __STDC__ -parse_error(const char *fmt, ...) -#else -parse_error(fmt, va_alist) - char *fmt; - va_dcl -#endif -{ - va_list ap; - char buff[256]; - -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - - vsprintf(buff, fmt, ap); - scsp_log(LOG_ERR, "%s: Config file error at line %d: %s\n", - prog, parse_line, buff); -#ifdef NOTDEF - fprintf(stderr, "%s: Config file error at line %d: %s\n", - prog, parse_line, buff); -#endif - va_end(ap); -} - - -void -yyerror(s) - char *s; -{ - parse_error(s); -} Property changes on: head/usr.sbin/atm/scspd/scsp_config_parse.y ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_var.h =================================================================== --- head/usr.sbin/atm/scspd/scsp_var.h (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_var.h (nonexistent) @@ -1,461 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP message formats - * - */ - -#ifndef _SCSP_SCSP_VAR_H -#define _SCSP_SCSP_VAR_H - - -/* - * Protocol constants - */ -#define SCSP_Open_Interval 30 -#define SCSP_HELLO_Interval 3 -#define SCSP_HELLO_DF 3 -#define SCSP_CAReXmitInterval 3 -#define SCSP_CSUSReXmitInterval 3 -#define SCSP_CSA_HOP_CNT 3 -#define SCSP_CSUReXmitInterval 2 -#define SCSP_CSUReXmitMax 5 - - -/* - * Operational constants - */ -#define SCSPD_CONFIG "/etc/scspd.conf" -#define SCSPD_DIR "/tmp" -#define SCSPD_DUMP "/tmp/scspd.dump" -#define SCSP_HASHSZ 19 -#define SCSPD_SOCK_NAME "SCSPD" - - -/* - * HELLO finite state machine states - */ -#define SCSP_HFSM_DOWN 0 -#define SCSP_HFSM_WAITING 1 -#define SCSP_HFSM_UNI_DIR 2 -#define SCSP_HFSM_BI_DIR 3 -#define SCSP_HFSM_STATE_CNT SCSP_HFSM_BI_DIR + 1 - - -/* - * HELLO finite state machine events - */ -#define SCSP_HFSM_VC_ESTAB 0 -#define SCSP_HFSM_VC_CLOSED 1 -#define SCSP_HFSM_HELLO_T 2 -#define SCSP_HFSM_RCV_T 3 -#define SCSP_HFSM_RCVD 4 -#define SCSP_HFSM_EVENT_CNT SCSP_HFSM_RCVD + 1 - - -/* - * Cache Alignment finite state machine states - */ -#define SCSP_CAFSM_DOWN 0 -#define SCSP_CAFSM_NEG 1 -#define SCSP_CAFSM_MASTER 2 -#define SCSP_CAFSM_SLAVE 3 -#define SCSP_CAFSM_UPDATE 4 -#define SCSP_CAFSM_ALIGNED 5 -#define SCSP_CAFSM_STATE_CNT SCSP_CAFSM_ALIGNED + 1 - - -/* - * Cache Alignment finite state machine events - */ -#define SCSP_CAFSM_HELLO_UP 0 -#define SCSP_CAFSM_HELLO_DOWN 1 -#define SCSP_CAFSM_CA_MSG 2 -#define SCSP_CAFSM_CSUS_MSG 3 -#define SCSP_CAFSM_CSU_REQ 4 -#define SCSP_CAFSM_CSU_REPLY 5 -#define SCSP_CAFSM_CA_T 6 -#define SCSP_CAFSM_CSUS_T 7 -#define SCSP_CAFSM_CSU_T 8 -#define SCSP_CAFSM_CACHE_UPD 9 -#define SCSP_CAFSM_CACHE_RSP 10 -#define SCSP_CAFSM_EVENT_CNT SCSP_CAFSM_CACHE_RSP + 1 - - -/* - * Client Interface finite state machine states - */ -#define SCSP_CIFSM_NULL 0 -#define SCSP_CIFSM_SUM 1 -#define SCSP_CIFSM_UPD 2 -#define SCSP_CIFSM_ALIGN 3 -#define SCSP_CIFSM_STATE_CNT SCSP_CIFSM_ALIGN + 1 - - -/* - * Client Interface finite state machine events - */ -#define SCSP_CIFSM_CA_DOWN 0 -#define SCSP_CIFSM_CA_SUMM 1 -#define SCSP_CIFSM_CA_UPD 2 -#define SCSP_CIFSM_CA_ALIGN 3 -#define SCSP_CIFSM_SOL_RSP 4 -#define SCSP_CIFSM_UPD_REQ 5 -#define SCSP_CIFSM_UPD_RSP 6 -#define SCSP_CIFSM_CSU_REQ 7 -#define SCSP_CIFSM_CSU_REPLY 8 -#define SCSP_CIFSM_CSU_SOL 9 -#define SCSP_CIFSM_EVENT_CNT SCSP_CIFSM_CSU_SOL + 1 - - -/* - * Server connection states (not part of any FSM) - */ -#define SCSP_SS_NULL 0 -#define SCSP_SS_CFG 1 -#define SCSP_SS_ACTIVE 2 - - -/* - * Hash a cache key - * - * key pointer to an Scsp_ckey structure - */ -#define SCSP_HASH(key) scsp_hash((key)) - - -/* - * Add a cache summary entry to a client's cache summary - * - * cpp pointer to a server control block - * key pointer to an Scsp_cse structure - */ -#define SCSP_ADD(cpp, key) \ -{ \ - Scsp_cse **c; \ - c = &(cpp)->ss_cache[SCSP_HASH(&(key)->sc_key)]; \ - LINK2TAIL((key), Scsp_cse, *c, sc_next); \ -} - - -/* - * Delete a cache summary entry from a client's cache summary - * - * cpp pointer to a server control block - * s pointer to an Scsp_cse structure - */ -#define SCSP_DELETE(cpp, s) \ -{ \ - Scsp_cse **c; \ - c = &(cpp)->ss_cache[SCSP_HASH(&(s)->sc_key)]; \ - UNLINK((s), Scsp_cse, *c, sc_next); \ -} - - -/* - * Search a client's cache summary for a given key - * - * cpp pointer to a server control block - * key pointer to an Scsp_ckey structure to find - * s Scsp_cse structure pointer to be set - */ -#define SCSP_LOOKUP(cpp, key, s) \ -{ \ - for ((s) = (cpp)->ss_cache[SCSP_HASH(key)]; \ - (s); \ - (s) = (s)->sc_next) { \ - if (scsp_cmp_key((key), &(s)->sc_key) == 0) \ - break; \ - } \ -} - - -/* - * SCSP pending connection control block - * - * The pending connection block is used to keep track of server - * connections which are open but haven't been identified yet. - */ -struct scsp_pending { - struct scsp_pending *sp_next; - int sp_sock; -}; -typedef struct scsp_pending Scsp_pending; - - -/* - * SCSP Server instance control block - */ -struct scsp_server { - struct scsp_server *ss_next; /* Server chain */ - char *ss_name; /* Server name */ - char ss_intf[IFNAMSIZ]; /* Interface */ - Atm_media ss_media; /* Physical comm medium */ - char ss_state; /* Server connection state */ - u_long ss_pid; /* Protocol ID */ - int ss_id_len; /* ID length */ - int ss_ckey_len; /* Cache key length */ - u_long ss_sgid; /* Server group ID */ - u_long ss_fid; /* Family ID */ - int ss_sock; /* Socket to client */ - int ss_dcs_lsock; /* DCS listen socket */ - Scsp_id ss_lsid; /* Local Server ID */ - Atm_addr ss_addr; /* Local ATM addr */ - Atm_addr ss_subaddr; /* Local ATM subaddr */ - int ss_mtu; /* Interface MTU */ - int ss_mark; - struct scsp_dcs *ss_dcs; /* Ptr to list of DCSs */ - struct scsp_cse *ss_cache[SCSP_HASHSZ]; /* Client's cache */ -}; -typedef struct scsp_server Scsp_server; - - -/* - * SCSP client cache summary entry control block - */ -struct scsp_cse { - struct scsp_cse *sc_next; /* Next on chain */ - long sc_seq; /* CSA sequence no */ - Scsp_ckey sc_key; /* Cache key */ - Scsp_id sc_oid; /* Origin ID */ -}; -typedef struct scsp_cse Scsp_cse; - - -/* - * CSU Request retransmission control block - */ -struct scsp_csu_rexmt { - struct scsp_csu_rexmt *sr_next; /* Next rexmit block */ - struct scsp_dcs *sr_dcs; /* DCS block */ - Scsp_csa *sr_csa; /* CSAs for rexmit */ - Harp_timer sr_t; /* Rexmit timer */ -}; -typedef struct scsp_csu_rexmt Scsp_csu_rexmt; - - -/* - * SCSP DCS control block - */ -struct scsp_dcs { - struct scsp_dcs *sd_next; /* DCS chain */ - Scsp_server *sd_server; /* Local server */ - Scsp_id sd_dcsid; /* DCS ID */ - Atm_addr sd_addr; /* DCS ATM address */ - Atm_addr sd_subaddr; /* DCS ATM subaddress */ - int sd_sock; /* Socket to DCS */ - Harp_timer sd_open_t; /* Open VCC retry timer */ - int sd_hello_state; /* Hello FSM state */ - int sd_hello_int; /* Hello interval */ - int sd_hello_df; /* Hello dead factor */ - int sd_hello_rcvd; /* Hello msg received */ - Harp_timer sd_hello_h_t; /* Hello timer */ - Harp_timer sd_hello_rcv_t; /* Hello receive timer */ - int sd_ca_state; /* CA FSM state */ - long sd_ca_seq; /* CA sequence number */ - int sd_ca_rexmt_int; /* CA rexmit interval */ - Scsp_msg *sd_ca_rexmt_msg; /* Saved CA msg */ - Scsp_cse *sd_ca_csas; /* CSAS still to send */ - Harp_timer sd_ca_rexmt_t; /* CA rexmit timer */ - int sd_csus_rexmt_int; /* CSUS rexmit int */ - Scsp_csa *sd_crl; /* Cache req list */ - Scsp_msg *sd_csus_rexmt_msg; /* Saved CSUS msg */ - Harp_timer sd_csus_rexmt_t; /* CSUS rexmit timer */ - int sd_hops; /* CSA hop count */ - Scsp_csa *sd_csu_ack_pend; /* CSUs to be ACKed */ - Scsp_csa *sd_csu_ack; /* CSUs ACKed */ - int sd_csu_rexmt_int; /* CSU Req rxmt time */ - int sd_csu_rexmt_max; /* CSU Req rxmt limit */ - Scsp_csu_rexmt *sd_csu_rexmt; /* CSU Req rxmt queue */ - int sd_client_state; /* Client I/F state */ -}; -typedef struct scsp_dcs Scsp_dcs; - -/* - * Trace options - */ -#define SCSP_TRACE_HFSM 1 /* Trace the Hello FSM */ -#define SCSP_TRACE_CAFSM 2 /* Trace the CA FSM */ -#define SCSP_TRACE_CFSM 4 /* Trace the server I/F FSM */ -#define SCSP_TRACE_HELLO_MSG 8 /* Trace Hello protocol msgs */ -#define SCSP_TRACE_CA_MSG 16 /* Trace CA protocol msgs */ -#define SCSP_TRACE_IF_MSG 32 /* Trace server I/F msgs */ - - -/* - * Global variables - */ -extern char *prog; -extern FILE *cfg_file; -extern int parse_line; -extern char *scsp_config_file; -extern FILE *scsp_log_file; -extern int scsp_log_syslog; -extern Scsp_server *scsp_server_head; -extern Scsp_pending *scsp_pending_head; -extern int scsp_max_socket; -extern int scsp_debug_mode; -extern int scsp_trace_mode; -extern FILE *scsp_trace_file; - - -/* - * Executable functions - */ -/* scsp_cafsm.c */ -extern int scsp_cafsm(Scsp_dcs *, int, void *); - -/* scsp_config.c */ -extern int scsp_config(char *); -extern int start_dcs(void); -extern int finish_dcs(void); -extern int set_dcs_addr(char *, char *); -extern int set_dcs_ca_rexmit(int); -extern int set_dcs_csus_rexmit(int); -extern int set_dcs_csu_rexmit(int); -extern int set_dcs_csu_rexmit_max(int); -extern int set_dcs_hello_df(int); -extern int set_dcs_hello_int(int); -extern int set_dcs_hops(int); -extern int set_dcs_id(char *); -extern int set_intf(char *); -extern int set_protocol(int); -extern int set_server_group(int); -extern int start_server(char *); -extern int finish_server(void); -extern int set_log_file(char *); - -/* scsp_config_lex.c */ -extern int yylex(void); - -/* scsp_config_parse.y */ -#if __STDC__ -extern void parse_error(const char *, ...); -#else -extern void parse_error(char *, va_alist); -#endif - -/* scsp_hfsm.c */ -extern int scsp_hfsm(Scsp_dcs *, int, Scsp_msg *); - -/* scsp_if.c */ -extern int scsp_cfsm(Scsp_dcs *, int, Scsp_msg *, Scsp_if_msg *); - -/* scsp_input.c */ -extern void scsp_free_msg(Scsp_msg *); -extern Scsp_msg *scsp_parse_msg(char *, int); - -/* scsp_log.c */ -#if __STDC__ -extern void scsp_log(const int, const char *, ...); -extern void scsp_trace(const char *, ...); -#else -extern void scsp_log(int, char *, va_alist); -extern void scsp_trace(const char *, va_alist); -#endif -extern void scsp_open_trace(); -extern void scsp_trace_msg(Scsp_dcs *, Scsp_msg *, int); -extern void scsp_mem_err(char *); - -/* scsp_msg.c */ -extern void scsp_csus_ack(Scsp_dcs *, Scsp_msg *); -extern int scsp_send_ca(Scsp_dcs *); -extern int scsp_send_csus(Scsp_dcs *); -extern int scsp_send_csu_req(Scsp_dcs *, Scsp_csa *); -extern int scsp_send_csu_reply(Scsp_dcs *, Scsp_csa *); -extern int scsp_send_hello(Scsp_dcs *); - -/* scsp_output.c */ -extern int scsp_format_msg(Scsp_dcs *, Scsp_msg *, char **); -extern int scsp_send_msg(Scsp_dcs *, Scsp_msg *); - -/* scsp_print.c */ -extern char *format_hfsm_state(int); -extern char *format_hfsm_event(int); -extern char *format_cafsm_state(int); -extern char *format_cafsm_event(int); -extern char *format_cifsm_state(int); -extern char *format_cifsm_event(int); -extern void print_scsp_cse(FILE *, Scsp_cse *); -extern void print_scsp_msg(FILE *, Scsp_msg *); -extern void print_scsp_if_msg(FILE *, Scsp_if_msg *); -extern void print_scsp_pending(FILE *, Scsp_pending *); -extern void print_scsp_server(FILE *, Scsp_server *); -extern void print_scsp_dcs(FILE *, Scsp_dcs *); -extern void print_scsp_dump(); - -/* scsp_socket.c */ -extern Scsp_dcs * scsp_find_dcs(int); -extern Scsp_server * scsp_find_server(int); -extern int scsp_dcs_connect(Scsp_dcs *); -extern int scsp_dcs_listen(Scsp_server *); -extern Scsp_dcs * scsp_dcs_accept(Scsp_server *); -extern int scsp_dcs_read(Scsp_dcs *); -extern int scsp_server_listen(); -extern int scsp_server_accept(int); -extern Scsp_if_msg * scsp_if_sock_read(int); -extern int scsp_if_sock_write(int, Scsp_if_msg *); -extern int scsp_server_read(Scsp_server *); -extern int scsp_send_cache_ind(Scsp_server *); -extern int scsp_pending_read(Scsp_pending *); - -/* scsp_subr.c */ -extern int scsp_hash(Scsp_ckey *); -extern int scsp_cmp_id(Scsp_id *, Scsp_id *); -extern int scsp_cmp_key(Scsp_ckey *, Scsp_ckey *); -extern int scsp_is_atmarp_server(char *); -extern Scsp_cse * scsp_dup_cse(Scsp_cse *); -extern Scsp_csa * scsp_dup_csa(Scsp_csa *); -extern Scsp_csa * scsp_cse2csas(Scsp_cse *); -extern void scsp_dcs_cleanup(Scsp_dcs *); -extern void scsp_dcs_delete(Scsp_dcs *); -extern void scsp_server_shutdown(Scsp_server *); -extern void scsp_server_delete(Scsp_server *); -extern int scsp_get_server_info(Scsp_server *); -extern void scsp_process_ca(Scsp_dcs *, Scsp_ca *); -extern void scsp_process_cache_rsp(Scsp_server *, Scsp_if_msg *); -extern int scsp_propagate_csa( Scsp_dcs *, Scsp_csa *); -extern void scsp_update_cache( Scsp_dcs *, Scsp_csa *); -extern void scsp_reconfigure(); - -/* scsp_timer.c */ -extern void scsp_open_timeout(Harp_timer *); -extern void scsp_hello_timeout(Harp_timer *); -extern void scsp_hello_rcv_timeout(Harp_timer *); -extern void scsp_ca_retran_timeout(Harp_timer *); -extern void scsp_csus_retran_timeout(Harp_timer *); -extern void scsp_csu_req_retran_timeout(Harp_timer *); - - - -#endif /* _SCSP_SCSP_VAR_H */ Property changes on: head/usr.sbin/atm/scspd/scsp_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_output.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_output.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_output.c (nonexistent) @@ -1,930 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Output packet processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Put a long integer into the output buffer - * - * This routine is provided for cases where long ints may not be - * word-aligned in the output buffer. - * - * Arguments: - * l long integer - * cp pointer to output buffer - * - * Returns: - * None - * - */ -static void -put_long(l, cp) - u_long l; - u_char *cp; -{ - u_long nl; - - /* - * Convert to network order and copy to output buffer - */ - nl = htonl(l); - bcopy(&nl, cp, sizeof(u_long)); -} - - -/* - * Format a Sender or Receiver ID - * - * Arguments: - * idp ponter to ID structure - * buff pointer to ID - * - * Returns: - * 0 input was invalid - * else length of ID processed - * - */ -static int -scsp_format_id(idp, buff) - Scsp_id *idp; - char *buff; -{ - /* - * Copy the ID - */ - bcopy(idp->id, buff, idp->id_len); - - /* - * Return the ID length - */ - return(idp->id_len); -} - - -/* - * Format the Mandatory Common Part of an SCSP input packet - * - * Arguments: - * mcp pointer to MCP - * buff pointer to mandatory common part - * - * Returns: - * 0 input was invalid - * else length of MCP in message - * - */ -static int -scsp_format_mcp(mcp, buff) - Scsp_mcp *mcp; - char *buff; -{ - int len; - char *odp; - struct scsp_nmcp *smp; - - /* - * Set the protocol ID - */ - smp = (struct scsp_nmcp *)buff; - smp->sm_pid = htons(mcp->pid); - - /* - * Set the server group ID - */ - smp->sm_sgid = htons(mcp->sgid); - - /* - * Set the flags - */ - smp->sm_flags = htons(mcp->flags); - - /* - * Set the sender ID and length - */ - smp->sm_sid_len = mcp->sid.id_len; - odp = buff + sizeof(struct scsp_nmcp); - len = scsp_format_id(&mcp->sid, odp); - if (len == 0) { - goto mcp_invalid; - } - - /* - * Set the receiver ID and length - */ - smp->sm_rid_len = mcp->rid.id_len; - odp += mcp->sid.id_len; - len = scsp_format_id(&mcp->rid, odp); - if (len == 0) { - goto mcp_invalid; - } - - /* - * Set the record count - */ - smp->sm_rec_cnt = htons(mcp->rec_cnt); - - /* - * Return the length of data we processed - */ - return(sizeof(struct scsp_nmcp) + mcp->sid.id_len + - mcp->rid.id_len); - -mcp_invalid: - return(0); -} - - -/* - * Format an Extension - * - * Arguments: - * exp pointer to extension in internal format - * buff pointer to output buffer - * blen space available in buffer - * - * Returns: - * 0 input was invalid - * else length of extension processed - * - */ -static int -scsp_format_ext(exp, buff, blen) - Scsp_ext *exp; - char *buff; - int blen; -{ - struct scsp_next *sep; - - /* - * Make sure there's room in the buffer - */ - if (blen < (sizeof(struct scsp_next) + exp->len)) - return(0); - - /* - * Set the type - */ - sep = (struct scsp_next *)buff; - sep->se_type = htons(exp->type); - - /* - * Set the length - */ - sep->se_len = htons(exp->len); - - /* - * Set the value - */ - if (exp->len > 0) { - buff += sizeof(struct scsp_next); - bcopy((caddr_t)exp + sizeof(Scsp_ext), - buff, - exp->len); - } - - /* - * Return the number of bytes processed - */ - return(sizeof(struct scsp_next) + exp->len); -} - - -/* - * Format the ATMARP part of a CSA record - * - * Arguments: - * acsp pointer to ATMARP protocol-specific CSA record - * buff pointer to output buffer - * - * Returns: - * 0 input was invalid - * else length of record processed - * - */ -static int -scsp_format_atmarp(acsp, buff) - Scsp_atmarp_csa *acsp; - char *buff; -{ - char *cp; - int len, pkt_len; - struct scsp_atmarp_ncsa *sanp; - - /* - * Figure out how long PDU is going to be - */ - pkt_len = sizeof(struct scsp_atmarp_ncsa); - switch (acsp->sa_sha.address_format) { - case T_ATM_ENDSYS_ADDR: - pkt_len += acsp->sa_sha.address_length; - break; - - case T_ATM_E164_ADDR: - pkt_len += acsp->sa_sha.address_length; - if (acsp->sa_ssa.address_format == T_ATM_ENDSYS_ADDR) - pkt_len += acsp->sa_ssa.address_length; - break; - } - - switch (acsp->sa_tha.address_format) { - case T_ATM_ENDSYS_ADDR: - pkt_len += acsp->sa_tha.address_length; - break; - - case T_ATM_E164_ADDR: - pkt_len += acsp->sa_tha.address_length; - if (acsp->sa_tha.address_format == T_ATM_ENDSYS_ADDR) - pkt_len += acsp->sa_tha.address_length; - break; - } - - if (acsp->sa_spa.s_addr != 0) - pkt_len += sizeof(struct in_addr); - - if (acsp->sa_tpa.s_addr != 0) - pkt_len += sizeof(struct in_addr); - - /* - * Set up pointers - */ - sanp = (struct scsp_atmarp_ncsa *)buff; - cp = (char *)sanp + sizeof(struct scsp_atmarp_ncsa); - - /* - * Build fields - */ - sanp->sa_hrd = htons(ARP_ATMFORUM); - sanp->sa_pro = htons(ETHERTYPE_IP); - - /* sa_sha */ - len = acsp->sa_sha.address_length; - switch (acsp->sa_sha.address_format) { - case T_ATM_ENDSYS_ADDR: - sanp->sa_shtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* sa_sha */ - bcopy(acsp->sa_sha.address, cp, len); - cp += len; - - sanp->sa_sstl = 0; - break; - - case T_ATM_E164_ADDR: - sanp->sa_shtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* sa_sha */ - bcopy(acsp->sa_sha.address, cp, len); - cp += len; - - if (acsp->sa_ssa.address_format == T_ATM_ENDSYS_ADDR) { - len = acsp->sa_ssa.address_length; - sanp->sa_sstl = ARP_TL_NSAPA | - (len & ARP_TL_LMASK); - - /* sa_ssa */ - bcopy(acsp->sa_ssa.address, cp, len); - cp += len; - } else - sanp->sa_sstl = 0; - break; - - default: - sanp->sa_shtl = 0; - sanp->sa_sstl = 0; - } - - /* sa_state */ - sanp->sa_state = acsp->sa_state; - sanp->sa_fill1 = 0; - - /* sa_spa */ - if (acsp->sa_spa.s_addr != 0) { - sanp->sa_spln = sizeof(struct in_addr); - bcopy(&acsp->sa_spa, cp, sizeof(struct in_addr)); - cp += sizeof(struct in_addr); - } - - /* sa_tha */ - len = acsp->sa_tha.address_length; - switch (acsp->sa_tha.address_format) { - case T_ATM_ENDSYS_ADDR: - sanp->sa_thtl = ARP_TL_NSAPA | (len & ARP_TL_LMASK); - - /* sa_tha */ - bcopy(acsp->sa_tha.address, cp, len); - cp += len; - - sanp->sa_tstl = 0; - break; - - case T_ATM_E164_ADDR: - sanp->sa_thtl = ARP_TL_E164 | (len & ARP_TL_LMASK); - - /* sa_tha */ - bcopy(acsp->sa_tha.address, cp, len); - cp += len; - - if (acsp->sa_tsa.address_format == T_ATM_ENDSYS_ADDR) { - len = acsp->sa_tha.address_length; - sanp->sa_tstl = ARP_TL_NSAPA | - (len & ARP_TL_LMASK); - - /* sa_tsa */ - bcopy(acsp->sa_tsa.address, cp, len); - cp += len; - } else - sanp->sa_tstl = 0; - break; - - default: - sanp->sa_thtl = 0; - sanp->sa_tstl = 0; - } - - /* sa_tpa */ - if (acsp->sa_tpa.s_addr != 0) { - sanp->sa_tpln = sizeof(struct in_addr); - bcopy(&acsp->sa_tpa, cp, sizeof(struct in_addr)); - } - - return(pkt_len); -} - - -/* - * Format a Cache State Advertisement or Cache State Advertisement - * Summary record - * - * Arguments: - * csapp pointer to CSA or CSAS - * buff pointer to output buffer - * - * Returns: - * 0 input was invalid - * else length of record processed - * - */ -static int -scsp_format_csa(csap, buff) - Scsp_csa *csap; - char *buff; -{ - int len = 0; - char *odp; - struct scsp_ncsa *scp; - - /* - * Set the hop count - */ - scp = (struct scsp_ncsa *)buff; - scp->scs_hop_cnt = htons(csap->hops); - - /* - * Set the null flag - */ - if (csap->null) { - scp->scs_nfill = htons(SCSP_CSAS_NULL); - } - - /* - * Set the sequence number - */ - put_long(csap->seq, (u_char *)&scp->scs_seq); - - /* - * Set the cache key - */ - scp->scs_ck_len = csap->key.key_len; - odp = buff + sizeof(struct scsp_ncsa); - bcopy(csap->key.key, odp, scp->scs_ck_len); - - /* - * Set the originator ID - */ - odp += scp->scs_ck_len; - scp->scs_oid_len = scsp_format_id(&csap->oid, odp); - - /* - * Set the protocol-specific data, if present. At the - * moment, we only handle data for ATMARP. - */ - if (csap->atmarp_data) { - odp += scp->scs_oid_len; - len = scsp_format_atmarp(csap->atmarp_data, odp); - } - - /* - * Set the record length - */ - scp->scs_len = htons(sizeof(struct scsp_ncsa) + - scp->scs_ck_len + scp->scs_oid_len + - len); - - /* - * Return the length of data we processed - */ - return(ntohs(scp->scs_len)); -} - - -/* - * Format a Cache Alignment message - * - * Arguments: - * cap pointer to CA message - * buff pointer to output buffer - * blen space available in buffer - * - * Returns: - * 0 input was invalid - * else length of CA message processed - * - */ -static int -scsp_format_ca(cap, buff, blen) - Scsp_ca *cap; - char *buff; - int blen; -{ - int i, len, proc_len; - struct scsp_nca *scap; - Scsp_csa *csap; - - /* - * Set the sequence number - */ - scap = (struct scsp_nca *)buff; - put_long(cap->ca_seq, (u_char *)&scap->sca_seq); - proc_len = sizeof(scap->sca_seq); - buff += sizeof(scap->sca_seq); - - /* - * Set the flags - */ - cap->ca_mcp.flags = 0; - if (cap->ca_m) - cap->ca_mcp.flags |= SCSP_CA_M; - if (cap->ca_i) - cap->ca_mcp.flags |= SCSP_CA_I; - if (cap->ca_o) - cap->ca_mcp.flags |= SCSP_CA_O; - - /* - * Format the mandatory common part of the message - */ - len = scsp_format_mcp(&cap->ca_mcp, buff); - if (len == 0) - goto ca_invalid; - buff += len; - proc_len += len; - - /* - * Put any CSAS records into the message - */ - for (i = 0, csap = cap->ca_csa_rec; i < cap->ca_mcp.rec_cnt; - i++, csap = csap->next) { - len = scsp_format_csa(csap, buff); - buff += len; - proc_len += len; - if (proc_len > blen) { - scsp_log(LOG_CRIT, "scsp_format_ca: buffer overflow"); - abort(); - } - } - - /* - * Return the length of processed data - */ - return(proc_len); - -ca_invalid: - return(0); -} - - -/* - * Format a Cache State Update Request, Cache State Update Reply, or - * Cache State Update Solicit message. These all have the same format, - * a Mandatory Common Part followed by a number of CSA or CSAS records. - * - * Arguments: - * csup pointer to location to put pointer to CSU Req message - * buff pointer to output buffer - * blen space available in buffer - * - * Returns: - * 0 input was invalid - * else length of CSU Req message processed - * - */ -static int -scsp_format_csu(csup, buff, blen) - Scsp_csu_msg *csup; - char *buff; - int blen; -{ - int i, len, proc_len; - struct scsp_ncsu_msg *scsup; - Scsp_csa *csap; - - /* - * Format the mandatory common part of the message - */ - scsup = (struct scsp_ncsu_msg *)buff; - len = scsp_format_mcp(&csup->csu_mcp, buff); - if (len == 0) - goto csu_invalid; - buff += len; - proc_len = len; - - /* - * Put the CSAS records into the message - */ - for (i = 0, csap = csup->csu_csa_rec; - i < csup->csu_mcp.rec_cnt && csap; - i++, csap = csap->next) { - len = scsp_format_csa(csap, buff); - buff += len; - proc_len += len; - if (proc_len > blen) { - scsp_log(LOG_CRIT, "scsp_format_csu: buffer overflow"); - abort(); - } - } - - /* - * Return the length of processed data - */ - return(proc_len); - -csu_invalid: - return(0); -} - - -/* - * Format a Hello message - * - * Arguments: - * hpp pointer to Hello message - * buff pointer to output buffer - * blen space available in buffer - * - * Returns: - * 0 input was invalid - * else length of Hello message processed - * - */ -static int -scsp_format_hello(hp, buff, blen) - Scsp_hello *hp; - char *buff; - int blen; -{ - int len, proc_len; - struct scsp_nhello *shp; - Scsp_id *ridp; - - /* - * Set the hello interval - */ - shp = (struct scsp_nhello *)buff; - shp->sch_hi = htons(hp->hello_int); - - /* - * Set the dead factor - */ - shp->sch_df = htons(hp->dead_factor); - - /* - * Set the family ID - */ - shp->sch_fid = htons(hp->family_id); - - /* - * Process the mandatory common part of the message - */ - proc_len = sizeof(struct scsp_nhello) - - sizeof(struct scsp_nmcp); - buff += proc_len; - len = scsp_format_mcp(&hp->hello_mcp, buff); - if (len == 0) - goto hello_invalid; - proc_len += len; - buff += len; - - /* - * Add any additional receiver ID records to the message - */ - for (ridp = hp->hello_mcp.rid.next; ridp; - ridp = ridp->next) { - len = scsp_format_id(ridp, buff); - if (len == 0) { - goto hello_invalid; - } - proc_len += len; - buff += len; - } - - /* - * Return the length of the Hello message body - */ - if (proc_len > blen) { - scsp_log(LOG_CRIT, "scsp_format_hello: buffer overflow"); - abort(); - } - return(proc_len); - -hello_invalid: - return(0); -} - - -/* - * Format an SCSP output packet - * - * Arguments: - * dcsp pointer to DCS for which message is being prepared - * msg pointer to input packet - * bpp pointer to location to put pointer to formatted packet - * - * Returns: - * 0 input packet was invalid - * else length of formatted packet - * - */ -int -scsp_format_msg(dcsp, msg, bpp) - Scsp_dcs *dcsp; - Scsp_msg *msg; - char **bpp; -{ - char *buff = (char *)0, *e_buff = (char *)0; - int buff_len, e_buff_len; - int e_len, len, plen; - struct scsp_nhdr *shp; - Scsp_ext *exp; - - /* - * Allocate a buffer for the message - */ - buff_len = dcsp->sd_server->ss_mtu; - buff = calloc(1, buff_len); - if (buff == NULL) - scsp_mem_err("scsp_format_msg: dcsp->sd_server->ss_mtu"); - *bpp = buff; - - /* - * Encode the fixed header - * - * Set the version - */ - shp = (struct scsp_nhdr *)buff; - shp->sh_ver = SCSP_VER_1; - - /* - * Set the message type - */ - shp->sh_type = msg->sc_msg_type; - - /* - * Point past the fixed header - */ - len = sizeof(struct scsp_nhdr); - buff_len -= len; - - /* - * Encode any extensions into a temporary buffer - */ - e_len = 0; - if (msg->sc_ext) { - /* - * Get a buffer for the extensions - */ - e_buff_len = 1024; - e_buff = calloc(1, e_buff_len); - if (buff) - scsp_mem_err("scsp_format_msg: e_buff_len"); - - /* - * Encode the extensions - */ - for (exp = msg->sc_ext = 0; exp; exp = exp->next) { - plen = scsp_format_ext(exp, e_buff + e_len, - e_buff_len - e_len); - if (plen == 0) { - goto ignore; - } - e_len += plen; - } - - /* - * Free the buffer if we didn't use it - */ - if (!e_len) { - free(e_buff); - e_buff = (char *)0; - } - } - buff_len -= e_len; - - /* - * Encode the body of the message, depending on the type - */ - switch(msg->sc_msg_type) { - case SCSP_CA_MSG: - plen = scsp_format_ca(msg->sc_ca, buff + len, buff_len); - break; - case SCSP_CSU_REQ_MSG: - case SCSP_CSU_REPLY_MSG: - case SCSP_CSUS_MSG: - plen = scsp_format_csu(msg->sc_csu_msg, buff + len, - buff_len); - break; - case SCSP_HELLO_MSG: - plen = scsp_format_hello(msg->sc_hello, buff + len, - buff_len); - break; - default: - goto ignore; - } - if (plen == 0) { - goto ignore; - } - len += plen; - - /* - * Copy the extensions to the end of the message - */ - if (e_len) { - shp->sh_ext_off = htons(len); - bcopy(e_buff, buff + len, e_len); - free(e_buff); - } - - /* - * Set the length - */ - shp->sh_len = htons(len); - - /* - * Compute the message checksum - */ - shp->sh_checksum = htons(ip_checksum(buff, len)); - - /* - * Return the length of the buffer - */ - return(len); - -ignore: - if (buff) - free(buff); - if (e_buff) - free(e_buff); - *bpp = (char *)0; - return(0); -} - - -/* - * Send an SCSP message - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to message to send - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_send_msg(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int len, rc; - char *buff; - - /* - * Make sure we have a socket open - */ - if (dcsp->sd_sock == -1) { - return(EBADF); - } - - /* - * Trace the message - */ - if (((scsp_trace_mode & SCSP_TRACE_HELLO_MSG) && - msg->sc_msg_type == SCSP_HELLO_MSG) || - ((scsp_trace_mode & SCSP_TRACE_CA_MSG) && - msg->sc_msg_type != SCSP_HELLO_MSG)) { - scsp_trace_msg(dcsp, msg, 0); - scsp_trace("\n"); - } - - /* - * Put the message into network format - */ - len = scsp_format_msg(dcsp, msg, &buff); - if (len == 0) { - scsp_log(LOG_ERR, "scsp_send_msg: message conversion failed\n"); - abort(); - } - - /* - * Write the message to the DCS - */ - rc = write(dcsp->sd_sock, (void *)buff, len); - free(buff); - if (rc == len || (rc == -1 && errno == EINPROGRESS)) { - rc = 0; - } else { - /* - * There was an error on the write--close the VCC - */ - (void)close(dcsp->sd_sock); - dcsp->sd_sock = -1; - - /* - * Inform the Hello FSM - */ - (void)scsp_hfsm(dcsp, SCSP_HFSM_VC_CLOSED, - (Scsp_msg *)0); - - /* - * Set the return code - */ - if (rc == -1) - rc = errno; - else - rc = EINVAL; - } - - return(rc); -} Property changes on: head/usr.sbin/atm/scspd/scsp_output.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_log.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_log.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_log.c (nonexistent) @@ -1,264 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP logging routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#if __STDC__ -#include -#else -#include -#endif -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Global variables - */ -FILE *scsp_trace_file = (FILE *)0; - - -/* - * Write a message to SCSP's log - * - * Arguments: - * level pointer to an SCSP cache key structure - * fmt printf-style format string - * ... parameters for printf-style use according to fmt - * - * Returns: - * none - * - */ -void -#if __STDC__ -scsp_log(const int level, const char *fmt, ...) -#else -scsp_log(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif -{ - va_list ap; - -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - - /* - * In debug mode, just write to stdout - */ - if (scsp_debug_mode) { - vprintf(fmt, ap); - printf("\n"); - return; - } - - /* - * Write to syslog if it's active or if no log file is set up - */ - if (scsp_log_syslog || !scsp_log_file) { - vsyslog(level, fmt, ap); - } - - /* - * Write to the log file if there's one set up - */ - if (scsp_log_file) { - vfprintf(scsp_log_file, fmt, ap); - fprintf(scsp_log_file, "\n"); - } - - va_end(ap); -} - - -/* - * Open SCSP's trace file - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -scsp_open_trace() -{ - char fname[64]; - - /* - * Build a file name - */ - bzero(fname, sizeof(fname)); - sprintf(fname, "/tmp/scspd.%d.trace", getpid()); - - /* - * Open the trace file. If the open fails, log an error, but - * keep going. The trace routine will notice that the file - * isn't open and won't try to write to it. - */ - scsp_trace_file = fopen(fname, "w"); - if (scsp_trace_file == (FILE *)0) { - scsp_log(LOG_ERR, "Can't open trace file"); - } -} - - -/* - * Write a message to SCSP's trace file - * - * Arguments: - * fmt printf-style format string - * ... parameters for printf-style use according to fmt - * - * Returns: - * none - * - */ -void -#if __STDC__ -scsp_trace(const char *fmt, ...) -#else -scsp_trace(fmt, va_alist) - char *fmt; - va_dcl -#endif -{ - va_list ap; - -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - - /* - * Write the message to the trace file, if it's open - */ - if (scsp_trace_file) { - vfprintf(scsp_trace_file, fmt, ap); - } - - va_end(ap); -} - - -/* - * Write an SCSP message to SCSP's trace file - * - * Arguments: - * dcsp pointer to DCS block for the message - * msg pointer to the message - * dir a direction indicator--0 for sending, 1 for receiving - * - * Returns: - * none - * - */ -void -scsp_trace_msg(dcsp, msg, dir) - Scsp_dcs *dcsp; - Scsp_msg *msg; - int dir; -{ - struct in_addr addr; - - /* - * Copy the remote IP address into a struct in_addr - */ - bcopy(dcsp->sd_dcsid.id, &addr.s_addr, sizeof(struct in_addr)); - - /* - * Write the message to the trace file, if it's open - */ - if (scsp_trace_file) { - scsp_trace("SCSP message at 0x%x %s %s\n", - (u_long)msg, - (dir ? "received from" : "sent to"), - format_ip_addr(&addr)); - print_scsp_msg(scsp_trace_file, msg); - } -} - - -/* - * Log a memory error and exit - * - * Arguments: - * cp message to log - * - * Returns: - * exits, does not return - * - */ -void -scsp_mem_err(cp) - char *cp; -{ - scsp_log(LOG_CRIT, "out of memory: %s", cp); - exit(2); -} Property changes on: head/usr.sbin/atm/scspd/scsp_log.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_msg.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_msg.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_msg.c (nonexistent) @@ -1,590 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP message-handling routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Copy CSAS records into a CA record - * - * Arguments: - * dcsp pointer to DCS block for DCS - * cap pointer to CA record for CSASs - * - * - * Returns: - * none - * - */ -static void -scsp_ca_csas_setup(dcsp, cap) - Scsp_dcs *dcsp; - Scsp_ca *cap; -{ - int csas_len, len, mtu; - Scsp_server *ssp = dcsp->sd_server; - Scsp_cse *csep, *next_csep; - Scsp_csa *csap; - - /* - * Loop through pending CSAS records - */ - len = sizeof(struct scsp_nhdr) + sizeof(struct scsp_nmcp) + - ssp->ss_lsid.id_len + - dcsp->sd_dcsid.id_len; - csas_len = sizeof(struct scsp_ncsa) + - dcsp->sd_server->ss_id_len + - dcsp->sd_server->ss_ckey_len; - mtu = dcsp->sd_server->ss_mtu; - for (csep = dcsp->sd_ca_csas; - csep && (len < mtu - csas_len); - csep = next_csep) { - next_csep = csep->sc_next; - csap = scsp_cse2csas(csep); - LINK2TAIL(csap, Scsp_csa, cap->ca_csa_rec, next); - len += csas_len; - UNLINK(csep, Scsp_cse, dcsp->sd_ca_csas, sc_next); - free(csep); - cap->ca_mcp.rec_cnt++; - } -} - - -/* - * Process CSA records from a CSU Request that may be in response to - * CSAS records sent in a CSUS - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message - * - * Returns: - * none - * - */ -void -scsp_csus_ack(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - Scsp_csu_msg *csusp; - Scsp_csa *csap, *csasp, *next_csasp; - - /* - * If this isn't a CSU Request, or there's no outstanding CSUS, - * or the outstanding CSUS has already been satisfied, just - * return - */ - if (!msg || msg->sc_msg_type != SCSP_CSU_REQ_MSG || - !dcsp->sd_csus_rexmt_msg || - !dcsp->sd_csus_rexmt_msg->sc_csu_msg || - !dcsp->sd_csus_rexmt_msg->sc_csu_msg->csu_csa_rec) - return; - - - /* - * Loop through the CSASs in the CSUS message, checking for - * each in the CSA records of the received CSU Request - */ - csusp = dcsp->sd_csus_rexmt_msg->sc_csu_msg; - for (csasp = csusp->csu_csa_rec; csasp; csasp = next_csasp) { - next_csasp = csasp->next; - for (csap = msg->sc_csu_msg->csu_csa_rec; - csap; csap = csap->next) { - /* - * If the records match, unlink and free the - * CSAS from the CSUS - */ - if (scsp_cmp_key(&csap->key, &csasp->key) == 0 && - scsp_cmp_key(&csap->key, &csasp->key) == 0 && - scsp_cmp_id(&csap->oid, &csasp->oid) == 0 && - csap->seq >= csasp->seq) { - UNLINK(csasp, Scsp_csa, - csusp->csu_csa_rec, - next); - SCSP_FREE_CSA(csasp); - dcsp->sd_csus_rexmt_msg->sc_csu_msg->csu_mcp.rec_cnt--; - break; - } - } - } - - if (csusp->csu_csa_rec == (Scsp_csa *)0) { - /* - * All CSASs in the CSUS message have been - * answered. Stop the timer and free the - * saved message. - */ - HARP_CANCEL(&dcsp->sd_csus_rexmt_t); - scsp_free_msg(dcsp->sd_csus_rexmt_msg); - dcsp->sd_csus_rexmt_msg = (Scsp_msg *)0; - - /* - * If the CRL isn't empty, send another CSUS - */ - if (dcsp->sd_crl) { - (void)scsp_send_csus(dcsp); - } - } -} - - -/* - * Send a CA message - * - * Arguments: - * dcsp pointer to DCS block for DCS - * - * Returns: - * 0 message sent OK - * else errno indicating reason for failure - * - */ -int -scsp_send_ca(dcsp) - Scsp_dcs *dcsp; -{ - int rc; - Scsp_msg *ca_msg; - Scsp_ca *cap; - Scsp_server *ssp = dcsp->sd_server; - - /* - * Get memory for a CA message - */ - ca_msg = calloc(1, sizeof(Scsp_msg)); - if (ca_msg == NULL) - scsp_mem_err("scsp_send_ca: sizeof(Scsp_msg)"); - cap = calloc(1, sizeof(Scsp_ca)); - if (cap == NULL) - scsp_mem_err("scsp_send_ca: sizeof(Scsp_ca)"); - - /* - * Fill out constant fields - */ - ca_msg->sc_msg_type = SCSP_CA_MSG; - ca_msg->sc_ca = cap; - cap->ca_seq = dcsp->sd_ca_seq; - cap->ca_mcp.pid = ssp->ss_pid; - cap->ca_mcp.sgid = ssp->ss_sgid; - cap->ca_mcp.sid = ssp->ss_lsid; - cap->ca_mcp.rid = dcsp->sd_dcsid; - - /* - * Fill out state-dependent fields - */ - switch(dcsp->sd_ca_state) { - case SCSP_CAFSM_NEG: - cap->ca_m = 1; - cap->ca_i = 1; - cap->ca_o = 1; - break; - case SCSP_CAFSM_MASTER: - cap->ca_m = 1; - cap->ca_i = 0; - scsp_ca_csas_setup(dcsp, cap); - cap->ca_o = dcsp->sd_ca_csas != (Scsp_cse *)0; - break; - case SCSP_CAFSM_SLAVE: - cap->ca_m = 0; - cap->ca_i = 0; - scsp_ca_csas_setup(dcsp, cap); - cap->ca_o = dcsp->sd_ca_csas != (Scsp_cse *)0; - break; - default: - scsp_log(LOG_ERR, "Invalid state in scsp_send_ca"); - abort(); - } - - /* - * Send the CA message and save a pointer to it in case - * it needs to be retransmitted - */ - rc = scsp_send_msg(dcsp, ca_msg); - if (rc == 0) { - dcsp->sd_ca_rexmt_msg = ca_msg; - } else { - scsp_free_msg(ca_msg); - } - - return(rc); -} - - -/* - * Send a CSU Solicit message - * - * Arguments: - * dcsp pointer to DCS block for DCS - * - * Returns: - * 0 message sent OK - * else errno indicating reason for failure - * - */ -int -scsp_send_csus(dcsp) - Scsp_dcs *dcsp; -{ - int csas_len, len, mtu, rc; - Scsp_msg *csus_msg; - Scsp_csu_msg *csusp; - Scsp_csa *csasp, *next_csasp; - Scsp_server *ssp = dcsp->sd_server; - - /* - * If we have a mesage saved for retransmission, use it. - * If not, get memory for a new one. - */ - if (dcsp->sd_csus_rexmt_msg) { - csus_msg = dcsp->sd_csus_rexmt_msg; - csusp = csus_msg->sc_csu_msg; - } else { - /* - * Get memory for a CSUS message - */ - csus_msg = calloc(1, sizeof(Scsp_msg)); - if (csus_msg == NULL) - scsp_mem_err("scsp_send_csus: sizeof(Scsp_msg)"); - csusp = calloc(1, sizeof(Scsp_csu_msg)); - if (csusp == NULL) - scsp_mem_err("scsp_send_csus: sizeof(Scsp_csu_msg)"); - - /* - * Fill out constant fields - */ - csus_msg->sc_msg_type = SCSP_CSUS_MSG; - csus_msg->sc_csu_msg = csusp; - csusp->csu_mcp.pid = ssp->ss_pid; - csusp->csu_mcp.sgid = ssp->ss_sgid; - csusp->csu_mcp.sid = ssp->ss_lsid; - csusp->csu_mcp.rid = dcsp->sd_dcsid; - } - - /* - * Move CSAS records from CRL into message - */ - mtu = dcsp->sd_server->ss_mtu; - csas_len = sizeof(struct scsp_ncsa) + ssp->ss_id_len + - ssp->ss_ckey_len; - len = sizeof(struct scsp_nhdr) + sizeof(struct scsp_nmcp) + - 2 * ssp->ss_id_len + - csas_len * (csusp->csu_mcp.rec_cnt + 1); - for (csasp = dcsp->sd_crl; - csasp && ((len + csas_len) < mtu); - csasp = next_csasp, len += csas_len) { - next_csasp = csasp->next; - csusp->csu_mcp.rec_cnt++; - UNLINK(csasp, Scsp_csa, dcsp->sd_crl, next); - LINK2TAIL(csasp, Scsp_csa, csusp->csu_csa_rec, next); - csasp->hops = 1; - } - - /* - * Send the CSUS message and save a pointer to it in case - * it needs to be retransmitted - */ - rc = scsp_send_msg(dcsp, csus_msg); - if (rc == 0) { - /* - * Success--Save a pointer to the message and - * start the CSUS retransmit timer - */ - dcsp->sd_csus_rexmt_msg = csus_msg; - HARP_TIMER(&dcsp->sd_csus_rexmt_t, - dcsp->sd_csus_rexmt_int, - scsp_csus_retran_timeout); - } else { - /* - * Error--free the CSUS message - */ - scsp_free_msg(csus_msg); - } - - return(rc); -} - - -/* - * Send a CSU Request message - * - * Arguments: - * dcsp pointer to DCS block for DCS - * csap pointer to CSAs to include - * - * Returns: - * 0 message sent OK - * else errno indicating reason for failure - * - */ -int -scsp_send_csu_req(dcsp, csap) - Scsp_dcs *dcsp; - Scsp_csa *csap; -{ - int rc; - Scsp_server *ssp = dcsp->sd_server; - Scsp_csa *cnt_csap; - Scsp_msg *csu_msg; - Scsp_csu_msg *csup; - Scsp_csu_rexmt *rxp; - - /* - * Return if CSA list is empty - */ - if (!csap) - return(0); - - /* - * Get memory for a CSU Req message - */ - csu_msg = calloc(1, sizeof(Scsp_msg)); - if (csu_msg == NULL) - scsp_mem_err("scsp_send_csu_req: sizeof(Scsp_msg)"); - csup = calloc(1, sizeof(Scsp_csu_msg)); - if (csup == NULL) - scsp_mem_err("scsp_send_csu_req: sizeof(Scsp_csu_msg)"); - - /* - * Get memory for a CSU Req retransmission queue entry - */ - rxp = calloc(1, sizeof(Scsp_csu_rexmt)); - if (rxp == NULL) - scsp_mem_err("scsp_send_csu_req: sizeof(Scsp_csu_rexmt)"); - - /* - * Fill out constant fields - */ - csu_msg->sc_msg_type = SCSP_CSU_REQ_MSG; - csu_msg->sc_csu_msg = csup; - csup->csu_mcp.pid = ssp->ss_pid; - csup->csu_mcp.sgid = ssp->ss_sgid; - csup->csu_mcp.sid = ssp->ss_lsid; - csup->csu_mcp.rid = dcsp->sd_dcsid; - - /* - * Put the CSA list into the message - */ - csup->csu_csa_rec = csap; - for (cnt_csap = csap; cnt_csap; cnt_csap = cnt_csap->next) { - csup->csu_mcp.rec_cnt++; - } - - /* - * Send the CSU Request - */ - rc = scsp_send_msg(dcsp, csu_msg); - if (rc) { - scsp_free_msg(csu_msg); - return(rc); - } - free(csu_msg); - free(csup); - - /* - * Save the CSA entries on the CSU Request retransmission - * queue and start the retransmission timer - */ - rxp->sr_dcs = dcsp; - rxp->sr_csa = csap; - HARP_TIMER(&rxp->sr_t, dcsp->sd_csu_rexmt_int, - scsp_csu_req_retran_timeout); - LINK2TAIL(rxp, Scsp_csu_rexmt, dcsp->sd_csu_rexmt, sr_next); - - return(0); -} - - -/* - * Send a CSU Reply message - * - * Arguments: - * dcsp pointer to DCS block for DCS - * csap pointer to CSAs to include - * - * Returns: - * 0 message sent OK - * errno reason for failure - * - */ -int -scsp_send_csu_reply(dcsp, csap) - Scsp_dcs *dcsp; - Scsp_csa *csap; -{ - int rc; - Scsp_server *ssp = dcsp->sd_server; - Scsp_csa *csap1; - Scsp_msg *csu_msg; - Scsp_csu_msg *csup; - - /* - * Return if CSA list is empty - */ - if (!csap) - return(0); - - /* - * Get memory for a CSU Reply message - */ - csu_msg = calloc(1, sizeof(Scsp_msg)); - if (csu_msg == NULL) - scsp_mem_err("scsp_send_csu_reply: sizeof(Scsp_msg)"); - csup = calloc(1, sizeof(Scsp_csu_msg)); - if (csup == NULL) - scsp_mem_err("scsp_send_csu_reply: sizeof(Scsp_csu_msg)"); - - /* - * Fill out constant fields - */ - csu_msg->sc_msg_type = SCSP_CSU_REPLY_MSG; - csu_msg->sc_csu_msg = csup; - csup->csu_mcp.pid = ssp->ss_pid; - csup->csu_mcp.sgid = ssp->ss_sgid; - csup->csu_mcp.sid = ssp->ss_lsid; - csup->csu_mcp.rid = dcsp->sd_dcsid; - - /* - * Put the CSA list into the message. Convert the CSAs into - * CSASs by freeing the protocol-specific portion. - */ - csup->csu_csa_rec = csap; - for (csap1 = csap; csap1; csap1 = csap1->next) { - switch(dcsp->sd_server->ss_pid) { - /* - * We currently only support ATMARP - */ - case SCSP_PROTO_ATMARP: - if (csap1->atmarp_data) { - free(csap1->atmarp_data); - csap1->atmarp_data = - (Scsp_atmarp_csa *)0; - } - break; - } - csup->csu_mcp.rec_cnt++; - } - - /* - * Send the CSU Reply - */ - rc = scsp_send_msg(dcsp, csu_msg); - scsp_free_msg(csu_msg); - - return(rc); -} - - -/* - * Send a Hello message - * - * Arguments: - * dcsp pointer to DCS control block - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_send_hello(dcsp) - Scsp_dcs *dcsp; -{ - int rc; - Scsp_msg *hello; - Scsp_hello *hp; - - /* - * Get memory for a Hello message - */ - hello = calloc(1, sizeof(Scsp_msg)); - if (hello == NULL) - scsp_mem_err("scsp_send_hello: sizeof(Scsp_msg)"); - hp = calloc(1, sizeof(Scsp_hello)); - if (hp == NULL) - scsp_mem_err("scsp_send_hello: sizeof(Scsp_hello)"); - - /* - * Set up the Hello message - */ - hello->sc_msg_type = SCSP_HELLO_MSG; - hello->sc_hello = hp; - hp->hello_int = SCSP_HELLO_Interval; - hp->dead_factor = SCSP_HELLO_DF; - hp->family_id = dcsp->sd_server->ss_fid; - hp->hello_mcp.pid = dcsp->sd_server->ss_pid; - hp->hello_mcp.sgid = dcsp->sd_server->ss_sgid; - hp->hello_mcp.flags = 0; - hp->hello_mcp.rec_cnt = 0; - hp->hello_mcp.sid = dcsp->sd_server->ss_lsid; - hp->hello_mcp.rid = dcsp->sd_dcsid; - - /* - * Send and free the message - */ - rc = scsp_send_msg(dcsp, hello); - scsp_free_msg(hello); - - return(rc); -} Property changes on: head/usr.sbin/atm/scspd/scsp_msg.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scspd.8 =================================================================== --- head/usr.sbin/atm/scspd/scspd.8 (revision 179307) +++ head/usr.sbin/atm/scspd/scspd.8 (nonexistent) @@ -1,632 +0,0 @@ -.\" -.\" =================================== -.\" 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$ -.\" -.Dd August 21, 1998 -.Dt SCSPD 8 -.Os -.Sh NAME -.Nm scspd -.Nd "SCSP daemon" -.Sh SYNOPSIS -.Nm -.Op Fl f Aq Ar cfg\-file -.Op Fl d -.Op Fl T Ns Aq Ar options -.Sh DESCRIPTION -The -.Nm -utility is an implementation of the Server Cache Synchronization -Protocol (SCSP) for the Host ATM Research Platform (HARP) -networking software. -The -.Nm -utility synchronizes the cache(s) of server(s) -running on a host with the caches of servers on remote hosts. -SCSP is defined for a number of different protocols, but the present -version of -.Nm -only supports ATMARP. -.Pp -By using -.Nm -and -.Xr atmarpd 8 , -one can provide multiple -ATMARP servers in a single ATM LIS. -This might be useful, for example, when a LIS consists of a number of -local-area ATM networks connected by long-distance links. -Each local-area network could have its own ATMARP server, with all the -servers' caches being synchronized by SCSP. -Then, if a long-distance link fails, hosts on a local-area network -will still have connectivity to other local hosts (since they all use -the local ATMARP server); when the long-distance link is restored, -SCSP will re-synchronize the servers' caches, restoring -connectivity to remote hosts. -Both -.Nm -and -.Xr atmarpd 8 -must be running before any ATMARP -cache synchronization can take place. -.Pp -The -.Nm -utility implements SCSP as specified in RFC 2334, -.%T "Server Cache Synchronization Protocol (SCSP)" -and -.Pa draft\-ietf\-ion\-scspd\-atmarpd\-00.txt , -.%T "A Distributed ATMARP Service using SCSP" . -.Pp -When -.Nm -starts, it parses its command line and puts -itself into the background. -.Sh TERMINOLOGY -Some of the vocabulary associated with SCSP can be confusing. -In this document, the following definitions are used: -.Pp -.Em "Client server" -or -.Em "local server" -means the server running on -the same host as -.Nm -whose cache is to be synchronized with that -of one or more remote servers. -When the word -.Em server -is used alone, it means -.Em "client server" . -.Pp -.Em "Remote server" -means a server running on some host other than -the one where -.Nm -is running. -.Pp -.Em "Directly Connected Server" -(DCS) means a remote server that -.Nm -communicates with directly. -The remote server will also be running an implementation of SCSP. -.Pp -.Em "Cache Alignment" -(CA) has two meanings. -The Cache Alignment protocol is a part of the SCSP protocol -specification, and the Cache Alignment finite state machine (FSM) -is a finite state machine that implements the Cache Alignment -protocol. -.Sh OPTIONS -The command-line options are: -.Bl -tag -width "-f " -.It Fl f Aq Ar cfg\-file -Specifies the name of the configuration file. -If this option is not specified, -.Nm -looks for the -file -.Pa /etc/scspd.conf . -.It Fl d -Specifies that -.Nm -is to be run in debug mode. -In debug mode, the daemon is not put into the background. -Log messages are written to standard output instead of to -the log file specified in the configuration file. -.It Fl T Ns Aq Ar options -Specifies that -.Nm -will trace specified events and messages -as it executes. -The -.Fl T -flag is followed by one or more of the following -options: -.Pp -.Bl -tag -width 4n -compact -.It Cm c -trace -.Nm Ns 's -CA Finite State Machine (FSM), -.It Cm h -trace -.Nm Ns 's -Hello FSM, -.It Cm i -trace -.Nm Ns 's -Client Interface FSM, -.It Cm C -trace CA, CSUS, CSU Request, and CSU Reply messages, -.It Cm H -trace Hello messages, -.It Cm I -trace interface messages to and from -.Nm Ns 's -clients. -.El -.El -.Sh CONFIGURATION -The configuration file consists of a sequence of configuration -statements. -These statements specify information about the servers, -both local and remote, whose -caches are to be synchronized by -.Nm . -RFC 2334, -.%T "Server Cache Synchronization Protocol (SCSP)" -and -.Pa draft\-ietf\-ion\-scspd\-atmarpd\-00.txt , -.%T "A Distributed ATMARP Service using SCSP" -will be valuable in understanding how to configure -.Nm . -.Pp -A configuration statement other than a comment is terminated by a -semicolon. -Some statements contain blocks, delimited by braces -.No ( Dq Li { -and -.Dq Li } ) . -Configuration statement keywords are not case-sensitive, -but some parameters (e.g.\& interface names) are. -Configuration statements can span multiple lines. -.Ss Comments -Three types of comments are allowed: -.Bl -hang -.It Sy "# comments" : -any characters from -.Dq Li # -to the end of the line are ignored. -.It Sy "C comments" : -any characters between -.Dq Li /* -and -.Dq Li */ -are ignored. -.It Sy "C++ comments" : -any characters from -.Dq Li // -to the end of the line are ignored. -.El -.Ss Statements -The configuration statements recognized by -.Nm -are: -.Bd -literal -Server { - Protocol ; - Netif ; - ServerGroupID ; - FamilyID ; - DCS { - ATMaddr ; - ID ; - CAReXmitInt ; - CSUSReXmitInt ; - CSUReXmitInt ; - CSUReXmitMax ; - HelloDead ; - HelloInt ; - Hops ; - }; -}; - -Log { - File ; - Syslog; -}; -.Ed -.Pp -Where a host address needs to be specified in the configuration file, -either a DNS name or an IP address in dotted decimal format can -be used. -.Pp -ATM addresses are specified as strings of hex digits, with an -optional leading -.Dq Li 0x . -Fields within the address may be separated by periods, but periods -are for readability only and are ignored. -ATM addresses are 20 bytes long. -The full address, including any leading zeroes, must be given. -For example: -.Pp -.Dl "0x47.0005.80.ffe100.0000.f21a.0170.0020481a0170.00" -.Ss "Server Statement" -The -.Ic server -statement specifies a client server whose cache -to be synchronized with the caches of other servers -running on remote hosts. -There will be one -.Ic server -statement in the configuration file -for each client server whose cache is to be synchronized by -.Nm . -The format of the -.Ic server -statement is: -.Bd -ragged -offset indent -.Ic Server -.Aq Ar name -{ -.Aq Ar statements -}; -.Ed -.Pp -A -.Ar name -must be specified on the -.Ic server -statement, but it is -not used by -.Nm . -It is expected to give a brief description of the server's purpose. -.Pp -The -.Ic server -statement has several sub-statements -that specify the details of the -.Nm Ns 's -configuration. -They are: -.Bl -tag -width indent -.It Ic Protocol Cm ATMARP ; -The only protocol supported by the current version of -.Nm -is -.Cm ATMARP . -The -.Ic protocol -statement must always be specified. -.It Ic Netif Aq Ar intf ; -The -.Ic netif -statement specifies the name of the ATM network -interface on which a client server is providing service. -The -.Ic netif -statement must always be specified. -.It Ic ServerGroupID Aq Ar ID ; -The -.Ic ServerGroupID -statement specifies an identifier for the -group of servers being synchronized by -.Nm . -The -.Ar ID -is specified as a decimal number in the range 0 - 65,535. -The server group ID must be the same for all servers whose caches -are being synchronized by an SCSP session. -That is, the server group ID for a host must be the same for all -Directly Connected Servers (DCSs) pointed to within a -.Ic server -statement. -The -.Ic ServerGroupID -statement must always be specified. -.It Ic FamilyID Aq Ar ID ; -The -.Ic familyID -statement specifies an identifier for a family -of parallel SCSP sessions running between a group of hosts (i.e., a -set of SCSP sessions with different protocol IDs but the same set -of servers). -The -.Ar ID -is specified as a decimal number in the range 0 - 65,535. -The family ID is currently not used by -.Nm . -.El -.Ss "DCS Statement" -The -.Ic DCS -statement is a sub-statement of the -.Ic server -statement -that specifies the characteristics of a Directly Connected Server (DCS). -The -.Ic server -statement will have one -.Ic DCS -statement for -each DCS that -.Nm -is to exchange information with. -The -.Ic DCS -statement has a number of sub-statements that specify the -details of the configuration for the DCS. -They are: -.Bl -tag -width indent -.It Ic ATMaddr Aq Ar ATM\ address ; -The -.Ic ATMaddr -statement specifies the ATM address of the DCS. -The -.Ic ATMaddr -statement must always be specified. -.It Ic ID Aq Ar host ; -The -.Ic ID -statement specifies the SCSP identifier of the DCS. -For ATMARP, the ID is the IP address or DNS name associated with the -ATM interface of the DCS. -The -.Ic ID -statement must always be specified. -.It Ic CAReXmitInt Aq Ar int ; -The -.Ic CAReXmitInt -statement specifies the interval that is -allowed to elapse between retransmissions of CA messages. -If a CA message is sent and an acknowledgement is not received within -.Ic CAReXmitInt -seconds, the message will be retransmitted. -The default value for -.Ic CAReXmitInt -is 3 seconds. -.It Ic CSUSReXmitInt Aq Ar int ; -The -.Ic CSUSReXmitInt -statement specifies the interval that is -allowed to elapse between retransmissions of CSU Solicit messages. -When a CSUS message is sent, any Cache State Advertisements (CSAs) -requested by the CSUS that have -not been received within -.Ic CSUSReXmitInt -seconds will be requested -again by another CSUS message. -The default value for -.Ic CSUSReXmitInt -is 3 seconds. -Be careful not to confuse -.Ic CSUSReXmitInt -and -.Ic CSUReXmitInt . -.It Ic CSUReXmitInt Aq Ar int ; -The -.Ic CSUReXmitInt -statement specifies the interval that is -allowed to elapse between retransmissions of CSU Request messages. -When a CSU Request message is sent, any CSAs that are not acknowledged -by a CSU Reply message within -.Ic CSUReXmitInt -seconds will -be retransmitted. -The default value for -.Ic CSUReXmitInt -is 2 seconds. -Be careful not to confuse -.Ic CSUReXmitInt -and -.Ic CSUSReXmitInt . -.It Ic CSUReXmitMax Aq Ar cnt ; -The -.Ic CSUReXmitMax -statement specifies the number of times that -a CSA will be retransmitted as described above before SCSP gives up -on the CSA and discards it. -The default value for -.Ic CSUReXmitMax -is 5. -.It Ic HelloDead Aq Ar cnt ; -The -.Ic HelloDead -statement specifies the Hello Dead Factor that -will be sent to the DCS in Hello messages. -A -.Dq "DCS down" -condition will be detected when nothing is received from -a DCS in -.Ic HelloDead No * Ic HelloInt -seconds. -The default value for -.Ic HelloDead -is 3. -.It Ic HelloInt Aq Ar int ; -The -.Ic HelloInt -statement specifies the Hello Interval that -will be sent to the DCS in Hello messages. -The default value for -.Ic HelloInt -is 3 seconds. -.It Ic Hops Aq Ar cnt ; -The -.Ic Hops -statement specifies the number of hops (DCS to DCS) -that will be specified in CSAs originating from the local server. -This number must be at least as large as the diameter of the -server group. -That is, it must be large enough for a CSA to be propagated from -server to server all the way across the server group. -The default value for -.Ic Hops -is 3. -.El -.Ss "Log Statement" -The -.Ic log -statement specifies how -.Nm -is to log -information about its operation. -The -.Nm -utility can write log information to a file, to the system log, -or both. -.Bl -tag -width indent -.It Ic File Aq Ar file\ name ; -The -.Ic file -statement specifies that -.Nm -is to write -its log messages to the named file. -Log messages will be appended to the end of the file if -it already exists. -.It Ic Syslog ; -The -.Ic syslog -statement specifies that -.Nm -is to write -its log messages to the syslog facility. -The -.Nm -utility writes its messages to syslog with a facility code -of -.Dv LOG_DAEMON . -.El -.Pp -If no -.Ic log -statement is specified, -.Nm -writes log -messages to the system log. -If both -.Ic file -and -.Ic syslog -are specified, -.Nm -will -write log messages to both the named file and the system log. -.Ss Examples -An example of a simple configuration file for -.Nm -might be: -.Bd -literal -offset indent -server atmarp_ni0 { - protocol ATMARP; - netif ni0; - ServerGroupID 23; - DCS { - ID 10.1.1.2; - ATMaddr 0x47.0005.80.ffdc00.0000.0002.0001.002048061de7.00; - hops 2; - }; -}; -.Ed -.Pp -This configuration would synchronize the cache of the ATMARP server -operating on network interface ni0 with the cache of a second server -running on a host whose IP address is 10.1.1.2. -Log messages would be written to the system log. -.Sh SIGNAL PROCESSING -The following signals can be used to control -.Nm : -.Bl -tag -width indent -.It Dv SIGHUP -Reread the configuration file and restart -.Nm . -.It Dv SIGINT -Dump debugging information to a file. -When it receives a -.Dv SIGINT -signal, -.Nm -dumps a summary of -its control blocks to a text file (see -.Sx FILES ) . -.El -.Sh FILES -.Bl -tag -width indent -.It Pa /etc/scspd.conf -.Nm -default configuration file name. -A different file name can be specified with the -.Fl f -command-line -option. -.It Xo -.Sm off -.Pa /tmp/scspd. -.Aq Ar pid -.Pa \&. -.Aq Ar seq -.Pa .out -.Sm on -.Xc -debugging information dump file name. -The -.Nm -utility writes a summary of its control blocks to this file -when it receives a -.Dv SIGINT -signal. -.Aq Ar pid -is the process ID of the daemon and -.Aq Ar seq -is a sequence -number which is incremented every time a dump is taken. -.It Xo -.Sm off -.Pa /tmp/scspd. -.Aq Ar pid -.Pa .trace -.Sm on -.Xc -trace file. -The -.Nm -utility writes trace information to this file if the -.Fl T -option is specified on the command line. -.El -.Sh SEE ALSO -.Xr atm 8 , -.Xr atmarpd 8 -.Rs -.%O "RFC 2334" -.%T "Server Cache Synchronization Protocol (SCSP)" -.Re -.Rs -.%O "draft\-ietf\-ion\-scsp\-atmarpd\-00.txt" -.%T "A Distributed ATMARP Service Using SCSP" -.Re -.Sh COPYRIGHT -Copyright (c) 1994-1998, Network Computing Services, Inc. -.Sh AUTHORS -.An John Cavanaugh , -Network Computing Services, Inc. -.An Mike Spengler , -Network Computing Services, Inc. -.An Joe Thomas , -Network Computing Services, Inc. -.Sh ACKNOWLEDGMENTS -This software was developed with the support of the Defense -Advanced Research Projects Agency (DARPA). -.Sh BUGS -If -.Nm -terminates and is restarted, there will be a period of -instability while previously-synchronized cache entries time out and are -refreshed. -.Pp -Please report any bugs to -.Aq harp\-bugs@magic.net . Property changes on: head/usr.sbin/atm/scspd/scspd.8 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_msg.h =================================================================== --- head/usr.sbin/atm/scspd/scsp_msg.h (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_msg.h (nonexistent) @@ -1,461 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP message formats - * - */ - -#ifndef _SCSP_SCSP_MSG_H -#define _SCSP_SCSP_MSG_H - - -/* - * ATMARP constants - */ -#define ARP_ATMFORUM 19 -#define ARP_TL_TMASK 0x40 /* Type mask */ -#define ARP_TL_NSAPA 0x00 /* Type = ATM Forum NSAPA */ -#define ARP_TL_E164 0x40 /* Type = E.164 */ -#define ARP_TL_LMASK 0x3f /* Length mask */ - - -/* - * SCSP version number - */ -#define SCSP_VER_1 1 - - -/* - * SCSP message types - */ -#define SCSP_CA_MSG 1 -#define SCSP_CSU_REQ_MSG 2 -#define SCSP_CSU_REPLY_MSG 3 -#define SCSP_CSUS_MSG 4 -#define SCSP_HELLO_MSG 5 - - -/* - * SCSP Client Protocol IDs - */ -#define SCSP_PROTO_ATMARP 1 -#define SCSP_PROTO_NHRP 2 -#define SCSP_PROTO_MARS 3 -#define SCSP_PROTO_DHCP 4 -#define SCSP_PROTO_LNNI 5 - - -/* - * Extension types - */ -#define SCSP_EXT_END 0 -#define SCSP_EXT_AUTH 1 -#define SCSP_EXT_VENDOR 2 - -/* - * Sequence number bounds - */ -#define SCSP_CSA_SEQ_MIN 0x80000001 -#define SCSP_CSA_SEQ_MAX 0x7FFFFFFF - - -/* - * Sender, Receiver, or Originator ID lengths - */ -#define SCSP_ATMARP_ID_LEN 4 -#define SCSP_NHRP_ID_LEN 4 -#define SCSP_MAX_ID_LEN 4 - - -/* - * Cache Key lengths - */ -#define SCSP_ATMARP_KEY_LEN 4 -#define SCSP_NHRP_KEY_LEN 4 -#define SCSP_MAX_KEY_LEN 4 - - -/* - * Fixed header - */ -struct scsp_nhdr { - u_char sh_ver; /* SCSP version */ - u_char sh_type; /* Message type */ - u_short sh_len; /* Message length */ - u_short sh_checksum; /* IP checksum over message */ - u_short sh_ext_off; /* Offset of first extension */ -}; - - -/* - * Mandatory common part - */ -struct scsp_nmcp { - u_short sm_pid; /* Protocol ID */ - u_short sm_sgid; /* Server group ID */ - u_short sm_fill_0; /* Unused */ - u_short sm_flags; /* Flags--see below */ - u_char sm_sid_len; /* Sender ID length */ - u_char sm_rid_len; /* Receiver ID length */ - u_short sm_rec_cnt; /* Number of records */ -#ifdef NOTDEF - /* Variable length fields */ - u_char sm_sid[]; /* Sender ID (variable) */ - u_char sm_rid[]; /* Receiver ID (variable) */ -#endif -}; - - -/* - * Extensions part - */ -struct scsp_next { - u_short se_type; /* Extension type */ - u_short se_len; /* Length */ -#ifdef NOTDEF - /* Variable length fields */ - u_char se_value[]; /* Extension value */ -#endif -}; - - -/* - * Cache State Advertisement record or - * Cache State Advertisement Summary record - */ -struct scsp_ncsa { - u_short scs_hop_cnt; /* Hop count */ - u_short scs_len; /* Record length */ - u_char scs_ck_len; /* Cache key length */ - u_char scs_oid_len; /* Originator ID length */ - u_short scs_nfill; /* Null bit and filler */ - long scs_seq; /* Sequence number */ -#ifdef NOTDEF - /* Variable length fields */ - u_char scs_ckey[]; /* Cache key */ - u_char scs_oid[]; /* Originator ID */ - u_char scs_proto[]; /* Protocol-specific (in CSA) */ -#endif -}; - -#define SCSP_CSAS_NULL 0x8000 - - -/* - * Cache Alignment message - */ -struct scsp_nca { - long sca_seq; /* Sequence number */ - struct scsp_nmcp sca_mcp; /* Mandatory common */ -#ifdef NOTDEF - /* Variable length fields */ - struct scsp_ncsa sca_rec[]; /* CSASs */ -#endif -}; - -#define SCSP_CA_M 0x8000 /* Master/Slave bit */ -#define SCSP_CA_I 0x4000 /* Initialization bit */ -#define SCSP_CA_O 0x2000 /* More bit */ - - -/* - * Cache State Update Request, Cache State Update Reply, or - * Cache State Update Solicit message - */ -struct scsp_ncsu_msg { - struct scsp_nmcp scr_mcp; /* Mandatory common */ -#ifdef NOTDEF - /* Variable length fields */ - struct scsp_ncsa scr_rec[]; /* CSAs */ -#endif -}; - - -/* - * Hello message - */ -struct scsp_nhello { - u_short sch_hi; /* Hello interval */ - u_short sch_df; /* Dead factor */ - u_short sch_fill_0; /* Unused */ - u_short sch_fid; /* Family ID */ - struct scsp_nmcp sch_mcp; /* Mandatory common */ -#ifdef NOTDEF - /* Variable-length fields */ - struct scsp_nrid sch_rid[]; /* Receiver IDs */ -#endif -}; - - -/* - * ATMARP-specific Cache State Advertisement record - */ -struct scsp_atmarp_ncsa { - u_short sa_hrd; /* Hardware type -- 0x0013 */ - u_short sa_pro; /* Protocol type -- 0x0800 */ - u_char sa_shtl; /* Src ATM addr type/len */ - u_char sa_sstl; /* Src ATM subaddr type/len */ - u_char sa_state; /* State */ - u_char sa_fill1; /* Unused */ - u_char sa_spln; /* Src proto addr type */ - u_char sa_thtl; /* Tgt ATM addr type/len */ - u_char sa_tstl; /* Tgt ATM subaddr type/len */ - u_char sa_tpln; /* Tgt proto addr len */ -#ifdef NOTDEF - /* Variable-length fields */ - u_char sa_sha[]; /* Source ATM addr */ - u_char sa_ssa[]; /* Source ATM subaddr */ - u_char sa_spa[]; /* Source IP addr */ - u_char sa_tha[]; /* Target ATM addr */ - u_char sa_tsa[]; /* Target ATM subaddr */ - u_char sa_tpa[]; /* Target IP addr */ -#endif -}; - - -/* - * NHRP-specific Cache State Advertisement record - */ -struct scsp_nhrp_ncsa { - u_short sn_af; /* Address family */ - u_short sn_pro; /* NHRP protocol type */ - u_char sn_snap[5]; /* SNAP header */ - u_char sn_ver; /* NHRP version no. */ - u_short sn_flags; /* Flags */ - u_long sn_rid; /* Request ID */ - u_char sn_state; /* State */ - u_char sn_pln; /* Prefix length */ - u_short sn_fill1; /* Unused */ - u_short sn_mtu; /* MTU */ - u_short sn_hold; /* Holding time */ - u_char sn_csatl; /* Client addr type/len */ - u_char sn_csstl; /* Client subaddr type/len */ - u_char sn_cpln; /* Client proto addr len */ - u_char sn_pref; /* Preference for next hop */ -#ifdef NOTDEF - /* Variable-length fields */ - u_char sn_csa[]; /* Client subnetwork addr */ - u_char sn_css[]; /* Client subnetwork subaddr */ - u_char sn_cpa[]; /* Client protocol addr */ -#endif -}; - - -/* - * SCSP messages in internal format - * - * - * Fixed message header - */ -struct scsp_hdr { - u_char msg_type; /* Message type */ -}; -typedef struct scsp_hdr Scsp_hdr; - - -/* - * Sender or Receiver ID structure - */ -struct scsp_id { - struct scsp_id *next; /* Next ID */ - u_char id_len; /* ID length */ - u_char id[SCSP_MAX_ID_LEN]; /* ID */ -}; -typedef struct scsp_id Scsp_id; - - -/* - * Cacke Key structure - */ -struct scsp_ckey { - u_char key_len; /* Cache key length */ - u_char key[SCSP_MAX_KEY_LEN]; /* Cache key */ -}; -typedef struct scsp_ckey Scsp_ckey; - - -/* - * Mandatory common part - */ -struct scsp_mcp { - u_short pid; /* Protocol ID */ - u_short sgid; /* Server group ID */ - u_short flags; /* Flags */ - u_short rec_cnt; /* No. of records attached */ - Scsp_id sid; /* Sender ID */ - Scsp_id rid; /* Receiver ID */ -}; -typedef struct scsp_mcp Scsp_mcp; - - -/* - * Extensions part - */ -struct scsp_ext { - struct scsp_ext *next; /* Next extension */ - u_short type; /* Extension type */ - u_short len; /* Length */ -#ifdef NOTDEF - /* Variable length fields */ - u_char value[]; /* Extension value */ -#endif -}; -typedef struct scsp_ext Scsp_ext; - - -/* - * Cache State Advertisement record or - * Cache State Advertisement Summary record - */ -struct scsp_csa { - struct scsp_csa *next; /* Next CSAS record */ - u_short hops; /* Hop count */ - u_char null; /* Null flag */ - u_long seq; /* CSA seq. no. */ - Scsp_ckey key; /* Cache key */ - Scsp_id oid; /* Originator ID */ - int trans_ct; /* No. of times CSA sent */ - struct scsp_atmarp_csa *atmarp_data; /* ATMARP data */ -#ifdef NOTDEF - struct scsp_nhrp_csa *nhrp_data; /* NHRP data */ -#endif -}; -typedef struct scsp_csa Scsp_csa; - -/* - * Macro to free a CSA and any associated protocol-specific data - */ -#define SCSP_FREE_CSA(c) \ -{ \ - if ((c)->atmarp_data) \ - free((c)->atmarp_data); \ - free((c)); \ -} - - -/* - * Cache Alignment message - */ -struct scsp_ca { - long ca_seq; /* CA msg sequence no. */ - u_char ca_m; /* Master/slave bit */ - u_char ca_i; /* Initialization bit */ - u_char ca_o; /* More bit */ - Scsp_mcp ca_mcp; /* Mandatory common part */ - Scsp_csa *ca_csa_rec; /* Ptr. to CSAS records */ -}; -typedef struct scsp_ca Scsp_ca; - - -/* - * Cache State Update Request, Cache State Update Reply, or - * Cache State Update Solicit message - */ -struct scsp_csu_msg { - Scsp_mcp csu_mcp; /* Mandatory common part */ - Scsp_csa *csu_csa_rec; /* Ptr. to CSA records */ -}; -typedef struct scsp_csu_msg Scsp_csu_msg; - - -/* - * Hello message - */ -struct scsp_hello { - u_short hello_int; /* Hello interval */ - u_short dead_factor; /* When is DCS dead? */ - u_short family_id; /* Family ID */ - Scsp_mcp hello_mcp; /* Mandatory common part */ -}; -typedef struct scsp_hello Scsp_hello; - - -/* - * NHRP-specific Cache State Advertisement record - */ -struct scsp_nhrp_csa { - u_char req_id; /* Request ID */ - u_char state; /* State */ - u_char pref_len; /* Prefix length */ - u_short flags; /* See below */ - u_short mtu; /* Maximim transmission unit */ - u_short hold_time; /* Entry holding time */ - u_char caddr_tlen; /* Client addr type/length */ - u_char csaddr_tlen; /* Client subaddr type/length */ - u_char cproto_len; /* Client proto addr length */ - u_char pref; /* Preference */ - Atm_addr caddr; /* Client address */ - Atm_addr csaddr; /* Client subaddress */ - struct in_addr cproto_addr; /* Client protocol address */ -}; -typedef struct scsp_nhrp Scsp_nhrp; - -#define SCSP_NHRP_UNIQ 0x8000 -#define SCSP_NHRP_ARP 0x4000 - - -/* - * ATMARP-specific Cache State Advertisement record - */ -struct scsp_atmarp_csa { - u_char sa_state; /* State */ - Atm_addr sa_sha; /* Source ATM addr */ - Atm_addr sa_ssa; /* Source ATM subaddr */ - struct in_addr sa_spa; /* Source IP addr */ - Atm_addr sa_tha; /* Target ATM addr */ - Atm_addr sa_tsa; /* Target ATM subaddr */ - struct in_addr sa_tpa; /* Target IP addr */ -}; -typedef struct scsp_atmarp_csa Scsp_atmarp_csa; - - -/* - * SCSP message - */ -struct scsp_msg { - Scsp_hdr sc_hdr; - union { - Scsp_ca *sc_u_ca; - Scsp_csu_msg *sc_u_csu_msg; - Scsp_hello *sc_u_hello; - } sc_msg_u; - Scsp_ext *sc_ext; -}; -typedef struct scsp_msg Scsp_msg; - -#define sc_msg_type sc_hdr.msg_type -#define sc_ca sc_msg_u.sc_u_ca -#define sc_csu_msg sc_msg_u.sc_u_csu_msg -#define sc_hello sc_msg_u.sc_u_hello - -#endif /* _SCSP_SCSP_MSG_H */ Property changes on: head/usr.sbin/atm/scspd/scsp_msg.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_timer.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_timer.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_timer.c (nonexistent) @@ -1,265 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Timer processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Process an SCSP Open timeout - * - * The open timer is set when an attempt to open a VCC to a DCS fails. - * This routine will be called when the timer fires and will retry - * the open. Retries can continue indefinitely. - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_open_timeout(stp) - Harp_timer *stp; -{ - Scsp_dcs *dcsp; - - /* - * Back off to start of DCS entry - */ - dcsp = (Scsp_dcs *) ((caddr_t)stp - - (int)(&((Scsp_dcs *)0)->sd_open_t)); - - /* - * Retry the connection - */ - if (scsp_dcs_connect(dcsp)) { - /* - * Connect failed -- we hope the error was temporary - * and set the timer to try again later - */ - HARP_TIMER(&dcsp->sd_open_t, SCSP_Open_Interval, - scsp_open_timeout); - } -} - - -/* - * Process an SCSP Hello timeout - * - * The Hello timer fires every SCSP_HELLO_Interval seconds. This - * routine will notify the Hello FSM when the timer fires. - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_hello_timeout(stp) - Harp_timer *stp; -{ - Scsp_dcs *dcsp; - - /* - * Back off to start of DCS entry - */ - dcsp = (Scsp_dcs *) ((caddr_t)stp - - (int)(&((Scsp_dcs *)0)->sd_hello_h_t)); - - /* - * Call the Hello FSM - */ - (void)scsp_hfsm(dcsp, SCSP_HFSM_HELLO_T, (Scsp_msg *)0); - - return; -} - - -/* - * Process an SCSP receive timeout - * - * The receive timer is started whenever the Hello FSM receives a - * Hello message from its DCS. If the timer fires, it means that no - * Hello messages have been received in the DCS's Hello interval. - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_hello_rcv_timeout(stp) - Harp_timer *stp; -{ - Scsp_dcs *dcsp; - - /* - * Back off to start of DCS entry - */ - dcsp = (Scsp_dcs *) ((caddr_t)stp - - (int)(&((Scsp_dcs *)0)->sd_hello_rcv_t)); - - /* - * Call the Hello FSM - */ - (void)scsp_hfsm(dcsp, SCSP_HFSM_RCV_T, (void *)0); - - return; -} - - -/* - * Process an SCSP CA retransmit timeout - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_ca_retran_timeout(stp) - Harp_timer *stp; -{ - Scsp_dcs *dcsp; - - /* - * Back off to start of DCS entry - */ - dcsp = (Scsp_dcs *) ((caddr_t)stp - - (int)(&((Scsp_dcs *)0)->sd_ca_rexmt_t)); - - /* - * Call the CA FSM - */ - (void)scsp_cafsm(dcsp, SCSP_CAFSM_CA_T, (void *)0); - - return; -} - - -/* - * Process an SCSP CSUS retransmit timeout - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_csus_retran_timeout(stp) - Harp_timer *stp; -{ - Scsp_dcs *dcsp; - - /* - * Back off to start of DCS entry - */ - dcsp = (Scsp_dcs *) ((caddr_t)stp - - (int)(&((Scsp_dcs *)0)->sd_csus_rexmt_t)); - - /* - * Call the CA FSM - */ - (void)scsp_cafsm(dcsp, SCSP_CAFSM_CSUS_T, (void *)0); - - return; -} - - -/* - * Process an SCSP CSU Req retransmit timeout - * - * Arguments: - * stp pointer to an SCSP timer block - * - * Returns: - * None - * - */ -void -scsp_csu_req_retran_timeout(stp) - Harp_timer *stp; -{ - Scsp_csu_rexmt *rxp; - Scsp_dcs *dcsp; - - /* - * Back off to start of CSU Request retransmission entry - */ - rxp = (Scsp_csu_rexmt *) ((caddr_t)stp - - (int)(&((Scsp_csu_rexmt *)0)->sr_t)); - dcsp = rxp->sr_dcs; - - /* - * Call the CA FSM - */ - (void)scsp_cafsm(dcsp, SCSP_CAFSM_CSU_T, (void *)rxp); - - return; -} Property changes on: head/usr.sbin/atm/scspd/scsp_timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_hfsm.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_hfsm.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_hfsm.c (nonexistent) @@ -1,577 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * HELLO finite state machine - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * HELLO FSM actions - */ -#define HELLO_ACTION_CNT 7 -int scsp_hello_act_00(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_01(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_02(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_03(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_04(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_05(Scsp_dcs *, Scsp_msg *); -int scsp_hello_act_06(Scsp_dcs *, Scsp_msg *); - -static int (*scsp_action_vector[HELLO_ACTION_CNT])() = { - scsp_hello_act_00, - scsp_hello_act_01, - scsp_hello_act_02, - scsp_hello_act_03, - scsp_hello_act_04, - scsp_hello_act_05, - scsp_hello_act_06 -}; - -/* - * HELLO FSM state table - */ -static int hello_state_table[SCSP_HFSM_EVENT_CNT][SCSP_HFSM_STATE_CNT] = { - /* 0 1 2 3 */ - { 1, 1, 1, 1 }, /* 0 */ - { 0, 2, 2, 2 }, /* 1 */ - { 0, 3, 3, 3 }, /* 2 */ - { 0, 0, 4, 4 }, /* 3 */ - { 0, 5, 5, 6 }, /* 4 */ -}; - -/* - * HELLO finite state machine - * - * Arguments: - * dcsp pointer to a DCS control block for the neighbor - * event the event which has occurred - * msg pointer to received message, if there is one - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hfsm(dcsp, event, msg) - Scsp_dcs *dcsp; - int event; - Scsp_msg *msg; -{ - int action, rc, state; - - /* - * Select an action from the state table - */ - state = dcsp->sd_hello_state; - action = hello_state_table[event][state]; - if (scsp_trace_mode & SCSP_TRACE_HFSM) { - scsp_trace("HFSM: state=%d, event=%d, action=%d\n", - state, event, action); - } - if (action >= HELLO_ACTION_CNT || action <= 0) { - scsp_log(LOG_ERR, "Hello FSM--invalid action %d; state=%d, event=%d", - action, dcsp->sd_hello_state, event); - abort(); - } - - /* - * Perform the selected action - */ - rc = scsp_action_vector[action](dcsp, msg); - - return(rc); -} - - -/* - * HELLO finite state machine action 0 - * Unexpected action -- log an error message - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message (ignored) - * - * Returns: - * EOPNOTSUPP always returns EOPNOTSUPP - * - */ -int -scsp_hello_act_00(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - scsp_log(LOG_ERR, "Hello FSM error--unexpected action, state=%d", - dcsp->sd_hello_state); - return(EOPNOTSUPP); -} - - -/* - * HELLO finite state machine action 1 - * VCC open -- send HELLO message, start hello timer, go to Waiting - * state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message (ignored) - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_01(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc; - - /* - * Cancel the VCC open timer if it's running - */ - HARP_CANCEL(&dcsp->sd_open_t); - - /* - * Go to Waiting state - */ - dcsp->sd_hello_state = SCSP_HFSM_WAITING; - - /* - * Send a Hello message - */ - rc = scsp_send_hello(dcsp); - if (rc == 0) { - /* - * Success--start the Hello timer - */ - HARP_TIMER(&dcsp->sd_hello_h_t, SCSP_HELLO_Interval, - scsp_hello_timeout); - } - - return(rc); -} - - -/* - * HELLO finite state machine action 2 - * VCC closed -- notify CA FSM, go to Down state, try to re-open VCC - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message (ignored) - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_02(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc; - - /* - * Cancel any current timers - */ - HARP_CANCEL(&dcsp->sd_hello_h_t); - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - - /* - * Log the loss of the VCC - */ - if (dcsp->sd_hello_state > SCSP_HFSM_WAITING) { - scsp_log(LOG_ERR, "VC to %s closed", - format_atm_addr(&dcsp->sd_addr)); - } - - /* - * Tell the CA FSM that the conection to the DCS is lost - */ - rc = scsp_cafsm(dcsp, SCSP_CAFSM_HELLO_DOWN, (void *)0); - - /* - * Go to Down state - */ - dcsp->sd_hello_state = SCSP_HFSM_DOWN; - - /* - * If our ID is lower than the DCS's, wait a second before - * trying to connect. This should keep both of us from - * trying to connect at the same time, resulting in two - * VCCs being open. - */ - if (scsp_cmp_id(&dcsp->sd_server->ss_lsid, - &dcsp->sd_dcsid) < 0) { - /* - * Our ID is lower--start the VCC open timer for one - * second so we'll try to open the VCC if the DCS - * doesn't do it by then - */ - HARP_TIMER(&dcsp->sd_open_t, 1, scsp_open_timeout); - } else { - /* - * Our ID is higher--try to reopen the VCC immediately - */ - if (scsp_dcs_connect(dcsp)) { - /* - * Conncect failed -- set a timer and try - * again later - */ - HARP_TIMER(&dcsp->sd_open_t, SCSP_Open_Interval, - scsp_open_timeout); - } - } - - return(0); -} - - -/* - * HELLO finite state machine action 3 - * Hello timer expired -- send HELLO message, restart hello timer - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message (ignored) - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_03(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc; - - /* - * Send a Hello message - */ - rc = scsp_send_hello(dcsp); - if (rc == 0) { - /* - * Success--restart the Hello timer - */ - HARP_TIMER(&dcsp->sd_hello_h_t, SCSP_HELLO_Interval, - scsp_hello_timeout); - } - - return(rc); -} - - -/* - * HELLO finite state machine action 4 - * Receive timer expired -- if we haven't received any Hellos, notify - * CA FSM and go to Waiting state; if we've received Hellos, but we - * weren't in the receiver ID list, go to Unidirectional state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message (ignored) - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_04(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc = 0; - - /* - * Check whether we'ver received any Hellos lately - */ - if (dcsp->sd_hello_rcvd) { - /* - * We've had Hellos since the receive timer was - * started--go to Unidirectional state - */ - dcsp->sd_hello_rcvd = 0; - dcsp->sd_hello_state = SCSP_HFSM_UNI_DIR; - } else { - /* - * We haven't seen any Hellos at all from the DCS in - * hello_interval * dead_factor seconds--go to Waiting - * state - */ - dcsp->sd_hello_state = SCSP_HFSM_WAITING; - } - - /* - * Notify the CA FSM - */ - rc = scsp_cafsm(dcsp, SCSP_CAFSM_HELLO_DOWN, (void *)0); - - return(rc); -} - - -/* - * HELLO finite state machine action 5 - * Message received -- Ignore all but HELLO messages; if local server - * is in receiver list, notify CA FSM and go to Bidirectional state; - * otherwise, go to Unidirectional state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_05(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc; - Scsp_id *ridp; - - /* - * Null message pointer means message decode failed, so - * message must have been invalid. Go to Waiting state. - */ - if (msg == (Scsp_msg *)0) { - dcsp->sd_hello_state = SCSP_HFSM_WAITING; - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - return(0); - } - - /* - * Ignore the message if it isn't a Hello - */ - if (msg->sc_msg_type != SCSP_HELLO_MSG) { - return(0); - } - - /* - * Save relevant information about DCS, but don't let him give - * us zero for timeout values - */ - if (msg->sc_hello->hello_int) { - dcsp->sd_hello_int = msg->sc_hello->hello_int; - } else { - dcsp->sd_hello_int = 1; - } - if (msg->sc_hello->dead_factor) { - dcsp->sd_hello_df = msg->sc_hello->dead_factor; - } else { - dcsp->sd_hello_df = 1; - } - dcsp->sd_dcsid = msg->sc_hello->hello_mcp.sid; - - /* - * Check the message for the local server's ID - */ - for (ridp = &msg->sc_hello->hello_mcp.rid; - ridp; - ridp = ridp->next) { - if (scsp_cmp_id(&dcsp->sd_server->ss_lsid, ridp) == 0) { - /* - * Cancel and restart the receive timer - */ - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - HARP_TIMER(&dcsp->sd_hello_rcv_t, - dcsp->sd_hello_int * dcsp->sd_hello_df, - scsp_hello_rcv_timeout); - - /* - * Go to Bidirectional state and notify the - * CA FSM that the connection is up - */ - dcsp->sd_hello_state = SCSP_HFSM_BI_DIR; - rc = scsp_cafsm(dcsp, - SCSP_CAFSM_HELLO_UP, - (void *)0); - return(rc); - } - } - - /* - * We weren't in the receiver ID list, so go to - * Unidirectional state - */ - dcsp->sd_hello_state = SCSP_HFSM_UNI_DIR; - - return(0); -} - - -/* - * HELLO finite state machine action 6 - * Message received -- if message is not a HELLO, pass it to the CA - * FSM; otherwise, if local server is not in receiver list, notify - * CA FSM and go to Unidirectional state - * - * Arguments: - * dcsp pointer to DCS control block - * msg pointer to received message - * - * Returns: - * 0 success - * errno error encountered - * - */ -int -scsp_hello_act_06(dcsp, msg) - Scsp_dcs *dcsp; - Scsp_msg *msg; -{ - int rc = 0, rcv_found; - Scsp_id *ridp; - - /* - * Null message pointer means message decode failed, so - * message must have been invalid. Go to Waiting state. - */ - if (msg == (Scsp_msg *)0) { - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - dcsp->sd_hello_state = SCSP_HFSM_WAITING; - rc = scsp_cafsm(dcsp, SCSP_CAFSM_HELLO_DOWN, (void *)0); - return(rc); - } - - /* - * Process the message depending on its type - */ - switch(msg->sc_msg_type) { - case SCSP_CA_MSG: - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CA_MSG, (void *)msg); - break; - case SCSP_CSU_REQ_MSG: - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CSU_REQ, (void *)msg); - break; - case SCSP_CSU_REPLY_MSG: - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CSU_REPLY, - (void *)msg); - break; - case SCSP_CSUS_MSG: - rc = scsp_cafsm(dcsp, SCSP_CAFSM_CSUS_MSG, (void *)msg); - break; - case SCSP_HELLO_MSG: - /* - * Make sure DCS info is consistent. The sender ID, - * family ID, protocol ID, and server group ID are - * checked. - */ - if (scsp_cmp_id(&msg->sc_hello->hello_mcp.sid, - &dcsp->sd_dcsid) || - (msg->sc_hello->family_id != - dcsp->sd_server->ss_fid) || - (msg->sc_hello->hello_mcp.pid != - dcsp->sd_server->ss_pid) || - (msg->sc_hello->hello_mcp.sgid != - dcsp->sd_server->ss_sgid)) { - /* - * Bad info--revert to waiting state - */ - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - dcsp->sd_hello_state = SCSP_HFSM_WAITING; - rc = scsp_cafsm(dcsp, - SCSP_CAFSM_HELLO_DOWN, - (void *)0); - return(rc); - } - - /* - * Mark the arrival of the Hello message - */ - dcsp->sd_hello_rcvd = 1; - - /* - * Check the message for the local server's ID - */ - for (ridp = &msg->sc_hello->hello_mcp.rid, - rcv_found = 0; - ridp; - ridp = ridp->next) { - rcv_found = (scsp_cmp_id(ridp, - &dcsp->sd_server->ss_lsid) == 0); - } - - if (rcv_found) { - /* - * The LS ID was in the list of receiver IDs-- - * Reset the Hello receive timer - */ - dcsp->sd_hello_rcvd = 0; - HARP_CANCEL(&dcsp->sd_hello_rcv_t); - HARP_TIMER(&dcsp->sd_hello_rcv_t, - dcsp->sd_hello_int * - dcsp->sd_hello_df, - scsp_hello_rcv_timeout); - } - break; - } - - return(rc); -} Property changes on: head/usr.sbin/atm/scspd/scsp_hfsm.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/scsp_config.c =================================================================== --- head/usr.sbin/atm/scspd/scsp_config.c (revision 179307) +++ head/usr.sbin/atm/scspd/scsp_config.c (nonexistent) @@ -1,1158 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * Configuration file processing - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "scsp_msg.h" -#include "scsp_if.h" -#include "scsp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -extern int yyparse(void); - -/* - * Global variables - */ -FILE *cfg_file; -Scsp_server *current_server; -Scsp_dcs *current_dcs; - - -/* - * Process the configuration file - * - * This routine is called when the daemon starts, and it can also be - * called while it is running, as the result of a SIGHUP signal. It - * therefore has to be capable of both configuring the daemon from - * scratch and modifying the configuration of a running daemon. - * - * Arguments: - * cfn configuration file name - * - * Returns: - * 0 configuration read with no errors - * else error found in configuration file - * - */ -int -scsp_config(cfn) - char *cfn; -{ - int rc; - Scsp_server *ssp, *snext; - - /* - * Open the configuration file - */ - cfg_file = fopen(cfn, "r"); - if (!cfg_file) { - scsp_log(LOG_ERR, "can't open config file %s", - (void *)cfn); - exit(1); - } - - /* - * Initialize current interface pointer - */ - current_server = (Scsp_server *)0; - - /* - * Clear marks on any existing servers - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - ssp->ss_mark = 0; - } - - /* - * Scan the configuration file, processing each line as - * it is read - */ - rc = yyparse(); - - /* - * Close the configuration file - */ - fclose(cfg_file); - - /* - * Delete any server entries that weren't updated - */ - for (ssp = scsp_server_head; ssp; ssp = snext) { - snext = ssp->ss_next; - if (!ssp->ss_mark) - scsp_server_delete(ssp); - } - - return(rc); -} - - -/* - * Prepare for SCSP DCS setup - * - * This routine is called from yyparse() when a DCS command is found. - * - * Arguments: - * none - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -start_dcs() -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - /* - * Allocate a DCS block - */ - dcsp = calloc(1, sizeof(Scsp_dcs)); - if (dcsp == NULL) - scsp_mem_err("start_dcs: sizeof(Scsp_dcs)"); - - /* - * Fill out DCS links and default values - */ - dcsp->sd_server = current_server; - dcsp->sd_addr.address_format = T_ATM_ABSENT; - dcsp->sd_subaddr.address_format = T_ATM_ABSENT; - dcsp->sd_sock = -1; - dcsp->sd_ca_rexmt_int = SCSP_CAReXmitInterval; - dcsp->sd_csus_rexmt_int = SCSP_CSUSReXmitInterval; - dcsp->sd_hops = SCSP_CSA_HOP_CNT; - dcsp->sd_csu_rexmt_int = SCSP_CSUReXmitInterval; - dcsp->sd_csu_rexmt_max = SCSP_CSUReXmitMax; - LINK2TAIL(dcsp, Scsp_dcs, current_server->ss_dcs, sd_next); - - current_dcs = dcsp; - return(0); -} - - -/* - * Finish up server configuration - * - * This routine is called from yyparse() to at the end of a DCS - * command. It checks that required fields are set and finishes - * up the DCS block. - * - * Arguments: - * none - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -finish_dcs() -{ - int rc = 0; - Scsp_dcs *dcsp; - Scsp_server *ssp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - ssp = current_server; - dcsp = current_dcs; - - /* - * Make sure the DCS ID is set - */ - if (dcsp->sd_dcsid.id_len == 0) { - parse_error("DCS ID not set"); - rc++; - } - - /* - * Make sure the ATM address is set - */ - if (dcsp->sd_addr.address_format == T_ATM_ABSENT) { - parse_error("DCS ATM address not set"); - rc++; - } - - current_dcs = (Scsp_dcs *)0; - return(rc); -} - - -/* - * Configure DCS ATM address - * - * This routine is called from yyparse() to process an ATMaddr command. - * - * Arguments: - * ap pointer to DCS's ATM address (in ASCII) - * sap pointer to DCS's ATM subaddress (in ASCII) - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_addr(ap, sap) - char *ap, *sap; -{ - Scsp_dcs *dcsp; - Atm_addr addr, subaddr; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - /* - * Initialize - */ - bzero(&addr, sizeof(addr)); - addr.address_format = T_ATM_ABSENT; - bzero(&subaddr, sizeof(subaddr)); - subaddr.address_format = T_ATM_ABSENT; - - /* - * Convert the ATM address from character to internal format - */ - if (ap) { - addr.address_length = get_hex_atm_addr(ap, - (u_char *)addr.address, strlen(ap)); - if (addr.address_length == 0) { - parse_error("invalid ATM address"); - return(1); - } - if (addr.address_length == sizeof(Atm_addr_nsap)) { - addr.address_format = T_ATM_ENDSYS_ADDR; - } else if (addr.address_length <= - sizeof(Atm_addr_e164)) { - addr.address_format = T_ATM_E164_ADDR; - } else { - parse_error("invalid ATM address"); - return(1); - } - } - - /* - * Convert the ATM subaddress from character to internal format - */ - if (sap) { - subaddr.address_length = get_hex_atm_addr(sap, - (u_char *)subaddr.address, strlen(sap)); - if (subaddr.address_length == 0) { - parse_error("invalid ATM address"); - return(1); - } - if (subaddr.address_length == sizeof(Atm_addr_nsap)) { - subaddr.address_format = T_ATM_ENDSYS_ADDR; - } else if (subaddr.address_length <= - sizeof(Atm_addr_e164)) { - subaddr.address_format = T_ATM_E164_ADDR; - } else { - parse_error("invalid ATM subaddress"); - return(1); - } - } - - /* - * Make sure we have a legal ATM address type combination - */ - if (((addr.address_format != T_ATM_ENDSYS_ADDR) || - (subaddr.address_format != T_ATM_ABSENT)) && - ((addr.address_format != T_ATM_E164_ADDR) || - (subaddr.address_format != T_ATM_ENDSYS_ADDR))) { - parse_error("invalid address/subaddress combination"); - return(1); - } - - /* - * Save the address and subaddress - */ - ATM_ADDR_COPY(&addr, &dcsp->sd_addr); - ATM_ADDR_COPY(&subaddr, &dcsp->sd_subaddr); - - return(0); -} - - -/* - * Configure CA retransmit interval for DCS - * - * This routine is called from yyparse() to process a CAReXmitInt - * command. - * - * Arguments: - * val time interval - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_ca_rexmit(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the interval - */ - if (val <= 0 || val > 1024) { - parse_error("invalid CA retransmit interval"); - return(1); - } - - /* - * Set CA retransmit interval - */ - dcsp->sd_ca_rexmt_int = val; - - return(0); -} - - -/* - * Configure CSUS retransmit interval for DCS - * - * This routine is called from yyparse() to process a CSUSReXmitInt - * command. - * - * Arguments: - * val time interval - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_csus_rexmit(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the interval - */ - if (val <= 0 || val > 1024) { - parse_error("invalid CSUS retransmit interval"); - return(1); - } - - /* - * Set CSUS retransmit interval - */ - dcsp->sd_csus_rexmt_int = val; - - return(0); -} - - -/* - * Configure CSU retransmit interval for DCS - * - * This routine is called from yyparse() to process a CSUReXmitInt - * command. - * - * Arguments: - * val time interval - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_csu_rexmit(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the interval - */ - if (val <= 0 || val > 1024) { - parse_error("invalid CSU retransmit interval"); - return(1); - } - - /* - * Set CSU retransmit interval - */ - dcsp->sd_csu_rexmt_int = val; - - return(0); -} - - -/* - * Configure CSU retransmit limit for DCS - * - * This routine is called from yyparse() to process a CSUReXmitMax - * command. - * - * Arguments: - * val time interval - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_csu_rexmit_max(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the interval - */ - if (val <= 0 || val > 1024) { - parse_error("invalid CSU retransmit maximum"); - return(1); - } - - /* - * Set CSU retransmit limit - */ - dcsp->sd_csu_rexmt_max = val; - - return(0); -} - - -/* - * Configure Hello dead factor for DCS - * - * This routine is called from yyparse() to process a HelloDead - * command. - * - * Arguments: - * val number of times Hello interval has to expire before - * a DCS is considered dead - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_hello_df(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the limit - */ - if (val <= 0 || val > 1024) { - parse_error("invalid Hello dead factor"); - return(1); - } - - /* - * Set Hello dead factor - */ - dcsp->sd_hello_df = val; - - return(0); -} - - -/* - * Configure Hello interval for DCS - * - * This routine is called from yyparse() to process a HelloInt - * command. - * - * Arguments: - * val time interval - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_hello_int(val) - int val; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the interval - */ - if (val <= 0 || val > 1024) { - parse_error("invalid Hello interval"); - return(1); - } - - /* - * Set Hello interval - */ - dcsp->sd_hello_int = val; - - return(0); -} - - -/* - * Configure hop count for SCSP server - * - * This routine is called from yyparse() to process a Hops command. - * - * Arguments: - * hops number of hops - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_hops(hops) - int hops; -{ - Scsp_dcs *dcsp; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - dcsp = current_dcs; - - - /* - * Validate the count - */ - if (hops <= 0 || hops > 1024) { - parse_error("invalid hop count"); - return(1); - } - - /* - * Set hop count - */ - dcsp->sd_hops = hops; - - return(0); -} - - -/* - * Configure DCS ID - * - * This routine is called from yyparse() to process an ID command. - * - * Arguments: - * name pointer to DCS's DNS name or IP address (in ASCII) - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_dcs_id(name) - char *name; -{ - Scsp_dcs *dcsp; - Scsp_server *ssp; - struct sockaddr_in *ip_addr; - - /* - * Make sure we have a current server block and DCS block - */ - if (!current_server) { - parse_error("server not found"); - return(1); - } - - if (!current_dcs) { - parse_error("server not found"); - return(1); - } - ssp = current_server; - dcsp = current_dcs; - - /* - * Convert the DNS name or IP address - */ - ip_addr = get_ip_addr(name); - if (!ip_addr) { - parse_error("invalid DCS IP address"); - return(1); - } - - /* - * Verify the address length - */ - if (ssp->ss_id_len != sizeof(ip_addr->sin_addr)) { - parse_error("invalid DCS ID length"); - return(1); - } - - /* - * Set the ID in the DCS block - */ - dcsp->sd_dcsid.id_len = ssp->ss_id_len; - bcopy(&ip_addr->sin_addr, dcsp->sd_dcsid.id, ssp->ss_id_len); - - return(0); -} - - -/* - * Configure network interface for SCSP server - * - * This routine is called from yyparse() to process a Netif command. - * It verifies the network interface name, gets interface information - * from the kernel, and sets the appropriate fields in the server - * control block. - * - * Arguments: - * netif pointer to network interface name - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_intf(netif) - char *netif; -{ - int rc; - Scsp_server *ssp; - - /* - * Get the current network interface address - */ - ssp = current_server; - if (!ssp) { - parse_error("Server not found"); - rc = 1; - goto set_intf_done; - } - - /* - * Make sure we're configuring a valid - * network interface - */ - rc = verify_nif_name(netif); - if (rc == 0) { - parse_error("%s is not a valid network interface", - (void *)netif); - rc = 1; - goto set_intf_done; - } else if (rc < 0) { - scsp_log(LOG_ERR, "Netif name verify error"); - exit(1); - } - - /* - * Save the server's network interface name - */ - strcpy(ssp->ss_intf, netif); - rc = 0; - -set_intf_done: - return(rc); -} - - -/* - * Configure protocol for SCSP server - * - * This routine is called from yyparse() to process a Protocol command. - * - * Arguments: - * proto SCSP protocol being configured - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_protocol(proto) - int proto; -{ - Scsp_server *ssp; - - /* - * Get address of current server block - */ - ssp = current_server; - if (!ssp) { - parse_error("server not found"); - return(1); - } - - /* - * Process based on protocol ID - */ - switch(proto) { - case SCSP_PROTO_ATMARP: - ssp->ss_pid = proto; - ssp->ss_id_len = SCSP_ATMARP_ID_LEN; - ssp->ss_ckey_len = SCSP_ATMARP_KEY_LEN; - break; - case SCSP_PROTO_NHRP: - ssp->ss_pid = proto; - ssp->ss_id_len = SCSP_NHRP_ID_LEN; - ssp->ss_ckey_len = SCSP_NHRP_KEY_LEN; - break; - case SCSP_PROTO_MARS: - case SCSP_PROTO_DHCP: - case SCSP_PROTO_LNNI: - default: - parse_error("invalid protocol"); - return(1); - } - - return(0); -} - - -/* - * Configure server group for SCSP server - * - * This routine is called from yyparse() to process a ServerGroupID - * command. - * - * Arguments: - * sgid server group id - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_server_group(sgid) - int sgid; -{ - Scsp_server *ssp; - - /* - * Get address of current server block - */ - ssp = current_server; - if (!ssp) { - parse_error("server not found"); - return(1); - } - - /* - * Validate server group ID - */ - if (sgid <= 0) { - parse_error("invalid server group ID"); - return(1); - } - - /* - * Save the ID - */ - ssp->ss_sgid = sgid; - - return(0); -} - - -/* - * Prepare for SCSP server setup - * - * This routine is called from yyparse() when a Server statment is - * found. - * - * Arguments: - * name pointer to LIS name - * - * Returns: - * 0 success - * else error encountered - * - */ -int -start_server(name) - char *name; -{ - int i; - Scsp_server *ssp; - Scsp_dcs *dcsp, *next_dcs; - Scsp_cse *csep, *next_cse; - - /* - * See if we already have an entry for this name - */ - for (ssp = scsp_server_head; ssp; ssp = ssp->ss_next) { - if (strcasecmp(ssp->ss_name, name) == 0) - break; - } - - if (ssp) { - /* - * Log the fact that we're updating the entry - */ - scsp_log(LOG_INFO, "updating server entry for %s", - (void *)name); - - /* - * Free the existing cache - */ - for (i = 0; i < SCSP_HASHSZ; i++) { - for (csep = ssp->ss_cache[i]; csep; - csep = next_cse) { - next_cse = csep->sc_next; - UNLINK(csep, Scsp_cse, ssp->ss_cache[i], - sc_next); - free(csep); - } - } - - /* - * Delete existing DCS blocks - */ - for (dcsp = ssp->ss_dcs; dcsp; dcsp = next_dcs) { - next_dcs = dcsp->sd_next; - scsp_dcs_delete(dcsp); - } - } else { - /* - * Get a new server entry - */ - ssp = calloc(1, sizeof(Scsp_server)); - if (ssp == NULL) { - scsp_log(LOG_ERR, "unable to allocate server entry"); - exit(1); - } - ssp->ss_sock = -1; - ssp->ss_dcs_lsock = -1; - - /* - * Set the name - */ - ssp->ss_name = strdup(name); - - /* - * Link in the new interface entry - */ - LINK2TAIL(ssp, Scsp_server, scsp_server_head, - ss_next); - } - - /* - * If the mark is already set, this is a duplicate command - */ - if (ssp->ss_mark) { - parse_error("duplicate server \"%s\"", name); - return(1); - } - - /* - * Make this the current interface - */ - current_server = ssp; - - return(0); -} - - -/* - * Finish up server configuration - * - * This routine is called from yyparse() when the end of a server - * statement is reached. It checks that required fields are set - * and marks the entry as processed. - * - * Arguments: - * None - * - * Returns: - * 0 OK - * 1 Error - * - */ -int -finish_server() -{ - int rc = 0; - Scsp_server *ssp; - - /* - * Get the current network interface address - */ - ssp = current_server; - if (!ssp) { - parse_error("Server not found"); - rc++; - } - - /* - * Mark the interface as processed - */ - ssp->ss_mark = 1; - - /* - * Make sure the interface has been configured - */ - if (ssp->ss_intf == (char *)0) { - parse_error("netif missing from server specification"); - rc++; - } - - /* - * Make sure the protocol is set - */ - if (ssp->ss_pid == 0) { - parse_error("protocol missing from server specification"); - rc++; - } - - /* - * Make sure the server group is set - */ - if (ssp->ss_sgid == 0) { - parse_error("server group ID missing from server specification"); - rc++; - } - - /* - * Make sure at least one DCS is configured - */ - if (ssp->ss_dcs == (Scsp_dcs *)0) { - parse_error("no DCS configured for server"); - rc++; - } - - /* - * Mark the end of the server - */ - current_server = (Scsp_server *)0; - - return(rc); -} - - -/* - * Configure log file for SCSP server - * - * This routine is called from yyparse() to process a log File command. - * - * Arguments: - * file name of logging file - * - * Returns: - * 0 success - * 1 error encountered - * - */ -int -set_log_file(file) - char *file; -{ - /* - * Make sure we haven't already got a log file - */ - if (scsp_log_file) { - parse_error("multiple log files specified"); - return(1); - } - - /* - * Open the file - */ - scsp_log_file = fopen(file, "a"); - if (!scsp_log_file) { - parse_error("can't open log file"); - return(1); - } - - return(0); -} Property changes on: head/usr.sbin/atm/scspd/scsp_config.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/scspd/Makefile =================================================================== --- head/usr.sbin/atm/scspd/Makefile (revision 179307) +++ head/usr.sbin/atm/scspd/Makefile (nonexistent) @@ -1,41 +0,0 @@ -# =================================== -# 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$ - -PROG= scspd -MAN= scspd.8 -SRCS= scspd.c scsp_cafsm.c scsp_config.c scsp_config_lex.c \ - scsp_config_parse.y \ - scsp_hfsm.c scsp_if.c scsp_input.c scsp_log.c scsp_msg.c \ - scsp_output.c scsp_print.c scsp_socket.c scsp_subr.c \ - scsp_timer.c - -CFLAGS+= -I. -I${.CURDIR}/../../../sys -I${.CURDIR} - -LDADD= -latm -lmd -DPADD= ${LIBATM} ${LIBMD} - -YFLAGS= -d - -.include Property changes on: head/usr.sbin/atm/scspd/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/Makefile.inc =================================================================== --- head/usr.sbin/atm/Makefile.inc (revision 179307) +++ head/usr.sbin/atm/Makefile.inc (nonexistent) @@ -1,26 +0,0 @@ -# =================================== -# 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$ - -.include "../Makefile.inc" Property changes on: head/usr.sbin/atm/Makefile.inc ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_var.h =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_var.h (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_var.h (nonexistent) @@ -1,224 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: control blocks - * - */ - -#ifndef _ATMARP_ATMARP_VAR_H -#define _ATMARP_ATMARP_VAR_H - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* - * Operational constants - */ -#define ATMARP_DIR "/tmp" -#define ATMARP_SOCK_PREFIX "AA_" -#define ATMARP_CACHE_INTERVAL 50 -#define ATMARP_PERM_INTERVAL 600 -#define ATMARP_KEEPALIVE_INTERVAL 5 - - -/* - * Macros for manipulating ATMARP tables and entries - */ -#define ATMARP_HASHSIZ 19 /* Hash table size */ - -#define ATMARP_HASH(ip) ((u_long)(ip) % ATMARP_HASHSIZ) - -#define ATMARP_ADD(ai, aa) \ -{ \ - Atmarp **h; \ - h = &ai->ai_arptbl[ATMARP_HASH((aa)->aa_dstip.s_addr)]; \ - LINK2TAIL((aa), Atmarp, *h, aa_next); \ -} - -#define ATMARP_DELETE(ai, aa) \ -{ \ - Atmarp **h; \ - h = &ai->ai_arptbl[ATMARP_HASH((aa)->aa_dstip.s_addr)]; \ - UNLINK((aa), Atmarp, *h, aa_next); \ -} - -#define ATMARP_LOOKUP(ai, ip, aa) \ -{ \ - for ((aa) = (ai)->ai_arptbl[ATMARP_HASH(ip)]; \ - (aa); (aa) = (aa)->aa_next) { \ - if ((aa)->aa_dstip.s_addr == (ip)) \ - break; \ - } \ -} - - -/* - * Macro to compare originator ID structures - */ -#define OID_EQUAL(id1, id2) \ - (((id1)->id_len == (id2)->id_len) && \ - (bcmp((caddr_t)(id1)->id, \ - (caddr_t)(id2)->id, \ - (id1)->id_len) == 0)) - -#define KEY_EQUAL(key1, key2) \ - (((key1)->key_len == (key2)->key_len) && \ - (bcmp((caddr_t)(key1)->key, \ - (caddr_t)(key2)->key, \ - (key1)->key_len) == 0)) - - -/* - * Interface entry for ATMARP SCSP interface daemon - */ -struct atmarp_intf { - struct atmarp_intf *ai_next; /* Next chained I/F */ - char ai_intf[IFNAMSIZ]; /* Network I/F name */ - struct in_addr ai_ip_addr; /* IP address */ - struct in_addr ai_subnet_mask; /* Subnet mask */ - int ai_mtu; /* IP MTU */ - Atm_addr ai_atm_addr; /* ATM address */ - Atm_addr ai_atm_subaddr; /* ATM subaddress */ - int ai_scsp_sock; /* Socket to SCSP */ - Harp_timer ai_keepalive_t; /* Keepalive timer */ - char *ai_scsp_sockname; /* Socket name */ - u_char ai_state; /* Interface state */ - u_char ai_mark; - struct atmarp *ai_arptbl[ATMARP_HASHSIZ]; /* ARP cache */ -}; -typedef struct atmarp_intf Atmarp_intf; - -#define AI_STATE_NULL 0 -#define AI_STATE_UP 1 - - -/* - * Super-LIS control block for ATMARP server daemon - */ -struct atmarp_slis { - struct atmarp_slis *as_next; /* Next super-LIS */ - char *as_name; /* Name of super-LIS */ - int as_cnt; /* LIS count */ - Atmarp_intf *as_intfs; /* List of intfs */ -}; -typedef struct atmarp_slis Atmarp_slis; - - -/* - * ATMARP cache entry format - */ -struct atmarp { - struct atmarp *aa_next; /* Hash chain link */ - struct in_addr aa_dstip; /* Destination IP addr */ - Atm_addr aa_dstatm; /* Destination ATM addr */ - Atm_addr aa_dstatmsub; /* Destination ATM subaddr */ - struct scsp_ckey aa_key; /* SCSP cache key */ - struct scsp_id aa_oid; /* SCSP originator ID */ - long aa_seq; /* SCSP sequence no. */ - Atmarp_intf *aa_intf; /* Interface for entry */ - u_char aa_flags; /* Flags (see below) */ - u_char aa_origin; /* Entry origin */ - char aa_mark; /* Mark */ -}; -typedef struct atmarp Atmarp; - -/* - * ATMARP Entry Flags - */ -#define AAF_PERM 0x01 /* Entry is permanent */ -#define AAF_SERVER 0x02 /* Entry is for the server */ - - -/* - * Global variables - */ -extern char *prog; -extern int atmarp_debug_mode; -extern int atmarp_max_socket; -extern Atmarp_intf *atmarp_intf_head; -extern Atmarp_slis *atmarp_slis_head; -extern FILE *atmarp_log_file; - - -/* - * Function definitions - */ - -/* atmarp_config.c */ -extern int atmarp_cfg_netif(char *); - -/* atmarp_log.c */ -#if __STDC__ -extern void atmarp_log(const int, const char *, ...); -#else -extern void atmarp_log(int, char *, va_alist); -#endif -extern void atmarp_mem_err(char *); - -/* atmarp_scsp.c */ -extern int atmarp_scsp_cache(Atmarp_intf *, Scsp_if_msg *); -extern int atmarp_scsp_update(Atmarp *, int); -extern int atmarp_scsp_update_in(Atmarp_intf *, Scsp_if_msg *); -extern int atmarp_scsp_read(Atmarp_intf *); -extern int atmarp_scsp_out(Atmarp_intf *, char *, int); -extern int atmarp_scsp_connect(Atmarp_intf *); -extern void atmarp_scsp_close(Atmarp_intf *); -extern int atmarp_scsp_disconnect(Atmarp_intf *); - -/* atmarp_subr.c */ -extern Atmarp_intf *atmarp_find_intf_sock(int); -extern Atmarp_intf *atmarp_find_intf_name(char *); -extern void atmarp_clear_marks(); -extern int atmarp_is_server(Atmarp_intf *); -extern int atmarp_if_ready(Atmarp_intf *); -extern Atmarp * atmarp_copy_cache_entry(struct air_arp_rsp *); -extern int atmarp_update_kernel(Atmarp *); -extern void atmarp_get_updated_cache(); -extern void atmarp_process_cache_entry(struct air_arp_rsp *); -extern void print_atmarp_intf(FILE *, Atmarp_intf *); -extern void print_atmarp_cache(FILE *, Atmarp *); -extern void dump_atmarp_cache(FILE *, Atmarp_intf *); -extern void atmarp_sigint(int); - -/* atmarp_timer.c */ -extern void atmarp_cache_timeout(Harp_timer *); -extern void atmarp_perm_timeout(Harp_timer *); -extern void atmarp_keepalive_timeout(Harp_timer *); - - -#endif /* _ATMARP_ATMARP_VAR_H */ Property changes on: head/usr.sbin/atm/atmarpd/atmarp_var.h ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_config.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_config.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_config.c (nonexistent) @@ -1,127 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: configuration support - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Configure network interface for ATMARP cache synchronization - * - * Verify the network interface name and set the appropriate fields - * in the ATMARP interface entry. - * - * Arguments: - * netif pointer to network interface name - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -atmarp_cfg_netif(netif) - char *netif; -{ - int rc; - Atmarp_intf *aip = (Atmarp_intf *)0; - - /* - * Get an ATMARP interface block - */ - aip = calloc(1, sizeof(Atmarp_intf)); - if (aip == NULL) - atmarp_mem_err("atmarp_cfg_netif: sizeof(Atmarp_intf)"); - - /* - * Make sure we're configuring a valid - * network interface - */ - rc = verify_nif_name(netif); - if (rc == 0) { - fprintf(stderr, "%s: \"%s\" is not a valid network interface\n", - prog, netif); - rc = EINVAL; - goto cfg_fail; - } else if (rc < 0) { - rc = errno; - fprintf(stderr, "%s: can't verify network interface \"%s\"\n", - prog, netif); - goto cfg_fail; - } - - /* - * Update the interface entry - */ - strcpy(aip->ai_intf, netif); - aip->ai_state = AI_STATE_NULL; - aip->ai_scsp_sock = -1; - LINK2TAIL(aip, Atmarp_intf, atmarp_intf_head, ai_next); - - return(0); - -cfg_fail: - if (aip) - free(aip); - return(rc); -} Property changes on: head/usr.sbin/atm/atmarpd/atmarp_config.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarpd.8 =================================================================== --- head/usr.sbin/atm/atmarpd/atmarpd.8 (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarpd.8 (nonexistent) @@ -1,172 +0,0 @@ -.\" -.\" =================================== -.\" 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$ -.\" -.\" -.Dd August 4, 1998 -.Dt ATMARPD 8 -.Os -.Sh NAME -.Nm atmarpd -.Nd "ATMARP/SCSP interface daemon" -.Sh SYNOPSIS -.Nm -.Op Fl d -.Op Fl l Aq Ar log_file -.Aq Ar net_intf -.Ar ... -.Sh DESCRIPTION -The -.Nm -utility provides an interface between the ATMARP server in the -kernel and the SCSP daemon for the Host ATM Research Platform -(HARP) networking software. -The -.Nm -utility reads the ATMARP cache from the kernel periodically -and passes any updated entries to -.Xr scspd 8 -so they will be -propagated to remote servers. -It also accepts updated entries that remote servers have sent to -.Xr scspd 8 -and, if they are -new or more up to date than current entries, installs them -in the kernel's ATMARP cache. -Both -.Nm -and -.Xr scspd 8 -must be running before any ATMARP cache synchronization can take place. -.Pp -When -.Nm -starts, it parses its command line and puts -itself into the background. -.Pp -The command-line options are: -.Bl -tag -width "-l " -.It Fl l Aq Ar log_file -Specify that -.Nm -is to write log messages to the -file named -.Aq Ar log_file -rather than to the system log. -.It Fl d -Specify that -.Nm -is to be run in debug mode. -In debug mode, -.Nm -is not put into the background. -Log messages are written to standard output instead of to -the log file. -.It Aq Ar net_intf -Specify the network interface(s) for which the host is providing -ATMARP service and whose caches are to be synchronized using SCSP. -If multiple network interface names are specified, -.Nm -will provide an interface to -.Xr scspd 8 -for the servers on all the -specified interfaces. -.El -.Sh SIGNAL PROCESSING -The following signals can be used to control -.Nm : -.Bl -tag -width indent -.It Dv SIGINT -Dump debugging information to a file. -When it receives a -.Dv SIGINT -signal, -.Nm -dumps a summary of -its control blocks to a text file (see -.Sx FILES ) . -.El -.Sh FILES -.Bl -tag -width indent -.It Xo -.Sm off -.Pa /tmp/atmarpd. -.Aq Ar pid -.Pa \&. -.Aq Ar seq -.Pa .out -.Sm on -.Xc -Debugging information dump file name. -The -.Nm -utility writes a summary of its control blocks to this file -when it receives a -.Dv SIGINT -signal. -.Aq Ar pid -is the process ID of the daemon and -.Aq Ar seq -is a sequence -number which is incremented every time a dump is taken. -.El -.Sh SEE ALSO -.Xr atm 8 , -.Xr scspd 8 -.Rs -.%T "Classical IP and ARP over ATM" -.%O "RFC 1577" -.Re -.Rs -.%T "Classical IP and ARP over ATM" -.%O "RFC 2225" -.Re -.Rs -.%T "Server Cache Synchronization Protocol (SCSP)" -.%O "RFC 2334" -.Re -.Rs -.%T "A Distributed ATMARP Service Using SCSP" -.%O "draft\-ietf\-ion\-scsp\-atmarpd\-00.txt" -.Re -.Sh COPYRIGHT -Copyright (c) 1994-1998, Network Computing Services, Inc. -.Sh AUTHORS -.An John Cavanaugh , -Network Computing Services, Inc. -.An Mike Spengler , -Network Computing Services, Inc. -.An Joe Thomas , -Network Computing Services, Inc. -.Sh ACKNOWLEDGMENTS -This software was developed with the support of the Defense -Advanced Research Projects Agency (DARPA). -.Sh BUGS -Results are unpredictable if multiple instantiations of -.Nm -are run simultaneously for a given network interface. -.Pp -Please report any bugs to -.Aq harp\-bugs@magic.net . Property changes on: head/usr.sbin/atm/atmarpd/atmarpd.8 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_timer.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_timer.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_timer.c (nonexistent) @@ -1,229 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: timer routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Cache update timeout processing - * - * When the cache update timer fires, we read the cache from the - * kernel, update the internal cache, and restart the timer. - * - * Arguments: - * tp pointer to a HARP timer block - * - * Returns: - * None - * - */ -void -atmarp_cache_timeout(tp) - Harp_timer *tp; -{ - Atmarp_intf *aip; - - /* - * Verify the status of all configured interfaces - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - if (atmarp_if_ready(aip)) { - /* - * The interface is up but we don't have - * a connection to SCSP--make a connection - */ - if (aip->ai_state == AI_STATE_NULL) - (void)atmarp_scsp_connect(aip); - } else { - /* - * The interface is down--disconnect from SCSP - */ - if (aip->ai_state != AI_STATE_NULL) - (void)atmarp_scsp_disconnect(aip); - } - } - - /* - * Read the cache from the kernel - */ - atmarp_get_updated_cache(); - - /* - * Restart the cache update timer - */ - HARP_TIMER(tp, ATMARP_CACHE_INTERVAL, atmarp_cache_timeout); -} - - -/* - * Permanent cache entry timer processing - * - * Permanent cache entries (entries that are administratively added - * and the entry for the server itself) don't ever get refreshed, so - * we broadcast updates for them every 10 minutes so they won't get - * deleted from the remote servers' caches - * - * Arguments: - * tp pointer to a HARP timer block - * - * Returns: - * None - * - */ -void -atmarp_perm_timeout(tp) - Harp_timer *tp; -{ - int i, rc; - Atmarp_intf *aip; - Atmarp *aap; - - /* - * Loop through all interfaces - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - /* - * Loop through the interface's cache - */ - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; - aap = aap->aa_next) { - /* - * Find and update permanent entries - */ - if ((aap->aa_flags & (AAF_PERM | - AAF_SERVER)) != 0) { - aap->aa_seq++; - rc = atmarp_scsp_update(aap, - SCSP_ASTATE_UPD); - } - } - } - } - - /* - * Restart the permanent cache entry timer - */ - HARP_TIMER(tp, ATMARP_PERM_INTERVAL, atmarp_perm_timeout); -} - - -/* - * Keepalive timeout processing - * - * When the keepalive timer fires, we send a NOP to SCSP. This - * will help us detect a broken connection. - * - * Arguments: - * tp pointer to a HARP timer block - * - * Returns: - * None - * - */ -void -atmarp_keepalive_timeout(tp) - Harp_timer *tp; -{ - Atmarp_intf *aip; - Scsp_if_msg *msg; - - /* - * Back off to start of DCS entry - */ - aip = (Atmarp_intf *) ((caddr_t)tp - - (int)(&((Atmarp_intf *)0)->ai_keepalive_t)); - - /* - * Get a message buffer - * - * XXX arr: Previously, the check on the returned value from - * the memory allocation routine was checked and _nothing_ - * resulted from the check (which would cause problems since - * the bzero() of NULL is not fun). At the moment, I am having - * it soley return -- this should be reviewed again soon. - */ - msg = calloc(1, sizeof(Scsp_if_msg)); - if (msg == NULL) - return; - - /* - * Build a NOP message - */ - msg->si_type = SCSP_NOP_REQ; - msg->si_proto = SCSP_PROTO_ATMARP; - msg->si_len = sizeof(Scsp_if_msg_hdr); - - /* - * Send the message to SCSP - */ - (void)atmarp_scsp_out(aip, (char *)msg, msg->si_len); - free(msg); - - /* - * Restart the keepalive timer - */ - HARP_TIMER(&aip->ai_keepalive_t, ATMARP_KEEPALIVE_INTERVAL, - atmarp_keepalive_timeout); -} Property changes on: head/usr.sbin/atm/atmarpd/atmarp_timer.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_scsp.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_scsp.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_scsp.c (nonexistent) @@ -1,778 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: SCSP/ATMARP interface code - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Send the cache for a LIS to SCSP - * - * - * Arguments: - * aip pointer to interface block - * - * Returns: - * 0 cache sent to SCSP OK - * errno reason for failure - * - */ -int -atmarp_scsp_cache(aip, msg) - Atmarp_intf *aip; - Scsp_if_msg *msg; -{ - int i, len, rc = 0; - Atmarp *aap; - Scsp_if_msg *smp = (Scsp_if_msg *)0; - Scsp_atmarp_msg *sap; - - /* - * Figure out how big the message needs to be - */ - len = sizeof(Scsp_if_msg_hdr); - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; aap = aap->aa_next) { - len += sizeof(Scsp_atmarp_msg); - } - } - - /* - * Get memory for the cache message - */ - smp = calloc(1, len); - if (smp == NULL) - atmarp_mem_err("atmarp_scsp_cache: len"); - /* - * Set header fields in SCSP message - */ - smp->si_type = SCSP_CACHE_RSP; - smp->si_proto = SCSP_PROTO_ATMARP; - smp->si_len = len; - smp->si_tok = msg->si_tok; - - /* - * Loop through the cache, adding each entry to the SCSP - * Cache Response message - */ - sap = &smp->si_atmarp; - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; aap = aap->aa_next) { - sap->sa_state = SCSP_ASTATE_NEW; - sap->sa_cpa = aap->aa_dstip; - ATM_ADDR_COPY(&aap->aa_dstatm, &sap->sa_cha); - ATM_ADDR_COPY(&aap->aa_dstatmsub, &sap->sa_csa); - sap->sa_key = aap->aa_key; - sap->sa_oid = aap->aa_oid; - sap->sa_seq = aap->aa_seq; - sap++; - } - } - - /* - * Send the message to SCSP - */ - rc = atmarp_scsp_out(aip, (char *)smp, len); - - /* - * Free the message - */ - if (smp) - free(smp); - return(rc); -} - - -/* - * Answer a reqeust for information about a cache entry - * - * Arguments: - * aap pointer to entry - * state entry's new state - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -atmarp_scsp_solicit(aip, smp) - Atmarp_intf *aip; - Scsp_if_msg *smp; -{ - int i, rc = 0; - Atmarp *aap; - Scsp_if_msg *rsp = (Scsp_if_msg *)0; - - /* - * Search the interface's ATMARP cache for an entry with - * the specified cache key and origin ID - */ - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; aap = aap->aa_next) { - if (KEY_EQUAL(&aap->aa_key, - &smp->si_sum.ss_key) && - OID_EQUAL(&aap->aa_oid, - &smp->si_sum.ss_oid)) - break; - } - if (aap) - break; - } - - /* - * Get storage for a Solicit Response - */ - rsp = calloc(1, sizeof(Scsp_if_msg)); - if (rsp == NULL) - atmarp_mem_err("atmarp_scsp_solicit: sizeof(Scsp_if_msg)"); - - /* - * Fill out the Solicit Rsp - */ - rsp->si_type = SCSP_SOLICIT_RSP; - rsp->si_proto = smp->si_proto; - rsp->si_tok = smp->si_tok; - - if (aap) { - /* - * Copy fields from the ATMARP entry to the SCSP - * Update Request message - */ - rsp->si_rc = SCSP_RSP_OK; - rsp->si_len = sizeof(Scsp_if_msg_hdr) + - sizeof(Scsp_atmarp_msg); - rsp->si_atmarp.sa_state = SCSP_ASTATE_UPD; - rsp->si_atmarp.sa_cpa = aap->aa_dstip; - ATM_ADDR_COPY(&aap->aa_dstatm, &rsp->si_atmarp.sa_cha); - ATM_ADDR_COPY(&aap->aa_dstatmsub, &rsp->si_atmarp.sa_csa); - rsp->si_atmarp.sa_key = aap->aa_key; - rsp->si_atmarp.sa_oid = aap->aa_oid; - rsp->si_atmarp.sa_seq = aap->aa_seq; - } else { - /* - * Entry not found--set return code - */ - rsp->si_rc = SCSP_RSP_NOT_FOUND; - rsp->si_len = smp->si_len; - rsp->si_sum = smp->si_sum; - } - - /* - * Send the message to SCSP - */ - rc = atmarp_scsp_out(aip, (char *)rsp, rsp->si_len); - free(rsp); - return(rc); -} - - -/* - * Send a cache update to SCSP - * - * Arguments: - * aap pointer to entry - * state entry's new state - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -atmarp_scsp_update(aap, state) - Atmarp *aap; - int state; -{ - int rc = 0; - Atmarp_intf *aip = aap->aa_intf; - Scsp_if_msg *smp = (Scsp_if_msg *)0; - - /* - * Make sure the connection to SCSP is active - */ - if (aip->ai_state == AI_STATE_NULL) { - return(0); - } - - /* - * Get memory for the cache message - */ - smp = calloc(1, sizeof(Scsp_if_msg)); - if (smp == NULL) - atmarp_mem_err("atmarp_scsp_update: sizeof(Scsp_if_msg)"); - - /* - * Set header fields in SCSP message - */ - smp->si_type = SCSP_UPDATE_REQ; - smp->si_proto = SCSP_PROTO_ATMARP; - smp->si_len = sizeof(Scsp_if_msg_hdr) + sizeof(Scsp_atmarp_msg); - - /* - * Copy fields from the ATMARP entry to the SCSP - * Update Request message - */ - smp->si_atmarp.sa_state = state; - smp->si_atmarp.sa_cpa = aap->aa_dstip; - ATM_ADDR_COPY(&aap->aa_dstatm, &smp->si_atmarp.sa_cha); - ATM_ADDR_COPY(&aap->aa_dstatmsub, &smp->si_atmarp.sa_csa); - smp->si_atmarp.sa_key = aap->aa_key; - smp->si_atmarp.sa_oid = aap->aa_oid; - smp->si_atmarp.sa_seq = aap->aa_seq; - - /* - * Send the message to SCSP - */ - rc = atmarp_scsp_out(aap->aa_intf, (char *)smp, smp->si_len); - - free(smp); - return(rc); -} - - -/* - * Respond to a Cache Update Indication from SCSP - * - * - * Arguments: - * aip pointer to interface control block - * smp pointer to message from SCSP - * - * Returns: - * 0 Message processed OK - * errno Reason for failure - * - */ -int -atmarp_scsp_update_in(aip, smp) - Atmarp_intf *aip; - Scsp_if_msg *smp; -{ - int accept, rc; - Atmarp *aap; - - /* - * Look up the entry - */ - ATMARP_LOOKUP(aip, smp->si_atmarp.sa_cpa.s_addr, aap); - - /* - * Whether we accept the request depends on whether we - * already have an entry for it - */ - if (!aap) { - /* - * We don't have this entry--accept it - */ - accept = 1; - } else { - /* - * We do have an entry for this host--check the - * origin ID - */ - if (bcmp(&aip->ai_ip_addr.s_addr, - smp->si_atmarp.sa_oid.id, - SCSP_ATMARP_ID_LEN) == 0) { - /* - * The received entry originated with us-- - * reject it - */ - accept = 0; - } else if (bcmp(&aip->ai_ip_addr.s_addr, - aap->aa_oid.id, - SCSP_ATMARP_ID_LEN) == 0) { - /* - * We originated the entry we currently have-- - * only accept the new one if SCSP has higher - * priority than the existing entry - */ - accept = aap->aa_origin < UAO_SCSP; - } else { - /* - * Accept the entry if it is more up-to-date - * than the existing entry - */ - accept = KEY_EQUAL(&aap->aa_key, - &smp->si_atmarp.sa_key) && - OID_EQUAL(&aap->aa_oid, - &smp->si_atmarp.sa_oid) && - (aap->aa_seq < smp->si_atmarp.sa_seq); - } - } - - /* - * Add the entry to the cache, if appropriate - */ - if (accept) { - if (!aap) { - /* - * Copy info from SCSP to a new cache entry - */ - aap = calloc(1, sizeof(Atmarp)); - if (aap == NULL) - atmarp_mem_err("atmarp_scsp_update_in: sizeof(Atmarp)"); - - aap->aa_dstip = smp->si_atmarp.sa_cpa; - aap->aa_dstatm = smp->si_atmarp.sa_cha; - aap->aa_dstatmsub = smp->si_atmarp.sa_csa; - aap->aa_key = smp->si_atmarp.sa_key; - aap->aa_oid = smp->si_atmarp.sa_oid; - aap->aa_seq = smp->si_atmarp.sa_seq; - aap->aa_intf = aip; - aap->aa_origin = UAO_SCSP; - - /* - * Add the new entry to our cache - */ - ATMARP_ADD(aip, aap); - } else { - /* - * Update the existing entry - */ - aap->aa_dstip = smp->si_atmarp.sa_cpa; - aap->aa_dstatm = smp->si_atmarp.sa_cha; - aap->aa_dstatmsub = smp->si_atmarp.sa_csa; - aap->aa_key = smp->si_atmarp.sa_key; - aap->aa_oid = smp->si_atmarp.sa_oid; - aap->aa_seq = smp->si_atmarp.sa_seq; - aap->aa_origin = UAO_SCSP; - } - - /* - * Send the updated entry to the kernel - */ - if (atmarp_update_kernel(aap) == 0) - rc = SCSP_RSP_OK; - else - rc = SCSP_RSP_REJ; - } else { - rc = SCSP_RSP_REJ; - } - - /* - * Turn the received message into a response - */ - smp->si_type = SCSP_UPDATE_RSP; - smp->si_rc = rc; - - /* - * Send the message to SCSP - */ - rc = atmarp_scsp_out(aip, (char *)smp, smp->si_len); - - return(rc); -} - - -/* - * Read and process a message from SCSP - * - * - * Arguments: - * aip interface for read - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -atmarp_scsp_read(aip) - Atmarp_intf *aip; -{ - int len, rc = 0; - char *buff = (char *)0; - Scsp_if_msg *smp; - Scsp_if_msg_hdr msg_hdr; - - /* - * Read the header of the message from SCSP - */ - len = read(aip->ai_scsp_sock, (char *)&msg_hdr, - sizeof(msg_hdr)); - if (len == -1) { - rc = errno; - goto read_fail; - } else if (len != sizeof(msg_hdr)) { - rc = EMSGSIZE; - goto read_fail; - } - - /* - * Get a buffer that will hold the message - */ - buff = malloc(msg_hdr.sh_len); - if (buff == NULL) - atmarp_mem_err("atmarp_scsp_read: msg_hdr.sh_len"); - bcopy(&msg_hdr, buff, sizeof(msg_hdr)); - - /* - * Read the rest of the message, if there is more than - * just a header - */ - len = msg_hdr.sh_len - sizeof(msg_hdr); - if (len > 0) { - len = read(aip->ai_scsp_sock, buff + sizeof(msg_hdr), - len); - if (len == -1) { - rc = errno; - goto read_fail; - } else if (len != msg_hdr.sh_len - sizeof(msg_hdr)) { - rc = EMSGSIZE; - goto read_fail; - } - } - - /* - * Handle the message based on its type - */ - smp = (Scsp_if_msg *)buff; - switch(smp->si_type) { - case SCSP_CFG_RSP: - if (smp->si_rc != SCSP_RSP_OK) { - rc = EINVAL; - goto read_fail; - } - break; - case SCSP_CACHE_IND: - rc = atmarp_scsp_cache(aip, smp); - break; - case SCSP_SOLICIT_IND: - rc = atmarp_scsp_solicit(aip, smp); - break; - case SCSP_UPDATE_IND: - rc = atmarp_scsp_update_in(aip, smp); - break; - case SCSP_UPDATE_RSP: - /* - * Ignore Update Responses - */ - break; - default: - atmarp_log(LOG_ERR, "Unexpected SCSP message received"); - return(EOPNOTSUPP); - } - free(buff); - return(rc); - -read_fail: - if (buff) - free(buff); - - /* - * Error on socket to SCSP--close the socket and set the state - * so that we know to retry when the cache timer fires. - */ - atmarp_scsp_close(aip); - - return(rc); -} - - -/* - * Send a message to SCSP - * - * - * Arguments: - * aip pointer to ATMARP interface to send message on - * buff pointer to message buffer - * len length of message - * - * Returns: - * 0 message sent - * errno reason for failure - * - */ -int -atmarp_scsp_out(aip, buff, len) - Atmarp_intf *aip; - char *buff; - int len; -{ - int rc; - - /* - * Send the message to SCSP - */ - rc = write(aip->ai_scsp_sock, buff, len); - if (rc == len) - return(0); - - /* - * Error on write--close the socket to SCSP, clean up and - * set the state so that we know to retry when the cache - * timer fires. - */ - atmarp_scsp_close(aip); - - /* - * Set the return code - */ - if (rc < 0) { - rc = errno; - } else { - rc = EFAULT; - } - - return(rc); -} - - -/* - * Set up a socket and connect to SCSP - * - * Arguments: - * aip pointer to interface block - * - * Returns: - * 0 success, ai_scsp_sock is set - * errno reason for failure - * - * - */ -int -atmarp_scsp_connect(aip) - Atmarp_intf *aip; -{ - int len, rc, sd; - char *sn; - Scsp_if_msg cfg_msg; - - static struct sockaddr local_addr = { -#if (defined(BSD) && (BSD >= 199103)) - sizeof(struct sockaddr), /* sa_len */ -#endif - AF_UNIX, /* sa_family */ - ATMARP_SOCK_PREFIX /* sa_data */ - }; - static struct sockaddr scsp_addr = { -#if (defined(BSD) && (BSD >= 199103)) - sizeof(struct sockaddr), /* sa_len */ -#endif - AF_UNIX, /* sa_family */ - SCSPD_SOCK_NAME /* sa_data */ - }; - - /* - * Construct a name for the socket - */ - strncpy(local_addr.sa_data, ATMARP_SOCK_PREFIX, - sizeof(local_addr.sa_data)); - (void)strncat(local_addr.sa_data, aip->ai_intf, - sizeof(local_addr.sa_data)); - sn = strdup(local_addr.sa_data); - if (!sn) - atmarp_mem_err("atmarp_scsp_connect: strdup"); - - /* - * Clean up any old socket - */ - rc = unlink(sn); - if (rc < 0 && errno != ENOENT) - return(errno); - - /* - * Open a socket to SCSP - */ - sd = socket(PF_UNIX, SOCK_STREAM, 0); - if (sd == -1) { - free(sn); - return(errno); - } - if (sd > atmarp_max_socket) { - atmarp_max_socket = sd; - } - - /* - * Set non-blocking I/O - */ -#ifdef sun - rc = fcntl(sd, F_SETFL, FNBIO + FNDELAY); -#else - rc = fcntl(sd, F_SETFL, O_NONBLOCK); -#endif - if (rc == -1) { - rc = errno; - goto scsp_connect_fail; - } - - /* - * Bind the local socket address - */ - rc = bind(sd, &local_addr, sizeof(local_addr)); - if (rc) { - rc = errno; - goto scsp_connect_fail; - } - - /* - * Connect to SCSP - */ - rc = connect(sd, &scsp_addr, sizeof(scsp_addr)); - if (rc) { - rc = errno; - goto scsp_connect_fail; - } - - /* - * Save socket information in interface control block - */ - aip->ai_scsp_sock = sd; - aip->ai_scsp_sockname = sn; - aip->ai_state = AI_STATE_UP; - - /* - * Send configuration information to SCSP - */ - bzero(&cfg_msg, sizeof(cfg_msg)); - cfg_msg.si_type = SCSP_CFG_REQ; - cfg_msg.si_proto = SCSP_PROTO_ATMARP; - strcpy(cfg_msg.si_cfg.atmarp_netif, aip->ai_intf); - len =sizeof(Scsp_if_msg_hdr) + strlen(aip->ai_intf) + 1; - cfg_msg.si_len = len; - rc = atmarp_scsp_out(aip, (char *)&cfg_msg, len); - if (rc) { - return(rc); - } - - return(0); - -scsp_connect_fail: - (void)close(sd); - aip->ai_scsp_sock = -1; - free(sn); - aip->ai_scsp_sockname = NULL; - aip->ai_state = AI_STATE_NULL; - return(rc); -} - - -/* - * Close a socket connection to SCSP - * - * Arguments: - * aip pointer to interface block for connection to be closed - * - * Returns: - * none - * - * - */ -void -atmarp_scsp_close(aip) - Atmarp_intf *aip; -{ - /* - * Close and unlink the SCSP socket - */ - (void)close(aip->ai_scsp_sock); - aip->ai_scsp_sock = -1; - (void)unlink(aip->ai_scsp_sockname); - free(aip->ai_scsp_sockname); - aip->ai_scsp_sockname = NULL; - - aip->ai_state = AI_STATE_NULL; - - return; -} - - -/* - * Disconnect an interface from SCSP - * - * Arguments: - * aip pointer to interface block for connection to be closed - * - * Returns: - * 0 success, ai_scsp_sock is set - * errno reason for failure - * - * - */ -int -atmarp_scsp_disconnect(aip) - Atmarp_intf *aip; -{ - int i; - Atmarp *aap; - - /* - * Close and unlink the SCSP socket - */ - atmarp_scsp_close(aip); - - /* - * Free the ATMARP cache associated with the interface - */ - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; aap = aap->aa_next) - free(aap); - aip->ai_arptbl[i] = (Atmarp *)0; - } - - return(0); -} Property changes on: head/usr.sbin/atm/atmarpd/atmarp_scsp.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_subr.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_subr.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_subr.c (nonexistent) @@ -1,953 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: misc. subroutines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Find an ATMARP interface, given its socket number - * - * Arguments: - * sd socket descriptor - * - * Returns: - * 0 failure - * else pointer to interface associated with socket - * - */ -Atmarp_intf * -atmarp_find_intf_sock(sd) - int sd; -{ - Atmarp_intf *aip; - - /* - * Loop through the list of interfaces - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - if (aip->ai_scsp_sock == sd) - break; - } - - return(aip); -} - - -/* - * Find an ATMARP interface, given its name - * - * Arguments: - * name pointer to network interface name - * - * Returns: - * 0 failure - * else pointer to interface associated with name - * - */ -Atmarp_intf * -atmarp_find_intf_name(name) - char *name; -{ - Atmarp_intf *aip; - - /* - * Loop through the list of interfaces - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - if (strcmp(name, aip->ai_intf) == 0) - break; - } - - return(aip); -} - - -/* - * Clear the mark field on all ATMARP cache entries - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atmarp_clear_marks() - -{ - int i; - Atmarp_intf *aip; - Atmarp *aap; - - /* - * Loop through list of interfaces - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - /* - * Clear mark on every entry in the interface's cache - */ - for (i = 0; i < ATMARP_HASHSIZ; i++ ) { - for (aap = aip->ai_arptbl[i]; aap; - aap = aap->aa_next) { - aap->aa_mark = 0; - } - } - } -} - - -/* - * Check whether the host system is an ATMARP server for - * the LIS associated with a given interface - * - * Arguments: - * aip pointer to an ATMARP interface control block - * - * Returns: - * 1 host is a server - * 0 host is not a server - * - */ -int -atmarp_is_server(aip) - Atmarp_intf *aip; -{ - int rc; - size_t buf_len; - struct atminfreq air; - struct air_asrv_rsp *asrv_info; - - /* - * Get interface information from the kernel - */ - strcpy(air.air_int_intf, aip->ai_intf); - air.air_opcode = AIOCS_INF_ASV; - buf_len = do_info_ioctl(&air, sizeof(struct air_asrv_rsp)); - if ((ssize_t)buf_len == -1) - return(0); - - /* - * Check the interface's ATMARP server address - */ - asrv_info = (struct air_asrv_rsp *) air.air_buf_addr; - rc = (asrv_info->asp_addr.address_format == T_ATM_ABSENT) && - (asrv_info->asp_subaddr.address_format == - T_ATM_ABSENT); - free(asrv_info); - return(rc); -} - - -/* - * Check whether an interface is up and ready for service - * - * Arguments: - * aip pointer to network interface block - * - * Returns: - * 0 interface not ready, errno has reason - * 1 interface is ready to go (interface block is updated) - * - */ -int -atmarp_if_ready(aip) - Atmarp_intf *aip; -{ - int i, mtu, rc, sel; - size_t len; - Atmarp *aap = (Atmarp *)0; - struct atminfreq air; - struct air_netif_rsp *netif_rsp = (struct air_netif_rsp *)0; - struct air_int_rsp *intf_rsp = (struct air_int_rsp *)0; - struct sockaddr_in *ip_addr; - struct sockaddr_in subnet_mask; - Atm_addr_nsap *anp; - - /* - * Get the IP address and physical interface name - * associated with the network interface - */ - bzero(&air, sizeof(struct atminfreq)); - air.air_opcode = AIOCS_INF_NIF; - strcpy(air.air_netif_intf, aip->ai_intf); - len = do_info_ioctl(&air, sizeof(struct air_netif_rsp)); - if ((ssize_t)len == -1) - goto if_ready_fail; - netif_rsp = (struct air_netif_rsp *)air.air_buf_addr; - - ip_addr = (struct sockaddr_in *)&netif_rsp->anp_proto_addr; - if (ip_addr->sin_family != AF_INET || - ip_addr->sin_addr.s_addr == 0) { - errno = EAFNOSUPPORT; - goto if_ready_fail; - } - - /* - * Get the MTU for the network interface - */ - mtu = get_mtu(aip->ai_intf); - if (mtu < 0) { - goto if_ready_fail; - } - - - /* - * Get the subnet mask associated with the - * network interface - */ - rc = get_subnet_mask(aip->ai_intf, &subnet_mask); - if (rc || subnet_mask.sin_family != AF_INET) { - goto if_ready_fail; - } - - /* - * Get physical interface information - */ - bzero(&air, sizeof(struct atminfreq)); - air.air_opcode = AIOCS_INF_INT; - strcpy(air.air_int_intf, netif_rsp->anp_phy_intf); - len = do_info_ioctl(&air, sizeof(struct air_int_rsp)); - if ((ssize_t)len == -1) - goto if_ready_fail; - intf_rsp = (struct air_int_rsp *)air.air_buf_addr; - - /* - * Check the signalling manager - */ - if (intf_rsp->anp_sig_proto != ATM_SIG_UNI30 && - intf_rsp->anp_sig_proto != ATM_SIG_UNI31 && - intf_rsp->anp_sig_proto != ATM_SIG_UNI40) { - errno = EINVAL; - goto if_ready_fail; - } - - /* - * Check the interface state - */ - if (intf_rsp->anp_sig_state != UNISIG_ACTIVE) { - errno = EINVAL; - goto if_ready_fail; - } - - /* - * Check the address format - */ - if (intf_rsp->anp_addr.address_format != T_ATM_ENDSYS_ADDR && - !(intf_rsp->anp_addr.address_format == - T_ATM_E164_ADDR && - intf_rsp->anp_subaddr.address_format == - T_ATM_ENDSYS_ADDR)) { - errno = EINVAL; - goto if_ready_fail; - } - - /* - * Find the selector byte value for the interface - */ - for (i=0; iai_intf); i++) { - if (aip->ai_intf[i] >= '0' && - aip->ai_intf[i] <= '9') - break; - } - sel = atoi(&aip->ai_intf[i]); - - /* - * Make sure we're the server for this interface's LIS - */ - if (!atmarp_is_server(aip)) { - rc = EINVAL; - goto if_ready_fail; - } - - /* - * If we already have the interface active and the address - * hasn't changed, return - */ - if (aip->ai_state != AI_STATE_NULL && - bcmp((caddr_t) &((struct sockaddr_in *) - &netif_rsp->anp_proto_addr)->sin_addr, - (caddr_t)&aip->ai_ip_addr, - sizeof(aip->ai_ip_addr)) == 0 && - ATM_ADDR_EQUAL(&intf_rsp->anp_addr, - &aip->ai_atm_addr) && - ATM_ADDR_EQUAL(&intf_rsp->anp_subaddr, - &aip->ai_atm_subaddr)) { - return(1); - } - - /* - * Delete any existing ATMARP cache entry for this interface - */ - ATMARP_LOOKUP(aip, aip->ai_ip_addr.s_addr, aap); - if (aap) { - ATMARP_DELETE(aip, aap); - free(aap); - } - - /* - * Update the interface entry - */ - aip->ai_ip_addr = ((struct sockaddr_in *) - &netif_rsp->anp_proto_addr)->sin_addr; - aip->ai_subnet_mask = subnet_mask.sin_addr; - aip->ai_mtu = mtu + 8; - ATM_ADDR_COPY(&intf_rsp->anp_addr, - &aip->ai_atm_addr); - ATM_ADDR_COPY(&intf_rsp->anp_subaddr, - &aip->ai_atm_subaddr); - anp = (Atm_addr_nsap *)aip->ai_atm_addr.address; - if (aip->ai_atm_addr.address_format == T_ATM_ENDSYS_ADDR) { - anp->aan_sel = sel; - } else if (aip->ai_atm_addr.address_format == - T_ATM_E164_ADDR && - aip->ai_atm_subaddr.address_format == - T_ATM_ENDSYS_ADDR) { - anp->aan_sel = sel; - } - - /* - * Get a new ATMARP cache for the interface - */ - aap = calloc(1, sizeof(Atmarp)); - if (aap == NULL) - atmarp_mem_err("atmarp_if_ready: sizeof(Atmarp)"); - - /* - * Fill out the entry - */ - aap->aa_dstip = aip->ai_ip_addr; - ATM_ADDR_COPY(&intf_rsp->anp_addr, &aap->aa_dstatm); - ATM_ADDR_COPY(&intf_rsp->anp_subaddr, - &aap->aa_dstatmsub); - aap->aa_key.key_len = SCSP_ATMARP_KEY_LEN; - scsp_cache_key(&aap->aa_dstatm, &aap->aa_dstip, - SCSP_ATMARP_KEY_LEN, aap->aa_key.key); - aap->aa_oid.id_len = SCSP_ATMARP_ID_LEN; - aap->aa_seq = SCSP_CSA_SEQ_MIN; - bcopy(&aap->aa_dstip.s_addr, aap->aa_oid.id, SCSP_ATMARP_ID_LEN); - aap->aa_intf = aip; - aap->aa_flags = AAF_SERVER; - aap->aa_origin = UAO_LOCAL; - - /* - * Add the entry to the cache - */ - ATMARP_ADD(aip, aap); - - /* - * Free dynamic data - */ - free(netif_rsp); - free(intf_rsp); - return(1); - -if_ready_fail: - if (netif_rsp) - free(netif_rsp); - if (intf_rsp) - free(intf_rsp); - return(0); -} - - -/* - * Copy an ATMARP cache entry from kernel format into an entry - * suitable for our cache - * - * Arguments: - * cp pointer to kernel entry - * - * Returns: - * pointer to a new cache entry - * 0 error - * - */ -Atmarp * -atmarp_copy_cache_entry(cp) - struct air_arp_rsp *cp; - -{ - struct sockaddr_in *ipp; - Atmarp_intf *aip; - Atmarp *aap; - - /* - * Sanity checks - */ - if (!cp) - return((Atmarp *)0); - aip = atmarp_find_intf_name(cp->aap_intf); - if (!aip) - return((Atmarp *)0); - - /* - * Get a new cache entry - */ - aap = calloc(1, sizeof(Atmarp)); - if (aap == NULL) { - errno = ENOMEM; - return(NULL); - } - aap->aa_intf = aip; - - /* - * Copy fields from the kernel entry to the new entry - */ - ipp = (struct sockaddr_in *)&cp->aap_arp_addr; - bcopy(&ipp->sin_addr.s_addr, &aap->aa_dstip.s_addr, - sizeof(aap->aa_dstip.s_addr)); - ATM_ADDR_COPY(&cp->aap_addr, &aap->aa_dstatm); - ATM_ADDR_COPY(&cp->aap_subaddr, &aap->aa_dstatmsub); - if (cp->aap_origin == UAO_PERM) - aap->aa_flags |= AAF_PERM; - aap->aa_origin = cp->aap_origin; - - /* - * Set up fields for SCSP - */ - aap->aa_key.key_len = SCSP_ATMARP_KEY_LEN; - scsp_cache_key(&cp->aap_addr, &aap->aa_dstip, - SCSP_ATMARP_KEY_LEN, (char *)aap->aa_key.key); - aap->aa_oid.id_len = SCSP_ATMARP_ID_LEN; - bcopy(&aip->ai_ip_addr.s_addr, aap->aa_oid.id, SCSP_ATMARP_ID_LEN); - aap->aa_seq = SCSP_CSA_SEQ_MIN; - - return(aap); -} - - -/* - * Send an updated ATMARP cache entry to the kernel - * - * Arguments: - * aap pointer to updated entry - * - * Returns: - * 0 success - * errno reason for failure - * - */ -int -atmarp_update_kernel(aap) - Atmarp *aap; -{ - int rc = 0, sd; - struct atmaddreq aar; - struct sockaddr_in *ipp; - - /* - * Build ioctl request - */ - bzero(&aar, sizeof(aar)); - aar.aar_opcode = AIOCS_ADD_ARP; - strncpy(aar.aar_arp_intf, aap->aa_intf->ai_intf, - sizeof(aar.aar_arp_intf)); - aar.aar_arp_origin = UAO_SCSP; - ATM_ADDR_COPY(&aap->aa_dstatm, &aar.aar_arp_addr); - ipp = (struct sockaddr_in *)&aar.aar_arp_dst; - ipp->sin_family = AF_INET; -#if (defined(BSD) && (BSD >= 199103)) - ipp->sin_len = sizeof(struct sockaddr_in); -#endif - ipp->sin_addr = aap->aa_dstip; - - /* - * Pass the new mapping to the kernel - */ - sd = socket(AF_ATM, SOCK_DGRAM, 0); - if (sd < 0) { - return(errno); - } - if (ioctl(sd, AIOCADD, (caddr_t)&aar) < 0) { - rc = errno; - } - - (void)close(sd); - return(rc); -} - - -/* - * Read the ATMARP cache from the kernel and scan it, processing - * all entries - * - * Arguments: - * none - * - * Returns: - * none - * - */ -void -atmarp_get_updated_cache() -{ - int i, rc; - size_t len; - struct atminfreq air; - struct air_arp_rsp *cp; - struct sockaddr_in *ipp; - Atmarp_intf *aip; - Atmarp *aap; - - /* - * Set up the request - */ - air.air_opcode = AIOCS_INF_ARP; - air.air_arp_flags = ARP_RESET_REF; - ipp = (struct sockaddr_in *)&air.air_arp_addr; -#if (defined(BSD) && (BSD >= 199103)) - ipp->sin_len = sizeof(struct sockaddr_in); -#endif - ipp->sin_family = AF_INET; - ipp->sin_addr.s_addr = INADDR_ANY; - - /* - * Issue an ATMARP information request IOCTL - */ - len = do_info_ioctl(&air, sizeof(struct air_arp_rsp) * 200); - if ((ssize_t)len == -1) - return; - - /* - * Clear marks on all our cache entries - */ - atmarp_clear_marks(); - - /* - * Loop through the cache, processing each entry - */ - for (cp = (struct air_arp_rsp *) air.air_buf_addr; - len > 0; - cp++, len -= sizeof(struct air_arp_rsp)) { - atmarp_process_cache_entry(cp); - } - - /* - * Now delete any old entries that aren't in the kernel's - * cache any more - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - for (i = 0; i < ATMARP_HASHSIZ; i++) { - for (aap = aip->ai_arptbl[i]; aap; - aap = aap->aa_next) { - /* - * Don't delete the entry for the server - */ - if (aap->aa_flags & AAF_SERVER) - continue; - /* - * Delete any entry that isn't marked - */ - if (!aap->aa_mark) { - rc = atmarp_scsp_update(aap, - SCSP_ASTATE_DEL); - if (rc == 0) - ATMARP_DELETE(aip, aap); - } - } - } - } - - /* - * Free the ioctl response - */ - free(air.air_buf_addr); -} - - -/* - * Process an ATMARP cache entry from the kernel. If we already - * have the entry in our local cache, update it, otherwise, add - * it. In either case, mark our local copy so we know it's still - * in the kernel's cache. - * - * Arguments: - * cp pointer to kernel's cache entry - * - * Returns: - * none - * - */ -void -atmarp_process_cache_entry(cp) - struct air_arp_rsp *cp; - -{ - int rc; - struct sockaddr_in *ipp = (struct sockaddr_in *)&cp->aap_arp_addr; - Atmarp_intf *aip; - Atmarp *aap; - - /* - * See whether the entry is for an interface that's - * both configured and up - */ - aip = atmarp_find_intf_name(cp->aap_intf); - if (!aip || aip->ai_state != AI_STATE_UP) - return; - - /* - * Make sure the entry is valid - */ - if (!(cp->aap_flags & ARPF_VALID)) - return; - - /* - * See whether we have the entry in our cache already - */ - ATMARP_LOOKUP(aip, ipp->sin_addr.s_addr, aap); - if (aap) { - /* - * We already have this in our cache--update it - */ - aap->aa_mark = 1; - if ((cp->aap_flags & ARPF_REFRESH) && - cp->aap_origin != UAO_SCSP) { - aap->aa_seq++; - rc = atmarp_scsp_update(aap, SCSP_ASTATE_UPD); - } - } else { - /* - * This is a new entry--add it to the cache - */ - aap = atmarp_copy_cache_entry(cp); - if (!aap) - return; - ATMARP_ADD(aip, aap); - aap->aa_mark = 1; - rc = atmarp_scsp_update(aap, SCSP_ASTATE_NEW); - } - - return; -} - - -/* - * Print an SCSP ID - * - * Arguments: - * df pointer to a FILE for the dump - * ip pointer to the SCSP ID to print - * - * Returns: - * None - * - */ -static void -print_scsp_id(df, ip) - FILE *df; - Scsp_id *ip; -{ - int i; - - fprintf(df, "\t next: %p\n", ip->next); - fprintf(df, "\t id_len: %d\n", ip->id_len); - fprintf(df, "\t id: 0x"); - for (i = 0; i < ip->id_len; i++) { - fprintf(df, "%0x ", ip->id[i]); - } - fprintf(df, "\n"); -} - - -/* - * Print an SCSP cacke key - * - * Arguments: - * df pointer to a FILE for the dump - * cp pointer to the cacke key to print - * - * Returns: - * None - * - */ -static void -print_scsp_cache_key(df, cp) - FILE *df; - Scsp_ckey *cp; -{ - int i; - - fprintf(df, "\t key_len: %d\n", cp->key_len); - fprintf(df, "\t key: 0x"); - for (i = 0; i < cp->key_len; i++) { - fprintf(df, "%0x ", cp->key[i]); - } - fprintf(df, "\n"); -} - - -/* - * Print an ATMARP interface entry - * - * Arguments: - * df pointer to a FILE for the dump - * aip pointer to interface entry - * - * Returns: - * None - * - */ -void -print_atmarp_intf(df, aip) - FILE *df; - Atmarp_intf *aip; -{ - if (!aip) { - fprintf(df, "print_atmarp_intf: NULL interface entry address\n"); - return; - } - - fprintf(df, "ATMARP network interface entry at %p\n", aip); - fprintf(df, "\tai_next: %p\n", aip->ai_next); - fprintf(df, "\tai_intf: %s\n", aip->ai_intf); - fprintf(df, "\tai_ip_addr: %s\n", - format_ip_addr(&aip->ai_ip_addr)); - fprintf(df, "\tai_subnet_mask: %s\n", - inet_ntoa(aip->ai_subnet_mask)); - fprintf(df, "\tai_mtu: %d\n", aip->ai_mtu); - fprintf(df, "\tai_atm_addr: %s\n", - format_atm_addr(&aip->ai_atm_addr)); - fprintf(df, "\tai_atm_subaddr: %s\n", - format_atm_addr(&aip->ai_atm_subaddr)); - fprintf(df, "\tai_scsp_sock: %d\n", aip->ai_scsp_sock); - fprintf(df, "\tai_scsp_sockname: %s\n", aip->ai_scsp_sockname); - fprintf(df, "\tai_state: %d\n", aip->ai_state); - fprintf(df, "\tai_mark: %d\n", aip->ai_mark); -} - - -/* - * Print an ATMARP cache entry - * - * Arguments: - * df pointer to a FILE for the dump - * aap pointer to cache entry - * - * Returns: - * None - * - */ -void -print_atmarp_cache(df, aap) - FILE *df; - Atmarp *aap; -{ - if (!aap) { - fprintf(df, "print_atmarp_cache: NULL ATMARP entry address\n"); - return; - } - - fprintf(df, "ATMARP entry at %p\n", aap); - fprintf(df, "\taa_next: %p\n", aap->aa_next); - fprintf(df, "\taa_dstip: %s\n", inet_ntoa(aap->aa_dstip)); - fprintf(df, "\taa_dstatm: %s\n", - format_atm_addr(&aap->aa_dstatm)); - fprintf(df, "\taa_dstatmsub: %s\n", - format_atm_addr(&aap->aa_dstatmsub)); - fprintf(df, "\taa_key:\n"); - print_scsp_cache_key(df, &aap->aa_key); - fprintf(df, "\taa_oid:\n"); - print_scsp_id(df, &aap->aa_oid); - fprintf(df, "\taa_seq: %ld (0x%lx)\n", aap->aa_seq, - aap->aa_seq); - fprintf(df, "\taa_intf: %p\n", aap->aa_intf); - fprintf(df, "\taa_flags: "); - if (aap->aa_flags & AAF_PERM) - fprintf(df, "Permanent "); - if (aap->aa_flags & AAF_SERVER) - fprintf(df, "Server "); - fprintf(df, "\n"); - fprintf(df, "\taa_origin: %d\n", aap->aa_origin); - fprintf(df, "\taa_mark: %d\n", aap->aa_mark); -} - - -/* - * Print the entire ATMARP cache - * - * Arguments: - * df pointer to a FILE for the dump - * aip pointer to interface whose cache is to be printed - * - * Returns: - * None - * - */ -void -dump_atmarp_cache(df, aip) - FILE *df; - Atmarp_intf *aip; -{ - int i; - Atmarp *aap; - - if (!aip) { - fprintf(df, "dump_atmarp_cache: NULL interface address\n"); - return; - } - - fprintf(df, "ATMARP cache for interface %s\n", aip->ai_intf); - for (i=0; iai_arptbl[i]; aap; aap=aap->aa_next) { - print_atmarp_cache(df, aap); - } - } -} - - -#ifdef NOTDEF -/* - * Print an ATMARP super-LIS entry - * - * Arguments: - * df pointer to a FILE for the dump - * asp pointer to super-LIS entry to be printed - * - * Returns: - * None - * - */ -void -print_atmarp_slis(df, asp) - FILE *df; - Atmarp_slis *asp; -{ - Atmarp_intf **aipp; - - if (!asp) { - fprintf(df, "print_atmarp_slis: NULL SLIS address\n"); - return; - } - - fprintf(df, "SLIS entry at 0x%0x\n", (u_long)asp); - fprintf(df, "\tas_next: 0x%0x\n", (u_long)asp->as_next); - fprintf(df, "\tas_name: %s\n", asp->as_name); - fprintf(df, "\tas_cnt: %d\n", asp->as_cnt); - for (aipp = &asp->as_intfs; *aipp; aipp++) { - fprintf(df, "\t%s (%s)\n", (*aipp)->ai_name, - (*aipp)->ai_intf); - } -} -#endif - - -/* - * Dump ATMARPD information - * - * Called as the result of a SIGINT signal. - * - * Arguments: - * sig signal number - * - * Returns: - * None - * - */ -void -atmarp_sigint(sig) - int sig; -{ - Atmarp_intf *aip; - FILE *df; - char fname[64]; - static int dump_no = 0; - - /* - * Build a file name - */ - bzero(&fname, sizeof(fname)); - sprintf(fname, "/tmp/atmarpd.%d.%03d.out", getpid(), dump_no++); - - /* - * Open the output file - */ - df = fopen(fname, "w"); - if (df == (FILE *)0) - return; - - /* - * Dump the interface control blocks and - * associated ATMARP caches - */ - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - print_atmarp_intf(df, aip); - fprintf(df, "\n"); - dump_atmarp_cache(df, aip); - fprintf(df, "\n"); - } - - /* - * Close the output file - */ - (void)fclose(df); -} Property changes on: head/usr.sbin/atm/atmarpd/atmarp_subr.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/Makefile =================================================================== --- head/usr.sbin/atm/atmarpd/Makefile (revision 179307) +++ head/usr.sbin/atm/atmarpd/Makefile (nonexistent) @@ -1,36 +0,0 @@ -# =================================== -# 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$ - -PROG= atmarpd -MAN= atmarpd.8 -SRCS= atmarpd.c atmarp_config.c atmarp_log.c atmarp_scsp.c \ - atmarp_subr.c atmarp_timer.c - -CFLAGS+= -I${.CURDIR}/../../../sys - -LDADD= -latm -lmd -DPADD= ${LIBATM} ${LIBMD} - -.include Property changes on: head/usr.sbin/atm/atmarpd/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarp_log.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarp_log.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarp_log.c (nonexistent) @@ -1,147 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: logging routines - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#if __STDC__ -#include -#else -#include -#endif -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Write a message to atmarpd's log - * - * Arguments: - * level the level (error, info, etc.) of the message - * fmt printf-style format string - * ... parameters for printf-style use according to fmt - * - * Returns: - * none - * - */ -void -#if __STDC__ -atmarp_log(const int level, const char *fmt, ...) -#else -atmarp_log(level, fmt, va_alist) - int level; - char *fmt; - va_dcl -#endif -{ - va_list ap; - -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - - /* - * In debug mode, just write to stdout - */ - if (atmarp_debug_mode) { - vprintf(fmt, ap); - printf("\n"); - return; - } - - /* - * Check whether we have a log file set up - */ - if (!atmarp_log_file) { - /* - * Write to syslog - */ - vsyslog(level, fmt, ap); - } else { - /* - * Write to the log file - */ - vfprintf(atmarp_log_file, fmt, ap); - fprintf(atmarp_log_file, "\n"); - } - - va_end(ap); -} - - -/* - * Log a memory error and exit - * - * Arguments: - * cp message to log - * - * Returns: - * exits, does not return - * - */ -void -atmarp_mem_err(cp) - char *cp; -{ - atmarp_log(LOG_CRIT, "out of memory: %s", cp); - exit(2); -} Property changes on: head/usr.sbin/atm/atmarpd/atmarp_log.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/atmarpd/atmarpd.c =================================================================== --- head/usr.sbin/atm/atmarpd/atmarpd.c (revision 179307) +++ head/usr.sbin/atm/atmarpd/atmarpd.c (nonexistent) @@ -1,412 +0,0 @@ -/* - * - * =================================== - * 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$ - * - */ - -/* - * Server Cache Synchronization Protocol (SCSP) Support - * ---------------------------------------------------- - * - * SCSP-ATMARP server interface: main line code - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../scspd/scsp_msg.h" -#include "../scspd/scsp_if.h" -#include "../scspd/scsp_var.h" -#include "atmarp_var.h" - -#ifndef lint -__RCSID("@(#) $FreeBSD$"); -#endif - - -/* - * Global variables - */ -char *prog; -int atmarp_debug_mode = 0; -int atmarp_max_socket = 0; -Atmarp_intf *atmarp_intf_head = (Atmarp_intf *)0; -Atmarp_slis *atmarp_slis_head = (Atmarp_slis *)0; -FILE *atmarp_log_file = (FILE *)0; -char *atmarp_log_file_name = (char *)0; -Harp_timer cache_timer, perm_timer; - - -/* - * Print a usage message - * - * Arguments: - * none - * - * Returns: - * exits, does not return - * - */ -void -usage() -{ - fprintf(stderr, "usage: %s [-d] [-l ] ...\n", prog); - exit(1); -} - - -/* - * Process command line parameters - * - * Arguments: - * argc number of command-line arguments - * argv list of pointers to command-line arguments - * - * Returns: - * none - * - */ -static void -initialize(argc, argv) - int argc; - char *argv[]; - -{ - int i, rc; - - /* - * Save program name, ignoring any path components - */ - if ((prog = (char *)strrchr(argv[0], '/')) != NULL) - prog++; - else - prog = argv[0]; - - /* - * Make sure we're being invoked by the super user - */ - i = getuid(); - if (i != 0) { - fprintf(stderr, "%s: You must be root to run this program\n", - prog); - exit(1); - } - - /* - * Scan arguments, checking for options - */ - for (i = 1; i < argc; i++) { - if (argv[i][0] == '-') { - if (strcmp(argv[i], "-d") == 0) { - atmarp_debug_mode = TRUE; - } else if (strcmp(argv[i], "-l") == 0) { - i++; - if (i >= argc) { - fprintf(stderr, "%s: Log file name missing\n", - prog); - exit(1); - } - atmarp_log_file_name = argv[i]; - } else { - fprintf(stderr, "%s: Unrecognized option \"%s\"\n", - prog, argv[i]); - exit(1); - } - } else { - /* - * Parameter is a network interface name - */ - rc = atmarp_cfg_netif(argv[i]); - if (rc) { - fprintf(stderr, "%s: Error configuring network interface %s\n", - prog, argv[i]); - exit(1); - } - } - } - - /* - * Make sure we had at least one interface configured - */ - if (!atmarp_intf_head) { - usage(); - } -} - - -/* - * Daemon housekeeping - * - * Arguments: - * None - * - * Returns: - * None - * - */ -static void -start_daemon() - -{ - int dpid, fd, file_count, rc; - - /* - * Ignore selected signals - */ -#ifdef SIGTTOU - signal(SIGTTOU, SIG_IGN); -#endif -#ifdef SIGTTIN - signal(SIGTTIN, SIG_IGN); -#endif -#ifdef SIGTSTP - signal(SIGTSTP, SIG_IGN); -#endif -#ifdef SIGPIPE - signal(SIGPIPE, SIG_IGN); -#endif - - /* - * Skip putting things into the background if we're - * in debugging mode - */ - if (atmarp_debug_mode) - goto daemon_bypass; - - /* - * Set up syslog for error logging - */ - if (!atmarp_log_file) { - openlog(prog, LOG_PID | LOG_CONS, LOG_DAEMON); - } - - /* - * Put the daemon into the background - */ - dpid = fork(); - if (dpid < 0) { - atmarp_log(LOG_ERR, "fork failed"); - exit(1); - } - if (dpid > 0) { - /* - * This is the parent process--just exit and let - * the daughter do all the work - */ - exit(0); - } - - /* - * Disassociate from any controlling terminal - */ - rc = setpgrp(0, getpid()); - if (rc < 0) { - atmarp_log(LOG_ERR, "can't change process group"); - exit(1); - } - fd = open(_PATH_TTY, O_RDWR); - if (fd >= 0) { - ioctl(fd, TIOCNOTTY, (char *)0); - close(fd); - } - - /* - * Close all open file descriptors - */ - file_count = getdtablesize(); - for (fd=0; fdai_next) { - if (atmarp_if_ready(aip)) { - (void)atmarp_scsp_connect(aip); - } - } - - /* - * Read the cache from the kernel - */ - atmarp_get_updated_cache(); - - /* - * Main program loop -- wait for data to come in from SCSP. - * When the timer fires, it will be handled elsewhere. - */ - while (1) { - /* - * Wait for input from SCSP - */ - FD_ZERO(&read_set); - FD_ZERO(&write_set); - FD_ZERO(&except_set); - for (aip = atmarp_intf_head; aip; aip = aip->ai_next) { - if (aip->ai_scsp_sock != -1) { - FD_SET(aip->ai_scsp_sock, &read_set); - } - } - rc = select(atmarp_max_socket + 1, - &read_set, &write_set, - &except_set, (struct timeval *)0); - if (rc < 0) { - if (harp_timer_exec) { - timer_proc(); - continue; - } else if (errno == EINTR) { - continue; - } else { - atmarp_log(LOG_ERR, "Select failed"); - abort(); - } - } - - /* - * Read and process the input from SCSP - */ - for (i = 0; i <= atmarp_max_socket; i++) { - if (FD_ISSET(i, &read_set)) { - aip = atmarp_find_intf_sock(i); - if (aip) - rc = atmarp_scsp_read(aip); - } - } - } -} Property changes on: head/usr.sbin/atm/atmarpd/atmarpd.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/atm/Makefile =================================================================== --- head/usr.sbin/atm/Makefile (revision 179307) +++ head/usr.sbin/atm/Makefile (nonexistent) @@ -1,29 +0,0 @@ -# =================================== -# 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$ - -SUBDIR= atmarpd \ - scspd - -.include Property changes on: head/usr.sbin/atm/Makefile ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/usr.sbin/Makefile =================================================================== --- head/usr.sbin/Makefile (revision 179307) +++ head/usr.sbin/Makefile (revision 179308) @@ -1,380 +1,375 @@ # From: @(#)Makefile 5.20 (Berkeley) 6/12/93 # $FreeBSD$ .include # XXX MISSING: mkproto SUBDIR= ac \ accton \ ${_acpi} \ adduser \ amd \ ancontrol \ ${_apm} \ ${_apmd} \ ${_arlcontrol} \ arp \ ${_asf} \ ${_atm} \ ${_audit} \ ${_auditd} \ ${_auditreduce} \ ${_authpf} \ ${_bluetooth} \ ${_boot0cfg} \ ${_boot98cfg} \ bootparamd \ bsnmpd \ ${_btxld} \ burncd \ cdcontrol \ chkgrp \ chown \ chroot \ ckdist \ clear_locks \ config \ cron \ crunch \ ctm \ daemon \ dconschat \ devinfo \ digictl \ diskinfo \ ${_dnssec-keygen} \ ${_dnssec-signzone} \ ${_editmap} \ edquota \ ${_eeprom} \ extattr \ extattrctl \ ${_faithd} \ fdcontrol \ fdformat \ fdread \ fdwrite \ fifolog \ flowctl \ freebsd-update \ ${_ftp-proxy} \ fwcontrol \ getfmac \ getpmac \ gstat \ ${_i4b} \ ifmcstat \ inetd \ iostat \ ${_ip6addrctl} \ ipfwpcap \ ${_IPXrouted} \ jail \ jexec \ jls \ kbdcontrol \ kbdmap \ ${_keyserv} \ ${_kgmon} \ ${_kgzip} \ kldxref \ lastlogin \ lmcconfig \ ${_lpr} \ ${_lptcontrol} \ ${_mailstats} \ mailwrapper \ ${_makemap} \ manctl \ memcontrol \ mergemaster \ mixer \ ${_mld6query} \ mlxcontrol \ mountd \ ${_mount_nwfs} \ mount_portalfs \ ${_mount_smbfs} \ moused \ ${_mptable} \ mtest \ mtree \ ${_named} \ ${_named-checkconf} \ ${_named-checkzone} \ ${_named.reload} \ ${_ndiscvt} \ ${_ndp} \ newsyslog \ nfsd \ ngctl \ nghook \ nologin \ ${_nscd} \ ntp \ ${_nvram} \ ${_ofwdump} \ pccard \ pciconf \ periodic \ pkg_install \ pmccontrol \ pmcstat \ ${_pnpinfo} \ portsnap \ powerd \ ppp \ ${_pppctl} \ pppd \ pppstats \ ${_praliases} \ ${_praudit} \ procctl \ pstat \ pw \ pwd_mkdb \ quot \ quotaon \ rarpd \ raycontrol \ repquota \ ${_rip6query} \ rmt \ ${_rndc} \ ${_rndc-confgen} \ ${_route6d} \ rpcbind \ rpc.lockd \ rpc.statd \ rpc.umntall \ ${_rpc.yppasswdd} \ ${_rpc.ypupdated} \ ${_rpc.ypxfrd} \ ${_rrenumd} \ ${_rtadvd} \ rtprio \ ${_rtsold} \ rwhod \ sa \ sade \ ${_sendmail} \ setfib \ setfmac \ setpmac \ ${_sicontrol} \ sliplogin \ slstat \ smbmsg \ snapinfo \ ${_spkrtest} \ spray \ ${_sysinstall} \ syslogd \ tcpdchk \ tcpdmatch \ tcpdrop \ tcpdump \ timed \ traceroute \ ${_traceroute6} \ trpt \ tzsetup \ ugidfw \ ${_usbdevs} \ vidcontrol \ vipw \ watch \ watchdogd \ wlandebug \ ${_wlconfig} \ wpa \ ${_ypbind} \ ${_yp_mkdb} \ ${_yppoll} \ ${_yppush} \ ${_ypserv} \ ${_ypset} \ zic \ ${_zzz} .if ${MACHINE_ARCH} != "arm" _sysinstall= sysinstall .endif -# Disabled in 7.0 as netatm is not MPSAFE. -#.if ${MK_ATM} != "no" -#_atm= atm -#.endif - .if ${MK_AUDIT} != "no" _audit= audit _auditd= auditd _auditreduce= auditreduce _praudit= praudit .endif .if ${MK_BIND_DNSSEC} != "no" && ${MK_OPENSSL} != "no" _dnssec-keygen= dnssec-keygen _dnssec-signzone= dnssec-signzone .endif .if ${MK_BIND_NAMED} != "no" _named= named _named-checkconf= named-checkconf _named-checkzone= named-checkzone _named.reload= named.reload _rndc= rndc _rndc-confgen= rndc-confgen .endif .if ${MK_BLUETOOTH} != "no" _bluetooth= bluetooth .endif .if ${MK_OPENSSL} != "no" _keyserv= keyserv .endif .if ${MK_PF} != "no" _ftp-proxy= ftp-proxy .endif .if ${MK_INET6} != "no" _faithd= faithd _ip6addrctl= ip6addrctl _mld6query= mld6query _ndp= ndp _rip6query= rip6query _route6d= route6d _rrenumd= rrenumd _rtadvd= rtadvd _rtsold= rtsold _traceroute6= traceroute6 .endif .if ${MK_IPX} != "no" _IPXrouted= IPXrouted .endif .if ${MK_NIS} != "no" _rpc.yppasswdd= rpc.yppasswdd _rpc.ypupdated= rpc.ypupdated _rpc.ypxfrd= rpc.ypxfrd _ypbind= ypbind _yp_mkdb= yp_mkdb _yppoll= yppoll _yppush= yppush _ypserv= ypserv _ypset= ypset .endif .if ${MK_AUTHPF} != "no" _authpf= authpf .endif .if ${MK_LIBTHR} != "no" _pppctl= pppctl .endif .if ${MK_LPR} != "no" _lpr= lpr .endif .if ${MK_NS_CACHING} != "no" .if ${MK_LIBTHR} != "no" _nscd= nscd .endif .endif .if ${MK_SENDMAIL} != "no" _editmap= editmap _mailstats= mailstats _makemap= makemap _praliases= praliases _sendmail= sendmail .endif .if ${MK_USB} != "no" _usbdevs= usbdevs .endif .if ${MACHINE_ARCH} == "arm" _kgmon= kgmon .endif .if ${MACHINE_ARCH} == "i386" _apm= apm _apmd= apmd _asf= asf _btxld= btxld .if ${MK_I4B} != "no" _i4b= i4b .endif _kgmon= kgmon _kgzip= kgzip _lptcontrol= lptcontrol .if ${MK_NCP} != "no" _mount_nwfs= mount_nwfs .endif _mount_smbfs= mount_smbfs _mptable= mptable _ndiscvt= ndiscvt _pnpinfo= pnpinfo _sicontrol= sicontrol _spkrtest= spkrtest _zzz= zzz .if ${MACHINE} == "i386" .if ${MK_ACPI} != "no" _acpi= acpi .endif _arlcontrol= arlcontrol _boot0cfg= boot0cfg _wlconfig= wlconfig .elif ${MACHINE} == "pc98" _boot98cfg= boot98cfg .endif .endif # kgzip: builds, but missing support files # mptable: broken (not 64 bit clean) # pnpinfo: crashes (not really useful anyway) .if ${MACHINE_ARCH} == "amd64" .if ${MK_ACPI} != "no" _acpi= acpi .endif _asf= asf _boot0cfg= boot0cfg _btxld= btxld _kgmon= kgmon _lptcontrol= lptcontrol .if ${MK_NCP} != "no" _mount_nwfs= mount_nwfs .endif _mount_smbfs= mount_smbfs _mptable= mptable _ndiscvt= ndiscvt _sicontrol= sicontrol _spkrtest= spkrtest _zzz= zzz .endif .if ${MACHINE_ARCH} == "ia64" .if ${MK_ACPI} != "no" _acpi= acpi .endif _kgmon= kgmon _mount_smbfs= mount_smbfs _zzz= zzz .endif .if ${MACHINE_ARCH} == "powerpc" _mount_smbfs= mount_smbfs _nvram= nvram _ofwdump= ofwdump .endif .if ${MACHINE_ARCH} == "sparc64" _eeprom= eeprom _ofwdump= ofwdump .endif .include