mirror of
https://github.com/0intro/wmii
synced 2024-11-22 05:42:05 +03:00
fixed RERROR in libixp2
This commit is contained in:
parent
def8587d89
commit
24f40f3dd1
2
README
2
README
@ -74,6 +74,8 @@ contributed especially to wmii in various ways:
|
||||
- Steve Hoffman <steveh (at) g2switchworks (dot) com>
|
||||
- Christof Musik <christof (at) senfdax (dot) de>
|
||||
- Steffen Liebergeld <perl (at) gmx (dot) org>
|
||||
- Tobias Walkowiak <wal (at) ivu (dot) de>
|
||||
- Sander van Dijk <a (dot) h (dot) vandijk (at) gmail (dot) com>
|
||||
|
||||
|
||||
References
|
||||
|
@ -217,7 +217,7 @@ static int attach(IXPServer *s, IXPConn *c)
|
||||
for (m = maps; m && m->next; m = m->next);
|
||||
m->next = new;
|
||||
}
|
||||
fprintf(stderr, "attaching %d %s %s\n", s->fcall.afid, s->fcall.uname, s->fcall.aname);
|
||||
fprintf(stderr, "attaching %u %u %s %s\n", s->fcall.fid, s->fcall.afid, s->fcall.uname, s->fcall.aname);
|
||||
new->qid = root_qid;
|
||||
new->fid = s->fcall.fid;
|
||||
s->fcall.id = RATTACH;
|
||||
|
@ -26,6 +26,54 @@
|
||||
#define IXP_MAX_WELEM 16 /* MAXWELEM */
|
||||
#define IXP_MAX_TFUNCS 14
|
||||
|
||||
|
||||
/*
|
||||
size[4] Tversion tag[2] msize[4] version[s]
|
||||
size[4] Rversion tag[2] msize[4] version[s]
|
||||
size[4] Tauth tag[2] afid[4] uname[s] aname[s]
|
||||
size[4] Rauth tag[2] aqid[13]
|
||||
size[4] Rerror tag[2] ename[s]
|
||||
size[4] Tflush tag[2] oldtag[2]
|
||||
size[4] Rflush tag[2]
|
||||
size[4] Tattach tag[2] fid[4] afid[4] uname[s] aname[s]
|
||||
size[4] Rattach tag[2] qid[13]
|
||||
size[4] Twalk tag[2] fid[4] newfid[4] nwname[2] nwname*(wname[s])
|
||||
size[4] Rwalk tag[2] nwqid[2] nwqid*(wqid[13])
|
||||
size[4] Topen tag[2] fid[4] mode[1]
|
||||
size[4] Ropen tag[2] qid[13] iounit[4]
|
||||
size[4] Tcreate tag[2] fid[4] name[s] perm[4] mode[1]
|
||||
size[4] Rcreate tag[2] qid[13] iounit[4]
|
||||
size[4] Tread tag[2] fid[4] offset[8] count[4]
|
||||
size[4] Rread tag[2] count[4] data[count]
|
||||
size[4] Twrite tag[2] fid[4] offset[8] count[4] data[count]
|
||||
size[4] Rwrite tag[2] count[4]
|
||||
size[4] Tclunk tag[2] fid[4]
|
||||
size[4] Rclunk tag[2]
|
||||
size[4] Tremove tag[2] fid[4]
|
||||
size[4] Rremove tag[2]
|
||||
size[4] Tstat tag[2] fid[4]
|
||||
size[4] Rstat tag[2] stat[n]
|
||||
size[4] Twstat tag[2] fid[4] stat[n]
|
||||
size[4] Rwstat tag[2]
|
||||
|
||||
stat[n]:
|
||||
size[2] total byte count of the following data
|
||||
type[2] for kernel use
|
||||
dev[4] for kernel use
|
||||
qid.type[1] the type of the file (directory, etc.),
|
||||
represented as a bit vector corresponding to the high 8 bits of the file's mode word.
|
||||
qid.vers[4] version number for given path
|
||||
qid.path[8] the file server's unique identification for the file
|
||||
mode[4] permissions and flags
|
||||
atime[4] last access time
|
||||
mtime[4] last modification time
|
||||
length[8] length of file in bytes
|
||||
name[ s ] file name; must be / if the file is the root directory of the server
|
||||
uid[ s ] owner name
|
||||
gid[ s ] group name
|
||||
muid[ s ]
|
||||
*/
|
||||
|
||||
/* 9P message types */
|
||||
enum {
|
||||
TVERSION = 100,
|
||||
@ -89,6 +137,7 @@ typedef unsigned char u8;
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned long long u64;
|
||||
|
||||
#define IXP_NOTAG (u16)~0U /* Dummy tag */
|
||||
#define IXP_NOFID (u32)~0 /* No auth */
|
||||
|
||||
|
@ -49,7 +49,7 @@ u32 ixp_fcall_to_msg(Fcall * fcall, void *msg, u32 msglen)
|
||||
sizeof_string(fcall->aname);
|
||||
break;
|
||||
case RERROR:
|
||||
msize += sizeof_string(fcall->errstr) + sizeof(u32);
|
||||
msize += sizeof_string(fcall->errstr);
|
||||
break;
|
||||
case RWRITE:
|
||||
case TCLUNK:
|
||||
@ -113,6 +113,8 @@ u32 ixp_fcall_to_msg(Fcall * fcall, void *msg, u32 msglen)
|
||||
p = ixp_enc_string(p, fcall->aname);
|
||||
break;
|
||||
case RAUTH:
|
||||
p = ixp_enc_qid(p, &fcall->aqid);
|
||||
break;
|
||||
case RATTACH:
|
||||
p = ixp_enc_qid(p, &fcall->qid);
|
||||
break;
|
||||
@ -202,8 +204,7 @@ u32 ixp_msg_to_fcall(void *msg, u32 msglen, Fcall * fcall)
|
||||
case TVERSION:
|
||||
case RVERSION:
|
||||
p = ixp_dec_u32(p, &fcall->maxmsg);
|
||||
p = ixp_dec_string(p, fcall->version, sizeof(fcall->version),
|
||||
&len);
|
||||
p = ixp_dec_string(p, fcall->version, sizeof(fcall->version), &len);
|
||||
break;
|
||||
case TAUTH:
|
||||
p = ixp_dec_u32(p, &fcall->afid);
|
||||
@ -211,6 +212,8 @@ u32 ixp_msg_to_fcall(void *msg, u32 msglen, Fcall * fcall)
|
||||
p = ixp_dec_string(p, fcall->aname, sizeof(fcall->aname), &len);
|
||||
break;
|
||||
case RAUTH:
|
||||
p = ixp_dec_qid(p, &fcall->aqid);
|
||||
break;
|
||||
case RATTACH:
|
||||
p = ixp_dec_qid(p, &fcall->qid);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user