diff options
Diffstat (limited to '9p/srv.h')
-rw-r--r-- | 9p/srv.h | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -3,25 +3,14 @@ #include "coroutine.h" -#define 9P_DEFAULT_PORT 564 +struct p9_srvreq; -/** - * 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) +struct p9_srv { + int sockfd; + cr_chan_t(p9_srvreq *) reqch; +}; -COROUTINE net9p_cr(void *); +COROUTINE p9_srv_read_cr(void *_srv); +COROUTINE p9_srv_write_cr(void *_srv); #endif /* _NET9P_H_ */ |