1*53ee8cc1Swenshuai.xi /* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */ 2*53ee8cc1Swenshuai.xi /* 3*53ee8cc1Swenshuai.xi * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 4*53ee8cc1Swenshuai.xi * unrestricted use provided that this legend is included on all tape 5*53ee8cc1Swenshuai.xi * media and as a part of the software program in whole or part. Users 6*53ee8cc1Swenshuai.xi * may copy or modify Sun RPC without charge, but are not authorized 7*53ee8cc1Swenshuai.xi * to license or distribute it to anyone else except as part of a product or 8*53ee8cc1Swenshuai.xi * program developed by the user. 9*53ee8cc1Swenshuai.xi * 10*53ee8cc1Swenshuai.xi * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 11*53ee8cc1Swenshuai.xi * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 12*53ee8cc1Swenshuai.xi * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 13*53ee8cc1Swenshuai.xi * 14*53ee8cc1Swenshuai.xi * Sun RPC is provided with no support and without any obligation on the 15*53ee8cc1Swenshuai.xi * part of Sun Microsystems, Inc. to assist in its use, correction, 16*53ee8cc1Swenshuai.xi * modification or enhancement. 17*53ee8cc1Swenshuai.xi * 18*53ee8cc1Swenshuai.xi * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 19*53ee8cc1Swenshuai.xi * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 20*53ee8cc1Swenshuai.xi * OR ANY PART THEREOF. 21*53ee8cc1Swenshuai.xi * 22*53ee8cc1Swenshuai.xi * In no event will Sun Microsystems, Inc. be liable for any lost revenue 23*53ee8cc1Swenshuai.xi * or profits or other special, indirect and consequential damages, even if 24*53ee8cc1Swenshuai.xi * Sun has been advised of the possibility of such damages. 25*53ee8cc1Swenshuai.xi * 26*53ee8cc1Swenshuai.xi * Sun Microsystems, Inc. 27*53ee8cc1Swenshuai.xi * 2550 Garcia Avenue 28*53ee8cc1Swenshuai.xi * Mountain View, California 94043 29*53ee8cc1Swenshuai.xi */ 30*53ee8cc1Swenshuai.xi 31*53ee8cc1Swenshuai.xi /* 32*53ee8cc1Swenshuai.xi * pmap_clnt.h 33*53ee8cc1Swenshuai.xi * Supplies C routines to get to portmap services. 34*53ee8cc1Swenshuai.xi * 35*53ee8cc1Swenshuai.xi * Copyright (C) 1984, Sun Microsystems, Inc. 36*53ee8cc1Swenshuai.xi */ 37*53ee8cc1Swenshuai.xi 38*53ee8cc1Swenshuai.xi #ifndef _RPC_PMAP_CLNT_H 39*53ee8cc1Swenshuai.xi #define _RPC_PMAP_CLNT_H 1 40*53ee8cc1Swenshuai.xi 41*53ee8cc1Swenshuai.xi #include <features.h> 42*53ee8cc1Swenshuai.xi #include <rpc/types.h> 43*53ee8cc1Swenshuai.xi #include <rpc/xdr.h> 44*53ee8cc1Swenshuai.xi #include <rpc/clnt.h> 45*53ee8cc1Swenshuai.xi 46*53ee8cc1Swenshuai.xi __BEGIN_DECLS 47*53ee8cc1Swenshuai.xi 48*53ee8cc1Swenshuai.xi typedef bool_t (*resultproc_t) (caddr_t resp, struct sockaddr_in *raddr); 49*53ee8cc1Swenshuai.xi 50*53ee8cc1Swenshuai.xi /* 51*53ee8cc1Swenshuai.xi * Usage: 52*53ee8cc1Swenshuai.xi * success = pmap_set(program, version, protocol, port); 53*53ee8cc1Swenshuai.xi * success = pmap_unset(program, version); 54*53ee8cc1Swenshuai.xi * port = pmap_getport(address, program, version, protocol); 55*53ee8cc1Swenshuai.xi * head = pmap_getmaps(address); 56*53ee8cc1Swenshuai.xi * clnt_stat = pmap_rmtcall(address, program, version, procedure, 57*53ee8cc1Swenshuai.xi * xdrargs, argsp, xdrres, resp, tout, port_ptr) 58*53ee8cc1Swenshuai.xi * (works for udp only.) 59*53ee8cc1Swenshuai.xi * clnt_stat = clnt_broadcast(program, version, procedure, 60*53ee8cc1Swenshuai.xi * xdrargs, argsp, xdrres, resp, eachresult) 61*53ee8cc1Swenshuai.xi * (like pmap_rmtcall, except the call is broadcasted to all 62*53ee8cc1Swenshuai.xi * locally connected nets. For each valid response received, 63*53ee8cc1Swenshuai.xi * the procedure eachresult is called. Its form is: 64*53ee8cc1Swenshuai.xi * done = eachresult(resp, raddr) 65*53ee8cc1Swenshuai.xi * bool_t done; 66*53ee8cc1Swenshuai.xi * caddr_t resp; 67*53ee8cc1Swenshuai.xi * struct sockaddr_in raddr; 68*53ee8cc1Swenshuai.xi * where resp points to the results of the call and raddr is the 69*53ee8cc1Swenshuai.xi * address if the responder to the broadcast. 70*53ee8cc1Swenshuai.xi */ 71*53ee8cc1Swenshuai.xi 72*53ee8cc1Swenshuai.xi extern bool_t pmap_set (__const u_long __program, __const u_long __vers, 73*53ee8cc1Swenshuai.xi int __protocol, u_short __port) __THROW; 74*53ee8cc1Swenshuai.xi extern bool_t pmap_unset (__const u_long __program, __const u_long __vers) 75*53ee8cc1Swenshuai.xi __THROW; 76*53ee8cc1Swenshuai.xi extern struct pmaplist *pmap_getmaps (struct sockaddr_in *__address) __THROW; 77*53ee8cc1Swenshuai.xi extern enum clnt_stat pmap_rmtcall (struct sockaddr_in *__addr, 78*53ee8cc1Swenshuai.xi __const u_long __prog, 79*53ee8cc1Swenshuai.xi __const u_long __vers, 80*53ee8cc1Swenshuai.xi __const u_long __proc, 81*53ee8cc1Swenshuai.xi xdrproc_t __xdrargs, 82*53ee8cc1Swenshuai.xi caddr_t __argsp, xdrproc_t __xdrres, 83*53ee8cc1Swenshuai.xi caddr_t __resp, struct timeval __tout, 84*53ee8cc1Swenshuai.xi u_long *__port_ptr) __THROW; 85*53ee8cc1Swenshuai.xi extern enum clnt_stat clnt_broadcast (__const u_long __prog, 86*53ee8cc1Swenshuai.xi __const u_long __vers, 87*53ee8cc1Swenshuai.xi __const u_long __proc, xdrproc_t __xargs, 88*53ee8cc1Swenshuai.xi caddr_t __argsp, xdrproc_t __xresults, 89*53ee8cc1Swenshuai.xi caddr_t __resultsp, 90*53ee8cc1Swenshuai.xi resultproc_t __eachresult) __THROW; 91*53ee8cc1Swenshuai.xi extern u_short pmap_getport (struct sockaddr_in *__address, 92*53ee8cc1Swenshuai.xi __const u_long __program, 93*53ee8cc1Swenshuai.xi __const u_long __version, u_int __protocol) 94*53ee8cc1Swenshuai.xi __THROW; 95*53ee8cc1Swenshuai.xi 96*53ee8cc1Swenshuai.xi __END_DECLS 97*53ee8cc1Swenshuai.xi 98*53ee8cc1Swenshuai.xi #endif /* rpc/pmap_clnt.h */ 99