Changeset 2627439 for lib/linktypes.c


Ignore:
Timestamp:
11/30/12 15:04:47 (9 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:
f00c146
Parents:
f240823
Message:
  • Created separate RT types for each combination of BPF + DLT - BPF doesn't store the linktype in the packet at all, so this has to be included in the RT type :/
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/linktypes.c

    r64d4398 r2627439  
    164164                case TRACE_TYPE_ATM:    return TYPE_ATM;
    165165                case TRACE_TYPE_AAL5:   return TYPE_AAL5;
     166               
     167                /* Not technically correct! Could be IPv6 packet
     168                 *
     169                 * TODO: Maybe we want TRACE_TYPE_RAW_IPV4 and
     170                 * TRACE_TYPE_RAW_IPV6 to replace TRACE_TYPE_NONE.
     171                 * Still need a good way to figure out how to convert
     172                 * TRACE_DLT_LINKTYPE_RAW into the correct type for the
     173                 * IP version though :( */
    166174                case TRACE_TYPE_NONE:   return TYPE_IPV4;
    167175                /* Unsupported conversions */
     
    360368                                return false;
    361369
    362 #if 0
    363                         switch(ntohs(((libtrace_sll_header_t*)packet->payload)
    364                                         ->hatype)) {
    365                                 case ARPHRD_PPP:
    366                                         packet->type=pcap_linktype_to_rt(TRACE_DLT_RAW);
    367                                         break;
    368                                 case ARPHRD_ETHER:
    369                                         packet->type=pcap_linktype_to_rt(TRACE_DLT_EN10MB);
    370                                         break;
    371                                 default:
    372                                         /* Dunno how to demote this packet */
    373                                         return false;
    374                         }
    375 #endif
    376370                        /* Skip the Linux SLL header */
    377371                        packet->payload=(void*)((char*)packet->payload
Note: See TracChangeset for help on using the changeset viewer.