diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-11 08:18:09 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-05-11 08:18:09 +0000 |
commit | 292e38e2c61edcd14bfa30ca3c72bacda1bcbe32 (patch) | |
tree | db4edef02456a48d0f6d505166ac7d70f6c0f644 /packet-h1.c | |
parent | 162800efb308901e0c302517be01226130e39b19 (diff) | |
download | wireshark-292e38e2c61edcd14bfa30ca3c72bacda1bcbe32.tar.gz wireshark-292e38e2c61edcd14bfa30ca3c72bacda1bcbe32.tar.bz2 wireshark-292e38e2c61edcd14bfa30ca3c72bacda1bcbe32.zip |
Add tvbuff class.
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.
dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.
The FDDI dissector is converted to use tvbuff's.
svn path=/trunk/; revision=1939
Diffstat (limited to 'packet-h1.c')
-rw-r--r-- | packet-h1.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/packet-h1.c b/packet-h1.c index ec5d8999b5..f42eef18d7 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.7 2000/05/08 17:19:42 guy Exp $ + * $Id: packet-h1.c,v 1.8 2000/05/11 08:15:09 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -122,11 +122,11 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) col_add_str (fd, COL_INFO, "S5: "); if (tree) { - ti = proto_tree_add_item (tree, proto_h1, offset, 16, NULL); + ti = proto_tree_add_item (tree, proto_h1, NullTVB, offset, 16, NULL); h1_tree = proto_item_add_subtree (ti, ett_h1); - proto_tree_add_item (h1_tree, hf_h1_header, offset, 2, + proto_tree_add_item (h1_tree, hf_h1_header, NullTVB, offset, 2, pd[offset] * 0x100 + pd[offset + 1]); - proto_tree_add_item (h1_tree, hf_h1_len, offset + 2, 1, + proto_tree_add_item (h1_tree, hf_h1_len, NullTVB, offset + 2, 1, pd[offset + 2]); } @@ -137,15 +137,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case OPCODE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_opfield, + ti = proto_tree_add_item (h1_tree, hf_h1_opfield, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); opcode_tree = proto_item_add_subtree (ti, ett_opcode); - proto_tree_add_item (opcode_tree, hf_h1_oplen, + proto_tree_add_item (opcode_tree, hf_h1_oplen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (opcode_tree, hf_h1_opcode, + proto_tree_add_item (opcode_tree, hf_h1_opcode, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -159,25 +159,25 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case REQUEST_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_requestblock, + ti = proto_tree_add_item (h1_tree, hf_h1_requestblock, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); org_tree = proto_item_add_subtree (ti, ett_org); - proto_tree_add_item (org_tree, hf_h1_requestlen, + proto_tree_add_item (org_tree, hf_h1_requestlen, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (org_tree, hf_h1_org, + proto_tree_add_item (org_tree, hf_h1_org, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); - proto_tree_add_item (org_tree, hf_h1_dbnr, + proto_tree_add_item (org_tree, hf_h1_dbnr, NullTVB, offset + position + 3, 1, pd[offset + position + 3]); - proto_tree_add_item (org_tree, hf_h1_dwnr, + proto_tree_add_item (org_tree, hf_h1_dwnr, NullTVB, offset + position + 4, 2, pd[offset + position + 4] * 0x100 + pd[offset + position + 5]); - proto_tree_add_item (org_tree, hf_h1_dlen, + proto_tree_add_item (org_tree, hf_h1_dlen, NullTVB, offset + position + 6, 2, pd[offset + position + 6] * 0x100 + pd[offset + position + 7]); @@ -199,15 +199,15 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case RESPONSE_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_response, + ti = proto_tree_add_item (h1_tree, hf_h1_response, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); response_tree = proto_item_add_subtree (ti, ett_response); - proto_tree_add_item (response_tree, hf_h1_response_len, + proto_tree_add_item (response_tree, hf_h1_response_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); - proto_tree_add_item (response_tree, hf_h1_response_value, + proto_tree_add_item (response_tree, hf_h1_response_value, NullTVB, offset + position + 2, 1, pd[offset + position + 2]); } @@ -221,13 +221,13 @@ dissect_h1 (const u_char * pd, int offset, frame_data * fd, proto_tree * tree) case EMPTY_BLOCK: if (h1_tree) { - ti = proto_tree_add_item (h1_tree, hf_h1_empty, + ti = proto_tree_add_item (h1_tree, hf_h1_empty, NullTVB, offset + position, pd[offset + position + 1], pd[offset + position]); empty_tree = proto_item_add_subtree (ti, ett_empty); - proto_tree_add_item (empty_tree, hf_h1_empty_len, + proto_tree_add_item (empty_tree, hf_h1_empty_len, NullTVB, offset + position + 1, 1, pd[offset + position + 1]); } |