From d559c50a98e65ce889411b46ab108b392907e0f0 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Tue, 24 Sep 2024 09:51:37 -0600 Subject: wip 9p --- 9p/srv.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to '9p/srv.h') 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_ */ -- cgit v1.2.3-2-g168b