138451Smsmith/*	$NetBSD: rpc.h,v 1.8 1996/09/26 23:22:03 cgd Exp $	*/
238451Smsmith
338451Smsmith/*
438451Smsmith * Copyright (c) 1992 Regents of the University of California.
538451Smsmith * All rights reserved.
638451Smsmith *
738451Smsmith * This software was developed by the Computer Systems Engineering group
838451Smsmith * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
938451Smsmith * contributed to Berkeley.
1038451Smsmith *
1138451Smsmith * Redistribution and use in source and binary forms, with or without
1238451Smsmith * modification, are permitted provided that the following conditions
1338451Smsmith * are met:
1438451Smsmith * 1. Redistributions of source code must retain the above copyright
1538451Smsmith *    notice, this list of conditions and the following disclaimer.
1638451Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1738451Smsmith *    notice, this list of conditions and the following disclaimer in the
1838451Smsmith *    documentation and/or other materials provided with the distribution.
1938451Smsmith * 4. Neither the name of the University nor the names of its contributors
2038451Smsmith *    may be used to endorse or promote products derived from this software
2138451Smsmith *    without specific prior written permission.
2238451Smsmith *
2338451Smsmith * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2438451Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2538451Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2638451Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2738451Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2838451Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2938451Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3038451Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3138451Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3238451Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3338451Smsmith * SUCH DAMAGE.
34165906Simp *
35165906Simp * $FreeBSD$
3638451Smsmith */
3738451Smsmith
3838451Smsmith/* XXX defines we can't easily get from system includes */
3938451Smsmith#define	PMAPPORT		111
4038451Smsmith#define	PMAPPROG		100000
4138451Smsmith#define	PMAPVERS		2
4238451Smsmith#define	PMAPPROC_NULL		0
4338451Smsmith#define	PMAPPROC_SET		1
4438451Smsmith#define	PMAPPROC_UNSET		2
4538451Smsmith#define	PMAPPROC_GETPORT	3
4638451Smsmith#define	PMAPPROC_DUMP		4
4738451Smsmith#define	PMAPPROC_CALLIT		5
4838451Smsmith
4938451Smsmith/* RPC functions: */
5038451Smsmithssize_t	rpc_call(struct iodesc *, n_long, n_long, n_long,
5138451Smsmith		     void *, size_t, void *, size_t);
5238451Smsmithvoid	rpc_fromaddr(void *, struct in_addr *, u_short *);
5338451Smsmithint	rpc_pmap_getcache(struct in_addr, u_int, u_int);
5438451Smsmithvoid	rpc_pmap_putcache(struct in_addr, u_int, u_int, int);
5538451Smsmith
5638451Smsmithextern int rpc_port;	/* decrement before bind */
5738451Smsmith
5838451Smsmith/*
5938451Smsmith * How much space to leave in front of RPC requests.
6038451Smsmith * In 32-bit words (alignment) we have:
6138451Smsmith * 12: Ether + IP + UDP + padding
6238451Smsmith *  6: RPC call header
6338451Smsmith *  7: Auth UNIX
6438451Smsmith *  2: Auth NULL
6538451Smsmith */
6638451Smsmith#define	RPC_HEADER_WORDS 28
67