aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-quake2.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-07-10 23:47:28 -0400
committerMichael Mann <mmann78@netscape.net>2016-07-21 12:35:22 +0000
commitad6fc87d64de30cdcdca18168a117d2ec24591da (patch)
treeb5df109654ae6806db7544933f8bf1a848a02ae7 /epan/dissectors/packet-quake2.c
parent1e19f55f0c44b850bc6304be28d5b272a3553204 (diff)
Add proto_tree_add_checksum.
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-quake2.c')
-rw-r--r--epan/dissectors/packet-quake2.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/epan/dissectors/packet-quake2.c b/epan/dissectors/packet-quake2.c
index 10a0297f7e..5ca865a874 100644
--- a/epan/dissectors/packet-quake2.c
+++ b/epan/dissectors/packet-quake2.c
@@ -137,7 +137,6 @@ dissect_quake2_client_commands_move(tvbuff_t *tvb, packet_info *pinfo _U_,
#define BUTTON_USE 2
#define BUTTON_ANY 128
- guint8 chksum;
guint32 lastframe;
int i, offset = 0;
enum { Q_OFFSET, Q_VALUE, Q_SIZE };
@@ -151,7 +150,6 @@ dissect_quake2_client_commands_move(tvbuff_t *tvb, packet_info *pinfo _U_,
guint8 impulse[Q_SIZE];
} move[MOVES+1];
- chksum = tvb_get_guint8(tvb, offset);
offset++;
lastframe = tvb_get_letohl(tvb, offset);
offset += 4;
@@ -212,8 +210,7 @@ dissect_quake2_client_commands_move(tvbuff_t *tvb, packet_info *pinfo _U_,
if (!tree)
return offset;
- proto_tree_add_uint(tree, hf_quake2_game_client_command_move_chksum, tvb,
- 0, 1, chksum);
+ proto_tree_add_checksum(tree, tvb, 0, hf_quake2_game_client_command_move_chksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
proto_tree_add_uint(tree, hf_quake2_game_client_command_move_lframe, tvb,
1, 4, lastframe);