Summary: Isode provides a number of APIs which allow integrators and product developers to build components that allow client programs to connect to, query and modify data in the directory.
dsapi_attr.h File Reference

Simple directory API methods for handling entries, attributes and values. More...

#include <stddef.h>
#include <isode/ds/dsapi/dsapi_cdecl.h>
#include <isode/ds/dsapi/dsapi_types.h>
#include <isode/ds/dsapi/dsapi_const.h>

Go to the source code of this file.

Functions

DS_Status DS_Entry_GetNamedAttr (const DS_Entry *entry, const char *type, const DS_Attr **attr_p)
 Get the named attribute from an attribute list. More...
 
DS_Status DS_Entry_GetAttrList (const DS_Entry *entry, const DS_AttrList **attr_list_p)
 Get the entry attribute list. More...
 
DS_Status DS_Entry_GetModList (const DS_Entry *entry, const DS_AttrList **mod_list_p)
 Get the change-entry's modification list. More...
 
DS_Status DS_AttrList_New (DS_AttrList **attrlist_p, const DS_Attr *attr)
 Create a new Attribute list. Initially the list contains a single Attribute. More...
 
DS_Status DS_AttrList_Append (DS_AttrList *attrlist, const DS_Attr *attr)
 Append an attribute to an Attribute list. More...
 
const DS_AttrDS_AttrList_GetFirst (const DS_AttrList *attr_list)
 Get the first attribute in an attribute list. More...
 
const DS_AttrDS_AttrList_GetNext (const DS_Attr *attr)
 Get the next attribute in a list. More...
 
DS_Status DS_Attr_GetTypeName (const DS_Attr *attr, const char **str_p)
 Return the type name of a given attribute. More...
 
DS_Status DS_Attr_GetModType (const DS_Attr *attr, DSModType *type_p)
 Return the modification type of a given attribute. More...
 
DS_Status DS_Attr_GetValueList (const DS_Attr *attr, const DS_AttrValList **val_list_p)
 Get an attribute's value list. More...
 
DS_Status DS_Attr_AddStringValue (DS_Attr *attr, const char *str, size_t len)
 Add a new string value to a DS_Attr. More...
 
DS_Status DS_Attr_AddBERValue (DS_Attr *attr, const unsigned char *ber, size_t len)
 Add a new BER value to a DS_Attr. More...
 
DS_Status DS_Attr_New (const char *name, DS_Attr **attr_p)
 Create a new DS_Attr structure. More...
 
DS_Status DS_Attr_New_AllowUnknown (const char *name, DS_Attr **attr_p)
 Create a new DS_Attr structure, allowing unknown attribute-types. More...
 
DS_Status DS_Attr_IsUnknown (DS_Attr *attr, int *is_unknown_p)
 Check to see if a DS_Attr has an unknown attribute-type. More...
 
DS_Status DS_Attr_Copy (const DS_Attr *attr, DS_Attr **copy_p)
 Copy a DS_Attr structure. More...
 
void DS_Attr_Delete (DS_Attr *attr)
 Free a DS_Attr structure. More...
 
DS_Status DS_AttrList_Copy (const DS_AttrList *attr_list, DS_AttrList **copy_p)
 Copy a DS_AttrList structure. More...
 
void DS_AttrList_Delete (DS_AttrList *attr_list)
 Free a DS_AttrList structure (and all elements). More...
 
const DS_AttrValDS_AttrValList_GetFirst (const DS_AttrValList *value_list)
 Get the first attribute in a list. More...
 
DS_Status DS_AttrValList_GetCount (const DS_AttrValList *value_list, int *count_p)
 Count the attribute values in a list. More...
 
const DS_AttrValDS_AttrValList_GetNext (const DS_AttrVal *value)
 Get the next attribute in a list. More...
 
DS_Status DS_AttrVal_GetBERPointer (const DS_AttrVal *value, const unsigned char **ber_ptr_p, size_t *ber_len_p)
 Return a pointer to the stored BER encoding. More...
 
DS_Status DS_AttrVal_GetStringPointer (const DS_AttrVal *value, const char **str_p, size_t *str_len_p)
 Return a pointer to the stored LDAPv3 format string encoding. More...
 
DS_Status DS_AttrVal_GetInternal (const DS_AttrVal *value, const void **ir_p)
 Verify that the contents of a DS_AttrVal have a valid internal representation, and optionally return a pointer to the internal representation of the value. More...
 
DS_Status DS_AttrVal_Internal_Delete (const DS_AttrVal *value, void *ir)
 Delete a pointer to the internal representation of a value. More...
 
DS_Status DS_AttrVal_Normalize (const DS_AttrVal *value)
 Normalize the value in a DS_AttrVal. More...
 
DS_Status DS_AttrVal_RegenerateBER (const DS_AttrVal *value, DS_AttrVal **copy_p)
 Regenerate the attribute value via BER. More...
 
DS_Status DS_AttrVal_Compare (const DS_AttrVal *av1, const DS_AttrVal *av2, int *res_p)
 Compare two DS_AttrVal values. More...
 
DS_Status DS_AttrVal_Copy (const DS_AttrVal *av, DS_AttrVal **copy_p)
 Copy a DS_AttrVal structure. More...
 
void DS_AttrVal_Delete (DS_AttrVal *av)
 Free a DS_AttrVal structure. More...
 
DS_Status DS_AttrValList_Copy (const DS_AttrValList *av_list, DS_AttrValList **copy_p)
 Copy a DS_AttrValList structure. More...
 
void DS_AttrValList_Delete (DS_AttrValList *av_list)
 Free a DS_AttrValList structure. More...
 

Detailed Description

Simple directory API methods for handling entries, attributes and values.

These API methods implement access to and manipulation of data returned from search and read operations. This includes entries, attributes, values and lists of these data objects.

Note that unknown attributes (i.e. those that have attribute-types unknown to the local schema) may be handled in DSAPI, but only with some restrictions. An unknown attribute always has a syntax of 'octetstring', because no interpretation can be imposed on the stream of bytes making up the attribute values by default.

In normal use (not using any function-calls that mention 'Unknown') no unknown attributes will ever be returned by the API. However, LDAP and LDIF calls will still accept unknown attributes and output them. DAP calls will however reject any unknown attributes.

Using special calls with 'Unknown' in the name, greater support for unknown attributes can be enabled. Using DS_AllowUnknownAttrs() on a session handle, LDAP reads and searches will return any unknown attribute-types found on the directory. Using DS_LDIF_AllowUnknownAttrs(), LDIF reads will return unknown attribute-types from the LDIF file. Using DS_Attr_New_AllowUnknown(), it is possible to create new attributes with unknown attribute-types and add values to them.

Definition in file dsapi_attr.h.