Changeset 1803a27 for lib/protocols.c
- Timestamp:
- 05/15/07 14:52:53 (15 years ago)
- 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:
- f898a97
- Parents:
- 89bfc98
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/protocols.c
r89bfc98 r1803a27 114 114 static void *trace_get_payload_from_80211(void *link, uint16_t *type, uint32_t *remaining) 115 115 { 116 /* TODO: Decode type != DATA117 * TODO: We're assuming four address frame here... probably not good118 */119 120 116 libtrace_80211_t *wifi; 121 117 libtrace_802_11_payload_t *eth; 122 uint8_t extra = 0; /* how many QoS bytes to skip */118 int8_t extra = 0; /* how many QoS bytes to skip */ 123 119 124 120 if (remaining && *remaining < sizeof(libtrace_80211_t)) … … 132 128 } 133 129 130 /* If FromDS and ToDS are both set then we have a four-address 131 * frame. Otherwise we have a three-address frame */ 132 if (!(wifi->to_ds && wifi->from_ds)) 133 extra -= 6; 134 134 135 /* Indicates QoS field present, see IEEE802.11e-2005 pg 21 */ 135 136 if (wifi->subtype & 0x8) … … 140 141 141 142 eth=(libtrace_802_11_payload_t *)((char*)wifi+sizeof(*wifi)+extra); 142 143 144 if (eth->type == 0xaaaa) 145 /* Payload contains an 802.2 LLC/SNAP frame */ 146 return trace_get_payload_from_llcsnap((void *)eth, type, remaining); 147 148 /* Otherwise we assume an Ethernet II frame */ 143 149 if (type) *type=ntohs(eth->type); 144 150 if (remaining) *remaining = *remaining - sizeof(libtrace_80211_t) - extra - sizeof(*eth); 145 146 151 147 152 return (void*)((char*)eth+sizeof(*eth));
Note: See TracChangeset
for help on using the changeset viewer.