2006-12-17 02:19:56 +00:00
/*
Unix SMB / CIFS mplementation .
DSDB schema header
2007-03-14 19:10:21 +00:00
Copyright ( C ) Stefan Metzmacher < metze @ samba . org > 2006
2006-12-17 02:19:56 +00:00
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 02:07:03 +00:00
the Free Software Foundation ; either version 3 of the License , or
2006-12-17 02:19:56 +00: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 02:07:03 +00:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2006-12-17 02:19:56 +00:00
*/
# ifndef _DSDB_SCHEMA_H
# define _DSDB_SCHEMA_H
2006-12-30 11:51:35 +00:00
struct dsdb_attribute ;
struct dsdb_class ;
struct dsdb_schema ;
2006-12-29 10:35:44 +00:00
struct dsdb_syntax {
const char * name ;
const char * ldap_oid ;
uint32_t oMSyntax ;
struct ldb_val oMObjectClass ;
const char * attributeSyntax_oid ;
2008-08-18 10:16:45 +10:00
const char * equality ;
const char * substring ;
const char * comment ;
2008-08-18 20:30:27 +10:00
const char * ldb_syntax ;
2006-12-30 11:51:35 +00:00
WERROR ( * drsuapi_to_ldb ) ( const struct dsdb_schema * schema ,
const struct dsdb_attribute * attr ,
const struct drsuapi_DsReplicaAttribute * in ,
TALLOC_CTX * mem_ctx ,
struct ldb_message_element * out ) ;
WERROR ( * ldb_to_drsuapi ) ( const struct dsdb_schema * schema ,
const struct dsdb_attribute * attr ,
const struct ldb_message_element * in ,
TALLOC_CTX * mem_ctx ,
struct drsuapi_DsReplicaAttribute * out ) ;
2006-12-29 10:35:44 +00:00
} ;
2006-12-17 02:19:56 +00:00
struct dsdb_attribute {
struct dsdb_attribute * prev , * next ;
const char * cn ;
const char * lDAPDisplayName ;
const char * attributeID_oid ;
uint32_t attributeID_id ;
struct GUID schemaIDGUID ;
uint32_t mAPIID ;
struct GUID attributeSecurityGUID ;
uint32_t searchFlags ;
uint32_t systemFlags ;
2007-08-27 18:10:19 +00:00
bool isMemberOfPartialAttributeSet ;
2006-12-17 02:19:56 +00:00
uint32_t linkID ;
const char * attributeSyntax_oid ;
uint32_t attributeSyntax_id ;
uint32_t oMSyntax ;
struct ldb_val oMObjectClass ;
2007-08-27 18:10:19 +00:00
bool isSingleValued ;
2008-11-13 21:32:04 +01:00
uint32_t * rangeLower ;
uint32_t * rangeUpper ;
2007-08-27 18:10:19 +00:00
bool extendedCharsAllowed ;
2006-12-17 02:19:56 +00:00
uint32_t schemaFlagsEx ;
struct ldb_val msDs_Schema_Extensions ;
2007-08-27 18:10:19 +00:00
bool showInAdvancedViewOnly ;
2006-12-17 02:19:56 +00:00
const char * adminDisplayName ;
const char * adminDescription ;
const char * classDisplayName ;
2007-08-27 18:10:19 +00:00
bool isEphemeral ;
bool isDefunct ;
bool systemOnly ;
2006-12-29 10:35:44 +00:00
/* internal stuff */
const struct dsdb_syntax * syntax ;
2006-12-17 02:19:56 +00:00
} ;
struct dsdb_class {
struct dsdb_class * prev , * next ;
const char * cn ;
const char * lDAPDisplayName ;
const char * governsID_oid ;
uint32_t governsID_id ;
struct GUID schemaIDGUID ;
uint32_t objectClassCategory ;
const char * rDNAttID ;
const char * defaultObjectCategory ;
const char * subClassOf ;
2006-12-28 13:06:29 +00:00
const char * * systemAuxiliaryClass ;
2006-12-17 02:19:56 +00:00
const char * * systemPossSuperiors ;
const char * * systemMustContain ;
const char * * systemMayContain ;
2006-12-28 13:06:29 +00:00
const char * * auxiliaryClass ;
2006-12-17 02:19:56 +00:00
const char * * possSuperiors ;
const char * * mustContain ;
const char * * mayContain ;
2007-07-27 03:08:15 +00:00
const char * * possibleInferiors ;
2006-12-17 02:19:56 +00:00
const char * defaultSecurityDescriptor ;
uint32_t schemaFlagsEx ;
struct ldb_val msDs_Schema_Extensions ;
2007-08-27 18:10:19 +00:00
bool showInAdvancedViewOnly ;
2006-12-17 02:19:56 +00:00
const char * adminDisplayName ;
const char * adminDescription ;
const char * classDisplayName ;
2007-08-27 18:10:19 +00:00
bool defaultHidingValue ;
bool isDefunct ;
bool systemOnly ;
2006-12-17 02:19:56 +00:00
} ;
2006-12-21 20:51:50 +00:00
struct dsdb_schema_oid_prefix {
uint32_t id ;
const char * oid ;
size_t oid_len ;
} ;
2006-12-17 02:19:56 +00:00
struct dsdb_schema {
2006-12-21 20:51:50 +00:00
uint32_t num_prefixes ;
struct dsdb_schema_oid_prefix * prefixes ;
/*
* the last element of the prefix mapping table isn ' t a oid ,
* it starts with 0xFF and has 21 bytes and is maybe a schema
* version number
2006-12-23 10:39:26 +00:00
*
* this is the content of the schemaInfo attribute of the
* Schema - Partition head object .
2006-12-21 20:51:50 +00:00
*/
2006-12-23 10:39:26 +00:00
const char * schema_info ;
2006-12-21 20:51:50 +00:00
2006-12-17 02:19:56 +00:00
struct dsdb_attribute * attributes ;
struct dsdb_class * classes ;
2008-02-19 13:39:27 +01:00
2008-07-01 16:35:13 +02:00
struct {
bool we_are_master ;
struct ldb_dn * master_dn ;
} fsmo ;
2008-02-19 13:39:27 +01:00
struct smb_iconv_convenience * iconv_convenience ;
2006-12-17 02:19:56 +00:00
} ;
2008-07-10 15:52:44 +10:00
enum dsdb_attr_list_query {
DSDB_SCHEMA_ALL_MAY ,
DSDB_SCHEMA_ALL_MUST ,
DSDB_SCHEMA_SYS_MAY ,
DSDB_SCHEMA_SYS_MUST ,
DSDB_SCHEMA_MAY ,
2008-07-11 15:11:32 +10:00
DSDB_SCHEMA_MUST ,
DSDB_SCHEMA_ALL
2008-07-10 15:52:44 +10:00
} ;
2008-08-15 20:40:57 +10:00
enum dsdb_schema_convert_target {
TARGET_OPENLDAP ,
TARGET_FEDORA_DS ,
TARGET_AD_SCHEMA_SUBENTRY
} ;
2007-12-17 04:22:44 +01:00
# include "dsdb/schema/proto.h"
2006-12-17 02:19:56 +00:00
# endif /* _DSDB_SCHEMA_H */