4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * RPC Language Protocol description file for NIS Plus
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 * From 4.1 : @(#)nis.x 1.61 Copyright 1989 Sun Microsystems
31 /* This gets stuffed into the source files. */
35 #if defined(RPC_XDR) || defined(RPC_CLNT) || defined(RPC_SVC)
37 %#define xdr_uint32_t xdr_u_int
40 %#define xdr_uint_t xdr_u_int
47 /* Include the RPC Language description of NIS objects */
48 #include "nis_object.x"
54 * These are the type of entries that are stored in the transaction log,
55 * note that modifications will appear as two entries, for names, they have
56 * a "OLD" entry followed by a "NEW" entry. For entries in tables, there
57 * is a remove followed by an add. It is done this way so that we can read
58 * the log backwards to back out transactions and forwards to propogate
63 ADD_NAME = 1, /* Name Added to name space */
64 REM_NAME = 2, /* Name removed from name space */
65 MOD_NAME_OLD = 3, /* Name was modified in the name space */
66 MOD_NAME_NEW = 4, /* Name was modified in the name space */
67 ADD_IBASE = 5, /* Entry added to information base */
68 REM_IBASE = 6, /* Entry removed from information base */
69 MOD_IBASE = 7, /* Entry was modified in information base */
70 UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */
74 * This result is returned from the name service when it is requested to
75 * dump logged entries from its transaction log. Information base updates
76 * will have the name of the information base in the le_name field and
77 * a canonical set of attribute/value pairs to fully specify the entry's
81 uint32_t le_time; /* Time in seconds */
82 log_entry_t le_type; /* Type of log entry */
83 nis_name le_princp; /* Principal making the change */
84 nis_name le_name; /* Name of table/dir involved */
85 nis_attr le_attrs<>; /* List of AV pairs. */
86 nis_object le_object; /* Actual object value */
91 * This structure defines a generic NIS tag list. The taglist contains
92 * zero or tags, each of which is a type and a value. (u_int).
93 * These are used to report statistics (see tag definitions below)
94 * and to set or reset state variables.
97 u_int tag_type; /* Statistic tag (may vary) */
98 string tag_val<>; /* Statistic value may also vary */
103 % * Structures used for server binding.
105 struct nis_bound_endpoint {
115 typedef struct nis_bound_endpoint nis_bound_endpoint;
117 struct nis_bound_directory {
119 int min_rank; /* minimum rank of bound endpoints */
120 int optimal_rank; /* best possible rank of all endpoints */
122 nis_bound_endpoint BEP<>;
124 typedef struct nis_bound_directory nis_bound_directory;
125 %#define bep_len BEP.BEP_len
126 %#define bep_val BEP.BEP_val
128 struct nis_active_endpoint {
132 int uaddr_generation;
137 typedef struct nis_active_endpoint nis_active_endpoint;
139 %/* defines for nis_bound_endpoint.flags */
140 %#define NIS_BOUND 0x1
141 %#define NIS_TRANSIENT_ERRORS 0x2
146 * What's going on here? Well, it's like this. When the service
147 * is being compiled it wants to have the service definition specific
148 * info included, and when the client is being compiled it wants that
149 * info. This includes the appropriate file which was generated by
150 * make in the protocols directory (probably /usr/include/rpcsvc).
153 %#include "nis_svc.h"
156 %#include "nis_clnt.h"
161 * Included below are the defines that become part of nis.h,
162 * they are technically not part of the protocol, but do define
163 * key aspects of the implementation and are therefore useful
164 * in building a conforming server or client.
168 % * Generic "hash" datastructures, used by all types of hashed data.
170 %struct nis_hash_data {
171 % nis_name name; /* NIS name of hashed item */
172 % int keychain; /* It's hash key (for pop) */
173 % struct nis_hash_data *next; /* Hash collision pointer */
174 % struct nis_hash_data *prv_item; /* A serial, doubly linked list */
175 % struct nis_hash_data *nxt_item; /* of items in the hash table */
177 %typedef struct nis_hash_data NIS_HASH_ITEM;
179 %struct nis_hash_table {
180 % NIS_HASH_ITEM *keys[64]; /* A hash table of items */
181 % NIS_HASH_ITEM *first; /* The first "item" in serial list */
183 %typedef struct nis_hash_table NIS_HASH_TABLE;
185 %/* Structure for storing dynamically allocated static data */
187 % void *buf; /* Memory allocation pointer */
188 % u_int size; /* Buffer size */
191 %/* Generic client creating flags */
195 %#define ZMH_NOFALLBACK 8
197 %/* Testing Access rights for objects */
199 %#define NIS_READ_ACC 1
200 %#define NIS_MODIFY_ACC 2
201 %#define NIS_CREATE_ACC 4
202 %#define NIS_DESTROY_ACC 8
203 %/* Test macros. a == access rights, m == desired rights. */
204 %#define NIS_WORLD(a, m) (((a) & (m)) != 0)
205 %#define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
206 %#define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
207 %#define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
209 % * EOL Alert - The following non-prefixed test macros are
210 % * here for backward compatability, and will be not be present
211 % * in future releases - use the NIS_*() macros above.
213 %#define WORLD(a, m) (((a) & (m)) != 0)
214 %#define GROUP(a, m) (((a) & ((m) << 8)) != 0)
215 %#define OWNER(a, m) (((a) & ((m) << 16)) != 0)
216 %#define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
218 %#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
219 %#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
220 %#define WORLD_DEFAULT (NIS_READ_ACC)
221 %#define GROUP_DEFAULT (NIS_READ_ACC << 8)
222 %#define OWNER_DEFAULT ((NIS_READ_ACC +\
225 % NIS_DESTROY_ACC) << 16)
226 %#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
228 %/* Result manipulation defines ... */
229 %#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
230 %#define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
231 %#define NIS_RES_COOKIE(x) ((x)->cookie)
232 %#define NIS_RES_STATUS(x) ((x)->status)
234 %/* These defines make getting at the variant part of the object easier. */
235 %#define TA_data zo_data.objdata_u.ta_data
236 %#define EN_data zo_data.objdata_u.en_data
237 %#define DI_data zo_data.objdata_u.di_data
238 %#define LI_data zo_data.objdata_u.li_data
239 %#define GR_data zo_data.objdata_u.gr_data
241 %#define __type_of(o) ((o)->zo_data.zo_type)
243 %/* Declarations for the internal subroutines in nislib.c */
244 %enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
245 %typedef enum name_pos name_pos;
248 % * Defines for getting at column data in entry objects. Because RPCGEN
249 % * generates some rather wordy structures, we create some defines that
250 % * collapse the needed keystrokes to access a particular value using
251 % * these definitions they take an nis_object *, and an int and return
252 % * a u_char * for Value, and an int for length.
254 %#define ENTRY_VAL(obj, col) \
255 % (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
256 %#define ENTRY_LEN(obj, col) \
257 % (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
265 %/* Prototypes, and extern declarations for the NIS library functions. */
266 %#include <rpcsvc/nislib.h>
267 %#endif /* __NIS_RPCGEN_H */
273 % * This file contains definitions that are only of interest to the actual
274 % * service daemon and client stubs. Normal users of NIS will not include
277 % * NOTE : This include file is automatically created by a combination
278 % * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
279 % * and then remake this file.