Ignore:
Timestamp:
09/06/07 11:53:07 (14 years ago)
Author:
Perry Lorier <perry@…>
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:
e3a9eb5
Parents:
9bc4689
Message:

Port tools over to using the new api's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracereport/nlp_report.c

    r40f19df rfbc4342  
    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
Note: See TracChangeset for help on using the changeset viewer.