PAttachPH
PAttachPH Add a protocol handler to the protocol table MPPPBPtr thePBptr; pointer to an LAPparms structure Boolean async; 0=await completion; 1=immediate return PAttachPH adds the protocol handler pointed to by the handler field of the LAPparms structure to the node's protocol table. thePBptr iis a pointer to an LAPparms structure. Æ csCode short 2 26 always attachPH
Æ handler Ptr 4 30 protocol handler async is a Boolean value. Use FALSE for normal ( synchronous) operation or TRUE to enqueue the request and resume control immediately. See Async I/O.
noErr (0) No error
lapProtErr (-94) Error attaching protocol type
Notes: handler is the protocol handler to add to the protocol table. protType specifies what kind of frame the protocol handler can service. After
PAttachPH is called, the protocol handler is called for each incoming frame whose ALAP protocol type equals protType. Most programs will never need to call ALAP, because higher- level
protocols will automatically call ALAP as necessary. If you do want to send a
frame directly via ALAP, call the PWriteLAP function. There is no PReadLAP function. If you want to read ALAP frames, you must call
PAttachPH to add your protocol handler to the node's protocol handler table. The ALAP module will examine every incoming frame and call your
protocol handler for each frame received with the correct ALAP protocol.
When your program no longer wants to receive frames with a particular
ALAP protocol type value, it can call PDetachPH to remove the corresponding protocol handler from the protocol handler table.