Changeset e5222e1


Ignore:
Timestamp:
09/19/06 15:14:33 (15 years ago)
Author:
Scott Raynel <smr26@…>
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:
1515e07
Parents:
e502f76
Message:

Make get_payload_from_80211 aware of 802.11e QoS bits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/protocols.c

    r6df012d re5222e1  
    7171static void *trace_get_payload_from_80211(void *link, uint16_t *type, uint32_t *remaining)
    7272{
     73        /* TODO: Decode type != DATA
     74         * TODO: We're assuming four address frame here... probably not good
     75         */
     76       
    7377        libtrace_80211_t *wifi;
    7478        libtrace_802_11_payload_t *eth;
    75 
     79        uint8_t extra; /* how many QoS bytes to skip */
     80       
    7681        if (remaining && *remaining < sizeof(libtrace_80211_t))
    7782                return NULL;
     
    8489        }
    8590
     91        /* Check for WME */
     92        if (wifi->subtype & 0x8) {
     93                /* indicates two octets of QoS before payload,
     94                 * see IEEE802.11e-2005 pg 21
     95                 * */
     96                extra = 2;
     97        } else
     98                extra = 0;
     99
    86100        if (remaining && *remaining < sizeof(*eth))
    87101                return NULL;
    88102
    89         eth=(libtrace_802_11_payload_t *)((char*)wifi+sizeof(*wifi));
     103        eth=(libtrace_802_11_payload_t *)((char*)wifi+sizeof(*wifi)+extra);
    90104
    91105        if (type) *type=ntohs(eth->type);
    92 
     106        if (remaining) *remaining = *remaining - sizeof(libtrace_80211_t) - extra - sizeof(*eth);
     107       
     108       
    93109        return (void*)((char*)eth+sizeof(*eth));
    94110}
     
    228244                case TRACE_TYPE_80211_PRISM:
    229245                        l = trace_get_payload_from_prism(link,type,remaining);
    230                         return(l ? trace_get_payload_from_80211(l,type,remaining) : NULL);
     246                        return (l ? trace_get_payload_from_link(l, TRACE_TYPE_80211, type, remaining) : NULL);
    231247                case TRACE_TYPE_80211_RADIO:
    232248                        l = trace_get_payload_from_radiotap(link,type,remaining);
    233                         return(l ? trace_get_payload_from_80211(l,type,remaining) : NULL);
     249                        return (l ? trace_get_payload_from_link(l, TRACE_TYPE_80211, type, remaining) : NULL);
    234250                case TRACE_TYPE_80211:
    235251                        return trace_get_payload_from_80211(link,type,remaining);
     252
    236253                case TRACE_TYPE_ETH:
    237254                        return trace_get_payload_from_ethernet(link,type,remaining);
Note: See TracChangeset for help on using the changeset viewer.