Changeset 528eb6e for libpacketdump


Ignore:
Timestamp:
12/04/12 15:24:34 (8 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:
b4c3f61
Parents:
fd87898
Message:
  • A very cut-down version of int: and ring: is now built on non-Linux systems, enabling them to be able to decode packets captured using those formats and exported via RT
  • Replaced arphrd.h with a new header file (libtrace_arphrd.h) that provides our own #defines for the various ARPHRD types. The inconsistency between what is available on different OS's was becoming problematic.
  • Increased RT buffer size so we can always fit a complete libtrace buffer into it - int: over RT tends to result in very large "packets".
  • Fixed copy-paste error in the failure case when creating a dummy linux trace in format_rt.c
  • Updated various bits of code to use the new LIBTRACE_ARPHRD types where sensible
  • Removed unneeded #include in protocols_pktmeta.c
  • Replaced u32 and u16 types in format_linux with more portable uint32_t and uint16_t types
  • Removed unneeded calls to linuxnative_init_input in the prepare_packet functions in format_linux.c
  • Don't call the fin_input function on a trace if the format does not provide one
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpacketdump/link_6.c

    rb3edbe9 r528eb6e  
    1212#include "libtrace.h"
    1313
    14 #include "arphrd.h"
     14#include "libtrace_arphrd.h"
    1515
    1616/* Copied this here because this isn't currently part of our external API -
     
    1818static libtrace_linktype_t arphrd_type_to_libtrace(unsigned int arphrd) {
    1919        switch(arphrd) {
    20                 case ARPHRD_ETHER: return TRACE_TYPE_ETH;
    21                 case ARPHRD_EETHER: return TRACE_TYPE_ETH;
    22                 case ARPHRD_IEEE80211: return TRACE_TYPE_80211;
    23                 case ARPHRD_80211_RADIOTAP: return TRACE_TYPE_80211_RADIO;
    24                 case ARPHRD_PPP: return TRACE_TYPE_NONE;
    25                 case ARPHRD_LOOPBACK: return TRACE_TYPE_NONE;
    26                 case ARPHRD_NONE: return TRACE_TYPE_NONE;
     20                case LIBTRACE_ARPHRD_ETHER: return TRACE_TYPE_ETH;
     21                case LIBTRACE_ARPHRD_EETHER: return TRACE_TYPE_ETH;
     22                case LIBTRACE_ARPHRD_IEEE80211: return TRACE_TYPE_80211;
     23                case LIBTRACE_ARPHRD_IEEE80211_RADIOTAP: return TRACE_TYPE_80211_RADIO;
     24                case LIBTRACE_ARPHRD_PPP: return TRACE_TYPE_NONE;
     25                case LIBTRACE_ARPHRD_LOOPBACK: return TRACE_TYPE_NONE;
     26                case LIBTRACE_ARPHRD_NONE: return TRACE_TYPE_NONE;
    2727        }
    2828        printf("Unknown ARPHRD: %u\n", arphrd);
     
    6262        ret=trace_get_payload_from_meta(pkt, &linktype, &len);
    6363       
    64         if (ntohs(sll->hatype) == ARPHRD_ETHER ||
    65                                 ntohs(sll->hatype) == ARPHRD_LOOPBACK) {
     64        if (ntohs(sll->hatype) == LIBTRACE_ARPHRD_ETHER ||
     65                                ntohs(sll->hatype) == LIBTRACE_ARPHRD_LOOPBACK) {
    6666               
    6767                if (ntohs(sll->protocol) == 0x0060) {
Note: See TracChangeset for help on using the changeset viewer.