ONC RPC v2 call and reply envelopes — RFC 5531 §9.
An RPC message is one of:
msg_type CALL = 0
msg_type REPLY = 1Calls carry the program/version/procedure to invoke and the caller's credentials; replies carry an outcome (accepted vs. denied) and either the procedure's result body or a status code.
This module decodes incoming wire bytes into the structs below and encodes outgoing replies back to wire bytes. The procedure-specific argument and result bodies are NOT decoded here — they're left as binaries for the program-specific handler to parse.
Summary
Functions
Decode an RPC call message. Returns {:ok, call} on success.
Encode a reply (accepted or denied) to wire bytes.
Numeric RPC version this server implements (always 2).
Quick predicate — is the message version this server speaks?
Types
@type reply() :: Tahr.RPC.Message.AcceptedReply.t() | Tahr.RPC.Message.DeniedReply.t()
Decoded reply, of either accepted or denied flavour.
Functions
@spec decode_call(binary()) :: {:ok, Tahr.RPC.Message.Call.t()} | {:error, term()}
Decode an RPC call message. Returns {:ok, call} on success.
This is the only message type a server expects to receive; replies
are produced via encode_reply/1.
Encode a reply (accepted or denied) to wire bytes.
Returns iodata so a streaming procedure body (e.g. NFSv3 READ
chunks) can flow through to :gen_tcp.send/2 without flattening.
Pass through RPC.RecordMarking.encode/1 before writing to the
socket.
@spec rpc_version() :: 2
Numeric RPC version this server implements (always 2).
@spec rpc_version_ok?(Tahr.RPC.Message.Call.t()) :: boolean()
Quick predicate — is the message version this server speaks?