xref: /minix3/sys/lib/libsa/rpc.h (revision 58a2b0008e28f606a7f7f5faaeaba4faac57a1ea)
1*58a2b000SEvgeniy Ivanov /*	$NetBSD: rpc.h,v 1.11 2009/01/17 14:00:36 tsutsui Exp $	*/
2*58a2b000SEvgeniy Ivanov 
3*58a2b000SEvgeniy Ivanov /*
4*58a2b000SEvgeniy Ivanov  * Copyright (c) 1992 Regents of the University of California.
5*58a2b000SEvgeniy Ivanov  * All rights reserved.
6*58a2b000SEvgeniy Ivanov  *
7*58a2b000SEvgeniy Ivanov  * This software was developed by the Computer Systems Engineering group
8*58a2b000SEvgeniy Ivanov  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
9*58a2b000SEvgeniy Ivanov  * contributed to Berkeley.
10*58a2b000SEvgeniy Ivanov  *
11*58a2b000SEvgeniy Ivanov  * Redistribution and use in source and binary forms, with or without
12*58a2b000SEvgeniy Ivanov  * modification, are permitted provided that the following conditions
13*58a2b000SEvgeniy Ivanov  * are met:
14*58a2b000SEvgeniy Ivanov  * 1. Redistributions of source code must retain the above copyright
15*58a2b000SEvgeniy Ivanov  *    notice, this list of conditions and the following disclaimer.
16*58a2b000SEvgeniy Ivanov  * 2. Redistributions in binary form must reproduce the above copyright
17*58a2b000SEvgeniy Ivanov  *    notice, this list of conditions and the following disclaimer in the
18*58a2b000SEvgeniy Ivanov  *    documentation and/or other materials provided with the distribution.
19*58a2b000SEvgeniy Ivanov  * 3. All advertising materials mentioning features or use of this software
20*58a2b000SEvgeniy Ivanov  *    must display the following acknowledgement:
21*58a2b000SEvgeniy Ivanov  *	This product includes software developed by the University of
22*58a2b000SEvgeniy Ivanov  *	California, Lawrence Berkeley Laboratory and its contributors.
23*58a2b000SEvgeniy Ivanov  * 4. Neither the name of the University nor the names of its contributors
24*58a2b000SEvgeniy Ivanov  *    may be used to endorse or promote products derived from this software
25*58a2b000SEvgeniy Ivanov  *    without specific prior written permission.
26*58a2b000SEvgeniy Ivanov  *
27*58a2b000SEvgeniy Ivanov  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28*58a2b000SEvgeniy Ivanov  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29*58a2b000SEvgeniy Ivanov  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30*58a2b000SEvgeniy Ivanov  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31*58a2b000SEvgeniy Ivanov  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32*58a2b000SEvgeniy Ivanov  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33*58a2b000SEvgeniy Ivanov  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34*58a2b000SEvgeniy Ivanov  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35*58a2b000SEvgeniy Ivanov  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36*58a2b000SEvgeniy Ivanov  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37*58a2b000SEvgeniy Ivanov  * SUCH DAMAGE.
38*58a2b000SEvgeniy Ivanov  */
39*58a2b000SEvgeniy Ivanov 
40*58a2b000SEvgeniy Ivanov /* XXX defines we can't easily get from system includes */
41*58a2b000SEvgeniy Ivanov #define	PMAPPORT		111
42*58a2b000SEvgeniy Ivanov #define	PMAPPROG		100000
43*58a2b000SEvgeniy Ivanov #define	PMAPVERS		2
44*58a2b000SEvgeniy Ivanov #define	PMAPPROC_NULL		0
45*58a2b000SEvgeniy Ivanov #define	PMAPPROC_SET		1
46*58a2b000SEvgeniy Ivanov #define	PMAPPROC_UNSET		2
47*58a2b000SEvgeniy Ivanov #define	PMAPPROC_GETPORT	3
48*58a2b000SEvgeniy Ivanov #define	PMAPPROC_DUMP		4
49*58a2b000SEvgeniy Ivanov #define	PMAPPROC_CALLIT		5
50*58a2b000SEvgeniy Ivanov 
51*58a2b000SEvgeniy Ivanov /* RPC functions: */
52*58a2b000SEvgeniy Ivanov ssize_t	rpc_call(struct iodesc *, n_long, n_long, n_long, void *, size_t,
53*58a2b000SEvgeniy Ivanov     void *, size_t);
54*58a2b000SEvgeniy Ivanov void	rpc_fromaddr(void *, struct in_addr *, u_short *);
55*58a2b000SEvgeniy Ivanov int	rpc_pmap_getcache(struct in_addr, u_int, u_int);
56*58a2b000SEvgeniy Ivanov void	rpc_pmap_putcache(struct in_addr, u_int, u_int, int);
57*58a2b000SEvgeniy Ivanov int	rpc_getport(struct iodesc *, n_long, n_long);
58*58a2b000SEvgeniy Ivanov 
59*58a2b000SEvgeniy Ivanov extern int rpc_port;	/* decrement before bind */
60*58a2b000SEvgeniy Ivanov 
61*58a2b000SEvgeniy Ivanov /*
62*58a2b000SEvgeniy Ivanov  * How much space to leave in front of RPC requests.
63*58a2b000SEvgeniy Ivanov  * In 32-bit words (alignment) we have:
64*58a2b000SEvgeniy Ivanov  * 12: Ether + IP + UDP + padding
65*58a2b000SEvgeniy Ivanov  *  6: RPC call header
66*58a2b000SEvgeniy Ivanov  *  7: Auth UNIX
67*58a2b000SEvgeniy Ivanov  *  2: Auth NULL
68*58a2b000SEvgeniy Ivanov  */
69*58a2b000SEvgeniy Ivanov #define	RPC_HEADER_WORDS 28
70