Changeset 50bbce8 for lib/format_dag24.c


Ignore:
Timestamp:
11/30/07 08:57:55 (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:
25a9201
Parents:
b282cf8
Message:

First pass implementation of loss recording framework.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dag24.c

    rf2fae49 r50bbce8  
    8080        uint32_t bottom;
    8181        uint32_t top;
     82        uint64_t drops;
    8283};
    8384
     
    130131        DUCK.last_pkt = 0;
    131132        DUCK.dummy_duck = NULL;
     133        FORMAT_DATA->drops = 0;
    132134
    133135        return 0;
     
    164166        while(dag_available(libtrace) != 0)
    165167                FORMAT_DATA->diff = 0;
     168        FORMAT_DATA->drops = 0;
    166169        return 0;
    167170}
     
    288291        tv = trace_get_timeval(packet);
    289292        DUCK.last_pkt = tv.tv_sec;
     293        DATA(libtrace)->drops += ntohs(erfptr->lctr);
    290294        return packet->payload ? htons(erfptr->rlen) : erf_get_framing_length(packet);
    291295}
     
    321325        event.seconds = 0.0001;
    322326        return event;
     327}
     328
     329static uint64_t dag24_get_dropped_packets(libtrace_t *trace)
     330{
     331        return DATA(trace)->drops;
    323332}
    324333
     
    366375        NULL,                           /* get_received_packets */
    367376        NULL,                           /* get_filtered_packets */
    368         NULL,                           /* get_dropped_packets */
     377        dag24_get_dropped_packets,      /* get_dropped_packets */
    369378        NULL,                           /* get_captured_packets */
    370379        NULL,                           /* get_fd */
Note: See TracChangeset for help on using the changeset viewer.