EAttachPH
EAttachPH Attach protocol handler to The .ENET Driver
#include <ENET.h> AppleTalk Manager
OSErr EAttachPH( thePBptr, async);
EParamBlkPtr thePBptr; address of an EParamBlock structure
Boolean async; 0=await completion; 1=immediate return
returns Error Code; 0=no error
EAttachPH serves two purposes: use it to attach to The .ENET Driver
your own protocol handler for a specific protocol type, or you can use it to
specify that The .ENET Driver should use the default protocol handler for a
particular protocol type. .
thePBptr is a pointer to an EParamBlock structure. The relevant fields are as
follows:
Out-InName Type Size Offset Description
¨ ioResult short 2 16 Result code
Æ csCode short 2 26 Always ENetAttachPH
Æ eProtType short 2 28 Ethernet protocol type
Æ ePointer long 4 30 Pointer to protocol handler
async is a Boolean value. Use FALSE for normal ( synchronous) operation
or TRUE to function asynchronously. See Async I/O.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
LAPProtErr (-94) Protocol handler is already attached or node's
protocol table is full.

Notes: If you attach your own protocol handler, The .ENET Driver calls that
protocol handler each time it receives a packet with the protocol type you
specified. If you specify that The .ENET Driver should use the default
protocol handler, then you can use the ERead command to read packets with
that protocol type.
The ioResult parameter returns the result of the function. If you call the
function asynchronously, the function sets this field to 1 as soon as it
begins execution, and it changes the field to the actual result code when it
completes execution. The csCode parameter is a routine selector; it is
always equal to ENetAttachPH for this function.
You specify the protocol type in the eProtType parameter and provide a
pointer to the protocol handler in the ePointer parameter. If you specify NIL
for the ePointer parameter, then The .ENET Driver uses the default
protocol handler for that protocol type. Specify 0 for the eProtType
parameter to attach a protocol handler for the IEEE 802.3 protocol, which
uses protocol types 0 through 0x05DC
The LAP Manager calls the EAttachPH function with a protocol type of
0 and thus receives all 802.3 protocol packets. Instead of using the
EAttachPH function to install a protocol handler for an 802.3 Ethernet
protocol type, you should use the L802Attach routine. In the case of an
802.3 protocol packet, The .ENET Driver passes the packet to the
LAP Manager 802.2 Protocol handler. If the packet has the protocol
type you specified with the L802Attach routine, the 802.2 protocol handler
passes the packet on to your protocol handler.
For more information about IEEE 802.2 and 802.3 protocols, see
LAP Manager 802.2 Protocol .