2006-03-14 18:03:25 +03:00
/*
Unix SMB / CIFS implementation .
interface functions for the sam database
Copyright ( C ) Andrew Tridgell 2004
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-10 06:07:03 +04:00
the Free Software Foundation ; either version 3 of the License , or
2006-03-14 18:03:25 +03:00
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
2007-07-10 06:07:03 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2006-03-14 18:03:25 +03:00
*/
# ifndef __SAMDB_H__
# define __SAMDB_H__
struct auth_session_info ;
2007-01-16 13:57:55 +03:00
struct dsdb_control_current_partition ;
2007-01-11 13:21:38 +03:00
struct dsdb_extended_replicated_object ;
struct dsdb_extended_replicated_objects ;
2007-12-02 19:09:52 +03:00
struct loadparm_context ;
2008-12-29 22:24:57 +03:00
struct tevent_context ;
2007-01-11 13:21:38 +03:00
# include "librpc/gen_ndr/security.h"
# include "lib/ldb/include/ldb.h"
2008-08-18 14:30:27 +04:00
# include "lib/ldb-samba/ldif_handlers.h"
2007-01-11 13:21:38 +03:00
# include "librpc/gen_ndr/samr.h"
# include "librpc/gen_ndr/drsuapi.h"
# include "librpc/gen_ndr/drsblobs.h"
# include "dsdb/schema/schema.h"
# include "dsdb/samdb/samdb_proto.h"
2007-12-17 06:22:44 +03:00
# include "dsdb/common/proto.h"
2009-11-05 08:57:20 +03:00
# include "dsdb/common/dsdb_dn.h"
2009-06-12 16:27:19 +04:00
# include "../libds/common/flags.h"
2006-03-14 18:03:25 +03:00
2007-01-16 13:57:55 +03:00
# define DSDB_CONTROL_CURRENT_PARTITION_OID "1.3.6.1.4.1.7165.4.3.2"
struct dsdb_control_current_partition {
/*
* this is the version of the dsdb_control_current_partition
* version 0 : initial implementation
2009-09-02 07:36:54 +04:00
* version 1 : got rid of backend and module fields
2007-01-16 13:57:55 +03:00
*/
2009-09-02 07:36:54 +04:00
# define DSDB_CONTROL_CURRENT_PARTITION_VERSION 1
2007-01-16 13:57:55 +03:00
uint32_t version ;
struct ldb_dn * dn ;
} ;
2008-09-27 04:27:54 +04:00
# define DSDB_CONTROL_REPLICATED_UPDATE_OID "1.3.6.1.4.1.7165.4.3.3"
/* DSDB_CONTROL_REPLICATED_UPDATE_OID has NULL data */
2008-12-16 11:21:55 +03:00
# define DSDB_CONTROL_DN_STORAGE_FORMAT_OID "1.3.6.1.4.1.7165.4.3.4"
/* DSDB_CONTROL_DN_STORAGE_FORMAT_OID has NULL data and behaves very
* much like LDB_CONTROL_EXTENDED_DN_OID when the DB stores an
* extended DN , and otherwise returns normal DNs */
2007-01-06 13:15:02 +03:00
# define DSDB_EXTENDED_REPLICATED_OBJECTS_OID "1.3.6.1.4.1.7165.4.4.1"
2007-01-09 14:15:56 +03:00
struct dsdb_extended_replicated_object {
struct ldb_message * msg ;
2007-01-11 12:45:30 +03:00
struct ldb_val guid_value ;
2007-01-13 13:53:12 +03:00
const char * when_changed ;
2007-01-11 12:45:30 +03:00
struct replPropertyMetaDataBlob * meta_data ;
2007-01-09 14:15:56 +03:00
} ;
2007-01-06 13:15:02 +03:00
struct dsdb_extended_replicated_objects {
2007-01-13 14:37:13 +03:00
/*
* this is the version of the dsdb_extended_replicated_objects
* version 0 : initial implementation
*/
2009-09-03 06:52:31 +04:00
# define DSDB_EXTENDED_REPLICATED_OBJECTS_VERSION 1
2007-01-13 14:37:13 +03:00
uint32_t version ;
2007-01-07 22:11:27 +03:00
struct ldb_dn * partition_dn ;
2007-01-09 14:15:56 +03:00
2007-01-12 19:02:10 +03:00
const struct repsFromTo1 * source_dsa ;
2007-01-12 16:17:25 +03:00
const struct drsuapi_DsReplicaCursor2CtrEx * uptodateness_vector ;
2007-01-09 14:15:56 +03:00
uint32_t num_objects ;
struct dsdb_extended_replicated_object * objects ;
2009-09-03 06:52:31 +04:00
uint32_t linked_attributes_count ;
const struct drsuapi_DsReplicaLinkedAttribute * linked_attributes ;
2007-01-06 13:15:02 +03:00
} ;
2007-01-18 04:31:09 +03:00
struct dsdb_naming_fsmo {
bool we_are_master ;
struct ldb_dn * master_dn ;
} ;
struct dsdb_pdc_fsmo {
bool we_are_master ;
struct ldb_dn * master_dn ;
} ;
2009-10-02 04:28:29 +04:00
# define DSDB_EXTENDED_CREATE_PARTITION_OID "1.3.6.1.4.1.7165.4.4.4"
struct dsdb_create_partition_exop {
struct ldb_dn * new_dn ;
} ;
2008-07-24 12:00:20 +04:00
/*
* the schema_dn is passed as struct ldb_dn in
* req - > op . extended . data
*/
2008-07-23 10:59:17 +04:00
# define DSDB_EXTENDED_SCHEMA_UPDATE_NOW_OID "1.3.6.1.4.1.7165.4.4.2"
2008-12-16 10:28:55 +03:00
# define DSDB_OPENLDAP_DEREFERENCE_CONTROL "1.3.6.1.4.1.4203.666.5.16"
struct dsdb_openldap_dereference {
const char * source_attribute ;
const char * * dereference_attribute ;
} ;
struct dsdb_openldap_dereference_control {
struct dsdb_openldap_dereference * * dereference ;
} ;
struct dsdb_openldap_dereference_result {
const char * source_attribute ;
const char * dereferenced_dn ;
int num_attributes ;
struct ldb_message_element * attributes ;
} ;
struct dsdb_openldap_dereference_result_control {
struct dsdb_openldap_dereference_result * * attributes ;
} ;
2009-10-02 04:28:29 +04:00
# define DSDB_PARTITION_DN "@PARTITION"
# define DSDB_PARTITION_ATTR "partition"
2009-11-16 10:46:28 +03:00
# define DSDB_EXTENDED_DN_STORE_FORMAT_OPAQUE_NAME "dsdb_extended_dn_store_format"
struct dsdb_extended_dn_store_format {
bool store_extended_dn_in_ldb ;
} ;
2006-03-14 18:03:25 +03:00
# endif /* __SAMDB_H__ */