OCEAuthDir.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:242k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       OCEAuthDir.h
  3.  
  4.      Contains:   Apple Open Collaboration Environment Authentication Interfaces.
  5.  
  6.      Version:    Technology: AOCE Toolbox 1.02
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __OCEAUTHDIR__
  18. #define __OCEAUTHDIR__
  19. #ifndef __APPLETALK__
  20. #include "AppleTalk.h"
  21. #endif
  22. #ifndef __FILES__
  23. #include "Files.h"
  24. #endif
  25. #ifndef __OSUTILS__
  26. #include "OSUtils.h"
  27. #endif
  28. #ifndef __MACTYPES__
  29. #include "MacTypes.h"
  30. #endif
  31. #ifndef __OCE__
  32. #include "OCE.h"
  33. #endif
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. #if PRAGMA_IMPORT
  41. #pragma import on
  42. #endif
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50. /*****************************************************************************/
  51. enum {
  52.     kRC4KeySizeInBytes          = 8,                            /* size of an RC4 key */
  53.     kRefNumUnknown              = 0
  54. };
  55. enum {
  56.     kEnumDistinguishedNameBit   = 0,
  57.     kEnumAliasBit               = 1,
  58.     kEnumPseudonymBit           = 2,
  59.     kEnumDNodeBit               = 3,
  60.     kEnumInvisibleBit           = 4
  61. };
  62. /* Values of DirEnumChoices */
  63. enum {
  64.     kEnumDistinguishedNameMask  = 1L << kEnumDistinguishedNameBit,
  65.     kEnumAliasMask              = 1L << kEnumAliasBit,
  66.     kEnumPseudonymMask          = 1L << kEnumPseudonymBit,
  67.     kEnumDNodeMask              = 1L << kEnumDNodeBit,
  68.     kEnumInvisibleMask          = 1L << kEnumInvisibleBit,
  69.     kEnumAllMask                = (kEnumDistinguishedNameMask | kEnumAliasMask | kEnumPseudonymMask | kEnumDNodeMask | kEnumInvisibleMask)
  70. };
  71. typedef unsigned long                   DirEnumChoices;
  72. /* Values of DirSortOption */
  73. enum {
  74.     kSortByName                 = 0,
  75.     kSortByType                 = 1
  76. };
  77. /* Values of DirSortDirection */
  78. enum {
  79.     kSortForwards               = 0,
  80.     kSortBackwards              = 1
  81. };
  82. /* Values of DirMatchWith */
  83. enum {
  84.     kMatchAll                   = 0,
  85.     kExactMatch                 = 1,
  86.     kBeginsWith                 = 2,
  87.     kEndingWith                 = 3,
  88.     kContaining                 = 4
  89. };
  90. typedef UInt8                           DirMatchWith;
  91. enum {
  92.     kCurrentOCESortVersion      = 1
  93. };
  94. /*  Access controls are implemented on three levels:
  95.  *      DNode, Record, and Attribute Type levels
  96.  *  Some access control bits apply to the container itself, and some apply to its contents.
  97.  *
  98.  *  The Catalog Toolbox supports six functions.  These calls are:
  99.  *  DSGetDNodeAccessControl : to get Access Controls at the DNode level
  100.  *  DSGetRecordAccessControl  : to get Access Controls at the record level
  101.  *  DSGetAttributeAccessControl : to get Access Privileges at the attribute type level
  102.  * 
  103.  *  The GetXXXAccessControl calls will return access control masks for various categories
  104.  *  of users.  Please refer to the access control document for a description of the
  105.  *  categories of users.  In general these are:
  106.  *      ThisRecordOwner         - means the identity of the record itself
  107.  *      Friends                  - means any one of the assigned friends for the record
  108.  *      AuthenticatedInDNode     - means any valid user that is an authenticated entity
  109.  *          in the DNode in which this record is located
  110.  *      AuthenticatedInDirectory - means any valid authenticated catalog user
  111.  *      Guest                    - means an unauthenticated user.
  112.  *  Bit masks for various permitted access controls are defined below.
  113.  *
  114.  *  GetXXXAccessControl calls will return access control masks for various categories of
  115.  *  users for this record. In addition they also return the level of access controls
  116.  *  that the user (who is making the GetXXXAccessControl call) has for the DNode,
  117.  *  record, or attribute type.
  118.  *
  119.  *  For records, the access control granted will be minimum of the DNode access
  120.  *  control and record access control masks.  For example, to add an attribute type to a
  121.  *  record, a user must have access control kCreateAttributeTypes at the record and
  122.  *  DNode levels.  Similarly, at the attribute type level, access controls will be the
  123.  *  minimum of the DNode, record, and attribute type access controls.
  124.  *
  125.  *  
  126.  */
  127. /* access privileges bit numbers */
  128. enum {
  129.     kSeeBit                     = 0,
  130.     kAddBit                     = 1,
  131.     kDeleteBit                  = 2,
  132.     kChangeBit                  = 3,
  133.     kRenameBit                  = 4,
  134.     kChangePrivsBit             = 5,
  135.     kSeeFoldersBit              = 6
  136. };
  137. /* Values of AccessMask */
  138. enum {
  139.     kSeeMask                    = (1L << kSeeBit),
  140.     kAddMask                    = (1L << kAddBit),
  141.     kDeleteMask                 = (1L << kDeleteBit),
  142.     kChangeMask                 = (1L << kChangeBit),
  143.     kRenameMask                 = (1L << kRenameBit),
  144.     kChangePrivsMask            = (1L << kChangePrivsBit),
  145.     kSeeFoldersMask             = (1L << kSeeFoldersBit)
  146. };
  147. enum {
  148.     kAllPrivs                   = (kSeeMask + kAddMask + kDeleteMask + kChangeMask + kRenameMask + kChangePrivsMask + kSeeFoldersMask),
  149.     kNoPrivs                    = 0
  150. };
  151. /*
  152. kSupportsDNodeNumberBit:
  153. If this bit is set, a DNode can be referenced using DNodeNumbers. 
  154. RecordLocationInfo can be specified using DNodeNumber and PathName component can be nil. 
  155. If this bit is not set, a DNode can be referenced only by PathName to the DNode. In the 
  156. later case DNodeNumber component inside record location info must be set to zero.
  157. kSupportsRecordCreationIDBit:
  158. If this bit is set, a record can be referenced by specifying CreationID 
  159. in most catalog manager calls. If this bit is not set recordName and recordType are 
  160. required in the recordID specification for all catalog manager calls.
  161. kSupportsAttributeCreationIDBit:
  162. If this bit is set, an attribute value can be obtained by specifying it's 
  163. CreationID in Lookup call staring point and also can be used in operations 
  164. like DeleteAttributeValue and ChangeAttributeValue an Attribute can be 
  165. specified by AttributeType and CreationID.
  166. *************************************************************************
  167. Implicit assumption with creationID's and dNodeNumbers are, when supported
  168. they are persistent and will preserved across boots and life of the system.
  169. *************************************************************************
  170. Following three bits are for determining the sort order in enumeration.
  171. kSupportsMatchAllBit:
  172. If this bit is set, enumeration of all the records is supported
  173. kSupportsBeginsWithBit:
  174. If this bit is set, enumeration of records matching prefix (e.g. Begin with abc)
  175. is supported
  176. kSupportsExactMatchBit:
  177. If this bit is set, existence of a record matching exact matchNameString and recordType
  178. is supported.
  179. kSupportsEndsWithBit:
  180. If this bit is set, enumeration of records matching suffix (e.g. end with abc)
  181. is supported.
  182. kSupportsContainsBit:
  183. If this bit is set, enumeration of records containing a matchNameString (e.g. containing abc)
  184. is supported
  185. Implicit assumption in all these is, a record type can be specified either as one of the above or
  186. a type list(more then one) to match exact type.
  187. The Following four bits will indicate sort ordering in enumeration.
  188. kSupportsOrderedEnumerationBit:
  189. If this bit is set, Enumerated records or in some order possibly in name order.
  190. kCanSupportNameOrderBit:
  191. If this is set, catalog will support sortbyName option in Enumerate.
  192. kCanSupportTypeOrderBit:
  193. If this bit is set, catalog will support sortbyType option in enumearte.
  194. kSupportSortBackwardsBit:
  195. If this bit is set, catalog supports backward sorting.
  196. kSupportIndexRatioBit:
  197. If this bit is set, it indicates that enumeration will return approximate position
  198. of a record (percentile) among all records.
  199. kSupportsEnumerationContinueBit:
  200. If this bit is set, catalog supports enumeration continue.
  201. kSupportsLookupContinueBit:
  202. If this bit is set, catalog supports lookup continue.
  203. kSupportsEnumerateAttributeTypeContinueBit:
  204. If this bit is set, catalog supports EnumerateAttributeType continue.
  205. kSupportsEnumeratePseudonymContinueBit:
  206. If this bit is set, catalog supports EnumeratePseudonym continue.
  207. kSupportsAliasesBit:
  208. If this bit is set, catalog supports create/delte/enumerate 
  209. of Alias Records.
  210. kSupportPseudonymBit: 
  211. If this bit is set, catalog supports create/delte/enumerate of 
  212. pseudonyms for a record.
  213. kSupportsPartialPathNameBit:
  214. If this bit is set, catalog nodes can be specified using DNodeNumber of a 
  215. intermediate DNode and a partial name starting from that DNode to the intended 
  216. DNode.
  217. kSupportsAuthenticationBit:
  218. If this bit is set, catalog supports authentication manager calls.
  219. kSupportsProxiesBit:
  220. If this bit is set, catalog supports proxy related calls in authentication manager. 
  221. kSupportsFindRecordBit:
  222. If this bit is set, catalog supports find record call.
  223. Bits and corresponding masks are as defined below.
  224. */
  225. enum {
  226.     kSupportsDNodeNumberBit     = 0,
  227.     kSupportsRecordCreationIDBit = 1,
  228.     kSupportsAttributeCreationIDBit = 2,
  229.     kSupportsMatchAllBit        = 3,
  230.     kSupportsBeginsWithBit      = 4,
  231.     kSupportsExactMatchBit      = 5,
  232.     kSupportsEndsWithBit        = 6,
  233.     kSupportsContainsBit        = 7,
  234.     kSupportsOrderedEnumerationBit = 8,
  235.     kCanSupportNameOrderBit     = 9,
  236.     kCanSupportTypeOrderBit     = 10,
  237.     kSupportSortBackwardsBit    = 11,
  238.     kSupportIndexRatioBit       = 12,
  239.     kSupportsEnumerationContinueBit = 13,
  240.     kSupportsLookupContinueBit  = 14,
  241.     kSupportsEnumerateAttributeTypeContinueBit = 15,
  242.     kSupportsEnumeratePseudonymContinueBit = 16,
  243.     kSupportsAliasesBit         = 17,
  244.     kSupportsPseudonymsBit      = 18,
  245.     kSupportsPartialPathNamesBit = 19,
  246.     kSupportsAuthenticationBit  = 20,
  247.     kSupportsProxiesBit         = 21,
  248.     kSupportsFindRecordBit      = 22
  249. };
  250. /* values of DirGestalt */
  251. enum {
  252.     kSupportsDNodeNumberMask    = 1L << kSupportsDNodeNumberBit,
  253.     kSupportsRecordCreationIDMask = 1L << kSupportsRecordCreationIDBit,
  254.     kSupportsAttributeCreationIDMask = 1L << kSupportsAttributeCreationIDBit,
  255.     kSupportsMatchAllMask       = 1L << kSupportsMatchAllBit,
  256.     kSupportsBeginsWithMask     = 1L << kSupportsBeginsWithBit,
  257.     kSupportsExactMatchMask     = 1L << kSupportsExactMatchBit,
  258.     kSupportsEndsWithMask       = 1L << kSupportsEndsWithBit,
  259.     kSupportsContainsMask       = 1L << kSupportsContainsBit,
  260.     kSupportsOrderedEnumerationMask = 1L << kSupportsOrderedEnumerationBit,
  261.     kCanSupportNameOrderMask    = 1L << kCanSupportNameOrderBit,
  262.     kCanSupportTypeOrderMask    = 1L << kCanSupportTypeOrderBit,
  263.     kSupportSortBackwardsMask   = 1L << kSupportSortBackwardsBit,
  264.     kSupportIndexRatioMask      = 1L << kSupportIndexRatioBit,
  265.     kSupportsEnumerationContinueMask = 1L << kSupportsEnumerationContinueBit,
  266.     kSupportsLookupContinueMask = 1L << kSupportsLookupContinueBit,
  267.     kSupportsEnumerateAttributeTypeContinueMask = 1L << kSupportsEnumerateAttributeTypeContinueBit,
  268.     kSupportsEnumeratePseudonymContinueMask = 1L << kSupportsEnumeratePseudonymContinueBit,
  269.     kSupportsAliasesMask        = 1L << kSupportsAliasesBit,
  270.     kSupportsPseudonymsMask     = 1L << kSupportsPseudonymsBit,
  271.     kSupportsPartialPathNamesMask = 1L << kSupportsPartialPathNamesBit,
  272.     kSupportsAuthenticationMask = 1L << kSupportsAuthenticationBit,
  273.     kSupportsProxiesMask        = 1L << kSupportsProxiesBit,
  274.     kSupportsFindRecordMask     = 1L << kSupportsFindRecordBit
  275. };
  276. /* Values of AuthLocalIdentityOp */
  277. enum {
  278.     kAuthLockLocalIdentityOp    = 1,
  279.     kAuthUnlockLocalIdentityOp  = 2,
  280.     kAuthLocalIdentityNameChangeOp = 3
  281. };
  282. /* Values of AuthLocalIdentityLockAction */
  283. enum {
  284.     kAuthLockPending            = 1,
  285.     kAuthLockWillBeDone         = 2
  286. };
  287. /* Values of AuthNotifications */
  288. enum {
  289.     kNotifyLockBit              = 0,
  290.     kNotifyUnlockBit            = 1,
  291.     kNotifyNameChangeBit        = 2
  292. };
  293. enum {
  294.     kNotifyLockMask             = 1L << kNotifyLockBit,
  295.     kNotifyUnlockMask           = 1L << kNotifyUnlockBit,
  296.     kNotifyNameChangeMask       = 1L << kNotifyNameChangeBit
  297. };
  298. enum {
  299.     kPersonalDirectoryFileCreator = FOUR_CHAR_CODE('kl03'),
  300.     kPersonalDirectoryFileType  = FOUR_CHAR_CODE('pabt'),
  301.     kBusinessCardFileType       = FOUR_CHAR_CODE('bust'),
  302.     kDirectoryFileType          = FOUR_CHAR_CODE('dirt'),
  303.     kDNodeFileType              = FOUR_CHAR_CODE('dnod'),
  304.     kDirsRootFileType           = FOUR_CHAR_CODE('drtt'),
  305.     kRecordFileType             = FOUR_CHAR_CODE('rcrd')
  306. };
  307. typedef unsigned short                  DirSortOption;
  308. typedef unsigned short                  DirSortDirection;
  309. typedef unsigned long                   AccessMask;
  310. typedef unsigned long                   DirGestalt;
  311. typedef unsigned long                   AuthLocalIdentityOp;
  312. typedef unsigned long                   AuthLocalIdentityLockAction;
  313. typedef unsigned long                   AuthNotifications;
  314. struct DNodeID {
  315.     DNodeNum                        dNodeNumber;                /* dNodenumber  */
  316.     long                            reserved1;
  317.     RStringPtr                      name;
  318.     long                            reserved2;
  319. };
  320. typedef struct DNodeID                  DNodeID;
  321. struct DirEnumSpec {
  322.     DirEnumChoices                  enumFlag;
  323.     unsigned short                  indexRatio;                 /* Approx Record Position between 1 and 100 If supported, 0 If not supported */
  324.     union {
  325.         LocalRecordID                   recordIdentifier;
  326.         DNodeID                         dNodeIdentifier;
  327.     }                                 u;
  328. };
  329. typedef struct DirEnumSpec              DirEnumSpec;
  330. struct DirMetaInfo {
  331.     unsigned long                   info[4];
  332. };
  333. typedef struct DirMetaInfo              DirMetaInfo;
  334. struct SLRV {
  335.     ScriptCode                      script;                     /*   Script code in which entries are sorted */
  336.     short                           language;                   /*   Language code in which entries are sorted */
  337.     short                           regionCode;                 /*   Region code in which entries are sorted */
  338.     short                           version;                    /*  version of oce sorting software */
  339. };
  340. typedef struct SLRV                     SLRV;
  341. /* Catalog types and operations */
  342. /* unique identifier for an identity */
  343. typedef unsigned long                   AuthIdentity;
  344. /* Umbrella LocalIdentity */
  345. typedef AuthIdentity                    LocalIdentity;
  346. /* A DES key is 8 bytes of data */
  347. struct DESKey {
  348.     unsigned long                   a;
  349.     unsigned long                   b;
  350. };
  351. typedef struct DESKey                   DESKey;
  352. typedef Byte                            RC4Key[8];
  353. typedef unsigned long                   AuthKeyType;
  354. /* key type followed by its data */
  355. struct AuthKey {
  356.     AuthKeyType                     keyType;
  357.     union {
  358.         DESKey                          des;
  359.         RC4Key                          rc4;
  360.     }                                 u;
  361. };
  362. typedef struct AuthKey                  AuthKey;
  363. typedef AuthKey *                       AuthKeyPtr;
  364. typedef union AuthParamBlock            AuthParamBlock;
  365. typedef AuthParamBlock *                AuthParamBlockPtr;
  366. /* Fix parameter passing convention (#1274062) ggs, 8-7-95 */
  367. typedef CALLBACK_API( void , AuthIOCompletionProcPtr )(AuthParamBlockPtr paramBlock);
  368. /*
  369.     WARNING: AuthIOCompletionProcPtr uses register based parameters under classic 68k
  370.              and cannot be written in a high-level language without 
  371.              the help of mixed mode or assembly glue.
  372. */
  373. typedef REGISTER_UPP_TYPE(AuthIOCompletionProcPtr)              AuthIOCompletionUPP;
  374. /*****************************************************************************
  375.         Authentication Manager operations 
  376. *****************************************************************************/
  377. /*
  378. kAuthResolveCreationID:
  379. userRecord will contain the user information whose creationID has to be
  380. returned. A client must make this call when he does not know the creaitionID.
  381. The creationID must be set to nil before making the call. The server will attempt
  382. to match the recordid's in the data base which match the user name and
  383. type in the record.  Depending on number of matchings, following
  384. results will be returned.
  385. Exactly One Match : CreationID in RecordID and also in buffer (if buffer is given)
  386. totalMatches = actualMatches = 1.
  387. > 1 Match:
  388.     Buffer is Large Enough:
  389.     totalMatches = actualMatches
  390.     Buffer will contain all the CIDs, kOCEAmbiguousMatches error.
  391. > 1 Match:
  392.     Buffer is not Large Enough:
  393.     totalMatches > actualMatches
  394.     Buffer will contain all the CIDs (equal to actualMatches), daMoreDataError error.
  395. 0 Matches:
  396.  kOCENoSuchRecord error
  397. */
  398. struct AuthResolveCreationIDPB {
  399.     void *                          qLink;
  400.     long                            reserved1;
  401.     long                            reserved2;
  402.     AuthIOCompletionUPP             ioCompletion;
  403.     OSErr                           ioResult;
  404.     unsigned long                   saveA5;
  405.     short                           reqCode;
  406.     long                            reserved[2];
  407.     AddrBlock                       serverHint;
  408.     short                           dsRefNum;
  409.     unsigned long                   callID;
  410.     AuthIdentity                    identity;
  411.     long                            gReserved1;
  412.     long                            gReserved2;
  413.     long                            gReserved3;
  414.     long                            clientData;
  415.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  416.     unsigned long                   bufferLength;               /*  --> Buffer Size to hold duplicate Info */
  417.     void *                          buffer;                     /*  --> Buffer  to hold duplicate Info */
  418.     unsigned long                   totalMatches;               /* <--  Total Number of matching names found */
  419.     unsigned long                   actualMatches;              /* <--  Number of matches returned in the buffer */
  420. };
  421. typedef struct AuthResolveCreationIDPB  AuthResolveCreationIDPB;
  422. /*
  423. kAuthBindSpecificIdentity:
  424. userRecord will contain the user information whose identity has to be
  425. verified. userKey will contain the userKey. An Identity is returned which
  426. binds the key and the userRecord. The identity returned can be used in the 'identity'
  427. field in the header portion (AuthParamHeader) for authenticating the Catalog and
  428. Authentication manager calls.
  429. */
  430. struct AuthBindSpecificIdentityPB {
  431.     void *                          qLink;
  432.     long                            reserved1;
  433.     long                            reserved2;
  434.     AuthIOCompletionUPP             ioCompletion;
  435.     OSErr                           ioResult;
  436.     unsigned long                   saveA5;
  437.     short                           reqCode;
  438.     long                            reserved[2];
  439.     AddrBlock                       serverHint;
  440.     short                           dsRefNum;
  441.     unsigned long                   callID;
  442.     AuthIdentity                    identity;
  443.     long                            gReserved1;
  444.     long                            gReserved2;
  445.     long                            gReserved3;
  446.     long                            clientData;
  447.     AuthIdentity                    userIdentity;               /* <--  binding identity */
  448.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  449.     AuthKeyPtr                      userKey;                    /*  --> OCE Key for the user */
  450. };
  451. typedef struct AuthBindSpecificIdentityPB AuthBindSpecificIdentityPB;
  452. /*
  453. kAuthUnbindSpecificIdentity:
  454. This call will unbind the userRecord and key which were bind earlier.
  455. */
  456. struct AuthUnbindSpecificIdentityPB {
  457.     void *                          qLink;
  458.     long                            reserved1;
  459.     long                            reserved2;
  460.     AuthIOCompletionUPP             ioCompletion;
  461.     OSErr                           ioResult;
  462.     unsigned long                   saveA5;
  463.     short                           reqCode;
  464.     long                            reserved[2];
  465.     AddrBlock                       serverHint;
  466.     short                           dsRefNum;
  467.     unsigned long                   callID;
  468.     AuthIdentity                    identity;
  469.     long                            gReserved1;
  470.     long                            gReserved2;
  471.     long                            gReserved3;
  472.     long                            clientData;
  473.     AuthIdentity                    userIdentity;               /*  --> identity to be deleted */
  474. };
  475. typedef struct AuthUnbindSpecificIdentityPB AuthUnbindSpecificIdentityPB;
  476. /*
  477. kAuthGetSpecificIdentityInfo:
  478. This call will return the userRecord for the given identity. Note: key is not
  479. returned because this would compromise security.
  480. */
  481. struct AuthGetSpecificIdentityInfoPB {
  482.     void *                          qLink;
  483.     long                            reserved1;
  484.     long                            reserved2;
  485.     AuthIOCompletionUPP             ioCompletion;
  486.     OSErr                           ioResult;
  487.     unsigned long                   saveA5;
  488.     short                           reqCode;
  489.     long                            reserved[2];
  490.     AddrBlock                       serverHint;
  491.     short                           dsRefNum;
  492.     unsigned long                   callID;
  493.     AuthIdentity                    identity;
  494.     long                            gReserved1;
  495.     long                            gReserved2;
  496.     long                            gReserved3;
  497.     long                            clientData;
  498.     AuthIdentity                    userIdentity;               /*  --> identity of initiator */
  499.     RecordIDPtr                     userRecord;                 /* <--  OCE name(Record) of the user */
  500. };
  501. typedef struct AuthGetSpecificIdentityInfoPB AuthGetSpecificIdentityInfoPB;
  502. /*
  503. kAuthAddKey:
  504. userRecord will contain the user information whose identity has to be
  505. created. userKey will point to the key to be created. password points to
  506. an RString containing the password used to generate the key.
  507. */
  508. struct AuthAddKeyPB {
  509.     void *                          qLink;
  510.     long                            reserved1;
  511.     long                            reserved2;
  512.     AuthIOCompletionUPP             ioCompletion;
  513.     OSErr                           ioResult;
  514.     unsigned long                   saveA5;
  515.     short                           reqCode;
  516.     long                            reserved[2];
  517.     AddrBlock                       serverHint;
  518.     short                           dsRefNum;
  519.     unsigned long                   callID;
  520.     AuthIdentity                    identity;
  521.     long                            gReserved1;
  522.     long                            gReserved2;
  523.     long                            gReserved3;
  524.     long                            clientData;
  525.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  526.     AuthKeyPtr                      userKey;                    /* <--  OCE Key for the user */
  527.     RStringPtr                      password;                   /*  --> Pointer to password string */
  528. };
  529. typedef struct AuthAddKeyPB             AuthAddKeyPB;
  530. /*
  531. kAuthChangeKey:
  532. userRecord will contain the user information whose identity has to be
  533. created. userKey will point to the key to be created. password points to
  534. an RString containing the password used to generate the key.
  535. */
  536. struct AuthChangeKeyPB {
  537.     void *                          qLink;
  538.     long                            reserved1;
  539.     long                            reserved2;
  540.     AuthIOCompletionUPP             ioCompletion;
  541.     OSErr                           ioResult;
  542.     unsigned long                   saveA5;
  543.     short                           reqCode;
  544.     long                            reserved[2];
  545.     AddrBlock                       serverHint;
  546.     short                           dsRefNum;
  547.     unsigned long                   callID;
  548.     AuthIdentity                    identity;
  549.     long                            gReserved1;
  550.     long                            gReserved2;
  551.     long                            gReserved3;
  552.     long                            clientData;
  553.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  554.     AuthKeyPtr                      userKey;                    /* <--  New OCE Key for the user */
  555.     RStringPtr                      password;                   /*  -->Pointer to the new password string */
  556. };
  557. typedef struct AuthChangeKeyPB          AuthChangeKeyPB;
  558. /*
  559. AuthDeleteKey:
  560. userRecord will contain the user information whose Key has to be deleted.
  561. */
  562. struct AuthDeleteKeyPB {
  563.     void *                          qLink;
  564.     long                            reserved1;
  565.     long                            reserved2;
  566.     AuthIOCompletionUPP             ioCompletion;
  567.     OSErr                           ioResult;
  568.     unsigned long                   saveA5;
  569.     short                           reqCode;
  570.     long                            reserved[2];
  571.     AddrBlock                       serverHint;
  572.     short                           dsRefNum;
  573.     unsigned long                   callID;
  574.     AuthIdentity                    identity;
  575.     long                            gReserved1;
  576.     long                            gReserved2;
  577.     long                            gReserved3;
  578.     long                            clientData;
  579.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  580. };
  581. typedef struct AuthDeleteKeyPB          AuthDeleteKeyPB;
  582. /* AuthPasswordToKey: Converts an RString into a key. */
  583. struct AuthPasswordToKeyPB {
  584.     void *                          qLink;
  585.     long                            reserved1;
  586.     long                            reserved2;
  587.     AuthIOCompletionUPP             ioCompletion;
  588.     OSErr                           ioResult;
  589.     unsigned long                   saveA5;
  590.     short                           reqCode;
  591.     long                            reserved[2];
  592.     AddrBlock                       serverHint;
  593.     short                           dsRefNum;
  594.     unsigned long                   callID;
  595.     AuthIdentity                    identity;
  596.     long                            gReserved1;
  597.     long                            gReserved2;
  598.     long                            gReserved3;
  599.     long                            clientData;
  600.     RecordIDPtr                     userRecord;                 /*  --> OCE name(Record) of the user */
  601.     AuthKeyPtr                      key;                        /* <--  */
  602.     RStringPtr                      password;                   /*  -->Pointer to the new password string */
  603. };
  604. typedef struct AuthPasswordToKeyPB      AuthPasswordToKeyPB;
  605. /*
  606. kAuthGetCredentials:
  607. userRecord will contain the user information whose identity has to be
  608. kMailDeletedMask. keyType (e.g. asDESKey) will indicate what type of key has to
  609. be deleted.
  610. */
  611. struct AuthGetCredentialsPB {
  612.     void *                          qLink;
  613.     long                            reserved1;
  614.     long                            reserved2;
  615.     AuthIOCompletionUPP             ioCompletion;
  616.     OSErr                           ioResult;
  617.     unsigned long                   saveA5;
  618.     short                           reqCode;
  619.     long                            reserved[2];
  620.     AddrBlock                       serverHint;
  621.     short                           dsRefNum;
  622.     unsigned long                   callID;
  623.     AuthIdentity                    identity;
  624.     long                            gReserved1;
  625.     long                            gReserved2;
  626.     long                            gReserved3;
  627.     long                            clientData;
  628.     AuthIdentity                    userIdentity;               /*  --> identity of initiator */
  629.     RecordIDPtr                     recipient;                  /*  --> OCE name of recipient */
  630.     AuthKeyPtr                      sessionKey;                 /* <--  session key */
  631.     UTCTime                         expiry;                     /* <--> desired/actual expiry */
  632.     unsigned long                   credentialsLength;          /* <--> max/actual credentials size */
  633.     void *                          credentials;                /* <--  buffer where credentials are returned */
  634. };
  635. typedef struct AuthGetCredentialsPB     AuthGetCredentialsPB;
  636. /*
  637. AuthDecryptCredentialsPB:
  638. Changes:
  639. userKey is changed userIdentity.
  640. userRecord is changed to initiatorRecord. User must supply buffer
  641. to hold initiatorRecord.
  642. agentList has changed to agent. There wil be no call back.
  643. User must supply buffer to hold agent Record.
  644. An additional boolean parameter 'hasAgent' is included.
  645. Toolbox will set this if an 'Agent' record is found in the
  646. credentials. If RecordIDPtr is 'nil', no agent record will
  647. be copied. However user can examine 'hasAgent', If true user
  648. can reissue this call with apprpriate buffer for getting a recordID.
  649. agent has changed to intermediary.  User must supply buffer to hold 
  650. intermediary Record.  The toolbox will set 'hasIntermediary' if an
  651. 'intermediary' record is found in the credentials. 
  652. */
  653. struct AuthDecryptCredentialsPB {
  654.     void *                          qLink;
  655.     long                            reserved1;
  656.     long                            reserved2;
  657.     AuthIOCompletionUPP             ioCompletion;
  658.     OSErr                           ioResult;
  659.     unsigned long                   saveA5;
  660.     short                           reqCode;
  661.     long                            reserved[2];
  662.     AddrBlock                       serverHint;
  663.     short                           dsRefNum;
  664.     unsigned long                   callID;
  665.     AuthIdentity                    identity;
  666.     long                            gReserved1;
  667.     long                            gReserved2;
  668.     long                            gReserved3;
  669.     long                            clientData;
  670.     AuthIdentity                    userIdentity;               /*  --> user's Identity */
  671.     RecordIDPtr                     initiatorRecord;            /* <--  OCE name of the initiator */
  672.     AuthKeyPtr                      sessionKey;                 /* <--  session key */
  673.     UTCTime                         expiry;                     /* <--  credentials expiry time */
  674.     unsigned long                   credentialsLength;          /*  --> actual credentials size */
  675.     void *                          credentials;                /*  --> credentials to be decrypted */
  676.     UTCTime                         issueTime;                  /* <--  credentials expiry time */
  677.     Boolean                         hasIntermediary;            /* <--  if true, An intermediary Record was found in credentials */
  678.     Boolean                         filler1;
  679.     RecordIDPtr                     intermediary;               /* <--  recordID of the intermediary */
  680. };
  681. typedef struct AuthDecryptCredentialsPB AuthDecryptCredentialsPB;
  682. struct AuthMakeChallengePB {
  683.     void *                          qLink;
  684.     long                            reserved1;
  685.     long                            reserved2;
  686.     AuthIOCompletionUPP             ioCompletion;
  687.     OSErr                           ioResult;
  688.     unsigned long                   saveA5;
  689.     short                           reqCode;
  690.     long                            reserved[2];
  691.     AddrBlock                       serverHint;
  692.     short                           dsRefNum;
  693.     unsigned long                   callID;
  694.     AuthIdentity                    identity;
  695.     long                            gReserved1;
  696.     long                            gReserved2;
  697.     long                            gReserved3;
  698.     long                            clientData;
  699.     AuthKeyPtr                      key;                        /*  --> UnEncrypted SessionKey */
  700.     void *                          challenge;                  /* <--  Encrypted Challenge */
  701.     unsigned long                   challengeBufferLength;      /*  ->length of challenge buffer */
  702.     unsigned long                   challengeLength;            /*  <-length of Encrypted Challenge */
  703. };
  704. typedef struct AuthMakeChallengePB      AuthMakeChallengePB;
  705. struct AuthMakeReplyPB {
  706.     void *                          qLink;
  707.     long                            reserved1;
  708.     long                            reserved2;
  709.     AuthIOCompletionUPP             ioCompletion;
  710.     OSErr                           ioResult;
  711.     unsigned long                   saveA5;
  712.     short                           reqCode;
  713.     long                            reserved[2];
  714.     AddrBlock                       serverHint;
  715.     short                           dsRefNum;
  716.     unsigned long                   callID;
  717.     AuthIdentity                    identity;
  718.     long                            gReserved1;
  719.     long                            gReserved2;
  720.     long                            gReserved3;
  721.     long                            clientData;
  722.     AuthKeyPtr                      key;                        /*  --> UnEncrypted SessionKey */
  723.     void *                          challenge;                  /*  --> Encrypted Challenge */
  724.     void *                          reply;                      /* <--  Encrypted Reply */
  725.     unsigned long                   replyBufferLength;          /*  -->length of challenge buffer */
  726.     unsigned long                   challengeLength;            /*  --> length of Encrypted Challenge */
  727.     unsigned long                   replyLength;                /* <--  length of Encrypted Reply */
  728. };
  729. typedef struct AuthMakeReplyPB          AuthMakeReplyPB;
  730. struct AuthVerifyReplyPB {
  731.     void *                          qLink;
  732.     long                            reserved1;
  733.     long                            reserved2;
  734.     AuthIOCompletionUPP             ioCompletion;
  735.     OSErr                           ioResult;
  736.     unsigned long                   saveA5;
  737.     short                           reqCode;
  738.     long                            reserved[2];
  739.     AddrBlock                       serverHint;
  740.     short                           dsRefNum;
  741.     unsigned long                   callID;
  742.     AuthIdentity                    identity;
  743.     long                            gReserved1;
  744.     long                            gReserved2;
  745.     long                            gReserved3;
  746.     long                            clientData;
  747.     AuthKeyPtr                      key;                        /*  --> UnEncrypted SessionKey */
  748.     void *                          challenge;                  /*  --> Encrypted Challenge */
  749.     void *                          reply;                      /*  --> Encrypted Reply */
  750.     unsigned long                   challengeLength;            /*  --> length of Encrypted Challenge */
  751.     unsigned long                   replyLength;                /*  --> length of Encrypted Reply */
  752. };
  753. typedef struct AuthVerifyReplyPB        AuthVerifyReplyPB;
  754. /*
  755. kAuthGetUTCTime:
  756. RLI will contain a valid RLI for a cluster server.
  757. UTC(GMT) time from one of the cluster server will be returned.
  758. An 'offSet' from UTC(GMT) to Mac Local Time will also be returned.
  759. If RLI is nil Map DA is used to determine UTC(GMT).
  760. Mac Local Time = theUTCTime + theUTCOffset.
  761. */
  762. struct AuthGetUTCTimePB {
  763.     void *                          qLink;
  764.     long                            reserved1;
  765.     long                            reserved2;
  766.     AuthIOCompletionUPP             ioCompletion;
  767.     OSErr                           ioResult;
  768.     unsigned long                   saveA5;
  769.     short                           reqCode;
  770.     long                            reserved[2];
  771.     AddrBlock                       serverHint;
  772.     short                           dsRefNum;
  773.     unsigned long                   callID;
  774.     AuthIdentity                    identity;
  775.     long                            gReserved1;
  776.     long                            gReserved2;
  777.     long                            gReserved3;
  778.     long                            clientData;
  779.     PackedRLIPtr                    pRLI;                       /*  --> packed RLI of the Node, whose server's UTC is requested */
  780.     UTCTime                         theUTCTime;                 /* <--  current UTC(GMT) Time utc seconds since 1/1/1904 */
  781.     UTCOffset                       theUTCOffset;               /* <--  offset from UTC(GMT) seconds EAST of Greenwich */
  782. };
  783. typedef struct AuthGetUTCTimePB         AuthGetUTCTimePB;
  784. /*
  785. kAuthMakeProxy:
  786. A user represented bu the 'userIdentity' can make a proxy using this call.
  787. 'recipient' is the RecordID of the recipient whom user is requesting proxy.
  788. 'intermediary' is the RecordID of the intermediary holding proxy for the user.
  789. 'firstValid' is time at which proxy becomes valid.
  790. 'expiry' is the time at which proxy must expire.
  791. 'proxyLength' will have the length of the buffer pointed by 'proxy' as input.
  792. When the call completes, it will hold the actual length of proxy. If the
  793. call completes 'kOCEMoreData' error, client can reissue the call with the
  794. buffer size as 'proxyLength' returned.
  795. expiry is a suggestion, and may be adjusted to be earlier by the ADAP/OCE server.
  796. The 'proxy' obtained like this might be used by the 'intermediary' to obtain credentials
  797. for the server using TradeProxyForCredentials call.
  798. authDataLength and authData are intended for possible future work, but are
  799. ignored for now.
  800. */
  801. struct AuthMakeProxyPB {
  802.     void *                          qLink;
  803.     long                            reserved1;
  804.     long                            reserved2;
  805.     AuthIOCompletionUPP             ioCompletion;
  806.     OSErr                           ioResult;
  807.     unsigned long                   saveA5;
  808.     short                           reqCode;
  809.     long                            reserved[2];
  810.     AddrBlock                       serverHint;
  811.     short                           dsRefNum;
  812.     unsigned long                   callID;
  813.     AuthIdentity                    identity;
  814.     long                            gReserved1;
  815.     long                            gReserved2;
  816.     long                            gReserved3;
  817.     long                            clientData;
  818.     AuthIdentity                    userIdentity;               /*  --> identity of principal */
  819.     RecordIDPtr                     recipient;                  /*  --> OCE name of recipient */
  820.     UTCTime                         firstValid;                 /*  --> time at which proxy becomes valid */
  821.     UTCTime                         expiry;                     /*  --> time at which proxy expires */
  822.     unsigned long                   authDataLength;             /*  --> size of authorization data */
  823.     void *                          authData;                   /*  --> pointer to authorization data */
  824.     unsigned long                   proxyLength;                /* <--> max/actual proxy size */
  825.     void *                          proxy;                      /* <--> buffer where proxy is returned */
  826.     RecordIDPtr                     intermediary;               /*  --> RecordID of intermediary */
  827. };
  828. typedef struct AuthMakeProxyPB          AuthMakeProxyPB;
  829. /*
  830. kAuthTradeProxyForCredentials:
  831. Using this call, intermediary holding a 'proxy' for a recipient may obtain credentials
  832. for that recipient. 'userIdentity' is the identity for the 'intermediary'.
  833. 'recipient' is the RecordID for whom credetials are requested.
  834. 'principal' is the RecordID of the user who created the proxy.
  835. 'proxyLength' is the length of data pointed by 'proxy.
  836. If the call is succesfull, credentials will be returned in the
  837. buffer pointed by 'credentials'. 'expiry' is the desired expiry time at input.
  838. When call succeds this will have expiry time of credentials.
  839. This is very similar to GetCredentials except that we (of course) need the proxy,
  840. but we also need the name of the principal who created the proxy.
  841. */
  842. struct AuthTradeProxyForCredentialsPB {
  843.     void *                          qLink;
  844.     long                            reserved1;
  845.     long                            reserved2;
  846.     AuthIOCompletionUPP             ioCompletion;
  847.     OSErr                           ioResult;
  848.     unsigned long                   saveA5;
  849.     short                           reqCode;
  850.     long                            reserved[2];
  851.     AddrBlock                       serverHint;
  852.     short                           dsRefNum;
  853.     unsigned long                   callID;
  854.     AuthIdentity                    identity;
  855.     long                            gReserved1;
  856.     long                            gReserved2;
  857.     long                            gReserved3;
  858.     long                            clientData;
  859.     AuthIdentity                    userIdentity;               /*  --> identity of intermediary */
  860.     RecordIDPtr                     recipient;                  /*  --> OCE name of recipient */
  861.     AuthKeyPtr                      sessionKey;                 /* <--  session key */
  862.     UTCTime                         expiry;                     /* <--> desired/actual expiry */
  863.     unsigned long                   credentialsLength;          /* <--> max/actual credentials size */
  864.     void *                          credentials;                /* <--> buffer where credentials are returned */
  865.     unsigned long                   proxyLength;                /*  --> actual proxy size */
  866.     void *                          proxy;                      /*  --> buffer containing proxy */
  867.     RecordIDPtr                     principal;                  /*  --> RecordID of principal */
  868. };
  869. typedef struct AuthTradeProxyForCredentialsPB AuthTradeProxyForCredentialsPB;
  870. /* API for Local Identity Interface */
  871. /*
  872. AuthGetLocalIdentityPB:
  873. A Collaborative application intended to work under the umbrella of LocalIdentity
  874. for the OCE toolbox will have to make this call to obtain LocalIdentity.
  875. If LocalIdentity has not been setup, then application will get
  876. 'kOCEOCESetupRequired.'. In this case application should put the dialog
  877. recommended by the OCE Setup document and guide the user through OCE Setup.
  878. If the OCESetup contains local identity, but user has not unlocked, it will get
  879. kOCELocalAuthenticationFail. In this case application should use SDPPromptForLocalIdentity
  880. to prompt user for the password.
  881. If a backGround application or stand alone code requires LocalIdentity, if it gets the
  882. OSErr from LocalIdentity and can not call SDPPromptForLocalIdentity, it should it self
  883. register with the toolbox using kAuthAddToLocalIdentityQueue call. It will be notified
  884. when a LocalIdentity gets created by a foreground application.
  885. */
  886. struct AuthGetLocalIdentityPB {
  887.     void *                          qLink;
  888.     long                            reserved1;
  889.     long                            reserved2;
  890.     AuthIOCompletionUPP             ioCompletion;
  891.     OSErr                           ioResult;
  892.     unsigned long                   saveA5;
  893.     short                           reqCode;
  894.     long                            reserved[2];
  895.     AddrBlock                       serverHint;
  896.     short                           dsRefNum;
  897.     unsigned long                   callID;
  898.     AuthIdentity                    identity;
  899.     long                            gReserved1;
  900.     long                            gReserved2;
  901.     long                            gReserved3;
  902.     long                            clientData;
  903.     LocalIdentity                   theLocalIdentity;           /* <--  LocalIdentity */
  904. };
  905. typedef struct AuthGetLocalIdentityPB   AuthGetLocalIdentityPB;
  906. /*
  907. kAuthUnlockLocalIdentity:
  908. The LocalIdentity can be created using this call.
  909. The userName and password correspond to the LocalIdentity setup.
  910. If the password matches, then collabIdentity will be returned.
  911. Typically SDPPromptForLocalIdentity call will make this call.
  912. All applications which are registered through kAuthAddToLocalIdentityQueue
  913. will be notified.
  914. */
  915. struct AuthUnlockLocalIdentityPB {
  916.     void *                          qLink;
  917.     long                            reserved1;
  918.     long                            reserved2;
  919.     AuthIOCompletionUPP             ioCompletion;
  920.     OSErr                           ioResult;
  921.     unsigned long                   saveA5;
  922.     short                           reqCode;
  923.     long                            reserved[2];
  924.     AddrBlock                       serverHint;
  925.     short                           dsRefNum;
  926.     unsigned long                   callID;
  927.     AuthIdentity                    identity;
  928.     long                            gReserved1;
  929.     long                            gReserved2;
  930.     long                            gReserved3;
  931.     long                            clientData;
  932.     LocalIdentity                   theLocalIdentity;           /* <--  LocalIdentity */
  933.     RStringPtr                      userName;                   /*  --> userName */
  934.     RStringPtr                      password;                   /*  -->user password */
  935. };
  936. typedef struct AuthUnlockLocalIdentityPB AuthUnlockLocalIdentityPB;
  937. /*
  938. kAuthLockLocalIdentity:
  939. With this call existing LocalIdentity can be locked. If the ASDeleteLocalIdetity
  940. call fails with 'kOCEOperationDenied' error, name will contain the application which
  941. denied the operation. This name will be supplied by the application
  942. when it registered through kAuthAddToLocalIdentityQueue call
  943. */
  944. struct AuthLockLocalIdentityPB {
  945.     void *                          qLink;
  946.     long                            reserved1;
  947.     long                            reserved2;
  948.     AuthIOCompletionUPP             ioCompletion;
  949.     OSErr                           ioResult;
  950.     unsigned long                   saveA5;
  951.     short                           reqCode;
  952.     long                            reserved[2];
  953.     AddrBlock                       serverHint;
  954.     short                           dsRefNum;
  955.     unsigned long                   callID;
  956.     AuthIdentity                    identity;
  957.     long                            gReserved1;
  958.     long                            gReserved2;
  959.     long                            gReserved3;
  960.     long                            clientData;
  961.     LocalIdentity                   theLocalIdentity;           /*  --> LocalIdentity */
  962.     StringPtr                       name;                       /* <--  name of the app which denied delete */
  963. };
  964. typedef struct AuthLockLocalIdentityPB  AuthLockLocalIdentityPB;
  965. typedef CALLBACK_API( Boolean , NotificationProcPtr )(long clientData, AuthLocalIdentityOp callValue, AuthLocalIdentityLockAction actionValue, LocalIdentity identity);
  966. typedef STACK_UPP_TYPE(NotificationProcPtr)                     NotificationUPP;
  967. typedef NotificationUPP                 NotificationProc;
  968. /*
  969. kAuthAddToLocalIdentityQueue:
  970. An application requiring notification of locking/unlocking of the
  971. LocalIdentity can install itself using this call. The function provided
  972. in 'notifyProc' will be called whenever the requested event happens.
  973. When an AuthLockLocalIdentity call is made to the toolbox, the notificationProc
  974. will be called with 'kAuthLockPending'. The application may refuse the lock by returning
  975. a 'true' value. If all the registered entries return 'false' value, locking will be done
  976. successfully. Otherwise 'kOCEOperationDenied' error is returned to the caller. The appName
  977. (registered with the notificationProc) of the application which denied locking is also
  978. returned to the caller making the AuthLockIdentity call.
  979. */
  980. struct AuthAddToLocalIdentityQueuePB {
  981.     void *                          qLink;
  982.     long                            reserved1;
  983.     long                            reserved2;
  984.     AuthIOCompletionUPP             ioCompletion;
  985.     OSErr                           ioResult;
  986.     unsigned long                   saveA5;
  987.     short                           reqCode;
  988.     long                            reserved[2];
  989.     AddrBlock                       serverHint;
  990.     short                           dsRefNum;
  991.     unsigned long                   callID;
  992.     AuthIdentity                    identity;
  993.     long                            gReserved1;
  994.     long                            gReserved2;
  995.     long                            gReserved3;
  996.     long                            clientData;
  997.     NotificationUPP                 notifyProc;                 /*  --> notification procedure */
  998.     AuthNotifications               notifyFlags;                /*  --> notifyFlags */
  999.     StringPtr                       appName;                    /*  --> name of application to be returned in Delete/Stop */
  1000. };
  1001. typedef struct AuthAddToLocalIdentityQueuePB AuthAddToLocalIdentityQueuePB;
  1002. /*
  1003. kAuthRemoveFromLocalIdentityQueue:*/
  1004. struct AuthRemoveFromLocalIdentityQueuePB {
  1005.     void *                          qLink;
  1006.     long                            reserved1;
  1007.     long                            reserved2;
  1008.     AuthIOCompletionUPP             ioCompletion;
  1009.     OSErr                           ioResult;
  1010.     unsigned long                   saveA5;
  1011.     short                           reqCode;
  1012.     long                            reserved[2];
  1013.     AddrBlock                       serverHint;
  1014.     short                           dsRefNum;
  1015.     unsigned long                   callID;
  1016.     AuthIdentity                    identity;
  1017.     long                            gReserved1;
  1018.     long                            gReserved2;
  1019.     long                            gReserved3;
  1020.     long                            clientData;
  1021.     NotificationUPP                 notifyProc;                 /*  --> notification procedure */
  1022. };
  1023. typedef struct AuthRemoveFromLocalIdentityQueuePB AuthRemoveFromLocalIdentityQueuePB;
  1024. /*
  1025. kAuthSetupLocalIdentity:
  1026. The LocalIdentity can be Setup using this call.
  1027. The userName and password correspond to the LocalIdentity setup.
  1028. If a LocalIdentity Setup already exists 'kOCELocalIdentitySetupExists' error
  1029. will be returned.
  1030. */
  1031. struct AuthSetupLocalIdentityPB {
  1032.     void *                          qLink;
  1033.     long                            reserved1;
  1034.     long                            reserved2;
  1035.     AuthIOCompletionUPP             ioCompletion;
  1036.     OSErr                           ioResult;
  1037.     unsigned long                   saveA5;
  1038.     short                           reqCode;
  1039.     long                            reserved[2];
  1040.     AddrBlock                       serverHint;
  1041.     short                           dsRefNum;
  1042.     unsigned long                   callID;
  1043.     AuthIdentity                    identity;
  1044.     long                            gReserved1;
  1045.     long                            gReserved2;
  1046.     long                            gReserved3;
  1047.     long                            clientData;
  1048.     long                            aReserved;                  /*  --  */
  1049.     RStringPtr                      userName;                   /*  --> userName */
  1050.     RStringPtr                      password;                   /*  -->user password */
  1051. };
  1052. typedef struct AuthSetupLocalIdentityPB AuthSetupLocalIdentityPB;
  1053. /*
  1054. kAuthChangeLocalIdentity:
  1055. An existing LocalIdentity  Setup can be changed using this call.
  1056. The userName and password correspond to the LocalIdentity setup.
  1057. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1058. will be returned. The user can use  kAuthSetupLocalIdentity call to setit up.
  1059. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1060. OSErr will be returned. If successful, LocalID will have new name as 'userName' and
  1061. password as 'newPassword' and if any applications has installed into 
  1062. LocalIdentityQueue with kNotifyNameChangeMask set, it will be notified with 
  1063. kAuthLocalIdentityNameChangeOp action value. 
  1064. */
  1065. struct AuthChangeLocalIdentityPB {
  1066.     void *                          qLink;
  1067.     long                            reserved1;
  1068.     long                            reserved2;
  1069.     AuthIOCompletionUPP             ioCompletion;
  1070.     OSErr                           ioResult;
  1071.     unsigned long                   saveA5;
  1072.     short                           reqCode;
  1073.     long                            reserved[2];
  1074.     AddrBlock                       serverHint;
  1075.     short                           dsRefNum;
  1076.     unsigned long                   callID;
  1077.     AuthIdentity                    identity;
  1078.     long                            gReserved1;
  1079.     long                            gReserved2;
  1080.     long                            gReserved3;
  1081.     long                            clientData;
  1082.     long                            aReserved;                  /*  --  */
  1083.     RStringPtr                      userName;                   /*  --> userName */
  1084.     RStringPtr                      password;                   /*  --> current password */
  1085.     RStringPtr                      newPassword;                /*  --> new password */
  1086. };
  1087. typedef struct AuthChangeLocalIdentityPB AuthChangeLocalIdentityPB;
  1088. /*
  1089. kAuthRemoveLocalIdentity:
  1090. An existing LocalIdentity  Setup can be removed using this call.
  1091. The userName and password correspond to the LocalIdentity setup.
  1092. If a LocalIdentity Setup does not exists 'kOCEOCESetupRequired' error
  1093. will be returned.
  1094. If the 'password' does not correspond to the existing setup, 'kOCELocalAuthenticationFail'
  1095. OSErr will be returned. If successful, LocalIdentity will be removed from the OCE Setup.
  1096. This is a very distructive operation, user must be warned enough before actually making
  1097. this call.
  1098. */
  1099. struct AuthRemoveLocalIdentityPB {
  1100.     void *                          qLink;
  1101.     long                            reserved1;
  1102.     long                            reserved2;
  1103.     AuthIOCompletionUPP             ioCompletion;
  1104.     OSErr                           ioResult;
  1105.     unsigned long                   saveA5;
  1106.     short                           reqCode;
  1107.     long                            reserved[2];
  1108.     AddrBlock                       serverHint;
  1109.     short                           dsRefNum;
  1110.     unsigned long                   callID;
  1111.     AuthIdentity                    identity;
  1112.     long                            gReserved1;
  1113.     long                            gReserved2;
  1114.     long                            gReserved3;
  1115.     long                            clientData;
  1116.     long                            aReserved;                  /*  --  */
  1117.     RStringPtr                      userName;                   /*  --> userName */
  1118.     RStringPtr                      password;                   /*  --> current password */
  1119. };
  1120. typedef struct AuthRemoveLocalIdentityPB AuthRemoveLocalIdentityPB;
  1121. /*
  1122. kOCESetupAddDirectoryInfo:
  1123. Using this call identity for a catalog can be setup under LocalIdentity umbrella.
  1124. ASCreateLocalIdentity should have been done succesfully before making this call.    
  1125. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1126. DirAddDSAMDirectory call was made.
  1127. rid-> is the recordID in which the identity for the catalog will be established.
  1128. password-> the password associated with the rid in the catalog world.
  1129. */
  1130. struct OCESetupAddDirectoryInfoPB {
  1131.     void *                          qLink;
  1132.     long                            reserved1;
  1133.     long                            reserved2;
  1134.     AuthIOCompletionUPP             ioCompletion;
  1135.     OSErr                           ioResult;
  1136.     unsigned long                   saveA5;
  1137.     short                           reqCode;
  1138.     long                            reserved[2];
  1139.     AddrBlock                       serverHint;
  1140.     short                           dsRefNum;
  1141.     unsigned long                   callID;
  1142.     AuthIdentity                    identity;
  1143.     long                            gReserved1;
  1144.     long                            gReserved2;
  1145.     long                            gReserved3;
  1146.     long                            clientData;
  1147.     CreationID                      directoryRecordCID;         /*  --> CreationID for the catalog */
  1148.     RecordIDPtr                     recordID;                   /*  --> recordID for the identity */
  1149.     RStringPtr                      password;                   /*  --> password in the catalog world */
  1150. };
  1151. typedef struct OCESetupAddDirectoryInfoPB OCESetupAddDirectoryInfoPB;
  1152. /*
  1153. kOCESetupChangeDirectoryInfo:
  1154. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1155. can be changed.
  1156. ASCreateLocalIdentity should have been done succesfully before making this call.
  1157. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1158. DirAddDSAMDirectory call was made.
  1159. rid-> is the recordID in which the identity for the catalog will be established.
  1160. password-> the password associated with the rid in the catalog world.
  1161. newPassword -> the new password for the catalog
  1162. */
  1163. struct OCESetupChangeDirectoryInfoPB {
  1164.     void *                          qLink;
  1165.     long                            reserved1;
  1166.     long                            reserved2;
  1167.     AuthIOCompletionUPP             ioCompletion;
  1168.     OSErr                           ioResult;
  1169.     unsigned long                   saveA5;
  1170.     short                           reqCode;
  1171.     long                            reserved[2];
  1172.     AddrBlock                       serverHint;
  1173.     short                           dsRefNum;
  1174.     unsigned long                   callID;
  1175.     AuthIdentity                    identity;
  1176.     long                            gReserved1;
  1177.     long                            gReserved2;
  1178.     long                            gReserved3;
  1179.     long                            clientData;
  1180.     CreationID                      directoryRecordCID;         /*  --> CreationID for the catalog */
  1181.     RecordIDPtr                     recordID;                   /*  --> recordID for the identity */
  1182.     RStringPtr                      password;                   /*  --> password in the catalog world */
  1183.     RStringPtr                      newPassword;                /*  --> new password in the catalog */
  1184. };
  1185. typedef struct OCESetupChangeDirectoryInfoPB OCESetupChangeDirectoryInfoPB;
  1186. /*
  1187. kOCESetupRemoveDirectoryInfo:
  1188. Using this call an existing identity for a catalog under LocalIdentity umbrella
  1189. can be changed.
  1190. ASCreateLocalIdentity should have been done succesfully before making this call.
  1191. directoryRecordCID -> is the record creationID obtained when DirAddOCEDirectory or
  1192. */
  1193. struct OCESetupRemoveDirectoryInfoPB {
  1194.     void *                          qLink;
  1195.     long                            reserved1;
  1196.     long                            reserved2;
  1197.     AuthIOCompletionUPP             ioCompletion;
  1198.     OSErr                           ioResult;
  1199.     unsigned long                   saveA5;
  1200.     short                           reqCode;
  1201.     long                            reserved[2];
  1202.     AddrBlock                       serverHint;
  1203.     short                           dsRefNum;
  1204.     unsigned long                   callID;
  1205.     AuthIdentity                    identity;
  1206.     long                            gReserved1;
  1207.     long                            gReserved2;
  1208.     long                            gReserved3;
  1209.     long                            clientData;
  1210.     CreationID                      directoryRecordCID;         /*  --> CreationID for the catalog */
  1211. };
  1212. typedef struct OCESetupRemoveDirectoryInfoPB OCESetupRemoveDirectoryInfoPB;
  1213. /*
  1214. kOCESetupGetDirectoryInfo:
  1215. Using this call info on an existing identity for a particular catalog under LocalIdentity umbrella
  1216. can be obtained.
  1217. For the specified catalog 'directoryName' and 'discriminator', rid and nativeName will
  1218. returned. Caller must provide appropriate buffer to get back rid and nativeName.
  1219. 'password' will be returned  for  non-ADAP Catalogs.
  1220. */
  1221. struct OCESetupGetDirectoryInfoPB {
  1222.     void *                          qLink;
  1223.     long                            reserved1;
  1224.     long                            reserved2;
  1225.     AuthIOCompletionUPP             ioCompletion;
  1226.     OSErr                           ioResult;
  1227.     unsigned long                   saveA5;
  1228.     short                           reqCode;
  1229.     long                            reserved[2];
  1230.     AddrBlock                       serverHint;
  1231.     short                           dsRefNum;
  1232.     unsigned long                   callID;
  1233.     AuthIdentity                    identity;
  1234.     long                            gReserved1;
  1235.     long                            gReserved2;
  1236.     long                            gReserved3;
  1237.     long                            clientData;
  1238.     DirectoryNamePtr                directoryName;              /*  --> catalog name */
  1239.     DirDiscriminator                discriminator;              /*  --> discriminator for the catalog */
  1240.     RecordIDPtr                     recordID;                   /* <--  rid for the catalog identity */
  1241.     RStringPtr                      nativeName;                 /* <--  user name in the catalog world */
  1242.     RStringPtr                      password;                   /* <--  password in the catalog world */
  1243. };
  1244. typedef struct OCESetupGetDirectoryInfoPB OCESetupGetDirectoryInfoPB;
  1245. /*****************************************************************************
  1246.         Catalog Manager operations
  1247. *****************************************************************************/
  1248. typedef union DirParamBlock             DirParamBlock;
  1249. typedef DirParamBlock *                 DirParamBlockPtr;
  1250. typedef CALLBACK_API( void , DirIOCompletionProcPtr )(DirParamBlockPtr paramBlock);
  1251. /*
  1252.     WARNING: DirIOCompletionProcPtr uses register based parameters under classic 68k
  1253.              and cannot be written in a high-level language without 
  1254.              the help of mixed mode or assembly glue.
  1255. */
  1256. typedef REGISTER_UPP_TYPE(DirIOCompletionProcPtr)               DirIOCompletionUPP;
  1257. /* AddRecord */
  1258. struct DirAddRecordPB {
  1259.     void *                          qLink;
  1260.     long                            reserved1;
  1261.     long                            reserved2;
  1262.     DirIOCompletionUPP              ioCompletion;
  1263.     OSErr                           ioResult;
  1264.     unsigned long                   saveA5;
  1265.     short                           reqCode;
  1266.     long                            reserved[2];
  1267.     AddrBlock                       serverHint;
  1268.     short                           dsRefNum;
  1269.     unsigned long                   callID;
  1270.     AuthIdentity                    identity;
  1271.     long                            gReserved1;
  1272.     long                            gReserved2;
  1273.     long                            gReserved3;
  1274.     long                            clientData;
  1275.     RecordIDPtr                     aRecord;                    /*  --> CreationID returned here */
  1276.     Boolean                         allowDuplicate;             /*  --> */
  1277.     Boolean                         filler1;
  1278. };
  1279. typedef struct DirAddRecordPB           DirAddRecordPB;
  1280. /* DeleteRecord */
  1281. struct DirDeleteRecordPB {
  1282.     void *                          qLink;
  1283.     long                            reserved1;
  1284.     long                            reserved2;
  1285.     DirIOCompletionUPP              ioCompletion;
  1286.     OSErr                           ioResult;
  1287.     unsigned long                   saveA5;
  1288.     short                           reqCode;
  1289.     long                            reserved[2];
  1290.     AddrBlock                       serverHint;
  1291.     short                           dsRefNum;
  1292.     unsigned long                   callID;
  1293.     AuthIdentity                    identity;
  1294.     long                            gReserved1;
  1295.     long                            gReserved2;
  1296.     long                            gReserved3;
  1297.     long                            clientData;
  1298.     RecordIDPtr                     aRecord;                    /*  --> */
  1299. };
  1300. typedef struct DirDeleteRecordPB        DirDeleteRecordPB;
  1301. /* aRecord must contain valid PackedRLI and a CreationID. */
  1302. /**********************************************************************************/
  1303. /*
  1304. DirEnumerate:
  1305. This call can be used to enumerate both DNodes and records under a specified
  1306. DNode. A DNode is specified by the PackedRLIPtr 'aRLI'.
  1307. startingPoint indicates where to start the enumeration.  Initially,
  1308. it should be set to a value of nil.  After some records are enumerated,
  1309. the client can issue the call again with the same aRLI and recordName and
  1310. typeList. The last received DirEnumSpec in the startingPoint field.  The server
  1311. will continue the enumeration from that record on. if user wants to get back the
  1312. value specified in the startingRecord also, the Boolean 'includeStartingPoint'
  1313. must be set to 'true'. If this is set to 'false', records specified after the
  1314. startingPoint record will be returned.
  1315. sortBy indicates to the server to return the records that match in name-first
  1316. or type-first order.  sortDirection indicates to the server to search in forward
  1317. or backward sort order for RecordIDs Specified.
  1318. RecordIDS and Enumeration Criteria:
  1319. PackedRLIPtr parameter 'aRLI' will be accepted for DNode
  1320. specification.
  1321. One RStringPtr 'nameMatchString' is provided. User is allowed to
  1322. specify a wild card in the name. WildCard specification is specified in 
  1323. matchNameHow parameter and possible values are defined in DirMatchWith Enum.
  1324. 'typeCount' parameter indicate how many types are in the 'typeList'.
  1325. 'typeList' parmeter is a pointer to an RString array of size 'typeCount'.
  1326. If 'typeCount' is exactly equal to one, a wild card can be specified
  1327. for the entity type; otherwise types have to be completely specified.
  1328. WildCard specification is specified in  matchNameHow parameter
  1329.  and possible values are defined in DirMatchWith Enum.
  1330. A nil value for 'startingPoint' is allowed when sortDirection specified
  1331. is 'kSortBackwards'. This was not allowed previously.
  1332. 'enumFlags' parameter is a bit field. The following bits can be set:
  1333.     kEnumDistinguishedNameMask to get back records in the cluster data base.
  1334.     kEnumAliasMask to get back record aliases
  1335.     kEnumPseudonymMask to get back record pseudonyms
  1336.     kEnumDNodeMask to get back any children dNodes for the DNode specified in the
  1337.     'aRLI' parameter.
  1338.     kEnumForeignDNodeMask to get back any children dNodes which have ForeignDnodes in the
  1339.     dNode specified in the 'aRLI' parameter.
  1340.     kEnumAll is combination of all five values and can be used to enumerate
  1341.     everything under a specified DNode.
  1342. The results returned for each element will consist of a DirEnumSpec.
  1343. The DirEnumSpec contains 'enumFlag' which indicates the type of entity and a
  1344. union which will have either DNodeID or LocalRecordID depending on the value of 'enumFlag'.
  1345. The 'enumFlag'  will indicate whether the returned element is a
  1346. record(kEnumDistinguishedNameMask bit) or a alias(kEnumAliasMask bit) or a
  1347. Pseudonym(kEnumPseudonymMask) or a child DNode(kEnumDNodeMask bit).  If the 'enumFlag' value
  1348. is kEnumDnodeMask, it indicates the value returned in the union is a DNodeID (i.e. 'dNodeNumber'
  1349. is the 'dNodeNumber' of the child dnode(if the catalog supports dNodeNumbers, otherwise
  1350. this will be set to zero). The name will be the child dnode name. For other values of the
  1351. 'enumFlag', the value in the union will be LocalRecordID. In addition to kEnumDnodeMask it is
  1352. possible that kEnumForeignDNodeMask is also set. This is an advisory bit and application must make
  1353. it's own decision before displaying these records. If catalog supports kSupportIndexRatioMask, it
  1354. may also return the relative position of the record (percentile of total records) in the 
  1355. indexRatio field in EnumSpec.
  1356. responseSLRV will contain the script, language, region and version of the oce sorting software.
  1357. The results will be collected in the 'getBuffer' supplied by the user.
  1358. If buffer can not hold all the data returned 'kOCEMoreData' error will be returned.
  1359. If user receives 'noErr' or 'kOCEMoreData', buffer will contain valid results. A user
  1360. can extract the results in the 'getBuffer' by making DirEnumerateParse' call.
  1361. */
  1362. struct DirEnumerateGetPB {
  1363.     void *                          qLink;
  1364.     long                            reserved1;
  1365.     long                            reserved2;
  1366.     DirIOCompletionUPP              ioCompletion;
  1367.     OSErr                           ioResult;
  1368.     unsigned long                   saveA5;
  1369.     short                           reqCode;
  1370.     long                            reserved[2];
  1371.     AddrBlock                       serverHint;
  1372.     short                           dsRefNum;
  1373.     unsigned long                   callID;
  1374.     AuthIdentity                    identity;
  1375.     long                            gReserved1;
  1376.     long                            gReserved2;
  1377.     long                            gReserved3;
  1378.     long                            clientData;
  1379.     PackedRLIPtr                    aRLI;                       /*  --> an RLI specifying the cluster to be enumerated */
  1380.     DirEnumSpec *                   startingPoint;              /*  --> */
  1381.     DirSortOption                   sortBy;                     /*  --> */
  1382.     DirSortDirection                sortDirection;              /*  --> */
  1383.     long                            dReserved;                  /*  --  */
  1384.     RStringPtr                      nameMatchString;            /*  --> name from which enumeration should start */
  1385.     RStringPtr *                    typesList;                  /*  --> list of entity types to be enumerated */
  1386.     unsigned long                   typeCount;                  /*  --> number of types in the list */
  1387.     DirEnumChoices                  enumFlags;                  /*  --> indicates what to enumerate */
  1388.     Boolean                         includeStartingPoint;       /*  --> if true return the record specified in starting point */
  1389.     Byte                            padByte;
  1390.     DirMatchWith                    matchNameHow;               /*  --> Matching Criteria for nameMatchString */
  1391.     DirMatchWith                    matchTypeHow;               /*  --> Matching Criteria for typeList */
  1392.     void *                          getBuffer;                  /*  --> */
  1393.     unsigned long                   getBufferSize;              /*  --> */
  1394.     SLRV                            responseSLRV;               /*  <--  response SLRV */
  1395. };
  1396. typedef struct DirEnumerateGetPB        DirEnumerateGetPB;
  1397. /* The EnumerateRecords call-back function is defined as follows: */
  1398. typedef CALLBACK_API( Boolean , ForEachDirEnumSpecProcPtr )(long clientData, const DirEnumSpec *enumSpec);
  1399. typedef STACK_UPP_TYPE(ForEachDirEnumSpecProcPtr)               ForEachDirEnumSpecUPP;
  1400. typedef ForEachDirEnumSpecUPP           ForEachDirEnumSpec;
  1401. /*
  1402. EnumerateParse:
  1403. After an EnumerateGet call has completed, call EnumerateParse
  1404. to parse through the buffer that was filled in EnumerateGet.
  1405. 'eachEnumSpec' will be called each time to return to the client a
  1406. DirEnumSpec that matches the pattern for enumeration. 'enumFlag' indicates the type
  1407. of information returned in the DirEnumSpec
  1408. The clientData parameter that you pass in the parameter block will be passed
  1409. to 'forEachEnumDSSpecFunc'.  You are free to put anything in clientData - it is intended
  1410. to allow you some way to match the call-back to the original call (for
  1411. example, you make more then one aysynchronous EnumerateGet calls and you want to
  1412. associate returned results in some way).
  1413. The client should return FALSE from 'eachEnumSpec' to continue
  1414. processing of the EnumerateParse request.  Returning TRUE will
  1415. terminate the EnumerateParse request.
  1416. For synchronous calls, the call-back routine actually runs as part of the same thread
  1417. of execution as the thread that made the EnumerateParse call.  That means that the
  1418. same low-memory globals, A5, stack, etc. are in effect during the call-back
  1419. that were in effect when the call was made.  Because of this, the call-back
  1420. routine has the same restrictions as the caller of EnumerateParse:
  1421. if EnumerateParse was not called from interrupt level, then the call-
  1422. back routine can allocate memory. For asynchronous calls, call-back routine is
  1423. like a ioCompletion except that A5 will be preserved for the application.
  1424. */
  1425. struct DirEnumerateParsePB {
  1426.     void *                          qLink;
  1427.     long                            reserved1;
  1428.     long                            reserved2;
  1429.     DirIOCompletionUPP              ioCompletion;
  1430.     OSErr                           ioResult;
  1431.     unsigned long                   saveA5;
  1432.     short                           reqCode;
  1433.     long                            reserved[2];
  1434.     AddrBlock                       serverHint;
  1435.     short                           dsRefNum;
  1436.     unsigned long                   callID;
  1437.     AuthIdentity                    identity;
  1438.     long                            gReserved1;
  1439.     long                            gReserved2;
  1440.     long                            gReserved3;
  1441.     long                            clientData;
  1442.     PackedRLIPtr                    aRLI;                       /*  --> an RLI specifying the cluster to be enumerated */
  1443.     long                            bReserved;                  /*  --  */
  1444.     long                            cReserved;                  /*  --  */
  1445.     ForEachDirEnumSpec              eachEnumSpec;               /*  --> */
  1446.     long                            eReserved;                  /*  --  */
  1447.     long                            fReserved;                  /*  --  */
  1448.     long                            gReserved;                  /*  --  */
  1449.     long                            hReserved;                  /*  --  */
  1450.     long                            iReserved;                  /*  --  */
  1451.     void *                          getBuffer;                  /*  --> */
  1452.     unsigned long                   getBufferSize;              /*  --> */
  1453.     short                           l1Reserved;                 /*  -- */
  1454.     short                           l2Reserved;                 /*  --  */
  1455.     short                           l3Reserved;                 /*  -- */
  1456.     short                           l4Reserved;                 /*  --  */
  1457. };
  1458. typedef struct DirEnumerateParsePB      DirEnumerateParsePB;
  1459. /*
  1460.  * FindRecordGet operates similarly to DirEnumerate except it returns a list
  1461.  * of records instead of records local to a cluster.
  1462. */
  1463. struct DirFindRecordGetPB {
  1464.     void *                          qLink;
  1465.     long                            reserved1;
  1466.     long                            reserved2;
  1467.     DirIOCompletionUPP              ioCompletion;
  1468.     OSErr                           ioResult;
  1469.     unsigned long                   saveA5;
  1470.     short                           reqCode;
  1471.     long                            reserved[2];
  1472.     AddrBlock                       serverHint;
  1473.     short                           dsRefNum;
  1474.     unsigned long                   callID;
  1475.     AuthIdentity                    identity;
  1476.     long                            gReserved1;
  1477.     long                            gReserved2;
  1478.     long                            gReserved3;
  1479.     long                            clientData;
  1480.     RecordIDPtr                     startingPoint;
  1481.     long                            reservedA[2];
  1482.     RStringPtr                      nameMatchString;
  1483.     RStringPtr *                    typesList;
  1484.     unsigned long                   typeCount;
  1485.     long                            reservedB;
  1486.     short                           reservedC;
  1487.     DirMatchWith                    matchNameHow;
  1488.     DirMatchWith                    matchTypeHow;
  1489.     void *                          getBuffer;
  1490.     unsigned long                   getBufferSize;
  1491.     DirectoryNamePtr                directoryName;
  1492.     DirDiscriminator                discriminator;
  1493. };
  1494. typedef struct DirFindRecordGetPB       DirFindRecordGetPB;
  1495. /* The FindRecordParse call-back function is defined as follows: */
  1496. typedef CALLBACK_API( Boolean , ForEachRecordProcPtr )(long clientData, const DirEnumSpec *enumSpec, PackedRLIPtr pRLI);
  1497. typedef STACK_UPP_TYPE(ForEachRecordProcPtr)                    ForEachRecordUPP;
  1498. typedef ForEachRecordUPP                ForEachRecord;
  1499. /*
  1500.  * This PB same as DirFindRecordGet except it includes the callback function
  1501. */
  1502. struct DirFindRecordParsePB {
  1503.     void *                          qLink;
  1504.     long                            reserved1;
  1505.     long                            reserved2;
  1506.     DirIOCompletionUPP              ioCompletion;
  1507.     OSErr                           ioResult;
  1508.     unsigned long                   saveA5;
  1509.     short                           reqCode;
  1510.     long                            reserved[2];
  1511.     AddrBlock                       serverHint;
  1512.     short                           dsRefNum;
  1513.     unsigned long                   callID;
  1514.     AuthIdentity                    identity;
  1515.     long                            gReserved1;
  1516.     long                            gReserved2;
  1517.     long                            gReserved3;
  1518.     long                            clientData;
  1519.     RecordIDPtr                     startingPoint;
  1520.     long                            reservedA[2];
  1521.     RStringPtr                      nameMatchString;
  1522.     RStringPtr *                    typesList;
  1523.     unsigned long                   typeCount;
  1524.     long                            reservedB;
  1525.     short                           reservedC;
  1526.     DirMatchWith                    matchNameHow;
  1527.     DirMatchWith                    matchTypeHow;
  1528.     void *                          getBuffer;
  1529.     unsigned long                   getBufferSize;
  1530.     DirectoryNamePtr                directoryName;
  1531.     DirDiscriminator                discriminator;
  1532.     ForEachRecord                   forEachRecordFunc;
  1533. };
  1534. typedef struct DirFindRecordParsePB     DirFindRecordParsePB;
  1535. /*
  1536. LookupGet:
  1537. aRecordList is an array of pointers to RecordIDs, each of which must
  1538. contain valid PackedRLI and a CreationID.  recordIDCount is
  1539. the size of this array.
  1540. attrTypeList is an array of pointers to AttributeTypes.  attrTypeCount is
  1541. the size of this array.
  1542. staringRecordIndex is the record from which to continue the lookup.
  1543. If you want to start from first record in the list, this must be 1 (not zero).
  1544. This value must always be <= recordIDCount.
  1545. startingAttributeIndex is the AttributeType from which we want to continue the lookup.
  1546. If you want to start from first attribute in the list, this must be 1 (not zero).
  1547. This value must always be <= attrTypeCount.
  1548. startingAttribute is the value of the attribute value from which we want to
  1549. continue lookup. In case of catalogs supporting creationIDs, startingAttribute
  1550. may contain only a CID. Other catalogs may require the entire value.
  1551. If a non-null cid is given and if an attribute value with that cid is not found, this
  1552. call will terminate with kOCENoSuchAttribute error. A client should not make a LookupParse call
  1553. after getting this error.
  1554. 'includeStartingPoint' boolean can be set to 'true' to receive the value specified in the
  1555. startingPoint in the results returned. If this is set to 'false', the value
  1556. specified in the startingAttribute will not be returned.
  1557. When LookupGet call fails with kOCEMoreData, the client will be able to find out where the call ended
  1558. with a subsequent LookupParse call. When the LookupParse call completes with kOCEMoreData,
  1559. lastRecordIndex, lastAttributeIndex and lastValueCID will point to the corresponding
  1560. recordID, attributeType and the CreationID of the last value returned successfully. These parameters
  1561. are exactly the same ones for the startingRecordIndex, startingAttributeIndex, and startingAttrValueCID
  1562. so they can be used in a subsequent LookupGet call to continue the lookup.
  1563. In an extreme case, It is possible that we had an attribute value that is too large to fit
  1564. in the client's buffer. In such cases, if it was the only thing that we tried to fit
  1565. into the buffer, the client will not able to proceed further because he will not know the
  1566. attributeCID of the attribute to continue with.  Also he does not know how big a buffer
  1567. would be needed for the next call to get this 'mondo' attribute value successfully.
  1568. to support this, LookupParse call will do the following:
  1569. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  1570. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  1571. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  1572. However, if it was not even called once, then the attribute value may be too big to fit in the
  1573. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  1574. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  1575. ForEachAttributeValue was not called because the user does not have read access to some of
  1576. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  1577. any of the attribute values.  A kOCEMoreData error is returned.
  1578. The Toolbox will check for duplicate RecordIDs in the aRecordList. If found, it will return
  1579. 'daDuplicateRecordIDErr'.
  1580. The Toolbox will check for duplicate AttributeTypes in the attrTypeList. If found it will
  1581. return 'daDuplicateAttrTypeErr'.
  1582. */
  1583. struct DirLookupGetPB {
  1584.     void *                          qLink;
  1585.     long                            reserved1;
  1586.     long                            reserved2;
  1587.     DirIOCompletionUPP              ioCompletion;
  1588.     OSErr                           ioResult;
  1589.     unsigned long                   saveA5;
  1590.     short                           reqCode;
  1591.     long                            reserved[2];
  1592.     AddrBlock                       serverHint;
  1593.     short                           dsRefNum;
  1594.     unsigned long                   callID;
  1595.     AuthIdentity                    identity;
  1596.     long                            gReserved1;
  1597.     long                            gReserved2;
  1598.     long                            gReserved3;
  1599.     long                            clientData;
  1600.     RecordIDPtr *                   aRecordList;                /*  --> an array of RecordID pointers */
  1601.     AttributeTypePtr *              attrTypeList;               /*  --> an array of attribute types */
  1602.     long                            cReserved;                  /*  --  */
  1603.     long                            dReserved;                  /*  --  */
  1604.     long                            eReserved;                  /*  --  */
  1605.     long                            fReserved;                  /*  --  */
  1606.     unsigned long                   recordIDCount;              /*  --> */
  1607.     unsigned long                   attrTypeCount;              /*  --> */
  1608.     Boolean                         includeStartingPoint;       /*  --> if true return the value specified by the starting indices */
  1609.     Byte                            padByte;
  1610.     short                           i1Reserved;                 /*  --  */
  1611.     void *                          getBuffer;                  /*  --> */
  1612.     unsigned long                   getBufferSize;              /*  --> */
  1613.     unsigned long                   startingRecordIndex;        /*  --> start from this record */
  1614.     unsigned long                   startingAttrTypeIndex;      /*  --> start from this attribute type */
  1615.     Attribute                       startingAttribute;          /*  --> start from this attribute value */
  1616.     long                            pReserved;                  /*  --  */
  1617. };
  1618. typedef struct DirLookupGetPB           DirLookupGetPB;
  1619. /* The Lookup call-back functions are defined as follows: */
  1620. typedef CALLBACK_API( Boolean , ForEachLookupRecordIDProcPtr )(long clientData, const RecordID *recordID);
  1621. typedef STACK_UPP_TYPE(ForEachLookupRecordIDProcPtr)            ForEachLookupRecordIDUPP;
  1622. typedef ForEachLookupRecordIDUPP        ForEachLookupRecordID;
  1623. typedef CALLBACK_API( Boolean , ForEachAttrTypeLookupProcPtr )(long clientData, const AttributeType *attrType, AccessMask myAttrAccMask);
  1624. typedef STACK_UPP_TYPE(ForEachAttrTypeLookupProcPtr)            ForEachAttrTypeLookupUPP;
  1625. typedef ForEachAttrTypeLookupUPP        ForEachAttrTypeLookup;
  1626. typedef CALLBACK_API( Boolean , ForEachAttrValueProcPtr )(long clientData, const Attribute *attribute);
  1627. typedef STACK_UPP_TYPE(ForEachAttrValueProcPtr)                 ForEachAttrValueUPP;
  1628. typedef ForEachAttrValueUPP             ForEachAttrValue;
  1629. /*
  1630. LookupParse:
  1631. After a LookupGet call has completed, call LookupParse
  1632. to parse through the buffer that was filled in LookupGet.  The
  1633. toolbox will parse through the buffer and call the appropriate call-back routines
  1634. for each item in the getBuffer.
  1635. 'eachRecordID' will be called each time to return to the client one of the
  1636. RecordIDs from aRecordList.  The clientData parameter that you
  1637. pass in the parameter block will be passed to eachRecordID.
  1638. You are free to put anything in clientData - it is intended to allow
  1639. you some way to match the call-back to the original call (in case, for
  1640. example, you make simultaneous asynchronous LookupGet calls).  If you don't
  1641. want to get a call-back for each RecordID (for example, if you're looking up
  1642. attributes for only one RecordID), pass nil for eachRecordID.
  1643. After forEachLocalRecordIDFunc is called, eachAttrType may be called to pass an
  1644. attribute type (one from attrTypeList) that exists in the record specified
  1645. in the last eachRecordID call.  If you don't want to get a call-back for
  1646. each AttributeType (for example, if you're looking up only one attribute type,
  1647. or you prefer to read the type from the Attribute struct during the eachAttrValue
  1648. call-back routine), pass nil for eachAttrType. However access controls may
  1649. prohibit you from reading some attribute types; in that case eachAttrValue
  1650. may not be called even though the value exists. Hence the client should
  1651. supply this call-back function to see the access controls for each attribute type.
  1652. This will be followed by one or more calls to eachAttrValue, to pass the
  1653. type, tag, and attribute value.  NOTE THIS CHANGE:  you are no longer expected to
  1654. pass a pointer to a buffer in which to put the value.  Now you get a pointer to
  1655. the value, and you can process it within the call-back routine.
  1656. After one or more values are returned, eachAttrType may be called again to pass
  1657. another attribute type that exists in the last-specified RecordID.
  1658. The client should return FALSE from eachRecordID, eachAttrType, and
  1659. eachAttrValue to continue processing of the LookupParse request.  Returning TRUE
  1660. from any call-back will terminate the LookupParse request.
  1661. If LookupGet has failed with kOCEMoreData error, LookupParse will check to make sure that
  1662. ForEachAttributeValueFunc has been called at least once. If so, the client has the option
  1663. to continue from that attribute CreationID (for PAB/ADAP) in the next LookupGet call.
  1664. However, if it was not even called once, then the attribute value may be too big to fit in the
  1665. user's buffer. In this case, lastAttrValueCID (lastAttribute) and attrSize are returned in the
  1666. parse buffer and the call will fail with kOCEMoreAttrValue. However, it is possible that
  1667. ForEachAttributeValue was not called because the user does not have read access to some of
  1668. the attributeTypes in the list, and the buffer was full before even reading the creationID of
  1669. any of the attribute values.  A kOCEMoreData error is returned.
  1670. For synchronous calls, the call-back routine actually runs as part of the same thread
  1671. of execution as the thread that made the LookupParse call.  That means that the
  1672. same low-memory globals, A5, stack, etc. are in effect during the call-back
  1673. that were in effect when the call was made.  Because of this, the call-back
  1674. routine has the same restrictions as the caller of LookupParse:
  1675. if LookupParse was not called from interrupt level, then the call-
  1676. back routine can allocate memory. For asynchronous calls, call-back routine is
  1677. like a ioCompletion except that A5 will be preserved for the application.
  1678. */
  1679. struct DirLookupParsePB {
  1680.     void *                          qLink;
  1681.     long                            reserved1;
  1682.     long                            reserved2;
  1683.     DirIOCompletionUPP              ioCompletion;
  1684.     OSErr                           ioResult;
  1685.     unsigned long                   saveA5;
  1686.     short                           reqCode;
  1687.     long                            reserved[2];
  1688.     AddrBlock                       serverHint;
  1689.     short                           dsRefNum;
  1690.     unsigned long                   callID;
  1691.     AuthIdentity                    identity;
  1692.     long                            gReserved1;
  1693.     long                            gReserved2;
  1694.     long                            gReserved3;
  1695.     long                            clientData;
  1696.     RecordIDPtr *                   aRecordList;                /*  --> must be same from the corresponding Get call */
  1697.     AttributeTypePtr *              attrTypeList;               /*  --> must be same from the corresponding Get call */
  1698.     long                            cReserved;                  /*  --  */
  1699.     ForEachLookupRecordID           eachRecordID;               /*  --> */
  1700.     ForEachAttrTypeLookup           eachAttrType;               /*  --> */
  1701.     ForEachAttrValue                eachAttrValue;              /*  --> */
  1702.     unsigned long                   recordIDCount;              /*  --> must be same from the corresponding Get call */
  1703.     unsigned long                   attrTypeCount;              /*  --> must be same from the corresponding Get call */
  1704.     long                            iReserved;                  /*  --  */
  1705.     void *                          getBuffer;                  /*  --> must be same from the corresponding Get call*/
  1706.     unsigned long                   getBufferSize;              /*  --> must be same from the corresponding Get call*/
  1707.     unsigned long                   lastRecordIndex;            /* <--  last RecordID processed when parse completed */
  1708.     unsigned long                   lastAttributeIndex;         /* <--  last Attribute Type processed when parse completed */
  1709.     Attribute                       lastAttribute;              /* <--  last attribute value (with this CreationID) processed when parse completed */
  1710.     unsigned long                   attrSize;                   /* <--  length of the attribute we did not return */
  1711. };
  1712. typedef struct DirLookupParsePB         DirLookupParsePB;
  1713. /* AddAttributeValue */
  1714. struct DirAddAttributeValuePB {
  1715.     void *                          qLink;
  1716.     long                            reserved1;
  1717.     long                            reserved2;
  1718.     DirIOCompletionUPP              ioCompletion;
  1719.     OSErr                           ioResult;
  1720.     unsigned long                   saveA5;
  1721.     short                           reqCode;
  1722.     long                            reserved[2];
  1723.     AddrBlock                       serverHint;
  1724.     short                           dsRefNum;
  1725.     unsigned long                   callID;
  1726.     AuthIdentity                    identity;
  1727.     long                            gReserved1;
  1728.     long                            gReserved2;
  1729.     long                            gReserved3;
  1730.     long                            clientData;
  1731.     RecordIDPtr                     aRecord;                    /*  --> */
  1732.     AttributePtr                    attr;                       /*  --> AttributeCreationID returned here */
  1733. };
  1734. typedef struct DirAddAttributeValuePB   DirAddAttributeValuePB;
  1735. /*
  1736. aRecord must contain valid PackedRLI and a CreationID.
  1737. Instead of passing type, length, and value in three separate
  1738. fields, we take a pointer to an Attribute structure that contains
  1739. all three, and has room for the AttributeCreationNumber.
  1740. The AttributeCreationID will be returned in the attr itself.
  1741. The AttributeTag tells the catalog service that the attribute is an RString,
  1742. binary, or a RecordID.
  1743. */
  1744. /*
  1745. DeleteAttributeType:
  1746. This call is provided so that an existing AttributeType can be deleted.
  1747. If any attribute values exist for this type, they will all be deleted
  1748. (if the user has access rights to delete the values) and then the attribute type
  1749. will be deleted. Otherwise dsAccessDenied error will be returned.
  1750. */
  1751. struct DirDeleteAttributeTypePB {
  1752.     void *                          qLink;
  1753.     long                            reserved1;
  1754.     long                            reserved2;
  1755.     DirIOCompletionUPP              ioCompletion;
  1756.     OSErr                           ioResult;
  1757.     unsigned long                   saveA5;
  1758.     short                           reqCode;
  1759.     long                            reserved[2];
  1760.     AddrBlock                       serverHint;
  1761.     short                           dsRefNum;
  1762.     unsigned long                   callID;
  1763.     AuthIdentity                    identity;
  1764.     long                            gReserved1;
  1765.     long                            gReserved2;
  1766.     long                            gReserved3;
  1767.     long                            clientData;
  1768.     RecordIDPtr                     aRecord;                    /*  --> */
  1769.     AttributeTypePtr                attrType;                   /*  --> */
  1770. };
  1771. typedef struct DirDeleteAttributeTypePB DirDeleteAttributeTypePB;
  1772. /*
  1773.     DeleteAttributeValue
  1774. */
  1775. struct DirDeleteAttributeValuePB {
  1776.     void *                          qLink;
  1777.     long                            reserved1;
  1778.     long                            reserved2;
  1779.     DirIOCompletionUPP              ioCompletion;
  1780.     OSErr                           ioResult;
  1781.     unsigned long                   saveA5;
  1782.     short                           reqCode;
  1783.     long                            reserved[2];
  1784.     AddrBlock                       serverHint;
  1785.     short                           dsRefNum;
  1786.     unsigned long                   callID;
  1787.     AuthIdentity                    identity;
  1788.     long                            gReserved1;
  1789.     long                            gReserved2;
  1790.     long                            gReserved3;
  1791.     long                            clientData;
  1792.     RecordIDPtr                     aRecord;                    /*  -> */
  1793.     AttributePtr                    attr;                       /*  -> */
  1794. };
  1795. typedef struct DirDeleteAttributeValuePB DirDeleteAttributeValuePB;
  1796. /*
  1797.     ChangeAttributeValue:
  1798.     currentAttr ==> the attribute to be changed. For ADAS and PAB CreationID is
  1799.                     sufficient
  1800.     newAttr     ==> new value for the attribute. For ADAS and PAB 
  1801.                     CreationID field will be set when
  1802.                     the call succeesfully completes
  1803.     
  1804.     aRecord     ==> must contain valid PackedRecordLocationInfo and a CreationID.
  1805.     
  1806. */
  1807. struct DirChangeAttributeValuePB {
  1808.     void *                          qLink;
  1809.     long                            reserved1;
  1810.     long                            reserved2;
  1811.     DirIOCompletionUPP              ioCompletion;
  1812.     OSErr                           ioResult;
  1813.     unsigned long                   saveA5;
  1814.     short                           reqCode;
  1815.     long                            reserved[2];
  1816.     AddrBlock                       serverHint;
  1817.     short                           dsRefNum;
  1818.     unsigned long                   callID;
  1819.     AuthIdentity                    identity;
  1820.     long                            gReserved1;
  1821.     long                            gReserved2;
  1822.     long                            gReserved3;
  1823.     long                            clientData;
  1824.     RecordIDPtr                     aRecord;                    /*  -> */
  1825.     AttributePtr                    currentAttr;                /*  -> */
  1826.     AttributePtr                    newAttr;                    /*  -> */
  1827. };
  1828. typedef struct DirChangeAttributeValuePB DirChangeAttributeValuePB;
  1829. /* VerifyAttributeValue */
  1830. struct DirVerifyAttributeValuePB {
  1831.     void *                          qLink;
  1832.     long                            reserved1;
  1833.     long                            reserved2;
  1834.     DirIOCompletionUPP              ioCompletion;
  1835.     OSErr                           ioResult;
  1836.     unsigned long                   saveA5;
  1837.     short                           reqCode;
  1838.     long                            reserved[2];
  1839.     AddrBlock                       serverHint;
  1840.     short                           dsRefNum;
  1841.     unsigned long                   callID;
  1842.     AuthIdentity                    identity;
  1843.     long                            gReserved1;
  1844.     long                            gReserved2;
  1845.     long                            gReserved3;
  1846.     long                            clientData;
  1847.     RecordIDPtr                     aRecord;                    /*  --> */
  1848.     AttributePtr                    attr;                       /*  --> */
  1849. };
  1850. typedef struct DirVerifyAttributeValuePB DirVerifyAttributeValuePB;
  1851. /*
  1852. aRecord must contain valid PackedRLI and a CreationID.
  1853. The attribute type and value are passed in the attribute structure.  If the
  1854. attribute CreationID is non-zero, the server will verify that an attribute with
  1855. the specified value and creation number exists in aRecord.  If the attribute
  1856. CreationID is zero, the server will verify the attribute by type and value
  1857. alone, and return the attribute CreationID in the Attribute struct if the
  1858. attribute exists.
  1859. */
  1860. /*
  1861. EnumerateAttributeTypesGet:
  1862. The following two calls can be used to enumerate the attribute types present in
  1863. a specified RecordID.  The first, EnumerateAttributeTypesGet, processes the request
  1864. and reads the response into getBuffer, as much as will fit.  A kOCEMoreData error will
  1865. be returned if the buffer was not large enough.  After this call completes, the
  1866. client can call EnumerateAttributeTypesParse (see below).
  1867. The user will able to continue from a startingPoint by setting a startingAttrType.
  1868. Typically, this should be the last value returned in EnumerateAttributeTypesParse call
  1869. when 'kOCEMoreData' is returned.
  1870. If 'includeStartingPoint' is true when a 'startingAttrType' is specified, the starting value
  1871. will be included in the results, if it exists. If this is set to false, this value will not
  1872. be included. AttributeTypes following this type will be returned.
  1873. */
  1874. struct DirEnumerateAttributeTypesGetPB {
  1875.     void *                          qLink;
  1876.     long                            reserved1;
  1877.     long                            reserved2;
  1878.     DirIOCompletionUPP              ioCompletion;
  1879.     OSErr                           ioResult;
  1880.     unsigned long                   saveA5;
  1881.     short                           reqCode;
  1882.     long                            reserved[2];
  1883.     AddrBlock                       serverHint;
  1884.     short                           dsRefNum;
  1885.     unsigned long                   callID;
  1886.     AuthIdentity                    identity;
  1887.     long                            gReserved1;
  1888.     long                            gReserved2;
  1889.     long                            gReserved3;
  1890.     long                            clientData;
  1891.     RecordIDPtr                     aRecord;                    /*  --> */
  1892.     AttributeTypePtr                startingAttrType;           /*  --> starting point */
  1893.     long                            cReserved;                  /*  --  */
  1894.     long                            dReserved;                  /*  --  */
  1895.     long                            eReserved;                  /*  --  */
  1896.     long                            fReserved;                  /*  --  */
  1897.     long                            gReserved;                  /*  --  */
  1898.     long                            hReserved;                  /*  --  */
  1899.     Boolean                         includeStartingPoint;       /*  --> if true return the attrType specified by starting point */
  1900.     Byte                            padByte;
  1901.     short                           i1Reserved;                 /*  --  */
  1902.     void *                          getBuffer;                  /*  --> */
  1903.     unsigned long                   getBufferSize;              /*  --> */
  1904. };
  1905. typedef struct DirEnumerateAttributeTypesGetPB DirEnumerateAttributeTypesGetPB;
  1906. /* The call-back function is defined as follows: */
  1907. typedef CALLBACK_API( Boolean , ForEachAttrTypeProcPtr )(long clientData, const AttributeType *attrType);
  1908. typedef STACK_UPP_TYPE(ForEachAttrTypeProcPtr)                  ForEachAttrTypeUPP;
  1909. typedef ForEachAttrTypeUPP              ForEachAttrType;
  1910. /*
  1911. EnumerateAttributeTypesParse:
  1912. After an EnumerateAttributeTypesGet call has completed, call EnumerateAttributeTypesParse
  1913. to parse through the buffer that was filled in EnumerateAttributeTypesGet.  The
  1914. toolbox will parse through the buffer and call the call-back routine for
  1915. each attribute type in the getBuffer.
  1916. The client should return false from eachAttrType to continue
  1917. processing of the EnumerateAttributeTypesParse request.  Returning true will
  1918. terminate the EnumerateAttributeTypesParse request.  The clientData parameter that
  1919. you pass in the parameter block will be passed to eachAttrType.
  1920. You are free to put anything in clientData - it is intended to allow
  1921. you some way to match the call-back to the original call (in case, for
  1922. example, you make simultaneous asynchronous calls).
  1923. For synchronous calls, the call-back routine actually runs as part of the same thread
  1924. of execution as the thread that made the EnumerateAttributeTypesParse call.  That means that the
  1925. same low-memory globals, A5, stack, etc. are in effect during the call-back
  1926. that were in effect when the call was made.  Because of this, the call-back
  1927. routine has the same restrictions as the caller of EnumerateAttributeTypesParse.
  1928. If EnumerateAttributeTypesParse was not called from interrupt level, then the call-
  1929. back routine can allocate memory. For asynchronous calls, call-back routine is
  1930. like a ioCompletion except that A5 will be preserved for the application.
  1931. */
  1932. struct DirEnumerateAttributeTypesParsePB {
  1933.     void *                          qLink;
  1934.     long                            reserved1;
  1935.     long                            reserved2;
  1936.     DirIOCompletionUPP              ioCompletion;
  1937.     OSErr                           ioResult;
  1938.     unsigned long                   saveA5;
  1939.     short                           reqCode;
  1940.     long                            reserved[2];
  1941.     AddrBlock                       serverHint;
  1942.     short                           dsRefNum;
  1943.     unsigned long                   callID;
  1944.     AuthIdentity                    identity;
  1945.     long                            gReserved1;
  1946.     long                            gReserved2;
  1947.     long                            gReserved3;
  1948.     long                            clientData;
  1949.     RecordIDPtr                     aRecord;                    /*  --> Same as DirEnumerateAttributeTypesGetPB */
  1950.     long                            bReserved;                  /*  --  */
  1951.     long                            cReserved;                  /*  --  */
  1952.     long                            dReserved;                  /*  --  */
  1953.     ForEachAttrType                 eachAttrType;               /*  --> */
  1954.     long                            fReserved;                  /*  --  */
  1955.     long                            gReserved;                  /*  --  */
  1956.     long                            hReserved;                  /*  --  */
  1957.     long                            iReserved;                  /*  --  */
  1958.     void *                          getBuffer;                  /*  --> */
  1959.     unsigned long                   getBufferSize;              /*  --> */
  1960. };
  1961. typedef struct DirEnumerateAttributeTypesParsePB DirEnumerateAttributeTypesParsePB;
  1962. /*
  1963. DirAbort:
  1964. With this call a user will able to abort an outstanding catalog service call.
  1965. A user must pass a pointer to the parameter block for the outstanding call.
  1966. In the current version of the product, the toolbox will process this call
  1967. for NetSearchADAPDirectoriesGet or FindADAPDirectoryByNetSearch calls and if possible
  1968. it will abort. For other calls for ADAP and PAB this will return 'daAbortFailErr'.
  1969. For CSAM catalogs, this call will be passed to the corresponding CSAM driver.
  1970. The CSAM driver may process this call or may return 'daAbortFailErr'. This call can
  1971. be called only in synchronous mode. Since the abort call makes references to fields in
  1972. the pb associated with the original call, this pb must not be disposed or or altered if
  1973. the original call completes before the abort call has completed.
  1974. */
  1975. struct DirAbortPB {
  1976.     void *                          qLink;
  1977.     long                            reserved1;
  1978.     long                            reserved2;
  1979.     DirIOCompletionUPP              ioCompletion;
  1980.     OSErr                           ioResult;
  1981.     unsigned long                   saveA5;
  1982.     short                           reqCode;
  1983.     long                            reserved[2];
  1984.     AddrBlock                       serverHint;
  1985.     short                           dsRefNum;
  1986.     unsigned long                   callID;
  1987.     AuthIdentity                    identity;
  1988.     long                            gReserved1;
  1989.     long                            gReserved2;
  1990.     long                            gReserved3;
  1991.     long                            clientData;
  1992.     DirParamBlock *                 pb;                         /*  --> pb for the call which must be aborted */
  1993. };
  1994. typedef struct DirAbortPB               DirAbortPB;
  1995. /*
  1996. AddPseudonym:
  1997. An alternate name and type can be added to a given record. If allowDuplicate
  1998. is set the name and type will be added even if the same name and type already
  1999. exists.
  2000. */
  2001. struct DirAddPseudonymPB {
  2002.     void *                          qLink;
  2003.     long                            reserved1;
  2004.     long                            reserved2;
  2005.     DirIOCompletionUPP              ioCompletion;
  2006.     OSErr                           ioResult;
  2007.     unsigned long                   saveA5;
  2008.     short                           reqCode;
  2009.     long                            reserved[2];
  2010.     AddrBlock                       serverHint;
  2011.     short                           dsRefNum;
  2012.     unsigned long                   callID;
  2013.     AuthIdentity                    identity;
  2014.     long                            gReserved1;
  2015.     long                            gReserved2;
  2016.     long                            gReserved3;
  2017.     long                            clientData;
  2018.     RecordIDPtr                     aRecord;                    /*  --> RecordID to which pseudonym is to be added */
  2019.     RStringPtr                      pseudonymName;              /*  --> new name to be added as pseudonym */
  2020.     RStringPtr                      pseudonymType;              /*  --> new name to be added as pseudonym */
  2021.     Boolean                         allowDuplicate;             /*  --> */
  2022.     Boolean                         filler1;
  2023. };
  2024. typedef struct DirAddPseudonymPB        DirAddPseudonymPB;
  2025. /*
  2026. DeletePseudonym:
  2027. An alternate name and type for a given record can be deleted.
  2028. */
  2029. struct DirDeletePseudonymPB {
  2030.     void *                          qLink;
  2031.     long                            reserved1;
  2032.     long                            reserved2;
  2033.     DirIOCompletionUPP              ioCompletion;
  2034.     OSErr                           ioResult;
  2035.     unsigned long                   saveA5;
  2036.     short                           reqCode;
  2037.     long                            reserved[2];
  2038.     AddrBlock                       serverHint;
  2039.     short                           dsRefNum;
  2040.     unsigned long                   callID;
  2041.     AuthIdentity                    identity;
  2042.     long                            gReserved1;
  2043.     long                            gReserved2;
  2044.     long                            gReserved3;
  2045.     long                            clientData;
  2046.     RecordIDPtr                     aRecord;                    /*  --> RecordID to which pseudonym to be added */
  2047.     RStringPtr                      pseudonymName;              /*  --> pseudonymName to be deleted */
  2048.     RStringPtr                      pseudonymType;              /*  --> pseudonymType to be deleted */
  2049. };
  2050. typedef struct DirDeletePseudonymPB     DirDeletePseudonymPB;
  2051. /*
  2052.     AddAlias:
  2053.     This call can be used to create an alias  record. The alias
  2054.     can be created either in the same or different cluster. ADAS will not support
  2055.     this call for this release. A new catalog capability flag 'kSupportsAlias' will indicate
  2056.     if the catalog supports this call. PAB's will support this call. For the PAB implementation,
  2057.     this call will create a record with the name and type specified an aRecord.
  2058.     This call works exactly like AddRecord.
  2059.     If 'allowDuplicate' is false and another record with same name and type already exists
  2060.     'daNoDupAllowed' error will be returned.
  2061. */
  2062. struct DirAddAliasPB {
  2063.     void *                          qLink;
  2064.     long                            reserved1;
  2065.     long                            reserved2;
  2066.     DirIOCompletionUPP              ioCompletion;
  2067.     OSErr                           ioResult;
  2068.     unsigned long                   saveA5;
  2069.     short                           reqCode;
  2070.     long                            reserved[2];
  2071.     AddrBlock                       serverHint;
  2072.     short                           dsRefNum;
  2073.     unsigned long                   callID;
  2074.     AuthIdentity                    identity;
  2075.     long                            gReserved1;
  2076.     long                            gReserved2;
  2077.     long                            gReserved3;
  2078.     long                            clientData;
  2079.     RecordIDPtr                     aRecord;                    /*  -> */
  2080.     Boolean                         allowDuplicate;             /*  -> */
  2081.     Boolean                         filler1;
  2082. };
  2083. typedef struct DirAddAliasPB            DirAddAliasPB;
  2084. /*
  2085. DirFindValue:
  2086. This call can be used to find the occurrence of a value. The value
  2087. to be matched is passed in the buffer 'matchingData' field. The current
  2088. ADAP/PAB implementation will match a maximum of 32 bytes of data.
  2089. For attribute values in the PAB/ADAP implementation, only the first 32 bytes will
  2090. be used for comparing the occurrence of data. Search can be restricted to
  2091. a particular record and/or attribute type by specifying 'aRecord' or 'aType'.
  2092. After finding one occurrence, 'startingRecord' and 'startingAttribute'
  2093. can be specified to find the next occurrence of the same value.
  2094. 'sortDirection' can be specified with starting values to search forward or backward.
  2095. When a matching value is found, the 'recordFound' indicates the reccordID in which the
  2096. data occurrence was found, 'attributeFound' indicates the attribute with in which the
  2097. matching data was found. ADAP/PAB implementation returns only the type and creationID of
  2098. attributes. Catalogs which don't support creationIDs may return the
  2099. complete value; hence this call may need a buffer to hold the data. For ADAP/PAB implementations
  2100. the user has to make a DirLookup call to get the actual data. 'recordFound' and
  2101. 'attributeFound' can be used to initialize 'startingRecord' and 'startingAttribute' to
  2102. find the next occurrence of the value.
  2103. */
  2104. struct DirFindValuePB {
  2105.     void *                          qLink;
  2106.     long                            reserved1;
  2107.     long                            reserved2;
  2108.     DirIOCompletionUPP              ioCompletion;
  2109.     OSErr                           ioResult;
  2110.     unsigned long                   saveA5;
  2111.     short                           reqCode;
  2112.     long                            reserved[2];
  2113.     AddrBlock                       serverHint;
  2114.     short                           dsRefNum;
  2115.     unsigned long                   callID;
  2116.     AuthIdentity                    identity;
  2117.     long                            gReserved1;
  2118.     long                            gReserved2;
  2119.     long                            gReserved3;
  2120.     long                            clientData;
  2121.     PackedRLIPtr                    aRLI;                       /*  --> an RLI specifying the cluster to be enumerated */
  2122.     LocalRecordIDPtr                aRecord;                    /*  --> if not nil, look only in this record */
  2123.     AttributeTypePtr                attrType;                   /*  --> if not nil, look only in this attribute type */
  2124.     LocalRecordIDPtr                startingRecord;             /*  --> record in which to start searching */
  2125.     AttributePtr                    startingAttribute;          /*  --> attribute in which to start searching */
  2126.     LocalRecordIDPtr                recordFound;                /* <--  record in which data was found */
  2127.     Attribute                       attributeFound;             /* <--  attribute in which data was found */
  2128.     unsigned long                   matchSize;                  /*  --> length of matching bytes */
  2129.     void *                          matchingData;               /*  --> data bytes to be matched in search */
  2130.     DirSortDirection                sortDirection;              /*  --> sort direction (forwards or backwards) */
  2131. };
  2132. typedef struct DirFindValuePB           DirFindValuePB;
  2133. /*
  2134. EnumeratePseudonymGet:
  2135. This call can be used to enumerate the existing pseudonyms for
  2136. a given record specified in 'aRecord'. A starting point can be specified
  2137. by 'startingName' and 'startingType'. If the 'includeStartingPoint' boolean
  2138. is true and a starting point is specified, the name specified by startingName
  2139. and startingType also is returned in the results, if it exists. If this is set to false,
  2140. the pseudonym in startingName and Type is not included.
  2141. Pseudonyms returned in the 'getBuffer' can be extracted by making an
  2142. EnumeratePseudonymParse call. The results will consist of a RecordID with the
  2143. name and type of the pseudonym. If the buffer could not hold all the results, then
  2144. 'kOCEMoreData' error will be returned. The user will be able to continue the call by
  2145. using the last result returned as starting point for the next call.
  2146. */
  2147. struct DirEnumeratePseudonymGetPB {
  2148.     void *                          qLink;
  2149.     long                            reserved1;
  2150.     long                            reserved2;
  2151.     DirIOCompletionUPP              ioCompletion;