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