Changeset 3c828b8


Ignore:
Timestamp:
01/08/19 12:48:46 (23 months ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
977e0db
Parents:
62b2d97
Message:

Ensure provenance records are correctly tagged

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r9a6bdbc r3c828b8  
    6161 */
    6262
     63#define ERF_META_TYPE 27
    6364
    6465static struct libtrace_format_t erfformat;
     
    536537        unsigned int rlen;
    537538        uint32_t flags = 0;
    538        
     539        libtrace_rt_types_t linktype;
    539540       
    540541        if (!packet->buffer || packet->buf_control == TRACE_CTRL_EXTERNAL) {
     
    603604                return -1;
    604605        }
    605        
     606
     607        /* If a provenance packet make sure correct rt linktype is set.
     608         * Only bits 0-6 are used for the type */
     609        if ((((dag_record_t *)packet->buffer)->type & 127) == ERF_META_TYPE) {
     610                linktype = TRACE_RT_ERF_META;
     611        } else { linktype = TRACE_RT_DATA_ERF; }
     612
    606613        if (erf_prepare_packet(libtrace, packet, packet->buffer,
    607                                 TRACE_RT_DATA_ERF, flags))
     614                                linktype, flags))
    608615                return -1;
    609616       
  • lib/libtrace.h.in

    r49f8ceb r3c828b8  
    469469        TRACE_RT_DUCK_5_0       =19,/**< Dag 5.0 Duck */
    470470        TRACE_RT_PCAPNG_META    =20,/**< Metadata for a PCAP NG input source */
     471        TRACE_RT_ERF_META       =21,/**< Metadata for a ERF input source */
    471472
    472473        /** Not actually used - all DATA types begin from this value */
Note: See TracChangeset for help on using the changeset viewer.