Expand description
9P2000.L message types and wire format serialization.
Minimal implementation — only the message types needed for a 9P client to walk, open, read, write, readdir, stat, and clunk.
Wire format: all little-endian, length-prefixed.
[4 bytes: total size including this field]
[1 byte: message type]
[2 bytes: tag]
[... type-specific fields ...]Structs§
- DirEntry
P9 - A parsed directory entry from Rreaddir data.
- Qid
- Readdir
Entry - One directory entry to encode into an Rreaddir payload.
Enums§
Constants§
- RATTACH
- RCLUNK
- RFLUSH
- RGETATTR
- RLERROR
- RLOPEN
- RREAD
- RREADDIR
- RVERSION
- RWALK
- RWRITE
- TATTACH
- TCLUNK
- TFLUSH
- 9P2000.L Tflush — not exercised by the client codec but defined for symmetry.
- TGETATTR
- TLOPEN
- TREAD
- TREADDIR
- TVERSION
- TWALK
- TWRITE
Functions§
- encode_
readdir_ page - Encode a directory listing as a page of standard 9P2000.L Rreaddir dirent records with cookie-based paging.
- encode_
response - Serialize an R-message (including length prefix) from a
Response. - encode_
tmessage - Serialize a T-message to wire format (including length prefix).
- parse_
readdir_ entries - Parse Rreaddir data into directory entries.
- parse_
request - Parse a T-message from wire bytes (including length prefix).
- parse_
response - Parse an R-message from wire bytes (including length prefix).
- rattach
- rclunk
- rflush
- rgetattr
- Encode an Rgetattr. Only the fields carried by
Response::Getattrare populated; the rest are zero (matches the subset the client decoder reads). - rlerror
- rlopen
- rread
- rreaddir
- Encode an Rreaddir. Body is
count[4] · data[count](identical framing torread) but the message type is RREADDIR (41).datamust already be a packed run of standard dirent records — build it withencode_readdir_page. - rversion
- rwalk
- rwrite
- tattach
- tclunk
- tgetattr
- tlopen
- tread
- treaddir
- tversion
- twalk
- twrite