174462Salfred/*	$NetBSD: rpc_com.h,v 1.3 2000/12/10 04:10:08 christos Exp $	*/
274462Salfred
3258578Shrs/*-
4258578Shrs * Copyright (c) 2009, Sun Microsystems, Inc.
5258578Shrs * All rights reserved.
6258578Shrs *
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.
1774462Salfred *
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.
2992989Sobrien *
3092989Sobrien * $FreeBSD$
3174462Salfred */
3274462Salfred/*
3374462Salfred * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
3474462Salfred */
3574462Salfred
3674462Salfred/*
3774462Salfred * rpc_com.h, Common definitions for both the server and client side.
3874462Salfred * All for the topmost layer of rpc
3974462Salfred *
4074462Salfred * In Sun's tirpc distribution, this was installed as <rpc/rpc_com.h>,
4174462Salfred * but as it contains only non-exported interfaces, it was moved here.
4274462Salfred */
4374462Salfred
4474462Salfred#ifndef _RPC_RPCCOM_H
4574462Salfred#define	_RPC_RPCCOM_H
4674462Salfred
4774462Salfred#include <sys/cdefs.h>
4874462Salfred
4974462Salfred/* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
5074462Salfred
5174462Salfred/*
5274462Salfred * The max size of the transport, if the size cannot be determined
5374462Salfred * by other means.
5474462Salfred */
5574462Salfred#define	RPC_MAXDATASIZE 9000
5674462Salfred#define	RPC_MAXADDRSIZE 1024
5774462Salfred
5874462Salfred#define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
5974462Salfred    (u_int32_t)(now)->tv_usec)
6074462Salfred
6174462Salfred__BEGIN_DECLS
6292905Sobrienextern u_int __rpc_get_a_size(int);
6392905Sobrienextern int __rpc_dtbsize(void);
6492905Sobrienextern struct netconfig * __rpcgettp(int);
6592905Sobrienextern  int  __rpc_get_default_domain(char **);
6674462Salfred
6792905Sobrienchar *__rpc_taddr2uaddr_af(int, const struct netbuf *);
6892905Sobrienstruct netbuf *__rpc_uaddr2taddr_af(int, const char *);
6992905Sobrienint __rpc_fixup_addr(struct netbuf *, const struct netbuf *);
7092905Sobrienint __rpc_sockinfo2netid(struct __rpc_sockinfo *, const char **);
7192905Sobrienint __rpc_seman2socktype(int);
7292905Sobrienint __rpc_socktype2seman(int);
7392905Sobrienvoid *rpc_nullproc(CLIENT *);
7492905Sobrienint __rpc_sockisbound(int);
7574462Salfred
7699997Salfredstruct netbuf *__rpcb_findaddr_timed(rpcprog_t, rpcvers_t,
7799997Salfred    const struct netconfig *, const char *host, CLIENT **clpp,
7899997Salfred    struct timeval *tp);
7999997Salfred
8092905Sobrienbool_t __rpc_control(int,void *);
8174462Salfred
8292905Sobrienchar *_get_next_token(char *, int);
8374462Salfred
84111618Snectarbool_t __svc_clean_idle(fd_set *, int, bool_t);
85111618Snectarbool_t __xdrrec_setnonblock(XDR *, int);
86111618Snectarbool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t);
87111618Snectarvoid __xprt_unregister_unlocked(SVCXPRT *);
88111618Snectar
89264196Stheravenextern SVCXPRT **__svc_xports;
90264196Stheravenextern int __svc_maxrec;
91109359Smbr
9274462Salfred__END_DECLS
9374462Salfred
9474462Salfred#endif /* _RPC_RPCCOM_H */
95