11.11Stsutsui/*	$NetBSD: rpc.h,v 1.11 2009/01/17 14:00:36 tsutsui Exp $	*/
21.2Scgd
31.1Sbrezak/*
41.1Sbrezak * Copyright (c) 1992 Regents of the University of California.
51.1Sbrezak * All rights reserved.
61.1Sbrezak *
71.1Sbrezak * This software was developed by the Computer Systems Engineering group
81.1Sbrezak * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
91.1Sbrezak * contributed to Berkeley.
101.1Sbrezak *
111.1Sbrezak * Redistribution and use in source and binary forms, with or without
121.1Sbrezak * modification, are permitted provided that the following conditions
131.1Sbrezak * are met:
141.1Sbrezak * 1. Redistributions of source code must retain the above copyright
151.1Sbrezak *    notice, this list of conditions and the following disclaimer.
161.1Sbrezak * 2. Redistributions in binary form must reproduce the above copyright
171.1Sbrezak *    notice, this list of conditions and the following disclaimer in the
181.1Sbrezak *    documentation and/or other materials provided with the distribution.
191.1Sbrezak * 3. All advertising materials mentioning features or use of this software
201.1Sbrezak *    must display the following acknowledgement:
211.1Sbrezak *	This product includes software developed by the University of
221.1Sbrezak *	California, Lawrence Berkeley Laboratory and its contributors.
231.1Sbrezak * 4. Neither the name of the University nor the names of its contributors
241.1Sbrezak *    may be used to endorse or promote products derived from this software
251.1Sbrezak *    without specific prior written permission.
261.1Sbrezak *
271.1Sbrezak * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
281.1Sbrezak * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
291.1Sbrezak * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
301.1Sbrezak * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
311.1Sbrezak * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
321.1Sbrezak * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
331.1Sbrezak * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
341.1Sbrezak * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
351.1Sbrezak * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
361.1Sbrezak * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
371.1Sbrezak * SUCH DAMAGE.
381.1Sbrezak */
391.1Sbrezak
401.1Sbrezak/* XXX defines we can't easily get from system includes */
411.1Sbrezak#define	PMAPPORT		111
421.1Sbrezak#define	PMAPPROG		100000
431.1Sbrezak#define	PMAPVERS		2
441.4Sgwr#define	PMAPPROC_NULL		0
451.4Sgwr#define	PMAPPROC_SET		1
461.4Sgwr#define	PMAPPROC_UNSET		2
471.1Sbrezak#define	PMAPPROC_GETPORT	3
481.4Sgwr#define	PMAPPROC_DUMP		4
491.4Sgwr#define	PMAPPROC_CALLIT		5
501.1Sbrezak
511.1Sbrezak/* RPC functions: */
521.11Stsutsuissize_t	rpc_call(struct iodesc *, n_long, n_long, n_long, void *, size_t,
531.11Stsutsui    void *, size_t);
541.11Stsutsuivoid	rpc_fromaddr(void *, struct in_addr *, u_short *);
551.11Stsutsuiint	rpc_pmap_getcache(struct in_addr, u_int, u_int);
561.11Stsutsuivoid	rpc_pmap_putcache(struct in_addr, u_int, u_int, int);
571.11Stsutsuiint	rpc_getport(struct iodesc *, n_long, n_long);
581.4Sgwr
591.4Sgwrextern int rpc_port;	/* decrement before bind */
601.4Sgwr
611.4Sgwr/*
621.4Sgwr * How much space to leave in front of RPC requests.
631.4Sgwr * In 32-bit words (alignment) we have:
641.4Sgwr * 12: Ether + IP + UDP + padding
651.4Sgwr *  6: RPC call header
661.4Sgwr *  7: Auth UNIX
671.4Sgwr *  2: Auth NULL
681.4Sgwr */
691.4Sgwr#define	RPC_HEADER_WORDS 28
70