Changeset 1270

Show
Ignore:
Timestamp:
06/09/07 11:53:07 (1 year ago)
Author:
perry
Message:

Port tools over to using the new api's

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/tracereport/error_report.c

    r1214 r1270  
    1515        struct libtrace_ip *ip = trace_get_ip(packet); 
    1616        struct libtrace_tcp *tcp = trace_get_tcp(packet); 
    17         void *link = trace_get_link(packet); 
     17        void *link = trace_get_packet_buffer(packet,NULL,NULL); 
    1818        if (!link) { 
    1919                ++rx_errors; 
  • trunk/tools/tracereport/nlp_report.c

    r1221 r1270  
    1111void nlp_per_packet(struct libtrace_packet_t *packet) 
    1212{ 
    13         char *link=(char *)trace_get_link(packet)
    14         uint16_t type
     13        uint16_t ethertype
     14        void *link
    1515        libtrace_direction_t dir = trace_get_direction(packet); 
     16 
     17        link = trace_get_layer3(packet,&ethertype,NULL); 
    1618         
    1719        if (!link) 
    1820                return; 
    19         type = htons(*(uint16_t*)(link+12)); 
    2021 
    2122        if (dir != TRACE_DIR_INCOMING && dir != TRACE_DIR_OUTGOING) 
    2223                dir = TRACE_DIR_OTHER; 
    2324         
    24         nlp_stat[dir][type].count++; 
    25         nlp_stat[dir][type].bytes+=trace_get_wire_length(packet); 
     25        nlp_stat[dir][ethertype].count++; 
     26        nlp_stat[dir][ethertype].bytes+=trace_get_wire_length(packet); 
    2627} 
    2728 
  • trunk/tools/tracertstats/tracertstats.c

    r1131 r1270  
    140140                erf_hdr = (dag_record_t *)packet->header; 
    141141                 
    142                 if (trace_get_link(packet) == NULL) { 
     142                if (trace_get_packet_buffer(packet,NULL,NULL) == NULL) { 
    143143                        continue; 
    144144                } 
  • trunk/tools/tracestats/tracestats.c

    r1253 r1270  
    6161struct libtrace_t *trace; 
    6262 
    63 volatile static int done=0; 
     63static volatile int done=0; 
    6464 
    6565static void cleanup_signal(int signal)