ADC Home > Reference Library > Reference > Networking > Mac OS X Server > Directory Service Framework Reference

 


DirServices.h

Includes:

Overview

Directory Services introduction text.



Functions

dsAddAttribute
dsAddAttributeValue
dsAddChildPIDToReference
dsCloseAttributeList
dsCloseAttributeValueList
dsCloseDirNode
dsCloseDirService
dsCloseRecord
dsCreateRecord
dsCreateRecordAndOpen
dsDeleteRecord
dsDoAttributeValueSearch
dsDoAttributeValueSearchWithData
dsDoDirNodeAuth
dsDoDirNodeAuthOnRecordType
dsDoMultipleAttributeValueSearch
dsDoMultipleAttributeValueSearchWithData
dsDoPlugInCustomCall
dsFindDirNodes
dsFlushRecord
dsGetAttributeEntry
dsGetAttributeValue
dsGetDirNodeCount
dsGetDirNodeCountWithInfo
dsGetDirNodeInfo
dsGetDirNodeList
dsGetDirNodeName
dsGetNextAttributeEntry
dsGetNextAttributeValue
dsGetRecordAttributeInfo
dsGetRecordAttributeValueByID
dsGetRecordAttributeValueByIndex
dsGetRecordAttributeValueByValue
dsGetRecordEntry
dsGetRecordList
dsGetRecordReferenceInfo
dsIsDirServiceLocalRunning
dsIsDirServiceRunning
dsOpenDirNode
dsOpenDirService
dsOpenDirServiceLocal
dsOpenDirServiceProxy
dsOpenRecord
dsReleaseContinueData
dsRemoveAttribute
dsRemoveAttributeValue
dsSetAttributeValue
dsSetAttributeValues
dsSetRecordName
dsSetRecordType
dsVerifyDirRefNum

dsAddAttribute


tDirStatus dsAddAttribute (
    tRecordReference inRecordReference, 
    tDataNodePtr inNewAttribute, 
    tAccessControlEntryPtr inNewAttributeAccess, 
    tDataNodePtr inFirstAttributeValue );  
Discussion

Add an attribute type to a record.


dsAddAttributeValue


tDirStatus dsAddAttributeValue (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    tDataNodePtr inAttributeValue );  
Discussion

Add data to a record.


dsAddChildPIDToReference


tDirStatus dsAddChildPIDToReference (
    tDirReference inDirRef, 
    SInt32 inValidChildPID, 
    UInt32 inValidAPIReferenceToGrantChild );  


dsCloseAttributeList


tDirStatus dsCloseAttributeList (
    tAttributeListRef inAttributeListRef );  


dsCloseAttributeValueList


tDirStatus dsCloseAttributeValueList (
    tAttributeValueListRef inAttributeValueListRef );  


dsCloseDirNode


tDirStatus dsCloseDirNode (
    tDirNodeReference inDirNodeReference );  
Parameters
inDirNodeReference
Directory node reference obtained from dsOpenDirNode
Discussion

Tear down a directory node session.


dsCloseDirService


tDirStatus dsCloseDirService (
    tDirReference inDirReference );  
Parameters
inDirReference
Directory Services API reference to be closed


dsCloseRecord


tDirStatus dsCloseRecord (
    tRecordReference inRecordReference );  


dsCreateRecord


tDirStatus dsCreateRecord (
    tDirNodeReference inDirNodeReference, 
    tDataNodePtr inRecordType, 
    tDataNodePtr inRecordName );  


dsCreateRecordAndOpen


tDirStatus dsCreateRecordAndOpen (
    tDirNodeReference inDirNodeReference, 
    tDataNodePtr inRecordType, 
    tDataNodePtr inRecordName, 
    tRecordReference *outRecordReference );  


dsDeleteRecord


tDirStatus dsDeleteRecord (
    tRecordReference inRecordReference );  


dsDoAttributeValueSearch


tDirStatus dsDoAttributeValueSearch (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tDataListPtr inRecordTypeList, 
    tDataNodePtr inAttributeType, 
    tDirPatternMatch inPatternMatchType, 
    tDataNodePtr inPattern2Match, 
    UInt32 *inOutMatchRecordCount, 
    tContextData *inOutContinueData );  
Parameters
inDirNodeReference
Directory node reference obtained from dsOpenDirNode.
inOutDataBuffer
A client-allocated buffer to hold the data results.
inRecordTypeList
The list of record types to search over.
inAttributeType
Which attribute type we are to match on.
inPatternMatchType
The matching criteria used.
inPattern2Match
Value to match for the above attribute type.
inOutMatchRecordCount
How many records we found that met the match criteria. However, also a limit of the maximum records returned as provided by the client. If zero or less, then assuming no limit on number of records to be returned.
inOutContinueData
Pointer to a tContextData variable. If (*inOutCountinueData == NULL) there is no more data. Otherwise can be used in the next call to the same routine to get the remainder of the information. If client does not use non-NULL continue data, then dsReleaseContinueData should be called to clean up.
Discussion

Use dsGetRecordEntry, dsGetAttributeEntry, and dsGetAttributeValue to parse the inOutDataBuffer parameter for results.


dsDoAttributeValueSearchWithData


tDirStatus dsDoAttributeValueSearchWithData (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tDataListPtr inRecordTypeList, 
    tDataNodePtr inAttributeMatchType, 
    tDirPatternMatch inPatternMatchType, 
    tDataNodePtr inPatternToMatch, 
    tDataListPtr inAttributeTypeRequestList, 
    dsBool inAttributeInfoOnly, 
    UInt32 *inOutMatchRecordCount, 
    tContextData *inOutContinueData );  
Parameters
inOutDataBuffer
A client-allocated buffer to hold the data results.
inRecordTypeList
The list of record types to search over.
inAttributeMatchType
Which attribute type we are to match on.
inPatternMatchType
The matching criteria used.
inPatternToMatch
Value to match for the above attribute type.
inAttributeTypeRequestList
What type of attributes do we want for each record.
inAttributeInfoOnly
Do we want attribute information only, or values too.
inOutMatchRecordCount
How many records we found that met the match criteria. However, also a limit of the maximum records returned as provided by the client. If zero or less, then assuming no limit on number of records to be returned.


dsDoDirNodeAuth


tDirStatus dsDoDirNodeAuth (
    tDirNodeReference inDirNodeReference, 
    tDataNodePtr inDirNodeAuthName, 
    dsBool inDirNodeAuthOnlyFlag, 
    tDataBufferPtr inAuthStepData, 
    tDataBufferPtr outAuthStepDataResponse, 
    tContextData *inOutContinueData );  
Parameters
inDirNodeAuthOnlyFlag
Indicates if the client wishes to use the results of this authentication process as their identity for this directory session (inDirNodeReference) for directory node access authorization. If the flag value is "false", then at the completion of the auth process both the Directory Services API and the Plug-in should use this "identity" to grant or deny access for all future directory service calls. If the flag value is "true", then at the completion of of the auth process no identity information will be used by the directory services or Plug-in for authorization purposes. A file server just wishing to authenticate a user, but not change how/who it is accessing the directory as would set this parameter to "true".
Discussion

Do an authentication session with the given authentication type. When a authentication is successful the error code 'eDSNoErr' is returned and the outAuthStepDataResponse parameter will contain a correctly formed kDS1AttrAuthCredential value. This AuthCredential can be used for future authentications for this and other directory nodes in the directory system. Not all directory nodes will support authenticating in this manner, but most should. In addition the current kDS1AttrAuthCredential value can always be obtained via dsGetDirNodeInfo call with kDS1AttrAuthCredential as one of the requested attributes. Directory Nodes that support using a kDS1AttrAuthCredential will list DSAuthCredential as a support authentication method. Support authentication methods can be determined by calling dsGetDirNodeInfo and requesting the kDSNAttrAuthMethod attribute for that directory node. NOTE: it is important to note that while some Directory Nodes may support the attempt of using a kDS1AttrAuthCredential to authenticate, when the Directory Node plug-in decodes the Credential the authentication attempt may still fail for plug-in specific reasons (the plug-in may find the level of original authentication insufficient for it's requirements or configuration, or the credential may have expired and is no longer valid). In addition when using a kDS1AttrAuthCredential to authentication to a different directory node than the original kDS1AttrAuthCredential was generated, the level of access granted by the directory node plug-in may not match the level in the original directory node. Access granted to the contents of a directory node is entirely at the descretion of the directory node plug-in and the directory system it represents.


dsDoDirNodeAuthOnRecordType


tDirStatus dsDoDirNodeAuthOnRecordType (
    tDirNodeReference inDirNodeReference, 
    tDataNodePtr inDirNodeAuthName, 
    dsBool inDirNodeAuthOnlyFlag, 
    tDataBufferPtr inAuthStepData, 
    tDataBufferPtr outAuthStepDataResponse, 
    tContextData *inOutContinueData, 
    tDataNodePtr inRecordType ) ;  
Parameters
inDirNodeAuthOnlyFlag
Indicates if the client wishes to use the results of this authentication process as their identity for this directory session (inDirNodeReference) for directory node access authorization. If the flag value is "false", then at the completion of the auth process both the Directory Services API and the Plug-in should use this "identity" to grant or deny access for all future directory service calls. If the flag value is "true", then at the completion of of the auth process no identity information will be used by the directory services or Plug-in for authorization purposes. A file server just wishing to authenticate a user, but not change how/who it is accessing the directory as would set this parameter to "true".
inRecordType
The record type to perform the auth against for the inDirNodeAuthName. If this is passed in as NULL then call will be routed as dsDoDirNodeAuth() which assumes a record type of kDSStdRecordTypeUsers.
Discussion

Do an authentication session with the given authentication type on the specified record type. When a authentication is successful the error code 'eDSNoErr' is returned and the outAuthStepDataResponse parameter will contain a correctly formed kDS1AttrAuthCredential value. This AuthCredential can be used for future authentications for this and other directory nodes in the directory system. Not all directory nodes will support authenticating in this manner, but most should. In addition the current kDS1AttrAuthCredential value can always be obtained via dsGetDirNodeInfo call with kDS1AttrAuthCredential as one of the requested attributes. Directory Nodes that support using a kDS1AttrAuthCredential will list DSAuthCredential as a supported authentication method. Support authentication methods can be determined by calling dsGetDirNodeInfo and requesting the kDSNAttrAuthMethod attribute for that directory node. NOTE: it is important to note that while some Directory Nodes may support the attempt of using a kDS1AttrAuthCredential to authenticate, when the Directory Node plug-in decodes the Credential the authentication attempt may still fail for plug-in specific reasons (the plug-in may find the level of original authentication insufficient for it's requirements or configuration, or the credential may have expired and is no longer valid). In addition when using a kDS1AttrAuthCredential to authentication to a different directory node than the original kDS1AttrAuthCredential was generated, the level of access granted by the directory node plug-in may not match the level in the original directory node. Access granted to the contents of a directory node is entirely at the descretion of the directory node plug-in and the directory system it represents.

Availability
Introduced in Mac OS X v10.3.

dsDoMultipleAttributeValueSearch


tDirStatus dsDoMultipleAttributeValueSearch (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tDataListPtr inRecordTypeList, 
    tDataNodePtr inAttributeType, 
    tDirPatternMatch inPatternMatchType, 
    tDataListPtr inPatterns2Match, 
    UInt32 *inOutMatchRecordCount, 
    tContextData *inOutContinueData ) ;  
Parameters
inOutDataBuffer
A client-allocated buffer to hold the data results.
inRecordTypeList
The list of record types to search over.
inAttributeType
Which attribute type we are to match on.
inPatternMatchType
The matching criteria used.
inPatterns2Match
The list of values to match for the above attribute type.
inOutMatchRecordCount
How many records we found that met the match criteria. However, also a limit of the maximum records returned as provided by the client. If zero or less, then assuming no limit on number of records to be returned.
Discussion

Use dsGetRecordEntry, dsGetAttributeEntry, and dsGetAttributeValue to parse the inOutDataBuffer parameter for results.

Availability
Introduced in Mac OS X v10.4.

dsDoMultipleAttributeValueSearchWithData


tDirStatus dsDoMultipleAttributeValueSearchWithData (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tDataListPtr inRecordTypeList, 
    tDataNodePtr inAttributeMatchType, 
    tDirPatternMatch inPatternMatchType, 
    tDataListPtr inPatternsToMatch, 
    tDataListPtr inAttributeTypeRequestList, 
    dsBool inAttributeInfoOnly, 
    UInt32 *inOutMatchRecordCount, 
    tContextData *inOutContinueData ) ;  
Parameters
inOutDataBuffer
A client-allocated buffer to hold the data results.
inRecordTypeList
The list of record types to search over.
inAttributeMatchType
Which attribute type we are to match on.
inPatternMatchType
The matching criteria used.
inPatternsToMatch
The list of values to match for the above attribute type.
inAttributeTypeRequestList
What type of attributes do we want for each record.
inAttributeInfoOnly
Do we want attribute information only, or values too.
inOutMatchRecordCount
How many records we found that met the match criteria. However, also a limit of the maximum records returned as provided by the client. If zero or less, then assuming no limit on number of records to be returned.

Availability
Introduced in Mac OS X v10.4.

dsDoPlugInCustomCall


tDirStatus dsDoPlugInCustomCall (
    tDirNodeReference inDirNodeReference, 
    UInt32 inCustomRequestCode, 
    tDataBufferPtr inCustomRequestData, 
    tDataBufferPtr outCustomRequestResponse );  
Discussion

Used for custom direct communications with plugs-ins.


dsFindDirNodes


tDirStatus dsFindDirNodes (
    tDirReference inDirReference, 
    tDataBufferPtr inOutDataBufferPtr, 
    tDataListPtr inNodeNamePattern, 
    tDirPatternMatch inPatternMatchType, 
    UInt32 *outDirNodeCount, 
    tContextData *inOutContinueData );  
Parameters
inDirReference
Directory reference established with dsOpenDirService
inOutDataBufferPtr
Contains a client allocated buffer to store results. Data is extracted with dsGetDirNodeName.
inNodeNamePattern
A tDataList pointer, which contains the pattern to be matched.
inPatternMatchType
What type of match to perform on inNodeNamePattern. Valid values for this are: eDSExact, eDSStartsWith, eDSEndsWith, eDSContains. Other match types will return an error.
outDirNodeCount
Number of items in the client buffer.
inOutContinueData
Pointer to a tContextData variable, if (*inOutCountinueData == NULL) there is no more data otherwise can be used in a 2nd call to the same routine to get the remainder of the directory node list. if client does not use if (*inOutCountinueData != NULL) and the client doesn't wish to continue then dsReleaseContinueData should be called to clean up.
Discussion

Find directory nodes matching a certain pattern.


dsFlushRecord


tDirStatus dsFlushRecord (
    tRecordReference inRecordReference );  


dsGetAttributeEntry


tDirStatus dsGetAttributeEntry (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tAttributeListRef inAttributeListRef, 
    UInt32 inAttributeInfoIndex, 
    tAttributeValueListRef *outAttributeValueListRef, 
    tAttributeEntryPtr *outAttributeInfoPtr );  
Discussion

Get an attribute entry from a buffer.


dsGetAttributeValue


tDirStatus dsGetAttributeValue (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    UInt32 inAttributeValueIndex, 
    tAttributeValueListRef inAttributeValueListRef, 
    tAttributeValueEntryPtr *outAttributeValue );  
Discussion

Get an attribute value from a buffer.


dsGetDirNodeCount


tDirStatus dsGetDirNodeCount (
    tDirReference inDirReference, 
    UInt32 *outDirectoryNodeCount ) ;  
Parameters
inDirReference
Directory reference established with dsOpenDirService.
outDirectoryNodeCount
Contains count of the total number of directory nodes.
Discussion

Get the count of the total number of directory nodes in the system.

Availability
Introduced in Mac OS X v10.2

dsGetDirNodeCountWithInfo


tDirStatus dsGetDirNodeCountWithInfo (
    tDirReference inDirReference, 
    UInt32 *outDirectoryNodeCount, 
    UInt32 *outDirectoryNodeChangeToken );  
Parameters
inDirReference
Directory Reference Established with dsOpenDirService
outDirectoryNodeCount
Contains count of the total number of nodes in the directory
outDirectoryNodeChangeToken
Contains token that changes upon any registered node changes.
Discussion

Get the count of the total number of DirNodes in the Directory System with change information ie. a token gets returned with a different value if there has been a change in the registered nodes so the client can retain the first token and compare with the second to see if any registered nodes have changed


dsGetDirNodeInfo


tDirStatus dsGetDirNodeInfo (
    tDirNodeReference inDirNodeReference, 
    tDataListPtr inDirNodeInfoTypeList, 
    tDataBufferPtr inOutDataBuffer, 
    dsBool inAttributeInfoOnly, 
    UInt32 *outAttributeInfoCount, 
    tAttributeListRef *outAttributeListRef, 
    tContextData *inOutContinueData );  
Parameters
inDirNodeReference
Directory node reference obtained from dsOpenDirNode.
inDirNodeInfoTypeList
tDataList containing the types of requested data.
inOutDataBuffer
Client-allocated buffer to hold the data results.
inAttributeInfoOnly
This flag is set to true if the client wants attribute info only, not attribute values.
outAttributeInfoCount
A count of the number of data types present in the DataBuffer.
inOutContinueData
Pointer to a tContextData variable. If (*inOutCountinueData == NULL) there is no more data. Otherwise can be used in the next call to the same routine to get the remainder of the information. If client does not use non-NULL continue data, then dsReleaseContinueData should be called to clean up.
Discussion

Get information about a directory node: authentication methods, unique ID's, ICON information, access controls, record types contained in this node, plug-in information, directory node/type/signature.


dsGetDirNodeList


tDirStatus dsGetDirNodeList (
    tDirReference inDirReference, 
    tDataBufferPtr inOutDataBufferPtr, 
    UInt32 *outDirNodeCount, 
    tContextData *inOutContinueData );  
Parameters
inDirReference
Directory reference established with dsOpenDirService
inOutDataBufferPtr
Contains a client allocated buffer to store results..data is extracted with dsGetDirNodeName
outDirNodeCount
Number of directory node names contained in dataBuffer
inOutContinueData
Pointer to a tContextData variable, if (*inOutCountinueData == NULL) there is no more data otherwise can be used in a 2nd call to the same routine to get the remainder of the directory node list. if client does not use if (*inOutCountinueData != NULL) and the client doesn't wish to continue then dsReleaseContinueData should be called to clean up..
Discussion

Fill a buffer with the names of all the directory nodes.


dsGetDirNodeName


tDirStatus dsGetDirNodeName (
    tDirReference inDirReference, 
    tDataBufferPtr inOutDataBuffer, 
    UInt32 inDirNodeIndex, 
    tDataListPtr *inOutDataList );  
Parameters
inDirReference
Directory reference established with dsOpenDirService
inOutDataBuffer
A buffer containing all the directory node names from dsGetDirNodeList or dsFindDirNodes
inDirNodeIndex
One-based index of directory node name to fetch/build.
inOutDataList
Address of tDataListPtr that is built by this call. The client is responsible for disposing of it with dsDataListDeAllocate.
Discussion

Parse the return Buffer from dsFindDirNodes or dsGetDirNodeList and build a tDataList representing the directory node's name.


dsGetNextAttributeEntry


tDirStatus dsGetNextAttributeEntry (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tAttributeListRef inAttributeListRef, 
    UInt32 inAttributeInfoIndex, 
    SInt32 *inOutAttributeOffset, 
    tAttributeValueListRef *outAttributeValueListRef, 
    tAttributeEntryPtr *outAttributeInfoPtr ) ;  
Discussion

Get the next attribute entry from a buffer. Optimized buffer extraction with offset value. Intent is to only service this call in the FW unless falling through to old call.

Availability
Introduced in Mac OS X v10.5.

dsGetNextAttributeValue


tDirStatus dsGetNextAttributeValue (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    UInt32 inAttributeValueIndex, 
    SInt32 *inOutAttributeValueOffset, 
    tAttributeValueListRef inAttributeValueListRef, 
    tAttributeValueEntryPtr *outAttributeValue ) ;  
Discussion

Get the next attribute value from a buffer. Optimized buffer extraction with offset value. Intent is to only service this call in the FW unless falling through to old call.

Availability
Introduced in Mac OS X v10.5.

dsGetRecordAttributeInfo


tDirStatus dsGetRecordAttributeInfo (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    tAttributeEntryPtr *outAttributeInfoPtr );  


dsGetRecordAttributeValueByID


tDirStatus dsGetRecordAttributeValueByID (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    UInt32 inValueID, 
    tAttributeValueEntryPtr *outEntryPtr );  


dsGetRecordAttributeValueByIndex


tDirStatus dsGetRecordAttributeValueByIndex (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    UInt32 inValueIndex, 
    tAttributeValueEntryPtr *outEntryPtr );  


dsGetRecordAttributeValueByValue


tDirStatus dsGetRecordAttributeValueByValue (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    tDataNodePtr inAttributeValue, 
    tAttributeValueEntryPtr *outEntryPtr ) ;  
Parameters
inRecordReference
Record reference from an opened record.
inAttributeType
Attribute type to retrieve.
inAttributeValue
Attribute value whose existence is to be confirmed.
outEntryPtr
Output data structure.
Discussion

This routine verifies the existence of an attribute value within a record.

Availability
Introduced in Mac OS X v10.4.

dsGetRecordEntry


tDirStatus dsGetRecordEntry (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    UInt32 inRecordEntryIndex,  
    tAttributeListRef *outAttributeListRef, 
    tRecordEntryPtr *outRecordEntryPtr );  
Parameters
inDirNodeReference
Directory node reference obtained from dsOpenDirNode.
inOutDataBuffer
A client-allocated buffer to hold the data results.
Discussion

Get a record entry from a buffer.


dsGetRecordList


tDirStatus dsGetRecordList (
    tDirNodeReference inDirNodeReference, 
    tDataBufferPtr inOutDataBuffer, 
    tDataListPtr inRecordNameList, 
    tDirPatternMatch inPatternMatchType, 
    tDataListPtr inRecordTypeList, 
    tDataListPtr inAttributeTypeList, 
    dsBool inAttributeInfoOnly, 
    UInt32 *inOutRecordEntryCount, 
    tContextData *inOutContinueData );  
Parameters
inDirNodeReference
Directory node reference obtained from dsOpenDirNode.
inOutDataBuffer
A client-allocated buffer to hold the data results.
inRecordNameList
A tDataList of Record names to be matched.
inPatternMatchType
How is the pattern matched for the inRecordNameList.
inRecordTypeList
What record types do we want returned?
inAttributeTypeList
What type of attributes do we want for each record.
inAttributeInfoOnly
Do we want attribute information only, or do we also want attribute values.
inOutRecordEntryCount
How many record entries are there in the client buffer. However, also a limit of the maximum records returned as provided by the client. If zero or less, then assuming no limit on number of records to be returned.
inOutContinueData
Pointer to a tContextData variable. If (*inOutCountinueData == NULL) there is no more data. Otherwise can be used in the next call to the same routine to get the remainder of the information. If client does not use and continue data is non-NULL then dsReleaseContinueData should be called to clean up.
Discussion

Get a list of records, optionally: by name, by type, with or without attribute info, with or without attribute value data.


dsGetRecordReferenceInfo


tDirStatus dsGetRecordReferenceInfo (
    tRecordReference inRecordReference, 
    tRecordEntryPtr *outRecordInfo );  


dsIsDirServiceLocalRunning


tDirStatus dsIsDirServiceLocalRunning ( ) ;  

Availability
Introduced in Mac OS X v10.5.

dsIsDirServiceRunning


tDirStatus dsIsDirServiceRunning ( );  


dsOpenDirNode


tDirStatus dsOpenDirNode (
    tDirReference inDirReference, 
    tDataListPtr inDirNodeName, 
    tDirNodeReference *outDirNodeReference );  
Parameters
inDirReference
Directory reference established with dsOpenDirService.
inDirNodeName
Directory node name to open. Should be split into path components, for example as a result of dsBuildListFromPath
outDirNodeReference
Valid call with eDSNoErr, results in a directory node session reference. This reference represents the client's session context for the contents of the given directory node.
Discussion

Establish a session for a particular directory node.


dsOpenDirService


tDirStatus dsOpenDirService (
    tDirReference *outDirReference );  
Parameters
outDirReference
reference to use in subsequent Directory Services API calls
Discussion

Opens Directory Services API reference. Must be called before any other Directory Services API calls because this reference is needed for any other call.


dsOpenDirServiceLocal


tDirStatus dsOpenDirServiceLocal (
    tDirReference *outDirRef, 
    const char *inFilePath ) ;  
Parameters
outDirRef
reference to use in subsequent Directory Services API calls
inFilePath
unix file path for a ds local node database [if either NULL or "Default" input then the default node is used]
Discussion

Opens Directory Services API reference to Local Access only daemon. Must be called before any other Directory Services API calls because this reference is needed for any other call.

Availability
Introduced in Mac OS X v10.5.

dsOpenDirServiceProxy


See Also:
DSPROXY
tDirStatus dsOpenDirServiceProxy (
    tDirReference *outDirRef, 
    const char *inIPAddress, 
    UInt32 inIPPort, 
    tDataNodePtr inAuthMethod, 
    tDataBufferPtr inAuthStepData, 
    tDataBufferPtr outAuthStepDataResponse, 
    tContextData *ioContinueData ) ;  
Parameters
outDirRef
reference to use in subsequent Directory Services API calls
inIPAddress
either the domain or IP (dot) address of the remote DirectoryService machine
inIPPort
either the client defined port or "0" which then allows use of the default
Discussion

Opens Directory Services API reference via TCP. Must be called before any other Directory Services API calls because this reference is needed for any other call.

Availability
Introduced in Mac OS X v10.2

dsOpenRecord


tDirStatus dsOpenRecord (
    tDirNodeReference inDirNodeReference, 
    tDataNodePtr inRecordType, 
    tDataNodePtr inRecordName, 
    tRecordReference *outRecordReference );  


dsReleaseContinueData


tDirStatus dsReleaseContinueData (
    tDirReference inDirReference, 
    tContextData inContinueData );  
Parameters
inDirReference
Directory reference established with dsOpenDirService if inContinueData was returned by dsGetDirNodeList or dsFindDirNodes, node reference (type tDirNodeReference) established with dsOpenDirNode if inContinueData was returned by a node specific API such as dsGetRecordList, dsDoAttributeValueSearch, dsDoAttributeValueSearchWithData, dsDoMultipleAttributeValueSearch, dsDoMultipleAttributeValueSearchWithData, dsGetDirNodeInfo, dsDoDirNodeAuth, or dsDoDirNodeAuthOnRecordType.
inContinueData
Pointer to a tContextData variable which will be cleaned up by Directory Services
Discussion

If continue data from dsGetDirNodeList or any other Directory Services function is non-NULL, then call this routine to release the continue data if the client chooses not to continue the directory node listing or other operation.


dsRemoveAttribute


tDirStatus dsRemoveAttribute (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttribute );  


dsRemoveAttributeValue


tDirStatus dsRemoveAttributeValue (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    UInt32 inAttributeValueID );  


dsSetAttributeValue


tDirStatus dsSetAttributeValue (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    tAttributeValueEntryPtr inAttributeValuePtr );  


dsSetAttributeValues


tDirStatus dsSetAttributeValues (
    tRecordReference inRecordReference, 
    tDataNodePtr inAttributeType, 
    tDataListPtr inAttributeValuesPtr ) ;  
Parameters
inRecordReference
the record reference of the record to modify
inAttributeType
the attribute type to set values for
inAttributeValuesPtr
the list of all values for the attribute
Discussion

sets an attribute to have the given list of values

Availability
Introduced in Mac OS X v10.4.

dsSetRecordName


tDirStatus dsSetRecordName (
    tRecordReference inRecordReference, 
    tDataNodePtr inNewRecordName );  


dsSetRecordType


tDirStatus dsSetRecordType (
    tRecordReference inRecordReference, 
    tDataNodePtr inNewRecordType ) ;  

Availability
Introduced in Mac OS X v10.0, but later deprecated in Mac OS X v10.2.

dsVerifyDirRefNum


tDirStatus dsVerifyDirRefNum (
    tDirReference inDirReference );  
Discussion

Verify an existing tDirReference.

#defines


DSPROXY


See Also:
dsOpenDirServiceProxy
#define DSPROXY 1 
Parameters
outDirRef
reference to use in subsequent Directory Services API calls
inIPAddress
either the domain or IP (dot) address of the remote DirectoryService machine
inIPPort
either the client defined port or "0" which then allows use of the default
Discussion

Opens Directory Services API reference via TCP. Must be called before any other Directory Services API calls because this reference is needed for any other call.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11