Sounds like you figured it out already.

ERF (Endace Record Format) is a proprietary binary format for captured network packets. An ERF File is simply one or more records concatenated, with no file header. This makes it conceptually simpler than pcap files, which it is not directly compatible with.

The Wireshark package (including mergecap, editcap, capinfos, tshark, wireshark etc) has the ability to read ERF Files and dissect the records. This functionality is split between wiretap (wtap/erf.c) and a dissector (epan/dissectors/packet-erf.c).

Because of this, editcap/mergecap/tshark/wireshark can read in an ERF File and output any format they support writing into, defaulting to pcap. The DLT you get will depend on the tool settings.

There is a pcap DLT_ERF specifically for encapsulating ERF records. If you output this type you will have a pcap file of type DLT_ERF where the payload of each pcap 'packet' is a complete ERF record including the header. Alternatively you can use these tools to output a regular DLT format such as DLT_EN10MB for Ethernet.

If you are capturing live you can use the native APIs or libpcap. If you are using libpcap by default the ERF records are converted into regular pcap DLTs such as DLT_EN10MB. You can optionally specify DLT_ERF to retain all the extra metadata including the high precision timestamp. When Wireshark tools read a pcap file containing DLT_ERF they discard the pcap wrapper information and use the ERF header preferentially.

As mentioned libtrace can also be used to read ERF Files as well as pcap files with a common API.


In reply to Re: Parsing ERF (pcap-like) format files by sfd
in thread Parsing ERF (pcap-like) format files by sblanton

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.