Misc ubik/afs updates to correct a SEGV and add some more

dissection. Will be more coming, but wanted to commit these before I headed
home.

svn path=/trunk/; revision=3172
This commit is contained in:
Nathan Neulinger 2001-03-23 21:42:37 +00:00
parent 1343043cdd
commit 848fa23499
5 changed files with 85 additions and 52 deletions

View File

@ -8,7 +8,7 @@
* Portions based on information/specs retrieved from the OpenAFS sources at * Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM. * www.openafs.org, Copyright IBM.
* *
* $Id: packet-afs-defs.h,v 1.5 2000/11/03 22:38:07 nneul Exp $ * $Id: packet-afs-defs.h,v 1.6 2001/03/23 21:42:37 nneul Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org> * By Gerald Combs <gerald@zing.org>
@ -289,6 +289,8 @@ static const value_string ubik_req[] = {
{ 10003, "vote-getsyncsite" }, { 10003, "vote-getsyncsite" },
{ 10004, "vote-debug" }, { 10004, "vote-debug" },
{ 10005, "vote-sdebug" }, { 10005, "vote-sdebug" },
{ 10006, "vote-xdebug" },
{ 10007, "vote-xsdebug" },
{ 20000, "disk-begin" }, { 20000, "disk-begin" },
{ 20001, "disk-commit" }, { 20001, "disk-commit" },
{ 20002, "disk-lock" }, { 20002, "disk-lock" },
@ -687,7 +689,7 @@ static int hf_afs_ubik_errcode = -1;
static int hf_afs_ubik_version_epoch = -1; static int hf_afs_ubik_version_epoch = -1;
static int hf_afs_ubik_version_counter = -1; static int hf_afs_ubik_version_counter = -1;
static int hf_afs_ubik_votestart = -1; static int hf_afs_ubik_votestart = -1;
static int hf_afs_ubik_syncsite = -1; static int hf_afs_ubik_state = -1;
static int hf_afs_ubik_site = -1; static int hf_afs_ubik_site = -1;
static int hf_afs_ubik_file = -1; static int hf_afs_ubik_file = -1;
static int hf_afs_ubik_pos = -1; static int hf_afs_ubik_pos = -1;

View File

@ -8,7 +8,7 @@
* Portions based on information/specs retrieved from the OpenAFS sources at * Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM. * www.openafs.org, Copyright IBM.
* *
* $Id: packet-afs-macros.h,v 1.5 2000/11/03 22:38:07 nneul Exp $ * $Id: packet-afs-macros.h,v 1.6 2001/03/23 21:42:37 nneul Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org> * By Gerald Combs <gerald@zing.org>
@ -451,8 +451,12 @@
"UBIK Version (%s): %u.%u", label, epoch, counter ); \ "UBIK Version (%s): %u.%u", label, epoch, counter ); \
save = tree; \ save = tree; \
tree = proto_item_add_subtree(ti, ett_afs_ubikver); \ tree = proto_item_add_subtree(ti, ett_afs_ubikver); \
if ( epoch != 0 ) \
proto_tree_add_time(tree,hf_afs_ubik_version_epoch, NullTVB,curoffset-8, \ proto_tree_add_time(tree,hf_afs_ubik_version_epoch, NullTVB,curoffset-8, \
sizeof(guint32),&tv); \ sizeof(guint32),&tv); \
else \
proto_tree_add_text(tree, NullTVB, curoffset-8, \
sizeof(guint32),"Epoch: 0"); \
proto_tree_add_uint(tree,hf_afs_ubik_version_counter, NullTVB,curoffset-4, \ proto_tree_add_uint(tree,hf_afs_ubik_version_counter, NullTVB,curoffset-4, \
sizeof(guint32),counter); \ sizeof(guint32),counter); \
tree = save; \ tree = save; \

View File

@ -8,7 +8,7 @@
* Portions based on information/specs retrieved from the OpenAFS sources at * Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM. * www.openafs.org, Copyright IBM.
* *
* $Id: packet-afs-register-info.h,v 1.5 2000/11/03 22:38:07 nneul Exp $ * $Id: packet-afs-register-info.h,v 1.6 2001/03/23 21:42:37 nneul Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org> * By Gerald Combs <gerald@zing.org>
@ -447,14 +447,16 @@
/* UBIK Fields */ /* UBIK Fields */
{ &hf_afs_ubik_errcode, { "Error Code", "afs.ubik.errcode", { &hf_afs_ubik_errcode, { "Error Code", "afs.ubik.errcode",
FT_UINT32, BASE_DEC, VALS(afs_errors), 0, "Error Code" }}, FT_UINT32, BASE_DEC, VALS(afs_errors), 0, "Error Code" }},
{ &hf_afs_ubik_state, { "State", "afs.ubik.state",
FT_UINT32, BASE_HEX, 0, 0, "State" }},
{ &hf_afs_ubik_version_epoch, { "Epoch", "afs.ubik.version.epoch", { &hf_afs_ubik_version_epoch, { "Epoch", "afs.ubik.version.epoch",
FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Epoch" }}, FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Epoch" }},
{ &hf_afs_ubik_version_counter, { "Counter", "afs.ubik.version.counter",
FT_UINT32, BASE_DEC, 0, 0, "Counter" }},
{ &hf_afs_ubik_votestart, { "Vote Started", "afs.ubik.votestart", { &hf_afs_ubik_votestart, { "Vote Started", "afs.ubik.votestart",
FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Vote Started" }}, FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Vote Started" }},
{ &hf_afs_ubik_voteend, { "Vote Ends", "afs.ubik.voteend", { &hf_afs_ubik_voteend, { "Vote Ends", "afs.ubik.voteend",
FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Vote Ends" }}, FT_ABSOLUTE_TIME, BASE_DEC, 0, 0, "Vote Ends" }},
{ &hf_afs_ubik_version_counter, { "Counter", "afs.ubik.version.counter",
FT_UINT32, BASE_DEC, 0, 0, "Counter" }},
{ &hf_afs_ubik_file, { "File", "afs.ubik.file", { &hf_afs_ubik_file, { "File", "afs.ubik.file",
FT_UINT32, BASE_DEC, 0, 0, "File" }}, FT_UINT32, BASE_DEC, 0, 0, "File" }},
{ &hf_afs_ubik_pos, { "Position", "afs.ubik.position", { &hf_afs_ubik_pos, { "Position", "afs.ubik.position",
@ -464,8 +466,6 @@
{ &hf_afs_ubik_locktype, { "Lock Type", "afs.ubik.locktype", { &hf_afs_ubik_locktype, { "Lock Type", "afs.ubik.locktype",
FT_UINT32, BASE_DEC, VALS(ubik_lock_types), 0, "Lock Type" }}, FT_UINT32, BASE_DEC, VALS(ubik_lock_types), 0, "Lock Type" }},
{ &hf_afs_ubik_votetype, { "Vote Type", "afs.ubik.votetype", { &hf_afs_ubik_votetype, { "Vote Type", "afs.ubik.votetype",
FT_BOOLEAN, BASE_HEX, 0, 0, "Vote Type" }}, FT_UINT32, BASE_HEX, 0, 0, "Vote Type" }},
{ &hf_afs_ubik_syncsite, { "Syncsite", "afs.ubik.syncsite",
FT_BOOLEAN, BASE_HEX, 0, 0, "Syncsite" }},
{ &hf_afs_ubik_site, { "Site", "afs.ubik.site", { &hf_afs_ubik_site, { "Site", "afs.ubik.site",
FT_IPv4, BASE_HEX, 0, 0, "Site" }}, FT_IPv4, BASE_HEX, 0, 0, "Site" }},

View File

@ -8,7 +8,7 @@
* Portions based on information/specs retrieved from the OpenAFS sources at * Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM. * www.openafs.org, Copyright IBM.
* *
* $Id: packet-afs.c,v 1.26 2001/01/03 06:55:26 guy Exp $ * $Id: packet-afs.c,v 1.27 2001/03/23 21:42:37 nneul Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org> * By Gerald Combs <gerald@zing.org>
@ -254,8 +254,6 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
opcode = request_val->opcode; opcode = request_val->opcode;
} }
node = 0; node = 0;
typenode = 0; typenode = 0;
vals = NULL; vals = NULL;
@ -359,7 +357,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
afs_tree = proto_item_add_subtree(ti, ett_afs); afs_tree = proto_item_add_subtree(ti, ett_afs);
if ( !BYTES_ARE_IN_FRAME(offset, sizeof(struct rx_header) + if ( !BYTES_ARE_IN_FRAME(offset, sizeof(struct rx_header) +
sizeof(struct afs_header)) ) sizeof(struct afs_header)) &&
typenode != hf_afs_ubik )
{ {
proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME, proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME,
"Service: %s %s (Truncated)", "Service: %s %s (Truncated)",
@ -1651,30 +1650,41 @@ dissect_ubik_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre
doffset = offset + sizeof(struct rx_header); doffset = offset + sizeof(struct rx_header);
curoffset = doffset; curoffset = doffset;
if ( rxh->type == RX_PACKET_TYPE_DATA ) switch ( opcode )
{ {
switch ( opcode ) case 10000: /* vote-beacon */
{ break;
case 10000: /* beacon */ case 10001: /* vote-debug-old */
proto_tree_add_boolean(tree,hf_afs_ubik_votetype, NullTVB,0,0,0); /* ubik_debug_old */
break; break;
case 20004: /* get version */ case 10002: /* vote-sdebug-old */
OUT_UBIKVERSION("DB Version"); /* ubik_sdebug_old */
break; break;
} case 10003: /* vote-get syncsite */
} break;
else if ( rxh->type == RX_PACKET_TYPE_ABORT ) case 10004: /* vote-debug */
{ /* ubik_debug */
switch ( opcode ) break;
{ case 10005: /* vote-sdebug */
case 10000: /* ubik_sdebug */
proto_tree_add_boolean(tree,hf_afs_ubik_votetype, NullTVB,0,0,1); break;
OUT_DATE(hf_afs_ubik_voteend); case 10006: /* vote-xdebug */
break; /* ubik_debug */
default: /* isClone */
OUT_UINT(hf_afs_ubik_errcode); break;
break; case 10007: /* vote-xsdebug */
} /* ubik_sdebug */
/* isClone */
break;
case 20000: /* disk-begin */
break;
case 20004: /* get version */
OUT_UBIKVERSION("DB Version");
break;
case 20010: /* disk-probe */
break;
} }
} }
@ -1694,48 +1704,65 @@ dissect_ubik_request(const u_char *pd, int offset, frame_data *fd, proto_tree *t
switch ( opcode ) switch ( opcode )
{ {
case 10000: /* beacon */ case 10000: /* vote-beacon */
OUT_UINT(hf_afs_ubik_syncsite); OUT_UINT(hf_afs_ubik_state);
OUT_DATE(hf_afs_ubik_votestart); OUT_DATE(hf_afs_ubik_votestart);
OUT_UBIKVERSION("DB Version"); OUT_UBIKVERSION("DB Version");
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
break; break;
case 10003: /* get sync site */ case 10001: /* vote-debug-old */
break;
case 10002: /* vote-sdebug-old */
OUT_UINT(hf_afs_ubik_site);
break;
case 10003: /* vote-get sync site */
OUT_IP(hf_afs_ubik_site); OUT_IP(hf_afs_ubik_site);
break; break;
case 20000: /* begin */ case 10004: /* vote-debug */
case 20001: /* commit */ case 10005: /* vote-sdebug */
case 20007: /* abort */ OUT_IP(hf_afs_ubik_site);
case 20008: /* release locks */ break;
case 20010: /* writev */ case 20000: /* disk-begin */
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
break; break;
case 20002: /* lock */ case 20001: /* disk-commit */
OUT_UBIKVERSION("TID");
break;
case 20002: /* disk-lock */
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
OUT_UINT(hf_afs_ubik_file); OUT_UINT(hf_afs_ubik_file);
OUT_UINT(hf_afs_ubik_pos); OUT_UINT(hf_afs_ubik_pos);
OUT_UINT(hf_afs_ubik_length); OUT_UINT(hf_afs_ubik_length);
OUT_UINT(hf_afs_ubik_locktype); OUT_UINT(hf_afs_ubik_locktype);
break; break;
case 20003: /* write */ case 20003: /* disk-write */
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
OUT_UINT(hf_afs_ubik_file); OUT_UINT(hf_afs_ubik_file);
OUT_UINT(hf_afs_ubik_pos); OUT_UINT(hf_afs_ubik_pos);
break; break;
case 20005: /* get file */ case 20004: /* disk-get version */
break;
case 20005: /* disk-get file */
OUT_UINT(hf_afs_ubik_file); OUT_UINT(hf_afs_ubik_file);
break; break;
case 20006: /* send file */ case 20006: /* disk-send file */
OUT_UINT(hf_afs_ubik_file); OUT_UINT(hf_afs_ubik_file);
OUT_UINT(hf_afs_ubik_length); OUT_UINT(hf_afs_ubik_length);
OUT_UBIKVERSION("DB Version"); OUT_UBIKVERSION("DB Version");
break; break;
case 20009: /* truncate */ case 20007: /* disk-abort */
case 20008: /* disk-release locks */
case 20010: /* disk-probe */
break;
case 20009: /* disk-truncate */
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
OUT_UINT(hf_afs_ubik_file); OUT_UINT(hf_afs_ubik_file);
OUT_UINT(hf_afs_ubik_length); OUT_UINT(hf_afs_ubik_length);
break; break;
case 20012: /* set version */ case 20011: /* disk-writev */
OUT_UBIKVERSION("TID");
break;
case 20012: /* disk-set version */
OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("TID");
OUT_UBIKVERSION("Old DB Version"); OUT_UBIKVERSION("Old DB Version");
OUT_UBIKVERSION("New DB Version"); OUT_UBIKVERSION("New DB Version");

View File

@ -1,7 +1,7 @@
/* packet-afs.h /* packet-afs.h
* Definitions for packet disassembly structures and routines * Definitions for packet disassembly structures and routines
* *
* $Id: packet-afs.h,v 1.2 2000/02/15 21:01:57 gram Exp $ * $Id: packet-afs.h,v 1.3 2001/03/23 21:42:37 nneul Exp $
* *
* Ethereal - Network traffic analyzer * Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org> * By Gerald Combs <gerald@zing.org>
@ -67,7 +67,7 @@ void dissect_afs(const u_char *, int, frame_data *, proto_tree *);
#define CB_TYPE_DROPPED 3 #define CB_TYPE_DROPPED 3
#define VOTE_LOW 10000 #define VOTE_LOW 10000
#define VOTE_HIGH 10005 #define VOTE_HIGH 10007
#define DISK_LOW 20000 #define DISK_LOW 20000
#define DISK_HIGH 20013 #define DISK_HIGH 20013