summaryrefslogtreecommitdiff
path: root/9p/srv.h
diff options
context:
space:
mode:
Diffstat (limited to '9p/srv.h')
-rw-r--r--9p/srv.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/9p/srv.h b/9p/srv.h
index f28a525..32a2e30 100644
--- a/9p/srv.h
+++ b/9p/srv.h
@@ -3,6 +3,25 @@
#include "coroutine.h"
+#define 9P_DEFAULT_PORT 564
+
+/**
+ * The default here is the same as in Plan 9 4e's lib9p. It's sized
+ * so that a Twrite message can return 8KiB of data; it uses the
+ * default (1024*8)+24 with the comment that "24" is "ample room for
+ * Twrite/Rread header (iounit)". In fact, the Twrite header is only
+ * 23 bytes ("size[4] Twrite[1] tag[2] fid[4] offset[8] count[4]") and
+ * the Rread header is even shorter at 11 bytes ("size[4] Rread[1]
+ * tag[2] count[4]"), so "24" appears to be the size of the Twrite
+ * header rounded up to a nice round number.
+ *
+ * In older versions of 9P ("9P1"), the max message size was defined
+ * as part of the protocol specification rather than negotiated. In
+ * Plan 9 1e it was (1024*8)+128, and was bumped to (1024*8)+160 in 2e
+ * and 3e.
+ */
+#define 9P_DEFAULT_MAX_MSG_SIZE ((1024*8)+24)
+
COROUTINE net9p_cr(void *);
#endif /* _NET9P_H_ */