Path: blob/main/crypto/krb5/src/include/gssrpc/pmap_clnt.h
34907 views
/* @(#)pmap_clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.11 88/02/08 SMI */1/*2* Copyright (c) 2010, Oracle America, Inc.3*4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions are met:8*9* * Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* * Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in14* the documentation and/or other materials provided with the15* distribution.16*17* * Neither the name of the "Oracle America, Inc." nor the names of18* its contributors may be used to endorse or promote products19* derived from this software without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS22* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED23* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A24* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT25* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,26* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED27* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR28* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF29* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING30* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS31* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.32*/3334/*35* pmap_clnt.h36* Supplies C routines to get to portmap services.37*/3839#ifndef GSSRPC_PMAP_CLNT_H40#define GSSRPC_PMAP_CLNT_H4142/*43* Usage:44* success = pmap_set(program, version, protocol, port);45* success = pmap_unset(program, version);46* port = pmap_getport(address, program, version, protocol);47* head = pmap_getmaps(address);48* clnt_stat = pmap_rmtcall(address, program, version, procedure,49* xdrargs, argsp, xdrres, resp, tout, port_ptr)50* (works for udp only.)51* clnt_stat = clnt_broadcast(program, version, procedure,52* xdrargs, argsp, xdrres, resp, eachresult)53* (like pmap_rmtcall, except the call is broadcasted to all54* locally connected nets. For each valid response received,55* the procedure eachresult is called. Its form is:56* done = eachresult(resp, raddr)57* bool_t done;58* caddr_t resp;59* struct sockaddr_in raddr;60* where resp points to the results of the call and raddr is the61* address if the responder to the broadcast.62*/6364GSSRPC__BEGIN_DECLS65extern bool_t pmap_set(rpcprog_t, rpcvers_t, rpcprot_t, u_int);66extern bool_t pmap_unset(rpcprog_t, rpcvers_t);67extern struct pmaplist *pmap_getmaps(struct sockaddr_in *);68enum clnt_stat pmap_rmtcall(struct sockaddr_in *, rpcprog_t,69rpcvers_t, rpcproc_t, xdrproc_t,70caddr_t, xdrproc_t, caddr_t,71struct timeval, rpcport_t *);7273typedef bool_t (*resultproc_t)(caddr_t, struct sockaddr_in *);7475enum clnt_stat clnt_broadcast(rpcprog_t, rpcvers_t, rpcproc_t,76xdrproc_t, caddr_t, xdrproc_t,77caddr_t, resultproc_t);78extern u_short pmap_getport(struct sockaddr_in *,79rpcprog_t,80rpcvers_t, rpcprot_t);81GSSRPC__END_DECLS82#endif /* !defined(GSSRPC_PMAP_CLNT_H) */838485