aboutsummaryrefslogtreecommitdiffstats
path: root/tap-iousers.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-05 01:33:40 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-05 01:33:40 +0000
commit86470e954d6e22a5e7c8571fcf6a18de95782647 (patch)
tree9c193ee5e563db3695363359da4cfb2a3df876c7 /tap-iousers.c
parent509c97f79d9f6b32716acad040195d6fc07dbfc6 (diff)
Update to the tethereal conversation list
to make it also sort endpoints by port first and second by address. This is to make it more likely that we always get the client (high port number)in the first column and the server (low port number) in the second column this improvs readability of the list svn path=/trunk/; revision=8382
Diffstat (limited to 'tap-iousers.c')
-rw-r--r--tap-iousers.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/tap-iousers.c b/tap-iousers.c
index c3a64b5778..409e9ac936 100644
--- a/tap-iousers.c
+++ b/tap-iousers.c
@@ -1,7 +1,7 @@
/* tap-iousers.c
* iostat 2003 Ronnie Sahlberg
*
- * $Id: tap-iousers.c,v 1.14 2003/09/04 23:37:43 sahlberg Exp $
+ * $Id: tap-iousers.c,v 1.15 2003/09/05 01:33:40 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -75,7 +75,16 @@ iousers_udpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_
io_users_item_t *iui;
int direction=0;
- if(CMP_ADDRESS(&udph->ip_src, &udph->ip_dst)>0){
+ if(udph->uh_sport>udph->uh_dport){
+ direction=0;
+ snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
+ snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
+ } else if(udph->uh_sport<udph->uh_dport){
+ direction=1;
+ snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
+ snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
+ } else if(CMP_ADDRESS(&udph->ip_src, &udph->ip_dst)>0){
+ direction=0;
snprintf(name1,256,"%s:%s",address_to_str(&udph->ip_src),get_udp_port(udph->uh_sport));
snprintf(name2,256,"%s:%s",address_to_str(&udph->ip_dst),get_udp_port(udph->uh_dport));
} else {
@@ -125,7 +134,16 @@ iousers_tcpip_packet(io_users_t *iu, packet_info *pinfo, epan_dissect_t *edt _U_
io_users_item_t *iui;
int direction=0;
- if(CMP_ADDRESS(&tcph->ip_src, &tcph->ip_dst)>0){
+ if(tcph->th_sport>tcph->th_dport){
+ direction=0;
+ snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
+ snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
+ } else if(tcph->th_sport<tcph->th_dport){
+ direction=1;
+ snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
+ snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
+ } else if(CMP_ADDRESS(&tcph->ip_src, &tcph->ip_dst)>0){
+ direction=0;
snprintf(name1,256,"%s:%s",address_to_str(&tcph->ip_src),get_tcp_port(tcph->th_sport));
snprintf(name2,256,"%s:%s",address_to_str(&tcph->ip_dst),get_tcp_port(tcph->th_dport));
} else {