Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] [Endpoint list] Sort type for columns

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jean-Baptiste Marchand <Jean-Baptiste.Marchand@xxxxxx>
Date: Wed, 3 Mar 2004 13:53:01 +0100
Hello,

it seems that the sort type (numerical versus lexicographical) in the
endpoints reporting windows is not correct for some columns.

At least:

- TCP endpoints window (Statistics -> Endpoint list -> TCP): 

the third column (index 2), representing the number of frames, is
incorrectly sorted (lexicographically instead of numerically).


- IPv4 Hosts window (Statistics -> Endpoint list -> IPv4):

the second column (index 1), representing the number of frames, is also
incorrectly sorted, as if it was non-numeric data.

Looking at ett_sort_column() in gtk/endpoint_talkers_table.c:

switch(clist->sort_column){
        case 0:
        case 2: 
                return strcmp (text1, text2);
        case 1:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
        case 8:
        case 9: 
                i1=atoi(text1);
                i2=atoi(text2);
                return i1-i2;
        }

Also, in hostlist_sort_column() in gtk/hostlist_table.c:

switch(clist->sort_column){
        case 0:
        case 2:
                return strcmp (text1, text2);
        case 1:
        case 3:
        case 4:
        case 5:
        case 6:
        case 7:
                i1=atoi(text1);
                i2=atoi(text2);
                return i1-i2;
        }              


I suppose that we should adapt the sort type of columns for each
endpoints list windows, as they contain different kind of information.

Sincerely,

Jean-Baptiste Marchand
-- 
Jean-Baptiste.Marchand@xxxxxx
HSC - http://www.hsc.fr/