Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 11 - Ethernet, Token Ring, and Fiber Distributed Data Interface / Ethernet, Token Ring, and FDDI Reference
Routines / Attaching and Detaching an Ethernet Protocol Handler


EDetachPH

The EDetachPH function detaches a protocol handler from the .ENET driver.

FUNCTION EDetachPH (thePBptr: EParamBlkPtr; 
                     async: Boolean): OSErr;
thePBptr
A pointer to a parameter block of type EParamBlock.
async
A Boolean value that specifies whether the function should be
executed asynchronously or synchronously. Specify TRUE for asynchronous execution.
-->ioCompletionProcPtrA pointer to completion routine.
<--ioResultOSErrThe result code.
-->ioRefNumIntegerThe driver reference number.
-->csCodeIntegerAlways ENetDetachPH for this function.
-->eProtTypeIntegerThe Ethernet protocol typ.

Field Description
eProtType
The protocol type whose protocol handler you want to remove.
DESCRIPTION
You use the EDetachPH function to remove from the .ENET driver a protocol handler that you attached using the EAttachPH function. When you call the EDetachPH function to remove the protocol handler, EDetachPH removes the protocol type from the node's protocol table. Once the protocol type is removed from the node's table, the .ENET driver no longer delivers packets with that protocol type. You specify the protocol type in the eProtType parameter.

If you specified your protocol type and attached the default protocol handler, EDetachPH removes the entry from the node's protocol table. When you call
the EDetachPH function, any pending calls to the ERead function terminate with
the reqAborted result code.

TOKEN RING AND FDDI CONSIDERATIONS
This function is available for token ring and FDDI also. However, Apple Computer, Inc. recommends that you use the LAP Manager interface to attach and detach a protocol handler for token ring and FDDI. To detach a protocol handler, you use the LAP Manager's L802Detach routine. For information about the L802Detach routine, see the chapter "Link-Access Protocol (LAP) Manager" in this book.

Note that if you use this function for token ring or FDDI, you must set the ioRefNum field to the driver reference number that the OpenSlot or OpenDriver function returns. For token ring, you can only detach a protocol handler for protocol type 0.

ASSEMBLY-LANGUAGE INFORMATION
To execute the EDetachPH function from assembly language, call the _Control trap macro with a value of ENetDetachPH in the csCode field of the parameter block.
To execute the _Control trap asynchronously, include the value ,ASYNC in the
operand field.

RESULT CODES
noErr0No error
LAPProtErr-94No protocol handler is attached

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996