diff options
author | Marcus Müller <marcus.mueller@ettus.com> | 2015-04-23 12:24:23 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-10-20 17:14:25 -0700 |
commit | dc44afe68a7557871f185fdcb64921c3437a6fc9 (patch) | |
tree | 3cdb2955d6716cd7720246b93d22fe48fbc9678a /tools | |
parent | ff13955757a25d2544b81a50d877b98f1ff59893 (diff) | |
download | uhd-dc44afe68a7557871f185fdcb64921c3437a6fc9.tar.gz uhd-dc44afe68a7557871f185fdcb64921c3437a6fc9.tar.bz2 uhd-dc44afe68a7557871f185fdcb64921c3437a6fc9.zip |
Wireshark CHDR dissector: Made new-API compatible
Basically two changes:
* tvb_get_string needs a scope reference (emulation of C++ scoping in C!)
* the function prototype for dissectors changed, accounted for that
Diffstat (limited to 'tools')
-rw-r--r-- | tools/chdr-dissector/packet-chdr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/chdr-dissector/packet-chdr.c b/tools/chdr-dissector/packet-chdr.c index cce46bb84..daf16fab4 100644 --- a/tools/chdr-dissector/packet-chdr.c +++ b/tools/chdr-dissector/packet-chdr.c @@ -71,7 +71,7 @@ void proto_reg_handoff_chdr(void); static void dissect_chdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); /* heuristic dissector call. Will always return. */ -static gboolean heur_dissect_chdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) +static gboolean heur_dissect_chdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* whatislove) { if(heur_warning_printed < 1){ printf(LOG_HEADER"heuristic dissector always returns true!\n"); @@ -169,7 +169,7 @@ static void dissect_chdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (len >= 4){ chdr_size = 8; - bytes = tvb_get_string(tvb, 0, 4); + bytes = tvb_get_string(wmem_packet_scope(), tvb, 0, 4); flag_has_time = bytes[flag_offset] & 0x20; if (flag_has_time) chdr_size += 8; // 64-bit timestamp @@ -208,7 +208,7 @@ static void dissect_chdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (is_network) item = proto_tree_add_item(chdr_tree, hf_chdr_timestamp, tvb, 8, 8, endianness); else{ - bytes = (guint8*) tvb_get_string(tvb, 8, sizeof(unsigned long long)); + bytes = (guint8*) tvb_get_string(wmem_packet_scope(), tvb, 8, sizeof(unsigned long long)); timestamp = get_timestamp(bytes, sizeof(unsigned long long)); proto_tree_add_uint64(chdr_tree, hf_chdr_timestamp, tvb, 8, 8, timestamp); } |