aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ncp2222.inc
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-ncp2222.inc
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-ncp2222.inc')
-rw-r--r--epan/dissectors/packet-ncp2222.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ncp2222.inc b/epan/dissectors/packet-ncp2222.inc
index 2f3c2b1077..be08cc62d1 100644
--- a/epan/dissectors/packet-ncp2222.inc
+++ b/epan/dissectors/packet-ncp2222.inc
@@ -83,6 +83,9 @@ static const fragment_items nds_frag_items = {
"segments"
};
+/* Table for reassembly of fragments. */
+static reassembly_table nds_reassembly_table;
+
#define NDS_TAG_NO_SUCH_ENTRY 0x00000000
#define NDS_TAG_LOCAL_ENTRY 0x00000001
#define NDS_TAG_REMOTE_ENTRY 0x00000002
@@ -1695,8 +1698,8 @@ ncp_init_protocol(void)
int i;
/* fragment */
- fragment_table_init(&nds_fragment_table);
- reassembled_table_init(&nds_reassembled_table);
+ reassembly_table_init(&nds_reassembly_table,
+ &addresses_reassembly_table_functions);
for (i = 0; i < 99; i++) {
frags[i].nds_frag = 0xfffffff0;
@@ -7236,7 +7239,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
frags[frag_count].nds_frag_version = request_value->nds_version;
frags[frag_count].nds_frag_flags = request_value->req_nds_flags;
frags[frag_count].nds_frag_prot_flags = request_value->req_nds_prot_flags;
- fd_head = fragment_add_seq_next(tvb, 0, pinfo, tid, nds_fragment_table, nds_reassembled_table, len, request_value->nds_frag);
+ fd_head = fragment_add_seq_next(&nds_reassembly_table, tvb, 0, pinfo, tid, NULL, len, request_value->nds_frag);
frags[frag_count].sequence = sequence;
frags[frag_count].nds_length = 1;
}
@@ -7248,7 +7251,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
if (!pinfo->fd->flags.visited)
{
if (sequence != frags[frag_count].sequence) {
- fd_head = fragment_add_seq_next(tvb, 16, pinfo, tid, nds_fragment_table, nds_reassembled_table, len-16, request_value->nds_frag);
+ fd_head = fragment_add_seq_next(&nds_reassembly_table, tvb, 16, pinfo, tid, NULL, len-16, request_value->nds_frag);
frags[frag_count].sequence = sequence;
}
else
@@ -7261,7 +7264,7 @@ nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequ
}
else
{
- fd_head = fragment_add_seq_next(tvb, 16, pinfo, tid, nds_fragment_table, nds_reassembled_table, len-16, request_value->nds_frag);
+ fd_head = fragment_add_seq_next(&nds_reassembly_table, tvb, 16, pinfo, tid, NULL, len-16, request_value->nds_frag);
frags[frag_count].sequence = sequence;
}
}