xref: /titanic_53/usr/src/head/rpcsvc/yp_prot.h (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  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate /*
31*7c478bd9Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley 4.3 BSD
32*7c478bd9Sstevel@tonic-gate  * under license from the Regents of the University of California.
33*7c478bd9Sstevel@tonic-gate  */
34*7c478bd9Sstevel@tonic-gate 
35*7c478bd9Sstevel@tonic-gate #ifndef	_RPCSVC_YP_PROT_H
36*7c478bd9Sstevel@tonic-gate #define	_RPCSVC_YP_PROT_H
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate #include <rpc/rpc.h>
41*7c478bd9Sstevel@tonic-gate #include <rpcsvc/ypclnt.h>
42*7c478bd9Sstevel@tonic-gate #include <ndbm.h>
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
45*7c478bd9Sstevel@tonic-gate extern "C" {
46*7c478bd9Sstevel@tonic-gate #endif
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate /*
49*7c478bd9Sstevel@tonic-gate  * This file contains symbols and structures defining the rpc protocol
50*7c478bd9Sstevel@tonic-gate  * between the YP clients and the YP servers.  The servers are the YP
51*7c478bd9Sstevel@tonic-gate  * database servers, and the YP.
52*7c478bd9Sstevel@tonic-gate  */
53*7c478bd9Sstevel@tonic-gate 
54*7c478bd9Sstevel@tonic-gate /*
55*7c478bd9Sstevel@tonic-gate  * The following procedures are supported by the protocol:
56*7c478bd9Sstevel@tonic-gate  *
57*7c478bd9Sstevel@tonic-gate  * YPPROC_NULL() returns () takes nothing, returns nothing.  This indicates
58*7c478bd9Sstevel@tonic-gate  * that the yp server is alive.
59*7c478bd9Sstevel@tonic-gate  *
60*7c478bd9Sstevel@tonic-gate  * YPPROC_DOMAIN (char *) returns (bool_t) TRUE.  Indicates that the
61*7c478bd9Sstevel@tonic-gate  * responding yp server does serve the named domain; FALSE indicates no
62*7c478bd9Sstevel@tonic-gate  * support.
63*7c478bd9Sstevel@tonic-gate  *
64*7c478bd9Sstevel@tonic-gate  * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the yp server does serve
65*7c478bd9Sstevel@tonic-gate  * the named domain, otherwise does not return.  Used in the broadcast case.
66*7c478bd9Sstevel@tonic-gate  *
67*7c478bd9Sstevel@tonic-gate  * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val).  Returns the
68*7c478bd9Sstevel@tonic-gate  * right-hand value for a passed left-hand key, within a named map and
69*7c478bd9Sstevel@tonic-gate  * domain.
70*7c478bd9Sstevel@tonic-gate  *
71*7c478bd9Sstevel@tonic-gate  * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
72*7c478bd9Sstevel@tonic-gate  * Returns the first key-value pair from a named domain and map.
73*7c478bd9Sstevel@tonic-gate  *
74*7c478bd9Sstevel@tonic-gate  * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val).  Returns
75*7c478bd9Sstevel@tonic-gate  * the key-value pair following a passed key-value pair within a named
76*7c478bd9Sstevel@tonic-gate  * domain and map.
77*7c478bd9Sstevel@tonic-gate  *
78*7c478bd9Sstevel@tonic-gate  * YPPROC_XFR (struct ypreq_xfr) returns nothing.  Indicates to a server that
79*7c478bd9Sstevel@tonic-gate  * a map should be updated.
80*7c478bd9Sstevel@tonic-gate  *
81*7c478bd9Sstevel@tonic-gate  * YPPROC_NEWXFR (struct ypreq_newxfr) returns nothing.  Indicates to a server
82*7c478bd9Sstevel@tonic-gate  * that a map should be updated. Uses protocol independent request struct.
83*7c478bd9Sstevel@tonic-gate  *
84*7c478bd9Sstevel@tonic-gate  * YPPROC_CLEAR	takes nothing, returns nothing.  Instructs a yp server to
85*7c478bd9Sstevel@tonic-gate  * close the current map, so that old versions of the disk file don't get
86*7c478bd9Sstevel@tonic-gate  * held open.
87*7c478bd9Sstevel@tonic-gate  *
88*7c478bd9Sstevel@tonic-gate  * YPPROC_ALL (struct ypreq_nokey), returns
89*7c478bd9Sstevel@tonic-gate  *	union switch (bool more) {
90*7c478bd9Sstevel@tonic-gate  *		TRUE:	(struct ypresp_key_val);
91*7c478bd9Sstevel@tonic-gate  *		FALSE:	(struct) {};
92*7c478bd9Sstevel@tonic-gate  *	}
93*7c478bd9Sstevel@tonic-gate  *
94*7c478bd9Sstevel@tonic-gate  * YPPROC_MASTER (struct ypreq_nokey), returns (ypresp_master)
95*7c478bd9Sstevel@tonic-gate  *
96*7c478bd9Sstevel@tonic-gate  * YPPROC_ORDER (struct ypreq_nokey), returns (ypresp_order)
97*7c478bd9Sstevel@tonic-gate  *
98*7c478bd9Sstevel@tonic-gate  * YPPROC_MAPLIST (char *), returns (struct ypmaplist *)
99*7c478bd9Sstevel@tonic-gate  */
100*7c478bd9Sstevel@tonic-gate 
101*7c478bd9Sstevel@tonic-gate /* 'bool' is a built-in type for g++ */
102*7c478bd9Sstevel@tonic-gate #if !(defined(__cplusplus) && defined(_BOOL)) && !defined(__GNUG__)
103*7c478bd9Sstevel@tonic-gate #ifndef BOOL_DEFINED
104*7c478bd9Sstevel@tonic-gate typedef unsigned int bool;
105*7c478bd9Sstevel@tonic-gate #define	BOOL_DEFINED
106*7c478bd9Sstevel@tonic-gate #endif
107*7c478bd9Sstevel@tonic-gate #endif
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate /* Program and version symbols, magic numbers */
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate #define	YPPROG		((rpcprog_t)100004)
112*7c478bd9Sstevel@tonic-gate #define	YPVERS		((rpcvers_t)2)
113*7c478bd9Sstevel@tonic-gate #define	YPVERS_ORIG	((rpcvers_t)1)
114*7c478bd9Sstevel@tonic-gate #define	YPMAXRECORD	((uint_t)1024)
115*7c478bd9Sstevel@tonic-gate #define	YPMAXDOMAIN	((uint_t)256)
116*7c478bd9Sstevel@tonic-gate #define	YPMAXMAP	((uint_t)64)
117*7c478bd9Sstevel@tonic-gate #define	YPMAXPEER	((uint_t)256)
118*7c478bd9Sstevel@tonic-gate 
119*7c478bd9Sstevel@tonic-gate /* byte size of a large yp packet */
120*7c478bd9Sstevel@tonic-gate #define	YPMSGSZ		1600
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate struct ypmap_parms {
123*7c478bd9Sstevel@tonic-gate 	char *domain;			/* Null string means not available */
124*7c478bd9Sstevel@tonic-gate 	char *map;			/* Null string means not available */
125*7c478bd9Sstevel@tonic-gate 	unsigned int ordernum;		/* 0 means not available */
126*7c478bd9Sstevel@tonic-gate 	char *owner;			/* Null string means not available */
127*7c478bd9Sstevel@tonic-gate };
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate /*
130*7c478bd9Sstevel@tonic-gate  * Request parameter structures
131*7c478bd9Sstevel@tonic-gate  */
132*7c478bd9Sstevel@tonic-gate 
133*7c478bd9Sstevel@tonic-gate struct ypreq_key {
134*7c478bd9Sstevel@tonic-gate 	char *domain;
135*7c478bd9Sstevel@tonic-gate 	char *map;
136*7c478bd9Sstevel@tonic-gate 	datum keydat;
137*7c478bd9Sstevel@tonic-gate };
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate struct ypreq_nokey {
140*7c478bd9Sstevel@tonic-gate 	char *domain;
141*7c478bd9Sstevel@tonic-gate 	char *map;
142*7c478bd9Sstevel@tonic-gate };
143*7c478bd9Sstevel@tonic-gate 
144*7c478bd9Sstevel@tonic-gate struct ypreq_xfr {
145*7c478bd9Sstevel@tonic-gate 	struct ypmap_parms map_parms;
146*7c478bd9Sstevel@tonic-gate 	unsigned int transid;
147*7c478bd9Sstevel@tonic-gate 	unsigned int proto;
148*7c478bd9Sstevel@tonic-gate 	unsigned short port;
149*7c478bd9Sstevel@tonic-gate };
150*7c478bd9Sstevel@tonic-gate 
151*7c478bd9Sstevel@tonic-gate struct ypreq_newxfr {
152*7c478bd9Sstevel@tonic-gate 	struct ypmap_parms map_parms;
153*7c478bd9Sstevel@tonic-gate 	unsigned int transid;
154*7c478bd9Sstevel@tonic-gate 	unsigned int proto;
155*7c478bd9Sstevel@tonic-gate 	char *name;
156*7c478bd9Sstevel@tonic-gate };
157*7c478bd9Sstevel@tonic-gate 
158*7c478bd9Sstevel@tonic-gate #define	ypxfr_domain map_parms.domain
159*7c478bd9Sstevel@tonic-gate #define	ypxfr_map map_parms.map
160*7c478bd9Sstevel@tonic-gate #define	ypxfr_ordernum map_parms.ordernum
161*7c478bd9Sstevel@tonic-gate #define	ypxfr_owner map_parms.owner
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate /*
164*7c478bd9Sstevel@tonic-gate  * Response parameter structures
165*7c478bd9Sstevel@tonic-gate  */
166*7c478bd9Sstevel@tonic-gate 
167*7c478bd9Sstevel@tonic-gate struct ypresp_val {
168*7c478bd9Sstevel@tonic-gate 	unsigned int status;
169*7c478bd9Sstevel@tonic-gate 	datum valdat;
170*7c478bd9Sstevel@tonic-gate };
171*7c478bd9Sstevel@tonic-gate 
172*7c478bd9Sstevel@tonic-gate struct ypresp_key_val {
173*7c478bd9Sstevel@tonic-gate 	unsigned int status;
174*7c478bd9Sstevel@tonic-gate 	datum valdat;
175*7c478bd9Sstevel@tonic-gate 	datum keydat;
176*7c478bd9Sstevel@tonic-gate };
177*7c478bd9Sstevel@tonic-gate 
178*7c478bd9Sstevel@tonic-gate struct ypresp_master {
179*7c478bd9Sstevel@tonic-gate 	unsigned int status;
180*7c478bd9Sstevel@tonic-gate 	char *master;
181*7c478bd9Sstevel@tonic-gate };
182*7c478bd9Sstevel@tonic-gate 
183*7c478bd9Sstevel@tonic-gate struct ypresp_order {
184*7c478bd9Sstevel@tonic-gate 	unsigned int status;
185*7c478bd9Sstevel@tonic-gate 	unsigned int ordernum;
186*7c478bd9Sstevel@tonic-gate };
187*7c478bd9Sstevel@tonic-gate 
188*7c478bd9Sstevel@tonic-gate struct ypmaplist {
189*7c478bd9Sstevel@tonic-gate 	char ypml_name[YPMAXMAP + 1];
190*7c478bd9Sstevel@tonic-gate 	struct ypmaplist *ypml_next;
191*7c478bd9Sstevel@tonic-gate };
192*7c478bd9Sstevel@tonic-gate 
193*7c478bd9Sstevel@tonic-gate struct ypresp_maplist {
194*7c478bd9Sstevel@tonic-gate 	unsigned int status;
195*7c478bd9Sstevel@tonic-gate 	struct ypmaplist *list;
196*7c478bd9Sstevel@tonic-gate };
197*7c478bd9Sstevel@tonic-gate 
198*7c478bd9Sstevel@tonic-gate /*
199*7c478bd9Sstevel@tonic-gate  * Procedure symbols.  YPPROC_NULL, YPPROC_DOMAIN, and YPPROC_DOMAIN_NONACK
200*7c478bd9Sstevel@tonic-gate  * must keep the same values (0, 1, and 2) that they had in the first version
201*7c478bd9Sstevel@tonic-gate  * of the protocol.
202*7c478bd9Sstevel@tonic-gate  */
203*7c478bd9Sstevel@tonic-gate 
204*7c478bd9Sstevel@tonic-gate #define	YPPROC_NULL	((rpcproc_t)0)
205*7c478bd9Sstevel@tonic-gate #define	YPPROC_DOMAIN	((rpcproc_t)1)
206*7c478bd9Sstevel@tonic-gate #define	YPPROC_DOMAIN_NONACK ((rpcproc_t)2)
207*7c478bd9Sstevel@tonic-gate #define	YPPROC_MATCH	((rpcproc_t)3)
208*7c478bd9Sstevel@tonic-gate #define	YPPROC_FIRST	((rpcproc_t)4)
209*7c478bd9Sstevel@tonic-gate #define	YPPROC_NEXT	((rpcproc_t)5)
210*7c478bd9Sstevel@tonic-gate #define	YPPROC_XFR	((rpcproc_t)6)
211*7c478bd9Sstevel@tonic-gate #define	YPPROC_NEWXFR	((rpcproc_t)12)
212*7c478bd9Sstevel@tonic-gate #define	YPPROC_CLEAR	((rpcproc_t)7)
213*7c478bd9Sstevel@tonic-gate #define	YPPROC_ALL	((rpcproc_t)8)
214*7c478bd9Sstevel@tonic-gate #define	YPPROC_MASTER	((rpcproc_t)9)
215*7c478bd9Sstevel@tonic-gate #define	YPPROC_ORDER	((rpcproc_t)10)
216*7c478bd9Sstevel@tonic-gate #define	YPPROC_MAPLIST	((rpcproc_t)11)
217*7c478bd9Sstevel@tonic-gate 
218*7c478bd9Sstevel@tonic-gate /* Return status values */
219*7c478bd9Sstevel@tonic-gate 
220*7c478bd9Sstevel@tonic-gate #define	YP_TRUE		(1)	/* General purpose success code */
221*7c478bd9Sstevel@tonic-gate #define	YP_NOMORE	(2)	/* No more entries in map */
222*7c478bd9Sstevel@tonic-gate #define	YP_FALSE	(0)	/* General purpose failure code */
223*7c478bd9Sstevel@tonic-gate #define	YP_NOMAP	(-1)	/* No such map in domain */
224*7c478bd9Sstevel@tonic-gate #define	YP_NODOM	(-2)	/* Domain not supported */
225*7c478bd9Sstevel@tonic-gate #define	YP_NOKEY	(-3)	/* No such key in map */
226*7c478bd9Sstevel@tonic-gate #define	YP_BADOP	(-4)	/* Invalid operation */
227*7c478bd9Sstevel@tonic-gate #define	YP_BADDB	(-5)	/* Server data base is bad */
228*7c478bd9Sstevel@tonic-gate #define	YP_YPERR	(-6)	/* YP server error */
229*7c478bd9Sstevel@tonic-gate #define	YP_BADARGS	(-7)	/* Request arguments bad */
230*7c478bd9Sstevel@tonic-gate #define	YP_VERS		(-8)	/* YP server vers. mismatch - server */
231*7c478bd9Sstevel@tonic-gate 				/*   can't supply requested service. */
232*7c478bd9Sstevel@tonic-gate 
233*7c478bd9Sstevel@tonic-gate enum ypreqtype {YPREQ_KEY = 1, YPREQ_NOKEY = 2, YPREQ_MAP_PARMS = 3};
234*7c478bd9Sstevel@tonic-gate struct yprequest {
235*7c478bd9Sstevel@tonic-gate 	enum ypreqtype yp_reqtype;
236*7c478bd9Sstevel@tonic-gate 	union {
237*7c478bd9Sstevel@tonic-gate 		struct ypreq_key yp_req_keytype;
238*7c478bd9Sstevel@tonic-gate 		struct ypreq_nokey yp_req_nokeytype;
239*7c478bd9Sstevel@tonic-gate 		struct ypmap_parms yp_req_map_parmstype;
240*7c478bd9Sstevel@tonic-gate 	}yp_reqbody;
241*7c478bd9Sstevel@tonic-gate };
242*7c478bd9Sstevel@tonic-gate 
243*7c478bd9Sstevel@tonic-gate #define	YPMATCH_REQTYPE YPREQ_KEY
244*7c478bd9Sstevel@tonic-gate #define	ypmatch_req_domain yp_reqbody.yp_req_keytype.domain
245*7c478bd9Sstevel@tonic-gate #define	ypmatch_req_map yp_reqbody.yp_req_keytype.map
246*7c478bd9Sstevel@tonic-gate #define	ypmatch_req_keydat yp_reqbody.yp_req_keytype.keydat
247*7c478bd9Sstevel@tonic-gate #define	ypmatch_req_keyptr yp_reqbody.yp_req_keytype.keydat.dptr
248*7c478bd9Sstevel@tonic-gate #define	ypmatch_req_keysize yp_reqbody.yp_req_keytype.keydat.dsize
249*7c478bd9Sstevel@tonic-gate 
250*7c478bd9Sstevel@tonic-gate #define	YPFIRST_REQTYPE YPREQ_NOKEY
251*7c478bd9Sstevel@tonic-gate #define	ypfirst_req_domain yp_reqbody.yp_req_nokeytype.domain
252*7c478bd9Sstevel@tonic-gate #define	ypfirst_req_map yp_reqbody.yp_req_nokeytype.map
253*7c478bd9Sstevel@tonic-gate 
254*7c478bd9Sstevel@tonic-gate #define	YPNEXT_REQTYPE YPREQ_KEY
255*7c478bd9Sstevel@tonic-gate #define	ypnext_req_domain yp_reqbody.yp_req_keytype.domain
256*7c478bd9Sstevel@tonic-gate #define	ypnext_req_map yp_reqbody.yp_req_keytype.map
257*7c478bd9Sstevel@tonic-gate #define	ypnext_req_keydat yp_reqbody.yp_req_keytype.keydat
258*7c478bd9Sstevel@tonic-gate #define	ypnext_req_keyptr yp_reqbody.yp_req_keytype.keydat.dptr
259*7c478bd9Sstevel@tonic-gate #define	ypnext_req_keysize yp_reqbody.yp_req_keytype.keydat.dsize
260*7c478bd9Sstevel@tonic-gate 
261*7c478bd9Sstevel@tonic-gate #define	YPPUSH_REQTYPE YPREQ_NOKEY
262*7c478bd9Sstevel@tonic-gate #define	yppush_req_domain yp_reqbody.yp_req_nokeytype.domain
263*7c478bd9Sstevel@tonic-gate #define	yppush_req_map yp_reqbody.yp_req_nokeytype.map
264*7c478bd9Sstevel@tonic-gate 
265*7c478bd9Sstevel@tonic-gate #define	YPPULL_REQTYPE YPREQ_NOKEY
266*7c478bd9Sstevel@tonic-gate #define	yppull_req_domain yp_reqbody.yp_req_nokeytype.domain
267*7c478bd9Sstevel@tonic-gate #define	yppull_req_map yp_reqbody.yp_req_nokeytype.map
268*7c478bd9Sstevel@tonic-gate 
269*7c478bd9Sstevel@tonic-gate #define	YPPOLL_REQTYPE YPREQ_NOKEY
270*7c478bd9Sstevel@tonic-gate #define	yppoll_req_domain yp_reqbody.yp_req_nokeytype.domain
271*7c478bd9Sstevel@tonic-gate #define	yppoll_req_map yp_reqbody.yp_req_nokeytype.map
272*7c478bd9Sstevel@tonic-gate 
273*7c478bd9Sstevel@tonic-gate #define	YPGET_REQTYPE YPREQ_MAP_PARMS
274*7c478bd9Sstevel@tonic-gate #define	ypget_req_domain yp_reqbody.yp_req_map_parmstype.domain
275*7c478bd9Sstevel@tonic-gate #define	ypget_req_map yp_reqbody.yp_req_map_parmstype.map
276*7c478bd9Sstevel@tonic-gate #define	ypget_req_ordernum yp_reqbody.yp_req_map_parmstype.ordernum
277*7c478bd9Sstevel@tonic-gate #define	ypget_req_owner yp_reqbody.yp_req_map_parmstype.owner
278*7c478bd9Sstevel@tonic-gate 
279*7c478bd9Sstevel@tonic-gate enum ypresptype {YPRESP_VAL = 1, YPRESP_KEY_VAL = 2, YPRESP_MAP_PARMS = 3};
280*7c478bd9Sstevel@tonic-gate struct ypresponse {
281*7c478bd9Sstevel@tonic-gate 	enum ypresptype yp_resptype;
282*7c478bd9Sstevel@tonic-gate 	union {
283*7c478bd9Sstevel@tonic-gate 		struct ypresp_val yp_resp_valtype;
284*7c478bd9Sstevel@tonic-gate 		struct ypresp_key_val yp_resp_key_valtype;
285*7c478bd9Sstevel@tonic-gate 		struct ypmap_parms yp_resp_map_parmstype;
286*7c478bd9Sstevel@tonic-gate 	} yp_respbody;
287*7c478bd9Sstevel@tonic-gate };
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate #define	YPMATCH_RESPTYPE YPRESP_VAL
290*7c478bd9Sstevel@tonic-gate #define	ypmatch_resp_status yp_respbody.yp_resp_valtype.status
291*7c478bd9Sstevel@tonic-gate #define	ypmatch_resp_valdat yp_respbody.yp_resp_valtype.valdat
292*7c478bd9Sstevel@tonic-gate #define	ypmatch_resp_valptr yp_respbody.yp_resp_valtype.valdat.dptr
293*7c478bd9Sstevel@tonic-gate #define	ypmatch_resp_valsize yp_respbody.yp_resp_valtype.valdat.dsize
294*7c478bd9Sstevel@tonic-gate 
295*7c478bd9Sstevel@tonic-gate #define	YPFIRST_RESPTYPE YPRESP_KEY_VAL
296*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_status yp_respbody.yp_resp_key_valtype.status
297*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_keydat yp_respbody.yp_resp_key_valtype.keydat
298*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_keyptr yp_respbody.yp_resp_key_valtype.keydat.dptr
299*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_keysize yp_respbody.yp_resp_key_valtype.keydat.dsize
300*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_valdat yp_respbody.yp_resp_key_valtype.valdat
301*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_valptr yp_respbody.yp_resp_key_valtype.valdat.dptr
302*7c478bd9Sstevel@tonic-gate #define	ypfirst_resp_valsize yp_respbody.yp_resp_key_valtype.valdat.dsize
303*7c478bd9Sstevel@tonic-gate 
304*7c478bd9Sstevel@tonic-gate #define	YPNEXT_RESPTYPE YPRESP_KEY_VAL
305*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_status yp_respbody.yp_resp_key_valtype.status
306*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_keydat yp_respbody.yp_resp_key_valtype.keydat
307*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_keyptr yp_respbody.yp_resp_key_valtype.keydat.dptr
308*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_keysize yp_respbody.yp_resp_key_valtype.keydat.dsize
309*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_valdat yp_respbody.yp_resp_key_valtype.valdat
310*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_valptr yp_respbody.yp_resp_key_valtype.valdat.dptr
311*7c478bd9Sstevel@tonic-gate #define	ypnext_resp_valsize yp_respbody.yp_resp_key_valtype.valdat.dsize
312*7c478bd9Sstevel@tonic-gate 
313*7c478bd9Sstevel@tonic-gate #define	YPPOLL_RESPTYPE YPRESP_MAP_PARMS
314*7c478bd9Sstevel@tonic-gate #define	yppoll_resp_domain yp_respbody.yp_resp_map_parmstype.domain
315*7c478bd9Sstevel@tonic-gate #define	yppoll_resp_map yp_respbody.yp_resp_map_parmstype.map
316*7c478bd9Sstevel@tonic-gate #define	yppoll_resp_ordernum yp_respbody.yp_resp_map_parmstype.ordernum
317*7c478bd9Sstevel@tonic-gate #define	yppoll_resp_owner yp_respbody.yp_resp_map_parmstype.owner
318*7c478bd9Sstevel@tonic-gate 
319*7c478bd9Sstevel@tonic-gate 
320*7c478bd9Sstevel@tonic-gate extern bool _xdr_yprequest();
321*7c478bd9Sstevel@tonic-gate extern bool _xdr_ypresponse();
322*7c478bd9Sstevel@tonic-gate /*
323*7c478bd9Sstevel@tonic-gate  *		Protocol between clients (ypxfr, only) and yppush
324*7c478bd9Sstevel@tonic-gate  *		yppush speaks a protocol in the transient range, which
325*7c478bd9Sstevel@tonic-gate  *		is supplied to ypxfr as a command-line parameter when it
326*7c478bd9Sstevel@tonic-gate  *		is activated by ypserv.
327*7c478bd9Sstevel@tonic-gate  */
328*7c478bd9Sstevel@tonic-gate #define	YPPUSHVERS		((rpcvers_t)1)
329*7c478bd9Sstevel@tonic-gate #define	YPPUSHVERS_ORIG		((rpcvers_t)1)
330*7c478bd9Sstevel@tonic-gate 
331*7c478bd9Sstevel@tonic-gate /* Procedure symbols */
332*7c478bd9Sstevel@tonic-gate 
333*7c478bd9Sstevel@tonic-gate #define	YPPUSHPROC_NULL		((rpcproc_t)0)
334*7c478bd9Sstevel@tonic-gate #define	YPPUSHPROC_XFRRESP	((rpcproc_t)1)
335*7c478bd9Sstevel@tonic-gate 
336*7c478bd9Sstevel@tonic-gate struct yppushresp_xfr {
337*7c478bd9Sstevel@tonic-gate 	unsigned int transid;
338*7c478bd9Sstevel@tonic-gate 	unsigned int status;
339*7c478bd9Sstevel@tonic-gate };
340*7c478bd9Sstevel@tonic-gate 
341*7c478bd9Sstevel@tonic-gate /* Status values for yppushresp_xfr.status */
342*7c478bd9Sstevel@tonic-gate 
343*7c478bd9Sstevel@tonic-gate #define	YPPUSH_SUCC	(1)	/* Success */
344*7c478bd9Sstevel@tonic-gate #define	YPPUSH_AGE	(2)	/* Master's version not newer */
345*7c478bd9Sstevel@tonic-gate #define	YPPUSH_NOMAP 	(-1)	/* Can't find server for map */
346*7c478bd9Sstevel@tonic-gate #define	YPPUSH_NODOM 	(-2)	/* Domain not supported */
347*7c478bd9Sstevel@tonic-gate #define	YPPUSH_RSRC 	(-3)	/* Local resouce alloc failure */
348*7c478bd9Sstevel@tonic-gate #define	YPPUSH_RPC 	(-4)	/* RPC failure talking to server */
349*7c478bd9Sstevel@tonic-gate #define	YPPUSH_MADDR	(-5)	/* Can't get master address */
350*7c478bd9Sstevel@tonic-gate #define	YPPUSH_YPERR 	(-6)	/* YP server/map db error */
351*7c478bd9Sstevel@tonic-gate #define	YPPUSH_BADARGS 	(-7)	/* Request arguments bad */
352*7c478bd9Sstevel@tonic-gate #define	YPPUSH_DBM	(-8)	/* Local dbm operation failed */
353*7c478bd9Sstevel@tonic-gate #define	YPPUSH_FILE	(-9)	/* Local file I/O operation failed */
354*7c478bd9Sstevel@tonic-gate #define	YPPUSH_SKEW	(-10)	/* Map version skew during transfer */
355*7c478bd9Sstevel@tonic-gate #define	YPPUSH_CLEAR	(-11)	/* Can't send "Clear" req to local */
356*7c478bd9Sstevel@tonic-gate 				/*   ypserv */
357*7c478bd9Sstevel@tonic-gate #define	YPPUSH_FORCE	(-12)	/* No local order number in map - */
358*7c478bd9Sstevel@tonic-gate 				/*   use -f flag. */
359*7c478bd9Sstevel@tonic-gate #define	YPPUSH_XFRERR	(-13)	/* ypxfr error */
360*7c478bd9Sstevel@tonic-gate #define	YPPUSH_REFUSED	(-14)	/* Transfer request refused by ypserv */
361*7c478bd9Sstevel@tonic-gate #define	YPPUSH_NOALIAS	(-15)	/* Alias not found for map or domain */
362*7c478bd9Sstevel@tonic-gate 
363*7c478bd9Sstevel@tonic-gate #ifdef __STDC__
364*7c478bd9Sstevel@tonic-gate extern bool xdr_datum(XDR *, datum *);
365*7c478bd9Sstevel@tonic-gate extern bool xdr_ypdomain_wrap_string(XDR *, char **);
366*7c478bd9Sstevel@tonic-gate extern bool xdr_ypmap_wrap_string(XDR *, char **);
367*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_key(XDR *, struct ypreq_key *);
368*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_nokey(XDR *, struct ypreq_nokey *);
369*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_xfr(XDR *, struct ypreq_xfr *);
370*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_newxfr(XDR *, struct ypreq_newxfr *);
371*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_val(XDR *, struct ypresp_val *);
372*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_key_val(XDR *, struct ypresp_key_val *);
373*7c478bd9Sstevel@tonic-gate extern bool xdr_ypmap_parms(XDR *, struct ypmap_parms *);
374*7c478bd9Sstevel@tonic-gate extern bool xdr_ypowner_wrap_string(XDR *, char **);
375*7c478bd9Sstevel@tonic-gate extern bool xdr_yppushresp_xfr(XDR *, struct yppushresp_xfr *);
376*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_order(XDR *, struct ypresp_order *);
377*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_master(XDR *, struct ypresp_master *);
378*7c478bd9Sstevel@tonic-gate extern bool xdr_ypall(XDR *, struct ypall_callback *);
379*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_maplist(XDR *, struct ypresp_maplist *);
380*7c478bd9Sstevel@tonic-gate 
381*7c478bd9Sstevel@tonic-gate #else
382*7c478bd9Sstevel@tonic-gate 
383*7c478bd9Sstevel@tonic-gate extern bool xdr_datum();
384*7c478bd9Sstevel@tonic-gate extern bool xdr_ypdomain_wrap_string();
385*7c478bd9Sstevel@tonic-gate extern bool xdr_ypmap_wrap_string();
386*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_key();
387*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_nokey();
388*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_xfr();
389*7c478bd9Sstevel@tonic-gate extern bool xdr_ypreq_newxfr();
390*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_val();
391*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_key_val();
392*7c478bd9Sstevel@tonic-gate extern bool xdr_yp_inaddr();
393*7c478bd9Sstevel@tonic-gate extern bool xdr_ypmap_parms();
394*7c478bd9Sstevel@tonic-gate extern bool xdr_ypowner_wrap_string();
395*7c478bd9Sstevel@tonic-gate extern bool xdr_yppushresp_xfr();
396*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_order();
397*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_master();
398*7c478bd9Sstevel@tonic-gate extern bool xdr_ypall();
399*7c478bd9Sstevel@tonic-gate extern bool xdr_ypresp_maplist();
400*7c478bd9Sstevel@tonic-gate #endif	/* __STDC__ */
401*7c478bd9Sstevel@tonic-gate 
402*7c478bd9Sstevel@tonic-gate #ifdef __cplusplus
403*7c478bd9Sstevel@tonic-gate }
404*7c478bd9Sstevel@tonic-gate #endif
405*7c478bd9Sstevel@tonic-gate 
406*7c478bd9Sstevel@tonic-gate #endif	/* _RPCSVC_YP_PROT_H */
407