]> sourceware.org Git - glibc.git/blob - nis/rpcsvc/nis.x
Update.
[glibc.git] / nis / rpcsvc / nis.x
1 %/*
2 % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 % * unrestricted use provided that this legend is included on all tape
4 % * media and as a part of the software program in whole or part. Users
5 % * may copy or modify Sun RPC without charge, but are not authorized
6 % * to license or distribute it to anyone else except as part of a product or
7 % * program developed by the user or with the express written consent of
8 % * Sun Microsystems, Inc.
9 % *
10 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 % *
14 % * Sun RPC is provided with no support and without any obligation on the
15 % * part of Sun Microsystems, Inc. to assist in its use, correction,
16 % * modification or enhancement.
17 % *
18 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 % * OR ANY PART THEREOF.
21 % *
22 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 % * or profits or other special, indirect and consequential damages, even if
24 % * Sun has been advised of the possibility of such damages.
25 % *
26 % * Sun Microsystems, Inc.
27 % * 2550 Garcia Avenue
28 % * Mountain View, California 94043
29 % */
30
31 /*
32 * From 4.1 : @(#)nis.x 1.61 Copyright 1989 Sun Microsystems
33 *
34 * RPC Language Protocol description file for NIS Plus
35 * This version : 1.61
36 * Last Modified : 3/19/91
37 */
38 #ifdef RPC_HDR
39 %/*
40 % * nis.h
41 % *
42 % * This file is the main include file for NIS clients. It contains
43 % * both the client library function defines and the various data
44 % * structures used by the NIS service. It includes the file nis_tags.h
45 % * which defines the tag values. This allows the tags to change without
46 % * having to change the nis.x file.
47 % *
48 % * NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
49 % * rpcgen is run on the nis.x file. Note that there is a
50 % * simple sed script to remove some unneeded lines. (See the
51 % * Makefile target nis.h)
52 % *
53 % */
54 %#include <rpcsvc/nis_tags.h>
55 #endif
56
57 /* This gets stuffed into the source files. */
58 #if RPC_HDR
59 %#include <rpc/xdr.h>
60 #endif
61 #if RPC_SVC
62 %#include "nis_svc.h"
63 #endif
64
65 /* Include the RPC Language description of NIS objects */
66 #include "nis_object.x"
67
68 /* Errors that can be returned by the service */
69 enum nis_error {
70 NIS_SUCCESS = 0, /* A-ok, let's rock n roll */
71 NIS_S_SUCCESS = 1, /* Name found (maybe) */
72 NIS_NOTFOUND = 2, /* Name definitely not found */
73 NIS_S_NOTFOUND = 3, /* Name maybe not found */
74 NIS_CACHEEXPIRED = 4, /* Name exists but cache out of date */
75 NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */
76 NIS_UNKNOWNOBJ = 6, /* Object type is bogus */
77 NIS_TRYAGAIN = 7, /* I'm busy, call back */
78 NIS_SYSTEMERROR = 8, /* Out of band failure */
79 NIS_CHAINBROKEN = 9, /* First/Next warning */
80 NIS_PERMISSION = 10, /* Not enough permission to access */
81 NIS_NOTOWNER = 11, /* You don't own it, sorry */
82 NIS_NOT_ME = 12, /* I don't serve this name */
83 NIS_NOMEMORY = 13, /* Outta VM! Help! */
84 NIS_NAMEEXISTS = 14, /* Can't create over another name */
85 NIS_NOTMASTER = 15, /* I'm justa secondaray, don't ask me */
86 NIS_INVALIDOBJ = 16, /* Object is broken somehow */
87 NIS_BADNAME = 17, /* Unparsable name */
88 NIS_NOCALLBACK = 18, /* Couldn't talk to call back proc */
89 NIS_CBRESULTS = 19, /* Results being called back to you */
90 NIS_NOSUCHNAME = 20, /* Name unknown */
91 NIS_NOTUNIQUE = 21, /* Value is not uniques (entry) */
92 NIS_IBMODERROR = 22, /* Inf. Base. Modify error. */
93 NIS_NOSUCHTABLE = 23, /* Name for table was wrong */
94 NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */
95 NIS_LINKNAMEERROR = 25, /* Link points to bogus name */
96 NIS_PARTIAL = 26, /* Partial success, found table */
97 NIS_TOOMANYATTRS = 27, /* Too many attributes */
98 NIS_RPCERROR = 28, /* RPC error encountered */
99 NIS_BADATTRIBUTE = 29, /* Bad or invalid attribute */
100 NIS_NOTSEARCHABLE = 30, /* Non-searchable object searched */
101 NIS_CBERROR = 31, /* Error during callback (svc crash) */
102 NIS_FOREIGNNS = 32, /* Foreign Namespace */
103 NIS_BADOBJECT = 33, /* Malformed object structure */
104 NIS_NOTSAMEOBJ = 34, /* Object swapped during deletion */
105 NIS_MODFAIL = 35, /* Failure during a Modify. */
106 NIS_BADREQUEST = 36, /* Illegal query for table */
107 NIS_NOTEMPTY = 37, /* Attempt to remove a non-empty tbl */
108 NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */
109 NIS_RESYNC = 39, /* Transaction log too far out of date */
110 NIS_FAIL = 40, /* NIS operation failed. */
111 NIS_UNAVAIL = 41, /* NIS+ service is unavailable (client) */
112 NIS_RES2BIG = 42, /* NIS+ result too big for datagram */
113 NIS_SRVAUTH = 43, /* NIS+ server wasn't authenticated. */
114 NIS_CLNTAUTH = 44, /* NIS+ Client wasn't authenticated. */
115 NIS_NOFILESPACE = 45, /* NIS+ server ran out of disk space */
116 NIS_NOPROC = 46, /* NIS+ server couldn't create new proc */
117 NIS_DUMPLATER = 47 /* NIS+ server already has dump child */
118 };
119
120
121 /*
122 * Structure definitions for the parameters and results of the actual
123 * NIS RPC calls.
124 *
125 * This is the standard result (in the protocol) of most of the nis
126 * requests.
127 */
128
129 struct nis_result {
130 nis_error status; /* Status of the response */
131 nis_object objects<>; /* objects found */
132 netobj cookie; /* Cookie Data */
133 u_long zticks; /* server ticks */
134 u_long dticks; /* DBM ticks. */
135 u_long aticks; /* Cache (accel) ticks */
136 u_long cticks; /* Client ticks */
137 };
138
139 /*
140 * A Name Service request
141 * This request is used to access the name space, ns_name is the name
142 * of the object within the namespace and the object is it's value, for
143 * add/modify, a copy of the original for remove.
144 */
145
146 struct ns_request {
147 nis_name ns_name; /* Name in the NIS name space */
148 nis_object ns_object<1>; /* Optional Object (add/remove) */
149 };
150
151 /*
152 * An information base request
153 * This request includes the NIS name of the table we wish to search, the
154 * search criteria in the form of attribute/value pairs and an optional
155 * callback program number. If the callback program number is provided
156 * the server will send back objects one at a time, otherwise it will
157 * return them all in the response.
158 */
159
160 struct ib_request {
161 nis_name ibr_name; /* The name of the Table */
162 nis_attr ibr_srch<>; /* The search critereia */
163 u_long ibr_flags; /* Optional flags */
164 nis_object ibr_obj<1>; /* optional object (add/modify) */
165 nis_server ibr_cbhost<1>; /* Optional callback info */
166 u_long ibr_bufsize; /* Optional first/next bufsize */
167 netobj ibr_cookie; /* The first/next cookie */
168 };
169
170 /*
171 * This argument to the PING call notifies the replicas that something in
172 * a directory has changed and this is it's timestamp. The replica will use
173 * the timestamp to determine if its resync operation was successful.
174 */
175 struct ping_args {
176 nis_name dir; /* Directory that had the change */
177 u_long stamp; /* timestamp of the transaction */
178 };
179
180 /*
181 * These are the type of entries that are stored in the transaction log,
182 * note that modifications will appear as two entries, for names, they have
183 * a "OLD" entry followed by a "NEW" entry. For entries in tables, there
184 * is a remove followed by an add. It is done this way so that we can read
185 * the log backwards to back out transactions and forwards to propogate
186 * updated.
187 */
188 enum log_entry_t {
189 LOG_NOP = 0,
190 ADD_NAME = 1, /* Name Added to name space */
191 REM_NAME = 2, /* Name removed from name space */
192 MOD_NAME_OLD = 3, /* Name was modified in the name space */
193 MOD_NAME_NEW = 4, /* Name was modified in the name space */
194 ADD_IBASE = 5, /* Entry added to information base */
195 REM_IBASE = 6, /* Entry removed from information base */
196 MOD_IBASE = 7, /* Entry was modified in information base */
197 UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */
198 };
199
200 /*
201 * This result is returned from the name service when it is requested to
202 * dump logged entries from its transaction log. Information base updates
203 * will have the name of the information base in the le_name field and
204 * a canonical set of attribute/value pairs to fully specify the entry's
205 * 'name'.
206 */
207 struct log_entry {
208 u_long le_time; /* Time in seconds */
209 log_entry_t le_type; /* Type of log entry */
210 nis_name le_princp; /* Principal making the change */
211 nis_name le_name; /* Name of table/dir involved */
212 nis_attr le_attrs<>; /* List of AV pairs. */
213 nis_object le_object; /* Actual object value */
214 };
215
216 struct log_result {
217 nis_error lr_status; /* The status itself */
218 netobj lr_cookie; /* Used by the dump callback */
219 log_entry lr_entries<>; /* zero or more entries */
220 };
221
222 struct cp_result {
223 nis_error cp_status; /* Status of the checkpoint */
224 u_long cp_zticks; /* Service 'ticks' */
225 u_long cp_dticks; /* Database 'ticks' */
226 };
227
228 /*
229 * This structure defines a generic NIS tag list. The taglist contains
230 * zero or tags, each of which is a type and a value. (u_long).
231 * These are used to report statistics (see tag definitions below)
232 * and to set or reset state variables.
233 */
234 struct nis_tag {
235 u_long tag_type; /* Statistic tag (may vary) */
236 string tag_val<1024>; /* Statistic value may also vary */
237 };
238
239 struct nis_taglist {
240 nis_tag tags<>; /* List of tags */
241 };
242
243 struct dump_args {
244 nis_name da_dir; /* Directory to dump */
245 u_long da_time; /* From this timestamp */
246 nis_server da_cbhost<1>; /* Callback to use. */
247 };
248
249 struct fd_args {
250 nis_name dir_name; /* The directory we're looking for */
251 nis_name requester; /* Host principal name for signature */
252 };
253
254 struct fd_result {
255 nis_error status; /* Status returned by function */
256 nis_name source; /* Source of this answer */
257 opaque dir_data<>; /* Directory Data (XDR'ed) */
258 opaque signature<>; /* Signature of the source */
259 };
260
261
262 /*
263 * What's going on here? Well, it's like this. When the service
264 * is being compiled it wants to have the service definition specific
265 * info included, and when the client is being compiled it wants that
266 * info. This includes the appropriate file which was generated by
267 * make in the protocols directory (probably /usr/include/rpcsvc).
268 */
269 #ifdef RPC_SVC
270 %#include "nis_svc.h"
271 #endif
272 #ifdef RPC_CLNT
273 %#include "nis_clnt.h"
274 #endif
275
276 program NIS_PROG {
277
278 /* RPC Language description of the NIS+ protocol */
279 version NIS_VERSION {
280 /* The name service functions */
281 nis_result NIS_LOOKUP(ns_request) = 1;
282 nis_result NIS_ADD(ns_request) = 2;
283 nis_result NIS_MODIFY(ns_request) = 3;
284 nis_result NIS_REMOVE(ns_request) = 4;
285
286 /* The information base functions */
287 nis_result NIS_IBLIST(ib_request) = 5;
288 nis_result NIS_IBADD(ib_request) = 6;
289 nis_result NIS_IBMODIFY(ib_request) = 7;
290 nis_result NIS_IBREMOVE(ib_request) = 8;
291 nis_result NIS_IBFIRST(ib_request) = 9;
292 nis_result NIS_IBNEXT(ib_request) = 10;
293
294 /* NIS Administrative functions */
295 fd_result NIS_FINDDIRECTORY(fd_args) = 12;
296
297 /* If fetch and optionally reset statistics */
298 nis_taglist NIS_STATUS(nis_taglist) = 14;
299
300 /* Dump changes to directory since time in da_time */
301 log_result NIS_DUMPLOG(dump_args) = 15;
302
303 /* Dump contents of directory named */
304 log_result NIS_DUMP(dump_args) = 16;
305
306 /* Check status of callback thread */
307 bool NIS_CALLBACK(netobj) = 17;
308
309 /* Return last update time for named dir */
310 u_long NIS_CPTIME(nis_name) = 18;
311
312 /* Checkpoint directory or table named */
313 cp_result NIS_CHECKPOINT(nis_name) = 19;
314
315 /* Send 'status changed' ping to replicates */
316 void NIS_PING(ping_args) = 20;
317
318 /* Modify server behaviour (such as debugging) */
319 nis_taglist NIS_SERVSTATE(nis_taglist) = 21;
320
321 /* Create a Directory */
322 nis_error NIS_MKDIR(nis_name) = 22;
323
324 /* Remove a Directory */
325 nis_error NIS_RMDIR(nis_name) = 23;
326
327 /* Update public keys of a directory object */
328 nis_error NIS_UPDKEYS(nis_name) = 24;
329 } = 3;
330 } = 100300;
331
332 /*
333 * Included below are the defines that become part of nis.h,
334 * they are technically not part of the protocol, but do define
335 * key aspects of the implementation and are therefore useful
336 * in building a conforming server or client.
337 */
338 #if RPC_HDR
339 %/*
340 % * Generic "hash" datastructures, used by all types of hashed data.
341 % */
342 %struct nis_hash_data {
343 % nis_name name; /* NIS name of hashed item */
344 % int keychain; /* It's hash key (for pop) */
345 % struct nis_hash_data *next; /* Hash collision pointer */
346 % struct nis_hash_data *prv_item; /* A serial, doubly linked list */
347 % struct nis_hash_data *nxt_item; /* of items in the hash table */
348 %};
349 %typedef struct nis_hash_data NIS_HASH_ITEM;
350 %
351 %struct nis_hash_table {
352 % NIS_HASH_ITEM *keys[64]; /* A hash table of items */
353 % NIS_HASH_ITEM *first; /* The first "item" in serial list */
354 %};
355 %typedef struct nis_hash_table NIS_HASH_TABLE;
356 %
357 %/* Structure for storing dynamically allocated static data */
358 %struct nis_sdata {
359 % void *buf; /* Memory allocation pointer */
360 % u_long size; /* Buffer size */
361 %};
362 %
363 %/* Generic client creating flags */
364 %#define ZMH_VC 1
365 %#define ZMH_DG 2
366 %#define ZMH_AUTH 4
367 %
368 %/* Testing Access rights for objects */
369 %
370 %#define NIS_READ_ACC 1
371 %#define NIS_MODIFY_ACC 2
372 %#define NIS_CREATE_ACC 4
373 %#define NIS_DESTROY_ACC 8
374 %/* Test macros. a == access rights, m == desired rights. */
375 %#define WORLD(a, m) (((a) & (m)) != 0)
376 %#define GROUP(a, m) (((a) & ((m) << 8)) != 0)
377 %#define OWNER(a, m) (((a) & ((m) << 16)) != 0)
378 %#define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
379 %
380 %#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
381 %#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
382 %#define WORLD_DEFAULT (NIS_READ_ACC)
383 %#define GROUP_DEFAULT (NIS_READ_ACC << 8)
384 %#define OWNER_DEFAULT ((NIS_READ_ACC +\
385 NIS_MODIFY_ACC +\
386 NIS_CREATE_ACC +\
387 NIS_DESTROY_ACC) << 16)
388 %#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
389 %
390 %/* Result manipulation defines ... */
391 %#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
392 %#define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
393 %#define NIS_RES_COOKIE(x) ((x)->cookie)
394 %#define NIS_RES_STATUS(x) ((x)->status)
395 %
396 %/* These defines make getting at the variant part of the object easier. */
397 %#define TA_data zo_data.objdata_u.ta_data
398 %#define EN_data zo_data.objdata_u.en_data
399 %#define DI_data zo_data.objdata_u.di_data
400 %#define LI_data zo_data.objdata_u.li_data
401 %#define GR_data zo_data.objdata_u.gr_data
402 %
403 %#define __type_of(o) ((o)->zo_data.zo_type)
404 %
405 %/* Declarations for the internal subroutines in nislib.c */
406 %enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
407 %typedef enum name_pos name_pos;
408 %
409 %/*
410 % * Defines for getting at column data in entry objects. Because RPCGEN
411 % * generates some rather wordy structures, we create some defines that
412 % * collapse the needed keystrokes to access a particular value using
413 % * these definitions they take an nis_object *, and an int and return
414 % * a u_char * for Value, and an int for length.
415 % */
416 %#define ENTRY_VAL(obj, col) \
417 % (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
418 %#define ENTRY_LEN(obj, col) \
419 % (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
420 %
421 %#ifdef __cplusplus
422 %}
423 %#endif
424 %
425 %/* Prototypes, and extern declarations for the NIS library functions. */
426 %#include <rpcsvc/nislib.h>
427 %#endif /* __NIS_RPCGEN_H */
428 %/* EDIT_START */
429 %
430 %/*
431 % * nis_3.h
432 % *
433 % * This file contains definitions that are only of interest to the actual
434 % * service daemon and client stubs. Normal users of NIS will not include
435 % * this file.
436 % *
437 % * NOTE : This include file is automatically created by a combination
438 % * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
439 % * and then remake this file.
440 % */
441 %#ifndef __nis_3_h
442 %#define __nis_3_h
443 %#ifdef __cplusplus
444 %extern "C" {
445 %#endif
446 #endif
This page took 0.060685 seconds and 5 git commands to generate.