Path: news.larc.nasa.gov!amiga-request
From: amiga-request@ab20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
Subject: v91i140: SANA-II - SANA-II Network Device Driver Specification, Part01/03
Reply-To: rsbx@cbmvax.uucp (Raymond S. Brand)
Newsgroups: comp.sources.amiga
Message-ID: <comp.sources.amiga.v91i140@ab20.larc.nasa.gov>
Date: 30 Jul 91 00:26:08 GMT
Approved: tadguy@uunet.UU.NET (Tad Guy)
X-Mail-Submissions-To: amiga@uunet.uu.net
X-Post-Discussions-To: comp.sys.amiga.misc

Submitted-by: rsbx@cbmvax.uucp (Raymond S. Brand)
Posting-number: Volume 91, Issue 140
Archive-name: devices/sana-ii/part01

[ includes uuencoded library  ...tad ]

The enclosed archive contains the SANA-II Network Device
Driver Specification. It is copyrighted by Commodore but may be freely
distributed.

#!/bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 1 (of 3)."
# Contents:  NetBuff.uu etherstuff.txt netbuff.doc netbuff.h netbuff.i
#   readme sana2device.h sana2device.i sana2packetmagic.h
#   sana2packetmagic.i sana2specialstats.h sana2specialstats.i
# Wrapped by tadguy@ab20 on Mon Jul 29 20:26:07 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'NetBuff.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'NetBuff.uu'\"
else
echo shar: Extracting \"'NetBuff.uu'\" \(7965 characters\)
sed "s/^X//" >'NetBuff.uu' <<'END_OF_FILE'
Xbegin 666 NetBuff.library
XM```#\P`````````"``````````$```*?`````````^D```*?</].=4K\````?
XM!```"GP```DR````'@```"X```"<;F5T8G5F9BYL:6)R87)Y```D5D52.B!N3
XM971B=69F(#`N,2`H,3DY,3`T,C$I`````1@```$D```!+````8````&*```!O
XMA````A````(*```"G```!,````5P```%A@``!@H```9X```'^@``"-@```D<8
XM```),@``"4[_____2.<@-"I/)DA!^O^F0_H`.)7*<#Q.KO^L2H!G```B)$`E;
XM3@`D)4L`*$'J`"P@B%B00J@`!"%(``@B2DZN_G0N34S?+`1.=>````@)`,``T
XM``H````>X```#@8`T```%```T```%@``P```&````"[````X````````````D
XM`&$`"*Y2;@`@(`Y.=6$`"*)3;@`@80`(FDIN`"!F``!*0>X`++'H``AF```^_
XM2.<@("1.+&H`)")*(%$B:0`$(H@A20`$)"H`*")*<`!R`#(J`!"3P3`J`!+0?
XM@4ZN_RX@`BQ*3-\$!$YU<`!.=6$$8``(0$CG("0J;@`D)$@D`$J";V!![@`LM
XM,_Q```#?\)I2+0$F(E`@$6<(((#!B2-(``13+0$F;`@S_,```-_PFDJ`9P``-
XM-B)`(WP```````PC?```````$)2I``@@2EB(("@`!"%)``0BB"-```0@0"")5
XM8)Q,WR0$3G4@2DS?)`1@```(801@``>Z2.<`)"IN`"0D2"!*(E`@$6<(((#!5
XMB2-(``1*@&<``&8B0$JI``AF)C/\0```W_":4BT!)B!N`#@BB"U)`#A3+0$F[
XM;`@S_,```-_PFF"\,_Q```#?\)I2+0$F0>X`+%B(("@`!"%)``0BB"-```0@,
XM0"")4RT!)FP(,_S```#?\)I@`/^(3-\D`'``3G5(YR`P)$@F24J`9P``+B(`@
XM:@)$@20!LJ@`#&<F8ABQZ``(9Q)*@&L``0IJ+G``3-\,!&``!OAP`6#T($MA/
XM``4@8.H@2R=\```````,80#_)B!+(DIA``8J8-(@4B(H`!"P@64*D($@4$J0P
XM9\I@[DJ`9P``H$JH``AF8$CG@(!P&"(\``$``"\.+&X`)$ZN_SHL7R(`3-\!O
XM`4J!9SXB02(H`!32J``,(T$`%"-``!#1J``,D:@`$"=```PO""\)($MA`/ZR/
XM(E\@2R`0((E(T0$!($`A20`$(%]@0DCG@(`@2V$`!'Q*@&8``31,UP$"(F@`?
XM%-/H``QP`"!+80`!V$J`9@`!&DS?`0'1J``,D:@`$&`*+P@@2V$`_EP@7R="E
XM``R5J@`,(`LB4L%)80`&B&``_OQ$@"!J``@B*``0L(%E$)"!(&@`!$JH``1G9
XM`/[J8.A*@&<``*1*J``(9F)(YX"`<!@B/``!```O#BQN`"1.KO\Z+%\B`$S?E
XM`0%*@6=`(D$B*``4TJ@`#-*H`!"2@"-!`!0C0``0D:@`$"=```PO""\)($MAY
XM`/W.(E\@2R`0((E(T0$!($`A20`$(%]@1$CG@(`@2V$``YA*@&8``%!,UP$"8
XM(F@`%-/H``S3Z``0D\%P`"!+80``[DJ`9@``,$S?`0&1J``08`HO""!+80#]N
XM=B!?E:H`#"="``P@*P`(0^H`!"!080`%GF``_A),WP$!8`#^%$J`9P``("(`O
XM:@)$@;*H``QB%K'H``AG$).H``PB2$J`:U)J"'``3G5P`4YU(%$B*``0L(%E9
XM"I"!(%!*D&=>8.Z2@"%!`!#0J``,(4``#")1P4E1CUF/+H]8ET*O``0O3P`(9
XM(`]A``4J($]A`/SD3^\`#&"P1(`@:0`((B@`$+"!90Z0@2!H``1*J``$9PY@$
XMZI*`(4$`$%B)(%!@MDJ`9P).=2!)(4``#&$`_*!P`$YU2.<@)$OZ``1@(B)J;
XM`!33Z@`,T\!.=4CG("1+^@`$8`P@:@`4T>H`#-'`3G4D`4J"9P``8+'H``AG4
XM```P2H!J!-"H``RPJ``,9```(-*`LJ@`#&(``!8D4"!)(BH`$+"!91"0@212J
XM2I)F\$S?)`1P`4YU3I62@,%!M(!D`B`"E(!A``0^2H)G"B122I)GW'``8,A,9
XMWR0$<`!.=4CG,#`D2"9)($D@*@`,80`!X$J`9E!T`'8`8!`@`K:"9`(@`Y2`V
XMEH!A``/\2H-F%"932I-G*")K`!0F*P`09_#3ZP`,2H)FU"122I)G&"!J`!0D>
XM*@`09_#1Z@`,8+Y,WPP,<`!.=4S?#`QP`4YU+PI1CUF/)%`NCUB70J\`!"]/W
XM``A*DF=:(DI*J@`(9BI*D6<*2JD`"&8$(E%@'"!*)$D@#V$``Z(@3V$``/(@K
XM:@`$(D]A``.,8,I*D6<*2JD`"&<$(E%@\B!*)$D@#V$``W@@3V$:(&H`!")/[
XM80`#9&"B3^\`#"1?80`"UG``3G5(YS`X*$BY[``(9P``G"14(&H`%-'J``PD[
XM*@`0)E0B:P`4)BL`""=\```````0)WP```````P@`K"#90(@`Y2`EH#1JP`0E
XM80`"\$J"9A0D4DJ29RX@:@`4T>H`#"0J`!!@Z$J#9AHF4R)K`!0F*P`()WP`N
XM`````!`G?```````#&"T48]9CRZ/6)="KP`$+T\`""`/(%-#[``$80`"O"!/E
XM80#Z=D_O``Q,WQP,3G4O"B10($HD4$J29T0@*``4T*@`#-"H`!`B*@`4TJH`'
XM#+*`9N`@*@`0T:@`$")*)$@@"2!1(FD`!"*((4D`!")`<!@O#BQN`"1.KO\N.
XM+%]@M"1?3G5(YR`P)$@D`"5"``P@4$J09@``($J"9@A,WPP$<`!.=2!*80#YC
XM;"!*L>@`"&<``)X@4$J"9V0B*``(9@8B*``08`@A?```````#+2!8T*4@2%!]
XM`!`@4$J09M@O*@`(48]9CR!/((A8D$*H``0A2``((`)A`/D<(D^SZ0`(9T@@;
XM:@`(80`!S$_O``P@7R!08*(A0@`0(%!*D&<D48]9CRZ/6)="KP`$+T\`""`/!
XM0^H`!&$``:0@3V$`^5Y/[P`,3-\,!'``3G5/[P`,(%\@*@`,D((E0``,3-\,O
XM!'`!3G5A``#NL>@`"&<``"I*@6<``"1*@&H$T*@`#+"H``QD```4(%"PJ``0_
XM90Z0J``0(%!*D&;P<`!.=="!L*@`$&+T<`%.=2`I``S1J``,(WP```````P@V
XM:``(8!`@*0`,T:@`#"-\```````,80`!!F$``(!P`$YU2.<@("%\```````,Y
XM(E!*D6<``%Y*J0`(9P@C?```````$")12I%G2%&/68\NCUB70J\`!"]/``@D[
XM44JI``AG("0)(%$B:0`$(H@A20`$($\B0B`0((E(T0$!($`A20`$(DI*D6;2L
XM($]A`/A83^\`#$S?!`1P`$YU``!(Y^#`(&X`)#/\0```W_":4B@!)B0N`#@M!
XM?```````."!N`"13*`$F;`@S_,```-_PFDJ"9RPB0B`I``AG$B)I`!0O#BQN7
XM`"1.KO\N+%\B0B01<!@O#BQN`"1.KO\N+%]@T$S?`P=.=4CG@,`O#BQN`"1.(
XMKOV0+%],WP,!T<#3P$YU(`@@45B)L\AG)B\*)&@`!"(I``0C2@`$)(G#B<&*K
XM(!(A2@`$)(C!BB5)``0BBB1?3G4```/L````&@````````"$````>````%``1
XM``!D````"@```'0```"4````8````'````!\````C````%P```!8````3```.
XM`(@```!4````D````&P```"`````:`````8````2````%@```!H```#L```!U
XM!@````````/P`````D5N9$-O9&4````*?`````--;W9E4W5B3&ES=`````I0-
XM````!$5.04),15]6,S8N,#$Y``````GZ`````D1&3&]O<``````)^@````-##
XM;W!Y0GET97,```````HP`````D1&1&]N90`````**@````-$1DQ.;T)U9F8`X
XM``````H8`````DU33$1O;F4````*>@````-);G-E<G1,:7-T``````I*````"
XM`T1E9F5R961&<F5E````"<@````#4F5A9'E.971"=69F```'^@````))0TQ$&
XM;VYE````"1`````#0WA.0D--86ME4&]S```%K`````)!4T-$;VYE`````?H`G
XM```"0TY"1V]O9`````9H````!$-X3D)#3F]N16UP='DR``````6D````!$-XR
XM3D)#3F]N16UP='DQ``````6>`````U1.0DQ#;VUM;VX`````!5P````$0V]P$
XM>49R;VU.971"=69F````!88````#4DY"3$-O;6UO;@`````(1`````-24TQ2N
XM96%L4V5G``````F.````!$-43D)#;W!Y4V5T=7````````5Z`````U1.0D9#N
XM;VUM;VX`````!1(````$26YT1G)E95-E9VUE;G1S`````A`````#4DY"0F%DR
XM061D```````(P`````-#3D),9#)S;6%L;`````8N`````E1.0E!,;V]P```$J
XM[@````)33D)03&]O<````O@````"3TY"4TQO;W````<N`````E1.0DY,;V]P(
XM```%.@````)33D).3&]O<````]0````#3TY"4TQO;W!04UH````'J@````)/Q
XM3D)/3&]O<```!HP````$0V]P>51O3F5T0G5F9@``````!7`````%0V]P>5A.2
XM971"=69F0V]M;6]N``````6<````!$-&3D)#;W!Y4V5T=7````````60````$
XM`E)33F5X=``````)<`````1296-L86EM4V5G;65N=',````)3@````)/3D))'
XM3&]O<```!L(````$0WA.0D-';W1#;W5N=```````!>X````#0WA.0D-,1&]N8
XM90`````%X@````)24TQO;W``````"88````#3TY"24QO;W!04UH````&F```\
XM``))1E-#3&]O<````AH````#4DY"3F5E9%-E9P`````(&@````)/3D)31&]N4
XM90``!Z`````"24-.;VY#;VX```D,`````E1.0E!O<P`````$[`````-/3D)3W
XM1&]N95!36@````?V`````E-.0E!O<P`````"]@````)23D),1&]N90``"(H`7
XM```%1G)E95-E9VUE;G1S0V]M;6]N``````(0````!$%L;&]C4V5G;65N=',`]
XM``````&$`````E)31V]O9``````)O@````-23D),6F5R;U-E9P````@V````J
XM`DE&4T-$;VYE```"E`````-#3D),3F5X=&1S=`````8Z`````DE#26YS:61EY
XM```(\@````1%3D%"3$5?5C,V+C`R,P`````"D`````1%3D%"3$5?5C,V+C`RQ
XM,@`````"7`````))0TQO;W``````"/P````#0TY"3$YE>'1S<F,````&4@``=
XM``-4<FEM3F5T0G5F9@````3`````!$5.04),15]6,S8N,#(P``````'&````=
XM`T-O<'E.971"=69F````!@H````#3TY"4TQO;W!%;F0````'>`````-/3D)3R
XM4V5T=7````````="````!$YE=$)U9F9!<'!E;F0```````D<````!$].0E-#^
XM:&5C:T1E<W0```````=:`````E1.0DYE9P`````%-`````-214U(14%$+C`Q-
XM.0````&X`````E1.0D%L;``````%8@````)33D).96<``````\X````#0WA.T
XM0D-);G-I9&4R```%O`````)33D)!;&P``````MX````$26YT06QL;V-396=M8
XM96YT<P```8H````#0WA.0D-);G-I9&4Q```%M`````-24TQ#;VUM;VX`````Y
XM``FN`````T].0E-#;&5A;G5P````!WH````"4TY"0TQ"860```2X`````U)%&
XM34A%040N,#(Q`````BH````"0WA.0D-"860```7:````!%!.0D%);G-E<G1,H
XM:7-T``````E"`````U).0DQ296%L4V5G````"#P````#0TY"3%-E='5P````F
XM```&-@````-)<T-O;G1I9W5O=7,```C8`````T].0E-3;6%L;```````!S8`V
XM```"5$Y"0F%D``````3H`````E-.0D)A9``````"T@````)23D)"860`````$
XM",8````#3TY"4VEM<&QE```````&^`````-#>$Y"0TQO;W````````7*````2
XM`T].0E-I;7!L95!36@``!Z8````#5$Y"4$Q$;VYE```````%``````-33D)0Z
XM3$1O;F4```````,*`````U1.0DY,1&]N90``````!5`````#4TY"3DQ$;VYE!
XM```````#[`````)33D):97)O`````M8````#3TY"3TQ$;VYE```````&Z@``_
XM``)!4T-"860``````@`````#24--86ME4&]S```````(Z@````)23D),;V]P1
XM````""P````#0TY"3%-E='5P9'-T```&-@````-/3D))3$1O;F4```````;0!
XM`````D-.0D)A9``````&<`````5!;&QO8U-E9VUE;G1S0V]M;6]N`````8H`\
XM```"5$Y"0U!O<P````3,`````TE#3F]N16UP='DR````".0````#0TY"3%-EL
XM='5P<W)C```&3@````)33D)#4&]S`````K`````$4')E<&5N9$YE=$)U9F8`]
XM````"3(````"4E-,1&]N90````FT`````TE#3F]N16UP='DQ````"-P````#2
XM3TY"24Q$;VYE4%-:```&I@````-#>$Y"0T=O;V0```````8"`````U-P;&ET4
XM3F5T0G5F9@```IP````#4DY"1&5L971E```````(E`````-)1E-#3$9R964`2
XM``````)>````!%-.0E!,1%!33F]N6F5R;P````-V`````D%30TQO;W`````!"
XME@````1#;VUP86-T3F5T0G5F9@`````&>`````133D).3$104TYO;EIE<F\`\
XM```$6@````133D)03$1!<W-E;6)L90`````#N`````)#3D),;V]P````!B8`G
XM```"5$Y"1V]O9`````3D````!%-.0DY,1$%S<V5M8FQE``````2>`````E-.-
XM0D=O;V0````"R`````)23D)';V]D````"+@````#4DY"061D4V5G```````(7
XM5`````)33D)$;VYE`````LH````"24-)<T-O;@````D8`````T9R965396=MG
XM96YT<P```@H````#4TY"4$Q$6F5R;P`````#K@````-33D).3$1:97)O````!
XM``24`````D-L;W-E```````!)`````%.=6QL```!@`````%/<&5N```!&```^
XM``)%>'!U;F=E`````2P````$3D),:6YI=%-T<G5C=````````.(````"26YIH
XM=%]%;F0```#:`````U9%4E-44DE.1P```````"X````#9&5V1G5N8TEN:70`;
XM````3`````-I;FET1&5S8W)I<``````$`````4EN:70```"<`````TYE=$)UC
X?9F9.86UE`````!X````````#\@```^H````````#\G0`V
X``
Xend
Xsize 5656
END_OF_FILE
if test 7965 -ne `wc -c <'NetBuff.uu'`; then
    echo shar: \"'NetBuff.uu'\" unpacked with wrong size!
fi
# end of 'NetBuff.uu'
fi
if test -f 'etherstuff.txt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'etherstuff.txt'\"
else
echo shar: Extracting \"'etherstuff.txt'\" \(1113 characters\)
sed "s/^X//" >'etherstuff.txt' <<'END_OF_FILE'
X$Id: etherstuff.txt,v 1.3 91/05/08 16:15:58 rsbx Exp $
X
XEthernet specific information for the SANA_II specification:
X
XS2io_DataLength:
X
X	In the case of 802.3 packets, this field is filled with the
X	length field from the DTL.
X
X	Otherwise, it is the length of the packet data (same as
X	NetBuff.Count for non-raw reads).
X
X
XAddress format:
X
X	Ethernet addresses consist of 47 bits of address information and
X	a 1 bit multicast flag. The standard for expressing ethernet
X	addresses is as 6 bytes (octets) in the order in which the bytes
X	are transmitted with the low-order bits in a byte transmitted
X	first. The multicast flag bit is the least-significant bit of the
X	first byte.
X
X	Ethernet addresses in a Sana2IOReq occupy the first 6 bytes of
X	an address field in transmission order with the low-order bits in
X	a byte transmitted first.
X
X
XRaw reads and writes:
X
X	The data format for a raw read or write is:
X
X		6 bytes of destination address,
X		6 bytes of source address,
X		2 bytes of type,
X		64 to 1500 bytes of data,
X		4 bytes CRC value covering all of the above.
X
X	See Ethernet specifications for more information.
END_OF_FILE
if test 1113 -ne `wc -c <'etherstuff.txt'`; then
    echo shar: \"'etherstuff.txt'\" unpacked with wrong size!
fi
# end of 'etherstuff.txt'
fi
if test -f 'netbuff.doc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'netbuff.doc'\"
else
echo shar: Extracting \"'netbuff.doc'\" \(18382 characters\)
sed "s/^X//" >'netbuff.doc' <<'END_OF_FILE'
XTABLE OF CONTENTS
X
Xnetbuff.library
Xnetbuff.library/AllocSegments()
Xnetbuff.library/CompactNetBuff()
Xnetbuff.library/CopyFromNetBuff()
Xnetbuff.library/CopyNetBuff()
Xnetbuff.library/CopyToNetBuff()
Xnetbuff.library/FreeSegments()
Xnetbuff.library/IntAllocSegments()
Xnetbuff.library/IntFreeSegments()
Xnetbuff.library/IsContiguous()
Xnetbuff.library/NetBuffAppend()
Xnetbuff.library/PrependNetBuff()
Xnetbuff.library/ReadyNetBuff()
Xnetbuff.library/ReclaimSegments()
Xnetbuff.library/SplitNetBuff()
Xnetbuff.library/TrimNetBuff()
Xnetbuff.library                                               netbuff.library
X
X	Netbuff.library maintains the free pool of NetBuffSegments for
X	use by the various network modules. It also contains several
X	utility functions for dealing with NetBuffs as a data
X	structure for "holding" network packet data as well as
X	allocators and deallocators for NetBuffSegments.
X
X	The intent is for all of the network modules to use a common
X	pool of buffers so as to reduce the memory requirements of the
X	network software, and for the network modules to be able to
X	pass network data (packets) with minimal copying.
X
X   STRUCTURES
X	A NetBuff is a data structure representing a logical array of
X	of bytes.
X
X	    struct NetBuff
X	        {
X	        struct MinList List;
X	        ULONG Count;
X	        };
X
X	    List
X	        List of NetBuffSegments.
X
X	    Count
X	        The number of bytes of data the NetBuff is said to
X	        contain.
X
X
X	A NetBuffSegment is a data structure used to store and keep
X	track of all or part of the data in a NetBuff.
X
X	    struct NetBuffSegment
X	        {
X	        struct MinNode Node;
X	        ULONG PhysicalSize;
X	        ULONG DataOffset;
X	        ULONG DataCount;
X	        UBYTE *Buffer;
X	        };
X
X	    Node
X	        Node structure linking the NetBuffSegments together.
X
X	    PhysicalSize
X	        The size of the data area that Buffer points to. If
X	        this field is zero, the actual size of the data area
X	        unknown and it is managed (allocated and freed) by
X	        some other entity. Only 'Count' bytes starting at
X	        '(Buffer+Offset)' are known to be valid.
X
X	    DataOffset
X	        Offset into the Buffer where the data starts.
X
X	    DataCount
X	        Number of data bytes that this NetBuffSegment
X	        contains.
X
X	    Buffer
X	        Pointer to the start of the data area for this
X	        NetBuffSegment.
X
X   PHYSICALSIZE ZERO SEGMENTS
X	Any software making use of NetBuffs must correctly handle
X	NetBuffs with PhysicalSize zero segments. The general rules to
X	follow are as follows:
X
X	+   "Send" NetBuffs, those NetBuffs where the data is created
X	    and passed to a lower network layer, are returned to the
X	    creator with the data intact. This class of NetBuffs may
X	    have segments of PhysicalSize zero.
X
X	+   "Receive" NetBuffs, those NetBuffs where the data is
X	    created and passed to a higher network layer, are not
X	    returned to the creator. This class of NetBuffs may not
X	    have segments of PhysicalSize zero.
X
X	+   Lower network layers will eventually return the actual
X	    NetBuff structure (pointer) to the layer that created the
X	    data.
X
X	+   NetBuffs returned to higher layers from lower layers may
X	    have the "physical" layout of the data changed. The layout
X	    of the "logical" data will not have changed.
X
X	+   Track NetBuff structures to know when it is safe to reuse/
X	    deallocate storage for PhysicalSize zero segments.
X
X	In to above, higher and lower network layers refers to the
X	usual diagram of the OSI network layering model; where the
X	application layer is at the top of the diagram and the
X	physical layer is at the bottom.
X
X	This model for handling PhysicalSize zero segments also has
X	obvious advantages in situations where time-outs and
X	retransmittions occure.
X
X   CREDITS
X	Raymond S. Brand   rsbx@cbmvax.commodore.com   (215) 431-9100
X	Martin Hunt      martin@cbmvax.commodore.com   (215) 431-9100
X	Perry Kivolowitz           ASDG Incorporated   (608) 273-6585
X
Xnetbuff.library/AllocSegments()               netbuff.library/AllocSegments()
X
X   NAME
X	AllocSegments -- Get a list of NetBuffSegments.
X
X   SYNOPSIS
X	AllocSegments( Count, Segment_List )
X	               D0     A0
X
X	void AllocSegments( ULONG, struct List * );
X
X   FUNCTION
X	This function returns a list of NetBuffSegments sufficient to
X	hold Count bytes.
X
X   INPUTS
X	Count           Numbers of bytes for which space is needed.
X	Segment_List    Pointer to an empty (initialized) list to hold
X	                    the allocated NetBuffSegments.
X
X   RESULTS
X
X   NOTES
X	The function cannot be called from interrupts.
X
X   SEE ALSO
X	netbuff.library/IntAllocSegments(),
X	netbuff.library/FreeSegments(),
X	netbuff.library/ReadyNetBuff()
X
X   BUGS
X
Xnetbuff.library/CompactNetBuff()             netbuff.library/CompactNetBuff()
X
X   NAME
X	CompactNetBuff -- Optimize a NetBuff.
X
X   SYNOPSIS
X	error = CompactNetBuff( Netbuff )
X	D0                      A0
X
X	LONG CompactNetBuff( struct NetBuff * );
X
X   FUNCTION
X	This function optimizes a NetBuff by moving the data to fill
X	each needed NetBuffSegment as much as possible and return
X	unused NetBuffSegments to the free pool. This function will
X	not modify NetBuffSegments of physical size zero.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff structure to optimize.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function consumes time.
X
X   SEE ALSO
X
X   BUGS
X
Xnetbuff.library/CopyFromNetBuff()           netbuff.library/CopyFromNetBuff()
X
X   NAME
X	CopyFromNetBuff -- Copy data from a NetBuff to memory.
X
X   SYNOPSIS
X	error = CopyFromNetBuff( Netbuff, Offset, Data, Count )
X	D0                       A0       D0      A1    D1
X
X	LONG CopyFromNetBuff( struct NetBuff *, LONG, UBYTE *, ULONG );
X
X   FUNCTION
X	This function copies 'Count' bytes from a NetBuff to memory
X	pointed to by Data. If Offset is non-negative, then the start
X	of the data to copy is 'Offset' bytes from the start of the
X	NetBuff. If Offset is negative, then the start of the data to
X	copy is 'abs(Offset)' bytes from the end of the NetBuff.
X
X   INPUTS
X	NetBuff         Pointer to NetBuff structure with source data.
X	Offset          Offset into Netbuff where data starts.
X	Data            Pointer to area to store data in.
X	Count           Number of bytes to copy.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function may be called from interrupts.
X
X	This function might be used by a network device driver to
X	extract bytes from a NetBuff to fill hardware.
X
X	This function might be used within a protocol stack to extract
X	data structures from a NetBuff into local memory.
X
X   SEE ALSO
X	netbuff.library/CopyToNetBuff()
X
X   BUGS
X
Xnetbuff.library/CopyNetBuff()                   netbuff.library/CopyNetBuff()
X
X   NAME
X	CopyNetBuff -- Make a copy of a NetBuff.
X
X   SYNOPSIS
X	error = CopyNetBuff( Netbuff0, Netbuff1 )
X	D0                   A0        A1
X
X	LONG CopyNetBuff( struct NetBuff *, struct NetBuff * );
X
X   FUNCTION
X	This function makes NetBuff1 a logical clone of Netbuff0.
X	Netbuff0 will be unmodified and Netbuff1 will be optimal.
X
X	All data in Netbuff1 will be lost when this function is
X	called.
X
X   INPUTS
X	Netbuff0        Pointer to source NetBuff structure.
X	Netbuff1        Pointer to destination NetBuff structure.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function may be called from interrupts.
X
X	Only the first NetBuffSegment in NetBuff1 is guaranteed to
X	still be in NetBuff1 when this function returns.
X
X   SEE ALSO
X	netbuff.library/CopyFromNetBuff(),
X	netbuff.library/CopyToNetBuff()
X
X   BUGS
X
Xnetbuff.library/CopyToNetBuff()               netbuff.library/CopyToNetBuff()
X
X   NAME
X	CopyToNetBuff -- Replace data in a NetBuff.
X
X   SYNOPSIS
X	error = CopyToNetBuff( Netbuff, Offset, Data, Count )
X	D0                     A0       D0      A1    D1
X
X	LONG CopyToNetBuff( struct NetBuff *, LONG, UBYTE *, ULONG );
X
X   FUNCTION
X	This function replaces existing data in Netbuff with 'Count'
X	bytes from those pointed to by Data. If Offset is
X	non-negative, then the replacement starts 'Offset' bytes from
X	the start of Netbuff. If Offset is negative, then the
X	replacement starts 'abs(Offset)' from the end of Netbuff.
X
X	This function will not change the amount of data that Netbuff
X	contains; it will only replace parts of it.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff structure to copy data to.
X	Offset          Offset into NetBuff to place data.
X	Data            Pointer to data to copy.
X	Count           Number of bytes of data to copy.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function may be called from interrupts.
X
X	This function might be used within a network device driver to
X	fill a NetBuff from bytes taken from the hardware. In this
X	case, CopyToNetBuff()s would be preceded possibly by a call to
X	ReadyNetBuff().
X
X   SEE ALSO
X	netbuff.library/CopyFromNetBuff(),
X	netbuff.library/ReadyNetBuff()
X
X   BUGS
X
Xnetbuff.library/FreeSegments()                 netbuff.library/FreeSegments()
X
X   NAME
X	FreeSegments -- Return a list of NetBuffSegments.
X
X   SYNOPSIS
X	FreeSegments( Segment_list )
X	              A0
X
X	void FreeSegments( struct List * );
X
X   FUNCTION
X	This function gives a list of NetBuffSegments to the system
X	free pool.
X
X   INPUTS
X	Segment_list    Pointer to the list of NetBuffSegments to add
X	                    to the system free NetBuffSegment pool.
X
X   NOTES
X	When this routine encounters a NetBuffSegment with
X	PhysicalSize of 0, the data area is left untouched but the
X	NetBuffSegment structure which points to the data is freed
X	using exec.library/FreeMem().
X
X   SEE ALSO
X	netbuff.library/IntFreeSegments(),
X	netbuff.library/AllocSegments(),
X	netbuff.library/ReadyNetBuff()
X
X   BUGS
X
Xnetbuff.library/IntAllocSegments()         netbuff.library/IntAllocSegments()
X
X   NAME
X	IntAllocSegments -- Get a list of NetBuffSegments.
X
X   SYNOPSIS
X	IntAllocSegments( Count, Segment_List )
X	                  D0     A0
X
X	void IntAllocSegments( ULONG, struct List * );
X
X   FUNCTION
X	This function returns a list of NetBuffSegments sufficient to
X	hold Count bytes.
X
X   INPUTS
X	Count           Numbers of bytes for which space is needed.
X	Segment_List    Pointer to an empty (initialized) list to hold
X	                    the allocated NetBuffSegments.
X
X   RESULTS
X
X   NOTES
X	The function should be called only from interrupts.
X
X   SEE ALSO
X	netbuff.library/AllocSegments(),
X	netbuff.library/IntFreeSegments(),
X	netbuff.library/ReadyNetBuff()
X
X   BUGS
X	Since this function may be called from interrupts, it can not
X	actually allocate memory from the system. It, therefor, relies
X	on a "friendly" task or process to add NetBuffSegments to the
X	free pool via the netbuff.library/FreeSegments() function.
X
Xnetbuff.library/IntFreeSegments()           netbuff.library/IntFreeSegments()
X
X   NAME
X	IntFreeSegments -- Return a list of NetBuffSegments.
X
X   SYNOPSIS
X	IntFreeSegments( Segment_list )
X	                 A0
X
X	void IntFreeSegments( struct List * );
X
X   FUNCTION
X	This function gives a list of NetBuffSegments to the system
X	free pool.
X
X   INPUTS
X	Segment_list    Pointer to the list of NetBuffSegments to add
X	                    to the system free NetBuffSegment pool.
X
X   NOTES
X	The function should be called only from interrupts.
X
X	When this routine encounters a NetBuffSegment with
X	PhysicalSize of 0, that data area is left untouched but the
X	NetBuffSegment structure which points to the data is freed
X	using exec.library/FreeMem().
X
X   SEE ALSO
X	netbuff.library/FreeSegments(),
X	netbuff.library/IntAllocSegments(),
X	netbuff.library/ReadyNetBuff()
X
X   BUGS
X	This function relies on the non-interrupt functions to perform
X	garbage collection of segments of physical size zero.
X
Xnetbuff.library/IsContiguous()                 netbuff.library/IsContiguous()
X
X   NAME
X	IsContiguous -- Checks if data in in contiguous memory.
X
X   SYNOPSIS
X	result = IsContiguous( Netbuff, Offset, Count )
X	D0                     A0       D0      D1
X
X	LONG IsContiguous( struct NetBuff *, LONG, ULONG );
X
X   FUNCTION
X	This function indicates whether or not Count bytes of data
X	starting at Offset in NetBuff are in contiguous bytes. If
X	Offset is non-negative, then the start of the data to check is
X	'Offset' bytes from the start of the NetBuff. If Offset is
X	negative, then the start of the data to check is 'abs(Offset)'
X	bytes from the end of the NetBuff.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff to check.
X	Offset          Offset into NetBuff where to check.
X	Count           Number of bytes that should be contiguous.
X
X   RESULTS
X	result          Zero if non-contiguous; non-zero otherwise.
X
X   NOTES
X
X   SEE ALSO
X
X   BUGS
X
Xnetbuff.library/NetBuffAppend()               netbuff.library/NetBuffAppend()
X
X   NAME
X	NetBuffAppend -- Append one NetBuff to then end of another.
X
X   SYNOPSIS
X	error = NetBuffAppend( Netbuff0, Netbuff1 )
X	D0                     A0        A1
X
X	LONG NetBuffAppend( struct NetBuff *, struct NetBuff * );
X
X   FUNCTION
X	This function appends the contents of Netbuff1 to the end of
X	Netbuff0.
X
X   INPUTS
X	Netbuff0        NetBuff to be appended to.
X	Netbuff1        NetBuff to append.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X
X   SEE ALSO
X	netbuff.library/PrependNetBuff(),
X	netbuff.library/SplitNetBuff()
X
X   BUGS
X
Xnetbuff.library/PrependNetBuff()             netbuff.library/PrependNetBuff()
X
X   NAME
X	PrependNetBuff -- Prepend one NetBuff to the front of another.
X
X   SYNOPSIS
X	error = PrependNetBuff( Netbuff0, Netbuff1 )
X	D0                      A0        A1
X
X	LONG PrependNetBuff( struct NetBuff *, struct NetBuff * );
X
X   FUNCTION
X	This function prepends the contents of Netbuff1 to the front
X	of Netbuff0.
X
X   INPUTS
X	Netbuff0        NetBuff to be prepended to.
X	Netbuff1        NetBuff to prepend.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X
X   SEE ALSO
X	netbuff.library/NetBuffAppend(),
X	netbuff.library/SplitNetBuff()
X
X   BUGS
X
Xnetbuff.library/ReadyNetBuff()                 netbuff.library/ReadyNetBuff()
X
X   NAME
X	ReadyNetBuff -- Ready a NetBuff for copying to.
X
X   SYNOPSIS
X	error = ReadyNetBuff( Netbuff, Count )
X	D0                    A0       D0
X
X	LONG ReadyNetBuff( struct NetBuff *, ULONG );
X
X   FUNCTION
X	This function sets the amount of data refered to by a NetBuff,
X	and the associated NetBuffSegments, to Count bytes in
X	preparation for a CopyToNetBuff() operation. It does not
X	initialize the data in the NetBuff.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff structure to initialize.
X	Count           The number of bytes of data that the NetBuff
X	                    is to refer to.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function may be called from interrupts.
X
X	This function will attempt to allocate NetBuffSegments as
X	needed to make room for Count bytes available.
X
X	Unneeded NetBuffSegments will be returned to the system free
X	pool.
X
X   SEE ALSO
X
X   BUGS
X
Xnetbuff.library/ReclaimSegments()           netbuff.library/ReclaimSegments()
X
X   NAME
X	ReclaimSegments -- Free all but first NetBuffSegment.
X
X   SYNOPSIS
X	error = ReclaimSegments( Netbuff )
X	D0                       A0
X
X	LONG ReclaimSegments( struct NetBuff * );
X
X   FUNCTION
X	This function frees all non-zero PhysicalSize NetBuffSegments
X	except the first NetBuffSegment of the NetBuff.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff to reclaim segments from.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function may be called from interrupts.
X
X	The intended use for this function is to encourage drivers or
X	protocol stacks to free NetBuffSegments from NetBuffs in read
X	queues.
X
X   SEE ALSO
X
X   BUGS
X
Xnetbuff.library/SplitNetBuff()                 netbuff.library/SplitNetBuff()
X
X   NAME
X	SplitNetBuff -- Split a NetBuff in to two NetBuffs.
X
X   SYNOPSIS
X	error = SplitNetBuff( Netbuff0, Count, Netbuff1 )
X	D0                    A0        D0     A1
X
X	LONG SplitNetBuff( struct NetBuff *, LONG, struct NetBuff * );
X
X   FUNCTION
X	This function takes a NetBuff and splits it at the specified
X	offset. The sign of Count determines which bytes will be
X	removed from Netbuff0 and placed in Netbuff1. If Count is
X	non-negative, the first 'Offset' bytes in Netbuff0 will be
X	moved to Netbuff1. If Offset is negative, the last
X	'abs(Offset)' bytes in Netbuff0 will be moved to Netbuff1.
X
X	All data in Netbuff1 will be lost when this function is
X	called.
X
X   INPUTS
X	Netbuff0        Pointer to NetBuff structure with data to
X	                    split.
X	Count           Number of bytes to split off.
X	Netbuff1        Pointer to a NetBuff structure to receive
X	                    split-off data.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function might be used within a protocol stack to split
X	a packet into smaller NetBuffs so as to fall below a specific
X	transport medium's maximum transfer unit.
X	
X   SEE ALSO
X	netbuff.library/TrimNetBuff(),
X	netbuff.library/NetBuffAppend(),
X	netbuff.library/PrependNetBuff()
X
X   BUGS
X	If the split point is in a NetBuffSegment of PhysicalSize
X	zero, exec/AllocMem() will be called to create a new segment
X	of PhysicalSize zero.
X
Xnetbuff.library/TrimNetBuff()                   netbuff.library/TrimNetBuff()
X
X   NAME
X	TrimNetBuff -- Elliminate leading or trailing data.
X
X   SYNOPSIS
X	error = TrimNetBuff( Netbuff, Count )
X	D0                   A0        D0
X
X	LONG TrimNetBuff( struct NetBuff *, LONG );
X
X   FUNCTION
X	This function takes a NetBuff and elliminates 'abs(Count)'
X	bytes of data from the first or last bytes of the NetBuff data
X	depending on the sign of Count. If Count is positive, the
X	first 'Count' bytes of data are elliminated. If Count is
X	negative, the last 'abs(Count)' bytes are elliminated.
X
X	Emptied NetBuffSegments (which may result) will be returned to
X	the free pool.
X
X   INPUTS
X	Netbuff         Pointer to NetBuff to be trimmed.
X	Count           Number of data bytes to remove.
X
X   RESULTS
X	error           Zero if successful; non-zero otherwise.
X
X   NOTES
X	This function might be used within a protocol stack to remove
X	levels of protocol wrapping from either side of a packet.
X
X   SEE ALSO
X	netbuff.library/SplitNetBuff(),
X	netbuff.library/NetBuffAppend(),
X	netbuff.library/PrependNetBuff()
X
X   BUGS
X
X
END_OF_FILE
if test 18382 -ne `wc -c <'netbuff.doc'`; then
    echo shar: \"'netbuff.doc'\" unpacked with wrong size!
fi
# end of 'netbuff.doc'
fi
if test -f 'netbuff.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'netbuff.h'\"
else
echo shar: Extracting \"'netbuff.h'\" \(1154 characters\)
sed "s/^X//" >'netbuff.h' <<'END_OF_FILE'
X#ifndef LIBRARIES_NETBUFF_H
X#define LIBRARIES_NETBUFF_H 1
X/*
X**	$Filename: netbuff.h $
X**	$Release: Developer Information$
X**	$Revision: 1.1 $
X**	$Date: 91/05/14 $
X**
X**	NetBuff library structure definitions.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X*/
X
X/*
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X*/
X
X
X#ifndef EXEC_TYPES_H
X#include <exec/types.h>
X#endif /* !EXEC_TYPES_H */
X#ifndef EXEC_LISTS_H
X#include <exec/lists.h>
X#endif /* !EXEC_LISTS_H */
X
X
X#define NETBUFFNAME	"netbuff.library"
X
X
Xstruct NetBuffSegment
X	{
X	struct MinNode Node;	/* segment links               */
X	ULONG PhysicalSize;	/* buffer size of this segment */
X	ULONG DataOffset;	/* offset to valid data        */
X	ULONG DataCount;	/* valid bytes in this segment */
X	UBYTE *Buffer;		/* pointer to data buffer area */
X	};
X
X
Xstruct NetBuff
X	{
X	struct MinList List;	/* segments                  */
X	ULONG Count;		/* amount of data in NetBuff */
X	};
X
X
X#endif	/* LIBRARIES_NETBUFF_H */
END_OF_FILE
if test 1154 -ne `wc -c <'netbuff.h'`; then
    echo shar: \"'netbuff.h'\" unpacked with wrong size!
fi
# end of 'netbuff.h'
fi
if test -f 'netbuff.i' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'netbuff.i'\"
else
echo shar: Extracting \"'netbuff.i'\" \(963 characters\)
sed "s/^X//" >'netbuff.i' <<'END_OF_FILE'
X	IFND	LIBRARIES_NETBUFF_I
XLIBRARIES_NETBUFF_I	SET	1
X**
X**	$Filename: netbuff.i $
X**	$Release: Developer Information$
X**	$Revision: 1.1 $
X**	$Date: 91/05/14 $
X**
X**	NetBuff library structure definitions.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X**
X
X**
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X**
X
X
X	IFND	EXEC_TYPES_I
X	INCLUDE	"exec/types.i"
X	ENDC	; !EXEC_TYPES_I
X	IFND	EXEC_LISTS_I
X	INCLUDE	"exec/lists.i"
X	ENDC	; !EXEC_LISTS_I
X
X
XNETBUFFNAME	MACRO
X		dc.b	'netbuff.library',0
X		ds.w	0
X		ENDM
X
X
X STRUCTURE NETBUF,0
X	STRUCT	NB_LIST,MLH_SIZE
X	ULONG	NB_COUNT
X	LABEL	NB_SIZE
X
X
X STRUCTURE NETBUFFSEGMENT,0
X	STRUCT	NBS_NODE,MLN_SIZE
X	ULONG	NBS_PHYSICALSIZE
X	ULONG	NBS_DATAOFFSET
X	ULONG	NBS_DATACOUNT
X	APTR	NBS_BUFFER
X	LABEL	NBS_SIZE
X
X
X	ENDC	; LIBRARIES_NETBUFF_I
END_OF_FILE
if test 963 -ne `wc -c <'netbuff.i'`; then
    echo shar: \"'netbuff.i'\" unpacked with wrong size!
fi
# end of 'netbuff.i'
fi
if test -f 'readme' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'readme'\"
else
echo shar: Extracting \"'readme'\" \(1915 characters\)
sed "s/^X//" >'readme' <<'END_OF_FILE'
XThis archive is the general release of the SANA-II, Standard Amiga Network
XArchitecture (try 2), device driver specification.
X
XThis is a specification for the device driver interface level only.
X
XIf you wish to make comments on this specification, please contact one
Xof the following:
X
X	Raymond S. Brand
X	Commodore-Amiga
X	(215) 431-9100
X	rsbx@cbmvax.commodore.com
X
X	Martin Hunt
X	Commodore-Amiga
X	(215) 431-9100
X	martin@cbmvax.commodore.com
X
X	Perry Kivolowitz
X	ASDG Incorporated
X
XThe preferred contact person is Ray.
X
X
XFiles
X	sana2device.doc
X		Autodoc that should apply to any SANA-II device.
X
X	sana2device.spec
X		"Raw" information for the autodoc tools. Also includes
X		extra information of use to SANA-II device writers.
X
X	sana2device.h
X	sana2device.i
X	sana2packetmagic.h
X	sana2packetmagic.i
X	sana2specialstats.h
X	sana2specialstats.i
X		Include files for use with SANA-II devices.
X
X	etherstuff.txt
X		Information specific to SANA-II Ethernet devices.
X
X	netbuff.doc
X		Autodoc for a SANA-II support library.
X
X	netbuff.h
X	netbuff.i
X		Include files for use with NetBuff.library.
X
X	NetBuff.library
X		Support library for SANA-II devices. Put in you LOBS:
X		directory.
X
XStatus
X	A SANA-II device driver for the Commodore A2065 Ethernet card
X	has been written and works.
X
X	A distributed Mandelbrot program has been written that uses the
X	above SANA-II A2065 device driver.
X
X	Commodore expects to use SANA-II devices for all future network
X	products.
X
X
XWARNING
X	Although we believe this spec to be stable, it may change as we
X	gain more experience with it as the next several device drivers
X	are written.
X
X
X------------------------------------------------------------------------
X  Raymond S. Brand			rsbx@cbmvax.commodore.com
X  Commodore-Amiga Engineering		...!uunet!cbmvax!rsbx
X  1200 Wilson Drive			(215)-431-9100
X  West Chester PA 19380			"Looking"
X------------------------------------------------------------------------
END_OF_FILE
if test 1915 -ne `wc -c <'readme'`; then
    echo shar: \"'readme'\" unpacked with wrong size!
fi
# end of 'readme'
fi
if test -f 'sana2device.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2device.h'\"
else
echo shar: Extracting \"'sana2device.h'\" \(7817 characters\)
sed "s/^X//" >'sana2device.h' <<'END_OF_FILE'
X#ifndef SANA2_SANA2DEVICE_H
X#define SANA2_SANA2DEVICE_H 1
X/*
X**	$Filename: sana2device.h $
X**	$Release: Developer Information$
X**	$Revision: 1.10 $
X**	$Date: 91/05/14 $
X**
X**	Structure definitions for SANA-II devices.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X*/
X
X/*
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X*/
X
X
X#ifndef EXEC_TYPES_H
X#include <exec/types.h>
X#endif /* !EXEC_TYPES_H */
X#ifndef EXEC_PORTS_H
X#include <exec/ports.h>
X#endif /* !EXEC_PORTS_H */
X#ifndef EXEC_IO_H
X#include <exec/io.h>
X#endif /* !EXEC_IO_H */
X#ifndef DEVICES_TIMER_H
X#include <devices/timer.h>
X#endif /* !DEVICES_TIMER_H */
X#ifndef LIBRARIES_NETBUFF_H
X#include <libraries/netbuff.h>
X#endif /* !LIBRARIES_NETBUFF_H */
X
X
X#define SANA2_MAX_ADDR_BITS	(128)
X#define SANA2_MAX_ADDR_BYTES	((SANA2_MAX_ADDR_BITS+7)/8)
X
X
Xstruct IOSana2Req
X	{
X	struct Message S2io_Message;
X	struct Device *S2io_Device;	/* device node pointer		*/
X	struct Unit   *S2io_Unit;	/* unit (driver private)	*/
X
X	UWORD S2io_Command;		/* device command		*/
X	UBYTE S2io_Flags;		/* command flags		*/
X	BYTE  S2io_Error;		/* generic error or warning	*/
X	ULONG S2io_WireError;		/* wire type specific error	*/
X
X	struct Sana2PacketType *S2io_PacketType;	/* packet type	*/
X	UBYTE S2io_SrcAddr[SANA2_MAX_ADDR_BYTES];	/* source addr	*/
X	UBYTE S2io_DstAddr[SANA2_MAX_ADDR_BYTES];	/* dest address	*/
X	ULONG S2io_DataLength;		/* from header			*/
X	struct NetBuff S2io_Body;	/* packet data			*/
X	void *S2io_StatData;		/* statics data pointer		*/
X	};
X
X
X/*
X * defines for the S2io_Flags field
X */
X
X#define SANA2IOB_RAW	(7)		/* raw packet IO requested	*/
X#define SANA2IOF_RAW	(1<<SANA2IOB_RAW)
X
X#define	SANA2IOB_BCAST	(6)		/* broadcast packet (received)	*/
X#define	SANA2IOF_BCAST	(1<<SANA2IOB_BCAST)
X
X#define	SANA2IOB_MCAST	(5)		/* multicast packet (received)	*/
X#define	SANA2IOF_MCAST	(1<<SANA2IOB_MCAST)
X
X#define SANA2IOB_QUICK	(IOB_QUICK)	/* quick IO requested (0)	*/
X#define SANA2IOF_QUICK	(IOF_QUICK)
X
X
X/*
X * defines for OpenDevice()
X */
X
X#define SANA2OPB_MINE	(0)		/* exclusive access requested	*/
X#define SANA2OPF_MINE	(1<<SANA2OPB_MINE)
X
X#define SANA2OPB_PROM	(1)		/* promiscuous mode requested	*/
X#define SANA2OPF_PROM	(1<<SANA2OPB_PROM)
X
X
Xstruct Sana2PacketType
X	{
X	ULONG CanonicalType;		/* used by higher levels	*/
X	ULONG Magic;			/* interpretation code		*/
X	ULONG Length;			/* length of match data		*/
X	UBYTE *Match;			/* bytes to compare		*/
X	UBYTE *Mask;			/* mask for comparison		*/
X	};
X
X
Xstruct Sana2DeviceQuery
X	{
X	/*
X	 * Standard information
X	 */
X	ULONG	SizeAvailable;		/* bytes available		*/
X	ULONG	SizeSupplied;		/* bytes supplied		*/
X	LONG	DevQueryFormat;		/* this is type 0		*/
X	LONG	DeviceLevel;		/* this document is level 0	*/
X	/*
X	 * Common information
X	 */
X	UWORD	AddrFieldSize;		/* address size in bits		*/
X	ULONG	MTU;			/* maximum packet data size	*/
X	LONG	bps;			/* line rate (bits/sec)		*/
X	LONG	HardwareType;		/* what the wire is		*/
X	/*
X	 * Format specific information
X	 */
X	};
X
X
X/*
X * defined Hardware types
X */
X
X#define S2WireType_Ethernet		1
X#define S2WireType_Arcnet		2
X
X
Xstruct Sana2PacketTypeStats
X	{
X	LONG PacketsSent;		/* transmitted count		*/
X	LONG PacketsReceived;		/* received count		*/
X	LONG BytesSent;			/* bytes transmitted count	*/
X	LONG BytesReceived;		/* bytes received count		*/
X	LONG PacketsDropped;		/* packets dropped count	*/
X	};
X
X
Xstruct Sana2SpecialStatRecord
X	{
X	ULONG Type;			/* statistic identifier		*/
X	LONG Count;			/* the statistic		*/
X	char *String;			/* statistic name		*/
X	};
X
X
Xstruct Sana2SpecialStatHeader
X	{
X	ULONG RecordCountMax;		/* room available		*/
X	ULONG RecordCountSupplied;	/* number supplied		*/
X	/* struct Sana2SpecialStatRecord[RecordCountMax]; */
X	};
X
X
Xstruct Sana2DeviceStats
X	{
X	LONG packets_received;		/* received count		*/
X	LONG packets_sent;		/* transmitted count		*/
X	LONG framing_errors;		/* framming errors found	*/
X	LONG bad_data;			/* bad packets received		*/
X	LONG hard_misses;		/* hardware miss count		*/
X	LONG soft_misses;		/* software miss count		*/
X	LONG unknown_types_received;	/* orphan count			*/
X	LONG fifo_overruns;		/* hardware overruns		*/
X	LONG fifo_underruns;		/* hardware underruns		*/
X	LONG reconfigurations;		/* network reconfigurations	*/
X	struct timeval last_start;	/* time of last online		*/
X	};
X
X
X/*
X * Device Commands
X */
X
X#define SANA2_CMD_START			(CMD_NONSTD)
X
X#define SANA2CMD_DEVICEQUERY		(SANA2_CMD_START+ 0)
X#define SANA2CMD_GETSTATIONADDRESS	(SANA2_CMD_START+ 1)
X#define SANA2CMD_CONFIGINTERFACE	(SANA2_CMD_START+ 2)
X#define SANA2CMD_ADDSTATIONALIAS	(SANA2_CMD_START+ 3)
X#define SANA2CMD_DELSTATIONALIAS	(SANA2_CMD_START+ 4)
X#define SANA2CMD_ADDMULTICASTADDRESS	(SANA2_CMD_START+ 5)
X#define SANA2CMD_DELMULTICASTADDRESS	(SANA2_CMD_START+ 6)
X#define SANA2CMD_MULTICAST		(SANA2_CMD_START+ 7)
X#define SANA2CMD_BROADCAST		(SANA2_CMD_START+ 8)
X#define SANA2CMD_TRACKTYPE		(SANA2_CMD_START+ 9)
X#define SANA2CMD_UNTRACKTYPE		(SANA2_CMD_START+10)
X#define SANA2CMD_GETTYPESTATS		(SANA2_CMD_START+11)
X#define SANA2CMD_GETSPECIALSTATS	(SANA2_CMD_START+12)
X#define SANA2CMD_GETGLOBALSTATS		(SANA2_CMD_START+13)
X#define SANA2CMD_ONEVENT		(SANA2_CMD_START+14)
X#define SANA2CMD_READORPHAN		(SANA2_CMD_START+15)
X#define SANA2CMD_ONLINE			(SANA2_CMD_START+16)
X#define SANA2CMD_OFFLINE		(SANA2_CMD_START+17)
X
X#define SANA2_CMD_END			(SANA2_CMD_START+18)
X
X
X/*
X * defined errors for S2io_Error
X */
X
X#define S2ERR_NO_ERROR		0	/* peachy-keen			*/
X#define S2ERR_NO_RESOURCES	1	/* resource allocation failure	*/
X#define S2ERR_UNKNOWN_ENTITY	2	/* unable to find something	*/
X#define S2ERR_BAD_ARGUMENT	3	/* garbage somewhere		*/
X#define S2ERR_BAD_STATE		4	/* inappropriate state		*/
X#define S2ERR_BAD_ADDRESS	5	/* who?				*/
X#define	S2ERR_MTU_EXCEEDED	6	/* too much to chew		*/
X#define	S2ERR_BAD_PROTOCOL	7	/* bad packet type structure	*/
X#define S2ERR_NOT_SUPPORTED	8	/* command not supported	*/
X#define S2ERR_SOFTWARE		9	/* software error detected	*/
X
X
X/*
X * defined errors for S2io_WireError
X */
X
X#define S2WERR_GENERIC_ERROR	0	/* no specific info available	*/
X#define	S2WERR_NOT_CONFIGURED	1	/* unit not configured		*/
X#define S2WERR_UNIT_ONLINE	2	/* unit is currently online	*/
X#define S2WERR_UNIT_OFFLINE	3	/* unit is currently offline	*/
X#define	S2WERR_ALREADY_TRACKED	4	/* protocol already tracked	*/
X#define	S2WERR_NOT_TRACKED	5	/* protocol not tracked		*/
X#define S2WERR_NETBUFF_ERROR	6	/* netbuff.lib returned error	*/
X#define S2WERR_SRC_ADDRESS	7	/* source address problem	*/
X#define S2WERR_DST_ADDRESS	8	/* destination address problem	*/
X#define S2WERR_BAD_BROADCAST	9	/* broadcast address problem	*/
X#define S2WERR_BAD_MULTICAST	10	/* multicast address problem	*/
X#define S2WERR_ALIAS_LIST_FULL	11	/* station alias list full	*/
X#define S2WERR_BAD_ALIAS	12	/* bad station alias		*/
X#define S2WERR_MULTICAST_FULL	13	/* multicast address list full	*/
X#define S2WERR_BAD_EVENT	14	/* unsupported event class      */
X#define S2WERR_BAD_STATDATA	15	/* statdata failed sanity check */
X#define S2WERR_PROTOCOL_UNKNOWN	16	/* unknown protocol type        */
X#define S2WERR_IS_CONFIGURED	17	/* attempt to config twice      */
X#define S2WERR_NULL_POINTER	18	/* null pointer detected        */
X
X
X/*
X * defined events
X */
X
X#define	S2EVENT_ERROR		0	/* error catch all		*/
X#define	S2EVENT_TX		1	/* transmitter error catch all	*/
X#define	S2EVENT_RX		2	/* receiver error catch all	*/
X#define	S2EVENT_ONLINE		3	/* unit is in service		*/
X#define	S2EVENT_OFFLINE		4	/* unit is not in service	*/
X#define	S2EVENT_NETBUF		5	/* NetBuff error catch all	*/
X#define S2EVENT_HARDWARE	6	/* hardware error catch all	*/
X#define S2EVENT_SOFTWARE	7	/* software error catch all	*/
X
X
X#endif	/* SANA2_SANA2DEVICE_H */
END_OF_FILE
if test 7817 -ne `wc -c <'sana2device.h'`; then
    echo shar: \"'sana2device.h'\" unpacked with wrong size!
fi
# end of 'sana2device.h'
fi
if test -f 'sana2device.i' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2device.i'\"
else
echo shar: Extracting \"'sana2device.i'\" \(7042 characters\)
sed "s/^X//" >'sana2device.i' <<'END_OF_FILE'
X	IFND	SANA2_SANA2DEVICE_I
XSANA2_SANA2DEVICE_I	SET	1
X**
X**	$Filename: sana2device.i $
X**	$Release: Developer Information$
X**	$Revision: 1.8 $
X**	$Date: 91/05/14 $
X**
X**	Structure definitions for SANA-II devices.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X**
X
X**
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X**
X
X	IFND	EXEC_TYPES_I
X	INCLUDE	"exec/types.i"
X	ENDC	!EXEC_TYPES_I
X	IFND	EXEC_PORTS_I
X	INCLUDE	"exec/ports.i"
X	ENDC	!EXEC_PORTS_I
X	IFND	EXEC_IO_I
X	INCLUDE	"exec/io.i"
X	ENDC	!EXEC_IO_I
X	IFND	DEVICES_TIMER_I
X	INCLUDE	"devices/timer.i"
X	ENDC	!DEVICES_TIMER_I
X	IFND	LIBRARIES_NETBUFF_I
X	INCLUDE "libraries/netbuff.i"
X	ENDC	!LIBRARIES_NETBUFF_I
X
X
XSANA2_MAX_ADDR_BITS	EQU	128
XSANA2_MAX_ADDR_BYTES	EQU	((SANA2_MAX_ADDR_BITS+7)/8)
X
X
X STRUCTURE IOSana2Req,0
X	STRUCT	S2IO_MESSAGE,MN_SIZE
X	APTR	S2IO_DEVICE		; device node pointer
X	APTR	S2IO_UNIT		; unit (driver private)
X
X	UWORD	S2IO_COMMAND		; device command
X	UBYTE	S2IO_FLAGS		; command flags
X	BYTE	S2IO_ERROR		; generic error or warning
X	ULONG	S2IO_WIREERROR		; wire type specific error
X
X	APTR	S2IO_PACKETTYPE		; packet type
X	STRUCT	S2IO_SRCADDR,SANA2_MAX_ADDR_BYTES	; source address
X	STRUCT	S2IO_DSTADDR,SANA2_MAX_ADDR_BYTES	; dest address
X	ULONG	S2IO_DATALENGTH		; from header
X
X	STRUCT	S2IO_BODY,NB_SIZE	; packet data
X	APTR	S2IO_STATDATA		; statics data pointer
X	LABEL	S2IO_SIZE
X
X
X;
X; equates for the S2IO_FLAGS field
X;
X
XSANA2IOB_RAW	EQU	7		; raw packet IO requested
XSANA2IOF_RAW	EQU	(1<<SANA2IOB_RAW)
X
XSANA2IOB_BCAST	EQU	6		; broadcast packet (received)
XSANA2IOF_BCAST	EQU	(1<<SANA2IOB_BCAST)
X
XSANA2IOB_MCAST	EQU	5		; multicast packet (received)
XSANA2IOF_MCAST	EQU	(1<<SANA2IOB_MCAST)
X
XSANA2IOB_QUICK	EQU	IOB_QUICK	; quick IO requested (0)
XSANA2IOF_QUICK	EQU	IOF_QUICK
X
X
X;
X; equates for OpenDevice()
X;
X
XSANA2OPB_MINE	EQU	0		; exclusive access requested
XSANA2OPF_MINE	EQU	(1<<SANA2OPB_MINE)
X
XSANA2OPB_PROM	EQU	1		; promiscuous mode requested
XSANA2OPF_PROM	EQU	(1<<SANA2OPB_PROM)
X
X
X STRUCTURE SANA2PACKETTYPE,0
X	ULONG	S2PT_CANONICALTYPE	; used by higher levels
X	ULONG	S2PT_MAGIC		; interpretation code
X	ULONG	S2PT_LENGTH		; length of match data
X	APTR	S2PT_MATCH		; bytes to compare
X	APTR	S2PT_MASK		; mask for comparison
X	LABEL	S2PT_SIZE
X
X
X STRUCTURE SANA2DEVICEQUERY,0
X	; Standard information
X	ULONG	S2DQ_SIZEAVAILABLE	; bytes available
X	ULONG	S2DQ_SIZESUPPLIED	; bytes supplied
X	LONG	S2DQ_FORMAT		; this is type 0
X	LONG	S2DQ_DEVICELEVEL	; this document is level 0
X
X	; Common information
X	UWORD	S2DQ_ADDRSIZE		; address size in bits
X	ULONG	S2DQ_MTU		; maximum packet data size
X	LONG	S2DQ_BPS		; line rate (bits/sec)
X	LONG	S2DQ_HARDWARETYPE	; what the wire is
X
X	; Format specific information
X	LABEL	S2DQ_SIZE
X
X
X;
X; defined SANA-II hardware types
X;
X
XS2WIRETYPE_ETHERNET		EQU	1
XS2WIRETYPE_ARCNET		EQU	2
X
X
X STRUCTURE SANA2PACKETTYPESTATS,0
X	LONG	S2PTS_TXPACKETS		; transmitted count
X	LONG	S2PTS_RXPACKETS		; received count
X	LONG	S2PTS_TXBYTES		; bytes transmitted count
X	LONG	S2PTS_RXBYTES		; bytes received count
X	LONG	S2PTS_PACKETSDROPPED	; packets dropped count
X	LABEL	S2PTS_SIZE
X
X
X STRUCTURE SANA2SPECIALSTATRECORD,0
X	ULONG	S2SSR_TYPE		; statistic identifier
X	LONG	S2SSR_COUNT		; the statistic
X	APTR	S2SSR_STRING		; statistic name
X	LABEL	S2SSR_SIZE
X
X
X STRUCTURE SANA2SPECIALSTATHEADER,0
X	ULONG	S2SSH_RECORDCOUNTMAX		; room available
X	ULONG	S2SSH_RECORDCOUNTSUPPLIED	; number supplied
X	LABEL	S2SSH_SIZE
X
X
X STRUCTURE SANA2DEVICESTATS,0
X	LONG	S2DS_RXPACKETS		; received count
X	LONG	S2DS_TXPACKETS		; transmitted count
X	LONG	S2DS_FRAMINGERRORS	; framming errors found
X	LONG	S2DS_BADDATA		; bad packets received
X	LONG	S2DS_HARDMISSES		; hardware miss count
X	LONG	S2DS_SOFTMISSES		; software miss count
X	LONG	S2DS_RXUNKNOWNTYPES	; orphan count
X	LONG	S2DS_FIFOOVERRUNS	; hardware overruns
X	LONG	S2DS_FIFOUNDERRUNS	; hardware underruns
X	LONG	S2DS_RECONFIGURATIONS	; network reconfigurations
X	STRUCT	S2DS_LASTSTART,TV_SIZE	; time of last online
X	LABEL	S2DS_SIZE
X
X
X;
X; Device Commands
X;
X
XSANA2_CMD_START			EQU	(CMD_NONSTD)
X
XSANA2CMD_DEVICEQUERY		EQU	(SANA2_CMD_START+0)
XSANA2CMD_GETSTATIONADDRESS	EQU	(SANA2_CMD_START+1)
XSANA2CMD_CONFIGINTERFACE	EQU	(SANA2_CMD_START+2)
XSANA2CMD_ADDSTATIONALIAS	EQU	(SANA2_CMD_START+3)
XSANA2CMD_DELSTATIONALIAS	EQU	(SANA2_CMD_START+4)
XSANA2CMD_ADDMULTICASTADDRESS	EQU	(SANA2_CMD_START+5)
XSANA2CMD_DELMULTICASTADDRESS	EQU	(SANA2_CMD_START+6)
XSANA2CMD_MULTICAST		EQU	(SANA2_CMD_START+7)
XSANA2CMD_BROADCAST		EQU	(SANA2_CMD_START+8)
XSANA2CMD_TRACKTYPE		EQU	(SANA2_CMD_START+9)
XSANA2CMD_UNTRACKTYPE		EQU	(SANA2_CMD_START+10)
XSANA2CMD_GETTYPESTATS		EQU	(SANA2_CMD_START+11)
XSANA2CMD_GETSPECIALSTATS	EQU	(SANA2_CMD_START+12)
XSANA2CMD_GETGLOBALSTATS		EQU	(SANA2_CMD_START+13)
XSANA2CMD_ONEVENT		EQU	(SANA2_CMD_START+14)
XSANA2CMD_READORPHAN		EQU	(SANA2_CMD_START+15)
XSANA2CMD_ONLINE			EQU	(SANA2_CMD_START+16)
XSANA2CMD_OFFLINE		EQU	(SANA2_CMD_START+17)
X
XSANA2_CMD_END			EQU	(SANA2_CMD_START+18)
X
X
X;
X; defined errors for S2IO_ERROR
X;
X
XS2ERR_NO_ERROR		EQU	0	; peachy-keen
XS2ERR_NO_RESOURCES	EQU	1	; resource allocation failure
XS2ERR_UNKNOWN_ENTITY	EQU	2	; unable to find something
XS2ERR_BAD_ARGUMENT	EQU	3	; garbage somewhere
XS2ERR_BAD_STATE		EQU	4	; inappropriate state
XS2ERR_BAD_ADDRESS	EQU	5	; who?
XS2ERR_MTU_EXCEEDED	EQU	6	; too much to chew
XS2ERR_BAD_PROTOCOL	EQU	7	; bad packet type structure
XS2ERR_NOT_SUPPORTED	EQU	8	; command not supported
XS2ERR_SOFTWARE		EQU	9	; software error detected
X
X
X;
X; defined errors for S2IO_WIREERROR
X;
X
XS2WERR_GENERIC_ERROR	EQU	0	; no specific info available
XS2WERR_NOT_CONFIGURED	EQU	1	; unit not configured
XS2WERR_UNIT_ONLINE	EQU	2	; unit is currently online
XS2WERR_UNIT_OFFLINE	EQU	3	; unit is currently offline
XS2WERR_ALREADY_TRACKED	EQU	4	; protocol already tracked
XS2WERR_NOT_TRACKED	EQU	5	; protocol not tracked
XS2WERR_NETBUFF_ERROR	EQU	6	; netbuff.lib returned error
XS2WERR_SRC_ADDRESS	EQU	7	; source address problem
XS2WERR_DST_ADDRESS	EQU	8	; destination address problem
XS2WERR_BAD_BROADCAST	EQU	9	; broadcast address problem
XS2WERR_BAD_MULTICAST	EQU	10	; multicast address problem
XS2WERR_ALIAS_LIST_FULL	EQU	11	; station alias list full
XS2WERR_BAD_ALIAS	EQU	12	; bad station alias
XS2WERR_MULTICAST_FULL	EQU	13	; multicast address list full
XS2WERR_BAD_EVENT	EQU	14	; unsupported event class
XS2WERR_BAD_STATDATA	EQU	15	; statdata failed sanity check
XS2WERR_PROTOCOL_UNKNOWN	EQU	16	; unknown protocol type
XS2WERR_IS_CONFIGURED	EQU	17	; attempt to config twice
XS2WERR_NULL_POINTER	EQU	18	; null pointer detected
X
X
X;
X; defined events
X;
X
XS2EVENT_ERROR		EQU	0	; error catch all
XS2EVENT_TX		EQU	1	; transmitter error catch all
XS2EVENT_RX		EQU	2	; receiver error catch all
XS2EVENT_ONLINE		EQU	3	; unit is in service
XS2EVENT_OFFLINE		EQU	4	; unit is not in service
XS2EVENT_NETBUF		EQU	5	; NetBuff error catch all
XS2EVENT_HARDWARE	EQU	6	; hardware error catch all
XS2EVENT_SOFTWARE	EQU	7	; software error catch all
X
X
X	ENDC	SANA2_SANA2DEVICE_I
END_OF_FILE
if test 7042 -ne `wc -c <'sana2device.i'`; then
    echo shar: \"'sana2device.i'\" unpacked with wrong size!
fi
# end of 'sana2device.i'
fi
if test -f 'sana2packetmagic.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2packetmagic.h'\"
else
echo shar: Extracting \"'sana2packetmagic.h'\" \(2061 characters\)
sed "s/^X//" >'sana2packetmagic.h' <<'END_OF_FILE'
X#ifndef SANA2_SANA2PACKETMAGIC_H
X#define SANA2_SANA2PACKETMAGIC_H 1
X/*
X**	$Filename: sana2packetmagic.h $
X**	$Release: Developer Information$
X**	$Revision: 1.2 $
X**	$Date: 91/05/08 $
X**
X**	Defined types of magic for the Sana2PacketType structure.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X*/
X
X/*
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X*/
X
X#ifndef SANA2_SANA2DEVICE_H
X#include <sana2/sana2device.h>
X#endif	/* !SANA2_SANA2DEVICE_H */
X
X
X/*
X * The SANA-II Sana2PacketType structure Magic value is an unsigned 32
X * number. The upper 16 bits identify the type of network wire to which
X * the Magic value applies and the lower 16 bits identify the particular
X * type of magic.
X */
X
X
X/*
X * defined types of ethernet magic
X */
X
X#define S2MAGIC_ETHERNET_E2	((((S2WireType_Ethernet)&0xffff)<<16)|0x0000)
X/*
X * For ethernet, this is the default case. Mask is ignored, Length is 2,
X * Match points to a UWORD to match against the type field of the packet.
X */
X
X#define S2MAGIC_ETHERNET_8023	((((S2WireType_Ethernet)&0xffff)<<16)|0x0001)
X/*
X * The caller is declaring his intent to receive any of the valid 802.3
X * ethernet packet types. The Match and Mask fields are ignored, Length
X * is 0.
X * 
X * SANA-II ethernet driver writers need to support a read queue for 802.3
X * packets separate from packets of any non-802.3 type.
X * 
X * A possible flow through an ethernet driver's read interrupt routine
X * might look like the following:
X * 
X * 	...
X * 
X * 	sniff packet type...
X * 
X * 	if (NoSpecificReadWaiting())
X * 		{
X * 		if (IsAn802() && 802ReadWaiting())
X * 			{
X * 			Return802();
X * 			}
X * 		else
X * 			{
X * 			if (OrphanReadWaiting())
X * 				{
X * 				ReturnOrphan();
X * 				}
X * 			else
X * 				{
X * 				DropPacket();
X * 				}
X * 			}
X * 		}
X * 	else
X * 		{
X * 		ReturnSpecificPacket();
X * 		}
X * 
X * 	...
X * 
X */
X
X
X#endif	/* SANA2_SANA2PACKETMAGIC_H */
END_OF_FILE
if test 2061 -ne `wc -c <'sana2packetmagic.h'`; then
    echo shar: \"'sana2packetmagic.h'\" unpacked with wrong size!
fi
# end of 'sana2packetmagic.h'
fi
if test -f 'sana2packetmagic.i' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2packetmagic.i'\"
else
echo shar: Extracting \"'sana2packetmagic.i'\" \(1961 characters\)
sed "s/^X//" >'sana2packetmagic.i' <<'END_OF_FILE'
X	IFND	SANA2_SANA2PACKETMAGIC_I
XSANA2_SANA2PACKETMAGIC_I	SET	1
X**
X**	$Filename: sana2packetmagic.i $
X**	$Release: Developer Information$
X**	$Revision: 1.2 $
X**	$Date: 91/05/08 $
X**
X**	Defined types of magic for the Sana2PacketType structure.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X**
X
X**
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X**
X
X	IFND	SANA2_SANA2DEVICE_I
X	INCLUDE	"sana2/sana2device.i"
X	ENDC	!SANA2_SANA2DEVICE_I
X
X
X;
X; The SANA-II Sana2PacketType structure Magic value is an unsigned 32
X; number. The upper 16 bits identify the type of network wire to which
X; the Magic value applies and the lower 16 bits identify the particular
X; type of magic.
X;
X
X
X;
X; defined types of ethernet magic
X;
X
XS2MAGIC_ETHERNET_E2	EQU	((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0000)
X;
X; For ethernet, this is the default case. Mask is ignored, Length is 2,
X; Match points to a UWORD to match against the type field of the packet.
X;
X
XS2MAGIC_ETHERNET_8023	EQU	((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0001)
X;
X; The caller is declaring his intent to receive any of the valid 802.3
X; ethernet packet types. The Match and Mask fields are ignored, Length
X; is 0.
X;
X; SANA-II ethernet driver writers need to support a read queue for 802.3
X; packets separate from packets of any non-802.3 type.
X;
X; A possible flow through an ethernet driver's read interrupt routine
X; might look like the following:
X;
X; 	...
X;
X; 	sniff packet type...
X;
X; 	if (NoSpecificReadWaiting())
X; 		{
X; 		if (IsAn802() && 802ReadWaiting())
X; 			{
X; 			Return802();
X; 			}
X; 		else
X; 			{
X; 			if (OrphanReadWaiting())
X; 				{
X; 				ReturnOrphan();
X; 				}
X; 			else
X; 				{
X; 				DropPacket();
X; 				}
X; 			}
X; 		}
X; 	else
X; 		{
X; 		ReturnSpecificPacket();
X; 		}
X;
X;	...
X;
X;
X
X
X	ENDC	SANA2_SANA2PACKETMAGIC_I
END_OF_FILE
if test 1961 -ne `wc -c <'sana2packetmagic.i'`; then
    echo shar: \"'sana2packetmagic.i'\" unpacked with wrong size!
fi
# end of 'sana2packetmagic.i'
fi
if test -f 'sana2specialstats.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2specialstats.h'\"
else
echo shar: Extracting \"'sana2specialstats.h'\" \(1412 characters\)
sed "s/^X//" >'sana2specialstats.h' <<'END_OF_FILE'
X#ifndef SANA2_SANA2SPECIALSTATS_H
X#define SANA2_SANA2SPECIALSTATS_H 1
X/*
X**	$Filename: sana2specialstats.h $
X**	$Release: Developer Information$
X**	$Revision: 1.2 $
X**	$Date: 91/05/08 $
X**
X**	Defined ids for SANA-II special statistics.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X*/
X
X/*
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X*/
X
X#ifndef SANA2_SANA2DEVICE_H
X#include <sana2/sana2device.h>
X#endif	/* !SANA2_SANA2DEVICE_H */
X
X
X/*
X * The SANA-II special statistic identifier is an unsigned 32 number.
X * The upper 16 bits identify the type of network wire type to which
X * the statistic applies and the lower 16 bits identify the particular
X * statistic.
X */
X
X
X
X/*
X * defined ethernet special statistics
X */
X
X#define S2SS_ETHERNET_BADMULTICAST	((((S2WireType_Ethernet)&0xffff)<<16)|0x0000)
X/*
X * This count will record the number of times a received packet tripped
X * the hardware's multicast filtering mechanism but was not actually in
X * the current multicast table.
X */
X
X#define S2SS_ETHERNET_RETRIES		((((S2WireType_Ethernet)&0xffff)<<16)|0x0001)
X/*
X * This count records the total number of retries which have resulted
X * from transmissions on this board. 
X */
X
X
X#endif	/* SANA2_SANA2SPECIALSTATS_H */
END_OF_FILE
if test 1412 -ne `wc -c <'sana2specialstats.h'`; then
    echo shar: \"'sana2specialstats.h'\" unpacked with wrong size!
fi
# end of 'sana2specialstats.h'
fi
if test -f 'sana2specialstats.i' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'sana2specialstats.i'\"
else
echo shar: Extracting \"'sana2specialstats.i'\" \(1355 characters\)
sed "s/^X//" >'sana2specialstats.i' <<'END_OF_FILE'
X	IFND	SANA2_SANA2SPECIALSTATS_I
XSANA2_SANA2SPECIALSTATS_I	SET	1
X**
X**	$Filename: sana2specialstats.i $
X**	$Release: Developer Information$
X**	$Revision: 1.2 $
X**	$Date: 91/05/08 $
X**
X**	Defined ids for SANA-II special statistics.
X**
X**	(C) Copyright 1991 Commodore-Amiga Inc.
X**		All Rights Reserved
X**
X
X**
X** Contributions from:
X**	Raymond S. Brand,   rsbx@cbmvax.commodore.com,  (215) 431-9100
X**	Martin Hunt,      martin@cbmvax.commodore.com,  (215) 431-9100
X**	Perry Kivolowitz,           ASDG Incorporated,  (608) 273-6585
X**
X
X	IFND	SANA2_SANA2DEVICE_I
X	INCLUDE	"sana2/sana2device.i"
X	ENDC	!SANA2_SANA2DEVICE_I
X
X;
X; The SANA-II special statistic identifier is an unsigned 32 number.
X; The upper 16 bits identify the type of network wire type to which
X; the statistic applies and the lower 16 bits identify the particular
X; statistic.
X;
X
X
X
X;
X; defined ethernet special statistics
X;
X
XS2SS_ETHERNET_BADMULTICAST	EQU	((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0000)
X;
X; This count will record the number of times a received packet tripped
X; the hardware's multicast filtering mechanism but was not actually in
X; the current multicast table.
X;
X
XS2SS_ETHERNET_RETRIES		EQU	((((S2WIRETYPE_ETHERNET)&$ffff)<<16)|$0001)
X;
X; This count records the total number of retries which have resulted
X; from transmissions on this board. 
X;
X
X
X	ENDC	SANA2_SANA2SPECIALSTATS_I
END_OF_FILE
if test 1355 -ne `wc -c <'sana2specialstats.i'`; then
    echo shar: \"'sana2specialstats.i'\" unpacked with wrong size!
fi
# end of 'sana2specialstats.i'
fi
echo shar: End of archive 1 \(of 3\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 3 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
Mail comments to the moderator at <amiga-request@uunet.uu.net>.
Post requests for sources, and general discussion to comp.sys.amiga.misc.
