diff options
author | Michael Mann <mmann78@netscape.net> | 2014-11-15 18:47:06 -0500 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-11-16 13:46:07 +0000 |
commit | d1696a6569033e1c8553aeecc940cfb7f64ebf64 (patch) | |
tree | 9c6a83a2faae6785ecdc8b8083c8bb821645e81e /epan/dissectors/packet-iuup.c | |
parent | f92ed4df2d4720720080d8013da124a0eb956de7 (diff) |
"Bubble up" the use of pinfo->circuit_id and pinfo->ctype to make it more obvious where in used in hopes that it can be eliminated through passing dissector data (or methods other than using packet_info)
Change-Id: Ib0e7efc123a3f9c06f58b5579c3c25b18818205c
Reviewed-on: https://code.wireshark.org/review/5326
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: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-iuup.c')
-rw-r--r-- | epan/dissectors/packet-iuup.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/epan/dissectors/packet-iuup.c b/epan/dissectors/packet-iuup.c index bc8992cf98..b9ea09aa84 100644 --- a/epan/dissectors/packet-iuup.c +++ b/epan/dissectors/packet-iuup.c @@ -353,7 +353,7 @@ iuup_proto_tree_add_bits(proto_tree* tree, int hf, tvbuff_t* tvb, int offset, in return pi; } -static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint rfci_id _U_, int offset) { +static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint rfci_id _U_, int offset, guint32 circuit_id) { iuup_circuit_t* iuup_circuit; iuup_rfci_t *rfci; int last_offset = tvb_reported_length(tvb) - 1; @@ -364,8 +364,8 @@ static void dissect_iuup_payload(tvbuff_t* tvb, packet_info* pinfo, proto_tree* if ( ! dissect_fields ) { return; - } else if ( ! pinfo->circuit_id - || ! ( iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)) ) ) { + } else if ( ! circuit_id + || ! ( iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(circuit_id)) ) ) { expert_add_info(pinfo, pi, &ei_iuup_payload_undecoded); return; } @@ -470,7 +470,7 @@ static guint dissect_rfcis(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tr return c - 1; } -static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree) { +static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, guint32 circuit_id) { int offset = 4; guint8 oct = tvb_get_guint8(tvb,offset); guint n = (oct & 0x0e) >> 1; @@ -482,11 +482,11 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre proto_tree* iptis_tree; iuup_circuit_t* iuup_circuit = NULL; - if (pinfo->circuit_id) { - iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(pinfo->circuit_id)); + if (circuit_id) { + iuup_circuit = (iuup_circuit_t *)g_hash_table_lookup(circuits,GUINT_TO_POINTER(circuit_id)); if (iuup_circuit) { - g_hash_table_remove(circuits,GUINT_TO_POINTER(pinfo->circuit_id)); + g_hash_table_remove(circuits,GUINT_TO_POINTER(circuit_id)); } iuup_circuit = wmem_new0(wmem_file_scope(), iuup_circuit_t); @@ -494,12 +494,12 @@ static void dissect_iuup_init(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tre iuup_circuit = wmem_new0(wmem_packet_scope(), iuup_circuit_t); } - iuup_circuit->id = pinfo->circuit_id; + iuup_circuit->id = circuit_id; iuup_circuit->num_of_subflows = n; iuup_circuit->rfcis = NULL; iuup_circuit->last_rfci = NULL; - if (pinfo->circuit_id) { + if (circuit_id) { g_hash_table_insert(circuits,GUINT_TO_POINTER(iuup_circuit->id),iuup_circuit); } @@ -670,7 +670,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree) proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,ENC_BIG_ENDIAN); add_hdr_crc(tvb, pinfo, iuup_tree, crccheck); add_payload_crc(tvb, pinfo, iuup_tree); - dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4); + dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,4,pinfo->circuit_id); return; case PDUTYPE_DATA_NO_CRC: col_append_fstr(pinfo->cinfo, COL_INFO," RFCI %u", (guint)(second_octet & 0x3f)); @@ -686,7 +686,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree) return; proto_tree_add_item(iuup_tree,hf_iuup_rfci,tvb,1,1,ENC_BIG_ENDIAN); add_hdr_crc(tvb, pinfo, iuup_tree, crccheck); - dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3); + dissect_iuup_payload(tvb,pinfo,iuup_tree,second_octet & 0x3f,3,pinfo->circuit_id); return; case PDUTYPE_DATA_CONTROL_PROC: if (tree) { @@ -739,7 +739,7 @@ static void dissect_iuup(tvbuff_t* tvb_in, packet_info* pinfo, proto_tree* tree) switch( second_octet & PROCEDURE_MASK ) { case PROC_INIT: if (tree) add_payload_crc(tvb, pinfo, iuup_tree); - dissect_iuup_init(tvb,pinfo,iuup_tree); + dissect_iuup_init(tvb,pinfo,iuup_tree,pinfo->circuit_id); return; case PROC_RATE: if (!tree) return; |