Logo Search packages:      
Sourcecode: ldb version File versions  Download package

ldb.h File Reference


Detailed Description

Samba's ldb database

This header file provides the main API for ldb.

Definition in file ldb.h.

Go to the source code of this file.

Classes

struct  ldb_add
struct  ldb_asq_control
struct  ldb_control
struct  ldb_debug_ops
struct  ldb_delete
struct  ldb_dirsync_control
struct  ldb_extended
struct  ldb_extended_dn_control
struct  ldb_handle
struct  ldb_ldif
struct  ldb_message
struct  ldb_message_element
struct  ldb_modify
struct  ldb_paged_control
struct  ldb_parse_tree
struct  ldb_register_control
struct  ldb_register_partition
struct  ldb_rename
struct  ldb_reply
struct  ldb_request
struct  ldb_result
struct  ldb_schema_attribute
struct  ldb_schema_syntax
struct  ldb_sd_flags_control
struct  ldb_search
struct  ldb_search_options_control
struct  ldb_sequence_number
struct  ldb_server_sort_control
struct  ldb_sort_resp_control
struct  ldb_utf8_fns
struct  ldb_val
struct  ldb_vlv_req_control
struct  ldb_vlv_resp_control

Defines

#define ldb_attr_cmp(a, b)   strcasecmp(a, b)
#define LDB_ATTR_FLAG_ALLOCATED   (1<<1)
#define LDB_ATTR_FLAG_CONSTRUCTED   (1<<1)
#define LDB_ATTR_FLAG_HIDDEN   (1<<0)
#define LDB_CONTROL_ASQ_OID   "1.2.840.113556.1.4.1504"
#define LDB_CONTROL_DIRSYNC_OID   "1.2.840.113556.1.4.841"
#define LDB_CONTROL_DOMAIN_SCOPE_OID   "1.2.840.113556.1.4.1339"
#define LDB_CONTROL_EXTENDED_DN_OID   "1.2.840.113556.1.4.529"
#define LDB_CONTROL_NOTIFICATION_OID   "1.2.840.113556.1.4.528"
#define LDB_CONTROL_PAGED_RESULTS_OID   "1.2.840.113556.1.4.319"
#define LDB_CONTROL_PERMISSIVE_MODIFY_OID   "1.2.840.113556.1.4.1413"
#define LDB_CONTROL_SD_FLAGS_OID   "1.2.840.113556.1.4.801"
#define LDB_CONTROL_SEARCH_OPTIONS_OID   "1.2.840.113556.1.4.1340"
#define LDB_CONTROL_SERVER_SORT_OID   "1.2.840.113556.1.4.473"
#define LDB_CONTROL_SHOW_DELETED_OID   "1.2.840.113556.1.4.417"
#define LDB_CONTROL_SORT_RESP_OID   "1.2.840.113556.1.4.474"
#define LDB_CONTROL_VLV_REQ_OID   "2.16.840.1.113730.3.4.9"
#define LDB_CONTROL_VLV_RESP_OID   "2.16.840.1.113730.3.4.10"
#define LDB_EXTENDED_DYNAMIC_OID   "1.3.6.1.4.1.1466.101.119.1"
#define LDB_EXTENDED_FAST_BIND_OID   "1.2.840.113556.1.4.1781"
#define LDB_EXTENDED_START_TLS_OID   "1.3.6.1.4.1.1466.20037"
#define LDB_FLAG_MOD_ADD   1
#define LDB_FLAG_MOD_DELETE   3
#define LDB_FLAG_MOD_MASK   0x3
#define LDB_FLAG_MOD_REPLACE   2
#define LDB_FLG_NOSYNC   2
#define LDB_FLG_RDONLY   1
#define LDB_FLG_RECONNECT   4
#define LDB_OID_COMPARATOR_AND   "1.2.840.113556.1.4.803"
#define LDB_OID_COMPARATOR_OR   "1.2.840.113556.1.4.804"
#define LDB_SEARCH_OPTION_DOMAIN_SCOPE   0x00000001
#define LDB_SEARCH_OPTION_PHANTOM_ROOT   0x00000002
#define LDB_SYNTAX_DIRECTORY_STRING   "1.3.6.1.4.1.1466.115.121.1.15"
#define LDB_SYNTAX_DN   "1.3.6.1.4.1.1466.115.121.1.12"
#define LDB_SYNTAX_INTEGER   "1.3.6.1.4.1.1466.115.121.1.27"
#define LDB_SYNTAX_OBJECTCLASS   "LDB_SYNTAX_OBJECTCLASS"
#define LDB_SYNTAX_OCTET_STRING   "1.3.6.1.4.1.1466.115.121.1.40"
#define LDB_SYNTAX_UTC_TIME   "1.3.6.1.4.1.1466.115.121.1.53"

Typedefs

typedef int(* ldb_attr_comparison_t )(struct ldb_context *, void *mem_ctx, const struct ldb_val *, const struct ldb_val *)
typedef int(* ldb_attr_handler_t )(struct ldb_context *, void *mem_ctx, const struct ldb_val *, struct ldb_val *)
typedef int(* ldb_qsort_cmp_fn_t )(void *v1, void *v2, void *opaque)
typedef int(* ldb_request_callback_t )(struct ldb_context *, void *, struct ldb_reply *)

Enumerations

enum  ldb_changetype { LDB_CHANGETYPE_NONE = 0, LDB_CHANGETYPE_ADD, LDB_CHANGETYPE_DELETE, LDB_CHANGETYPE_MODIFY }
enum  ldb_debug_level { LDB_DEBUG_FATAL, LDB_DEBUG_ERROR, LDB_DEBUG_WARNING, LDB_DEBUG_TRACE }
enum  ldb_parse_op {
  LDB_OP_AND = 1, LDB_OP_OR = 2, LDB_OP_NOT = 3, LDB_OP_EQUALITY = 4,
  LDB_OP_SUBSTRING = 5, LDB_OP_GREATER = 6, LDB_OP_LESS = 7, LDB_OP_PRESENT = 8,
  LDB_OP_APPROX = 9, LDB_OP_EXTENDED = 10
}
enum  ldb_reply_type { LDB_REPLY_ENTRY, LDB_REPLY_REFERRAL, LDB_REPLY_EXTENDED, LDB_REPLY_DONE }
enum  ldb_request_type {
  LDB_SEARCH, LDB_ADD, LDB_MODIFY, LDB_DELETE,
  LDB_RENAME, LDB_EXTENDED, LDB_SEQUENCE_NUMBER, LDB_REQ_REGISTER_CONTROL,
  LDB_REQ_REGISTER_PARTITION
}
enum  ldb_scope { LDB_SCOPE_DEFAULT = -1, LDB_SCOPE_BASE = 0, LDB_SCOPE_ONELEVEL = 1, LDB_SCOPE_SUBTREE = 2 }
enum  ldb_state { LDB_ASYNC_INIT, LDB_ASYNC_PENDING, LDB_ASYNC_DONE }
enum  ldb_wait_type { LDB_WAIT_ALL, LDB_WAIT_NONE }

Functions

int ldb_add (struct ldb_context *ldb, const struct ldb_message *message)
char * ldb_attr_casefold (void *mem_ctx, const char *s)
int ldb_attr_dn (const char *attr)
int ldb_attr_in_list (const char *const *attrs, const char *attr)
const char ** ldb_attr_list_copy (void *mem_ctx, const char *const *attrs)
const char ** ldb_attr_list_copy_add (void *mem_ctx, const char *const *attrs, const char *new_attr)
int ldb_base64_decode (char *s)
char * ldb_base64_encode (void *mem_ctx, const char *buf, int len)
char * ldb_binary_encode (void *ctx, struct ldb_val val)
char * ldb_binary_encode_string (void *mem_ctx, const char *string)
int ldb_build_add_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, const struct ldb_message *message, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
int ldb_build_del_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, struct ldb_dn *dn, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
int ldb_build_extended_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, const char *oid, void *data, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
int ldb_build_mod_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, const struct ldb_message *message, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
int ldb_build_rename_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, struct ldb_dn *olddn, struct ldb_dn *newdn, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
int ldb_build_search_req (struct ldb_request **ret_req, struct ldb_context *ldb, void *mem_ctx, struct ldb_dn *base, enum ldb_scope scope, const char *expression, const char *const *attrs, struct ldb_control **controls, void *context, ldb_request_callback_t callback)
char * ldb_casefold (struct ldb_context *ldb, void *mem_ctx, const char *s)
int ldb_connect (struct ldb_context *ldb, const char *url, unsigned int flags, const char *options[])
int ldb_delete (struct ldb_context *ldb, struct ldb_dn *dn)
bool ldb_dn_add_base (struct ldb_dn *dn, struct ldb_dn *base)
bool ldb_dn_add_base_fmt (struct ldb_dn *dn, const char *base_fmt,...) PRINTF_ATTRIBUTE(2
bool bool ldb_dn_add_child (struct ldb_dn *dn, struct ldb_dn *child)
bool ldb_dn_add_child_fmt (struct ldb_dn *dn, const char *child_fmt,...) PRINTF_ATTRIBUTE(2
char * ldb_dn_alloc_casefold (void *mem_ctx, struct ldb_dn *dn)
char * ldb_dn_alloc_linearized (void *mem_ctx, struct ldb_dn *dn)
char * ldb_dn_canonical_ex_string (void *mem_ctx, struct ldb_dn *dn)
char * ldb_dn_canonical_string (void *mem_ctx, struct ldb_dn *dn)
bool ldb_dn_check_special (struct ldb_dn *dn, const char *check)
int ldb_dn_cmp (struct ldb_context *ldb, const char *dn1, const char *dn2)
int ldb_dn_compare (struct ldb_dn *edn0, struct ldb_dn *edn1)
int ldb_dn_compare_base (struct ldb_dn *base, struct ldb_dn *dn)
struct ldb_dn * ldb_dn_copy (void *mem_ctx, struct ldb_dn *dn)
char * ldb_dn_escape_value (void *mem_ctx, struct ldb_val value)
const char * ldb_dn_get_casefold (struct ldb_dn *dn)
int ldb_dn_get_comp_num (struct ldb_dn *dn)
const char * ldb_dn_get_component_name (struct ldb_dn *dn, unsigned int num)
struct ldb_valldb_dn_get_component_val (struct ldb_dn *dn, unsigned int num)
const char * ldb_dn_get_linearized (struct ldb_dn *dn)
struct ldb_dn * ldb_dn_get_parent (void *mem_ctx, struct ldb_dn *dn)
const char * ldb_dn_get_rdn_name (struct ldb_dn *dn)
struct ldb_valldb_dn_get_rdn_val (struct ldb_dn *dn)
bool ldb_dn_is_null (struct ldb_dn *dn)
bool ldb_dn_is_special (struct ldb_dn *dn)
bool ldb_dn_is_valid (struct ldb_dn *dn)
struct ldb_dn * ldb_dn_new (void *mem_ctx, struct ldb_context *ldb, const char *dn)
struct ldb_dn * ldb_dn_new_fmt (void *mem_ctx, struct ldb_context *ldb, const char *new_fmt,...) PRINTF_ATTRIBUTE(3
bool bool ldb_dn_remove_base_components (struct ldb_dn *dn, unsigned int num)
bool ldb_dn_remove_child_components (struct ldb_dn *dn, unsigned int num)
int ldb_dn_set_component (struct ldb_dn *dn, int num, const char *name, const struct ldb_val val)
struct ldb_dn *bool ldb_dn_validate (struct ldb_dn *dn)
const char * ldb_errstring (struct ldb_context *ldb)
int ldb_extended (struct ldb_context *ldb, const char *oid, void *data, struct ldb_result **res)
int ldb_extended_default_callback (struct ldb_context *ldb, void *context, struct ldb_reply *ares)
char * ldb_filter_from_tree (void *mem_ctx, struct ldb_parse_tree *tree)
struct ldb_dn * ldb_get_config_basedn (struct ldb_context *ldb)
struct ldb_dn * ldb_get_default_basedn (struct ldb_context *ldb)
void * ldb_get_opaque (struct ldb_context *ldb, const char *name)
struct ldb_dn * ldb_get_root_basedn (struct ldb_context *ldb)
struct ldb_dn * ldb_get_schema_basedn (struct ldb_context *ldb)
int ldb_global_init (void)
struct ldb_context * ldb_init (void *mem_ctx)
struct ldb_ldifldb_ldif_read (struct ldb_context *ldb, int(*fgetc_fn)(void *), void *private_data)
struct ldb_ldifldb_ldif_read_file (struct ldb_context *ldb, FILE *f)
void ldb_ldif_read_free (struct ldb_context *ldb, struct ldb_ldif *msg)
struct ldb_ldifldb_ldif_read_string (struct ldb_context *ldb, const char **s)
int ldb_ldif_write (struct ldb_context *ldb, int(*fprintf_fn)(void *, const char *,...) PRINTF_ATTRIBUTE(2, 3), void *private_data, const struct ldb_ldif *ldif)
int ldb_ldif_write_file (struct ldb_context *ldb, FILE *f, const struct ldb_ldif *msg)
int ldb_modify (struct ldb_context *ldb, const struct ldb_message *message)
int ldb_msg_add (struct ldb_message *msg, const struct ldb_message_element *el, int flags)
int ldb_msg_add_empty (struct ldb_message *msg, const char *attr_name, int flags, struct ldb_message_element **return_el)
int ldb_msg_add_fmt (struct ldb_message *msg, const char *attr_name, const char *fmt,...) PRINTF_ATTRIBUTE(3
int ldb_msg_add_steal_string (struct ldb_message *msg, const char *attr_name, char *str)
int ldb_msg_add_steal_value (struct ldb_message *msg, const char *attr_name, struct ldb_val *val)
int ldb_msg_add_string (struct ldb_message *msg, const char *attr_name, const char *str)
int ldb_msg_add_value (struct ldb_message *msg, const char *attr_name, const struct ldb_val *val, struct ldb_message_element **return_el)
struct ldb_messageldb_msg_canonicalize (struct ldb_context *ldb, const struct ldb_message *msg)
int ldb_msg_check_string_attribute (const struct ldb_message *msg, const char *name, const char *value)
struct ldb_messageldb_msg_copy (void *mem_ctx, const struct ldb_message *msg)
int ldb_msg_copy_attr (struct ldb_message *msg, const char *attr, const char *replace)
struct ldb_messageldb_msg_copy_shallow (void *mem_ctx, const struct ldb_message *msg)
struct ldb_messageldb_msg_diff (struct ldb_context *ldb, struct ldb_message *msg1, struct ldb_message *msg2)
int int ldb_msg_element_compare (struct ldb_message_element *el1, struct ldb_message_element *el2)
int ldb_msg_find_attr_as_bool (const struct ldb_message *msg, const char *attr_name, int default_value)
struct ldb_dn * ldb_msg_find_attr_as_dn (struct ldb_context *ldb, void *mem_ctx, const struct ldb_message *msg, const char *attr_name)
double ldb_msg_find_attr_as_double (const struct ldb_message *msg, const char *attr_name, double default_value)
int ldb_msg_find_attr_as_int (const struct ldb_message *msg, const char *attr_name, int default_value)
int64_t ldb_msg_find_attr_as_int64 (const struct ldb_message *msg, const char *attr_name, int64_t default_value)
const char * ldb_msg_find_attr_as_string (const struct ldb_message *msg, const char *attr_name, const char *default_value)
unsigned int ldb_msg_find_attr_as_uint (const struct ldb_message *msg, const char *attr_name, unsigned int default_value)
uint64_t ldb_msg_find_attr_as_uint64 (const struct ldb_message *msg, const char *attr_name, uint64_t default_value)
struct ldb_message_elementldb_msg_find_element (const struct ldb_message *msg, const char *attr_name)
struct ldb_valldb_msg_find_ldb_val (const struct ldb_message *msg, const char *attr_name)
struct ldb_valldb_msg_find_val (const struct ldb_message_element *el, struct ldb_val *val)
struct ldb_messageldb_msg_new (void *mem_ctx)
void ldb_msg_remove_attr (struct ldb_message *msg, const char *attr)
int ldb_msg_rename_attr (struct ldb_message *msg, const char *attr, const char *replace)
int ldb_msg_sanity_check (struct ldb_context *ldb, const struct ldb_message *msg)
void ldb_msg_sort_elements (struct ldb_message *msg)
struct ldb_control ** ldb_parse_control_strings (struct ldb_context *ldb, void *mem_ctx, const char **control_strings)
struct ldb_parse_tree * ldb_parse_tree (void *mem_ctx, const char *s)
void ldb_parse_tree_attr_replace (struct ldb_parse_tree *tree, const char *attr, const char *replace)
void ldb_qsort (void *const pbase, size_t total_elems, size_t size, void *opaque, ldb_qsort_cmp_fn_t cmp)
int ldb_rename (struct ldb_context *ldb, struct ldb_dn *olddn, struct ldb_dn *newdn)
int ldb_request (struct ldb_context *ldb, struct ldb_request *request)
int ldb_request_add_control (struct ldb_request *req, const char *oid, bool critical, void *data)
struct ldb_control * ldb_request_get_control (struct ldb_request *req, const char *oid)
struct ldb_schema_attribute * ldb_schema_attribute_by_name (struct ldb_context *ldb, const char *name)
int ldb_search (struct ldb_context *ldb, struct ldb_dn *base, enum ldb_scope scope, const char *expression, const char *const *attrs, struct ldb_result **res)
int int ldb_search_bytree (struct ldb_context *ldb, struct ldb_dn *base, enum ldb_scope scope, struct ldb_parse_tree *tree, const char *const *attrs, struct ldb_result **res)
int ldb_search_default_callback (struct ldb_context *ldb, void *context, struct ldb_reply *ares)
int ldb_search_exp_fmt (struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct ldb_result **result, struct ldb_dn *base, enum ldb_scope scope, const char *const *attrs, const char *exp_fmt,...) PRINTF_ATTRIBUTE(7
void ldb_set_create_perms (struct ldb_context *ldb, unsigned int perms)
int ldb_set_debug (struct ldb_context *ldb, void(*debug)(void *context, enum ldb_debug_level level, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3, 0), void *context)
int ldb_set_debug_stderr (struct ldb_context *ldb)
int ldb_set_opaque (struct ldb_context *ldb, const char *name, void *value)
int ldb_set_timeout (struct ldb_context *ldb, struct ldb_request *req, int timeout)
int ldb_set_timeout_from_prev_req (struct ldb_context *ldb, struct ldb_request *oldreq, struct ldb_request *newreq)
void ldb_set_utf8_default (struct ldb_context *ldb)
void ldb_set_utf8_fns (struct ldb_context *ldb, void *context, char *(*casefold)(void *, void *, const char *))
const char * ldb_strerror (int ldb_err)
time_t ldb_string_to_time (const char *s)
time_t ldb_string_utc_to_time (const char *s)
char * ldb_timestring (void *mem_ctx, time_t t)
char * ldb_timestring_utc (void *mem_ctx, time_t t)
int ldb_transaction_cancel (struct ldb_context *ldb)
int ldb_transaction_commit (struct ldb_context *ldb)
int ldb_transaction_start (struct ldb_context *ldb)
struct ldb_val ldb_val_dup (void *mem_ctx, const struct ldb_val *v)
int ldb_val_equal_exact (const struct ldb_val *v1, const struct ldb_val *v2)
int ldb_valid_attr_name (const char *s)
int ldb_wait (struct ldb_handle *handle, enum ldb_wait_type type)


Generated by  Doxygen 1.6.0   Back to index