Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nslcd/ldap-schema.h
blob: 4ccbcd294fb92e1b5d86534c12140c8e3d521dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
/*
   ldap-schema.h - LDAP schema information functions and definitions
   This file was part of the nss_ldap library which has been
   forked into the nss-ldapd library.

   Copyright (C) 1997-2005 Luke Howard
   Copyright (C) 2006 West Consulting
   Copyright (C) 2006 Arthur de Jong

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
   02110-1301 USA
*/

#ifndef _LDAP_NSS_LDAP_LDAP_SCHEMA_H
#define _LDAP_NSS_LDAP_LDAP_SCHEMA_H

/**
 * function to initialize global lookup filters.
 */
void _nss_ldap_init_filters(void);
void _nss_ldap_init_attributes(const char ***attrtab);

/**
 * make filters formerly declared in ldap-*.h globally available.
 */

/* rfc822 mail aliases */
extern char _nss_ldap_filt_getaliasbyname[];
extern char _nss_ldap_filt_getaliasent[];

/* MAC address mappings */
extern char _nss_ldap_filt_gethostton[];
extern char _nss_ldap_filt_getntohost[];
extern char _nss_ldap_filt_getetherent[];

/* groups */
extern char _nss_ldap_filt_getgrnam[];
extern char _nss_ldap_filt_getgrgid[];
extern char _nss_ldap_filt_getgrent[];
extern char _nss_ldap_filt_getgroupsbymemberanddn[];
extern char _nss_ldap_filt_getgroupsbydn[];
extern char _nss_ldap_filt_getpwnam_groupsbymember[];
extern char _nss_ldap_filt_getgroupsbymember[];

/* IP hosts */
extern char _nss_ldap_filt_gethostbyname[];
extern char _nss_ldap_filt_gethostbyaddr[];
extern char _nss_ldap_filt_gethostent[];

/* IP networks */
extern char _nss_ldap_filt_getnetbyname[];
extern char _nss_ldap_filt_getnetbyaddr[];
extern char _nss_ldap_filt_getnetent[];

/* IP protocols */
extern char _nss_ldap_filt_getprotobyname[];
extern char _nss_ldap_filt_getprotobynumber[];
extern char _nss_ldap_filt_getprotoent[];

/* users */
extern char _nss_ldap_filt_getpwnam[];
extern char _nss_ldap_filt_getpwuid[];
extern char _nss_ldap_filt_getpwent[];

/* RPCs */
extern char _nss_ldap_filt_getrpcbyname[];
extern char _nss_ldap_filt_getrpcbynumber[];
extern char _nss_ldap_filt_getrpcent[];

/* IP services */
extern char _nss_ldap_filt_getservbyname[];
extern char _nss_ldap_filt_getservbynameproto[];
extern char _nss_ldap_filt_getservbyport[];
extern char _nss_ldap_filt_getservbyportproto[];
extern char _nss_ldap_filt_getservent[];

/* shadow users */
extern char _nss_ldap_filt_getspnam[];
extern char _nss_ldap_filt_getspent[];

/* netgroups */
extern char _nss_ldap_filt_getnetgrent[];

/**
 * Initialize attribute vector table indexed by map
 * selector (eg. LM_PASSWD) relative to an "ldap_config"
 */

/**
 * Lookup (potentially mapped)
 * objectclass/attribute.
 */
#define OC(oc)                   _nss_ldap_map_oc(LM_NONE, OC##_##oc)
#define OCM(map, at)             _nss_ldap_map_oc(map, AT##_##at)
#define AT(at)                   _nss_ldap_map_at(LM_NONE, AT##_##at)
#define ATM(map, at)             _nss_ldap_map_at(map, AT##_##at)

/**
 * Common attributes, not from RFC 2307.
 */
#define AT_objectClass            "objectClass"
#define AT_cn                     "cn"
#define AT_description            "description"
#define AT_l                      "l"
#define AT_manager                "manager"

/**
 * Vendor-specific attributes and object classes.
 * (Mainly from Sun.)
 */
#define OC_nisMailAlias           "nisMailAlias"
#define AT_rfc822MailMember       "rfc822MailMember"

/**
 * RFC 2307 attributes and object classes.
 */

/*
 * ( nisSchema.2.0 NAME 'posixAccount' SUP top AUXILIARY
 *   DESC 'Abstraction of an account with POSIX attributes'
 *   MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory )
 *   MAY ( userPassword $ loginShell $ gecos $ description ) )
 */
#define OC_posixAccount           "posixAccount"
#define AT_uid                    "uid"
#define AT_userPassword           "userPassword"
#define AT_uidNumber              "uidNumber"
#define AT_gidNumber              "gidNumber"
#define AT_loginShell             "loginShell"
#define AT_gecos                  "gecos"
#define AT_homeDirectory          "homeDirectory"

/*
 * ( nisSchema.2.1 NAME 'shadowAccount' SUP top AUXILIARY
 *   DESC 'Additional attributes for shadow passwords'
 *   MUST uid
 *   MAY ( userPassword $ shadowLastChange $ shadowMin
 *         shadowMax $ shadowWarning $ shadowInactive $
 *         shadowExpire $ shadowFlag $ description ) )
 */
#define OC_shadowAccount          "shadowAccount"
#define AT_shadowLastChange       "shadowLastChange"
#define AT_shadowMin              "shadowMin"
#define AT_shadowMax              "shadowMax"
#define AT_shadowWarning          "shadowWarning"
#define AT_shadowInactive         "shadowInactive"
#define AT_shadowExpire           "shadowExpire"
#define AT_shadowFlag             "shadowFlag"

/*
 * ( nisSchema.2.2 NAME 'posixGroup' SUP top STRUCTURAL
 *   DESC 'Abstraction of a group of accounts'
 *   MUST ( cn $ gidNumber )
 *   MAY ( userPassword $ uidMember $ description ) )
 */
#define OC_posixGroup             "posixGroup"
#define AT_gidNumber              "gidNumber"
#define AT_memberUid              "memberUid"
#define AT_uniqueMember           "uniqueMember"
#define AT_memberOf               "memberOf"

/*
 * ( nisSchema.2.3 NAME 'ipService' SUP top STRUCTURAL
 *   DESC 'Abstraction an Internet Protocol service.
 *         Maps an IP port and protocol (such as tcp or udp)
 *         to one or more names; the distinguished value of
 *         the cn attribute denotes the service's canonical
 *         name'
 *   MUST ( cn $ ipServicePort $ ipServiceProtocol )
 *   MAY ( description ) )
 */
#define OC_ipService              "ipService"
#define AT_ipServicePort          "ipServicePort"
#define AT_ipServiceProtocol      "ipServiceProtocol"

/*
 * ( nisSchema.2.4 NAME 'ipProtocol' SUP top STRUCTURAL
 *   DESC 'Abstraction of an IP protocol. Maps a protocol number
 *         to one or more names. The distinguished value of the cn
 *         attribute denotes the protocol's canonical name'
 *   MUST ( cn $ ipProtocolNumber )
 *    MAY description )
 */
#define OC_ipProtocol             "ipProtocol"
#define AT_ipProtocolNumber       "ipProtocolNumber"

/*
 * ( nisSchema.2.5 NAME 'oncRpc' SUP top STRUCTURAL
 *   DESC 'Abstraction of an Open Network Computing (ONC)
 *         [RFC1057] Remote Procedure Call (RPC) binding.
 *         This class maps an ONC RPC number to a name.
 *         The distinguished value of the cn attribute denotes
 *         the RPC service's canonical name'
 *   MUST ( cn $ oncRpcNumber )
 *   MAY description )
 */
#define OC_oncRpc                 "oncRpc"
#define AT_oncRpcNumber           "oncRpcNumber"

/*
 * ( nisSchema.2.6 NAME 'ipHost' SUP top AUXILIARY
 *   DESC 'Abstraction of a host, an IP device. The distinguished
 *         value of the cn attribute denotes the host's canonical
 *         name. Device SHOULD be used as a structural class'
 *   MUST ( cn $ ipHostNumber )
 *   MAY ( l $ description $ manager ) )
 */
#define OC_ipHost                 "ipHost"
#define AT_ipHostNumber           "ipHostNumber"

/*
 * ( nisSchema.2.7 NAME 'ipNetwork' SUP top STRUCTURAL
 *   DESC 'Abstraction of a network. The distinguished value of
 *   MUST ( cn $ ipNetworkNumber )
 *   MAY ( ipNetmaskNumber $ l $ description $ manager ) )
 */
#define OC_ipNetwork              "ipNetwork"
#define AT_ipNetworkNumber        "ipNetworkNumber"
#define AT_ipNetmaskNumber        "ipNetmaskNumber"

/*
 * ( nisSchema.2.8 NAME 'nisNetgroup' SUP top STRUCTURAL
 *   DESC 'Abstraction of a netgroup. May refer to other netgroups'
 *   MUST cn
 *   MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) )
 */
#define OC_nisNetgroup            "nisNetgroup"
#define AT_nisNetgroupTriple      "nisNetgroupTriple"
#define AT_memberNisNetgroup      "memberNisNetgroup"

/*
 * ( nisSchema.2.09 NAME 'nisMap' SUP top STRUCTURAL
 *   DESC 'A generic abstraction of a NIS map'
 *   MUST nisMapName
 *   MAY description )
 */
#define OC_nisMap                 "nisMap"
#define AT_nisMapName             "nisNapName"

/*
 * ( nisSchema.2.10 NAME 'nisObject' SUP top STRUCTURAL
 *   DESC 'An entry in a NIS map'
 *   MUST ( cn $ nisMapEntry $ nisMapName )
 *   MAY description )
 */
#define OC_nisObject              "nisObject"
#define AT_nisMapEntry            "nisMapEntry"

/*
 * ( nisSchema.2.11 NAME 'ieee802Device' SUP top AUXILIARY
 *   DESC 'A device with a MAC address; device SHOULD be
 *         used as a structural class'
 *   MAY macAddress )
 */
#define OC_ieee802Device          "ieee802Device"
#define AT_macAddress             "macAddress"

/*
 * ( nisSchema.2.12 NAME 'bootableDevice' SUP top AUXILIARY
 *   DESC 'A device with boot parameters; device SHOULD be
 *         used as a structural class'
 *   MAY ( bootFile $ bootParameter ) )
 */
#define OC_bootableDevice         "bootableDevice"
#define AT_bootFile               "bootFile"
#define AT_bootParameter          "bootParameter"

/*
 * Map names
 */
#define MP_passwd                 "passwd"
#define MP_shadow                 "shadow"
#define MP_group                  "group"
#define MP_hosts                  "hosts"
#define MP_services               "services"
#define MP_networks               "networks"
#define MP_protocols              "protocols"
#define MP_rpc                    "rpc"
#define MP_ethers                 "ethers"
#define MP_netmasks               "netmasks"
#define MP_bootparams             "bootparams"
#define MP_aliases                "aliases"
#define MP_netgroup               "netgroup"

#endif /* _LDAP_NSS_LDAP_LDAP_SCHEMA_H */