aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/sctp_assoc_analyse.c
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2007-01-29 20:44:59 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2007-01-29 20:44:59 +0000
commited692e1c8a5238ef26ef80b686d4fe0a2a4e8f09 (patch)
tree71bb4109057efded18a8f71b3909006b80ab3c38 /gtk/sctp_assoc_analyse.c
parent063621f11ba5c3c05514be94bd03865096b911b5 (diff)
Improve the handling of INIT/ABORT mesage pairs.
svn path=/trunk/; revision=20608
Diffstat (limited to 'gtk/sctp_assoc_analyse.c')
-rw-r--r--gtk/sctp_assoc_analyse.c107
1 files changed, 29 insertions, 78 deletions
diff --git a/gtk/sctp_assoc_analyse.c b/gtk/sctp_assoc_analyse.c
index 74daff142e..06e0195265 100644
--- a/gtk/sctp_assoc_analyse.c
+++ b/gtk/sctp_assoc_analyse.c
@@ -372,12 +372,14 @@ sctp_set_filter (GtkButton *button _U_, struct sctp_analyse* u_data)
selected_stream->port1,
selected_stream->port2,
selected_stream->verification_tag1,
- selected_stream->verification_tag2,
+ /*selected_stream->verification_tag2,*/
+ selected_stream->initiate_tag,
selected_stream->verification_tag2,
selected_stream->port2,
selected_stream->port1,
selected_stream->verification_tag2,
- selected_stream->verification_tag1,
+ /*selected_stream->verification_tag1,*/
+ selected_stream->initiate_tag,
selected_stream->verification_tag1);
filter_string = f_string;
}
@@ -840,18 +842,18 @@ static void sctp_analyse_cb(struct sctp_analyse* u_data, gboolean ext)
guint16 srcport;
guint8* ip_dst;
guint16 dstport;
- GList *list, *srclist, *dstlist;
+ GList *list, *framelist;
dfilter_t *sfcode;
capture_file *cf;
epan_dissect_t *edt;
gint err;
gchar *err_info;
- gboolean frame_matched;
+ gboolean frame_matched, frame_found = FALSE;;
frame_data *fdata;
gchar filter_text[256];
sctp_assoc_info_t* assoc = NULL;
- address *src, *dst;
int i;
+ guint32 *fn; //frame_number
strcpy(filter_text,"sctp");
if (!dfilter_compile(filter_text, &sfcode)) {
@@ -899,91 +901,40 @@ static void sctp_analyse_cb(struct sctp_analyse* u_data, gboolean ext)
while (list)
{
assoc = (sctp_assoc_info_t*)(list->data);
- if (assoc->port1 == srcport && assoc->port2 == dstport)
- {
- srclist = g_list_first(assoc->addr1);
- while(srclist)
- {
- src = (address *)(srclist->data);
- if (*src->data == *ip_src)
- {
- dstlist = g_list_first(assoc->addr2);
- while(dstlist)
- {
- dst = (address *)(dstlist->data);
- if (*dst->data == *ip_dst)
- {
- u_data->assoc = assoc;
- u_data->assoc->addr_chunk_count = assoc->addr_chunk_count;
- static_assoc.addr_chunk_count = assoc->addr_chunk_count;
- static_assoc.port1 = assoc->port1;
- static_assoc.port2 = assoc->port2;
- for (i=0; i<NUM_CHUNKS; i++)
- {
- static_assoc.chunk_count[i] = assoc->chunk_count[i];
- static_assoc.ep1_chunk_count[i] = assoc->ep1_chunk_count[i];
- static_assoc.ep2_chunk_count[i] = assoc->ep2_chunk_count[i];
- }
- if (ext == FALSE)
- create_analyse_window(u_data);
- return;
- }
- else
- dstlist = g_list_next(dstlist);
- }
- }
- else
- srclist = g_list_next(srclist);
- }
- if (assoc->port2 != assoc->port1)
+ framelist = g_list_first(assoc->frame_numbers);
+ while(framelist)
+ {
+ fn = (guint32 *)framelist->data;
+ if (*fn == fdata->num)
{
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Assoc not found!");
- return;
+ frame_found = TRUE;
+ break;
}
+ framelist = g_list_next(framelist);
}
- if (assoc->port2 == srcport && assoc->port1 == dstport)
+ if (frame_found)
{
- srclist = g_list_first(assoc->addr2);
- while(srclist)
+ u_data->assoc = assoc;
+ u_data->assoc->addr_chunk_count = assoc->addr_chunk_count;
+ static_assoc.addr_chunk_count = assoc->addr_chunk_count;
+ static_assoc.port1 = assoc->port1;
+ static_assoc.port2 = assoc->port2;
+ for (i=0; i<NUM_CHUNKS; i++)
{
- src = (address *)(srclist->data);
- if (*src->data == *ip_src)
- {
- dstlist = g_list_first(assoc->addr1);
- while(dstlist)
- {
- dst = (address *)(dstlist->data);
- if (*dst->data == *ip_dst)
- {
- u_data->assoc = assoc;
- u_data->assoc->addr_chunk_count = assoc->addr_chunk_count;
- static_assoc.addr_chunk_count = assoc->addr_chunk_count;
- static_assoc.port1 = assoc->port1;
- static_assoc.port2 = assoc->port2;
- for (i=0; i<NUM_CHUNKS; i++)
- {
- static_assoc.chunk_count[i] = assoc->chunk_count[i];
- static_assoc.ep1_chunk_count[i] = assoc->ep1_chunk_count[i];
- static_assoc.ep2_chunk_count[i] = assoc->ep2_chunk_count[i];
- }
- if (ext == FALSE)
- create_analyse_window(u_data);
- return;
- }
- else
- dstlist = g_list_next(dstlist);
- }
- }
- else
- srclist = g_list_next(srclist);
+ static_assoc.chunk_count[i] = assoc->chunk_count[i];
+ static_assoc.ep1_chunk_count[i] = assoc->ep1_chunk_count[i];
+ static_assoc.ep2_chunk_count[i] = assoc->ep2_chunk_count[i];
}
- simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Assoc not found!");
+ if (ext == FALSE)
+ create_analyse_window(u_data);
return;
}
else
list = g_list_next(list);
}
+ if (!frame_found)
+ simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Assoc not found!");
}
void sctp_set_assoc_filter(void)