diff options
author | Michael Mann <mmann78@netscape.net> | 2014-10-22 08:53:07 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-10-28 07:11:26 +0000 |
commit | 3d359da2b54d7e6c3ade4434894cd7f6207083fc (patch) | |
tree | 56b53030b03309fab4a6b711de47c955fb328e09 /epan/dissectors/packet-iax2.c | |
parent | 09957ca41875abda6e9ea24f35eb15f93dacb618 (diff) |
Refactor pinfo->circuit_id from H.223 dissector.
Change-Id: Id63e0088047c7948fd190ba4dd5fbcb536e0cc6b
Reviewed-on: https://code.wireshark.org/review/4921
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-iax2.c')
-rw-r--r-- | epan/dissectors/packet-iax2.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/epan/dissectors/packet-iax2.c b/epan/dissectors/packet-iax2.c index 4135e4f27d..83ae890759 100644 --- a/epan/dissectors/packet-iax2.c +++ b/epan/dissectors/packet-iax2.c @@ -1083,16 +1083,10 @@ static iax_packet_data *iax_new_packet_data(iax_call_data *call, gboolean revers static void iax2_populate_pinfo_from_packet_data(packet_info *pinfo, const iax_packet_data *p) { - /* info for subdissectors. We always pass on the original forward circuit, - * and steal the p2p_dir flag to indicate the direction */ - if (p->call_data == NULL) { + if (p->call_data != NULL) { /* if we missed the NEW packet for this call, call_data will be null. it's * tbd what the best thing to do here is. */ - pinfo -> ctype = CT_NONE; - } else { - pinfo -> ctype = CT_IAX2; - pinfo -> circuit_id = (guint32)p->call_data->forward_circuit_ids[0]; - pinfo -> p2p_dir = p->reversed?P2P_DIR_RECV:P2P_DIR_SENT; + pinfo->p2p_dir = p->reversed?P2P_DIR_RECV:P2P_DIR_SENT; col_set_str(pinfo->cinfo, COL_IF_DIR, p->reversed ? "rev" : "fwd"); } @@ -2183,7 +2177,20 @@ static void process_iax_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, #endif if (!video && iax_call && iax_call->subdissector) { - call_dissector(iax_call->subdissector, tvb, pinfo, tree); + iax2_dissector_info_t dissector_info; + + /* info for subdissectors. We always pass on the original forward circuit, + * and steal the p2p_dir flag to indicate the direction */ + if (iax_packet->call_data == NULL) { + /* if we missed the NEW packet for this call, call_data will be null. it's + * tbd what the best thing to do here is. */ + memset(&dissector_info, 0, sizeof(dissector_info)); + } else { + dissector_info.ctype = CT_IAX2; + dissector_info.circuit_id = (guint32)iax_packet->call_data->forward_circuit_ids[0]; + } + + call_dissector_with_data(iax_call->subdissector, tvb, pinfo, tree, &dissector_info); } else if (codec != 0 && dissector_try_uint(iax2_codec_dissector_table, codec, tvb, pinfo, tree)) { /* codec dissector handled our data */ } else { |