2 * This file contains symbols and structures defining the rpc protocol
3 * between the NIS clients and the NIS servers. The servers
4 * are the NIS database servers, and the NIS binders.
7 #ifndef _RPCSVC_YP_PROT_H
8 #define _RPCSVC_YP_PROT_H
13 #include <rpcsvc/ypclnt.h>
16 * The following procedures are supported by the protocol:
18 * YPPROC_NULL() returns () takes nothing, returns nothing. This indicates
19 * that the NIS server is alive.
21 * YPPROC_DOMAIN (char *) returns (bool_t) TRUE. Indicates that the
22 * responding NIS server does serve the named domain; FALSE indicates no
25 * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the NIS server does serve
26 * the named domain, otherwise does not return. Used in the broadcast case.
28 * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val). Returns the
29 * right-hand value for a passed left-hand key, within a named map and
32 * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val).
33 * Returns the first key-value pair from a named domain and map.
35 * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val). Returns
36 * the key-value pair following a passed key-value pair within a named
39 * YPPROC_XFR (struct ypreq_xfr) returns nothing. Indicates to a server that
40 * a map should be updated.
42 * YPPROC_CLEAR takes nothing, returns nothing. Instructs a NIS server to
43 * close the current map, so that old versions of the disk file don't get
46 * YPPROC_ALL (struct ypreq_nokey), returns
47 * union switch (bool_t more) {
48 * TRUE: (struct ypresp_key_val);
52 * YPPROC_MASTER (struct ypreq_nokey), returns (ypresp_master)
54 * YPPROC_ORDER (struct ypreq_nokey), returns (ypresp_order)
56 * YPPROC_MAPLIST (char *), returns (struct ypmaplist *)
59 /* Program and version symbols, magic numbers */
61 #define YPPROG ((u_long)100004)
62 #define YPVERS ((u_long)2)
63 #define YPVERS_ORIG ((u_long)1)
64 #define YPMAXRECORD ((u_long)1024)
65 #define YPMAXDOMAIN ((u_long)256)
66 #define YPMAXMAP ((u_long)64)
67 #define YPMAXPEER ((u_long)256)
69 /* byte size of a large NIS packet */
81 char *domain
; /* Null string means not available */
82 char *map
; /* Null string means not available */
83 unsigned long int ordernum
; /* 0 means not available */
84 char *owner
; /* Null string means not available */
88 * Request parameter structures
103 struct ypmap_parms map_parms
;
104 unsigned long transid
;
109 struct ypreq_newxfr
{
110 struct ypmap_parms map_parms
;
111 unsigned long transid
;
116 #define ypxfr_domain map_parms.domain
117 #define ypxfr_map map_parms.map
118 #define ypxfr_ordernum map_parms.ordernum
119 #define ypxfr_owner map_parms.owner
122 * Response parameter structures
126 long unsigned status
;
130 struct ypresp_key_val
{
131 long unsigned status
;
136 struct ypresp_master
{
137 long unsigned status
;
141 struct ypresp_order
{
142 long unsigned status
;
143 unsigned long int ordernum
;
147 char map
[YPMAXMAP
+ 1];
148 #define ypml_name map
149 struct ypmaplist
*next
;
150 #define ypml_next next
153 struct ypresp_maplist
{
154 long unsigned status
;
155 struct ypmaplist
*list
;
159 * Procedure symbols. YPPROC_NULL, YPPROC_DOMAIN, and YPPROC_DOMAIN_NONACK
160 * must keep the same values (0, 1, and 2) that they had in the first version
164 #define YPPROC_NULL ((u_long)0)
165 #define YPPROC_DOMAIN ((u_long)1)
166 #define YPPROC_DOMAIN_NONACK ((u_long)2)
167 #define YPPROC_MATCH ((u_long)3)
168 #define YPPROC_FIRST ((u_long)4)
169 #define YPPROC_NEXT ((u_long)5)
170 #define YPPROC_XFR ((u_long)6)
171 #define YPPROC_CLEAR ((u_long)7)
172 #define YPPROC_ALL ((u_long)8)
173 #define YPPROC_MASTER ((u_long)9)
174 #define YPPROC_ORDER ((u_long)10)
175 #define YPPROC_MAPLIST ((u_long)11)
176 #define YPPROC_NEWXFR ((u_long)12)
178 /* Return status values */
180 #define YP_TRUE ((long)1) /* General purpose success code */
181 #define YP_NOMORE ((long)2) /* No more entries in map */
182 #define YP_FALSE ((long)0) /* General purpose failure code */
183 #define YP_NOMAP ((long)-1) /* No such map in domain */
184 #define YP_NODOM ((long)-2) /* Domain not supported */
185 #define YP_NOKEY ((long)-3) /* No such key in map */
186 #define YP_BADOP ((long)-4) /* Invalid operation */
187 #define YP_BADDB ((long)-5) /* Server data base is bad */
188 #define YP_YPERR ((long)-6) /* NIS server error */
189 #define YP_BADARGS ((long)-7) /* Request arguments bad */
190 #define YP_VERS ((long)-8) /* NIS server version mismatch - server
191 * can't supply requested service. */
193 * Protocol between clients and NIS binder servers
197 * The following procedures are supported by the protocol:
199 * YPBINDPROC_NULL() returns ()
200 * takes nothing, returns nothing
202 * YPBINDPROC_DOMAIN takes (char *) returns (struct ypbind_resp)
204 * YPBINDPROC_SETDOM takes (struct ypbind_setdom) returns nothing
207 /* Program and version symbols, magic numbers */
209 #define YPBINDPROG ((u_long)100007)
210 #define YPBINDVERS ((u_long)2)
211 #define YPBINDVERS_ORIG ((u_long)1)
213 /* Procedure symbols */
215 #define YPBINDPROC_NULL ((u_long)0)
216 #define YPBINDPROC_DOMAIN ((u_long)1)
217 #define YPBINDPROC_SETDOM ((u_long)2)
219 * Response structure and overall result status codes. Success and failure
220 * represent two separate response message types.
223 enum ypbind_resptype
{YPBIND_SUCC_VAL
= 1, YPBIND_FAIL_VAL
= 2};
225 struct ypbind_binding
{
226 struct in_addr ypbind_binding_addr
; /* In network order */
227 unsigned short int ypbind_binding_port
; /* In network order */
231 enum ypbind_resptype ypbind_status
;
233 unsigned long ypbind_error
;
234 struct ypbind_binding ypbind_bindinfo
;
239 /* Detailed failure reason codes for response field ypbind_error*/
241 #define YPBIND_ERR_ERR 1 /* Internal error */
242 #define YPBIND_ERR_NOSERV 2 /* No bound server for passed domain */
243 #define YPBIND_ERR_RESC 3 /* System resource allocation failure */
246 * Request data structure for ypbind "Set domain" procedure.
248 struct ypbind_setdom
{
249 char ypsetdom_domain
[YPMAXDOMAIN
+ 1];
250 struct ypbind_binding ypsetdom_binding
;
251 unsigned short ypsetdom_vers
;
253 #define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
254 #define ypsetdom_port ypsetdom_binding.ypbind_binding_port
257 * Protocol between clients (ypxfr, only) and yppush
258 * yppush speaks a protocol in the transient range, which
259 * is supplied to ypxfr as a command-line parameter when it
260 * is activated by ypserv.
262 #define YPPUSHVERS ((u_long) 1)
263 #define YPPUSHVERS_ORIG ((u_long)1)
265 /* Procedure symbols */
267 #define YPPUSHPROC_NULL ((u_long)0)
268 #define YPPUSHPROC_XFRRESP ((u_long)1)
270 struct yppushresp_xfr
{
271 unsigned long transid
;
272 unsigned long status
;
275 /* Status values for yppushresp_xfr.status */
277 #define YPPUSH_SUCC ((long)1) /* Success */
278 #define YPPUSH_AGE ((long)2) /* Master's version not newer */
279 #define YPPUSH_NOMAP ((long)-1) /* Can't find server for map */
280 #define YPPUSH_NODOM ((long)-2) /* Domain not supported */
281 #define YPPUSH_RSRC ((long)-3) /* Local resouce alloc failure */
282 #define YPPUSH_RPC ((long)-4) /* RPC failure talking to server */
283 #define YPPUSH_MADDR ((long)-5) /* Can't get master address */
284 #define YPPUSH_YPERR ((long)-6) /* NIS server/map db error */
285 #define YPPUSH_BADARGS ((long)-7) /* Request arguments bad */
286 #define YPPUSH_DBM ((long)-8) /* Local dbm operation failed */
287 #define YPPUSH_FILE ((long)-9) /* Local file I/O operation failed */
288 #define YPPUSH_SKEW ((long)-10) /* Map version skew during transfer */
289 #define YPPUSH_CLEAR ((long)-11) /* Can't send "Clear" req to local
291 #define YPPUSH_FORCE ((long)-12) /* No local order number in map -
293 #define YPPUSH_XFRERR ((long)-13) /* ypxfr error */
294 #define YPPUSH_REFUSED ((long)-14) /* Transfer request refused by ypserv */
295 #define YPPUSH_NOALIAS ((long)-15) /* Alias not found for map or domain */
300 struct ypresp_key_val val
;
306 extern bool_t xdr_datum
__P ((XDR
*__xdrs
, datum
* __objp
));
307 extern bool_t xdr_ypdomain_wrap_string
__P ((XDR
*__xdrs
, char ** __objp
));
308 extern bool_t xdr_ypmap_wrap_string
__P ((XDR
*__xdrs
, char ** __objp
));
309 extern bool_t xdr_ypreq_key
__P ((XDR
*__xdrs
, struct ypreq_key
* __objp
));
310 extern bool_t xdr_ypreq_nokey
__P ((XDR
*__xdrs
, struct ypreq_nokey
* __objp
));
311 extern bool_t xdr_ypreq_xfr
__P ((XDR
*__xdrs
, struct ypreq_xfr
* __objp
));
312 extern bool_t xdr_ypreq_newxfr
__P ((XDR
*__xdrs
, struct ypreq_newxfr
* __objp
));
313 extern bool_t xdr_ypresp_val
__P ((XDR
*__xdrs
, struct ypresp_val
* __objp
));
314 extern bool_t xdr_ypresp_key_val
__P ((XDR
*__xdrs
, struct ypresp_key_val
* __objp
));
315 extern bool_t xdr_ypbind_resp
__P ((XDR
*__xdrs
, struct ypbind_resp
* __objp
));
316 extern bool_t xdr_ypbind_setdom
__P ((XDR
*__xdrs
, struct ypbind_setdom
* __objp
));
317 extern bool_t xdr_ypmap_parms
__P ((XDR
*__xdrs
, struct ypmap_parms
* __objp
));
318 extern bool_t xdr_ypowner_wrap_string
__P ((XDR
*__xdrs
, char ** __objp
));
319 extern bool_t xdr_yppushresp_xfr
__P ((XDR
*__xdrs
, struct yppushresp_xfr
* __objp
));
320 extern bool_t xdr_ypresp_order
__P ((XDR
*__xdrs
, struct ypresp_order
* __objp
));
321 extern bool_t xdr_ypresp_master
__P ((XDR
*__xdrs
, struct ypresp_master
* __objp
));
322 extern bool_t xdr_ypall
__P ((XDR
*__xdrs
, struct ypall_callback
* __objp
));
323 extern bool_t xdr_ypresp_maplist
__P ((XDR
*__xdrs
, struct ypresp_maplist
* __objp
));
325 extern bool_t xdr_domainname_ypbind
__P ((XDR
*__xdrs
, char * __objp
));
326 extern bool_t xdr_ypbind_binding
__P ((XDR
*__xdrs
, struct ypbind_binding
* __objp
));
327 extern bool_t xdr_ypbind_resptype
__P ((XDR
*__xdrs
, enum ypbind_resptype
* __objp
));
328 extern bool_t xdr_ypstat
__P ((XDR
*__xdrs
, enum ypbind_resptype
* __objp
));
329 extern bool_t xdr_ypresp_all
__P ((XDR
*__xdrs
, struct ypresp_all
* __objp
));
330 extern bool_t xdr_ypresp_all_seq
__P ((XDR
*__xdrs
, u_long
* __objp
));
331 extern bool_t xdr_ypmaplist_str
__P ((XDR
*__xdrs
, char * __objp
));
332 extern bool_t xdr_ypmaplist
__P ((XDR
*__xdrs
, struct ypmaplist
* __objp
));
336 #endif /* _RPCSVC_YP_PROT_H */