aboutsummaryrefslogtreecommitdiffstats
path: root/tap-iousers.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-05 01:33:40 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2003-09-05 01:33:40 +0000
commit9d83502801a155a4eab6a4b1ecbe174298f69ba3 (patch)
tree9c193ee5e563db3695363359da4cfb2a3df876c7 /tap-iousers.c
parent4ec0416c98c330984fb4cd4d25871bc9c55335f7 (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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8382 f5534014-38df-0310-8fa8-9805f1628bb7
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 {