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 9 - AppleTalk Filing Protocol (AFP) / AFP Reference
Data Structures


XPP Parameter Block

The AFPCommand function, which has four formats, requires a pointer to an XPP param-
eter block of type XPPParamBlock. Because the .XPP driver maps the AFP commands that you specify to ASP commands, the various AFPCommand function formats use some of the XPP parameter block fields defined within variant records for ASP functions.

The first four fields of the XPP parameter block, qLink, qType, ioTrap, and ioCmdAddr, which are the same for all four formats of the AFPCommand, are used internally by the Device Manager.

You must specify the .XPP driver reference number as the input value of the ioRefNum field; AFP does not fill in this value. You can use the Device Manager's OpenDriver function to obtain the .XPP driver reference number.

The XPP parameter block that follows is defined as the maximum size required for any format of the AFPCommand function. Various formats use different size parameter blocks. You can abbreviate the parameter block appropriately for any AFPCommand format.

This section defines the parameter block fields that are common to all AFP 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 format are defined in the section that describes that format.

XPPPrmBlkType = (XPPPrmBlk...);
XPPSubPrmType = (ASPOpenPrm,ASPSubPrm);
XPPEndPrmType = (AFPLoginPrm,ASPEndPrm);
XPPParmBlkPtr = ^XPPParamBlock;
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
   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
   AFPLoginPrm:
      (afpAddrBlock: AddrBlock;           {address block in AFP login}
      afPSCBPtr:     Ptr;                 {SCB pointer in AFP login}
      afpAttnRoutine:Ptr);                {attn routine pointer in AFP login}
   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, the .XPP 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 .XPP 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. 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 .XPP driver command code for the function. For the AFPCommand function, the value of this field is always afpCall. The MPW interface fills in this field.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996