diff options
author | Michael Mann <mmann78@netscape.net> | 2015-04-08 21:08:55 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2015-04-09 05:58:09 +0000 |
commit | 66f7f6eec8663118fd7925b738f3e0060efccae5 (patch) | |
tree | e606203f9f55a9a43d2273ee8bcd5dc281fdbcd8 /epan/dissectors/packet-ath.c | |
parent | 327ec9cb3b5d107da0ac9173a9f55f21175735b5 (diff) |
Improve ATH dissector.
Address comments made after initial dissector was submitted.
Change-Id: Ic42431d8af1d281dbe6f67a8f3f4d5e0aeea4156
Reviewed-on: https://code.wireshark.org/review/7995
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-ath.c')
-rw-r--r-- | epan/dissectors/packet-ath.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ath.c b/epan/dissectors/packet-ath.c index 5b636ffe94..40b2489852 100644 --- a/epan/dissectors/packet-ath.c +++ b/epan/dissectors/packet-ath.c @@ -53,6 +53,7 @@ void proto_reg_handoff_ath(void); static int proto_ath = -1; static int hf_ath_begin = -1; +static int hf_ath_padding = -1; static int hf_ath_length = -1; static int hf_ath_alive = -1; static int hf_ath_port = -1; @@ -217,6 +218,9 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_item(ath_tree, hf_ath_begin, tvb, offset, 8, ENC_ASCII|ENC_NA); offset+=8; + proto_tree_add_item(ath_tree, hf_ath_padding, tvb, offset, 2, ENC_ASCII|ENC_NA); + offset+=2; + /* LENGTH */ proto_tree_add_item(ath_tree, hf_ath_length, tvb, offset, 4, ENC_BIG_ENDIAN); @@ -244,7 +248,7 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* HOST LENGTH */ - proto_tree_add_item(ath_tree, hf_ath_hlen, tvb, offset, 1, ENC_BIG_ENDIAN); + hlen_item = proto_tree_add_item(ath_tree, hf_ath_hlen, tvb, offset, 1, ENC_BIG_ENDIAN); hlen = tvb_get_guint8(tvb, offset); offset+=1; @@ -256,6 +260,8 @@ dissect_ath(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } else if(hlen == 6) { proto_tree_add_item(ath_tree, hf_ath_ipv6, tvb, offset, 6, ENC_NA); info_srcaddr = tvb_ip6_to_str(tvb, offset); + } else { + expert_add_info(pinfo, hlen_item, &ei_ath_hlen_invalid); } offset+=hlen; @@ -344,6 +350,10 @@ proto_register_ath(void) { "Begin", "ath.begin", FT_STRING, BASE_NONE, NULL, 0x0, "Begin mark", HFILL } }, + { &hf_ath_padding, + { "Padding", "ath.padding", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, + HFILL } + }, { &hf_ath_length, { "Length", "ath.length", FT_UINT32, BASE_DEC, NULL, 0x0, "Data Length", HFILL } |