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-eth.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-eth.c')
-rw-r--r-- | packet-eth.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/packet-eth.c b/packet-eth.c index fec20d78e3..3ac60dde14 100644 --- a/packet-eth.c +++ b/packet-eth.c @@ -1,7 +1,7 @@ /* packet-eth.c * Routines for ethernet packet disassembly * - * $Id: packet-eth.c,v 1.32 2000/05/05 09:32:02 guy Exp $ + * $Id: packet-eth.c,v 1.33 2000/05/11 08:15:08 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -195,19 +195,19 @@ dissect_eth(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) } if (tree) { - ti = proto_tree_add_protocol_format(tree, proto_eth, offset, ETH_HEADER_SIZE, + ti = proto_tree_add_protocol_format(tree, proto_eth, NullTVB, offset, ETH_HEADER_SIZE, "IEEE 802.3 %s", (ethhdr_type == ETHERNET_802_3 ? "Raw " : "")); fh_tree = proto_item_add_subtree(ti, ett_ieee8023); - proto_tree_add_item(fh_tree, hf_eth_dst, offset+0, 6, &pd[offset+0]); - proto_tree_add_item(fh_tree, hf_eth_src, offset+6, 6, &pd[offset+6]); + proto_tree_add_item(fh_tree, hf_eth_dst, NullTVB, offset+0, 6, &pd[offset+0]); + proto_tree_add_item(fh_tree, hf_eth_src, NullTVB, offset+6, 6, &pd[offset+6]); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, offset + 0, 6, &pd[offset+0]); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, offset + 6, 6, &pd[offset+6]); + proto_tree_add_item_hidden(fh_tree, hf_eth_addr, NullTVB, offset + 0, 6, &pd[offset+0]); + proto_tree_add_item_hidden(fh_tree, hf_eth_addr, NullTVB, offset + 6, 6, &pd[offset+6]); - proto_tree_add_item(fh_tree, hf_eth_len, offset+12, 2, length); + proto_tree_add_item(fh_tree, hf_eth_len, NullTVB, offset+12, 2, length); } /* Convert the LLC length from the 802.3 header to a total @@ -226,16 +226,16 @@ dissect_eth(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) col_add_str(fd, COL_INFO, "Ethernet II"); if (tree) { - ti = proto_tree_add_protocol_format(tree, proto_eth, offset, ETH_HEADER_SIZE, + ti = proto_tree_add_protocol_format(tree, proto_eth, NullTVB, offset, ETH_HEADER_SIZE, "Ethernet II"); fh_tree = proto_item_add_subtree(ti, ett_ether2); - proto_tree_add_item(fh_tree, hf_eth_dst, offset+0, 6, &pd[offset+0]); - proto_tree_add_item(fh_tree, hf_eth_src, offset+6, 6, &pd[offset+6]); + proto_tree_add_item(fh_tree, hf_eth_dst, NullTVB, offset+0, 6, &pd[offset+0]); + proto_tree_add_item(fh_tree, hf_eth_src, NullTVB, offset+6, 6, &pd[offset+6]); /* add items for eth.addr filter */ - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, offset + 0, 6, &pd[offset+0]); - proto_tree_add_item_hidden(fh_tree, hf_eth_addr, offset + 6, 6, &pd[offset+6]); + proto_tree_add_item_hidden(fh_tree, hf_eth_addr, NullTVB, offset + 0, 6, &pd[offset+0]); + proto_tree_add_item_hidden(fh_tree, hf_eth_addr, NullTVB, offset + 6, 6, &pd[offset+6]); } } offset += ETH_HEADER_SIZE; |