Skip to main content

Crate onc_rpc_client

Crate onc_rpc_client 

Source
Expand description

ONC RPC version 2 – RFC 5531, with a runtime-agnostic transport layer.

Every NFS version rides on ONC RPC. A call names a (program, version, procedure) triple and carries a credential; the reply either accepts the call and returns results, or rejects it with a reason. This crate provides that machinery once, so the per-version protocol crates only have to describe their own wire types and procedure numbers.

The portmapper (program 100000) and rpcbind v3/v4 clients have been extracted to the onc_rpcbind crate – they are a specific RPC service, not part of the RPC machinery itself.

§What a security tool needs that a filesystem client does not

Two behaviours here differ from a conventional RPC client, deliberately:

  • AUTH_SYS is unauthenticated, and this crate leans into that. The credential is a plain struct asserting a UID, GID, and group list (RFC 5531 sec. 14). Nothing signs it. RpcClient therefore allows its credential to be replaced on an established connection, so one TCP session can issue calls under many identities without re-handshaking.
  • PROG_MISMATCH preserves the server’s version range. A server rejecting a call reports the lowest and highest versions it supports. That is a free version-enumeration oracle, so RpcError::ProgMismatch carries the range rather than discarding it.

§Layout

ModuleContents
rpcRPC v2 message types and the generic RpcClient
transportThe RpcTransport seam, a direct implementation, and the tokio backend
authAUTH_SYS credentials (RFC 5531 sec. 14)

Re-exports§

pub use auth::AuthDesCred;
pub use auth::AuthDesVerf;
pub use auth::AuthFlavor;
pub use auth::AuthSys;
pub use rpc::RpcClient;
pub use transport::DirectTransport;
pub use transport::RpcTransport;

Modules§

auth
Authentication credentials – RFC 5531 sec. 8.2, 14; RFC 2695.
rpc
ONC RPC version 2 – RFC 5531 (originally RFC 1057).
transport
Async I/O abstraction and TCP connectors.

Enums§

RpcError
Error from an RPC call.