Ignore:
Timestamp:
09/20/07 18:36:24 (14 years ago)
Author:
Perry Lorier <perry@…>
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:
a07a0ec
Parents:
75453c2
Message:

pflog is a pktmeta header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols_pktmeta.c

    ra81d2fc r8b98289  
    3131        }
    3232
    33         /* What kind of wacked out header, has this in host order?! */
    3433        if (type) *type = ntohs(sll->hatype);
    3534
     
    3837}
    3938
    40 void *trace_get_payload_from_pflog(void *link,
    41                 uint16_t *type, uint32_t *remaining)
     39/* NB: type is returned as an ethertype */
     40static void *trace_get_payload_from_pflog(const void *link,
     41                libtrace_linktype_t *type, uint32_t *remaining)
    4242{
    4343        libtrace_pflog_header_t *pflog = (libtrace_pflog_header_t*)link;
    44     if (remaining) {
     44        if (remaining) {
    4545                if (*remaining<sizeof(*pflog))
    4646                        return NULL;
     
    4848        }
    4949        if (type) {
    50                 switch(pflog->af) {
    51                         case AF_INET6: *type=0x86DD; break;
    52                         case AF_INET:  *type=0x0800; break;
    53                         default:
    54                                       /* Unknown */
    55                                       return NULL;
    56                 }
     50                *type = TRACE_TYPE_NONE;
    5751        }
    5852        return (void*)((char*)pflog+ sizeof(*pflog));
     
    6054
    6155/* Returns the 'payload' of the prism header, which is the 802.11 frame */
    62 void *trace_get_payload_from_prism (const void *link,
     56static void *trace_get_payload_from_prism (const void *link,
    6357                libtrace_linktype_t *type, uint32_t *remaining)
    6458{
     
    7569
    7670/* Returns the 'payload' of the radiotap header, which is the 802.11 frame */
    77 void *trace_get_payload_from_radiotap (const void *link,
     71static void *trace_get_payload_from_radiotap (const void *link,
    7872                libtrace_linktype_t *type, uint32_t *remaining)
    7973{
     
    154148                                        linktype, remaining);
    155149                        return nexthdr;
    156                 case TRACE_TYPE_HDLC_POS:
    157                 case TRACE_TYPE_ETH:
    158                 case TRACE_TYPE_ATM:
    159                 case TRACE_TYPE_80211:
    160                 case TRACE_TYPE_NONE:
    161                 case TRACE_TYPE_PFLOG:
     150                case TRACE_TYPE_PFLOG:
     151                        nexthdr = trace_get_payload_from_pflog(meta,
     152                                        linktype, remaining);
     153                        return nexthdr;
     154                case TRACE_TYPE_HDLC_POS:
     155                case TRACE_TYPE_ETH:
     156                case TRACE_TYPE_ATM:
     157                case TRACE_TYPE_80211:
     158                case TRACE_TYPE_NONE:
    162159                case TRACE_TYPE_POS:
    163160                case TRACE_TYPE_AAL5:
Note: See TracChangeset for help on using the changeset viewer.