]> git.decadent.org.uk Git - nfs-utils.git/blob - support/include/conn.h
Merge branch 'upstream'
[nfs-utils.git] / support / include / conn.h
1 /* 
2  * conn.h -- Connection routines for NFS mount / umount code.
3  *
4  * 2006-06-06 Amit Gud <agud@redhat.com>
5  * - Moved code snippets here from util-linux/mount
6  */
7
8 #ifndef _CONN_H
9 #define _CONN_H
10
11 #ifdef HAVE_RPCSVC_NFS_PROT_H
12 #include <rpcsvc/nfs_prot.h>
13 #else
14 #include <linux/nfs.h>
15 #define nfsstat nfs_stat
16 #endif
17
18 #include <rpc/pmap_prot.h>
19 #include <rpc/clnt.h>
20
21 #define MNT_SENDBUFSIZE ((u_int)2048)
22 #define MNT_RECVBUFSIZE ((u_int)1024)
23
24 typedef struct {
25         char **hostname;
26         struct sockaddr_in saddr;
27         struct pmap pmap;
28 } clnt_addr_t;
29
30 /* RPC call timeout values */
31 static const struct timeval TIMEOUT = { 20, 0 };
32 static const struct timeval RETRY_TIMEOUT = { 3, 0 };
33
34 int clnt_ping(struct sockaddr_in *, const u_long, const u_long, const u_int,
35               struct sockaddr_in *);
36 u_long nfsvers_to_mnt(const u_long);
37 u_long mntvers_to_nfs(const u_long);
38 int get_socket(struct sockaddr_in *, u_int, int);
39 CLIENT * mnt_openclnt(clnt_addr_t *, int *);
40 void mnt_closeclnt(CLIENT *, int);
41
42 #endif /* _CONN_H */
43