4
* Copyright (c) 1988-1992 Sun Microsystems Inc
4
* Copyright (c) 2010, Oracle America, Inc.
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions are
10
* * Redistributions of source code must retain the above copyright
11
* notice, this list of conditions and the following disclaimer.
12
* * Redistributions in binary form must reproduce the above
13
* copyright notice, this list of conditions and the following
14
* disclaimer in the documentation and/or other materials
15
* provided with the distribution.
16
* * Neither the name of the "Oracle America, Inc." nor the names of its
17
* contributors may be used to endorse or promote products derived
18
* from this software without specific prior written permission.
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8
%#pragma ident "@(#)nis_object.x 1.12 97/11/19 SMI"
34
%#pragma ident "@(#)nis_object.x 1.12 97/11/19"
54
80
* optional set of attribute/value pairs.
57
string zattr_ndx<>; /* name of the index */
58
opaque zattr_val<>; /* Value for the attribute. */
83
string zattr_ndx<>; /* name of the index */
84
opaque zattr_val<>; /* Value for the attribute. */
61
87
typedef string nis_name<>; /* The NIS name itself. */
63
89
/* NIS object types are defined by the following enumeration. The numbers
64
90
* they use are based on the following scheme :
65
91
* 0 - 1023 are reserved for Sun,
66
* 1024 - 2047 are defined to be private to a particular tree.
92
* 1024 - 2047 are defined to be private to a particular tree.
67
93
* 2048 - 4095 are defined to be user defined.
68
94
* 4096 - ... are reserved for future use.
77
BOGUS_OBJ = 0, /* Uninitialized object structure */
78
NO_OBJ = 1, /* NULL object (no data) */
79
DIRECTORY_OBJ = 2, /* Directory object describing domain */
80
GROUP_OBJ = 3, /* Group object (a list of names) */
81
TABLE_OBJ = 4, /* Table object (a database schema) */
82
ENTRY_OBJ = 5, /* Entry object (a database record) */
83
LINK_OBJ = 6, /* A name link. */
84
PRIVATE_OBJ = 7, /* Private object (all opaque data) */
103
BOGUS_OBJ = 0, /* Uninitialized object structure */
104
NO_OBJ = 1, /* NULL object (no data) */
105
DIRECTORY_OBJ = 2, /* Directory object describing domain */
106
GROUP_OBJ = 3, /* Group object (a list of names) */
107
TABLE_OBJ = 4, /* Table object (a database schema) */
108
ENTRY_OBJ = 5, /* Entry object (a database record) */
109
LINK_OBJ = 6, /* A name link. */
110
PRIVATE_OBJ = 7, /* Private object (all opaque data) */
86
NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */
87
NIS_NO_OBJ = 1, /* NULL object (no data) */
88
NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */
89
NIS_GROUP_OBJ = 3, /* Group object (a list of names) */
90
NIS_TABLE_OBJ = 4, /* Table object (a database schema) */
91
NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */
92
NIS_LINK_OBJ = 6, /* A name link. */
112
NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */
113
NIS_NO_OBJ = 1, /* NULL object (no data) */
114
NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */
115
NIS_GROUP_OBJ = 3, /* Group object (a list of names) */
116
NIS_TABLE_OBJ = 4, /* Table object (a database schema) */
117
NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */
118
NIS_LINK_OBJ = 6, /* A name link. */
93
119
NIS_PRIVATE_OBJ = 7 /* Private object (all opaque data) */
140
166
* the expected lifetime of this service.
142
168
struct nis_server {
143
nis_name name; /* Principal name of the server */
144
endpoint ep<>; /* Universal addr(s) for server */
169
nis_name name; /* Principal name of the server */
170
endpoint ep<>; /* Universal addr(s) for server */
145
171
uint32_t key_type; /* Public key type */
146
netobj pkey; /* server's public key */
172
netobj pkey; /* server's public key */
149
175
struct directory_obj {
150
176
nis_name do_name; /* Name of the directory being served */
151
nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */
152
nis_server do_servers<>; /* <0> == Primary name server */
153
uint32_t do_ttl; /* Time To Live (for caches) */
177
nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */
178
nis_server do_servers<>; /* <0> == Primary name server */
179
uint32_t do_ttl; /* Time To Live (for caches) */
154
180
oar_mask do_armask<>; /* Create/Destroy rights by object type */
163
189
* entry but got to it through a LINK rather than directly.
164
190
* If the entry is a "standalone" entry then this field is void.
166
const EN_BINARY = 1; /* Indicates value is binary data */
192
const EN_BINARY = 1; /* Indicates value is binary data */
167
193
const EN_CRYPT = 2; /* Indicates the value is encrypted */
168
194
const EN_XDR = 4; /* Indicates the value is XDR encoded */
169
const EN_MODIFIED = 8; /* Indicates entry is modified. */
195
const EN_MODIFIED = 8; /* Indicates entry is modified. */
170
196
const EN_ASN1 = 64; /* Means contents use ASN.1 encoding */
172
198
struct entry_col {
222
const TA_BINARY = 1; /* Means table data is binary */
223
const TA_CRYPT = 2; /* Means value should be encrypted */
248
const TA_BINARY = 1; /* Means table data is binary */
249
const TA_CRYPT = 2; /* Means value should be encrypted */
224
250
const TA_XDR = 4; /* Means value is XDR encoded */
225
251
const TA_SEARCHABLE = 8; /* Means this column is searchable */
226
252
const TA_CASE = 16; /* Means this column is Case Sensitive */
228
254
const TA_ASN1 = 64; /* Means contents use ASN.1 encoding */
230
256
struct table_col {
231
string tc_name<64>; /* Column Name */
257
string tc_name<64>; /* Column Name */
232
258
uint32_t tc_flags; /* control flags */
233
259
uint32_t tc_rights; /* Access rights mask */
236
262
struct table_obj {
237
string ta_type<64>; /* Table type such as "passwd" */
263
string ta_type<64>; /* Table type such as "passwd" */
238
264
int ta_maxcol; /* Total number of columns */
239
u_char ta_sep; /* Separator character */
240
table_col ta_cols<>; /* The number of table indexes */
265
u_char ta_sep; /* Separator character */
266
table_col ta_cols<>; /* The number of table indexes */
241
267
string ta_path<>; /* A search path for this table */
245
271
* This union joins together all of the currently known objects.
247
273
union objdata switch (zotypes zo_type) {
248
case NIS_DIRECTORY_OBJ :
249
struct directory_obj di_data;
251
struct group_obj gr_data;
253
struct table_obj ta_data;
255
struct entry_obj en_data;
257
struct link_obj li_data;
258
case NIS_PRIVATE_OBJ :
274
case NIS_DIRECTORY_OBJ :
275
struct directory_obj di_data;
277
struct group_obj gr_data;
279
struct table_obj ta_data;
281
struct entry_obj en_data;
283
struct link_obj li_data;
284
case NIS_PRIVATE_OBJ :
260
286
case NIS_NO_OBJ :
293
319
nis_name zo_domain; /* The administrator for the object */
294
320
uint32_t zo_access; /* Access rights (owner, group, world) */
295
321
uint32_t zo_ttl; /* Object's time to live in seconds. */
296
objdata zo_data; /* Data structure for this type */
322
objdata zo_data; /* Data structure for this type */