nfs_v2/lib.rs
1//! NFS version 2 -- [RFC 1094].
2//!
3//! All 18 procedures. The version is long obsolete and still enabled on plenty
4//! of servers, which is exactly why it matters: it is the weakest of the three
5//! by a wide margin.
6//!
7//! * **No security negotiation at all** ([RFC 2623] sec. 2.7). The server
8//! cannot advertise, and the client cannot request, anything beyond AUTH_SYS.
9//! * **No `ACCESS` procedure.** NFSv3 added it so a client could ask what it
10//! would be permitted to do; under v2 a client simply tries the operation.
11//! * **Fixed 32-byte file handles** with no length prefix (`FHSIZE = 32`,
12//! RFC 1094 sec. 2.3.3), unlike NFSv3's variable-length handle. That changes
13//! the XDR encoding, which is why these types cannot share NFSv3's.
14//!
15//! Some servers apply `root_squash` on their v3 path but not their v2 path, so
16//! where both are offered v2 is worth probing first.
17//!
18//! [RFC 1094]: https://www.rfc-editor.org/rfc/rfc1094
19//! [RFC 2623]: https://www.rfc-editor.org/rfc/rfc2623
20
21mod client;
22pub mod raw;
23pub mod wire;
24
25pub use client::{Nfs2Client, Nfs2Error};
26pub use raw::Nfs2RawClient;
27pub use wire::{NFS_PROGRAM as PROGRAM, NFS_VERSION as VERSION, Nfs2FileAttr, Nfs2FileHandle, Nfs2SetAttr, Nfs2Stat};
28
29/// Re-export the MOUNT client from `nfswolf-mount` for backward compatibility.
30///
31/// `MountV1Client<T>` is `MountClient<T>` configured for MOUNT v1.
32/// Callers that used `nfs_v2::MountV1Client` can keep that path;
33/// new code should use `nfs_mount::MountClient` directly.
34pub type MountV1Client<T> = nfs_mount::MountClient<T>;