9p1.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #include <authsrv.h>
  2. enum {
  3. DIRREC = 116, /* size of a directory ascii record */
  4. ERRREC = 64, /* size of a error record */
  5. };
  6. typedef struct Fcall Fcall;
  7. struct Fcall
  8. {
  9. char type;
  10. ushort fid;
  11. short err;
  12. short tag;
  13. union
  14. {
  15. struct
  16. {
  17. short uid; /* T-Userstr [obs.] */
  18. short oldtag; /* T-nFlush */
  19. Qid9p1 qid; /* R-Attach, R-Clwalk, R-Walk,
  20. * R-Open, R-Create */
  21. char rauth[AUTHENTLEN]; /* R-attach */
  22. };
  23. struct
  24. {
  25. char uname[NAMELEN]; /* T-nAttach */
  26. char aname[NAMELEN]; /* T-nAttach */
  27. char ticket[TICKETLEN]; /* T-attach */
  28. char auth[AUTHENTLEN]; /* T-attach */
  29. };
  30. struct
  31. {
  32. char ename[ERRREC]; /* R-nError */
  33. char chal[CHALLEN]; /* T-session, R-session */
  34. char authid[NAMELEN]; /* R-session */
  35. char authdom[DOMLEN]; /* R-session */
  36. };
  37. struct
  38. {
  39. char name[NAMELEN]; /* T-Walk, T-Clwalk, T-Create, T-Remove */
  40. long perm; /* T-Create */
  41. ushort newfid; /* T-Clone, T-Clwalk */
  42. char mode; /* T-Create, T-Open */
  43. };
  44. struct
  45. {
  46. Off offset; /* T-Read, T-Write */
  47. long count; /* T-Read, T-Write, R-Read */
  48. char* data; /* T-Write, R-Read */
  49. };
  50. struct
  51. {
  52. char stat[DIRREC]; /* T-Wstat, R-Stat */
  53. };
  54. };
  55. };
  56. /*
  57. * P9 protocol message types
  58. */
  59. enum
  60. {
  61. Tnop = 50,
  62. Rnop,
  63. Tosession = 52,
  64. Rosession,
  65. Terror = 54, /* illegal */
  66. Rerror,
  67. Tflush = 56,
  68. Rflush,
  69. Toattach = 58,
  70. Roattach,
  71. Tclone = 60,
  72. Rclone,
  73. Twalk = 62,
  74. Rwalk,
  75. Topen = 64,
  76. Ropen,
  77. Tcreate = 66,
  78. Rcreate,
  79. Tread = 68,
  80. Rread,
  81. Twrite = 70,
  82. Rwrite,
  83. Tclunk = 72,
  84. Rclunk,
  85. Tremove = 74,
  86. Rremove,
  87. Tstat = 76,
  88. Rstat,
  89. Twstat = 78,
  90. Rwstat,
  91. Tclwalk = 80,
  92. Rclwalk,
  93. Tauth = 82, /* illegal */
  94. Rauth, /* illegal */
  95. Tsession = 84,
  96. Rsession,
  97. Tattach = 86,
  98. Rattach,
  99. MAXSYSCALL
  100. };
  101. int convA2M9p1(Authenticator*, char*, char*);
  102. void convM2A9p1(char*, Authenticator*, char*);
  103. void convM2T9p1(char*, Ticket*, char*);
  104. int convD2M9p1(Dentry*, char*);
  105. int convM2D9p1(char*, Dentry*);
  106. int convM2S9p1(uchar*, Fcall*, int);
  107. int convS2M9p1(Fcall*, uchar*);
  108. void fcall9p1(Chan*, Fcall*, Fcall*);
  109. void (*call9p1[MAXSYSCALL])(Chan*, Fcall*, Fcall*);