Expand description
Constructs NFSv4.2 compound RPC payloads and parses server replies.
Implements the minimal ONC RPC + NFSv4.2 wire format needed for atomic file creation via compound operations.
Structs§
- Compound
Reply - Parsed NFSv4.2 compound reply.
- OpResult
- Parsed result of a single operation in a compound reply.
- RpcMessage
- An RPC message separated from transport framing.
- StateId
- Represents an NFSv4 state identifier (returned by OPEN, used by WRITE/SETATTR/CLOSE).
Enums§
- Nfs4Op
- A single NFSv4.2 compound operation.
- Write
Stable - Write stability level.
Constants§
- AUTH_
NONE - ONC RPC AUTH_NONE authentication flavor (no credentials).
- AUTH_
RPCSEC_ GSS - ONC RPC RPCSEC_GSS authentication flavor (RFC 2203).
- AUTH_
SYS - ONC RPC AUTH_SYS authentication flavor (Unix uid/gid credentials).
- AUTH_
TLS - ONC RPC AUTH_TLS authentication flavor (RFC 9289 S4.1).
- CLAIM_
NULL - OPEN claim type: open by filename in the current directory.
- CREATEMOD
E4_ UNCHECKED - Create mode: unchecked (overwrite existing attributes).
- DATA_
SYNC4 - Write stability: data flushed to stable storage, metadata may be cached.
- FATT
R4_ MODE - FATTR4 bitmap position for file mode/permissions (bit 33, word 1).
- FATT
R4_ OWNER - FATTR4 bitmap position for file owner (bit 36, word 1).
- FATT
R4_ OWNER_ GROUP - FATTR4 bitmap position for file owner group (bit 37, word 1).
- FATT
R4_ SIZE - FATTR4 bitmap position for file size (bit 4, word 0).
- FATT
R4_ TIME_ MODIFY - FATTR4 bitmap position for modification time (bit 53, word 1).
- FATT
R4_ TIME_ MODIFY_ SET - FATTR4 bitmap position for settable modification time (bit 52, word 1).
- FILE_
SYNC4 - Write stability: data and metadata flushed to stable storage.
- MSG_
ACCEPTED - RPC reply status: message accepted by the server.
- NFS4ERR_
ACCESS - NFS4 error: permission denied.
- NFS4ERR_
BADSEQ - NFS4 error: bad sequence ID in a stateful operation.
- NFS4ERR_
BADSESSION - NFS4 error: session ID is invalid or expired.
- NFS4ERR_
BAD_ STATEID - NFS4 error: bad stateid (expired or wrong open).
- NFS4ERR_
DELAY - NFS4 error: server is busy, client should retry.
- NFS4ERR_
EXIST - NFS4 error: file already exists.
- NFS4ERR_
FBIG - NFS4 error: file too large.
- NFS4ERR_
INVAL - NFS4 error: invalid argument (e.g. bad attribute value, nseconds out of range).
- NFS4ERR_
ISDIR - NFS4 error: is a directory (write to directory attempted).
- NFS4ERR_
NAMETOOLONG - NFS4 error: filename too long.
- NFS4ERR_
NOENT - NFS4 error: file or directory not found.
- NFS4ERR_
NOSPC - NFS4 error: no space on device.
- NFS4ERR_
NOTDIR - NFS4 error: not a directory.
- NFS4ERR_
NOTEMPTY - NFS4 error: directory not empty.
- NFS4ERR_
ROFS - NFS4 error: read-only filesystem.
- NFS4ERR_
SEQ_ MISORDERED - NFS4 error: sequence operations arrived out of order.
- NFS4ERR_
STALE - NFS4 error: stale filehandle (target was deleted or renamed).
- NFS4_OK
- NFS4 status: operation succeeded.
- NFSPRO
C4_ COMPOUND - NFS procedure number for COMPOUND (batched operations).
- NFSPRO
C4_ NULL - NFS procedure number for NULL (liveness probe).
- NFS_
PROGRAM - ONC RPC program number for NFS.
- NFS_V4
- NFS protocol major version (4).
- OPEN4_
CREATE - OPEN type: create the file if it doesn’t exist.
- OPEN4_
NOCREATE - OPEN type: fail if the file doesn’t exist.
- OPEN4_
SHARE_ ACCESS_ BOTH - OPEN share access: read and write.
- OPEN4_
SHARE_ ACCESS_ READ - OPEN share access: read only.
- OPEN4_
SHARE_ ACCESS_ WRITE - OPEN share access: write only.
- OPEN4_
SHARE_ DENY_ NONE - OPEN share deny: no deny (allow concurrent access).
- OP_
CLOSE - NFSv4 CLOSE operation code: release an open stateid (RFC 8881 S18.2).
- OP_
CREATE_ SESSION - NFSv4.1 CREATE_SESSION operation code: create a session (RFC 8881 S18.36).
- OP_
DESTROY_ SESSION - NFSv4.1 DESTROY_SESSION operation code: tear down a session (RFC 8881 S18.37).
- OP_
EXCHANGE_ ID - NFSv4.1 EXCHANGE_ID operation code: establish client identity (RFC 8881 S18.35).
- OP_
GETATTR - NFSv4 GETATTR operation code: retrieve file attributes (RFC 8881 S18.7).
- OP_
GETFH - NFSv4 GETFH operation code: retrieve the current filehandle (RFC 8881 S18.8).
- OP_
LOOKUP - NFSv4 LOOKUP operation code: look up a name in a directory (RFC 8881 S18.13).
- OP_OPEN
- NFSv4 OPEN operation code: open or create a file (RFC 8881 S18.16).
- OP_
PUTFH - NFSv4 PUTFH operation code: set the current filehandle (RFC 8881 S18.19).
- OP_
PUTROOTFH - NFSv4 PUTROOTFH operation code: set the current filehandle to the root (RFC 8881 S18.20).
- OP_READ
- NFSv4 READ operation code: read data from a file (RFC 7530 S16.23).
- OP_
RECLAIM_ COMPLETE - NFSv4.1 RECLAIM_COMPLETE operation code: end grace period (RFC 8881 S18.51).
- OP_
SEQUENCE - NFSv4.2 SEQUENCE operation code (RFC 8881 S18.46).
- OP_
SETATTR - NFSv4 SETATTR operation code: set file attributes (RFC 8881 S18.30).
- OP_
WRITE - NFSv4 WRITE operation code: write data to a file (RFC 8881 S18.32).
- RPCSEC_
GSS_ DATA - RPCSEC_GSS procedure: data exchange (after context established).
- RPCSEC_
GSS_ VERSION - RPCSEC_GSS protocol version.
- RPC_
VERSION - ONC RPC protocol version (always 2).
- SUCCESS
- RPC accept status: procedure executed successfully.
- UNSTABL
E4 - Write stability: server may cache, no durability guarantee.
Functions§
- build_
auth_ tls_ probe - Build an AUTH_TLS probe (RFC 9289 S4.1) to detect RPC-over-TLS support.
- build_
compound - Build an NFSv4.2 COMPOUND RPC call body (XDR, no record mark).
- build_
null_ call - Build a minimal NFS NULL RPC call (zero-overhead server liveness check).
- frame_
rpc_ message - Prepend a TCP record mark to an XDR body.
- nfs4_
error_ name - Get the human-readable name for an NFS4 error code.
- parse_
auth_ tls_ reply - Parse an ONC RPC reply to an AUTH_TLS probe (RFC 9289 S4.1).
- parse_
compound_ reply - Parse a compound reply, extracting status codes and the OPEN stateid.