Important: The information in this document is obsolete and should not be used for new development.
EDetachPH
TheEDetachPHfunction 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. SpecifyTRUEfor asynchronous execution.
--> ioCompletion ProcPtr A pointer to completion routine. <-- ioResult OSErr The result code. --> ioRefNum Integer The driver reference number. --> csCode Integer Always ENetDetachPHfor this function.--> eProtType Integer The Ethernet protocol typ.
Field Description
eProtType- The protocol type whose protocol handler you want to remove.
DESCRIPTION
You use theEDetachPHfunction to remove from the .ENET driver a protocol handler that you attached using theEAttachPHfunction. When you call theEDetachPHfunction to remove the protocol handler,EDetachPHremoves 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 theeProtTypeparameter.If you specified your protocol type and attached the default protocol handler,
EDetachPHremoves the entry from the node's protocol table. When you call
theEDetachPHfunction, any pending calls to theEReadfunction terminate with
thereqAbortedresult 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'sL802Detachroutine. For information about theL802Detachroutine, 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
ioRefNumfield to the driver reference number that theOpenSlotorOpenDriverfunction returns. For token ring, you can only detach a protocol handler for protocol type 0.ASSEMBLY-LANGUAGE INFORMATION
To execute theEDetachPHfunction from assembly language, call the_Controltrap macro with a value ofENetDetachPHin thecsCodefield of the parameter block.
To execute the_Controltrap asynchronously, include the value,ASYNCin the
operand field.RESULT CODES
noErr 0 No error LAPProtErr -94 No protocol handler is attached