9P2000: give a name to NinepMsgType to ease debug

This commit is contained in:
Giacomo Tesio 2016-12-24 21:25:05 +01:00
parent c30fb72b82
commit 0c094289e6
1 changed files with 35 additions and 34 deletions

View File

@ -25,10 +25,44 @@
/* bits that must be zero in open/create mode */ /* bits that must be zero in open/create mode */
#define NP_OZEROES ~(NP_OREAD|NP_OWRITE|NP_ORDWR|NP_OEXEC|NP_OTRUNC|NP_ORCLOSE) #define NP_OZEROES ~(NP_OREAD|NP_OWRITE|NP_ORDWR|NP_OEXEC|NP_OTRUNC|NP_ORCLOSE)
typedef enum NinepMsgType
{
Tversion = 100,
Rversion,
Tauth = 102,
Rauth,
Tattach = 104,
Rattach,
Terror = 106, /* illegal */
Rerror,
Tflush = 108,
Rflush,
Twalk = 110,
Rwalk,
Topen = 112,
Ropen,
Tcreate = 114,
Rcreate,
Tread = 116,
Rread,
Twrite = 118,
Rwrite,
Tclunk = 120,
Rclunk,
Tremove = 122,
Rremove,
Tstat = 124,
Rstat,
Twstat = 126,
Rwstat,
Tmax,
} NinepMsgType;
typedef typedef
struct Fcall struct Fcall
{ {
uint8_t type; NinepMsgType type : 8;
uint32_t fid; uint32_t fid;
uint16_t tag; uint16_t tag;
union { union {
@ -107,39 +141,6 @@ struct Fcall
#define NOFID (uint32_t)~0U /* Dummy fid */ #define NOFID (uint32_t)~0U /* Dummy fid */
#define IOHDRSZ 24 /* ample room for Twrite/Rread header (iounit) */ #define IOHDRSZ 24 /* ample room for Twrite/Rread header (iounit) */
enum
{
Tversion = 100,
Rversion,
Tauth = 102,
Rauth,
Tattach = 104,
Rattach,
Terror = 106, /* illegal */
Rerror,
Tflush = 108,
Rflush,
Twalk = 110,
Rwalk,
Topen = 112,
Ropen,
Tcreate = 114,
Rcreate,
Tread = 116,
Rread,
Twrite = 118,
Rwrite,
Tclunk = 120,
Rclunk,
Tremove = 122,
Rremove,
Tstat = 124,
Rstat,
Twstat = 126,
Rwstat,
Tmax,
};
extern unsigned int convM2S(uint8_t*, uint, Fcall*); extern unsigned int convM2S(uint8_t*, uint, Fcall*);
extern unsigned int convS2M(Fcall*, uint8_t*, uint); extern unsigned int convS2M(Fcall*, uint8_t*, uint);
extern unsigned int sizeS2M(Fcall*); extern unsigned int sizeS2M(Fcall*);