123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- #include <authsrv.h>
- #define DIRREC 116 /* size of a directory ascii record */
- #define ERRREC 64 /* size of a error record */
- #define NAMEREC 28
- typedef struct Fcall9p1 Fcall9p1;
- typedef struct Qid9p1 Qid9p1;
- struct Qid9p1
- {
- long path;
- long version;
- };
- struct Fcall9p1
- {
- char type;
- ushort fid;
- short err;
- short tag;
- union
- {
- struct
- {
- short uid; /* T-Userstr */
- short oldtag; /* T-nFlush */
- Qid9p1 qid; /* R-Attach, R-Clwalk, R-Walk,
- * R-Open, R-Create */
- char rauth[AUTHENTLEN]; /* R-attach */
- };
- struct
- {
- char uname[NAMEREC]; /* T-nAttach */
- char aname[NAMEREC]; /* T-nAttach */
- char ticket[TICKETLEN]; /* T-attach */
- char auth[AUTHENTLEN]; /* T-attach */
- };
- struct
- {
- char ename[ERRREC]; /* R-nError */
- char chal[CHALLEN]; /* T-session, R-session */
- char authid[NAMEREC]; /* R-session */
- char authdom[DOMLEN]; /* R-session */
- };
- struct
- {
- char name[NAMEREC]; /* T-Walk, T-Clwalk, T-Create, T-Remove */
- long perm; /* T-Create */
- ushort newfid; /* T-Clone, T-Clwalk */
- char mode; /* T-Create, T-Open */
- };
- struct
- {
- long offset; /* T-Read, T-Write */
- long count; /* T-Read, T-Write, R-Read */
- char* data; /* T-Write, R-Read */
- };
- struct
- {
- char stat[DIRREC]; /* T-Wstat, R-Stat */
- };
- };
- };
- /*
- * P9 protocol message types
- */
- enum
- {
- Tnop9p1 = 50,
- Rnop9p1,
- Tosession9p1 = 52,
- Rosession9p1,
- Terror9p1 = 54, /* illegal */
- Rerror9p1,
- Tflush9p1 = 56,
- Rflush9p1,
- Toattach9p1 = 58,
- Roattach9p1,
- Tclone9p1 = 60,
- Rclone9p1,
- Twalk9p1 = 62,
- Rwalk9p1,
- Topen9p1 = 64,
- Ropen9p1,
- Tcreate9p1 = 66,
- Rcreate9p1,
- Tread9p1 = 68,
- Rread9p1,
- Twrite9p1 = 70,
- Rwrite9p1,
- Tclunk9p1 = 72,
- Rclunk9p1,
- Tremove9p1 = 74,
- Rremove9p1,
- Tstat9p1 = 76,
- Rstat9p1,
- Twstat9p1 = 78,
- Rwstat9p1,
- Tclwalk9p1 = 80,
- Rclwalk9p1,
- Tauth9p1 = 82, /* illegal */
- Rauth9p1, /* illegal */
- Tsession9p1 = 84,
- Rsession9p1,
- Tattach9p1 = 86,
- Rattach9p1,
- MAXSYSCALL
- };
- int convA2M9p1(Authenticator*, char*, char*);
- void convM2A9p1(char*, Authenticator*, char*);
- void convM2T9p1(char*, Ticket*, char*);
- int convD2M9p1(Dir*, char*);
- int convM2D9p1(char*, Dir*);
- int convM2S9p1(char*, Fcall9p1*, int);
- int convS2M9p1(Fcall9p1*, char*);
- int fcallfmt9p1(Fmt*);
- int fcall(int);
- #pragma varargck type "F" Fcall*
- #pragma varargck type "G" Fcall9p1*
- #pragma varargck type "D" Dir*
- void fatal(char*, ...);
|