Changeset 7ac9705 for lib/linktypes.c


Ignore:
Timestamp:
03/06/06 15:31:15 (16 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
e4e1635
Parents:
eeab9832
Message:

Changed rt types so that every pcap dlt has a matching rt type
Added functions for conversion between rt type and pcap dlt
format_rt now uses trace_set_err appropriately if rt_connect fails
format_pcap will check if a trace is dead before trying to look at

format data

Dead traces now have their format_data set to NULL
packet->type is now 32 bits, not 8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/linktypes.c

    r643105b r7ac9705  
    22#include <pcap.h>
    33#include "dagformat.h"
     4#include "rt_protocol.h"
     5#include <assert.h>
    46
    57/* This file maps libtrace types to/from pcap DLT and erf types
     
    4648}
    4749
     50enum rt_field_t pcap_dlt_to_rt(int dlt)
     51{
     52        /* For pcap the rt type is just the dlt + a fixed value */
     53        return dlt + RT_DATA_PCAP;
     54}
     55
     56int rt_to_pcap_dlt(enum rt_field_t rt_type)
     57{
     58        assert(rt_type >= RT_DATA_PCAP);
     59        return rt_type - RT_DATA_PCAP;
     60}
     61
    4862libtrace_linktype_t erf_type_to_libtrace(char erf)
    4963{
Note: See TracChangeset for help on using the changeset viewer.