]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/network.c
libnfs.a: move more mount-only functions out of libnfs.a
[nfs-utils.git] / utils / mount / network.c
index 08b1f99f458f0baa894c98fc82bb152f2a69b028..c092571044b0c31d61cec3f7862c16a93c8f8650 100644 (file)
@@ -57,6 +57,40 @@ extern int nfs_mount_data_version;
 extern char *progname;
 extern int verbose;
 
+static const unsigned long nfs_to_mnt[] = {
+       0,
+       0,
+       1,
+       3,
+};
+
+static const unsigned long mnt_to_nfs[] = {
+       0,
+       2,
+       2,
+       3,
+};
+
+/*
+ * Map an NFS version into the corresponding Mountd version
+ */
+unsigned long nfsvers_to_mnt(const unsigned long vers)
+{
+       if (vers <= 3)
+               return nfs_to_mnt[vers];
+       return 0;
+}
+
+/*
+ * Map a Mountd version into the corresponding NFS version
+ */
+static unsigned long mntvers_to_nfs(const unsigned long vers)
+{
+       if (vers <= 3)
+               return mnt_to_nfs[vers];
+       return 0;
+}
+
 static const unsigned int probe_udp_only[] = {
        IPPROTO_UDP,
        0,