1177633Sdfr/*	$NetBSD: pmap_prot.h,v 1.8 2000/06/02 22:57:55 fvdl Exp $	*/
2177633Sdfr
3261057Smav/*-
4261057Smav * Copyright (c) 2009, Sun Microsystems, Inc.
5261057Smav * All rights reserved.
6177633Sdfr *
7261057Smav * Redistribution and use in source and binary forms, with or without
8261057Smav * modification, are permitted provided that the following conditions are met:
9261057Smav * - Redistributions of source code must retain the above copyright notice,
10261057Smav *   this list of conditions and the following disclaimer.
11261057Smav * - Redistributions in binary form must reproduce the above copyright notice,
12261057Smav *   this list of conditions and the following disclaimer in the documentation
13261057Smav *   and/or other materials provided with the distribution.
14261057Smav * - Neither the name of Sun Microsystems, Inc. nor the names of its
15261057Smav *   contributors may be used to endorse or promote products derived
16261057Smav *   from this software without specific prior written permission.
17261057Smav *
18261057Smav * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19261057Smav * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20261057Smav * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21261057Smav * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22261057Smav * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23261057Smav * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24261057Smav * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25261057Smav * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26261057Smav * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27261057Smav * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28261057Smav * POSSIBILITY OF SUCH DAMAGE.
29177633Sdfr *
30177633Sdfr *	from: @(#)pmap_prot.h 1.14 88/02/08 SMI
31177633Sdfr *	from: @(#)pmap_prot.h	2.1 88/07/29 4.0 RPCSRC
32177633Sdfr * $FreeBSD$
33177633Sdfr */
34177633Sdfr
35177633Sdfr/*
36177633Sdfr * pmap_prot.h
37177633Sdfr * Protocol for the local binder service, or pmap.
38177633Sdfr *
39177633Sdfr * Copyright (C) 1984, Sun Microsystems, Inc.
40177633Sdfr *
41177633Sdfr * The following procedures are supported by the protocol:
42177633Sdfr *
43177633Sdfr * PMAPPROC_NULL() returns ()
44177633Sdfr * 	takes nothing, returns nothing
45177633Sdfr *
46182154Sdfr * PMAPPROC_SET(struct portmap) returns (bool_t)
47177633Sdfr * 	TRUE is success, FALSE is failure.  Registers the tuple
48177633Sdfr *	[prog, vers, prot, port].
49177633Sdfr *
50182154Sdfr * PMAPPROC_UNSET(struct portmap) returns (bool_t)
51177633Sdfr *	TRUE is success, FALSE is failure.  Un-registers pair
52177633Sdfr *	[prog, vers].  prot and port are ignored.
53177633Sdfr *
54182154Sdfr * PMAPPROC_GETPORT(struct portmap) returns (long unsigned).
55177633Sdfr *	0 is failure.  Otherwise returns the port number where the pair
56177633Sdfr *	[prog, vers] is registered.  It may lie!
57177633Sdfr *
58177633Sdfr * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
59177633Sdfr *
60177633Sdfr * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
61177633Sdfr * 	RETURNS (port, string<>);
62177633Sdfr * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
63177633Sdfr * 	Calls the procedure on the local machine.  If it is not registered,
64177633Sdfr *	this procedure is quite; ie it does not return error information!!!
65177633Sdfr *	This procedure only is supported on rpc/udp and calls via
66177633Sdfr *	rpc/udp.  This routine only passes null authentication parameters.
67177633Sdfr *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
68177633Sdfr *
69177633Sdfr * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
70177633Sdfr */
71177633Sdfr
72177633Sdfr#ifndef _RPC_PMAP_PROT_H
73177633Sdfr#define _RPC_PMAP_PROT_H
74177633Sdfr#include <sys/cdefs.h>
75177633Sdfr
76177633Sdfr#define PMAPPORT		((u_short)111)
77177633Sdfr#define PMAPPROG		((u_long)100000)
78177633Sdfr#define PMAPVERS		((u_long)2)
79177633Sdfr#define PMAPVERS_PROTO		((u_long)2)
80177633Sdfr#define PMAPVERS_ORIG		((u_long)1)
81177633Sdfr#define PMAPPROC_NULL		((u_long)0)
82177633Sdfr#define PMAPPROC_SET		((u_long)1)
83177633Sdfr#define PMAPPROC_UNSET		((u_long)2)
84177633Sdfr#define PMAPPROC_GETPORT	((u_long)3)
85177633Sdfr#define PMAPPROC_DUMP		((u_long)4)
86177633Sdfr#define PMAPPROC_CALLIT		((u_long)5)
87177633Sdfr
88182154Sdfrstruct portmap {
89177633Sdfr	long unsigned pm_prog;
90177633Sdfr	long unsigned pm_vers;
91177633Sdfr	long unsigned pm_prot;
92177633Sdfr	long unsigned pm_port;
93177633Sdfr};
94177633Sdfr
95177633Sdfrstruct pmaplist {
96182154Sdfr	struct portmap	pml_map;
97177633Sdfr	struct pmaplist *pml_next;
98177633Sdfr};
99177633Sdfr
100177633Sdfr__BEGIN_DECLS
101182154Sdfrextern bool_t xdr_portmap(XDR *, struct portmap *);
102177633Sdfrextern bool_t xdr_pmaplist(XDR *, struct pmaplist **);
103177633Sdfrextern bool_t xdr_pmaplist_ptr(XDR *, struct pmaplist *);
104177633Sdfr__END_DECLS
105177633Sdfr
106177633Sdfr#endif /* !_RPC_PMAP_PROT_H */
107