Changeset 509ee47 for lib/trace.c


Ignore:
Timestamp:
12/10/18 14:52:43 (2 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
418c78d
Parents:
54ef438
Message:

Add option to allow users to specify a constant ERF framing length.

This can be useful for situations where

a) the input uses ERF (or some derivative thereof)
b) the link type and ERF record type are constant for the

duration of the capture

c) performance is critical

This option allows users to simply tell libtrace what the ERF
framing length on every packet is going to be, so libtrace
doesn't have to repeatedly derive the framing length for each
packet it processes. At high packet rates, the time taken to
do this calculation can really add up and it makes no sense
to risk dropping packets because you're busy calculating a value
that is always a single constant value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r9c86dee r509ee47  
    674674                        /* Dealt with earlier */
    675675                        return -1;
     676                case TRACE_OPTION_CONSTANT_ERF_FRAMING:
     677                        if (!trace_is_err(libtrace)) {
     678                                trace_set_err(libtrace,
     679                                                TRACE_ERR_OPTION_UNAVAIL,
     680                                                "This format does not feature an ERF header or does not support bypassing the framing length calculation");
     681                        }
     682                        return -1;
     683
    676684
    677685        }
Note: See TracChangeset for help on using the changeset viewer.