diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-28 19:35:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-28 19:35:41 +0000 |
commit | cdc06969c7e22ed9f3dcaca7151bf4319f6436be (patch) | |
tree | 8329c5927c7d0ce704b8b439bab8e01734b0c0d9 | |
parent | 5f8a1bb8ab4d8990e4c840d2ea28b71515c160b1 (diff) | |
download | wireshark-cdc06969c7e22ed9f3dcaca7151bf4319f6436be.tar.gz |
Changes from Gerrit Gehnen to
1) fix some problems with the SINEC H1 dissector;
2) make it easier to plug in other dissectors atop OSI transport
protocols (by making the H1 dissector return an indication of
whether it recognizes the packet as an H1 packet or not, so
that, if it doesn't, additional dissectors can be tried).
svn path=/trunk/; revision=1895
-rw-r--r-- | packet-clnp.c | 10 | ||||
-rw-r--r-- | packet-h1.c | 30 | ||||
-rw-r--r-- | packet-h1.h | 4 |
3 files changed, 23 insertions, 21 deletions
diff --git a/packet-clnp.c b/packet-clnp.c index 2552b8c79e..66ba406951 100644 --- a/packet-clnp.c +++ b/packet-clnp.c @@ -1,7 +1,7 @@ /* packet-clnp.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-clnp.c,v 1.4 2000/04/18 18:01:50 deniel Exp $ + * $Id: packet-clnp.c,v 1.5 2000/04/28 19:35:39 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * Ralf Schneider <Ralf.Schneider@t-online.de> * @@ -428,8 +428,12 @@ static gboolean osi_decode_DT(const u_char *pd, int offset, offset += li + 1; if (uses_inactive_subset){ - dissect_h1(pd, offset, fd, tree); - return TRUE; + if (dissect_h1(pd, offset, fd, tree)) { + return TRUE; + } + /* Fill in other Dissectors using inactive subset here */ + dissect_data(pd, offset, fd, tree); + return FALSE; } else { dissect_data(pd, offset, fd, tree); diff --git a/packet-h1.c b/packet-h1.c index 0266b838bb..5c636caaa8 100644 --- a/packet-h1.c +++ b/packet-h1.c @@ -2,7 +2,7 @@ * Routines for Sinec H1 packet disassembly * Gerrit Gehnen <G.Gehnen@atrie.de> * - * $Id: packet-h1.c,v 1.4 2000/04/13 06:26:31 guy Exp $ + * $Id: packet-h1.c,v 1.5 2000/04/28 19:35:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -90,7 +90,7 @@ static const value_string returncode_vals[] = { {0x00, "No error"}, {0x02, "Requested block does not exist"}, {0x03, "Requested block too small"}, - {0xFF, "Error, reason unkown"}, + {0xFF, "Error, reason unknown"}, {0, NULL} }; @@ -101,7 +101,7 @@ static gint ett_response = -1; static gint ett_empty = -1; -void +gboolean dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) { proto_tree *h1_tree = NULL; @@ -113,8 +113,10 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) unsigned int position = 2; - if (pd[offset] == 'S' && pd[offset + 1] == '5') - { + if (!(pd[offset] == 'S' && pd[offset + 1] == '5')) { + return FALSE; + } + if (check_col (fd, COL_PROTOCOL)) col_add_str (fd, COL_PROTOCOL, "H1"); if (check_col (fd, COL_INFO)) @@ -151,8 +153,8 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) if (check_col (fd, COL_INFO)) { col_append_str (fd, COL_INFO, - match_strval (pd[offset + position + 2], - opcode_vals)); + val_to_str (pd[offset + position + 2], + opcode_vals,"Unknown Opcode (0x%2.2x)")); } break; case REQUEST_BLOCK: @@ -184,8 +186,8 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) if (check_col (fd, COL_INFO)) { col_append_fstr (fd, COL_INFO, " %s %d", - match_strval (pd[offset + position + 2], - org_vals), + val_to_str (pd[offset + position + 2], + org_vals,"Unknown Type (0x%2.2x)"), pd[offset + position + 3]); col_append_fstr (fd, COL_INFO, " DW %d", pd[offset + position + 4] * 0x100 + @@ -213,8 +215,8 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) if (check_col (fd, COL_INFO)) { col_append_fstr (fd, COL_INFO, " %s", - match_strval (pd[offset + position + 2], - returncode_vals)); + val_to_str (pd[offset + position + 2], + returncode_vals,"Unknown Returcode (0x%2.2x")); } break; case EMPTY_BLOCK: @@ -239,11 +241,7 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) } /* ..while */ dissect_data (pd, offset + pd[offset + 2], fd, tree); - } - else - { - dissect_data (pd, offset, fd, tree); - } + return TRUE; } diff --git a/packet-h1.h b/packet-h1.h index 11a49db467..b9ba335e05 100644 --- a/packet-h1.h +++ b/packet-h1.h @@ -2,7 +2,7 @@ * Declarations of outines for Sinec H1 packet disassembly * Gerrit Gehnen <G.Gehnen@atrie.de> * - * $Id: packet-h1.h,v 1.1 2000/03/02 07:27:05 guy Exp $ + * $Id: packet-h1.h,v 1.2 2000/04/28 19:35:41 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -24,4 +24,4 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -void dissect_h1(const u_char *, int, frame_data *, proto_tree *); +gboolean dissect_h1(const u_char *, int, frame_data *, proto_tree *); |