PatchworkOS
19e446b
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
9p.h
Go to the documentation of this file.
1
#ifndef _SYS_9P_H
2
#define _SYS_9P_H 1
3
4
#include <
sys/defs.h
>
5
6
/**
7
* @brief 9P Protocol.
8
* @ingroup libstd
9
* @defgroup libstd_sys_9p 9P Protocol
10
*
11
* The `sys/9p.h` header provides definitions for the 9P protocol, a distributed file system protocol developed by Bell
12
* Labs.
13
*
14
* ## Messages
15
*
16
* Message types prefixed with 'T' are client-to-server messages, while those prefixed with 'R' are server-to-client
17
* messages and are usually in response to a 'T' message. The client is the entity initiating requests, and the server
18
* is the entity responding to those requests.
19
*
20
* All messages follow the format `size[4] type[1] tag[2] ...` where `size` is the total size of the message in bytes
21
* (including the size field itself), `type` is one of the message types defined in `ninep_msg_type_t`, and `tag` is a
22
* identifier used to match requests and responses.
23
*
24
* @note The values specified within square brackets indicate the size of each field in bytes and all multi-byte fields
25
* are encoded in little-endian format.
26
*
27
* @see http://rfc.nop.hu/plan9/rfc9p.pdf for the 9P protocol specification.
28
*
29
* @{
30
*/
31
32
/**
33
* @brief 9P message types.
34
*/
35
typedef
enum
36
{
37
Tversion
= 100,
38
Rversion
= 101,
39
Tauth
= 102,
40
Rauth
= 103,
41
Tattach
= 104,
42
Rattach
= 105,
43
Terror
= 106,
44
Rerror
= 107,
45
Tflush
= 108,
46
Rflush
= 109,
47
Twalk
= 110,
48
Rwalk
= 111,
49
Topen
= 112,
50
Ropen
= 113,
51
Tcreate
= 114,
52
Rcreate
= 115,
53
Tread
= 116,
54
Rread
= 117,
55
Twrite
= 118,
56
Rwrite
= 119,
57
Tclunk
= 120,
58
Rclunk
= 121,
59
Tremove
= 122,
60
Rremove
= 123,
61
Tstat
= 124,
62
Rstat
= 125,
63
Twstat
= 126,
64
Rwstat
= 127,
65
Tmax
,
66
}
ninep_msg_type_t
;
67
68
/** @} */
69
70
#endif
defs.h
ninep_msg_type_t
ninep_msg_type_t
9P message types.
Definition
9p.h:36
Tread
@ Tread
Definition
9p.h:53
Tauth
@ Tauth
Definition
9p.h:39
Topen
@ Topen
Definition
9p.h:49
Tcreate
@ Tcreate
Definition
9p.h:51
Rwstat
@ Rwstat
Definition
9p.h:64
Tattach
@ Tattach
Definition
9p.h:41
Twstat
@ Twstat
Definition
9p.h:63
Twrite
@ Twrite
Definition
9p.h:55
Ropen
@ Ropen
Definition
9p.h:50
Tclunk
@ Tclunk
Definition
9p.h:57
Rauth
@ Rauth
Definition
9p.h:40
Rstat
@ Rstat
Definition
9p.h:62
Tmax
@ Tmax
Definition
9p.h:65
Rwrite
@ Rwrite
Definition
9p.h:56
Tstat
@ Tstat
Definition
9p.h:61
Rread
@ Rread
Definition
9p.h:54
Rattach
@ Rattach
Definition
9p.h:42
Twalk
@ Twalk
Definition
9p.h:47
Rwalk
@ Rwalk
Definition
9p.h:48
Rcreate
@ Rcreate
Definition
9p.h:52
Rerror
@ Rerror
Definition
9p.h:44
Rflush
@ Rflush
Definition
9p.h:46
Tflush
@ Tflush
Definition
9p.h:45
Rclunk
@ Rclunk
Definition
9p.h:58
Rversion
@ Rversion
Definition
9p.h:38
Tremove
@ Tremove
Definition
9p.h:59
Terror
@ Terror
Definition
9p.h:43
Tversion
@ Tversion
Definition
9p.h:37
Rremove
@ Rremove
Definition
9p.h:60
include
sys
9p.h
Generated on Sat Jan 24 2026 10:59:24 for PatchworkOS by
1.9.8