1431e8abfSfvdl %/* 2431e8abfSfvdl % * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3431e8abfSfvdl % * unrestricted use provided that this legend is included on all tape 4431e8abfSfvdl % * media and as a part of the software program in whole or part. Users 5431e8abfSfvdl % * may copy or modify Sun RPC without charge, but are not authorized 6431e8abfSfvdl % * to license or distribute it to anyone else except as part of a product or 7431e8abfSfvdl % * program developed by the user. 8431e8abfSfvdl % * 9431e8abfSfvdl % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 10431e8abfSfvdl % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 11431e8abfSfvdl % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 12431e8abfSfvdl % * 13431e8abfSfvdl % * Sun RPC is provided with no support and without any obligation on the 14431e8abfSfvdl % * part of Sun Microsystems, Inc. to assist in its use, correction, 15431e8abfSfvdl % * modification or enhancement. 16431e8abfSfvdl % * 17431e8abfSfvdl % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 18431e8abfSfvdl % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 19431e8abfSfvdl % * OR ANY PART THEREOF. 20431e8abfSfvdl % * 21431e8abfSfvdl % * In no event will Sun Microsystems, Inc. be liable for any lost revenue 22431e8abfSfvdl % * or profits or other special, indirect and consequential damages, even if 23431e8abfSfvdl % * Sun has been advised of the possibility of such damages. 24431e8abfSfvdl % * 25431e8abfSfvdl % * Sun Microsystems, Inc. 26431e8abfSfvdl % * 2550 Garcia Avenue 27431e8abfSfvdl % * Mountain View, California 94043 28431e8abfSfvdl % */ 29431e8abfSfvdl %/* 30431e8abfSfvdl % * Copyright (c) 1988 by Sun Microsystems, Inc. 31431e8abfSfvdl % */ 32431e8abfSfvdl 33431e8abfSfvdl %/* from rpcb_prot.x */ 34431e8abfSfvdl 35431e8abfSfvdl #ifdef RPC_HDR 36431e8abfSfvdl % 37431e8abfSfvdl %/* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */ 38431e8abfSfvdl % 39431e8abfSfvdl %#ifndef _KERNEL 40431e8abfSfvdl % 41431e8abfSfvdl #endif 42431e8abfSfvdl 43431e8abfSfvdl /* 44431e8abfSfvdl * rpcb_prot.x 45431e8abfSfvdl * rpcbind protocol, versions 3 and 4, in RPC Language 46431e8abfSfvdl */ 47431e8abfSfvdl % 48431e8abfSfvdl %/* 49431e8abfSfvdl % * The following procedures are supported by the protocol in version 3: 50431e8abfSfvdl % * 51431e8abfSfvdl % * RPCBPROC_NULL() returns () 52431e8abfSfvdl % * takes nothing, returns nothing 53431e8abfSfvdl % * 54431e8abfSfvdl % * RPCBPROC_SET(rpcb) returns (bool_t) 55431e8abfSfvdl % * TRUE is success, FALSE is failure. Registers the tuple 56431e8abfSfvdl % * [prog, vers, address, owner, netid]. 57431e8abfSfvdl % * Finds out owner and netid information on its own. 58431e8abfSfvdl % * 59431e8abfSfvdl % * RPCBPROC_UNSET(rpcb) returns (bool_t) 60431e8abfSfvdl % * TRUE is success, FALSE is failure. Un-registers tuple 61431e8abfSfvdl % * [prog, vers, netid]. addresses is ignored. 62431e8abfSfvdl % * If netid is NULL, unregister all. 63431e8abfSfvdl % * 64431e8abfSfvdl % * RPCBPROC_GETADDR(rpcb) returns (string). 65431e8abfSfvdl % * 0 is failure. Otherwise returns the universal address where the 66431e8abfSfvdl % * triple [prog, vers, netid] is registered. Ignore address and owner. 67431e8abfSfvdl % * 68431e8abfSfvdl % * RPCBPROC_DUMP() RETURNS (rpcblist_ptr) 69431e8abfSfvdl % * used to dump the entire rpcbind maps 70431e8abfSfvdl % * 71431e8abfSfvdl % * RPCBPROC_CALLIT(rpcb_rmtcallargs) 72431e8abfSfvdl % * RETURNS (rpcb_rmtcallres); 73431e8abfSfvdl % * Calls the procedure on the remote machine. If it is not registered, 74431e8abfSfvdl % * this procedure is quiet; i.e. it does not return error information!!! 75431e8abfSfvdl % * This routine only passes null authentication parameters. 76431e8abfSfvdl % * It has no interface to xdr routines for RPCBPROC_CALLIT. 77431e8abfSfvdl % * 78431e8abfSfvdl % * RPCBPROC_GETTIME() returns (int). 79431e8abfSfvdl % * Gets the remote machines time 80431e8abfSfvdl % * 81431e8abfSfvdl % * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf) 82431e8abfSfvdl % * Returns the netbuf address from universal address. 83431e8abfSfvdl % * 84431e8abfSfvdl % * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string) 85431e8abfSfvdl % * Returns the universal address from netbuf address. 86431e8abfSfvdl % * 87431e8abfSfvdl % * END OF RPCBIND VERSION 3 PROCEDURES 88431e8abfSfvdl % */ 89431e8abfSfvdl %/* 90431e8abfSfvdl % * Except for RPCBPROC_CALLIT, the procedures above are carried over to 91431e8abfSfvdl % * rpcbind version 4. Those below are added or modified for version 4. 92431e8abfSfvdl % * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER 93431e8abfSfvdl % * AS RPCBPROC_CALLIT. 94431e8abfSfvdl % * 95431e8abfSfvdl % * RPCBPROC_BCAST(rpcb_rmtcallargs) 96431e8abfSfvdl % * RETURNS (rpcb_rmtcallres); 97431e8abfSfvdl % * Calls the procedure on the remote machine. If it is not registered, 98431e8abfSfvdl % * this procedure IS quiet; i.e. it DOES NOT return error information!!! 99431e8abfSfvdl % * This routine should be used for broadcasting and nothing else. 100431e8abfSfvdl % * 101431e8abfSfvdl % * RPCBPROC_GETVERSADDR(rpcb) returns (string). 102431e8abfSfvdl % * 0 is failure. Otherwise returns the universal address where the 103431e8abfSfvdl % * triple [prog, vers, netid] is registered. Ignore address and owner. 104431e8abfSfvdl % * Same as RPCBPROC_GETADDR except that if the given version number 105431e8abfSfvdl % * is not available, the address is not returned. 106431e8abfSfvdl % * 107431e8abfSfvdl % * RPCBPROC_INDIRECT(rpcb_rmtcallargs) 108431e8abfSfvdl % * RETURNS (rpcb_rmtcallres); 109431e8abfSfvdl % * Calls the procedure on the remote machine. If it is not registered, 110431e8abfSfvdl % * this procedure is NOT quiet; i.e. it DOES return error information!!! 111431e8abfSfvdl % * as any normal application would expect. 112431e8abfSfvdl % * 113431e8abfSfvdl % * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr). 114431e8abfSfvdl % * Same as RPCBPROC_GETADDR except that it returns a list of all the 115431e8abfSfvdl % * addresses registered for the combination (prog, vers) (for all 116431e8abfSfvdl % * transports). 117431e8abfSfvdl % * 118431e8abfSfvdl % * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers) 119431e8abfSfvdl % * Returns the statistics about the kind of requests received by rpcbind. 120431e8abfSfvdl % */ 121431e8abfSfvdl % 122431e8abfSfvdl %/* 123431e8abfSfvdl % * A mapping of (program, version, network ID) to address 124431e8abfSfvdl % */ 125431e8abfSfvdl struct rpcb { 126431e8abfSfvdl rpcprog_t r_prog; /* program number */ 127431e8abfSfvdl rpcvers_t r_vers; /* version number */ 128431e8abfSfvdl string r_netid<>; /* network id */ 129431e8abfSfvdl string r_addr<>; /* universal address */ 130431e8abfSfvdl string r_owner<>; /* owner of this service */ 131431e8abfSfvdl }; 132431e8abfSfvdl #ifdef RPC_HDR 133431e8abfSfvdl % 134431e8abfSfvdl %typedef rpcb RPCB; 135431e8abfSfvdl % 136431e8abfSfvdl #endif 137431e8abfSfvdl % 138431e8abfSfvdl %/* 139431e8abfSfvdl % * A list of mappings 140431e8abfSfvdl % * 141431e8abfSfvdl % * Below are two definitions for the rpcblist structure. This is done because 142431e8abfSfvdl % * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a 143431e8abfSfvdl % * struct rpcblist * that rpcgen would produce. One version of the rpcblist 144431e8abfSfvdl % * structure (actually called rp__list) is used with rpcgen, and the other is 145431e8abfSfvdl % * defined only in the header file for compatibility with the specified 146431e8abfSfvdl % * interface. 147431e8abfSfvdl % */ 148431e8abfSfvdl 149431e8abfSfvdl struct rp__list { 150431e8abfSfvdl rpcb rpcb_map; 151431e8abfSfvdl struct rp__list *rpcb_next; 152431e8abfSfvdl }; 153431e8abfSfvdl 154431e8abfSfvdl typedef rp__list *rpcblist_ptr; /* results of RPCBPROC_DUMP */ 155431e8abfSfvdl 156431e8abfSfvdl #ifdef RPC_HDR 157431e8abfSfvdl % 158431e8abfSfvdl %typedef struct rp__list rpcblist; 159431e8abfSfvdl %typedef struct rp__list RPCBLIST; 160431e8abfSfvdl % 161431e8abfSfvdl %#ifndef __cplusplus 162431e8abfSfvdl %struct rpcblist { 163431e8abfSfvdl % RPCB rpcb_map; 164431e8abfSfvdl % struct rpcblist *rpcb_next; 165431e8abfSfvdl %}; 166431e8abfSfvdl %#endif 167431e8abfSfvdl % 168431e8abfSfvdl %#ifdef __cplusplus 169431e8abfSfvdl %extern "C" { 170431e8abfSfvdl %#endif 171140ad8e5Smrg %#if __STDC__ 172431e8abfSfvdl %extern bool_t xdr_rpcblist(XDR *, rpcblist**); 173431e8abfSfvdl %#else /* K&R C */ 174431e8abfSfvdl %bool_t xdr_rpcblist(); 175431e8abfSfvdl %#endif 176431e8abfSfvdl %#ifdef __cplusplus 177431e8abfSfvdl %} 178431e8abfSfvdl %#endif 179431e8abfSfvdl % 180431e8abfSfvdl #endif 181431e8abfSfvdl 182431e8abfSfvdl % 183431e8abfSfvdl %/* 184431e8abfSfvdl % * Arguments of remote calls 185431e8abfSfvdl % */ 186431e8abfSfvdl struct rpcb_rmtcallargs { 187431e8abfSfvdl rpcprog_t prog; /* program number */ 188431e8abfSfvdl rpcvers_t vers; /* version number */ 189431e8abfSfvdl rpcproc_t proc; /* procedure number */ 190431e8abfSfvdl opaque args<>; /* argument */ 191431e8abfSfvdl }; 192431e8abfSfvdl #ifdef RPC_HDR 193431e8abfSfvdl % 194431e8abfSfvdl %/* 195431e8abfSfvdl % * Client-side only representation of rpcb_rmtcallargs structure. 196431e8abfSfvdl % * 197431e8abfSfvdl % * The routine that XDRs the rpcb_rmtcallargs structure must deal with the 198431e8abfSfvdl % * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to 199431e8abfSfvdl % * be passed the XDR routine that knows the args' structure. This routine 200431e8abfSfvdl % * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since 201431e8abfSfvdl % * the application being called already knows the args structure. So we use a 202431e8abfSfvdl % * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which 203431e8abfSfvdl % * includes the args' XDR routine. 204431e8abfSfvdl % */ 205431e8abfSfvdl %struct r_rpcb_rmtcallargs { 206431e8abfSfvdl % rpcprog_t prog; 207431e8abfSfvdl % rpcvers_t vers; 208431e8abfSfvdl % rpcproc_t proc; 209431e8abfSfvdl % struct { 210*89050ca1Sdholland % unsigned int args_len; 211347f995cSyamt % const char *args_val; 212431e8abfSfvdl % } args; 213431e8abfSfvdl % xdrproc_t xdr_args; /* encodes args */ 214431e8abfSfvdl %}; 215431e8abfSfvdl % 216431e8abfSfvdl #endif /* def RPC_HDR */ 217431e8abfSfvdl % 218431e8abfSfvdl %/* 219431e8abfSfvdl % * Results of the remote call 220431e8abfSfvdl % */ 221431e8abfSfvdl struct rpcb_rmtcallres { 222431e8abfSfvdl string addr<>; /* remote universal address */ 223431e8abfSfvdl opaque results<>; /* result */ 224431e8abfSfvdl }; 225431e8abfSfvdl #ifdef RPC_HDR 226431e8abfSfvdl % 227431e8abfSfvdl %/* 228431e8abfSfvdl % * Client-side only representation of rpcb_rmtcallres structure. 229431e8abfSfvdl % */ 230431e8abfSfvdl %struct r_rpcb_rmtcallres { 231431e8abfSfvdl % char *addr; 232431e8abfSfvdl % struct { 23329f79e71Sdholland % uint32_t results_len; 234431e8abfSfvdl % char *results_val; 235431e8abfSfvdl % } results; 236431e8abfSfvdl % xdrproc_t xdr_res; /* decodes results */ 237431e8abfSfvdl %}; 2388afa23b8Ssimonb #endif /* RPC_HDR */ 239431e8abfSfvdl % 240431e8abfSfvdl %/* 241431e8abfSfvdl % * rpcb_entry contains a merged address of a service on a particular 242431e8abfSfvdl % * transport, plus associated netconfig information. A list of rpcb_entrys 243431e8abfSfvdl % * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used 244431e8abfSfvdl % * in r_nc_* fields. 245431e8abfSfvdl % */ 246431e8abfSfvdl struct rpcb_entry { 247431e8abfSfvdl string r_maddr<>; /* merged address of service */ 248431e8abfSfvdl string r_nc_netid<>; /* netid field */ 249431e8abfSfvdl unsigned int r_nc_semantics; /* semantics of transport */ 250431e8abfSfvdl string r_nc_protofmly<>; /* protocol family */ 251431e8abfSfvdl string r_nc_proto<>; /* protocol name */ 252431e8abfSfvdl }; 253431e8abfSfvdl % 254431e8abfSfvdl %/* 255431e8abfSfvdl % * A list of addresses supported by a service. 256431e8abfSfvdl % */ 257431e8abfSfvdl struct rpcb_entry_list { 258431e8abfSfvdl rpcb_entry rpcb_entry_map; 259431e8abfSfvdl struct rpcb_entry_list *rpcb_entry_next; 260431e8abfSfvdl }; 261431e8abfSfvdl 262431e8abfSfvdl typedef rpcb_entry_list *rpcb_entry_list_ptr; 263431e8abfSfvdl 264431e8abfSfvdl % 265431e8abfSfvdl %/* 266431e8abfSfvdl % * rpcbind statistics 267431e8abfSfvdl % */ 268431e8abfSfvdl % 269431e8abfSfvdl const rpcb_highproc_2 = RPCBPROC_CALLIT; 270431e8abfSfvdl const rpcb_highproc_3 = RPCBPROC_TADDR2UADDR; 271431e8abfSfvdl const rpcb_highproc_4 = RPCBPROC_GETSTAT; 272431e8abfSfvdl 273431e8abfSfvdl const RPCBSTAT_HIGHPROC = 13; /* # of procs in rpcbind V4 plus one */ 274431e8abfSfvdl const RPCBVERS_STAT = 3; /* provide only for rpcbind V2, V3 and V4 */ 275431e8abfSfvdl const RPCBVERS_4_STAT = 2; 276431e8abfSfvdl const RPCBVERS_3_STAT = 1; 277431e8abfSfvdl const RPCBVERS_2_STAT = 0; 278431e8abfSfvdl % 279431e8abfSfvdl %/* Link list of all the stats about getport and getaddr */ 280431e8abfSfvdl struct rpcbs_addrlist { 281431e8abfSfvdl rpcprog_t prog; 282431e8abfSfvdl rpcvers_t vers; 283431e8abfSfvdl int success; 284431e8abfSfvdl int failure; 285431e8abfSfvdl string netid<>; 286431e8abfSfvdl struct rpcbs_addrlist *next; 287431e8abfSfvdl }; 288431e8abfSfvdl % 289431e8abfSfvdl %/* Link list of all the stats about rmtcall */ 290431e8abfSfvdl struct rpcbs_rmtcalllist { 291431e8abfSfvdl rpcprog_t prog; 292431e8abfSfvdl rpcvers_t vers; 293431e8abfSfvdl rpcproc_t proc; 294431e8abfSfvdl int success; 295431e8abfSfvdl int failure; 296431e8abfSfvdl int indirect; /* whether callit or indirect */ 297431e8abfSfvdl string netid<>; 298431e8abfSfvdl struct rpcbs_rmtcalllist *next; 299431e8abfSfvdl }; 300431e8abfSfvdl 301431e8abfSfvdl typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 302431e8abfSfvdl typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 303431e8abfSfvdl typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 304431e8abfSfvdl 305431e8abfSfvdl struct rpcb_stat { 306431e8abfSfvdl rpcbs_proc info; 307431e8abfSfvdl int setinfo; 308431e8abfSfvdl int unsetinfo; 309431e8abfSfvdl rpcbs_addrlist_ptr addrinfo; 310431e8abfSfvdl rpcbs_rmtcalllist_ptr rmtinfo; 311431e8abfSfvdl }; 312431e8abfSfvdl % 313431e8abfSfvdl %/* 314431e8abfSfvdl % * One rpcb_stat structure is returned for each version of rpcbind 315431e8abfSfvdl % * being monitored. 316431e8abfSfvdl % */ 317431e8abfSfvdl 318431e8abfSfvdl typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 319431e8abfSfvdl 320431e8abfSfvdl #ifdef RPC_HDR 321431e8abfSfvdl % 322431e8abfSfvdl %/* 323431e8abfSfvdl % * We don't define netbuf in RPCL, since it would contain structure member 324431e8abfSfvdl % * names that would conflict with the definition of struct netbuf in 325431e8abfSfvdl % * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here, 326431e8abfSfvdl % * and implement it ourselves in rpc/rpcb_prot.c. 327431e8abfSfvdl % */ 328431e8abfSfvdl %#ifdef __cplusplus 329431e8abfSfvdl %extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *); 330431e8abfSfvdl % 331431e8abfSfvdl %#elif __STDC__ 332431e8abfSfvdl %extern bool_t xdr_netbuf(XDR *, struct netbuf *); 333431e8abfSfvdl % 334431e8abfSfvdl %#else /* K&R C */ 335431e8abfSfvdl %bool_t xdr_netbuf(); 336431e8abfSfvdl % 337431e8abfSfvdl %#endif /* K&R C*/ 338431e8abfSfvdl #endif /* def RPC_HDR */ 339431e8abfSfvdl 340431e8abfSfvdl /* 341431e8abfSfvdl * rpcbind procedures 342431e8abfSfvdl */ 343431e8abfSfvdl program RPCBPROG { 344431e8abfSfvdl version RPCBVERS { 345431e8abfSfvdl bool 346431e8abfSfvdl RPCBPROC_SET(rpcb) = 1; 347431e8abfSfvdl 348431e8abfSfvdl bool 349431e8abfSfvdl RPCBPROC_UNSET(rpcb) = 2; 350431e8abfSfvdl 351431e8abfSfvdl string 352431e8abfSfvdl RPCBPROC_GETADDR(rpcb) = 3; 353431e8abfSfvdl 354431e8abfSfvdl rpcblist_ptr 355431e8abfSfvdl RPCBPROC_DUMP(void) = 4; 356431e8abfSfvdl 357431e8abfSfvdl rpcb_rmtcallres 358431e8abfSfvdl RPCBPROC_CALLIT(rpcb_rmtcallargs) = 5; 359431e8abfSfvdl 360431e8abfSfvdl unsigned int 361431e8abfSfvdl RPCBPROC_GETTIME(void) = 6; 362431e8abfSfvdl 363431e8abfSfvdl struct netbuf 364431e8abfSfvdl RPCBPROC_UADDR2TADDR(string) = 7; 365431e8abfSfvdl 366431e8abfSfvdl string 367431e8abfSfvdl RPCBPROC_TADDR2UADDR(struct netbuf) = 8; 368431e8abfSfvdl } = 3; 369431e8abfSfvdl 370431e8abfSfvdl version RPCBVERS4 { 371431e8abfSfvdl bool 372431e8abfSfvdl RPCBPROC_SET(rpcb) = 1; 373431e8abfSfvdl 374431e8abfSfvdl bool 375431e8abfSfvdl RPCBPROC_UNSET(rpcb) = 2; 376431e8abfSfvdl 377431e8abfSfvdl string 378431e8abfSfvdl RPCBPROC_GETADDR(rpcb) = 3; 379431e8abfSfvdl 380431e8abfSfvdl rpcblist_ptr 381431e8abfSfvdl RPCBPROC_DUMP(void) = 4; 382431e8abfSfvdl 383431e8abfSfvdl /* 384431e8abfSfvdl * NOTE: RPCBPROC_BCAST has the same functionality as CALLIT; 385431e8abfSfvdl * the new name is intended to indicate that this 386431e8abfSfvdl * procedure should be used for broadcast RPC, and 387431e8abfSfvdl * RPCBPROC_INDIRECT should be used for indirect calls. 388431e8abfSfvdl */ 389431e8abfSfvdl rpcb_rmtcallres 390431e8abfSfvdl RPCBPROC_BCAST(rpcb_rmtcallargs) = RPCBPROC_CALLIT; 391431e8abfSfvdl 392431e8abfSfvdl unsigned int 393431e8abfSfvdl RPCBPROC_GETTIME(void) = 6; 394431e8abfSfvdl 395431e8abfSfvdl struct netbuf 396431e8abfSfvdl RPCBPROC_UADDR2TADDR(string) = 7; 397431e8abfSfvdl 398431e8abfSfvdl string 399431e8abfSfvdl RPCBPROC_TADDR2UADDR(struct netbuf) = 8; 400431e8abfSfvdl 401431e8abfSfvdl string 402431e8abfSfvdl RPCBPROC_GETVERSADDR(rpcb) = 9; 403431e8abfSfvdl 404431e8abfSfvdl rpcb_rmtcallres 405431e8abfSfvdl RPCBPROC_INDIRECT(rpcb_rmtcallargs) = 10; 406431e8abfSfvdl 407431e8abfSfvdl rpcb_entry_list_ptr 408431e8abfSfvdl RPCBPROC_GETADDRLIST(rpcb) = 11; 409431e8abfSfvdl 410431e8abfSfvdl rpcb_stat_byvers 411431e8abfSfvdl RPCBPROC_GETSTAT(void) = 12; 412431e8abfSfvdl } = 4; 413431e8abfSfvdl } = 100000; 414431e8abfSfvdl #ifdef RPC_HDR 415431e8abfSfvdl % 416431e8abfSfvdl %#define RPCBVERS_3 RPCBVERS 417431e8abfSfvdl %#define RPCBVERS_4 RPCBVERS4 418431e8abfSfvdl % 419431e8abfSfvdl %#define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock" 420431e8abfSfvdl % 4218afa23b8Ssimonb %#else /* ifndef _KERNEL */ 422431e8abfSfvdl %#ifdef __cplusplus 423431e8abfSfvdl %extern "C" { 424431e8abfSfvdl %#endif 425431e8abfSfvdl % 426431e8abfSfvdl %/* 427431e8abfSfvdl % * A mapping of (program, version, network ID) to address 428431e8abfSfvdl % */ 429431e8abfSfvdl %struct rpcb { 430431e8abfSfvdl % rpcprog_t r_prog; /* program number */ 431431e8abfSfvdl % rpcvers_t r_vers; /* version number */ 432431e8abfSfvdl % char *r_netid; /* network id */ 433431e8abfSfvdl % char *r_addr; /* universal address */ 434431e8abfSfvdl % char *r_owner; /* owner of the mapping */ 435431e8abfSfvdl %}; 436431e8abfSfvdl %typedef struct rpcb RPCB; 437431e8abfSfvdl % 438431e8abfSfvdl %/* 439431e8abfSfvdl % * A list of mappings 440431e8abfSfvdl % */ 441431e8abfSfvdl %struct rpcblist { 442431e8abfSfvdl % RPCB rpcb_map; 443431e8abfSfvdl % struct rpcblist *rpcb_next; 444431e8abfSfvdl %}; 445431e8abfSfvdl %typedef struct rpcblist RPCBLIST; 446431e8abfSfvdl %typedef struct rpcblist *rpcblist_ptr; 447431e8abfSfvdl % 448431e8abfSfvdl %/* 449431e8abfSfvdl % * Remote calls arguments 450431e8abfSfvdl % */ 451431e8abfSfvdl %struct rpcb_rmtcallargs { 452431e8abfSfvdl % rpcprog_t prog; /* program number */ 453431e8abfSfvdl % rpcvers_t vers; /* version number */ 454431e8abfSfvdl % rpcproc_t proc; /* procedure number */ 45529f79e71Sdholland % uint32_t arglen; /* arg len */ 456431e8abfSfvdl % caddr_t args_ptr; /* argument */ 457431e8abfSfvdl % xdrproc_t xdr_args; /* XDR routine for argument */ 458431e8abfSfvdl %}; 459431e8abfSfvdl %typedef struct rpcb_rmtcallargs rpcb_rmtcallargs; 460431e8abfSfvdl % 461431e8abfSfvdl %/* 462431e8abfSfvdl % * Remote calls results 463431e8abfSfvdl % */ 464431e8abfSfvdl %struct rpcb_rmtcallres { 465431e8abfSfvdl % char *addr_ptr; /* remote universal address */ 46629f79e71Sdholland % uint32_t resultslen; /* results length */ 467431e8abfSfvdl % caddr_t results_ptr; /* results */ 468431e8abfSfvdl % xdrproc_t xdr_results; /* XDR routine for result */ 469431e8abfSfvdl %}; 470431e8abfSfvdl %typedef struct rpcb_rmtcallres rpcb_rmtcallres; 471431e8abfSfvdl % 472431e8abfSfvdl %struct rpcb_entry { 473431e8abfSfvdl % char *r_maddr; 474431e8abfSfvdl % char *r_nc_netid; 475431e8abfSfvdl % unsigned int r_nc_semantics; 476431e8abfSfvdl % char *r_nc_protofmly; 477431e8abfSfvdl % char *r_nc_proto; 478431e8abfSfvdl %}; 479431e8abfSfvdl %typedef struct rpcb_entry rpcb_entry; 480431e8abfSfvdl % 481431e8abfSfvdl %/* 482431e8abfSfvdl % * A list of addresses supported by a service. 483431e8abfSfvdl % */ 484431e8abfSfvdl % 485431e8abfSfvdl %struct rpcb_entry_list { 486431e8abfSfvdl % rpcb_entry rpcb_entry_map; 487431e8abfSfvdl % struct rpcb_entry_list *rpcb_entry_next; 488431e8abfSfvdl %}; 489431e8abfSfvdl %typedef struct rpcb_entry_list rpcb_entry_list; 490431e8abfSfvdl % 491431e8abfSfvdl %typedef rpcb_entry_list *rpcb_entry_list_ptr; 492431e8abfSfvdl % 493431e8abfSfvdl %/* 494431e8abfSfvdl % * rpcbind statistics 495431e8abfSfvdl % */ 496431e8abfSfvdl % 497431e8abfSfvdl %#define rpcb_highproc_2 RPCBPROC_CALLIT 498431e8abfSfvdl %#define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 499431e8abfSfvdl %#define rpcb_highproc_4 RPCBPROC_GETSTAT 500431e8abfSfvdl %#define RPCBSTAT_HIGHPROC 13 501431e8abfSfvdl %#define RPCBVERS_STAT 3 502431e8abfSfvdl %#define RPCBVERS_4_STAT 2 503431e8abfSfvdl %#define RPCBVERS_3_STAT 1 504431e8abfSfvdl %#define RPCBVERS_2_STAT 0 505431e8abfSfvdl % 506431e8abfSfvdl %/* Link list of all the stats about getport and getaddr */ 507431e8abfSfvdl % 508431e8abfSfvdl %struct rpcbs_addrlist { 509431e8abfSfvdl % rpcprog_t prog; 510431e8abfSfvdl % rpcvers_t vers; 511431e8abfSfvdl % int success; 512431e8abfSfvdl % int failure; 513431e8abfSfvdl % char *netid; 514431e8abfSfvdl % struct rpcbs_addrlist *next; 515431e8abfSfvdl %}; 516431e8abfSfvdl %typedef struct rpcbs_addrlist rpcbs_addrlist; 517431e8abfSfvdl % 518431e8abfSfvdl %/* Link list of all the stats about rmtcall */ 519431e8abfSfvdl % 520431e8abfSfvdl %struct rpcbs_rmtcalllist { 521431e8abfSfvdl % rpcprog_t prog; 522431e8abfSfvdl % rpcvers_t vers; 523431e8abfSfvdl % rpcproc_t proc; 524431e8abfSfvdl % int success; 525431e8abfSfvdl % int failure; 526431e8abfSfvdl % int indirect; 527431e8abfSfvdl % char *netid; 528431e8abfSfvdl % struct rpcbs_rmtcalllist *next; 529431e8abfSfvdl %}; 530431e8abfSfvdl %typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist; 531431e8abfSfvdl % 532431e8abfSfvdl %typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 533431e8abfSfvdl % 534431e8abfSfvdl %typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 535431e8abfSfvdl % 536431e8abfSfvdl %typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 537431e8abfSfvdl % 538431e8abfSfvdl %struct rpcb_stat { 539431e8abfSfvdl % rpcbs_proc info; 540431e8abfSfvdl % int setinfo; 541431e8abfSfvdl % int unsetinfo; 542431e8abfSfvdl % rpcbs_addrlist_ptr addrinfo; 543431e8abfSfvdl % rpcbs_rmtcalllist_ptr rmtinfo; 544431e8abfSfvdl %}; 545431e8abfSfvdl %typedef struct rpcb_stat rpcb_stat; 546431e8abfSfvdl % 547431e8abfSfvdl %/* 548431e8abfSfvdl % * One rpcb_stat structure is returned for each version of rpcbind 549431e8abfSfvdl % * being monitored. 550431e8abfSfvdl % */ 551431e8abfSfvdl % 552431e8abfSfvdl %typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 553431e8abfSfvdl % 554431e8abfSfvdl %#ifdef __cplusplus 555431e8abfSfvdl %} 556431e8abfSfvdl %#endif 557431e8abfSfvdl % 5588afa23b8Ssimonb %#endif /* ifndef _KERNEL */ 559431e8abfSfvdl #endif /* RPC_HDR */ 560