4 Copyright (C) Simo Sorce 2005
6 ** NOTE! The following LGPL license applies to the ldb
7 ** library. This does NOT imply that all of Samba is released
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "ldb/include/includes.h"
29 /* Shared map for converting syntax between formats */
30 static const struct syntax_map syntax_map[] = {
32 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.12",
34 .equality = "distinguishedNameMatch",
35 .comment = "Object(DS-DN) == a DN"
38 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.38",
40 .equality = "objectIdentifierMatch",
41 .comment = "OID String"
44 .Standard_OID = "1.2.840.113556.1.4.905",
46 .equality = "caseIgnoreMatch",
47 .substring = "caseIgnoreSubstringsMatch",
48 .comment = "Case Insensitive String"
51 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.44",
53 .equality = "caseExactIA5Match",
54 .comment = "Printable String"
57 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.36",
59 .equality = "numericStringMatch",
60 .substring = "numericStringSubstringsMatch",
61 .comment = "Numeric String"
64 .Standard_OID = "1.2.840.113556.1.4.903",
66 .equality = "distinguishedNameMatch",
67 .comment = "OctetString: Binary+DN"
70 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.7",
72 .equality = "booleanMatch",
76 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.27",
78 .equality = "integerMatch",
82 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.40",
84 .equality = "octetStringMatch",
85 .comment = "Octet String"
88 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.24",
90 .equality = "generalizedTimeMatch",
91 .comment = "Generalized Time"
94 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.53",
96 .equality = "generalizedTimeMatch",
100 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.15",
101 .AD_OID = "2.5.5.12",
102 .equality = "caseIgnoreMatch",
103 .substring = "caseIgnoreSubstringsMatch",
104 .comment = "Directory String"
107 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.43",
108 .AD_OID = "2.5.5.13",
109 .comment = "Presentation Address"
112 .Standard_OID = "Not Found Yet",
113 .AD_OID = "2.5.5.14",
114 .equality = "distinguishedNameMatch",
115 .comment = "OctetString: String+DN"
118 .Standard_OID = "1.2.840.113556.1.4.907",
119 .AD_OID = "2.5.5.15",
120 .equality = "octetStringMatch",
121 .comment = "NT Security Descriptor"
124 .Standard_OID = "1.2.840.113556.1.4.906",
125 .AD_OID = "2.5.5.16",
126 .equality = "integerMatch",
127 .comment = "Large Integer"
130 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.40",
131 .AD_OID = "2.5.5.17",
132 .equality = "octetStringMatch",
133 .comment = "Octet String - Security Identifier (SID)"
136 .Standard_OID = "1.3.6.1.4.1.1466.115.121.1.26",
138 .equality = "caseExactIA5Match",
139 .comment = "IA5 String"
145 const struct syntax_map *find_syntax_map_by_ad_oid(const char *ad_oid)
148 for (i=0; syntax_map[i].Standard_OID; i++) {
149 if (strcasecmp(ad_oid, syntax_map[i].AD_OID) == 0) {
150 return &syntax_map[i];
156 const struct syntax_map *find_syntax_map_by_standard_oid(const char *standard_oid)
159 for (i=0; syntax_map[i].Standard_OID; i++) {
160 if (strcasecmp(standard_oid, syntax_map[i].Standard_OID) == 0) {
161 return &syntax_map[i];