aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-05 01:11:12 +0000
committerRonnie Sahlberg <ronnie_sahlberg@ozemail.com.au>2003-09-05 01:11:12 +0000
commit509c97f79d9f6b32716acad040195d6fc07dbfc6 (patch)
treea95d4112fabca0608153c9ef712a81c7a84df4c5 /gtk
parent51b7e878f8358507956a8be006fb31ca6c8e9dbc (diff)
For endpoint conversations change how Endpoint1 and Endpoint two are selected.
Make the selction of what is endpoint 1 and what is endpoint 2 first check the port (if a port is present it will be !=0) and if the ports are present set the lowest port as endpoint2. If the prots are not present or the ports are identical then compare the addresses instead. The idea is that low port numbers usually refer to server daemons and this sorting thus usually puts the client as endpoint 1 and the server as endpoint 2. It is much more intuitive and makes the table much more readable. svn path=/trunk/; revision=8381
Diffstat (limited to 'gtk')
-rw-r--r--gtk/endpoint_talkers_table.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gtk/endpoint_talkers_table.c b/gtk/endpoint_talkers_table.c
index 41449e22f5..4dca616c0e 100644
--- a/gtk/endpoint_talkers_table.c
+++ b/gtk/endpoint_talkers_table.c
@@ -4,7 +4,7 @@
* endpoint_talkers_table 2003 Ronnie Sahlberg
* Helper routines common to all endpoint talkers tap.
*
- * $Id: endpoint_talkers_table.c,v 1.14 2003/09/04 23:37:45 sahlberg Exp $
+ * $Id: endpoint_talkers_table.c,v 1.15 2003/09/05 01:11:12 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -978,30 +978,26 @@ add_ett_table_data(endpoints_table *et, address *src, address *dst, guint32 src_
gboolean new_talker;
int res;
- res=CMP_ADDRESS(src, dst);
-
- if(res<0){
+ if(src_port>dst_port){
addr1=src;
addr2=dst;
port1=src_port;
port2=dst_port;
- } else if(res>0) {
+ } else if(src_port<dst_port){
addr2=src;
addr1=dst;
port2=src_port;
port1=dst_port;
+ } else if(CMP_ADDRESS(src, dst)<0){
+ addr1=src;
+ addr2=dst;
+ port1=src_port;
+ port2=dst_port;
} else {
- if(src_port>dst_port){
- addr1=src;
- addr2=dst;
- port1=src_port;
- port2=dst_port;
- } else {
- addr2=src;
- addr1=dst;
- port2=src_port;
- port1=dst_port;
- }
+ addr2=src;
+ addr1=dst;
+ port2=src_port;
+ port1=dst_port;
}