]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/include/conn.h
Move NFS mount code from util-linux to nfs-utils - part 2
[nfs-utils.git] / support / include / conn.h
diff --git a/support/include/conn.h b/support/include/conn.h
new file mode 100644 (file)
index 0000000..ae19a3e
--- /dev/null
@@ -0,0 +1,42 @@
+/* 
+ * conn.h -- Connection routines for NFS mount / umount code.
+ *
+ * 2006-06-06 Amit Gud <agud@redhat.com>
+ * - Moved code snippets here from util-linux/mount
+ */
+
+#ifndef _CONN_H
+#define _CONN_H
+
+#ifdef HAVE_RPCSVC_NFS_PROT_H
+#include <rpcsvc/nfs_prot.h>
+#else
+#include <linux/nfs.h>
+#define nfsstat nfs_stat
+#endif
+
+#include <rpc/pmap_prot.h>
+#include <rpc/clnt.h>
+
+#define MNT_SENDBUFSIZE ((u_int)2048)
+#define MNT_RECVBUFSIZE ((u_int)1024)
+
+typedef struct {
+       char **hostname;
+       struct sockaddr_in saddr;
+       struct pmap pmap;
+} clnt_addr_t;
+
+/* RPC call timeout values */
+static const struct timeval TIMEOUT = { 20, 0 };
+static const struct timeval RETRY_TIMEOUT = { 3, 0 };
+
+int clnt_ping(struct sockaddr_in *, const u_long, const u_long, const u_int);
+u_long nfsvers_to_mnt(const u_long);
+u_long mntvers_to_nfs(const u_long);
+int get_socket(struct sockaddr_in *, u_int, int);
+CLIENT * mnt_openclnt(clnt_addr_t *, int *);
+void mnt_closeclnt(CLIENT *, int);
+
+#endif /* _CONN_H */
+