4 Copyright (C) Simo Sorce 2004-2006
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * Component: ldb schema module
25 * Description: add schema syntax functionality
29 * License: GNU GPL v2 or Later
35 see ldap_server/devdocs/AD-syntaxes.txt
38 enum schema_internal_syntax {
39 SCHEMA_AS_BOOLEAN = 1,
40 SCHEMA_AS_INTEGER = 2,
41 SCHEMA_AS_OCTET_STRING = 3,
44 SCHEMA_AS_ENUMERATION = 6,
45 SCHEMA_AS_NUMERIC_STRING = 7,
46 SCHEMA_AS_PRINTABLE_STRING = 8,
47 SCHEMA_AS_CASE_IGNORE_STRING = 9,
48 SCHEMA_AS_IA5_STRING = 10,
49 SCHEMA_AS_UTC_TIME = 11,
50 SCHEMA_AS_GENERALIZED_TIME = 12,
51 SCHEMA_AS_CASE_SENSITIVE_STRING = 13,
52 SCHEMA_AS_DIRECTORY_STRING = 14,
53 SCHEMA_AS_LARGE_INTEGER = 15,
54 SCHEMA_AS_OBJECT_SECURITY_DESCRIPTOR = 16,
56 SCHEMA_AS_DN_BINARY = 18,
57 SCHEMA_AS_OR_NAME = 19,
58 SCHEMA_AS_REPLICA_LINK = 20,
59 SCHEMA_AS_PRESENTATION_ADDRESS = 21,
60 SCHEMA_AS_ACCESS_POINT = 22,
61 SCHEMA_AS_DN_STRING = 23
64 int map_schema_syntax(uint32_t om_syntax,
65 const char *attr_syntax,
66 const struct ldb_val *om_class,
67 enum schema_internal_syntax *syntax);
69 int schema_validate(struct ldb_context *ldb,
70 struct ldb_message_element *el,
71 enum schema_internal_syntax type,
72 bool single, int min, int max);