174462Salfred/* $NetBSD: pmap_clnt.h,v 1.9 2000/06/02 22:57:55 fvdl Exp $ */ 274462Salfred 3258578Shrs/*- 4258578Shrs * Copyright (c) 2009, Sun Microsystems, Inc. 5258578Shrs * All rights reserved. 68858Srgrimes * 7258578Shrs * Redistribution and use in source and binary forms, with or without 8258578Shrs * modification, are permitted provided that the following conditions are met: 9258578Shrs * - Redistributions of source code must retain the above copyright notice, 10258578Shrs * this list of conditions and the following disclaimer. 11258578Shrs * - Redistributions in binary form must reproduce the above copyright notice, 12258578Shrs * this list of conditions and the following disclaimer in the documentation 13258578Shrs * and/or other materials provided with the distribution. 14258578Shrs * - Neither the name of Sun Microsystems, Inc. nor the names of its 15258578Shrs * contributors may be used to endorse or promote products derived 16258578Shrs * from this software without specific prior written permission. 178858Srgrimes * 18258578Shrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19258578Shrs * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20258578Shrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21258578Shrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22258578Shrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23258578Shrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24258578Shrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25258578Shrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26258578Shrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27258578Shrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28258578Shrs * POSSIBILITY OF SUCH DAMAGE. 298858Srgrimes * 3074462Salfred * from: @(#)pmap_clnt.h 1.11 88/02/08 SMI 311903Swollman * from: @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC 3250473Speter * $FreeBSD$ 331839Swollman */ 341839Swollman 351839Swollman/* 361839Swollman * pmap_clnt.h 371839Swollman * Supplies C routines to get to portmap services. 381839Swollman * 391839Swollman * Copyright (C) 1984, Sun Microsystems, Inc. 401839Swollman */ 411839Swollman 421839Swollman/* 431839Swollman * Usage: 441839Swollman * success = pmap_set(program, version, protocol, port); 451839Swollman * success = pmap_unset(program, version); 461839Swollman * port = pmap_getport(address, program, version, protocol); 471839Swollman * head = pmap_getmaps(address); 481839Swollman * clnt_stat = pmap_rmtcall(address, program, version, procedure, 491839Swollman * xdrargs, argsp, xdrres, resp, tout, port_ptr) 508858Srgrimes * (works for udp only.) 511839Swollman * clnt_stat = clnt_broadcast(program, version, procedure, 521839Swollman * xdrargs, argsp, xdrres, resp, eachresult) 531839Swollman * (like pmap_rmtcall, except the call is broadcasted to all 541839Swollman * locally connected nets. For each valid response received, 551839Swollman * the procedure eachresult is called. Its form is: 561839Swollman * done = eachresult(resp, raddr) 571839Swollman * bool_t done; 581839Swollman * caddr_t resp; 591839Swollman * struct sockaddr_in raddr; 601839Swollman * where resp points to the results of the call and raddr is the 611839Swollman * address if the responder to the broadcast. 621839Swollman */ 631839Swollman 6474462Salfred#ifndef _RPC_PMAP_CLNT_H_ 6574462Salfred#define _RPC_PMAP_CLNT_H_ 661903Swollman#include <sys/cdefs.h> 671903Swollman 681903Swollman__BEGIN_DECLS 6993032Simpextern bool_t pmap_set(u_long, u_long, int, int); 7093032Simpextern bool_t pmap_unset(u_long, u_long); 7193032Simpextern struct pmaplist *pmap_getmaps(struct sockaddr_in *); 7293032Simpextern enum clnt_stat pmap_rmtcall(struct sockaddr_in *, 7393032Simp u_long, u_long, u_long, 7493032Simp xdrproc_t, caddr_t, 7593032Simp xdrproc_t, caddr_t, 7693032Simp struct timeval, u_long *); 7793032Simpextern enum clnt_stat clnt_broadcast(u_long, u_long, u_long, 7895658Sdes xdrproc_t, void *, 7995658Sdes xdrproc_t, void *, 8093032Simp resultproc_t); 8193032Simpextern u_short pmap_getport(struct sockaddr_in *, 8293032Simp u_long, u_long, u_int); 831903Swollman__END_DECLS 841903Swollman 8574462Salfred#endif /* !_RPC_PMAP_CLNT_H_ */ 86