Important: The information in this document is obsolete and should not be used for new development.
Using the FDDI Driver
You can write an application implementing a protocol other than AppleTalk that processes 802.2 packets and that sends and receives data over a Fiber Distributed Data Interface (FDDI) network. To do this, you read data from and write it to the FDDI driver defined by Apple. Your application can run on a node that is also running AppleTalk.To write data to the FDDI driver and to perform other functions such as adding a multicast address for the FDDI hardware, you use the Ethernet functions described earlier in this chapter. To receive 802.2 packets from the FDDI driver, you attach your protocol handler to the LAP Manager using the interface to the LAP Manager.
The Apple FDDI driver implementation support allows for the attachment of only one protocol handler. The Apple FDDI driver specification requires that an FDDI driver handle 802.2 packets to service access points (SAP) other than SAP $AA.
Although it is possible to attach your own protocol handler at the hardware device driver level, Apple Computer, Inc. recommends that you not do this because it excludes AppleTalk from using the FDDI driver. So that more than one protocol can receive packets from the FDDI driver concurrently, Apple recommends that you attach your protocol handler to the LAP Manager. The LAP Manager attaches its own protocol handler to the FDDI driver, and when it receives a packet for your protocol, the LAP Manager calls your protocol handler. When it receives a packet for another protocol, such as AppleTalk, the LAP Manager calls that application's protocol handler.
For a description of how to attach and detach your protocol handler for FDDI, see the chapter "Link-Access Protocol (LAP) Manager" included in this book and the discussion of token ring and FDDI in "About Ethernet, Token Ring, and FDDI Support" beginning on page 11-3 in this chapter. The chapter "Link-Access Protocol (LAP) Manager" also explains the concept and use of the SAP field value for 802.2 Type 1 packets.
Applying Ethernet Functions
The Apple FDDI driver implements many but not all of the functions that the Apple Ethernet driver implements.For those Ethernet functions that do apply to FDDI, you use the function for FDDI in the same way that you do for Ethernet: you pass parameters in a parameter block and you use the Ethernet control code in the
csCode
field to call the function. The only difference is that instead of specifying the Ethernet driver reference number in the parameter block'sioRefNum
field, you specify the FDDI driver reference number. Here are the Ethernet functions that apply to FDDI:
Here are the Ethernet functions that do not apply to FDDI:
- You use the
EAddMulti
function to add a multicast address for FDDI and theEDelMulti
function to remove one. Be careful not to use the broadcast address as
a multicast address. The broadcast and multicast addresses are the same for FDDI
and Ethernet. For information about these addresses and their formats, see the discussion of them for Ethernet in Inside AppleTalk, second edition.- You use the
EWrite
function to send data to the FDDI driver for transmission over the network.
There are some other differences between Ethernet and FDDI:
- The
ERead
andERdCancel
functions are not valid for FDDI because Apple does not specify a default protocol handler for the FDDI driver. These two functions are used exclusively by applications that use the default Ethernet protocol handler. If an application calls these functions for FDDI, the driver will return an error.- The
ESetGeneral
function switches to a mode that allows the .ENET driver to transmit a larger Ethernet data packet than the standard size. Because FDDI is not normally restricted to the limited packet size, this function does not apply. However, the FDDI driver will return a result ofnoErr
if you call this function.
- The FDDI packet size is determined by the FDDI hardware developer. However, for Logical Link Control (LLC) type packets, the packet length cannot exceed 1500 bytes.
- The FDDI driver searches for a resource of type
'fadr'
instead of'eadr'
in the System file for an alternative hardware address. (For general information about alternative hardware addresses, see "Changing the Ethernet Hardware Address" on page 11-19.)
- Note
- Although you can use the
EAttachPH
function to attach a protocol handler to the FDDI driver and theEDetachPH
function to remove
one, Apple recommends that you not use these functions. Instead,
you should use the LAP Manager'sL802Attach
andL802Detach
routines.Sending and Receiving Data
The tasks involved in sending data to and receiving it from an FDDI driver are similar to those that you use for Ethernet. The primary difference is that you use the LAP Manager to attach your protocol handler. Any vendor implementing an FDDI driver to run on a Macintosh computer must follow rules that direct them to return packet information in the same manner as does the Ethernet driver for 802.2 packets. From the perspective of an application that uses the FDDI driver, this means that when the LAP Manager calls your protocol handler, you can expect the FDDI hardware addresses that you reference from register A3 to follow the same format that is used for Ethernet addresses, regardless of how the FDDI address might appear in the packet. The chapter "Link-Access Protocol (LAP) Manager" in this book explains this in detail.Here are the steps that you follow to send data to and receive it from an FDDI driver:
- Locate the FDDI cards that are installed in the system. Use the Slot Manager to identify installed FDDI cards. Use the
SGetTypeSRsrc
function described in the Slot Manager chapter of Inside Macintosh: Devices to determine which NuBus slots contain FDDI cards. To find FDDI cards, use the valuecatNetwork
(0x4)
in thespCategory
field and the valuetypeFDDI
(0x11)
in thespCType
field. You should provide a user interface that allows the user to select a specific FDDI card in the case that more than one is present.- Use the
OpenSlot
function to open the FDDI driver. Set theioNamePtr
field to .FDDI. If you did not locate any NuBus FDDI cards in step 1, you should also attempt to open the .FDDI0 driver in case non-NuBus FDDI hardware is attached to the system. Use the Device Manager'sOpenDriver
function to open the .FDDI0 driver. (For information on theOpenSlot
andOpenDriver
functions, see the chapter "Device Manager" in Inside Macintosh: Devices.)Note that this section refers to the .FDDI driver shell, which facilitates multivendor support, as the .FDDI driver. Opening the .FDDI driver shell, which loads and opens the card's driver, is effectively the same as directly opening the FDDI driver.
- If your application requires a multicast address, use the
EAddMulti
function to register a multicast address. (For information on multicast addresses, see Inside AppleTalk, second edition. For a description of multicast addresses, see "About Multicast Addressing" on page 11-7.)- Use the LAP Manager's
L802Attach
routine to install your protocol handler. (See the chapter "Link-Access Protocol [LAP] Manager" in this book for more information.)- Use the
EWrite
function to send packets to the FDDI driver for transmission across the network. To use theEWrite
function, you provide a pointer to a write-data structure. The first buffer in the write-data structure must be at least 14 bytes long: the first 6 bytes of that buffer must contain the destination address. Bytes 13 and 14 must contain the packet length, which must not exceed 1500 bytes. The FDDI driver fills in bytes 7-12 with the source address. (For more information on the write-data structure, see "Using a Write-Data Structure to Transmit Ethernet Data" on page 11-10.)- When you are finished using the FDDI driver, use the LAP Manager's
L802Detach
routine to remove your protocol handler.- When you are finished using a multicast address, use the
EDelMulti
function to remove it.