r23792: convert Samba4 to GPLv3
[garming/samba-autobuild/.git] / source4 / dsdb / samdb / ldb_modules / schema_syntax.h
1 /* 
2    ldb database library
3
4    Copyright (C) Simo Sorce  2004-2006
5
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.
10    
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.
15    
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/>.
18 */
19
20 /*
21  *  Name: ldb
22  *
23  *  Component: ldb schema module
24  *
25  *  Description: add schema syntax functionality
26  *
27  *  Author: Simo Sorce
28  *
29  *  License: GNU GPL v2 or Later
30  */
31
32
33 /* Syntax-Table
34
35    see ldap_server/devdocs/AD-syntaxes.txt
36 */
37
38 enum schema_internal_syntax {
39         SCHEMA_AS_BOOLEAN = 1,
40         SCHEMA_AS_INTEGER = 2,
41         SCHEMA_AS_OCTET_STRING = 3,
42         SCHEMA_AS_SID = 4,
43         SCHEMA_AS_OID = 5,
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,
55         SCHEMA_AS_DN = 17,
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
62 };
63
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);
68
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);
73