Changeset b25f4b0


Ignore:
Timestamp:
04/26/07 14:00:46 (14 years ago)
Author:
Shane Alcock <salcock@…>
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:
1dc58e0
Parents:
0a65ed8
Message:

Added a new report type to tracereport which can be used to provide stats as to how much traffic is national / international based on the IP addresses involved. This report does require the user to provide a list of "local" IP ranges.
Replaced the "remove" call in traceflow which should make it run a lot faster.

Location:
tools
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • tools/traceflow/traceflow.cc

    r87d0a5b rb25f4b0  
    104104       
    105105        flow->expiry_ts = ts + timeout;
    106         flow->flow_list->remove(flow);
     106        flow->flow_list->erase(active_flows[flow->id]);
    107107        flow->flow_list = lru;
    108108        lru->push_front(flow);
  • tools/tracereport/Makefile.am

    r7be3cc4 rb25f4b0  
    2626        ecn_report.c\
    2727        tcpsegment_report.c\
     28        locality_report.c\
    2829        contain.h\
    2930        report.h\
  • tools/tracereport/tracereport.c

    r7be3cc4 rb25f4b0  
    110110                if (reports_required & REPORT_TYPE_TCPSEG)
    111111                        tcpseg_per_packet(packet);
     112                if (reports_required & REPORT_TYPE_LOCALITY)
     113                        locality_per_packet(packet);
    112114        }
    113115        trace_destroy(trace);
     
    132134        "-C --ecn               Report TCP ECN information\n"
    133135        "-s --tcpsegment        \tReport TCP segment size\n"
     136        "-l --locality=input    \tReport traffic locality using <input> to describe local IP addresses\n"
    134137        "-H --help              Print libtrace runtime documentation\n"
    135138        ,argv0);
     
    163166                        { "ecn",                0, 0, 'C' },
    164167                        { "tcpsegment",         0, 0, 's' },
     168                        { "locality",           1, 0, 'l' },
    165169                        { NULL,                 0, 0, 0 }
    166170                };
    167                 opt = getopt_long(argc, argv, "f:HeFmPpTtOondCs", long_options,
    168                                 &option_index);
     171                opt = getopt_long(argc, argv, "f:HemFPpTtOondCsl:",
     172                                long_options, &option_index);
    169173                if (opt == -1)
    170174                        break;
     
    189193                                usage(argv[0]);
    190194                                break;
     195                        case 'l':
     196                                if (locality_init(optarg) > 0)
     197                                        reports_required |= REPORT_TYPE_LOCALITY;
     198                        case 'm':
     199                                reports_required |= REPORT_TYPE_MISC;
     200                                break;
    191201                        case 'n':
    192202                                reports_required |= REPORT_TYPE_NLP;
     
    197207                        case 'o':
    198208                                reports_required |= REPORT_TYPE_SYNOPT;
    199                                 break;
    200                         case 'm':
    201                                 reports_required |= REPORT_TYPE_MISC;
    202209                                break;
    203210                        case 'P':
     
    267274        if (reports_required & REPORT_TYPE_TCPSEG)
    268275                tcpseg_report();
     276        if (reports_required & REPORT_TYPE_LOCALITY)
     277                locality_report();
    269278        return 0;
    270279}
  • tools/tracereport/tracereport.h

    r7be3cc4 rb25f4b0  
    2020        REPORT_TYPE_TCPSEG = 1 << 10,
    2121        REPORT_TYPE_SYNOPT = 1 << 11,
    22         REPORT_TYPE_MISC = 1 << 12
     22        REPORT_TYPE_LOCALITY = 1 << 12
     23        REPORT_TYPE_MISC = 1 << 13
    2324} report_type_t;
    2425
Note: See TracChangeset for help on using the changeset viewer.