src/schema.c file

Functions

static auto ldap_schema_destructor(ldap_schema_t* schema) -> int
ldap_schema_destructor Destroys schema associated hash tables and frees memory.
auto ldap_schema_new(TALLOC_CTX* ctx) -> ldap_schema_t*
ldap_schema_new Allocates ldap_schema_t and checks it for validity.
auto ldap_schema_object_classes(const ldap_schema_t* schema) -> LDAPObjectClass**
ldap_schema_object_classes Returns a list of LDAPObjectClass structs.
auto ldap_schema_attribute_types(const ldap_schema_t* schema) -> LDAPAttributeType**
ldap_schema_attribute_types Returns a list of LDAPAttributeType structs.
auto ldap_schema_get_objectclass_by_oid(const ldap_schema_t* schema, const char* oid) -> LDAPObjectClass*
ldap_schema_get_objectclass_by_oid Returns a LDAPObjectClass struct corresponding to the specified OID.
auto ldap_schema_get_objectclass_by_name(const ldap_schema_t* schema, const char* name) -> LDAPObjectClass*
ldap_schema_get_objectclass_by_name Returns a LDAPObjectClass struct corresponding to the specified name.
auto ldap_schema_get_attributetype_by_oid(const ldap_schema_t* schema, const char* oid) -> LDAPAttributeType*
ldap_schema_get_attributetype_by_oid Returns a LDAPAttributeType struct corresponding to the specified OID.
auto ldap_schema_get_attributetype_by_name(const ldap_schema_t* schema, const char* name) -> LDAPAttributeType*
ldap_schema_get_attributetype_by_name Returns a LDAPAttributeType struct corresponding to the specified name.
auto ldap_schema_append_attributetype(struct ldap_schema_t* schema, LDAPAttributeType* attributetype) -> bool
ldap_schema_append_attributetype Appends attribute type to the list of schema's attribute types.
auto ldap_schema_append_objectclass(struct ldap_schema_t* schema, LDAPObjectClass* objectclass) -> bool
ldap_schema_append_objectclass Appends object class to the list of schema's object classes.
auto ldap_schema_load(struct ldap_connection_ctx_t* connection) -> enum OperationReturnCode
ldap_schema_load Loads the schema from the connection depending on the type of directory.
auto ldap_schema_ready(struct ldap_connection_ctx_t* connection) -> bool
ldap_schema_ready Verifies the schema is fully loaded and ready for use.

Defines

#define return_null_if_null(parameter, error)

Function documentation

static int ldap_schema_destructor(ldap_schema_t* schema)

ldap_schema_destructor Destroys schema associated hash tables and frees memory.

Parameters
schema in Schema to free.

ldap_schema_t* ldap_schema_new(TALLOC_CTX* ctx)

ldap_schema_new Allocates ldap_schema_t and checks it for validity.

Parameters
ctx in TALLOC_CTX to use.
Returns
  • NULL on error.
  • Pointer to ldap schema on success.

LDAPObjectClass** ldap_schema_object_classes(const ldap_schema_t* schema)

ldap_schema_object_classes Returns a list of LDAPObjectClass structs.

Parameters
schema in Schema to work with.
Returns
  • NULL if schema is NULL.
  • List of object classes from schema.

LDAPAttributeType** ldap_schema_attribute_types(const ldap_schema_t* schema)

ldap_schema_attribute_types Returns a list of LDAPAttributeType structs.

Parameters
schema in Schema to work with.
Returns
  • NULL if schema is NULL.
  • List of attribute types from schema.

LDAPObjectClass* ldap_schema_get_objectclass_by_oid(const ldap_schema_t* schema, const char* oid)

ldap_schema_get_objectclass_by_oid Returns a LDAPObjectClass struct corresponding to the specified OID.

Parameters
schema in Schema to work with.
oid in OID of the object class.
Returns
  • NULL if schema is NULL.
  • Object class from schema.

LDAPObjectClass* ldap_schema_get_objectclass_by_name(const ldap_schema_t* schema, const char* name)

ldap_schema_get_objectclass_by_name Returns a LDAPObjectClass struct corresponding to the specified name.

Parameters
schema in Schema to work with.
name in Name of the object class.
Returns
  • NULL if schema is NULL.
  • Object class from schema.

LDAPAttributeType* ldap_schema_get_attributetype_by_oid(const ldap_schema_t* schema, const char* oid)

ldap_schema_get_attributetype_by_oid Returns a LDAPAttributeType struct corresponding to the specified OID.

Parameters
schema in Schema to work with.
oid in OID of the attribute type.
Returns
  • NULL if schema is NULL.
  • Attribute type from schema.

LDAPAttributeType* ldap_schema_get_attributetype_by_name(const ldap_schema_t* schema, const char* name)

ldap_schema_get_attributetype_by_name Returns a LDAPAttributeType struct corresponding to the specified name.

Parameters
schema in Schema to work with.
name in One of the attribute names.
Returns
  • NULL if schema is NULL.
  • Attribute type from schema.

bool ldap_schema_append_attributetype(struct ldap_schema_t* schema, LDAPAttributeType* attributetype)

ldap_schema_append_attributetype Appends attribute type to the list of schema's attribute types.

Parameters
schema in Schema to work with.
attributetype in Attribute type to add.
Returns
  • false - on error.
  • true - on success.

bool ldap_schema_append_objectclass(struct ldap_schema_t* schema, LDAPObjectClass* objectclass)

ldap_schema_append_objectclass Appends object class to the list of schema's object classes.

Parameters
schema in Current schema we working with.
objectclass in Object class we want to add to schema.
Returns
  • false - on error.
  • true - on success.

enum OperationReturnCode ldap_schema_load(struct ldap_connection_ctx_t* connection)

ldap_schema_load Loads the schema from the connection depending on the type of directory.

Parameters
connection in Connection to work with.
Returns
  • RETURN_CODE_SUCCESS on success.
  • RETURN_CODE_FAILURE on failure.

bool ldap_schema_ready(struct ldap_connection_ctx_t* connection)

ldap_schema_ready Verifies the schema is fully loaded and ready for use.

Parameters
connection in Connection to work with.
Returns
  • false - if schema is not ready.
  • true - if schema is ready.