aboutsummaryrefslogtreecommitdiffstats
path: root/epan/frame_data.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-05-15 16:50:37 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-05-15 16:50:37 +0000
commit85ff18cf166fbbfdedf6a6bd80af1635b48e7276 (patch)
tree40564dee9d96a4bbd99044bb9ecb7be3fde272f3 /epan/frame_data.c
parent5b279569d245c0c2e23588251fb4c951f50c9b36 (diff)
- Use the key for comparison of per_proto_data.
- Show the number of per-packet-data entries and which protocol has made entries in the frame. svn path=/trunk/; revision=49313
Diffstat (limited to 'epan/frame_data.c')
-rw-r--r--epan/frame_data.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/epan/frame_data.c b/epan/frame_data.c
index 097e6ede92..b489876a8b 100644
--- a/epan/frame_data.c
+++ b/epan/frame_data.c
@@ -51,13 +51,18 @@ p_compare(gconstpointer a, gconstpointer b)
const frame_proto_data *ap = (const frame_proto_data *)a;
const frame_proto_data *bp = (const frame_proto_data *)b;
- if (ap -> proto > bp -> proto)
+ if (ap -> proto > bp -> proto){
return 1;
- else if (ap -> proto == bp -> proto)
- return 0;
- else
+ }else if (ap -> proto == bp -> proto){
+ if (ap -> key > bp -> key){
+ return 1;
+ }else if (ap -> key == bp -> key){
+ return 0;
+ }
return -1;
-
+ }else{
+ return -1;
+ }
}
void
@@ -114,6 +119,16 @@ p_remove_proto_data(frame_data *fd, int proto, guint8 key)
}
}
+gchar *
+p_get_proto_name_and_key(frame_data *fd, guint index){
+ frame_proto_data *temp;
+
+ temp = (frame_proto_data*)g_slist_nth_data(fd->pfd, index);
+
+ return ep_strdup_printf("[%s, key %u]",proto_get_protocol_name(temp->proto), temp->key);
+
+}
+
#define COMPARE_FRAME_NUM() ((fdata1->num < fdata2->num) ? -1 : \
(fdata1->num > fdata2->num) ? 1 : \
0)