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