174462Salfred/*	$NetBSD: rpc_com.h,v 1.3 2000/12/10 04:10:08 christos Exp $	*/
274462Salfred/*	$FreeBSD$ */
374462Salfred
4258578Shrs/*-
5258578Shrs * Copyright (c) 2009, Sun Microsystems, Inc.
6258578Shrs * All rights reserved.
7258578Shrs *
8258578Shrs * Redistribution and use in source and binary forms, with or without
9258578Shrs * modification, are permitted provided that the following conditions are met:
10258578Shrs * - Redistributions of source code must retain the above copyright notice,
11258578Shrs *   this list of conditions and the following disclaimer.
12258578Shrs * - Redistributions in binary form must reproduce the above copyright notice,
13258578Shrs *   this list of conditions and the following disclaimer in the documentation
14258578Shrs *   and/or other materials provided with the distribution.
15258578Shrs * - Neither the name of Sun Microsystems, Inc. nor the names of its
16258578Shrs *   contributors may be used to endorse or promote products derived
17258578Shrs *   from this software without specific prior written permission.
18258578Shrs *
19258578Shrs * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20258578Shrs * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21258578Shrs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22258578Shrs * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23258578Shrs * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24258578Shrs * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25258578Shrs * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26258578Shrs * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27258578Shrs * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28258578Shrs * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29258578Shrs * POSSIBILITY OF SUCH DAMAGE.
3026209Swpaul */
3126209Swpaul/*
3226209Swpaul * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
3326209Swpaul */
3426209Swpaul
3526209Swpaul/*
3626209Swpaul * rpc_com.h, Common definitions for both the server and client side.
3726209Swpaul * All for the topmost layer of rpc
3826209Swpaul *
3926209Swpaul */
4026209Swpaul
4126209Swpaul#ifndef _RPC_RPCCOM_H
4226209Swpaul#define	_RPC_RPCCOM_H
4326209Swpaul
4474462Salfred#include <sys/cdefs.h>
4526209Swpaul
46240062Spfg/* #pragma ident	"@(#)rpc_com.h	1.11	93/07/05 SMI" */
4726209Swpaul
4826209Swpaul/*
4926209Swpaul * The max size of the transport, if the size cannot be determined
5026209Swpaul * by other means.
5126209Swpaul */
5226209Swpaul#define	RPC_MAXDATASIZE 9000
5326209Swpaul#define	RPC_MAXADDRSIZE 1024
5426209Swpaul
5574462Salfred#define __RPC_GETXID(now) ((u_int32_t)getpid() ^ (u_int32_t)(now)->tv_sec ^ \
5674462Salfred    (u_int32_t)(now)->tv_usec)
5726209Swpaul
5874462Salfred__BEGIN_DECLS
5993032Simpextern u_int __rpc_get_a_size(int);
6093032Simpextern int __rpc_dtbsize(void);
6193032Simpextern int _rpc_dtablesize(void);
6293032Simpextern struct netconfig * __rpcgettp(int);
6393032Simpextern  int  __rpc_get_default_domain(char **);
6426209Swpaul
6593032Simpchar *__rpc_taddr2uaddr_af(int, const struct netbuf *);
6693032Simpstruct netbuf *__rpc_uaddr2taddr_af(int, const char *);
6793032Simpint __rpc_fixup_addr(struct netbuf *, const struct netbuf *);
6893032Simpint __rpc_sockinfo2netid(struct __rpc_sockinfo *, const char **);
6993032Simpint __rpc_seman2socktype(int);
7093032Simpint __rpc_socktype2seman(int);
7193032Simpvoid *rpc_nullproc(CLIENT *);
7293032Simpint __rpc_sockisbound(int);
7374462Salfred
7493032Simpstruct netbuf *__rpcb_findaddr(rpcprog_t, rpcvers_t, const struct netconfig *,
7593032Simp			       const char *, CLIENT **);
76109359Smbrbool_t rpc_control(int,void *);
7774462Salfred
7893032Simpchar *_get_next_token(char *, int);
7974462Salfred
8074462Salfred__END_DECLS
8174462Salfred
8226209Swpaul#endif /* _RPC_RPCCOM_H */
83