]> git.decadent.org.uk Git - nfs-utils.git/blob - support/include/nfsrpc.h
e129a72dffab062fad12f2532d03b6e0c73bd0bd
[nfs-utils.git] / support / include / nfsrpc.h
1 /*
2  * nfsrpc.h -- RPC client APIs provided by support/nfs
3  *
4  * Copyright (C) 2008 Oracle Corporation.  All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public
17  * License along with this program; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 021110-1307, USA.
20  *
21  */
22
23 #ifndef __NFS_UTILS_NFSRPC_H
24 #define __NFS_UTILS_NFSRPC_H
25
26 #include <rpc/types.h>
27
28 /*
29  * Conventional RPC program numbers
30  */
31 #ifndef RPCBPROG
32 #define RPCBPROG        ((rpcprog_t)100000)
33 #endif
34 #ifndef PMAPPROG
35 #define PMAPPROG        ((rpcprog_t)100000)
36 #endif
37
38 #ifndef NFSPROG
39 #define NFSPROG         ((rpcprog_t)100003)
40 #endif
41 #ifndef MOUNTPROG
42 #define MOUNTPROG       ((rpcprog_t)100005)
43 #endif
44 #ifndef NLMPROG
45 #define NLMPROG         ((rpcprog_t)100021)
46 #endif
47 #ifndef NSMPROG
48 #define NSMPROG         ((rpcprog_t)100024)
49 #endif
50
51 /*
52  * Look up an RPC program name in /etc/rpc
53  */
54 extern rpcprog_t        nfs_getrpcbyname(const rpcprog_t, const char *table[]);
55
56 /*
57  * Look up a port number in /etc/services for an RPC program
58  */
59 extern unsigned short   nfs_getportbynumber(const rpcprog_t program,
60                                 const unsigned short transport);
61
62 /*
63  * Acquire an RPC CLIENT *
64  */
65 extern CLIENT           *nfs_get_rpcclient(const struct sockaddr *,
66                                 const socklen_t, const unsigned short,
67                                 const rpcprog_t, const rpcvers_t,
68                                 struct timeval *);
69
70 #endif  /* __NFS_UTILS_NFSRPC_H */