1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #ifndef _RPCB_PROT_H_RPCGEN 7 #define _RPCB_PROT_H_RPCGEN 8 9 #include <rpc/rpc.h> 10 11 #ifdef __cplusplus 12 extern "C" { 13 #endif 14 15 /* 16 * $FreeBSD$ 17 * 18 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 19 * unrestricted use provided that this legend is included on all tape 20 * media and as a part of the software program in whole or part. Users 21 * may copy or modify Sun RPC without charge, but are not authorized 22 * to license or distribute it to anyone else except as part of a product or 23 * program developed by the user. 24 * 25 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 26 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 27 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 28 * 29 * Sun RPC is provided with no support and without any obligation on the 30 * part of Sun Microsystems, Inc. to assist in its use, correction, 31 * modification or enhancement. 32 * 33 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 34 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 35 * OR ANY PART THEREOF. 36 * 37 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 38 * or profits or other special, indirect and consequential damages, even if 39 * Sun has been advised of the possibility of such damages. 40 * 41 * Sun Microsystems, Inc. 42 * 2550 Garcia Avenue 43 * Mountain View, California 94043 44 */ 45 /* 46 * Copyright (c) 1988 by Sun Microsystems, Inc. 47 */ 48 /* from rpcb_prot.x */ 49 50 /* #pragma ident "@(#)rpcb_prot.x 1.5 94/04/29 SMI" */ 51 52 #ifndef _KERNEL 53 54 55 /* 56 * The following procedures are supported by the protocol in version 3: 57 * 58 * RPCBPROC_NULL() returns () 59 * takes nothing, returns nothing 60 * 61 * RPCBPROC_SET(rpcb) returns (bool_t) 62 * TRUE is success, FALSE is failure. Registers the tuple 63 * [prog, vers, address, owner, netid]. 64 * Finds out owner and netid information on its own. 65 * 66 * RPCBPROC_UNSET(rpcb) returns (bool_t) 67 * TRUE is success, FALSE is failure. Un-registers tuple 68 * [prog, vers, netid]. addresses is ignored. 69 * If netid is NULL, unregister all. 70 * 71 * RPCBPROC_GETADDR(rpcb) returns (string). 72 * 0 is failure. Otherwise returns the universal address where the 73 * triple [prog, vers, netid] is registered. Ignore address and owner. 74 * 75 * RPCBPROC_DUMP() RETURNS (rpcblist_ptr) 76 * used to dump the entire rpcbind maps 77 * 78 * RPCBPROC_CALLIT(rpcb_rmtcallargs) 79 * RETURNS (rpcb_rmtcallres); 80 * Calls the procedure on the remote machine. If it is not registered, 81 * this procedure is quiet; i.e. it does not return error information!!! 82 * This routine only passes null authentication parameters. 83 * It has no interface to xdr routines for RPCBPROC_CALLIT. 84 * 85 * RPCBPROC_GETTIME() returns (int). 86 * Gets the remote machines time 87 * 88 * RPCBPROC_UADDR2TADDR(strint) RETURNS (struct netbuf) 89 * Returns the netbuf address from universal address. 90 * 91 * RPCBPROC_TADDR2UADDR(struct netbuf) RETURNS (string) 92 * Returns the universal address from netbuf address. 93 * 94 * END OF RPCBIND VERSION 3 PROCEDURES 95 */ 96 /* 97 * Except for RPCBPROC_CALLIT, the procedures above are carried over to 98 * rpcbind version 4. Those below are added or modified for version 4. 99 * NOTE: RPCBPROC_BCAST HAS THE SAME FUNCTIONALITY AND PROCEDURE NUMBER 100 * AS RPCBPROC_CALLIT. 101 * 102 * RPCBPROC_BCAST(rpcb_rmtcallargs) 103 * RETURNS (rpcb_rmtcallres); 104 * Calls the procedure on the remote machine. If it is not registered, 105 * this procedure IS quiet; i.e. it DOES NOT return error information!!! 106 * This routine should be used for broadcasting and nothing else. 107 * 108 * RPCBPROC_GETVERSADDR(rpcb) returns (string). 109 * 0 is failure. Otherwise returns the universal address where the 110 * triple [prog, vers, netid] is registered. Ignore address and owner. 111 * Same as RPCBPROC_GETADDR except that if the given version number 112 * is not available, the address is not returned. 113 * 114 * RPCBPROC_INDIRECT(rpcb_rmtcallargs) 115 * RETURNS (rpcb_rmtcallres); 116 * Calls the procedure on the remote machine. If it is not registered, 117 * this procedure is NOT quiet; i.e. it DOES return error information!!! 118 * as any normal application would expect. 119 * 120 * RPCBPROC_GETADDRLIST(rpcb) returns (rpcb_entry_list_ptr). 121 * Same as RPCBPROC_GETADDR except that it returns a list of all the 122 * addresses registered for the combination (prog, vers) (for all 123 * transports). 124 * 125 * RPCBPROC_GETSTAT(void) returns (rpcb_stat_byvers) 126 * Returns the statistics about the kind of requests received by rpcbind. 127 */ 128 129 /* 130 * A mapping of (program, version, network ID) to address 131 */ 132 133 struct rpcb { 134 rpcprog_t r_prog; 135 rpcvers_t r_vers; 136 char *r_netid; 137 char *r_addr; 138 char *r_owner; 139 }; 140 typedef struct rpcb rpcb; 141 142 typedef rpcb RPCB; 143 144 145 /* 146 * A list of mappings 147 * 148 * Below are two definitions for the rpcblist structure. This is done because 149 * xdr_rpcblist() is specified to take a struct rpcblist **, rather than a 150 * struct rpcblist * that rpcgen would produce. One version of the rpcblist 151 * structure (actually called rp__list) is used with rpcgen, and the other is 152 * defined only in the header file for compatibility with the specified 153 * interface. 154 */ 155 156 struct rp__list { 157 rpcb rpcb_map; 158 struct rp__list *rpcb_next; 159 }; 160 typedef struct rp__list rp__list; 161 162 typedef rp__list *rpcblist_ptr; 163 164 typedef struct rp__list rpcblist; 165 typedef struct rp__list RPCBLIST; 166 167 #ifndef __cplusplus 168 struct rpcblist { 169 RPCB rpcb_map; 170 struct rpcblist *rpcb_next; 171 }; 172 #endif 173 174 #ifdef __cplusplus 175 extern "C" { 176 #endif 177 extern bool_t xdr_rpcblist(XDR *, rpcblist**); 178 #ifdef __cplusplus 179 } 180 #endif 181 182 183 /* 184 * Arguments of remote calls 185 */ 186 187 struct rpcb_rmtcallargs { 188 rpcprog_t prog; 189 rpcvers_t vers; 190 rpcproc_t proc; 191 struct { 192 u_int args_len; 193 char *args_val; 194 } args; 195 }; 196 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs; 197 198 /* 199 * Client-side only representation of rpcb_rmtcallargs structure. 200 * 201 * The routine that XDRs the rpcb_rmtcallargs structure must deal with the 202 * opaque arguments in the "args" structure. xdr_rpcb_rmtcallargs() needs to 203 * be passed the XDR routine that knows the args' structure. This routine 204 * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since 205 * the application being called already knows the args structure. So we use a 206 * different "XDR" structure on the client side, r_rpcb_rmtcallargs, which 207 * includes the args' XDR routine. 208 */ 209 struct r_rpcb_rmtcallargs { 210 rpcprog_t prog; 211 rpcvers_t vers; 212 rpcproc_t proc; 213 struct { 214 u_int args_len; 215 char *args_val; 216 } args; 217 xdrproc_t xdr_args; /* encodes args */ 218 }; 219 220 221 /* 222 * Results of the remote call 223 */ 224 225 struct rpcb_rmtcallres { 226 char *addr; 227 struct { 228 u_int results_len; 229 char *results_val; 230 } results; 231 }; 232 typedef struct rpcb_rmtcallres rpcb_rmtcallres; 233 234 /* 235 * Client-side only representation of rpcb_rmtcallres structure. 236 */ 237 struct r_rpcb_rmtcallres { 238 char *addr; 239 struct { 240 uint32_t results_len; 241 char *results_val; 242 } results; 243 xdrproc_t xdr_res; /* decodes results */ 244 }; 245 246 /* 247 * rpcb_entry contains a merged address of a service on a particular 248 * transport, plus associated netconfig information. A list of rpcb_entrys 249 * is returned by RPCBPROC_GETADDRLIST. See netconfig.h for values used 250 * in r_nc_* fields. 251 */ 252 253 struct rpcb_entry { 254 char *r_maddr; 255 char *r_nc_netid; 256 u_int r_nc_semantics; 257 char *r_nc_protofmly; 258 char *r_nc_proto; 259 }; 260 typedef struct rpcb_entry rpcb_entry; 261 262 /* 263 * A list of addresses supported by a service. 264 */ 265 266 struct rpcb_entry_list { 267 rpcb_entry rpcb_entry_map; 268 struct rpcb_entry_list *rpcb_entry_next; 269 }; 270 typedef struct rpcb_entry_list rpcb_entry_list; 271 272 typedef rpcb_entry_list *rpcb_entry_list_ptr; 273 274 /* 275 * rpcbind statistics 276 */ 277 278 #define rpcb_highproc_2 RPCBPROC_CALLIT 279 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 280 #define rpcb_highproc_4 RPCBPROC_GETSTAT 281 #define RPCBSTAT_HIGHPROC 13 282 #define RPCBVERS_STAT 3 283 #define RPCBVERS_4_STAT 2 284 #define RPCBVERS_3_STAT 1 285 #define RPCBVERS_2_STAT 0 286 287 /* Link list of all the stats about getport and getaddr */ 288 289 struct rpcbs_addrlist { 290 rpcprog_t prog; 291 rpcvers_t vers; 292 int success; 293 int failure; 294 char *netid; 295 struct rpcbs_addrlist *next; 296 }; 297 typedef struct rpcbs_addrlist rpcbs_addrlist; 298 299 /* Link list of all the stats about rmtcall */ 300 301 struct rpcbs_rmtcalllist { 302 rpcprog_t prog; 303 rpcvers_t vers; 304 rpcproc_t proc; 305 int success; 306 int failure; 307 int indirect; 308 char *netid; 309 struct rpcbs_rmtcalllist *next; 310 }; 311 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist; 312 313 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 314 315 typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 316 317 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 318 319 struct rpcb_stat { 320 rpcbs_proc info; 321 int setinfo; 322 int unsetinfo; 323 rpcbs_addrlist_ptr addrinfo; 324 rpcbs_rmtcalllist_ptr rmtinfo; 325 }; 326 typedef struct rpcb_stat rpcb_stat; 327 328 /* 329 * One rpcb_stat structure is returned for each version of rpcbind 330 * being monitored. 331 */ 332 333 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 334 335 /* 336 * We don't define netbuf in RPCL, since it would contain structure member 337 * names that would conflict with the definition of struct netbuf in 338 * <tiuser.h>. Instead we merely declare the XDR routine xdr_netbuf() here, 339 * and implement it ourselves in rpc/rpcb_prot.c. 340 */ 341 #ifdef __cplusplus 342 extern "C" bool_t xdr_netbuf(XDR *, struct netbuf *); 343 344 #else /* __STDC__ */ 345 extern bool_t xdr_netbuf(XDR *, struct netbuf *); 346 347 #endif 348 349 #define RPCBVERS_3 RPCBVERS 350 #define RPCBVERS_4 RPCBVERS4 351 352 #else /* ndef _KERNEL */ 353 #ifdef __cplusplus 354 extern "C" { 355 #endif 356 357 /* 358 * A mapping of (program, version, network ID) to address 359 */ 360 struct rpcb { 361 rpcprog_t r_prog; /* program number */ 362 rpcvers_t r_vers; /* version number */ 363 char *r_netid; /* network id */ 364 char *r_addr; /* universal address */ 365 char *r_owner; /* owner of the mapping */ 366 }; 367 typedef struct rpcb RPCB; 368 369 /* 370 * A list of mappings 371 */ 372 struct rpcblist { 373 RPCB rpcb_map; 374 struct rpcblist *rpcb_next; 375 }; 376 typedef struct rpcblist RPCBLIST; 377 typedef struct rpcblist *rpcblist_ptr; 378 379 /* 380 * Remote calls arguments 381 */ 382 struct rpcb_rmtcallargs { 383 rpcprog_t prog; /* program number */ 384 rpcvers_t vers; /* version number */ 385 rpcproc_t proc; /* procedure number */ 386 uint32_t arglen; /* arg len */ 387 caddr_t args_ptr; /* argument */ 388 xdrproc_t xdr_args; /* XDR routine for argument */ 389 }; 390 typedef struct rpcb_rmtcallargs rpcb_rmtcallargs; 391 392 /* 393 * Remote calls results 394 */ 395 struct rpcb_rmtcallres { 396 char *addr_ptr; /* remote universal address */ 397 uint32_t resultslen; /* results length */ 398 caddr_t results_ptr; /* results */ 399 xdrproc_t xdr_results; /* XDR routine for result */ 400 }; 401 typedef struct rpcb_rmtcallres rpcb_rmtcallres; 402 403 struct rpcb_entry { 404 char *r_maddr; 405 char *r_nc_netid; 406 unsigned int r_nc_semantics; 407 char *r_nc_protofmly; 408 char *r_nc_proto; 409 }; 410 typedef struct rpcb_entry rpcb_entry; 411 412 /* 413 * A list of addresses supported by a service. 414 */ 415 416 struct rpcb_entry_list { 417 rpcb_entry rpcb_entry_map; 418 struct rpcb_entry_list *rpcb_entry_next; 419 }; 420 typedef struct rpcb_entry_list rpcb_entry_list; 421 422 typedef rpcb_entry_list *rpcb_entry_list_ptr; 423 424 /* 425 * rpcbind statistics 426 */ 427 428 #define rpcb_highproc_2 RPCBPROC_CALLIT 429 #define rpcb_highproc_3 RPCBPROC_TADDR2UADDR 430 #define rpcb_highproc_4 RPCBPROC_GETSTAT 431 #define RPCBSTAT_HIGHPROC 13 432 #define RPCBVERS_STAT 3 433 #define RPCBVERS_4_STAT 2 434 #define RPCBVERS_3_STAT 1 435 #define RPCBVERS_2_STAT 0 436 437 /* Link list of all the stats about getport and getaddr */ 438 439 struct rpcbs_addrlist { 440 rpcprog_t prog; 441 rpcvers_t vers; 442 int success; 443 int failure; 444 char *netid; 445 struct rpcbs_addrlist *next; 446 }; 447 typedef struct rpcbs_addrlist rpcbs_addrlist; 448 449 /* Link list of all the stats about rmtcall */ 450 451 struct rpcbs_rmtcalllist { 452 rpcprog_t prog; 453 rpcvers_t vers; 454 rpcproc_t proc; 455 int success; 456 int failure; 457 int indirect; 458 char *netid; 459 struct rpcbs_rmtcalllist *next; 460 }; 461 typedef struct rpcbs_rmtcalllist rpcbs_rmtcalllist; 462 463 typedef int rpcbs_proc[RPCBSTAT_HIGHPROC]; 464 465 typedef rpcbs_addrlist *rpcbs_addrlist_ptr; 466 467 typedef rpcbs_rmtcalllist *rpcbs_rmtcalllist_ptr; 468 469 struct rpcb_stat { 470 rpcbs_proc info; 471 int setinfo; 472 int unsetinfo; 473 rpcbs_addrlist_ptr addrinfo; 474 rpcbs_rmtcalllist_ptr rmtinfo; 475 }; 476 typedef struct rpcb_stat rpcb_stat; 477 478 /* 479 * One rpcb_stat structure is returned for each version of rpcbind 480 * being monitored. 481 */ 482 483 typedef rpcb_stat rpcb_stat_byvers[RPCBVERS_STAT]; 484 485 #ifdef __cplusplus 486 } 487 #endif 488 489 #endif /* ndef _KERNEL */ 490 491 #define _PATH_RPCBINDSOCK "/var/run/rpcbind.sock" 492 493 #define RPCBPROG ((unsigned long)(100000)) 494 #define RPCBVERS ((unsigned long)(3)) 495 496 extern void rpcbprog_3(struct svc_req *rqstp, SVCXPRT *transp); 497 #define RPCBPROC_SET ((unsigned long)(1)) 498 extern bool_t * rpcbproc_set_3(RPCB *, CLIENT *); 499 extern bool_t * rpcbproc_set_3_svc(RPCB *, struct svc_req *); 500 #define RPCBPROC_UNSET ((unsigned long)(2)) 501 extern bool_t * rpcbproc_unset_3(RPCB *, CLIENT *); 502 extern bool_t * rpcbproc_unset_3_svc(RPCB *, struct svc_req *); 503 #define RPCBPROC_GETADDR ((unsigned long)(3)) 504 extern char ** rpcbproc_getaddr_3(RPCB *, CLIENT *); 505 extern char ** rpcbproc_getaddr_3_svc(RPCB *, struct svc_req *); 506 #define RPCBPROC_DUMP ((unsigned long)(4)) 507 extern rpcblist_ptr * rpcbproc_dump_3(void *, CLIENT *); 508 extern rpcblist_ptr * rpcbproc_dump_3_svc(void *, struct svc_req *); 509 #define RPCBPROC_CALLIT ((unsigned long)(5)) 510 extern rpcb_rmtcallres * rpcbproc_callit_3(rpcb_rmtcallargs *, CLIENT *); 511 extern rpcb_rmtcallres * rpcbproc_callit_3_svc(rpcb_rmtcallargs *, struct svc_req *); 512 #define RPCBPROC_GETTIME ((unsigned long)(6)) 513 extern u_int * rpcbproc_gettime_3(void *, CLIENT *); 514 extern u_int * rpcbproc_gettime_3_svc(void *, struct svc_req *); 515 #define RPCBPROC_UADDR2TADDR ((unsigned long)(7)) 516 extern struct netbuf * rpcbproc_uaddr2taddr_3(char **, CLIENT *); 517 extern struct netbuf * rpcbproc_uaddr2taddr_3_svc(char **, struct svc_req *); 518 #define RPCBPROC_TADDR2UADDR ((unsigned long)(8)) 519 extern char ** rpcbproc_taddr2uaddr_3(struct netbuf *, CLIENT *); 520 extern char ** rpcbproc_taddr2uaddr_3_svc(struct netbuf *, struct svc_req *); 521 extern int rpcbprog_3_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 522 #define RPCBVERS4 ((unsigned long)(4)) 523 524 extern void rpcbprog_4(struct svc_req *rqstp, SVCXPRT *transp); 525 extern bool_t * rpcbproc_set_4(RPCB *, CLIENT *); 526 extern bool_t * rpcbproc_set_4_svc(RPCB *, struct svc_req *); 527 extern bool_t * rpcbproc_unset_4(RPCB *, CLIENT *); 528 extern bool_t * rpcbproc_unset_4_svc(RPCB *, struct svc_req *); 529 extern char ** rpcbproc_getaddr_4(RPCB *, CLIENT *); 530 extern char ** rpcbproc_getaddr_4_svc(RPCB *, struct svc_req *); 531 extern rpcblist_ptr * rpcbproc_dump_4(void *, CLIENT *); 532 extern rpcblist_ptr * rpcbproc_dump_4_svc(void *, struct svc_req *); 533 #define RPCBPROC_BCAST ((unsigned long)(RPCBPROC_CALLIT)) 534 extern rpcb_rmtcallres * rpcbproc_bcast_4(rpcb_rmtcallargs *, CLIENT *); 535 extern rpcb_rmtcallres * rpcbproc_bcast_4_svc(rpcb_rmtcallargs *, struct svc_req *); 536 extern u_int * rpcbproc_gettime_4(void *, CLIENT *); 537 extern u_int * rpcbproc_gettime_4_svc(void *, struct svc_req *); 538 extern struct netbuf * rpcbproc_uaddr2taddr_4(char **, CLIENT *); 539 extern struct netbuf * rpcbproc_uaddr2taddr_4_svc(char **, struct svc_req *); 540 extern char ** rpcbproc_taddr2uaddr_4(struct netbuf *, CLIENT *); 541 extern char ** rpcbproc_taddr2uaddr_4_svc(struct netbuf *, struct svc_req *); 542 #define RPCBPROC_GETVERSADDR ((unsigned long)(9)) 543 extern char ** rpcbproc_getversaddr_4(RPCB *, CLIENT *); 544 extern char ** rpcbproc_getversaddr_4_svc(RPCB *, struct svc_req *); 545 #define RPCBPROC_INDIRECT ((unsigned long)(10)) 546 extern rpcb_rmtcallres * rpcbproc_indirect_4(rpcb_rmtcallargs *, CLIENT *); 547 extern rpcb_rmtcallres * rpcbproc_indirect_4_svc(rpcb_rmtcallargs *, struct svc_req *); 548 #define RPCBPROC_GETADDRLIST ((unsigned long)(11)) 549 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4(RPCB *, CLIENT *); 550 extern rpcb_entry_list_ptr * rpcbproc_getaddrlist_4_svc(RPCB *, struct svc_req *); 551 #define RPCBPROC_GETSTAT ((unsigned long)(12)) 552 extern rpcb_stat * rpcbproc_getstat_4(void *, CLIENT *); 553 extern rpcb_stat * rpcbproc_getstat_4_svc(void *, struct svc_req *); 554 extern int rpcbprog_4_freeresult(SVCXPRT *, xdrproc_t, caddr_t); 555 556 /* the xdr functions */ 557 extern bool_t xdr_rpcb(XDR *, RPCB *); 558 #ifndef _KERNEL 559 extern bool_t xdr_rp__list(XDR *, rp__list*); 560 #endif 561 extern bool_t xdr_rpcblist_ptr(XDR *, rpcblist_ptr*); 562 extern bool_t xdr_rpcb_rmtcallargs(XDR *, rpcb_rmtcallargs*); 563 extern bool_t xdr_rpcb_rmtcallres(XDR *, rpcb_rmtcallres*); 564 extern bool_t xdr_rpcb_entry(XDR *, rpcb_entry*); 565 extern bool_t xdr_rpcb_entry_list(XDR *, rpcb_entry_list*); 566 extern bool_t xdr_rpcb_entry_list_ptr(XDR *, rpcb_entry_list_ptr*); 567 extern bool_t xdr_rpcbs_addrlist(XDR *, rpcbs_addrlist*); 568 extern bool_t xdr_rpcbs_rmtcalllist(XDR *, rpcbs_rmtcalllist*); 569 extern bool_t xdr_rpcbs_proc(XDR *, rpcbs_proc); 570 extern bool_t xdr_rpcbs_addrlist_ptr(XDR *, rpcbs_addrlist_ptr*); 571 extern bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *, rpcbs_rmtcalllist_ptr*); 572 extern bool_t xdr_rpcb_stat(XDR *, rpcb_stat*); 573 extern bool_t xdr_rpcb_stat_byvers(XDR *, rpcb_stat_byvers); 574 575 #ifdef __cplusplus 576 } 577 #endif 578 579 #endif /* !_RPCB_PROT_H_RPCGEN */ 580