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 3 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, see <http://www.gnu.org/licenses/>.
26 #include "ldb/include/includes.h"
28 /* Shared map for converting syntax between formats */
29 static const struct syntax_map syntax_map
[] = {
31 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.12",
33 .equality
= "distinguishedNameMatch",
34 .comment
= "Object(DS-DN) == a DN"
37 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.38",
39 .equality
= "objectIdentifierMatch",
40 .comment
= "OID String"
43 .Standard_OID
= "1.2.840.113556.1.4.905",
45 .equality
= "caseIgnoreMatch",
46 .substring
= "caseIgnoreSubstringsMatch",
47 .comment
= "Case Insensitive String"
50 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.26",
52 .equality
= "caseExactIA5Match",
53 .comment
= "Printable String"
56 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.36",
58 .equality
= "numericStringMatch",
59 .substring
= "numericStringSubstringsMatch",
60 .comment
= "Numeric String"
63 .Standard_OID
= "1.2.840.113556.1.4.903",
65 .equality
= "distinguishedNameMatch",
66 .comment
= "OctetString: Binary+DN"
69 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.7",
71 .equality
= "booleanMatch",
75 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.27",
77 .equality
= "integerMatch",
81 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.40",
83 .equality
= "octetStringMatch",
84 .comment
= "Octet String"
87 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.24",
89 .equality
= "generalizedTimeMatch",
90 .comment
= "Generalized Time"
93 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.53",
95 .equality
= "generalizedTimeMatch",
99 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.15",
100 .AD_OID
= "2.5.5.12",
101 .equality
= "caseIgnoreMatch",
102 .substring
= "caseIgnoreSubstringsMatch",
103 .comment
= "Directory String"
106 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.43",
107 .AD_OID
= "2.5.5.13",
108 .comment
= "Presentation Address"
111 .Standard_OID
= "Not Found Yet",
112 .AD_OID
= "2.5.5.14",
113 .equality
= "distinguishedNameMatch",
114 .comment
= "OctetString: String+DN"
117 .Standard_OID
= "1.2.840.113556.1.4.907",
118 .AD_OID
= "2.5.5.15",
119 .equality
= "octetStringMatch",
120 .comment
= "NT Security Descriptor"
123 .Standard_OID
= "1.2.840.113556.1.4.906",
124 .AD_OID
= "2.5.5.16",
125 .equality
= "integerMatch",
126 .comment
= "Large Integer"
129 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.40",
130 .AD_OID
= "2.5.5.17",
131 .equality
= "octetStringMatch",
132 .comment
= "Octet String - Security Identifier (SID)"
135 .Standard_OID
= "1.3.6.1.4.1.1466.115.121.1.26",
137 .equality
= "caseExactIA5Match",
138 .comment
= "IA5 String"
140 { .Standard_OID
= NULL
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
];