Changeset 1239


Ignore:
Timestamp:
06/27/07 16:32:30 (6 years ago)
Author:
spa1
Message:

Added uncompressed trace size to the misc-report in tracereport
Fixed incorrect byte-ordering of wire length in legacyeth

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/format_legacy.c

    r1163 r1239  
    178178static int legacyeth_get_wire_length(const libtrace_packet_t *packet) { 
    179179        legacy_ether_t *leth = (legacy_ether_t *)packet->header; 
    180         return ntohs(leth->wlen); 
     180        return leth->wlen; 
    181181} 
    182182 
  • trunk/tools/tracereport/misc_report.c

    r1214 r1239  
    1414static uint64_t packets = 0; 
    1515 
     16static uint64_t capture_bytes = 0; 
     17 
    1618void misc_per_packet(struct libtrace_packet_t *packet) 
    1719{ 
     
    2325        has_starttime = has_endtime = true; 
    2426        ++packets; 
     27        capture_bytes += trace_get_capture_length(packet) + trace_get_framing_length(packet); 
    2528} 
    2629 
     
    8285        fprintf(out, "Average packet rate: %.02f packets/sec\n", 
    8386                        packets/(endtime-starttime)); 
     87        fprintf(out, "Uncompressed trace size: %" PRIu64 "\n", capture_bytes); 
    8488} 
Note: See TracChangeset for help on using the changeset viewer.