1999-08-31 09:17:01 +08:00
|
|
|
/* $OpenLDAP$ */
|
1999-05-24 09:38:57 +08:00
|
|
|
/*
|
2002-01-05 04:40:29 +08:00
|
|
|
* Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
|
1999-05-24 09:38:57 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2001-05-29 11:29:53 +08:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License. A copy of this license is available at
|
|
|
|
* http://www.OpenLDAP.org/license.html or in file LICENSE in the
|
|
|
|
* top-level directory of the distribution.
|
1999-05-24 09:38:57 +08:00
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* ldap-schema.h - Header for basic schema handling functions that can be
|
|
|
|
* used by both clients and servers.
|
2001-07-22 07:13:04 +08:00
|
|
|
* these routines should be renamed ldap_x_...
|
1999-05-24 09:38:57 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LDAP_SCHEMA_H
|
|
|
|
#define _LDAP_SCHEMA_H 1
|
|
|
|
|
|
|
|
#include <ldap_cdefs.h>
|
|
|
|
|
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
|
|
/* Codes for parsing errors */
|
|
|
|
|
1999-05-26 21:52:11 +08:00
|
|
|
#define LDAP_SCHERR_OUTOFMEM 1
|
|
|
|
#define LDAP_SCHERR_UNEXPTOKEN 2
|
|
|
|
#define LDAP_SCHERR_NOLEFTPAREN 3
|
|
|
|
#define LDAP_SCHERR_NORIGHTPAREN 4
|
|
|
|
#define LDAP_SCHERR_NODIGIT 5
|
|
|
|
#define LDAP_SCHERR_BADNAME 6
|
|
|
|
#define LDAP_SCHERR_BADDESC 7
|
|
|
|
#define LDAP_SCHERR_BADSUP 8
|
|
|
|
#define LDAP_SCHERR_DUPOPT 9
|
1999-05-30 07:57:39 +08:00
|
|
|
#define LDAP_SCHERR_EMPTY 10
|
1999-05-24 09:38:57 +08:00
|
|
|
|
2000-05-22 07:32:39 +08:00
|
|
|
typedef struct ldap_schema_extension_item {
|
|
|
|
char *lsei_name;
|
|
|
|
char **lsei_values;
|
2000-07-23 01:28:45 +08:00
|
|
|
} LDAPSchemaExtensionItem;
|
2000-05-22 07:32:39 +08:00
|
|
|
|
1999-05-31 20:02:43 +08:00
|
|
|
typedef struct ldap_syntax {
|
|
|
|
char *syn_oid; /* REQUIRED */
|
2000-05-29 06:45:56 +08:00
|
|
|
char **syn_names; /* OPTIONAL */
|
1999-05-31 20:02:43 +08:00
|
|
|
char *syn_desc; /* OPTIONAL */
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSchemaExtensionItem **syn_extensions; /* OPTIONAL */
|
|
|
|
} LDAPSyntax;
|
1999-05-31 20:02:43 +08:00
|
|
|
|
1999-06-14 21:37:59 +08:00
|
|
|
typedef struct ldap_matchingrule {
|
|
|
|
char *mr_oid; /* REQUIRED */
|
|
|
|
char **mr_names; /* OPTIONAL */
|
|
|
|
char *mr_desc; /* OPTIONAL */
|
|
|
|
int mr_obsolete; /* OPTIONAL */
|
|
|
|
char *mr_syntax_oid; /* REQUIRED */
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSchemaExtensionItem **mr_extensions; /* OPTIONAL */
|
|
|
|
} LDAPMatchingRule;
|
1999-06-14 21:37:59 +08:00
|
|
|
|
2000-10-23 20:25:43 +08:00
|
|
|
typedef struct ldap_matchingruleuse {
|
|
|
|
char *mru_oid; /* REQUIRED */
|
|
|
|
char **mru_names; /* OPTIONAL */
|
|
|
|
char *mru_desc; /* OPTIONAL */
|
|
|
|
int mru_obsolete; /* OPTIONAL */
|
|
|
|
char **mru_applies_oids; /* REQUIRED */
|
|
|
|
LDAPSchemaExtensionItem **mru_extensions; /* OPTIONAL */
|
|
|
|
} LDAPMatchingRuleUse;
|
|
|
|
|
1999-05-24 09:38:57 +08:00
|
|
|
typedef struct ldap_attributetype {
|
|
|
|
char *at_oid; /* REQUIRED */
|
|
|
|
char **at_names; /* OPTIONAL */
|
|
|
|
char *at_desc; /* OPTIONAL */
|
|
|
|
int at_obsolete; /* 0=no, 1=yes */
|
|
|
|
char *at_sup_oid; /* OPTIONAL */
|
|
|
|
char *at_equality_oid; /* OPTIONAL */
|
|
|
|
char *at_ordering_oid; /* OPTIONAL */
|
|
|
|
char *at_substr_oid; /* OPTIONAL */
|
|
|
|
char *at_syntax_oid; /* OPTIONAL */
|
|
|
|
int at_syntax_len; /* OPTIONAL */
|
|
|
|
int at_single_value; /* 0=no, 1=yes */
|
|
|
|
int at_collective; /* 0=no, 1=yes */
|
|
|
|
int at_no_user_mod; /* 0=no, 1=yes */
|
|
|
|
int at_usage; /* 0=userApplications, 1=directoryOperation,
|
|
|
|
2=distributedOperation, 3=dSAOperation */
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSchemaExtensionItem **at_extensions; /* OPTIONAL */
|
|
|
|
} LDAPAttributeType;
|
1999-05-24 09:38:57 +08:00
|
|
|
|
|
|
|
typedef struct ldap_objectclass {
|
|
|
|
char *oc_oid; /* REQUIRED */
|
|
|
|
char **oc_names; /* OPTIONAL */
|
|
|
|
char *oc_desc; /* OPTIONAL */
|
|
|
|
int oc_obsolete; /* 0=no, 1=yes */
|
|
|
|
char **oc_sup_oids; /* OPTIONAL */
|
|
|
|
int oc_kind; /* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY */
|
|
|
|
char **oc_at_oids_must; /* OPTIONAL */
|
1999-05-26 21:52:11 +08:00
|
|
|
char **oc_at_oids_may; /* OPTIONAL */
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSchemaExtensionItem **oc_extensions; /* OPTIONAL */
|
|
|
|
} LDAPObjectClass;
|
1999-05-24 09:38:57 +08:00
|
|
|
|
1999-05-28 02:18:36 +08:00
|
|
|
#define LDAP_SCHEMA_NO 0
|
|
|
|
#define LDAP_SCHEMA_YES 1
|
|
|
|
|
|
|
|
#define LDAP_SCHEMA_USER_APPLICATIONS 0
|
|
|
|
#define LDAP_SCHEMA_DIRECTORY_OPERATION 1
|
|
|
|
#define LDAP_SCHEMA_DISTRIBUTED_OPERATION 2
|
|
|
|
#define LDAP_SCHEMA_DSA_OPERATION 3
|
|
|
|
|
|
|
|
#define LDAP_SCHEMA_ABSTRACT 0
|
|
|
|
#define LDAP_SCHEMA_STRUCTURAL 1
|
|
|
|
#define LDAP_SCHEMA_AUXILIARY 2
|
|
|
|
|
2000-05-29 06:45:56 +08:00
|
|
|
/*
|
|
|
|
* Flags that control how liberal the parsing routines are.
|
|
|
|
*/
|
|
|
|
#define LDAP_SCHEMA_ALLOW_NONE 0x00 /* Strict parsing */
|
|
|
|
#define LDAP_SCHEMA_ALLOW_NO_OID 0x01 /* Allow missing oid */
|
|
|
|
#define LDAP_SCHEMA_ALLOW_QUOTED 0x02 /* Allow bogus extra quotes */
|
|
|
|
#define LDAP_SCHEMA_ALLOW_DESCR 0x04 /* Allow descr instead of OID */
|
|
|
|
#define LDAP_SCHEMA_ALLOW_DESCR_PREFIX 0x08 /* Allow descr as OID prefix */
|
2001-09-19 02:44:16 +08:00
|
|
|
#define LDAP_SCHEMA_ALLOW_OID_MACRO 0x10 /* Allow OID macros in slapd */
|
2001-09-18 19:30:00 +08:00
|
|
|
#define LDAP_SCHEMA_ALLOW_ALL 0x1f /* Be very liberal in parsing */
|
2001-12-30 17:42:58 +08:00
|
|
|
#define LDAP_SCHEMA_SKIP 0x80 /* Don't malloc any result */
|
2000-05-29 06:45:56 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( LDAP_CONST char * )
|
1999-08-16 10:59:11 +08:00
|
|
|
ldap_syntax2name LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSyntax * syn ));
|
1999-08-16 10:59:11 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( LDAP_CONST char * )
|
1999-08-16 10:59:11 +08:00
|
|
|
ldap_matchingrule2name LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPMatchingRule * mr ));
|
1999-08-16 10:59:11 +08:00
|
|
|
|
2000-10-23 20:25:43 +08:00
|
|
|
LDAP_F( LDAP_CONST char * )
|
|
|
|
ldap_matchingruleuse2name LDAP_P((
|
|
|
|
LDAPMatchingRuleUse * mru ));
|
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( LDAP_CONST char * )
|
1999-08-16 10:59:11 +08:00
|
|
|
ldap_attributetype2name LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPAttributeType * at ));
|
1999-08-16 10:59:11 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( LDAP_CONST char * )
|
1999-08-16 10:59:11 +08:00
|
|
|
ldap_objectclass2name LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPObjectClass * oc ));
|
1999-08-16 10:59:11 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( void )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_syntax_free LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPSyntax * syn ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( void )
|
1999-06-14 21:37:59 +08:00
|
|
|
ldap_matchingrule_free LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPMatchingRule * mr ));
|
1999-06-14 21:37:59 +08:00
|
|
|
|
2000-10-23 20:25:43 +08:00
|
|
|
LDAP_F( void )
|
|
|
|
ldap_matchingruleuse_free LDAP_P((
|
|
|
|
LDAPMatchingRuleUse * mr ));
|
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( void )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_attributetype_free LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPAttributeType * at ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_F( void )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_objectclass_free LDAP_P((
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAPObjectClass * oc ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( LDAPObjectClass * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_str2objectclass LDAP_P((
|
|
|
|
LDAP_CONST char * s,
|
|
|
|
int * code,
|
2000-05-29 06:45:56 +08:00
|
|
|
LDAP_CONST char ** errp,
|
|
|
|
LDAP_CONST int flags ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( LDAPAttributeType * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_str2attributetype LDAP_P((
|
|
|
|
LDAP_CONST char * s,
|
|
|
|
int * code,
|
2000-05-29 06:45:56 +08:00
|
|
|
LDAP_CONST char ** errp,
|
|
|
|
LDAP_CONST int flags ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( LDAPSyntax * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_str2syntax LDAP_P((
|
|
|
|
LDAP_CONST char * s,
|
|
|
|
int * code,
|
2000-05-29 06:45:56 +08:00
|
|
|
LDAP_CONST char ** errp,
|
|
|
|
LDAP_CONST int flags ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( LDAPMatchingRule * )
|
1999-06-14 21:37:59 +08:00
|
|
|
ldap_str2matchingrule LDAP_P((
|
|
|
|
LDAP_CONST char * s,
|
|
|
|
int * code,
|
2000-05-29 06:45:56 +08:00
|
|
|
LDAP_CONST char ** errp,
|
|
|
|
LDAP_CONST int flags ));
|
1999-06-14 21:37:59 +08:00
|
|
|
|
2000-10-23 20:25:43 +08:00
|
|
|
LDAP_F( LDAPMatchingRuleUse * )
|
|
|
|
ldap_str2matchingruleuse LDAP_P((
|
|
|
|
LDAP_CONST char * s,
|
|
|
|
int * code,
|
|
|
|
LDAP_CONST char ** errp,
|
|
|
|
LDAP_CONST int flags ));
|
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( char * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_objectclass2str LDAP_P((
|
2001-12-20 05:20:46 +08:00
|
|
|
LDAPObjectClass * oc ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2001-12-26 20:31:44 +08:00
|
|
|
LDAP_F( struct berval * )
|
|
|
|
ldap_objectclass2bv LDAP_P((
|
|
|
|
LDAPObjectClass * oc, struct berval *bv ));
|
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( char * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_attributetype2str LDAP_P((
|
2001-12-20 05:20:46 +08:00
|
|
|
LDAPAttributeType * at ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2001-12-26 20:31:44 +08:00
|
|
|
LDAP_F( struct berval * )
|
|
|
|
ldap_attributetype2bv LDAP_P((
|
|
|
|
LDAPAttributeType * at, struct berval *bv ));
|
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( char * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_syntax2str LDAP_P((
|
2001-12-20 05:20:46 +08:00
|
|
|
LDAPSyntax * syn ));
|
1999-06-14 19:57:02 +08:00
|
|
|
|
2001-12-26 20:31:44 +08:00
|
|
|
LDAP_F( struct berval * )
|
|
|
|
ldap_syntax2bv LDAP_P((
|
|
|
|
LDAPSyntax * syn, struct berval *bv ));
|
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( char * )
|
1999-06-14 21:37:59 +08:00
|
|
|
ldap_matchingrule2str LDAP_P((
|
2001-12-20 05:20:46 +08:00
|
|
|
LDAPMatchingRule * mr ));
|
1999-06-14 21:37:59 +08:00
|
|
|
|
2001-12-26 20:31:44 +08:00
|
|
|
LDAP_F( struct berval * )
|
|
|
|
ldap_matchingrule2bv LDAP_P((
|
|
|
|
LDAPMatchingRule * mr, struct berval *bv ));
|
|
|
|
|
2000-10-23 20:25:43 +08:00
|
|
|
LDAP_F( char * )
|
|
|
|
ldap_matchingruleuse2str LDAP_P((
|
2001-12-20 05:20:46 +08:00
|
|
|
LDAPMatchingRuleUse * mru ));
|
2000-10-23 20:25:43 +08:00
|
|
|
|
2001-12-26 20:31:44 +08:00
|
|
|
LDAP_F( struct berval * )
|
|
|
|
ldap_matchingruleuse2bv LDAP_P((
|
|
|
|
LDAPMatchingRuleUse * mru, struct berval *bv ));
|
|
|
|
|
2000-07-23 01:28:45 +08:00
|
|
|
LDAP_F( char * )
|
1999-06-14 19:57:02 +08:00
|
|
|
ldap_scherr2str LDAP_P((
|
1999-09-05 05:15:49 +08:00
|
|
|
int code )) LDAP_GCCATTR((const));
|
1999-05-24 09:38:57 +08:00
|
|
|
|
|
|
|
LDAP_END_DECL
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|