diff options
-rw-r--r-- | packet-afs-defs.h | 34 | ||||
-rw-r--r-- | packet-afs-macros.h | 66 | ||||
-rw-r--r-- | packet-afs-register-info.h | 96 | ||||
-rw-r--r-- | packet-afs.c | 44 | ||||
-rw-r--r-- | packet-rx.c | 18 |
5 files changed, 216 insertions, 42 deletions
diff --git a/packet-afs-defs.h b/packet-afs-defs.h index 4ee17e3991..bacc5ce1f9 100644 --- a/packet-afs-defs.h +++ b/packet-afs-defs.h @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs-defs.h,v 1.6 2001/03/23 21:42:37 nneul Exp $ + * $Id: packet-afs-defs.h,v 1.7 2001/03/26 15:27:55 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -691,6 +691,7 @@ static int hf_afs_ubik_version_counter = -1; static int hf_afs_ubik_votestart = -1; static int hf_afs_ubik_state = -1; static int hf_afs_ubik_site = -1; +static int hf_afs_ubik_interface = -1; static int hf_afs_ubik_file = -1; static int hf_afs_ubik_pos = -1; static int hf_afs_ubik_length = -1; @@ -698,6 +699,37 @@ static int hf_afs_ubik_locktype = -1; static int hf_afs_ubik_voteend = -1; static int hf_afs_ubik_votetype = -1; +static int hf_afs_ubik_now = -1; +static int hf_afs_ubik_lastyestime = -1; +static int hf_afs_ubik_lastyeshost = -1; +static int hf_afs_ubik_lastyesstate = -1; +static int hf_afs_ubik_lastyesclaim = -1; +static int hf_afs_ubik_lowesthost = -1; +static int hf_afs_ubik_lowesttime = -1; +static int hf_afs_ubik_synchost = -1; +static int hf_afs_ubik_synctime = -1; +static int hf_afs_ubik_amsyncsite = -1; +static int hf_afs_ubik_syncsiteuntil = -1; +static int hf_afs_ubik_nservers = -1; +static int hf_afs_ubik_lockedpages = -1; +static int hf_afs_ubik_writelockedpages = -1; +static int hf_afs_ubik_activewrite = -1; +static int hf_afs_ubik_tidcounter = -1; +static int hf_afs_ubik_anyreadlocks = -1; +static int hf_afs_ubik_anywritelocks = -1; +static int hf_afs_ubik_recoverystate = -1; +static int hf_afs_ubik_currenttrans = -1; +static int hf_afs_ubik_writetrans = -1; +static int hf_afs_ubik_epochtime = -1; +static int hf_afs_ubik_isclone = -1; +static int hf_afs_ubik_addr = -1; +static int hf_afs_ubik_lastvotetime = -1; +static int hf_afs_ubik_lastbeaconsent = -1; +static int hf_afs_ubik_lastvote = -1; +static int hf_afs_ubik_currentdb = -1; +static int hf_afs_ubik_beaconsincedown = -1; +static int hf_afs_ubik_up = -1; + static gint ett_afs = -1; static gint ett_afs_op = -1; static gint ett_afs_acl = -1; diff --git a/packet-afs-macros.h b/packet-afs-macros.h index 6d88af76e5..e9c50afaa5 100644 --- a/packet-afs-macros.h +++ b/packet-afs-macros.h @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs-macros.h,v 1.6 2001/03/23 21:42:37 nneul Exp $ + * $Id: packet-afs-macros.h,v 1.7 2001/03/26 15:27:55 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -376,6 +376,68 @@ #define OUT_BOS_STATUS() \ SKIP(10 * 4); +/* output a ubik interface addr array */ +#define OUT_UBIK_InterfaceAddrs() \ + { \ + unsigned int i,j,seen_null=0; \ + for (i=0; i<255; i++) { \ + j = GETINT(); \ + if ( j != 0 ) { \ + OUT_IP(hf_afs_ubik_interface); \ + seen_null = 0; \ + } else { \ + if ( ! seen_null ) { \ + TRUNC(4); \ + proto_tree_add_text(tree, NullTVB,curoffset,END_OF_FRAME, \ + "Null Interface Addresses"); \ + seen_null = 1; \ + } \ + curoffset += 4; \ + }\ + } \ + } + +#define OUT_UBIK_DebugOld() \ + { \ + OUT_DATE(hf_afs_ubik_now); \ + OUT_DATE(hf_afs_ubik_lastyestime); \ + OUT_IP(hf_afs_ubik_lastyeshost); \ + OUT_UINT(hf_afs_ubik_lastyesstate); \ + OUT_DATE(hf_afs_ubik_lastyesclaim); \ + OUT_IP(hf_afs_ubik_lowesthost); \ + OUT_DATE(hf_afs_ubik_lowesttime); \ + OUT_IP(hf_afs_ubik_synchost); \ + OUT_DATE(hf_afs_ubik_synctime); \ + OUT_UBIKVERSION("Sync Version"); \ + OUT_UBIKVERSION("Sync TID"); \ + OUT_UINT(hf_afs_ubik_amsyncsite); \ + OUT_DATE(hf_afs_ubik_syncsiteuntil); \ + OUT_UINT(hf_afs_ubik_nservers); \ + OUT_UINT(hf_afs_ubik_lockedpages); \ + OUT_UINT(hf_afs_ubik_writelockedpages); \ + OUT_UBIKVERSION("Local Version"); \ + OUT_UINT(hf_afs_ubik_activewrite); \ + OUT_UINT(hf_afs_ubik_tidcounter); \ + OUT_UINT(hf_afs_ubik_anyreadlocks); \ + OUT_UINT(hf_afs_ubik_anywritelocks); \ + OUT_UINT(hf_afs_ubik_recoverystate); \ + OUT_UINT(hf_afs_ubik_currenttrans); \ + OUT_UINT(hf_afs_ubik_writetrans); \ + OUT_DATE(hf_afs_ubik_epochtime); \ + } + +#define OUT_UBIK_SDebugOld() \ + { \ + OUT_IP(hf_afs_ubik_addr); \ + OUT_DATE(hf_afs_ubik_lastvotetime); \ + OUT_DATE(hf_afs_ubik_lastbeaconsent); \ + OUT_UINT(hf_afs_ubik_lastvote); \ + OUT_UBIKVERSION("Remote Version"); \ + OUT_UINT(hf_afs_ubik_currentdb); \ + OUT_UINT(hf_afs_ubik_beaconsincedown); \ + OUT_UINT(hf_afs_ubik_up); \ + } + /* Skip a certain number of bytes */ #define SKIP(bytes) \ TRUNC(bytes) \ @@ -447,7 +509,7 @@ curoffset += 4; \ tv.tv_sec = epoch; \ tv.tv_usec = 0; \ - ti = proto_tree_add_text(tree, NullTVB, curoffset, 3*4, \ + ti = proto_tree_add_text(tree, NullTVB, curoffset-8, 8, \ "UBIK Version (%s): %u.%u", label, epoch, counter ); \ save = tree; \ tree = proto_item_add_subtree(ti, ett_afs_ubikver); \ diff --git a/packet-afs-register-info.h b/packet-afs-register-info.h index fe3cd101e9..42fc1c81e5 100644 --- a/packet-afs-register-info.h +++ b/packet-afs-register-info.h @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs-register-info.h,v 1.6 2001/03/23 21:42:37 nneul Exp $ + * $Id: packet-afs-register-info.h,v 1.7 2001/03/26 15:27:55 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -234,35 +234,27 @@ { &hf_afs_fs_acl_count_positive, { "ACL Count (Positive)", "afs.fs.acl.count.positive", - FT_UINT32, BASE_DEC, - 0, 0, "Number of Positive ACLs" }}, + FT_UINT32, BASE_DEC, 0, 0, "Number of Positive ACLs" }}, { &hf_afs_fs_acl_count_negative, { "ACL Count (Negative)", "afs.fs.acl.count.negative", - FT_UINT32, BASE_DEC, - 0, 0, "Number of Negative ACLs" }}, + FT_UINT32, BASE_DEC, 0, 0, "Number of Negative ACLs" }}, { &hf_afs_fs_acl_datasize, { "ACL Size", "afs.fs.acl.datasize", - FT_UINT32, BASE_DEC, - 0, 0, "ACL Data Size" }}, + FT_UINT32, BASE_DEC, 0, 0, "ACL Data Size" }}, { &hf_afs_fs_acl_entity, { "Entity (User/Group)", "afs.fs.acl.entity", - FT_STRING, BASE_HEX, - 0, 0, "ACL Entity (User/Group)" }}, + FT_STRING, BASE_HEX, 0, 0, "ACL Entity (User/Group)" }}, { &hf_afs_fs_acl_r, { "_R_ead", "afs.fs.acl.r", - FT_UINT8, BASE_BIN, - 0, PRSFS_READ, "Read" }}, + FT_UINT8, BASE_BIN, 0, PRSFS_READ, "Read" }}, { &hf_afs_fs_acl_l, { "_L_ookup", "afs.fs.acl.l", - FT_UINT8, BASE_BIN, - 0, PRSFS_LOOKUP, "Lookup" }}, + FT_UINT8, BASE_BIN, 0, PRSFS_LOOKUP, "Lookup" }}, { &hf_afs_fs_acl_i, { "_I_nsert", "afs.fs.acl.i", - FT_UINT8, BASE_BIN, - 0, PRSFS_INSERT, "Insert" }}, + FT_UINT8, BASE_BIN, 0, PRSFS_INSERT, "Insert" }}, { &hf_afs_fs_acl_d, { "_D_elete", "afs.fs.acl.d", - FT_UINT8, BASE_BIN, - 0, PRSFS_DELETE, "Delete" }}, + FT_UINT8, BASE_BIN, 0, PRSFS_DELETE, "Delete" }}, { &hf_afs_fs_acl_w, { "_W_rite", "afs.fs.acl.w", FT_UINT8, BASE_BIN, 0, PRSFS_WRITE, "Write" }}, { &hf_afs_fs_acl_k, { "_L_ock", "afs.fs.acl.k", @@ -469,3 +461,73 @@ FT_UINT32, BASE_HEX, 0, 0, "Vote Type" }}, { &hf_afs_ubik_site, { "Site", "afs.ubik.site", FT_IPv4, BASE_HEX, 0, 0, "Site" }}, +{ &hf_afs_ubik_interface, { "Interface Address", "afs.ubik.interface", + FT_IPv4, BASE_HEX, 0, 0, "Interface Address" }}, + +{ &hf_afs_ubik_now, { "Now", "afs.ubik.now", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Now" }}, +{ &hf_afs_ubik_lastyestime, { "Last Yes Time", "afs.ubik.lastyesttime", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Last Yes Time" }}, +{ &hf_afs_ubik_lastyeshost, { "Last Yes Host", "afs.ubik.lastyeshost", + FT_IPv4, BASE_HEX, 0, 0, "Last Yes Host" }}, +{ &hf_afs_ubik_lastyesstate, { "Last Yes State", "afs.ubik.lastyesstate", + FT_UINT32, BASE_HEX, 0, 0, "Last Yes State" }}, +{ &hf_afs_ubik_lastyesclaim, { "Last Yes Claim", "afs.ubik.lastyesclaim", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Last Yes Claim" }}, +{ &hf_afs_ubik_lowesthost, { "Lowest Host", "afs.ubik.lowesthost", + FT_IPv4, BASE_HEX, 0, 0, "Lowest Host" }}, +{ &hf_afs_ubik_lowesttime, { "Lowest Time", "afs.ubik.lowesttime", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Lowest Time" }}, +{ &hf_afs_ubik_synchost, { "Sync Host", "afs.ubik.synchost", + FT_IPv4, BASE_HEX, 0, 0, "Sync Host" }}, +{ &hf_afs_ubik_addr, { "Address", "afs.ubik.addr", + FT_IPv4, BASE_HEX, 0, 0, "Address" }}, +{ &hf_afs_ubik_synctime, { "Sync Time", "afs.ubik.synctime", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Sync Time" }}, +{ &hf_afs_ubik_lastvotetime, { "Last Vote Time", "afs.ubik.lastvotetime", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Last Vote Time" }}, +{ &hf_afs_ubik_lastbeaconsent, { "Last Beacon Sent", "afs.ubik.lastbeaconsent", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Last Beacon Sent" }}, +{ &hf_afs_ubik_lastvote, { "Last Vote", "afs.ubik.lastvote", + FT_UINT32, BASE_HEX, 0, 0, "Last Vote" }}, +{ &hf_afs_ubik_currentdb, { "Current DB", "afs.ubik.currentdb", + FT_UINT32, BASE_HEX, 0, 0, "Current DB" }}, +{ &hf_afs_ubik_up, { "Up", "afs.ubik.up", + FT_UINT32, BASE_HEX, 0, 0, "Up" }}, +{ &hf_afs_ubik_beaconsincedown, { "Beacon Since Down", "afs.ubik.beaconsincedown", + FT_UINT32, BASE_HEX, 0, 0, "Beacon Since Down" }}, +{ &hf_afs_ubik_amsyncsite, { "Am Sync Site", "afs.ubik.amsyncsite", + FT_UINT32, BASE_HEX, 0, 0, "Am Sync Site" }}, +{ &hf_afs_ubik_syncsiteuntil, { "Sync Site Until", "afs.ubik.syncsiteuntil", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Sync Site Until" }}, +{ &hf_afs_ubik_nservers, { "Number of Servers", "afs.ubik.nservers", + FT_UINT32, BASE_HEX, 0, 0, "Number of Servers" }}, +{ &hf_afs_ubik_lockedpages, { "Locked Pages", "afs.ubik.lockedpages", + FT_UINT32, BASE_HEX, 0, 0, "Locked Pages" }}, +{ &hf_afs_ubik_writelockedpages, { "Write Locked Pages", "afs.ubik.writelockedpages", + FT_UINT32, BASE_HEX, 0, 0, "Write Locked Pages" }}, +{ &hf_afs_ubik_activewrite, { "Active Write", "afs.ubik.activewrite", + FT_UINT32, BASE_HEX, 0, 0, "Active Write" }}, +{ &hf_afs_ubik_tidcounter, { "TID Counter", "afs.ubik.tidcounter", + FT_UINT32, BASE_HEX, 0, 0, "TID Counter" }}, +{ &hf_afs_ubik_anyreadlocks, { "Any Read Locks", "afs.ubik.anyreadlocks", + FT_UINT32, BASE_HEX, 0, 0, "Any Read Locks" }}, +{ &hf_afs_ubik_anywritelocks, { "Any Write Locks", "afs.ubik.anywritelocks", + FT_UINT32, BASE_HEX, 0, 0, "Any Write Locks" }}, +{ &hf_afs_ubik_recoverystate, { "Recovery State", "afs.ubik.recoverystate", + FT_UINT32, BASE_HEX, 0, 0, "Recovery State" }}, +{ &hf_afs_ubik_currenttrans, { "Current Transaction", "afs.ubik.currenttran", + FT_UINT32, BASE_HEX, 0, 0, "Current Transaction" }}, +{ &hf_afs_ubik_writetrans, { "Write Transaction", "afs.ubik.writetran", + FT_UINT32, BASE_HEX, 0, 0, "Write Transaction" }}, +{ &hf_afs_ubik_epochtime, { "Epoch Time", "afs.ubik.epochtime", + FT_ABSOLUTE_TIME, BASE_HEX, 0, 0, "Epoch Time" }}, +{ &hf_afs_ubik_isclone, { "Is Clone", "afs.ubik.isclone", + FT_UINT32, BASE_HEX, 0, 0, "Is Clone" }}, + + + + + + + diff --git a/packet-afs.c b/packet-afs.c index 4b85210c17..08e139d85e 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -8,7 +8,7 @@ * Portions based on information/specs retrieved from the OpenAFS sources at * www.openafs.org, Copyright IBM. * - * $Id: packet-afs.c,v 1.27 2001/03/23 21:42:37 nneul Exp $ + * $Id: packet-afs.c,v 1.28 2001/03/26 15:27:55 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -338,7 +338,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if ( vals ) { if (check_col(fd, COL_INFO)) - col_add_fstr(fd, COL_INFO, "%s %s: %s (%d)", + col_add_fstr(fd, COL_INFO, "%s%s %s: %s (%d)", + typenode == hf_afs_ubik ? "UBIK-" : "", val_to_str(port, port_types_short, "Unknown(%d)"), reply ? "Reply" : "Request", val_to_str(opcode, vals, "Unknown(%d)"), opcode); @@ -346,7 +347,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) else { if (check_col(fd, COL_INFO)) - col_add_fstr(fd, COL_INFO, "%s %s: Unknown(%d)", + col_add_fstr(fd, COL_INFO, "%s%s %s: Unknown(%d)", + typenode == hf_afs_ubik ? "UBIK-" : "", val_to_str(port, port_types_short, "Unknown(%d)"), reply ? "Reply" : "Request", opcode); @@ -361,7 +363,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) typenode != hf_afs_ubik ) { proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME, - "Service: %s %s (Truncated)", + "Service: %s%s %s (Truncated)", + typenode == hf_afs_ubik ? "UBIK - " : "", val_to_str(port, port_types, "Unknown(%d)"), reply ? "Reply" : "Request"); return; @@ -369,7 +372,8 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) else { proto_tree_add_text(afs_tree, NullTVB, doffset, END_OF_FRAME, - "Service: %s %s", + "Service: %s%s %s", + typenode == hf_afs_ubik ? "UBIK - " : "", val_to_str(port, port_types, "Unknown(%d)"), reply ? "Reply" : "Request"); } @@ -1655,28 +1659,31 @@ dissect_ubik_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre case 10000: /* vote-beacon */ break; case 10001: /* vote-debug-old */ - /* ubik_debug_old */ + OUT_UBIK_DebugOld(); break; case 10002: /* vote-sdebug-old */ - /* ubik_sdebug_old */ + OUT_UBIK_SDebugOld(); break; case 10003: /* vote-get syncsite */ break; case 10004: /* vote-debug */ - /* ubik_debug */ + OUT_UBIK_DebugOld(); + OUT_UBIK_InterfaceAddrs(); break; case 10005: /* vote-sdebug */ - /* ubik_sdebug */ + OUT_UBIK_SDebugOld(); + OUT_UBIK_InterfaceAddrs(); break; case 10006: /* vote-xdebug */ - /* ubik_debug */ - /* isClone */ + OUT_UBIK_DebugOld(); + OUT_UBIK_InterfaceAddrs(); + OUT_UINT(hf_afs_ubik_isclone); break; case 10007: /* vote-xsdebug */ - /* ubik_sdebug */ - /* isClone */ + OUT_UBIK_SDebugOld(); + OUT_UBIK_InterfaceAddrs(); + OUT_UINT(hf_afs_ubik_isclone); break; - case 20000: /* disk-begin */ break; case 20004: /* get version */ @@ -1684,7 +1691,9 @@ dissect_ubik_reply(const u_char *pd, int offset, frame_data *fd, proto_tree *tre break; case 20010: /* disk-probe */ break; - + case 20012: /* disk-interfaceaddr */ + OUT_UBIK_InterfaceAddrs(); + break; } } @@ -1762,7 +1771,10 @@ dissect_ubik_request(const u_char *pd, int offset, frame_data *fd, proto_tree *t case 20011: /* disk-writev */ OUT_UBIKVERSION("TID"); break; - case 20012: /* disk-set version */ + case 20012: /* disk-interfaceaddr */ + OUT_UBIK_InterfaceAddrs(); + break; + case 20013: /* disk-set version */ OUT_UBIKVERSION("TID"); OUT_UBIKVERSION("Old DB Version"); OUT_UBIKVERSION("New DB Version"); diff --git a/packet-rx.c b/packet-rx.c index c0119d6369..0895093e8f 100644 --- a/packet-rx.c +++ b/packet-rx.c @@ -4,7 +4,7 @@ * Based on routines from tcpdump patches by * Ken Hornstein <kenh@cmf.nrl.navy.mil> * - * $Id: packet-rx.c,v 1.18 2001/01/09 06:31:41 guy Exp $ + * $Id: packet-rx.c,v 1.19 2001/03/26 15:27:55 nneul Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -118,12 +118,18 @@ dissect_rx(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) if (tree) { ti = proto_tree_add_protocol_format(tree, proto_rx, NullTVB, offset, - sizeof(struct rx_header), "RX Protocol (%s)", - val_to_str(rxh->type,rx_types,"unknown (%d)")); + sizeof(struct rx_header), "RX Protocol"); rx_tree = proto_item_add_subtree(ti, ett_rx); - proto_tree_add_uint(rx_tree, hf_rx_epoch, NullTVB, - offset, 4, pntohl(&rxh->epoch)); + { + struct timeval tv; + tv.tv_sec = pntohl(&rxh->epoch); + tv.tv_usec = 0; + + proto_tree_add_time(rx_tree,hf_rx_epoch, NullTVB, + offset,sizeof(guint32),&tv); + } + proto_tree_add_uint(rx_tree, hf_rx_cid, NullTVB, offset+4, 4, pntohl(&rxh->cid)); proto_tree_add_uint(rx_tree, hf_rx_callnumber, NullTVB, @@ -187,7 +193,7 @@ proto_register_rx(void) { static hf_register_info hf[] = { { &hf_rx_epoch, { - "Epoch", "rx.epoch", FT_UINT32, BASE_DEC, + "Epoch", "rx.epoch", FT_ABSOLUTE_TIME, BASE_DEC, NULL, 0, "Epoch" }}, { &hf_rx_cid, { "CID", "rx.cid", FT_UINT32, BASE_DEC, |