⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ldap_schema.3

📁 开放源码的ldap系统
💻 3
字号:
.TH LDAP_SCHEMA 3 "4 June 2000" "OpenLDAP LDVERSION".\" $OpenLDAP: pkg/ldap/doc/man/man3/ldap_schema.3,v 1.1.2.3 2000/09/18 16:09:20 kurt Exp $.\" Copyright 2000 The OpenLDAP Foundation All Rights Reserved..\" Copying restrictions apply.  See COPYRIGHT/LICENSE..SH NAMEldap_str2syntax, ldap_syntax2str, ldap_syntax2name, ldap_syntax_free,ldap_str2matchingrule, ldap_matchingrule2str, ldap_matchingrule2name,ldap_matchingrule_free,ldap_str2attributetype, ldap_attributetype2str,ldap_attributetype2name, ldap_attributetype_free,ldap_str2objectclass, ldap_objectclass2str, ldap_objectclass2name,ldap_objectclass_free,ldap_scherr2str \- Schema definition handling routines.SH SYNOPSIS.nf.ft B#include <ldap.h>.LP.ft BLDAPSyntax * ldap_str2syntax(s, code, errp, flags).ftconst char * s;int * code;const char ** errp;const int flags;.LP.ft Bchar * ldap_syntax2str(syn).ftconst LDAPSyntax * syn;.LP.ft Bconst char * ldap_syntax2name(syn).ftLDAPSyntax * syn;.LP.ft Bldap_syntax_free(syn).ftLDAPSyntax * syn;.LP.ft BLDAPMatchingRule * ldap_str2matchingrule(s, code, errp, flags).ftconst char * s;int * code;const char ** errp;const int flags;.LP.ft Bchar * ldap_matchingrule2str(mr);.ftconst LDAPMatchingRule * mr;.LP.ft Bconst char * ldap_matchingrule2name(mr).ftLDAPMatchingRule * mr;.LP.ft Bldap_matchingrule_free(mr).ftLDAPMatchingRule * mr;.LP.ft BLDAPAttributeType * ldap_str2attributetype(s, code, errp, flags).ftconst char * s;int * code;const char ** errp;const int flags;.LP.ft Bchar * ldap_attributetype2str(at).ftconst LDAPAttributeType * at;.LP.ft Bconst char * ldap_attributetype2name(at).ftLDAPAttributeType * at;.LP.ft Bldap_attributetype_free(at).ftLDAPAttributeType * at;.LP.ft BLDAPObjectClass * ldap_str2objectclass(s, code, errp, flags).ftconst char * s;int * code;const char ** errp;const int flags;.LP.ft Bchar * ldap_objectclass2str(oc).ftconst LDAPObjectClass * oc;.LP.ft Bconst char * ldap_objectclass2name(oc).ftLDAPObjectClass * oc;.LP.ft Bldap_objectclass_free(oc).ftLDAPObjectClass * oc;.LP.ft Bchar * ldap_scherr2str(code).ftint code;.SH DESCRIPTIONThese routines are used to parse schema definitions in the syntaxdefined in RFC 2252 into structs and handle these structs.  Theseroutines handle four kinds of definitions: syntaxes, matching rules,attribute types and objectclasses.  For each definition kind, fourroutines are provided..LP.B ldap_str2xxx()takes a definition in RFC 2252 format in argument.IR sas a NUL-terminated string and returns, if possible, a pointer to anewly allocated struct of the appropriate kind.  The caller isresponsible for freeing the struct by calling.B ldap_xxx_free()when not needed any longer.  The routine returns NULL if some problemhappened.  In this case, the integer pointed at by argument.IR codewill receive an error code (see below the description of.B ldap_scherr2str()for an explanation of the values) and a pointer to a NUL-terminatedstring will be placed where requested by argument.IR errp, indicating where in argument.IR sthe error happened, so it must not be freed by the caller.  Argument.IR flagsis a bit mask of parsing options controlling the relaxation of thesyntax recognized.  The following values are defined:.TP.B LDAP_SCHEMA_ALLOW_NONEstrict parsing according to RFC 2252..TP.B LDAP_SCHEMA_ALLOW_NO_OIDpermit definitions that do not contain an initial OID..TP.B LDAP_SCHEMA_ALLOW_QUOTEDpermit quotes around some items that should not have them..TP.B LDAP_SCHEMA_ALLOW_DESCRpermit a.B descrinstead of a numeric OID in places where the syntax expect the latter..TP.B LDAP_SCHEMA_ALLOW_DESCR_PREFIXpermit that the initial numeric OID contains a prefix in.B descrformat..TP.B LDAP_SCHEMA_ALLOW_ALLbe very liberal, include all options..LPThe structures returned are as follows:.sp.RS.nf.ne 7.ta 8n 16n 32ntypedef struct ldap_schema_extension_item {	char *lsei_name;	/* Extension name */	char **lsei_values;	/* Extension values */} LDAPSchemaExtensionItem;typedef struct ldap_syntax {	char *syn_oid;		/* OID */	char **syn_names;	/* Names */	char *syn_desc;		/* Description */	LDAPSchemaExtensionItem **syn_extensions; /* Extension */} LDAPSyntax;typedef struct ldap_matchingrule {	char *mr_oid;		/* OID */	char **mr_names;	/* Names */	char *mr_desc;		/* Description */	int  mr_obsolete;	/* Is obsolete? */	char *mr_syntax_oid;	/* Syntax of asserted values */	LDAPSchemaExtensionItem **mr_extensions; /* Extensions */} LDAPMatchingRule;typedef struct ldap_attributetype {	char *at_oid;		/* OID */	char **at_names;	/* Names */	char *at_desc;		/* Description */	int  at_obsolete;	/* Is obsolete? */	char *at_sup_oid;	/* OID of superior type */	char *at_equality_oid;	/* OID of equality matching rule */	char *at_ordering_oid;	/* OID of ordering matching rule */	char *at_substr_oid;	/* OID of substrings matching rule */	char *at_syntax_oid;	/* OID of syntax of values */	int  at_syntax_len;	/* Suggested minimum maximum length */	int  at_single_value;	/* Is single-valued?  */	int  at_collective;	/* Is collective? */	int  at_no_user_mod;	/* Are changes forbidden through LDAP? */	int  at_usage;		/* Usage, see below */	LDAPSchemaExtensionItem **at_extensions; /* Extensions */} LDAPAttributeType;typedef struct ldap_objectclass {	char *oc_oid;		/* OID */	char **oc_names;	/* Names */	char *oc_desc;		/* Description */	int  oc_obsolete;	/* Is obsolete? */	char **oc_sup_oids;	/* OIDs of superior classes */	int  oc_kind;		/* Kind, see below */	char **oc_at_oids_must;	/* OIDs of required attribute types */	char **oc_at_oids_may;	/* OIDs of optional attribute types */	LDAPSchemaExtensionItem **oc_extensions; /* Extensions */} LDAPObjectClass;.ta.fi.RE.PPSome integer fields (those described with a question mark) have atruth value, for these fields the possible values are:.TP.B LDAP_SCHEMA_NOThe answer to the question is no..TP.B LDAP_SCHEMA_YESThe answer to the question is yes..LPFor attribute types, the following usages are possible:.TP.B LDAP_SCHEMA_USER_APPLICATIONSthe attribute type is non-operational..TP.B LDAP_SCHEMA_DIRECTORY_OPERATIONthe attribute type is operational and is pertinent to the directoryitself, i.e. it has the same value on all servers that master theentry containing this attribute type..TP.B LDAP_SCHEMA_DISTRIBUTED_OPERATIONthe attribute type is operational and is pertinent to replication,shadowing or other distributed directory aspect.  TBC..TP.B LDAP_SCHEMA_DSA_OPERATIONthe attribute type is operational and is pertinent to the directoryserver itself, i.e. it may have different values for the same entrywhen retrieved from different servers that master the entry..LPObject classes can be of three kinds:.TP.B LDAP_SCHEMA_ABSTRACTthe object class is abstract, i.e. there cannot be entries of thisclass alone..TP.B LDAP_SCHEMA_STRUCTURALthe object class is structural, i.e. it describes the main role of theentry.  On some servers, once the entry is created the set ofstructural object classes assigned cannot be changed: none of thosepresent can be removed and none other can be added..TP.B LDAP_SCHEMA_AUXILIARYthe object class is auxiliary, i.e. it is intended to go with other,structural, object classes.  These can be added or removed at any timeif attribute types are added or removed at the same time as needed bythe set of object classes resulting from the operation..LPRoutines.B ldap_xxx2name()return a canonical name for the definition..LPRoutines.B ldap_xxx2str()return a string representation in the format described by RFC 2252 ofthe struct passed in the argument.  The string is a newly allocatedstring that must be freed by the caller.  These routines may returnNULL if no memory can be allocated for the string..LP.B ldap_scherr2str()returns a NUL-terminated string with a text description of the errorfound.  This is a pointer to a static area, so it must not be freed bythe caller.  The argument.IR codecomes from one of the parsing routines and can adopt the followingvalues:.TP.B LDAP_SCHERR_OUTOFMEMOut of memory..TP.B LDAP_SCHERR_UNEXPTOKENUnexpected token..TP.B LDAP_SCHERR_NOLEFTPARENMissing opening parenthesis..TP.B LDAP_SCHERR_NORIGHTPARENMissing closing parenthesis..TP.B LDAP_SCHERR_NODIGITExpecting digit..TP.B LDAP_SCHERR_BADNAMEExpecting a name..TP.B LDAP_SCHERR_BADDESCBad description..TP.B LDAP_SCHERR_BADSUPBad superiors..TP.B LDAP_SCHERR_DUPOPTDuplicate option..TP.B LDAP_SCHERR_EMPTYUnexpected end of data..SH SEE ALSO.BR ldap (3),.SH ACKNOWLEDGEMENTS.B	OpenLDAPis developed and maintained by The OpenLDAP Project (http://www.openldap.org/)..B	OpenLDAPis derived from University of Michigan LDAP 3.3 Release.  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -