Ignore:
Timestamp:
02/22/07 15:45:46 (14 years ago)
Author:
Josef Vodanovich <jjv4@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
051618c
Parents:
4eec8dc
Message:

Lots of minor changes to the reports to make it look a bit nicer and tcp ss should be working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereport/tos_report.c

    r09be643 rb5dc60d  
    66#include "tracereport.h"
    77
    8 static stat_t tos_stat[4][256] = {{{0,0}}} ;
    9 static bool suppress[4] = {true,true,true,true};
     8static stat_t tos_stat[3][256] = {{{0,0}}} ;
     9static bool suppress[3] = {true,true,true};
    1010
    1111void tos_per_packet(struct libtrace_packet_t *packet)
    1212{
    1313        struct libtrace_ip *ip = trace_get_ip(packet);
     14        libtrace_direction_t dir = trace_get_direction(packet);
     15       
    1416        if (!ip)
    1517                return;
    16         int dir = trace_get_direction(packet);
    17         if(dir < 0 || dir > 1)
    18                 dir = 2;
     18       
     19        if (dir != TRACE_DIR_INCOMING && dir != TRACE_DIR_OUTGOING)
     20                dir = TRACE_DIR_OTHER;
     21       
    1922        tos_stat[dir][ip->ip_tos].count++;
    2023        tos_stat[dir][ip->ip_tos].bytes+=trace_get_wire_length(packet);
     
    2629        int i;
    2730        printf("%-20s","Direction:");
    28         for(i=0;i<4;i++){
     31        for(i=0;i<3;i++){
    2932                if(!suppress[i]){
    3033                        switch(i){
     
    4548        printf("\n");
    4649        printf("%-20s","ToS");
    47         for(i=0;i<4;i++){
     50        for(i=0;i<3;i++){
    4851                if(!suppress[i]){
    4952                        printf("\t%12s\t%12s", "bytes","packets");
     
    6366                        continue;
    6467                printf("%20i:",i);
    65                 for(j=0;j<4;j++){
     68                for(j=0;j<3;j++){
    6669                        if (tos_stat[j][i].count==0){
    6770                                if(!suppress[j])
Note: See TracChangeset for help on using the changeset viewer.