Changeset ed5b2ce for lib/trace.c


Ignore:
Timestamp:
07/03/17 16:31:57 (4 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, dpdk-ndag, etsilive, master, ndag_format, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance
Children:
8e11beb
Parents:
4578626
Message:

Add support for reading pcapng traces

Also added special macro: IS_LIBTRACE_META_PACKET()
This macro can be used to easily recognise if a "packet" is a
genuine packet record or a meta record (such as a pcapng interface
block or an RT control message).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    rd47ca18 red5b2ce  
    145145                bpf_constructor();
    146146                pcapfile_constructor();
    147                 rt_constructor();
     147                pcapng_constructor();
     148                rt_constructor();
    148149#ifdef HAVE_DAG
    149150                dag_constructor();
     
    957958                                                libtrace->snaplen);
    958959                        }
     960                        if (!IS_LIBTRACE_META_PACKET(packet)) {
     961                                ++libtrace->accepted_packets;
     962                        }
    959963                        trace_packet_set_order(packet, libtrace->sequence_number);
    960                         ++libtrace->accepted_packets;
    961                         ++libtrace->sequence_number;
     964                        ++libtrace->sequence_number;
    962965                        if (!libtrace_parallel && packet->trace == libtrace)
    963966                                libtrace->last_packet = packet;
     
    10331036                return -1;
    10341037        }
     1038
     1039        /* Don't try to convert meta-packets across formats */
     1040        if (strcmp(libtrace->format->name, packet->trace->format->name) != 0 &&
     1041                        IS_LIBTRACE_META_PACKET(packet)) {
     1042                return 0;
     1043        }
    10351044
    10361045        if (libtrace->format->write_packet) {
Note: See TracChangeset for help on using the changeset viewer.