1 /* $NetBSD: clnt_bcast.c,v 1.3 2000/07/06 03:05:20 christos Exp $ */ 2 3 /* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or 9 * program developed by the user. 10 * 11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 14 * 15 * Sun RPC is provided with no support and without any obligation on the 16 * part of Sun Microsystems, Inc. to assist in its use, correction, 17 * modification or enhancement. 18 * 19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 21 * OR ANY PART THEREOF. 22 * 23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 24 * or profits or other special, indirect and consequential damages, even if 25 * Sun has been advised of the possibility of such damages. 26 * 27 * Sun Microsystems, Inc. 28 * 2550 Garcia Avenue 29 * Mountain View, California 94043 30 */ 31 /* 32 * Copyright (c) 1986-1991 by Sun Microsystems Inc. 33 */ 34 35 /* #ident "@(#)clnt_bcast.c 1.18 94/05/03 SMI" */ 36 37 #if !defined(lint) && defined(SCCSIDS) 38 static char sccsid[] = "@(#)clnt_bcast.c 1.15 89/04/21 Copyr 1988 Sun Micro"; 39 #endif 40 #include <sys/cdefs.h> 41 __FBSDID("$FreeBSD$"); 42 43 44 /* 45 * clnt_bcast.c 46 * Client interface to broadcast service. 47 * 48 * Copyright (C) 1988, Sun Microsystems, Inc. 49 * 50 * The following is kludged-up support for simple rpc broadcasts. 51 * Someday a large, complicated system will replace these routines. 52 */ 53 54 #include "namespace.h" 55 #include <sys/types.h> 56 #include <sys/socket.h> 57 #include <sys/queue.h> 58 #include <net/if.h> 59 #include <netinet/in.h> 60 #include <ifaddrs.h> 61 #include <sys/poll.h> 62 #include <rpc/rpc.h> 63 #ifdef PORTMAP 64 #include <rpc/pmap_prot.h> 65 #include <rpc/pmap_clnt.h> 66 #include <rpc/pmap_rmt.h> 67 #endif /* PORTMAP */ 68 #include <rpc/nettype.h> 69 #include <arpa/inet.h> 70 #ifdef RPC_DEBUG 71 #include <stdio.h> 72 #endif 73 #include <errno.h> 74 #include <stdlib.h> 75 #include <unistd.h> 76 #include <netdb.h> 77 #include <err.h> 78 #include <string.h> 79 #include "un-namespace.h" 80 81 #include "rpc_com.h" 82 83 #define MAXBCAST 20 /* Max no of broadcasting transports */ 84 #define INITTIME 4000 /* Time to wait initially */ 85 #define WAITTIME 8000 /* Maximum time to wait */ 86 87 /* 88 * If nettype is NULL, it broadcasts on all the available 89 * datagram_n transports. May potentially lead to broadacst storms 90 * and hence should be used with caution, care and courage. 91 * 92 * The current parameter xdr packet size is limited by the max tsdu 93 * size of the transport. If the max tsdu size of any transport is 94 * smaller than the parameter xdr packet, then broadcast is not 95 * sent on that transport. 96 * 97 * Also, the packet size should be less the packet size of 98 * the data link layer (for ethernet it is 1400 bytes). There is 99 * no easy way to find out the max size of the data link layer and 100 * we are assuming that the args would be smaller than that. 101 * 102 * The result size has to be smaller than the transport tsdu size. 103 * 104 * If PORTMAP has been defined, we send two packets for UDP, one for 105 * rpcbind and one for portmap. For those machines which support 106 * both rpcbind and portmap, it will cause them to reply twice, and 107 * also here it will get two responses ... inefficient and clumsy. 108 */ 109 110 struct broadif { 111 int index; 112 struct sockaddr_storage broadaddr; 113 TAILQ_ENTRY(broadif) link; 114 }; 115 116 typedef TAILQ_HEAD(, broadif) broadlist_t; 117 118 int __rpc_getbroadifs(int, int, int, broadlist_t *); 119 void __rpc_freebroadifs(broadlist_t *); 120 int __rpc_broadenable(int, int, struct broadif *); 121 122 int __rpc_lowvers = 0; 123 124 int 125 __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list) 126 { 127 int count = 0; 128 struct broadif *bip; 129 struct ifaddrs *ifap, *ifp; 130 #ifdef INET6 131 struct sockaddr_in6 *sin6; 132 #endif 133 struct sockaddr_in *sin; 134 struct addrinfo hints, *res; 135 136 if (getifaddrs(&ifp) < 0) 137 return 0; 138 139 memset(&hints, 0, sizeof hints); 140 141 hints.ai_family = af; 142 hints.ai_protocol = proto; 143 hints.ai_socktype = socktype; 144 145 if (getaddrinfo(NULL, "sunrpc", &hints, &res) != 0) 146 return 0; 147 148 for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) { 149 if (ifap->ifa_addr->sa_family != af || 150 !(ifap->ifa_flags & IFF_UP)) 151 continue; 152 #ifdef INET6 153 if ((af == AF_INET6 && !(ifap->ifa_flags & IFF_MULTICAST)) || 154 !(ifap->ifa_flags & IFF_BROADCAST)) 155 continue; 156 #endif 157 bip = (struct broadif *)malloc(sizeof *bip); 158 if (bip == NULL) 159 break; 160 bip->index = if_nametoindex(ifap->ifa_name); 161 #ifdef INET6 162 if (af != AF_INET6 && (ifap->ifa_flags & IFF_BROADCAST)) { 163 #else 164 if (ifap->ifa_flags & IFF_BROADCAST) { 165 #endif 166 memcpy(&bip->broadaddr, ifap->ifa_broadaddr, 167 (size_t)ifap->ifa_broadaddr->sa_len); 168 sin = (struct sockaddr_in *)(void *)&bip->broadaddr; 169 sin->sin_port = 170 ((struct sockaddr_in *) 171 (void *)res->ai_addr)->sin_port; 172 #ifdef INET6 173 } else if (af == AF_INET6) { 174 sin6 = (struct sockaddr_in6 *)(void *)&bip->broadaddr; 175 inet_pton(af, RPCB_MULTICAST_ADDR, &sin6->sin6_addr); 176 sin6->sin6_family = af; 177 sin6->sin6_len = sizeof *sin6; 178 sin6->sin6_port = 179 ((struct sockaddr_in6 *) 180 (void *)res->ai_addr)->sin6_port; 181 sin6->sin6_scope_id = bip->index; 182 #endif 183 } 184 TAILQ_INSERT_TAIL(list, bip, link); 185 count++; 186 } 187 freeifaddrs(ifp); 188 freeaddrinfo(res); 189 190 return count; 191 } 192 193 void 194 __rpc_freebroadifs(broadlist_t *list) 195 { 196 struct broadif *bip, *next; 197 198 bip = TAILQ_FIRST(list); 199 200 while (bip != NULL) { 201 next = TAILQ_NEXT(bip, link); 202 free(bip); 203 bip = next; 204 } 205 } 206 207 int 208 /*ARGSUSED*/ 209 __rpc_broadenable(int af, int s, struct broadif *bip) 210 { 211 int o = 1; 212 213 #if 0 214 if (af == AF_INET6) { 215 fprintf(stderr, "set v6 multicast if to %d\n", bip->index); 216 if (_setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, &bip->index, 217 sizeof bip->index) < 0) 218 return -1; 219 } else 220 #endif 221 if (_setsockopt(s, SOL_SOCKET, SO_BROADCAST, &o, sizeof o) < 0) 222 return -1; 223 224 return 0; 225 } 226 227 228 enum clnt_stat 229 rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, 230 eachresult, inittime, waittime, nettype) 231 rpcprog_t prog; /* program number */ 232 rpcvers_t vers; /* version number */ 233 rpcproc_t proc; /* procedure number */ 234 xdrproc_t xargs; /* xdr routine for args */ 235 caddr_t argsp; /* pointer to args */ 236 xdrproc_t xresults; /* xdr routine for results */ 237 caddr_t resultsp; /* pointer to results */ 238 resultproc_t eachresult; /* call with each result obtained */ 239 int inittime; /* how long to wait initially */ 240 int waittime; /* maximum time to wait */ 241 const char *nettype; /* transport type */ 242 { 243 enum clnt_stat stat = RPC_SUCCESS; /* Return status */ 244 XDR xdr_stream; /* XDR stream */ 245 XDR *xdrs = &xdr_stream; 246 struct rpc_msg msg; /* RPC message */ 247 struct timeval t; 248 char *outbuf = NULL; /* Broadcast msg buffer */ 249 char *inbuf = NULL; /* Reply buf */ 250 int inlen; 251 u_int maxbufsize = 0; 252 AUTH *sys_auth = authunix_create_default(); 253 int i; 254 void *handle; 255 char uaddress[1024]; /* A self imposed limit */ 256 char *uaddrp = uaddress; 257 int pmap_reply_flag; /* reply recvd from PORTMAP */ 258 /* An array of all the suitable broadcast transports */ 259 struct { 260 int fd; /* File descriptor */ 261 int af; 262 int proto; 263 struct netconfig *nconf; /* Netconfig structure */ 264 u_int asize; /* Size of the addr buf */ 265 u_int dsize; /* Size of the data buf */ 266 struct sockaddr_storage raddr; /* Remote address */ 267 broadlist_t nal; 268 } fdlist[MAXBCAST]; 269 struct pollfd pfd[MAXBCAST]; 270 size_t fdlistno = 0; 271 struct r_rpcb_rmtcallargs barg; /* Remote arguments */ 272 struct r_rpcb_rmtcallres bres; /* Remote results */ 273 size_t outlen; 274 struct netconfig *nconf; 275 int msec; 276 int pollretval; 277 int fds_found; 278 279 #ifdef PORTMAP 280 size_t outlen_pmap = 0; 281 u_long port; /* Remote port number */ 282 int pmap_flag = 0; /* UDP exists ? */ 283 char *outbuf_pmap = NULL; 284 struct rmtcallargs barg_pmap; /* Remote arguments */ 285 struct rmtcallres bres_pmap; /* Remote results */ 286 u_int udpbufsz = 0; 287 #endif /* PORTMAP */ 288 289 if (sys_auth == NULL) { 290 return (RPC_SYSTEMERROR); 291 } 292 /* 293 * initialization: create a fd, a broadcast address, and send the 294 * request on the broadcast transport. 295 * Listen on all of them and on replies, call the user supplied 296 * function. 297 */ 298 299 if (nettype == NULL) 300 nettype = "datagram_n"; 301 if ((handle = __rpc_setconf(nettype)) == NULL) { 302 return (RPC_UNKNOWNPROTO); 303 } 304 while ((nconf = __rpc_getconf(handle)) != NULL) { 305 int fd; 306 struct __rpc_sockinfo si; 307 308 if (nconf->nc_semantics != NC_TPI_CLTS) 309 continue; 310 if (fdlistno >= MAXBCAST) 311 break; /* No more slots available */ 312 if (!__rpc_nconf2sockinfo(nconf, &si)) 313 continue; 314 315 TAILQ_INIT(&fdlist[fdlistno].nal); 316 if (__rpc_getbroadifs(si.si_af, si.si_proto, si.si_socktype, 317 &fdlist[fdlistno].nal) == 0) 318 continue; 319 320 fd = _socket(si.si_af, si.si_socktype, si.si_proto); 321 if (fd < 0) { 322 stat = RPC_CANTSEND; 323 continue; 324 } 325 fdlist[fdlistno].af = si.si_af; 326 fdlist[fdlistno].proto = si.si_proto; 327 fdlist[fdlistno].fd = fd; 328 fdlist[fdlistno].nconf = nconf; 329 fdlist[fdlistno].asize = __rpc_get_a_size(si.si_af); 330 pfd[fdlistno].events = POLLIN | POLLPRI | 331 POLLRDNORM | POLLRDBAND; 332 pfd[fdlistno].fd = fdlist[fdlistno].fd = fd; 333 fdlist[fdlistno].dsize = __rpc_get_t_size(si.si_af, si.si_proto, 334 0); 335 336 if (maxbufsize <= fdlist[fdlistno].dsize) 337 maxbufsize = fdlist[fdlistno].dsize; 338 339 #ifdef PORTMAP 340 if (si.si_af == AF_INET && si.si_proto == IPPROTO_UDP) { 341 udpbufsz = fdlist[fdlistno].dsize; 342 if ((outbuf_pmap = malloc(udpbufsz)) == NULL) { 343 _close(fd); 344 stat = RPC_SYSTEMERROR; 345 goto done_broad; 346 } 347 pmap_flag = 1; 348 } 349 #endif /* PORTMAP */ 350 fdlistno++; 351 } 352 353 if (fdlistno == 0) { 354 if (stat == RPC_SUCCESS) 355 stat = RPC_UNKNOWNPROTO; 356 goto done_broad; 357 } 358 if (maxbufsize == 0) { 359 if (stat == RPC_SUCCESS) 360 stat = RPC_CANTSEND; 361 goto done_broad; 362 } 363 inbuf = malloc(maxbufsize); 364 outbuf = malloc(maxbufsize); 365 if ((inbuf == NULL) || (outbuf == NULL)) { 366 stat = RPC_SYSTEMERROR; 367 goto done_broad; 368 } 369 370 /* Serialize all the arguments which have to be sent */ 371 (void) gettimeofday(&t, NULL); 372 msg.rm_xid = __RPC_GETXID(&t); 373 msg.rm_direction = CALL; 374 msg.rm_call.cb_rpcvers = RPC_MSG_VERSION; 375 msg.rm_call.cb_prog = RPCBPROG; 376 msg.rm_call.cb_vers = RPCBVERS; 377 msg.rm_call.cb_proc = RPCBPROC_CALLIT; 378 barg.prog = prog; 379 barg.vers = vers; 380 barg.proc = proc; 381 barg.args.args_val = argsp; 382 barg.xdr_args = xargs; 383 bres.addr = uaddrp; 384 bres.results.results_val = resultsp; 385 bres.xdr_res = xresults; 386 msg.rm_call.cb_cred = sys_auth->ah_cred; 387 msg.rm_call.cb_verf = sys_auth->ah_verf; 388 xdrmem_create(xdrs, outbuf, maxbufsize, XDR_ENCODE); 389 if ((!xdr_callmsg(xdrs, &msg)) || 390 (!xdr_rpcb_rmtcallargs(xdrs, 391 (struct rpcb_rmtcallargs *)(void *)&barg))) { 392 stat = RPC_CANTENCODEARGS; 393 goto done_broad; 394 } 395 outlen = xdr_getpos(xdrs); 396 xdr_destroy(xdrs); 397 398 #ifdef PORTMAP 399 /* Prepare the packet for version 2 PORTMAP */ 400 if (pmap_flag) { 401 msg.rm_xid++; /* One way to distinguish */ 402 msg.rm_call.cb_prog = PMAPPROG; 403 msg.rm_call.cb_vers = PMAPVERS; 404 msg.rm_call.cb_proc = PMAPPROC_CALLIT; 405 barg_pmap.prog = prog; 406 barg_pmap.vers = vers; 407 barg_pmap.proc = proc; 408 barg_pmap.args_ptr = argsp; 409 barg_pmap.xdr_args = xargs; 410 bres_pmap.port_ptr = &port; 411 bres_pmap.xdr_results = xresults; 412 bres_pmap.results_ptr = resultsp; 413 xdrmem_create(xdrs, outbuf_pmap, udpbufsz, XDR_ENCODE); 414 if ((! xdr_callmsg(xdrs, &msg)) || 415 (! xdr_rmtcall_args(xdrs, &barg_pmap))) { 416 stat = RPC_CANTENCODEARGS; 417 goto done_broad; 418 } 419 outlen_pmap = xdr_getpos(xdrs); 420 xdr_destroy(xdrs); 421 } 422 #endif /* PORTMAP */ 423 424 /* 425 * Basic loop: broadcast the packets to transports which 426 * support data packets of size such that one can encode 427 * all the arguments. 428 * Wait a while for response(s). 429 * The response timeout grows larger per iteration. 430 */ 431 for (msec = inittime; msec <= waittime; msec += msec) { 432 struct broadif *bip; 433 434 /* Broadcast all the packets now */ 435 for (i = 0; i < fdlistno; i++) { 436 if (fdlist[i].dsize < outlen) { 437 stat = RPC_CANTSEND; 438 continue; 439 } 440 for (bip = TAILQ_FIRST(&fdlist[i].nal); bip != NULL; 441 bip = TAILQ_NEXT(bip, link)) { 442 void *addr; 443 444 addr = &bip->broadaddr; 445 446 __rpc_broadenable(fdlist[i].af, fdlist[i].fd, 447 bip); 448 449 /* 450 * Only use version 3 if lowvers is not set 451 */ 452 453 if (!__rpc_lowvers) 454 if (_sendto(fdlist[i].fd, outbuf, 455 outlen, 0, (struct sockaddr*)addr, 456 (size_t)fdlist[i].asize) != 457 outlen) { 458 #ifdef RPC_DEBUG 459 perror("sendto"); 460 #endif 461 warnx("clnt_bcast: cannot send" 462 "broadcast packet"); 463 stat = RPC_CANTSEND; 464 continue; 465 }; 466 #ifdef RPC_DEBUG 467 if (!__rpc_lowvers) 468 fprintf(stderr, "Broadcast packet sent " 469 "for %s\n", 470 fdlist[i].nconf->nc_netid); 471 #endif 472 #ifdef PORTMAP 473 /* 474 * Send the version 2 packet also 475 * for UDP/IP 476 */ 477 if (fdlist[i].proto == IPPROTO_UDP) { 478 if (_sendto(fdlist[i].fd, outbuf_pmap, 479 outlen_pmap, 0, addr, 480 (size_t)fdlist[i].asize) != 481 outlen_pmap) { 482 warnx("clnt_bcast: " 483 "Cannot send broadcast packet"); 484 stat = RPC_CANTSEND; 485 continue; 486 } 487 } 488 #ifdef RPC_DEBUG 489 fprintf(stderr, "PMAP Broadcast packet " 490 "sent for %s\n", 491 fdlist[i].nconf->nc_netid); 492 #endif 493 #endif /* PORTMAP */ 494 } 495 /* End for sending all packets on this transport */ 496 } /* End for sending on all transports */ 497 498 if (eachresult == NULL) { 499 stat = RPC_SUCCESS; 500 goto done_broad; 501 } 502 503 /* 504 * Get all the replies from these broadcast requests 505 */ 506 recv_again: 507 508 switch (pollretval = _poll(pfd, fdlistno, msec)) { 509 case 0: /* timed out */ 510 stat = RPC_TIMEDOUT; 511 continue; 512 case -1: /* some kind of error - we ignore it */ 513 goto recv_again; 514 } /* end of poll results switch */ 515 516 for (i = fds_found = 0; 517 i < fdlistno && fds_found < pollretval; i++) { 518 bool_t done = FALSE; 519 520 if (pfd[i].revents == 0) 521 continue; 522 else if (pfd[i].revents & POLLNVAL) { 523 /* 524 * Something bad has happened to this descri- 525 * ptor. We can cause _poll() to ignore 526 * it simply by using a negative fd. We do that 527 * rather than compacting the pfd[] and fdlist[] 528 * arrays. 529 */ 530 pfd[i].fd = -1; 531 fds_found++; 532 continue; 533 } else 534 fds_found++; 535 #ifdef RPC_DEBUG 536 fprintf(stderr, "response for %s\n", 537 fdlist[i].nconf->nc_netid); 538 #endif 539 try_again: 540 inlen = _recvfrom(fdlist[i].fd, inbuf, fdlist[i].dsize, 541 0, (struct sockaddr *)(void *)&fdlist[i].raddr, 542 &fdlist[i].asize); 543 if (inlen < 0) { 544 if (errno == EINTR) 545 goto try_again; 546 warnx("clnt_bcast: Cannot receive reply to " 547 "broadcast"); 548 stat = RPC_CANTRECV; 549 continue; 550 } 551 if (inlen < sizeof (u_int32_t)) 552 continue; /* Drop that and go ahead */ 553 /* 554 * see if reply transaction id matches sent id. 555 * If so, decode the results. If return id is xid + 1 556 * it was a PORTMAP reply 557 */ 558 if (*((u_int32_t *)(void *)(inbuf)) == 559 *((u_int32_t *)(void *)(outbuf))) { 560 pmap_reply_flag = 0; 561 msg.acpted_rply.ar_verf = _null_auth; 562 msg.acpted_rply.ar_results.where = 563 (caddr_t)(void *)&bres; 564 msg.acpted_rply.ar_results.proc = 565 (xdrproc_t)xdr_rpcb_rmtcallres; 566 #ifdef PORTMAP 567 } else if (pmap_flag && 568 *((u_int32_t *)(void *)(inbuf)) == 569 *((u_int32_t *)(void *)(outbuf_pmap))) { 570 pmap_reply_flag = 1; 571 msg.acpted_rply.ar_verf = _null_auth; 572 msg.acpted_rply.ar_results.where = 573 (caddr_t)(void *)&bres_pmap; 574 msg.acpted_rply.ar_results.proc = 575 (xdrproc_t)xdr_rmtcallres; 576 #endif /* PORTMAP */ 577 } else 578 continue; 579 xdrmem_create(xdrs, inbuf, (u_int)inlen, XDR_DECODE); 580 if (xdr_replymsg(xdrs, &msg)) { 581 if ((msg.rm_reply.rp_stat == MSG_ACCEPTED) && 582 (msg.acpted_rply.ar_stat == SUCCESS)) { 583 struct netbuf taddr, *np; 584 struct sockaddr_in *sin; 585 586 #ifdef PORTMAP 587 if (pmap_flag && pmap_reply_flag) { 588 sin = (struct sockaddr_in *) 589 (void *)&fdlist[i].raddr; 590 sin->sin_port = 591 htons((u_short)port); 592 taddr.len = taddr.maxlen = 593 fdlist[i].raddr.ss_len; 594 taddr.buf = &fdlist[i].raddr; 595 done = (*eachresult)(resultsp, 596 &taddr, fdlist[i].nconf); 597 } else { 598 #endif /* PORTMAP */ 599 #ifdef RPC_DEBUG 600 fprintf(stderr, "uaddr %s\n", 601 uaddrp); 602 #endif 603 np = uaddr2taddr( 604 fdlist[i].nconf, uaddrp); 605 done = (*eachresult)(resultsp, 606 np, fdlist[i].nconf); 607 free(np); 608 #ifdef PORTMAP 609 } 610 #endif /* PORTMAP */ 611 } 612 /* otherwise, we just ignore the errors ... */ 613 } 614 /* else some kind of deserialization problem ... */ 615 616 xdrs->x_op = XDR_FREE; 617 msg.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; 618 (void) xdr_replymsg(xdrs, &msg); 619 (void) (*xresults)(xdrs, resultsp); 620 XDR_DESTROY(xdrs); 621 if (done) { 622 stat = RPC_SUCCESS; 623 goto done_broad; 624 } else { 625 goto recv_again; 626 } 627 } /* The recv for loop */ 628 } /* The giant for loop */ 629 630 done_broad: 631 if (inbuf) 632 (void) free(inbuf); 633 if (outbuf) 634 (void) free(outbuf); 635 #ifdef PORTMAP 636 if (outbuf_pmap) 637 (void) free(outbuf_pmap); 638 #endif /* PORTMAP */ 639 for (i = 0; i < fdlistno; i++) { 640 (void)_close(fdlist[i].fd); 641 __rpc_freebroadifs(&fdlist[i].nal); 642 } 643 AUTH_DESTROY(sys_auth); 644 (void) __rpc_endconf(handle); 645 646 return (stat); 647 } 648 649 650 enum clnt_stat 651 rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, 652 eachresult, nettype) 653 rpcprog_t prog; /* program number */ 654 rpcvers_t vers; /* version number */ 655 rpcproc_t proc; /* procedure number */ 656 xdrproc_t xargs; /* xdr routine for args */ 657 caddr_t argsp; /* pointer to args */ 658 xdrproc_t xresults; /* xdr routine for results */ 659 caddr_t resultsp; /* pointer to results */ 660 resultproc_t eachresult; /* call with each result obtained */ 661 const char *nettype; /* transport type */ 662 { 663 enum clnt_stat dummy; 664 665 dummy = rpc_broadcast_exp(prog, vers, proc, xargs, argsp, 666 xresults, resultsp, eachresult, 667 INITTIME, WAITTIME, nettype); 668 return (dummy); 669 } 670