Changeset f2fae49 for lib/trace.c


Ignore:
Timestamp:
11/28/07 23:04:28 (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:
9d3c721
Parents:
95b1d6d
Message:

Add new "loss" framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r95b1d6d rf2fae49  
    15901590        packet->type=pcap_linktype_to_rt(libtrace_to_pcap_linktype(linktype));
    15911591}
     1592
     1593uint64_t trace_get_received_packets(const libtrace_t *trace)
     1594{
     1595        assert(trace);
     1596        if (trace->format->get_received_packets) {
     1597                return trace->format->get_received_packets(trace);
     1598        }
     1599        return (uint64_t)-1;
     1600}
     1601
     1602uint64_t trace_get_filtered_packets(const libtrace_t *trace)
     1603{
     1604        assert(trace);
     1605        if (trace->format->get_filtered_packets) {
     1606                return trace->format->get_filtered_packets(trace);
     1607        }
     1608        if (trace->format->get_received_packets
     1609                && trace->format->get_dropped_packets) {
     1610                return
     1611                        trace_get_received_packets(trace)
     1612                        -trace_get_accepted_packets(trace)
     1613                        -trace_get_dropped_packets(trace);
     1614        }
     1615        return (uint64_t)-1;
     1616}
     1617
     1618uint64_t trace_get_dropped_packets(const libtrace_t *trace)
     1619{
     1620        assert(trace);
     1621        if (trace->format->get_dropped_packets) {
     1622                return trace->format->get_dropped_packets(trace);
     1623        }
     1624        return (uint64_t)-1;
     1625}
     1626
     1627uint64_t trace_get_accepted_packets(const libtrace_t *trace)
     1628{
     1629        assert(trace);
     1630        return trace->accepted_packets;
     1631}
     1632
Note: See TracChangeset for help on using the changeset viewer.