Important: The information in this document is obsolete and should not be used for new development.
L802Attach
TheL802Attach
routine attaches to the LAP Manager a protocol handler for a specific IEEE 802.2 protocol type.DESCRIPTION
You call theL802Attach
routine from assembly language by placing the routine selector of 21 in the D0 register and the reference number of the Ethernet, token ring, or FDDI driver in the D2 register that theOpenSlot
orOpenDriver
function returns. Then, you execute a JSR instruction to an offset 2 bytes past the start of the LAP Manager. The start of the LAP Manager is contained in the global variableLAPMgrPtr
($B18).Here are the register contents that you supply on entry and the value that is returned
to you.
Registers on entry D0 21 D2 Reference number of hardware device driver A0 Pointer to your protocol handler A1 Pointer to protocol-type specification
Registers on exit D0 Nonzero if error You must put a pointer to your protocol handler in the A0 register and a pointer to the protocol-type specification for this protocol handler in the A1 register. The protocol-type specification consists of one or more protocol-type fields, each preceded by a length byte. The LAP Manager reads the fields in the 802.2 data packet header to determine to which protocol handler (if any) to deliver the packet. The first type field in your protocol specification is the 1-byte DSAP. If the DSAP type field is equal to
$AA
, then the packet is a SNAP packet. In this case, the protocol-type specification must contain a second type field, the 5-byte SNAP type. If the SNAP type field is$00000080F3
, indicating the AppleTalk Address Resolution Protocol (AARP), then the protocol-type specification must contain a third type field, the 4-byte AARP protocol type. Terminate the list of protocol-type fields with a byte of zeros.The following protocol-type specification, for example, is for the permanent LAP Manager protocol handler for an 802.3 packet containing AppleTalk data. The .ENET driver would deliver this packet to the LAP Manager. The first byte,
$01
, is the length byte for the first protocol-type field (the DSAP type field),$AA
, contained in the second byte. The DSAP value of$AA
is reserved for use with protocol-type specifications that include a SNAP field. The third byte,$05
, is the length byte for the next protocol-type field, the SNAP type field,$0800078098
. The SNAP value of$08 00 07 80 9B
is reserved for AppleTalk data. The final byte ($00
) terminates the type specification.
01 AA 05 08 00 07 80 9B 00The following protocol-type specification is for the permanent LAP Manager protocol handler for an 802.3 packet to be delivered to the EtherTalk AARP handler. Notice that the SNAP field is followed by an additional type field, the AARP protocol type.
01 AA 05 00 00 00 80 F3 04 00 01 80 9B 00The SNAP value of$00 00 00 80 F3
is reserved for AARP data. The AARP protocol type value of$00 01 80 9B
is reserved for Ethernet AARP packets.SPECIAL CONSIDERATIONS
For token ring, the Apple Computer, Inc. specification for the device driver that
the hardware vendor must implement requires that the driver process only SNAP packets, that is, packets with a SAP value of $AA. For Ethernet and FDDI, your
protocol can receive packets with a SAP value of $AA or any other SAP value.You can only use the
L802Attach
routine if the hardware device driver interface conforms to the Apple specification for that driver type.RESULT CODES
TheL802Attach
routine returns a nonzero value in the D0 register if there is an error.SEE ALSO
See the "The LAP Manager and 802.2 Protocol Packets" on page 10-21 and the ANSI/IEEE standard 802.2 for more information about 802.2 protocols, and see Inside AppleTalk, second edition, for more information about AARP.See Inside Macintosh: Devices for information on the
OpenSlot
function.