xref: /nrf52832-nimble/rt-thread/components/dfs/filesystems/nfs/rpc/pmap.h (revision 042d53a763ad75cb1465103098bb88c245d95138)
1 /*
2  * Copyright (c) 2006-2018, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  */
9 #ifndef __RPC_PMAP_PROT_H__
10 #define __RPC_PMAP_PROT_H__
11 
12 #include <rpc/xdr.h>
13 
14 /* The following procedures are supported by the protocol:
15  *
16  * PMAPPROC_NULL() returns ()
17  * 	takes nothing, returns nothing
18  *
19  * PMAPPROC_SET(struct pmap) returns (bool_t)
20  * 	TRUE is success, FALSE is failure.  Registers the tuple
21  *	[prog, vers, prot, port].
22  *
23  * PMAPPROC_UNSET(struct pmap) returns (bool_t)
24  *	TRUE is success, FALSE is failure.  Un-registers pair
25  *	[prog, vers].  prot and port are ignored.
26  *
27  * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
28  *	0 is failure.  Otherwise returns the port number where the pair
29  *	[prog, vers] is registered.  It may lie!
30  *
31  * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
32  *
33  * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
34  * 	RETURNS (port, string<>);
35  * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
36  * 	Calls the procedure on the local machine.  If it is not registered,
37  *	this procedure is quite; ie it does not return error information!!!
38  *	This procedure only is supported on rpc/udp and calls via
39  *	rpc/udp.  This routine only passes null authentication parameters.
40  *	This file has no interface to xdr routines for PMAPPROC_CALLIT.
41  *
42  * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
43  */
44 
45 #define PMAPPORT		((unsigned short)111)
46 #define PMAPPROG		((unsigned long)100000)
47 #define PMAPVERS		((unsigned long)2)
48 #define PMAPVERS_PROTO		((unsigned long)2)
49 #define PMAPVERS_ORIG		((unsigned long)1)
50 #define PMAPPROC_NULL		((unsigned long)0)
51 #define PMAPPROC_SET		((unsigned long)1)
52 #define PMAPPROC_UNSET		((unsigned long)2)
53 #define PMAPPROC_GETPORT	((unsigned long)3)
54 #define PMAPPROC_DUMP		((unsigned long)4)
55 #define PMAPPROC_CALLIT		((unsigned long)5)
56 
57 struct pmap {
58 	long unsigned pm_prog;
59 	long unsigned pm_vers;
60 	long unsigned pm_prot;
61 	long unsigned pm_port;
62 };
63 
64 extern bool_t xdr_pmap (XDR *__xdrs, struct pmap *__regs);
65 
66 #endif
67