aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_cbch.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-03-22 23:59:54 +0000
committerGuy Harris <guy@alum.mit.edu>2013-03-22 23:59:54 +0000
commita2414d8909088ddb40c907886e725993e6baecb5 (patch)
tree53f0ebac8baa171f4317c7eb502a354da8596c72 /epan/dissectors/packet-gsm_cbch.c
parent3295912210fa1a8d7d0b1a18aa7c100f27905ed1 (diff)
Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols running atop TCP should be done on flows from one TCP endpoint to another. We do this by: adding "reassembly table" as a data structure; associating hash tables for both in-progress reassemblies and completed reassemblies with that data structure (currently, not all reassemblies use the latter; they might keep completed reassemblies in the first table); having functions to create and destroy keys in that table; offering standard routines for doing address-based and address-and-port-based flow processing, so that dissectors not needing their own specialized flow processing can just use them. This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where the second YPALL response is processed as if it were a continuation of a previous response between different endpoints, even though said response is already reassembled), and also allows the DCE RPC-specific stuff to be moved out of epan/reassembly.c into the DCE RPC dissector. svn path=/trunk/; revision=48491
Diffstat (limited to 'epan/dissectors/packet-gsm_cbch.c')
-rw-r--r--epan/dissectors/packet-gsm_cbch.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/epan/dissectors/packet-gsm_cbch.c b/epan/dissectors/packet-gsm_cbch.c
index a8e97f2047..69791d900a 100644
--- a/epan/dissectors/packet-gsm_cbch.c
+++ b/epan/dissectors/packet-gsm_cbch.c
@@ -93,8 +93,7 @@ static dissector_handle_t data_handle;
static dissector_handle_t cbs_handle;
/* reassembly of CHCH blocks */
-static GHashTable *fragment_block_table = NULL;
-static GHashTable *reassembled_message_table = NULL;
+static reassembly_table cbch_block_reassembly_table;
/* Structure needed for the fragmentation routines in reassemble.c
*/
@@ -119,8 +118,8 @@ static const fragment_items cbch_frag_items = {
static void
cbch_defragment_init(void)
{
- fragment_table_init(&fragment_block_table);
- reassembled_table_init(&reassembled_message_table);
+ reassembly_table_init(&cbch_block_reassembly_table,
+ &addresses_reassembly_table_functions);
}
static void
@@ -370,8 +369,8 @@ dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
this information is carried in the initial sequence number, not the payload,
so we prepend the reassembly with the octet containing the initial sequence number
to allow later dissection of the payload */
- frag_data = fragment_add_seq_check(tvb, offset, pinfo, 0,
- fragment_block_table, reassembled_message_table,
+ frag_data = fragment_add_seq_check(&cbch_block_reassembly_table,
+ tvb, offset, pinfo, 0, NULL,
seq_num & 0x03, CBCH_FRAGMENT_SIZE + 1, !lb);
reass_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled CBCH message",
frag_data, &cbch_frag_items, NULL, cbch_tree);
@@ -382,9 +381,9 @@ dissect_cbch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case 0x03:
pinfo->fragmented = TRUE;
offset++; /* step to beginning of payload */
- frag_data = fragment_add_seq_check(tvb, offset, pinfo, 0,
- fragment_block_table, reassembled_message_table, seq_num,
- CBCH_FRAGMENT_SIZE, !lb);
+ frag_data = fragment_add_seq_check(&cbch_block_reassembly_table,
+ tvb, offset, pinfo, 0, NULL,
+ seq_num, CBCH_FRAGMENT_SIZE, !lb);
reass_tvb = process_reassembled_data(tvb, offset, pinfo, "Reassembled CBCH message",
frag_data, &cbch_frag_items, NULL, cbch_tree);
break;