PatchworkOS  19e446b
A non-POSIX operating system.
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 */
35typedef 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,
67
68/** @} */
69
70#endif
ninep_msg_type_t
9P message types.
Definition 9p.h:36
@ Tread
Definition 9p.h:53
@ Tauth
Definition 9p.h:39
@ Topen
Definition 9p.h:49
@ Tcreate
Definition 9p.h:51
@ Rwstat
Definition 9p.h:64
@ Tattach
Definition 9p.h:41
@ Twstat
Definition 9p.h:63
@ Twrite
Definition 9p.h:55
@ Ropen
Definition 9p.h:50
@ Tclunk
Definition 9p.h:57
@ Rauth
Definition 9p.h:40
@ Rstat
Definition 9p.h:62
@ Tmax
Definition 9p.h:65
@ Rwrite
Definition 9p.h:56
@ Tstat
Definition 9p.h:61
@ Rread
Definition 9p.h:54
@ Rattach
Definition 9p.h:42
@ Twalk
Definition 9p.h:47
@ Rwalk
Definition 9p.h:48
@ Rcreate
Definition 9p.h:52
@ Rerror
Definition 9p.h:44
@ Rflush
Definition 9p.h:46
@ Tflush
Definition 9p.h:45
@ Rclunk
Definition 9p.h:58
@ Rversion
Definition 9p.h:38
@ Tremove
Definition 9p.h:59
@ Terror
Definition 9p.h:43
@ Tversion
Definition 9p.h:37
@ Rremove
Definition 9p.h:60