From: assar Date: Fri, 7 Jan 2000 15:17:43 +0000 (+0000) Subject: (fs_reply_print): support parsing and printing of the errors in abort X-Git-Tag: tcpdump-3.5.1~442 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/ab757e9ce12b08bbd0f936eef18e411fdbe1c3cf (fs_reply_print): support parsing and printing of the errors in abort packets in symbolic form. From Love --- diff --git a/print-rx.c b/print-rx.c index 245b7deb..7fd9206f 100644 --- a/print-rx.c +++ b/print-rx.c @@ -13,7 +13,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Id: print-rx.c,v 1.5 1999-12-15 08:10:18 fenner Exp $"; + "@(#) $Id: print-rx.c,v 1.6 2000-01-07 15:17:43 assar Exp $"; #endif #ifdef HAVE_CONFIG_H @@ -315,6 +315,23 @@ static struct tok ubik_lock_types[] = { static char *voltype[] = { "read-write", "read-only", "backup" }; +static struct tok afs_fs_errors[] = { + { 101, "salvage volume" }, + { 102, "no such vnode" }, + { 103, "no such volume" }, + { 104, "volume exist" }, + { 105, "no service" }, + { 106, "volume offline" }, + { 107, "voline online" }, + { 108, "diskfull" }, + { 109, "diskquota exceeded" }, + { 110, "volume busy" }, + { 111, "volume moved" }, + { 112, "AFS IO error" }, + { -100, "restarting fileserver" }, + { 0, NULL } +}; + /* * Cache entries we keep around so we can figure out the RX opcode * numbers for replies. This allows us to make sense of RX reply packets. @@ -854,7 +871,7 @@ fs_reply_print(register const u_char *bp, int length, int32_t opcode) * If it was a data packet, interpret the response */ - if (rxh->type == RX_PACKET_TYPE_DATA) + if (rxh->type == RX_PACKET_TYPE_DATA) { switch (opcode) { case 131: /* Fetch ACL */ { @@ -883,12 +900,19 @@ fs_reply_print(register const u_char *bp, int length, int32_t opcode) default: ; } - else { - /* - * Otherwise, just print out the return code - */ - printf(" errcode"); - INTOUT(); + } else if (rxh->type == RX_PACKET_TYPE_ABORT) { + int i; + + /* + * Otherwise, just print out the return code + */ + TRUNC(sizeof(int32_t)); + i = (int) ntohl(*((int *) bp)); + bp += sizeof(int32_t); + + printf(" error %s", tok2str(afs_fs_errors, "#%d", i)); + } else { + printf(" strange fs reply of type %d", rxh->type); } return;