4 Copyright (C) Simo Sorce 2005
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/>.
21 #include "dsdb/samdb/samdb.h"
23 /* Shared map for converting syntax between formats */
24 static const struct dsdb_syntax_map syntax_map[] = {
26 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.12",
28 .equality = "distinguishedNameMatch",
29 .comment = "Object(DS-DN) == a DN"
32 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.38",
34 .equality = "objectIdentifierMatch",
35 .comment = "OID String"
38 .Standard_OID = "1.2.840.113556.1.4.905",
40 .equality = "caseIgnoreMatch",
41 .substring = "caseIgnoreSubstringsMatch",
42 .comment = "Case Insensitive String"
45 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.26",
47 .equality = "caseExactIA5Match",
48 .comment = "Printable String"
51 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.36",
53 .equality = "numericStringMatch",
54 .substring = "numericStringSubstringsMatch",
55 .comment = "Numeric String"
58 .Standard_OID = "1.2.840.113556.1.4.903",
60 .equality = "distinguishedNameMatch",
61 .comment = "OctetString: Binary+DN"
64 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.7",
66 .equality = "booleanMatch",
70 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.27",
72 .equality = "integerMatch",
76 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.40",
78 .equality = "octetStringMatch",
79 .comment = "Octet String"
82 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.24",
84 .equality = "generalizedTimeMatch",
85 .comment = "Generalized Time"
88 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.53",
90 .equality = "generalizedTimeMatch",
94 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.15",
96 .equality = "caseIgnoreMatch",
97 .substring = "caseIgnoreSubstringsMatch",
98 .comment = "Directory String"
101 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.43",
102 .AD_OID = "2.5.5.13",
103 .comment = "Presentation Address"
106 .Standard_OID = "Not Found Yet",
107 .AD_OID = "2.5.5.14",
108 .equality = "distinguishedNameMatch",
109 .comment = "OctetString: String+DN"
112 .Standard_OID = "1.2.840.113556.1.4.907",
113 .AD_OID = "2.5.5.15",
114 .equality = "octetStringMatch",
115 .comment = "NT Security Descriptor"
118 .Standard_OID = "1.2.840.113556.1.4.906",
119 .AD_OID = "2.5.5.16",
120 .equality = "integerMatch",
121 .comment = "Large Integer"
124 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.40",
125 .AD_OID = "2.5.5.17",
126 .equality = "octetStringMatch",
127 .comment = "Octet String - Security Identifier (SID)"
130 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.26",
132 .equality = "caseExactIA5Match",
133 .comment = "IA5 String"
135 { .Standard_OID = NULL
140 const struct dsdb_syntax_map *find_syntax_map_by_ad_oid(const char *ad_oid)
143 for (i=0; syntax_map[i].Standard_OID; i++) {
144 if (strcasecmp(ad_oid, syntax_map[i].AD_OID) == 0) {
145 return &syntax_map[i];
151 const struct dsdb_syntax_map *find_syntax_map_by_standard_oid(const char *standard_oid)
154 for (i=0; syntax_map[i].Standard_OID; i++) {
155 if (strcasecmp(standard_oid, syntax_map[i].Standard_OID) == 0) {
156 return &syntax_map[i];