X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnetwork.c;h=c092571044b0c31d61cec3f7862c16a93c8f8650;hp=08b1f99f458f0baa894c98fc82bb152f2a69b028;hb=b6e4ddd10b3c67ef210e572dec956cb35ce96440;hpb=3eb619857b2f2fe896877c903a2c2eb28b632945 diff --git a/utils/mount/network.c b/utils/mount/network.c index 08b1f99..c092571 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -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,