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 8 - AppleTalk Session Protocol (ASP) / ASP Reference
Data Structures


XPP Parameter Block for ASP

The ASP functions use the XPP parameter block defined by the XPPParamBlock data type to pass input and receive output parameters. In addition to the standard XPP parameter block fields, the ASP functions use variant records. The ASPOpenSession function uses the ASPOpenPrm variant record. The ASPAbortOS function uses the ASPAbortPrm variant record. The ASPGetParms function uses the ASPSizeBlk variant record. The ASPUserCommand and ASPUserWrite functions uses the ASPSubPrm variant record. The ASPUserWrite, ASPUserCommand, and ASPGetStatus functions use the ASPEndPrm variant record.

This section defines the parameter block fields that are common to all ASP functions. It does not define reserved fields, which are used either internally by the .XPP driver or not at all. The fields that are used by a particular function are defined in the section that describes the function.

XPPPrmBlkType = (...XPPPrmBlk,ASPAbortPrm,ASPSizeBlk...);
XPPSubPrmType = (ASPOpenPrm,ASPSubPrm);
XPPEndPrmType = (...ASPEndPrm);
XPPParamBlock = PACKED RECORD
   qLink:            QElemPtr;            {reserved}
   qType:            Integer;             {reserved}
   ioTrap:           Integer;             {reserved}
   ioCmdAddr:        Ptr;                 {reserved}
   ioCompletion:     ProcPtr;             {completion routine}
   ioResult:         OSErr;               {result code}
   cmdResult:        LongInt;             {command result (ATP user bytes)}
   ioVRefNum:        Integer;             {reserved}
   ioRefNum:         Integer;             {driver reference number}
   csCode:           Integer;             {call command code}
   CASE XPPPrmBlkType OF
   ASPAbortPrm:
      (abortSCBPtr: Ptr);                 {SCB pointer for AbortOS}
   ASPSizeBlk:
      (aspMaxCmdSize: Integer;            {for ASPGetParms}
       aspQuantumSize: Integer;           {for ASPGetParms}
       numSesss: Integer);                {for SPGetParms}
   XPPPrmBlk:
      (sessRefnum: Integer;               {offset to session refnum}
       aspTimeout: Byte;                  {timeout for ATP}
      aspRetry: Byte;                     {retry count for ATP}
   CASE XPPSubPrmType OF
   ASPOpenPrm:
      (serverAddr: AddrBlock;             {server address block}
      scbPointer: Ptr;                    {SCB pointer}
      attnRoutine: Ptr);                  {attention routine pointer}
   ASPSubPrm:
      (cbSize: Integer;                   {command block size}
      cbPtr: Ptr;                         {command block pointer}
      rbSize: Integer;                    {reply buffer size}
      rbPtr: Ptr;                         {reply buffer pointer}
   CASE XPPEndPrmType OF
   ASPEndPrm:
      (wdSize: Integer;                   {write data size}
      wdPtr: Ptr;                         {write data pointer}
      ccbStart: ARRAY[0..295] OF Byte))); {beginning of command control }
                                          { block}
 END;
 XPPParmBlkPtr = ^XPPParamBlock;
Field Description
ioCompletion
A pointer to a completion routine that you can provide. When you execute a function asynchronously, AppleTalk 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, AppleTalk ignores the ioCompletion field. For information about completion routines, see the chapter "Introduction to AppleTalk" in this book.
ioResult
The result of the function. When you execute the function asynchro-
nously, the function sets this field to 1 and returns a function result of noErr as soon as the function begins execution. When the function completes execution, it sets the ioResult field to the actual result code.
ioRefNum
The driver reference number for the .XPP driver. The Device Manager's OpenDriver function that you use to open the .XPP driver returns the driver reference number in the refnum field. You must supply this value. You can call this function to obtain the .XPP driver's reference number even if the .XPP driver is already open. The MPW interface does not fill in this value. For information on opening the .XPP driver, see the chapter "AppleTalk Utilities" in this book. For information on the OpenDriver function, see the chapter "Device Manager" in Inside Macintosh: Devices.
csCode
The command code of the XPP command to be executed. The MPW interface fills in this field.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996