/* $NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $ */12/*-3* SPDX-License-Identifier: BSD-3-Clause4*5* Copyright (c) 2009, Sun Microsystems, Inc.6* All rights reserved.7*8* Redistribution and use in source and binary forms, with or without9* modification, are permitted provided that the following conditions are met:10* - Redistributions of source code must retain the above copyright notice,11* this list of conditions and the following disclaimer.12* - Redistributions in binary form must reproduce the above copyright notice,13* this list of conditions and the following disclaimer in the documentation14* and/or other materials provided with the distribution.15* - Neither the name of Sun Microsystems, Inc. nor the names of its16* contributors may be used to endorse or promote products derived17* from this software without specific prior written permission.18*19* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"20* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE21* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE22* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE23* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR24* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF25* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS26* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN27* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)28* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE29* POSSIBILITY OF SUCH DAMAGE.30*/3132/*33* rpc.h, Just includes the billions of rpc header files necessary to34* do remote procedure calling.35*36* Copyright (C) 1984, Sun Microsystems, Inc.37*/38#ifndef _RPC_RPC_H39#define _RPC_RPC_H4041#include <rpc/types.h> /* some typedefs */42#include <sys/socket.h>43#include <netinet/in.h>4445/* external data representation interfaces */46#include <rpc/xdr.h> /* generic (de)serializer */4748/* Client side only authentication */49#include <rpc/auth.h> /* generic authenticator (client side) */5051/* Client side (mostly) remote procedure call */52#include <rpc/clnt.h> /* generic rpc stuff */5354/* semi-private protocol headers */55#include <rpc/rpc_msg.h> /* protocol for rpc messages */5657#ifndef _KERNEL58#include <rpc/auth_unix.h> /* protocol for unix style cred */59/*60* Uncomment-out the next line if you are building the rpc library with61* DES Authentication (see the README file in the secure_rpc/ directory).62*/63#include <rpc/auth_des.h> /* protocol for des style cred */64#endif6566/* Server side only remote procedure callee */67#include <rpc/svc.h> /* service manager and multiplexer */68#include <rpc/svc_auth.h> /* service side authenticator */6970#ifndef _KERNEL71/* Portmapper client, server, and protocol headers */72#include <rpc/pmap_clnt.h>73#endif74#include <rpc/pmap_prot.h>7576#include <rpc/rpcb_clnt.h> /* rpcbind interface functions */7778#ifndef _KERNEL79#include <rpc/rpcent.h>80#endif8182#ifndef UDPMSGSIZE83#define UDPMSGSIZE 880084#endif8586__BEGIN_DECLS87extern int get_myaddress(struct sockaddr_in *);88#ifndef _KERNEL89extern int bindresvport(int, struct sockaddr_in *);90#endif91extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),92xdrproc_t, xdrproc_t);93extern int callrpc(const char *, int, int, int, xdrproc_t, void *,94xdrproc_t , void *);95extern int getrpcport(char *, int, int, int);9697char *taddr2uaddr(const struct netconfig *, const struct netbuf *);98struct netbuf *uaddr2taddr(const struct netconfig *, const char *);99100struct sockaddr;101extern int bindresvport_sa(int, struct sockaddr *);102__END_DECLS103104/*105* The following are not exported interfaces, they are for internal library106* and rpcbind use only. Do not use, they may change without notice.107*/108__BEGIN_DECLS109#ifndef _KERNEL110int __rpc_nconf2fd(const struct netconfig *);111int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);112int __rpc_fd2sockinfo(int, struct __rpc_sockinfo *);113#else114struct socket *__rpc_nconf2socket(const struct netconfig *);115int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);116int __rpc_socket2sockinfo(struct socket *, struct __rpc_sockinfo *);117#endif118u_int __rpc_get_t_size(int, int, int);119__END_DECLS120121#endif /* !_RPC_RPC_H */122123124