diff options
author | Anders Broman <anders.broman@ericsson.com> | 2006-01-07 11:10:50 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2006-01-07 11:10:50 +0000 |
commit | 44784a9fe4b7dff0a503dab7c51d7c1875cdc14a (patch) | |
tree | 36a908d443420d40eba6dab8de174aaefaa0eb33 /gtk | |
parent | 4e973150eadefff0962d854e000e485c200158a4 (diff) | |
download | wireshark-44784a9fe4b7dff0a503dab7c51d7c1875cdc14a.tar.gz |
From Olivier Jacques,
Here is a patch that:
- Replaces the arrow labels by the beginning of the COLINFO column if available (usually containing message names/types).
- Change the comment area to be "protocol: colinfo_content"
From Anders
Added ID tag
Camel
Use col_set_str to remove TCAP info in col_info
svn path=/trunk/; revision=16975
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/flow_graph.c | 66 |
1 files changed, 50 insertions, 16 deletions
diff --git a/gtk/flow_graph.c b/gtk/flow_graph.c index 494e6b4f6b..b43683a17d 100644 --- a/gtk/flow_graph.c +++ b/gtk/flow_graph.c @@ -1,4 +1,5 @@ /* flow_graph.c + * $Id:$ * Allows to display a flow graph of the currently displayed packets * * Copyright 2004, Ericsson , Spain @@ -215,30 +216,40 @@ static int flow_graph_frame_add_to_graph(packet_info *pinfo) { graph_analysis_item_t *gai; int i; + gchar *protocol; + gchar *colinfo; + + protocol=NULL; + colinfo=NULL; gai = g_malloc(sizeof(graph_analysis_item_t)); gai->frame_num = pinfo->fd->num; gai->time= nstime_to_sec(&pinfo->fd->rel_ts); - if (node_addr_type == NET_SRCDST) { - COPY_ADDRESS(&(gai->src_addr),&(pinfo->net_src)); - COPY_ADDRESS(&(gai->dst_addr),&(pinfo->net_dst)); - } else { - COPY_ADDRESS(&(gai->src_addr),&(pinfo->src)); - COPY_ADDRESS(&(gai->dst_addr),&(pinfo->dst)); - } + if (node_addr_type == NET_SRCDST) { + COPY_ADDRESS(&(gai->src_addr),&(pinfo->net_src)); + COPY_ADDRESS(&(gai->dst_addr),&(pinfo->net_dst)); + } else { + COPY_ADDRESS(&(gai->src_addr),&(pinfo->src)); + COPY_ADDRESS(&(gai->dst_addr),&(pinfo->dst)); + } gai->port_src=pinfo->srcport; gai->port_dst=pinfo->destport; gai->comment=NULL; gai->frame_label=NULL; + if (gai->comment!=NULL){ + g_free(gai->comment); + } + if (gai->frame_label!=NULL){ + g_free(gai->frame_label); + } + + if (pinfo->cinfo->col_first[COL_INFO]>=0){ for (i = pinfo->cinfo->col_first[COL_INFO]; i <= pinfo->cinfo->col_last[COL_INFO]; i++) { if (pinfo->cinfo->fmt_matx[i][COL_INFO]) { - if (gai->comment!=NULL){ - g_free(gai->comment); - } - gai->comment = g_strdup(pinfo->cinfo->col_data[i]); + colinfo = g_strdup(pinfo->cinfo->col_data[i]); } } } @@ -247,14 +258,37 @@ static int flow_graph_frame_add_to_graph(packet_info *pinfo) for (i = pinfo->cinfo->col_first[COL_PROTOCOL]; i <= pinfo->cinfo->col_last[COL_PROTOCOL]; i++) { if (pinfo->cinfo->fmt_matx[i][COL_PROTOCOL]) { - if (gai->frame_label!=NULL){ - g_free(gai->frame_label); - } - gai->frame_label = g_strdup(pinfo->cinfo->col_data[i]); + protocol = g_strdup(pinfo->cinfo->col_data[i]); + } } } - + + if (colinfo != NULL) { + if (protocol != NULL) { + gai->frame_label = g_strdup_printf("%.19s", colinfo); + gai->comment = g_strdup_printf("%s: %s", protocol, colinfo); + } else { + gai->frame_label = g_strdup_printf("%.19s", colinfo); + gai->comment = g_strdup_printf("%s", colinfo); + } + } else { + /* This will probably never happen...*/ + if (protocol != NULL) { + gai->frame_label = g_strdup_printf("%.19s", protocol); + gai->comment = g_strdup_printf("%s", protocol); + } else { + gai->frame_label = NULL; + gai->comment = NULL; + } + } + + if (protocol!=NULL){ + g_free(protocol); + } + if (colinfo!=NULL){ + g_free(colinfo); + } gai->line_style=1; gai->conv_num=0; |