Changeset 8e11beb for tools/tracesplit


Ignore:
Timestamp:
07/03/17 16:37:48 (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:
568a341
Parents:
ed5b2ce
Message:

Update tools to properly ignore meta records and missing timestamps

pcapng introduces a lot of meta records that we should preserve as
long as possible. Since we aren't automatically discarding them,
we need to make sure that our tools do not try to treat them as
"real" packets, i.e. try to get a timestamp or capture length from
them.

Similarly, simple pcapng packet records do not have a timestamp
so we need to make sure the tools do the right thing when
trace_get_seconds() returns a timestamp of zero on a packet. For
starters, we don't want to set our "first" packet time to zero
in that case!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/tracesplit/tracesplit.c

    ree6e802 r8e11beb  
    190190 */
    191191static int per_packet(libtrace_packet_t **packet) {
     192        if (IS_LIBTRACE_META_PACKET((*packet))) {
     193                return 1;
     194        }
    192195
    193196        if (trace_get_link_type(*packet) == -1) {
     
    210213        if (firsttime==0) {
    211214                time_t now = trace_get_seconds(*packet);
    212                 if (starttime != 0) {
     215                if (now != 0 && starttime != 0) {
    213216                        firsttime=now-((now - starttime)%interval);
    214217                }
    215                 else {
     218                else if (now != 0) {
    216219                        firsttime=now;
    217220                }
Note: See TracChangeset for help on using the changeset viewer.