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 6 - AppleTalk Transaction Protocol (ATP) / ATP Reference
Data Structures


The ATP Parameter Block

The ATP functions require a pointer to an ATP parameter block that is used to pass the input and output parameters associated with the function. The ATPParamBlock data type defines the ATP parameter block. The ATP parameter block includes variant records for the fields that are particular to an ATP routine.

This section defines the fields that are common to all ATP functions that use the ATP parameter block. (The BuildBDS function does not use the ATP parameter block.) These common fields are either filled in by the MPW interface or returned by the function; your application does not need to provide values for these fields. This section does not define reserved fields, which are used internally by the .ATP driver or not at all. The fields that are used for specific functions only are defined in the descriptions of the functions to which they apply.

TYPE ATPParamBlock = 
PACKED RECORD
   qLink:         QElemPtr;         {reserved}
   qType:         Integer;          {reserved}
   ioTrap:        Integer;          {reserved}
   ioCmdAddr:     Ptr;              {reserved}
   ioCompletion:  ProcPtr;          {completion routine}
   ioResult:      OSErr;            {result code}
   userData:      Longint;          {ATP user bytes}
   reqTID:        Integer;          {request transaction ID}
   ioRefNum:      Integer;          {driver reference number}
   csCode:        Integer;          {call command code}
   atpSocket:     Byte;             {currBitMap or socket number}
   CASE MPPParmType OF 
      SendRequestParm,
      SendResponseParm,
      GetRequestParm,
      AddResponseParm,
      KillSendReqParm:
         (atpFlags:        Byte;    {control information}
         addrBlock:        AddrBlock;  
                                    {source/dest. socket address}
         reqLength:        Integer; {request/response length}
         reqPointer:       Ptr;     {ptr to request/response data}
         bdsPointer:       Ptr;     {ptr to response BDS}
      CASE MPPParmType OF
         SendRequestParm:
            (numOfBuffs:   Byte;    {number of responses expected}
            timeOutVal:    Byte;    {timeout interval}
            numOfResps:    Byte;    {number of responses }
                                    { actually received}
            retryCount:    Byte;    {number of retries}
            intBuff:       Integer; {used internally for }
                                    { PNSendRequest}
            TRelTime:      Byte);   {TRelease time for extended }
                                    { send request}
         SendResponseParm:
            (filler0:      Byte;    {bitmap}
            bdsSize:       Byte;    {number of BDS elements}
            transID:       Integer);{transaction ID}
         GetRequestParm:
            (bitmap:       Byte;    {bitmap}
            filler1:       Byte);   {reserved}
         AddResponseParm:
            (rspNum:       Byte;    {sequence number}
            filler2:       Byte);   {reserved}
         KillSendReqParm
            (aKillQEl:     Ptr));   {ptr to (queue element) function to }
                                    { cancel}
END;

ATPPBPtr =  ^ATPParamBlock; 
Field Description
ioCompletion
A pointer to a completion routine that you can provide. When you execute a function asynchronously, the .ATP driver calls your completion routine when it completes execution of the function if you specify a pointer to the routine as the value of this field. Specify NIL for this field if you do not wish to provide a completion routine. If you execute a function synchronously, the .ATP driver ignores the ioCompletion field. For information about completion routines, see the chapter "Introduction to AppleTalk" in this book.
ioResult
The result of the function. If you call the function asynchronously, the .ATP driver sets this field to 1 as soon as you call the function, and it changes the field to the actual result code when the function completes execution.
ioRefNum
The .ATP driver reference number. The MPW interface fills in
this field.
csCode
The command code for the ATP function to be executed. The MPW interface fills in this value for you.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996