~vorlon/ubuntu/natty/eglibc/multiarch

« back to all changes in this revision

Viewing changes to nis/rpcsvc/nis_object.x

  • Committer: Steve Langasek
  • Date: 2011-02-18 21:18:44 UTC
  • mfrom: (103.1.7 eglibc)
  • Revision ID: steve.langasek@linaro.org-20110218211844-lodmi8b1qhyq3f3x
Tags: 2.13~pre1-0ubuntu1+multiarch.1
merge from natty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      nis_object.x
3
3
 *
4
 
 *      Copyright (c) 1988-1992 Sun Microsystems Inc
5
 
 *      All Rights Reserved.
 
4
 * Copyright (c) 2010, Oracle America, Inc.
 
5
 *
 
6
 * Redistribution and use in source and binary forms, with or without
 
7
 * modification, are permitted provided that the following conditions are
 
8
 * met:
 
9
 *
 
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.
 
19
 *
 
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.
6
32
 */
7
33
 
8
 
%#pragma ident  "@(#)nis_object.x       1.12    97/11/19 SMI"
 
34
%#pragma ident  "@(#)nis_object.x       1.12    97/11/19"
9
35
 
10
36
#if RPC_HDR
11
37
%
14
40
%
15
41
#endif
16
42
/*
17
 
 *      This file defines the format for a NIS object in RPC language.
 
43
 *      This file defines the format for a NIS object in RPC language.
18
44
 * It is included by the main .x file and the database access protocol
19
45
 * file. It is common because both of them need to deal with the same
20
46
 * type of object. Generating the actual code though is a bit messy because
54
80
 * optional set of attribute/value pairs.
55
81
 */
56
82
struct nis_attr {
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.     */
59
85
};
60
86
 
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.
69
95
 *
74
100
 
75
101
enum zotypes {
76
102
 
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)     */
85
111
 
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) */
94
120
};
95
121
 
124
150
 * administrator's approval.
125
151
 */
126
152
struct oar_mask {
127
 
        uint32_t        oa_rights;      /* Access rights mask   */
128
 
        zotypes         oa_otype;       /* Object type          */
 
153
        uint32_t        oa_rights;      /* Access rights mask   */
 
154
        zotypes         oa_otype;       /* Object type          */
129
155
};
130
156
 
131
157
struct endpoint {
140
166
 * the expected lifetime of this service.
141
167
 */
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           */
147
173
};
148
174
 
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 */
155
181
};
156
182
 
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.
165
191
 */
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    */
171
197
 
172
198
struct entry_col {
175
201
};
176
202
 
177
203
struct entry_obj {
178
 
        string  en_type<>;      /* Type of entry such as "passwd" */
 
204
        string  en_type<>;      /* Type of entry such as "passwd" */
179
205
        entry_col en_cols<>;    /* Value for the entry            */
180
206
};
181
207
 
187
213
 */
188
214
struct group_obj {
189
215
        uint32_t        gr_flags;       /* Flags controlling group      */
190
 
        nis_name        gr_members<>;   /* List of names in group       */
 
216
        nis_name        gr_members<>;   /* List of names in group       */
191
217
};
192
218
 
193
219
/*
200
226
struct link_obj {
201
227
        zotypes  li_rtype;      /* Real type of the object      */
202
228
        nis_attr li_attrs<>;    /* Attribute/Values for tables  */
203
 
        nis_name li_name;       /* The object's real NIS name   */
 
229
        nis_name li_name;       /* The object's real NIS name   */
204
230
};
205
231
 
206
232
/*
219
245
 * column value.
220
246
 */
221
247
 
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     */
229
255
 
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      */
234
260
};
235
261
 
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 */
242
268
};
243
269
 
245
271
 * This union joins together all of the currently known objects.
246
272
 */
247
273
union objdata switch (zotypes zo_type) {
248
 
        case NIS_DIRECTORY_OBJ :
249
 
                struct directory_obj di_data;
250
 
        case NIS_GROUP_OBJ :
251
 
                struct group_obj gr_data;
252
 
        case NIS_TABLE_OBJ :
253
 
                struct table_obj ta_data;
254
 
        case NIS_ENTRY_OBJ:
255
 
                struct entry_obj en_data;
256
 
        case NIS_LINK_OBJ :
257
 
                struct link_obj li_data;
258
 
        case NIS_PRIVATE_OBJ :
259
 
                opaque  po_data<>;
 
274
        case NIS_DIRECTORY_OBJ :
 
275
                struct directory_obj di_data;
 
276
        case NIS_GROUP_OBJ :
 
277
                struct group_obj gr_data;
 
278
        case NIS_TABLE_OBJ :
 
279
                struct table_obj ta_data;
 
280
        case NIS_ENTRY_OBJ:
 
281
                struct entry_obj en_data;
 
282
        case NIS_LINK_OBJ :
 
283
                struct link_obj li_data;
 
284
        case NIS_PRIVATE_OBJ :
 
285
                opaque  po_data<>;
260
286
        case NIS_NO_OBJ :
261
287
                void;
262
 
        case NIS_BOGUS_OBJ :
263
 
                void;
264
 
        default :
265
 
                void;
 
288
        case NIS_BOGUS_OBJ :
 
289
                void;
 
290
        default :
 
291
                void;
266
292
};
267
293
 
268
294
/*
281
307
 * new position and calculate the size.
282
308
 */
283
309
struct nis_oid {
284
 
        uint32_t ctime;         /* Time of objects creation     */
 
310
        uint32_t ctime;         /* Time of objects creation     */
285
311
        uint32_t mtime;         /* Time of objects modification */
286
312
};
287
313
 
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         */
297
323
};
298
324
#if RPC_HDR
299
325
%