1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-26 07:04:12 +00:00

Parse radiotap headers for proper frame injection

This commit is contained in:
kimocoder 2018-06-22 19:37:47 +02:00
parent f53c7ea20e
commit be14d54031
7 changed files with 1103 additions and 100 deletions

View File

@ -68,7 +68,7 @@ CONFIG_80211W = n
CONFIG_REDUCE_TX_CPU_LOADING = n
CONFIG_BR_EXT = y
CONFIG_TDLS = n
CONFIG_WIFI_MONITOR = n
CONFIG_WIFI_MONITOR = y
CONFIG_MCC_MODE = n
CONFIG_APPEND_VENDOR_IE_ENABLE = n
CONFIG_RTW_NAPI = y
@ -187,6 +187,7 @@ _OS_INTFS_FILES := os_dep/osdep_service.o \
os_dep/linux/rtw_cfgvendor.o \
os_dep/linux/wifi_regd.o \
os_dep/linux/rtw_android.o \
os_dep/linux/rtw_radiotap.o \
os_dep/linux/rtw_proc.o
ifeq ($(CONFIG_MP_INCLUDED), y)

View File

@ -7211,14 +7211,15 @@ void update_monitor_frame_attrib(_adapter *padapter, struct pkt_attrib *pattrib)
u8 wireless_mode;
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
struct sta_info *psta = NULL;
struct sta_priv *pstapriv = &padapter->stapriv;
// struct sta_info *psta = NULL;
// struct sta_priv *pstapriv = &padapter->stapriv;
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
// psta = rtw_get_stainfo(pstapriv, pattrib->ra);
pattrib->hdrlen = 24;
pattrib->nr_frags = 1;
pattrib->priority = 7;
pattrib->inject = 0xa5;
pattrib->mac_id = RTW_DEFAULT_MGMT_MACID;
pattrib->qsel = QSLT_MGNT;
@ -7258,7 +7259,7 @@ void update_monitor_frame_attrib(_adapter *padapter, struct pkt_attrib *pattrib)
pattrib->seqnum = pmlmeext->mgnt_seq;
pattrib->retry_ctrl = _TRUE;
pattrib->retry_ctrl = _FALSE;
pattrib->mbssid = 0;
pattrib->hw_ssn_sel = pxmitpriv->hw_ssn_seq_no;

View File

@ -4214,7 +4214,13 @@ static void do_queue_select(_adapter *padapter, struct pkt_attrib *pattrib)
* 0 success, hardware will handle this xmit frame(packet)
* <0 fail
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
int rtw_ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
int rtw_ieee80211_radiotap_iterator_init(
struct ieee80211_radiotap_iterator *iterator,
struct ieee80211_radiotap_header *radiotap_header,
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
{
int ret = 0;
@ -4228,8 +4234,22 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
unsigned char dst_mac_addr[6];
struct rtw_ieee80211_hdr *dot11_hdr;
struct ieee80211_radiotap_header *rtap_hdr;
struct ieee80211_radiotap_iterator iterator;
u8 fixed_rate = MGN_1M, sgi = 0, bwidth = 0, ldpc = 0, stbc = 0;
u16 txflags = 0;
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
u32 len = skb->len;
u8 category, action;
int type = -1;
if (skb)
rtw_mstat_update(MSTAT_TYPE_SKB, MSTAT_ALLOC_SUCCESS, skb->truesize);
@ -4244,90 +4264,110 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
if (unlikely(skb->len < rtap_len))
goto fail;
if (rtap_len != 12) {
RTW_INFO("radiotap len (should be 14): %d\n", rtap_len);
goto fail;
}
ret = rtw_ieee80211_radiotap_iterator_init(&iterator, rtap_hdr, skb->len, NULL);
while (!ret) {
ret = rtw_ieee80211_radiotap_iterator_next(&iterator);
if (ret)
continue;
/* see if this argument is something we can use */
switch (iterator.this_arg_index) {
case IEEE80211_RADIOTAP_RATE: /* u8 */
fixed_rate = *iterator.this_arg;
break;
case IEEE80211_RADIOTAP_TX_FLAGS:
txflags = get_unaligned_le16(iterator.this_arg);
break;
case IEEE80211_RADIOTAP_MCS: { /* u8,u8,u8 */
u8 mcs_have = iterator.this_arg[0];
if (mcs_have & IEEE80211_RADIOTAP_MCS_HAVE_MCS) {
fixed_rate = iterator.this_arg[2] & 0x7f;
if(fixed_rate > 31)
fixed_rate = 0;
fixed_rate += MGN_MCS0;
}
if ((mcs_have & 4) &&
(iterator.this_arg[1] & 4))
sgi = 1;
if ((mcs_have & 1) &&
(iterator.this_arg[1] & 1))
bwidth = 1;
if ((mcs_have & 0x10) &&
(iterator.this_arg[1] & 0x10))
ldpc = 1;
if ((mcs_have & 0x20))
stbc = (iterator.this_arg[1] >> 5) & 3;
}
break;
case IEEE80211_RADIOTAP_VHT: {
/* u16 known, u8 flags, u8 bandwidth, u8 mcs_nss[4], u8 coding, u8 group_id, u16 partial_aid */
u8 known = iterator.this_arg[0];
u8 flags = iterator.this_arg[2];
unsigned int mcs, nss;
if((known & 4) && (flags & 4))
sgi = 1;
if((known & 1) && (flags & 1))
stbc = 1;
if(known & 0x40) {
bwidth = iterator.this_arg[3] & 0x1f;
if(bwidth>=1 && bwidth<=3)
bwidth = 1; // 40 MHz
else if(bwidth>=4 && bwidth<=10)
bwidth = 2; // 80 MHz
else
bwidth = 0; // 20 MHz
}
if(iterator.this_arg[8] & 1)
ldpc = 1;
mcs = (iterator.this_arg[4]>>4) & 0x0f;
nss = iterator.this_arg[4] & 0x0f;
if(nss > 0) {
if(nss > 4) nss = 4;
if(mcs > 9) mcs = 9;
fixed_rate = MGN_VHT1SS_MCS0 + ((nss-1)*10 + mcs);
}
}
break;
default:
break;
}
}
/* Skip the ratio tap header */
skb_pull(skb, rtap_len);
dot11_hdr = (struct rtw_ieee80211_hdr *)skb->data;
frame_ctl = le16_to_cpu(dot11_hdr->frame_ctl);
// dot11_hdr = (struct ieee80211_hdr *)skb->data;
// frame_ctl = le16_to_cpu(dot11_hdr->frame_control);
/* Check if the QoS bit is set */
if ((frame_ctl & RTW_IEEE80211_FCTL_FTYPE) == RTW_IEEE80211_FTYPE_DATA) {
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
u32 len = skb->len;
u8 category, action;
int type = -1;
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL) {
if ((pmgntframe = alloc_mgtxmitframe(pxmitpriv)) == NULL) {
rtw_udelay_os(500);
goto fail;
}
pattrib = &pmgntframe->attrib;
update_monitor_frame_attrib(padapter, pattrib);
pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
_rtw_memcpy(pframe, (void *)buf, len);
_rtw_memcpy(pframe, (void*)skb->data, skb->len);
pattrib->pktlen = len;
pattrib->pktlen = skb->len;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
//printk("**** rt mcs %x rate %x raid %d sgi %d bwidth %d ldpc %d stbc %d txflags %x\n", fixed_rate, pattrib->rate, pattrib->raid, sgi, bwidth, ldpc, stbc, txflags);
pattrib->rate = fixed_rate;
pattrib->sgi = sgi;
pattrib->bwmode = bwidth; // 0-20 MHz, 1-40 MHz, 2-80 MHz
pattrib->ldpc = ldpc;
pattrib->stbc = stbc;
pattrib->retry_ctrl = (txflags & 0x08)?_FALSE:_TRUE;
if (is_broadcast_mac_addr(pwlanhdr->addr3) || is_broadcast_mac_addr(pwlanhdr->addr1))
pattrib->rate = MGN_24M;
pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq;
pmlmeext->mgnt_seq++;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe);
} else {
struct xmit_frame *pmgntframe;
struct pkt_attrib *pattrib;
unsigned char *pframe;
struct rtw_ieee80211_hdr *pwlanhdr;
struct xmit_priv *pxmitpriv = &(padapter->xmitpriv);
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
u8 *buf = skb->data;
u32 len = skb->len;
u8 category, action;
int type = -1;
pmgntframe = alloc_mgtxmitframe(pxmitpriv);
if (pmgntframe == NULL)
goto fail;
pattrib = &pmgntframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
pattrib->retry_ctrl = _FALSE;
_rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET);
pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET;
_rtw_memcpy(pframe, (void *)buf, len);
pattrib->pktlen = len;
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -4336,18 +4376,14 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
pmlmeext->mgnt_seq++;
pattrib->last_txcmdsz = pattrib->pktlen;
dump_mgntframe(padapter, pmgntframe);
}
fail:
rtw_skb_free(skb);
return 0;
}
#endif
/*
* The main transmit(tx) entry
*

View File

@ -326,6 +326,31 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba
SET_TX_DESC_GID_8812(ptxdesc, pattrib->txbf_g_id);
SET_TX_DESC_PAID_8812(ptxdesc, pattrib->txbf_p_aid);
#endif
/* injected frame */
if(pattrib->inject == 0xa5) {
SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1);
if (pattrib->retry_ctrl == _TRUE) {
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6);
} else {
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 0);
}
if(pattrib->sgi == _TRUE) {
SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 1);
} else {
SET_TX_DESC_DATA_SHORT_8812(ptxdesc, 0);
}
SET_TX_DESC_USE_RATE_8812(ptxdesc, 1);
SET_TX_DESC_TX_RATE_8812(ptxdesc, MRateToHwRate(pattrib->rate));
if (pattrib->ldpc)
SET_TX_DESC_DATA_LDPC_8812(ptxdesc, 1);
SET_TX_DESC_DATA_STBC_8812(ptxdesc, pattrib->stbc & 3);
//SET_TX_DESC_GF_8812(ptxdesc, 1); // no MCS rates if sets, GreenField?
//SET_TX_DESC_LSIG_TXOP_EN_8812(ptxdesc, 1);
//SET_TX_DESC_HTC_8812(ptxdesc, 1);
//SET_TX_DESC_NO_ACM_8812(ptxdesc, 1);
SET_TX_DESC_DATA_BW_8812(ptxdesc, pattrib->bwmode); // 0 - 20 MHz, 1 - 40 MHz, 2 - 80 MHz
}
rtl8812a_cal_txdesc_chksum(ptxdesc);
_dbg_dump_tx_info(padapter, pxmitframe->frame_tag, ptxdesc);
return pull;
@ -1101,7 +1126,8 @@ s32 rtl8812au_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
ptxdesc->txdw3 |= cpu_to_le32((8 << 28)); /* set bit3 to 1. Suugested by TimChen. 2009.12.29. */
rtl8188eu_cal_txdesc_chksum(ptxdesc);
//rtl8188eu_cal_txdesc_chksum(ptxdesc);
rtl8812au_cal_txdesc_chksum(ptxdesc);
/* ----- end of fill tx desc ----- */
/* */
@ -1119,7 +1145,7 @@ s32 rtl8812au_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
pipe = usb_sndbulkpipe(pdvobj->pusbdev, pHalData->Queue2EPNum[(u8)MGT_QUEUE_INX] & 0x0f);
usb_fill_bulk_urb(urb, pdvobj->pusbdev, pipe,
pxmit_skb->data, pxmit_skb->len, rtl8192cu_hostap_mgnt_xmit_cb, pxmit_skb);
pxmit_skb->data, pxmit_skb->len, rtl8812au_hostap_mgnt_xmit_cb, pxmit_skb);
urb->transfer_flags |= URB_ZERO_PACKET;
usb_anchor_urb(urb, &phostapdpriv->anchored);

View File

@ -483,6 +483,7 @@ struct pkt_attrib {
*/
u8 bf_pkt_type;
#endif
u8 inject; /* == a5 if injected */
};
#endif

View File

@ -0,0 +1,568 @@
rtw_radiotap.o: /root/Downloads/rtl8812au/os_dep/linux/rtw_radiotap.c \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kconfig.h \
include/generated/autoconf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/compiler_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/compiler-gcc.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kernel.h \
/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/linkage.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stringify.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/export.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/linkage.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stddef.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/stddef.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/int-ll64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/int-ll64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/bitsperlong.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitsperlong.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/bitsperlong.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/posix_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/posix_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/posix_types_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/posix_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/compiler.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/barrier.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/alternative.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/asm.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/nops.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/barrier.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kasan-checks.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bitops.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/bitops.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/rmwcc.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitops/find.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitops/sched.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/arch_hweight.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cpufeatures.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/required-features.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/disabled-features.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitops/const_hweight.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitops/le.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/byteorder.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/byteorder/little_endian.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/byteorder/little_endian.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/swab.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/swab.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/swab.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/byteorder/generic.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bitops/ext2-atomic-setbit.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/log2.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/typecheck.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/printk.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/init.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kern_levels.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cache.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/kernel.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/sysinfo.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cache.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dynamic_debug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/jump_label.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/jump_label.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/build_bug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/cfg80211.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netdevice.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/timer.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/list.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/poison.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/const.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ktime.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/time.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/seqlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/spinlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/preempt.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/preempt.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/percpu.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/percpu.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/threads.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/percpu-defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/thread_info.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bug.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/bug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/bug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/restart_block.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/current.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/thread_info.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/page.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/page_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mem_encrypt.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mem_encrypt.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/bootparam.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/screen_info.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/screen_info.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/apm_bios.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/apm_bios.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/ioctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/ioctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/ioctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/ioctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/edd.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/edd.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/ist.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/ist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/video/edid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/video/edid.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/page_64_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/kaslr.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/page_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/range.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/memory_model.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pfn.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/getorder.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cpufeature.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/processor.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/processor-flags.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/processor-flags.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/math_emu.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/ptrace.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/segment.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/ptrace.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/ptrace-abi.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/paravirt_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/desc_defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/kmap_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/kmap_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/pgtable_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/pgtable_64_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/sparsemem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/pgtable-nop4d.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/nospec-branch.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/alternative-asm.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/msr-index.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/spinlock_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/qspinlock_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/qrwlock_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/ptrace.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/sigcontext.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/msr.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/msr-index.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/errno.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/errno.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/errno-base.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cpumask.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cpumask.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bitmap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/string.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/string.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/string.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/string_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/msr.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/atomic.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cmpxchg.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/cmpxchg_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/atomic64_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/tracepoint-defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/atomic.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/atomic-long.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/static_key.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/paravirt.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/frame.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/special_insns.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/fpu/types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/unwind_hints.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/orc_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/personality.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/personality.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/math64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/div64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/div64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/err.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irqflags.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/irqflags.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bottom_half.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/spinlock_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/lockdep.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rwlock_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/spinlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/qspinlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/qspinlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/qrwlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/qrwlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rwlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/spinlock_api_smp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rwlock_api_smp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/time64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/time.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/time32.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/jiffies.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/timex.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/timex.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/param.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/param.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/param.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/param.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/timex.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/tsc.h \
include/generated/timeconst.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/timekeeping.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/errno.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/errno.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/timekeeping32.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/debugobjects.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/delay.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/delay.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/delay.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/prefetch.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/percpu.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mmdebug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/smp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/llist.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/smp.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mpspec.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mpspec_def.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/x86_init.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/apicdef.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/apic.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/fixmap.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/acpi.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/acpi/pdc_intel.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/numa.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/nodemask.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/numa.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/topology.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/topology.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mmu.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rwsem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/osq_lock.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/rwsem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mutex.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/debug_locks.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/realmode.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/io.h \
arch/x86/include/generated/asm/early_ioremap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/early_ioremap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/iomap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/pci_iomap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/xen/xen.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/xen/interface/xen.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/xen/interface.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/xen/interface_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/pvclock-abi.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/xen/hypervisor.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/io.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/vmalloc.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rbtree.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcupdate.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcutree.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/vsyscall.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/fixmap.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/io_apic.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/irq_vectors.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rculist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/workqueue.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dynamic_queue_limits.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ethtool.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/compat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stat.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/stat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/stat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/uidgid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/highuid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/sem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ipc.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rhashtable.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/jhash.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/unaligned/packed_struct.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/list_nulls.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/ipc.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/ipcbuf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/ipcbuf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/refcount.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/refcount.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/sembuf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/socket.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/socket.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/socket.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/sockios.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/sockios.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/sockios.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/uio.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/uio.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/socket.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/if.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/libc-compat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/hdlc/ioctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/fs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/wait_bit.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/wait.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/wait.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kdev_t.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/kdev_t.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dcache.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rculist_bl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/list_bl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bit_spinlock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/lockref.h \
include/generated/bounds.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stringhash.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/hash.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/path.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/list_lru.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/shrinker.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/radix-tree.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mm_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mm_types_task.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/tlbbatch.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/auxvec.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/auxvec.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/auxvec.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/completion.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/uprobes.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/uprobes.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/notifier.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/srcu.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcu_segcblist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/srcutree.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcu_node_tree.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/page-flags-layout.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/capability.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/capability.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/semaphore.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/fcntl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/fcntl.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/fcntl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/fcntl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/fiemap.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/migrate_mode.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/percpu-rwsem.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcuwait.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/rcu_sync.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/delayed_call.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/uuid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/uuid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/errseq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/fs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/limits.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/quota.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/percpu_counter.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/gfp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mmzone.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pageblock-flags.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/memory_hotplug.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mmzone.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/mmzone_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/topology.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/dqblk_xfs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dqblk_v1.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dqblk_v2.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dqblk_qtree.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/projid.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/quota.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/nfs_fs_i.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/aio_abi.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/uaccess.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/sched.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/shm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/shm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/hugetlb_encode.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/shmbuf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/shmbuf.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/shmparam.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kcov.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/kcov.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/plist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/hrtimer.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/timerqueue.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/seccomp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/seccomp.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/seccomp.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/unistd.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/unistd.h \
arch/x86/include/generated/uapi/asm/unistd_64.h \
arch/x86/include/generated/asm/unistd_64_x32.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/ia32_unistd.h \
arch/x86/include/generated/asm/unistd_32_ia32.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/seccomp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/unistd.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/resource.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/resource.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/resource.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/resource.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/resource.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/latencytop.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched/prio.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/signal_types.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/signal.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/signal.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/signal.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/signal-defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/uapi/asm/siginfo.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/asm-generic/siginfo.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/task_io_accounting.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/uaccess.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/smap.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/extable.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/uaccess_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/compat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched/task_stack.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/magic.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/user32.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/ethtool.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/if_ether.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/skbuff.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/net.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/random.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/once.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/random.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irqnr.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/irqnr.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/archrandom.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/net.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/textsearch.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/slab.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kmemleak.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kasan.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/checksum.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/checksum.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/checksum_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dma-mapping.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sizes.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/device.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ioport.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kobject.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sysfs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kernfs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/idr.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kobject_ns.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kref.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/klist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ratelimit.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/device.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pm_wakeup.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dma-debug.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dma-direction.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/scatterlist.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/mm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/percpu-refcount.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/page_ext.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stacktrace.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/stackdepot.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/page_ref.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/page-flags.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/memremap.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/pgtable.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/pgtable_64.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/pgtable.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/huge_mm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched/coredump.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/vmstat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/vm_event_item.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/dma-mapping.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/swiotlb.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/swiotlb.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/dma-contiguous.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netdev_features.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched/clock.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/flow_dissector.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/in6.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/in6.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/if_ether.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/splice.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/pipe_fs_i.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/if_packet.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/flow.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/net_namespace.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sysctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/sysctl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/core.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/mib.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/snmp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/snmp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/u64_stats_sync.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/unix.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/packet.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/ipv4.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/inet_frag.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/ipv6.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/dst_ops.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/ieee802154_6lowpan.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/sctp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/dccp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/netfilter.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netfilter_defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netfilter.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/in.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/in.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/x_tables.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/conntrack.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netfilter/nf_conntrack_tcp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netfilter/nf_conntrack_tcp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netfilter/nf_conntrack_dccp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netfilter/nf_conntrack_common.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netfilter/nf_conntrack_common.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netfilter/nf_conntrack_sctp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netfilter/nf_conntrack_sctp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/nftables.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/xfrm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/xfrm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/mpls.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netns/can.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ns_common.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/seq_file_net.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/seq_file.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cred.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/key.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/assoc_array.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/selinux.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/sched/user.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/dcbnl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/dcbnl.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/netprio_cgroup.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cgroup.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/cgroupstats.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/taskstats.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/nsproxy.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/user_namespace.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/kernel_stat.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/interrupt.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irqreturn.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/hardirq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ftrace_irq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/vtime.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/context_tracking_state.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/hardirq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irqhandler.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/io.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/irq.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/irq_regs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/irqdesc.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/hw_irq.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/profile.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/sections.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/asm-generic/sections.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cgroup-defs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/bpf-cgroup.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/bpf.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/bpf_common.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/cgroup_subsys.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/xdp.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/neighbour.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/netlink.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/scm.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/security.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netlink.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/netdevice.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/if_link.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/if_link.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/if_bonding.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/pkt_cls.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/pkt_sched.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/hashtable.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/debugfs.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/uapi/linux/nl80211.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/ieee80211.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/etherdevice.h \
/usr/src/linux-headers-4.16.0-kali2-common/arch/x86/include/asm/unaligned.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/unaligned/access_ok.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/linux/unaligned/generic.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/regulatory.h \
/usr/src/linux-headers-4.16.0-kali2-common/include/net/ieee80211_radiotap.h

370
os_dep/linux/rtw_radiotap.c Normal file
View File

@ -0,0 +1,370 @@
/*
* Radiotap parser
*
* Copyright 2007 Andy Green <andy@warmcat.com>
* Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
* See COPYING for more details.
*/
#include <linux/kernel.h>
#include <linux/export.h>
#include <net/cfg80211.h>
#include <net/ieee80211_radiotap.h>
#include <asm/unaligned.h>
/* function prototypes and related defs are in include/net/cfg80211.h */
static const struct radiotap_align_size rtap_namespace_sizes[] = {
[IEEE80211_RADIOTAP_TSFT] = { .align = 8, .size = 8, },
[IEEE80211_RADIOTAP_FLAGS] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_RATE] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_CHANNEL] = { .align = 2, .size = 4, },
[IEEE80211_RADIOTAP_FHSS] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_DBM_ANTSIGNAL] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_DBM_ANTNOISE] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_LOCK_QUALITY] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_TX_ATTENUATION] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_DB_TX_ATTENUATION] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_DBM_TX_POWER] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_ANTENNA] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_DB_ANTSIGNAL] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_DB_ANTNOISE] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_RX_FLAGS] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_TX_FLAGS] = { .align = 2, .size = 2, },
[IEEE80211_RADIOTAP_RTS_RETRIES] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_DATA_RETRIES] = { .align = 1, .size = 1, },
[IEEE80211_RADIOTAP_MCS] = { .align = 1, .size = 3, },
[IEEE80211_RADIOTAP_AMPDU_STATUS] = { .align = 4, .size = 8, },
[IEEE80211_RADIOTAP_VHT] = { .align = 2, .size = 12, },
/*
* add more here as they are defined in radiotap.h
*/
};
static const struct ieee80211_radiotap_namespace radiotap_ns = {
.n_bits = ARRAY_SIZE(rtap_namespace_sizes),
.align_size = rtap_namespace_sizes,
};
/**
* ieee80211_radiotap_iterator_init - radiotap parser iterator initialization
* @iterator: radiotap_iterator to initialize
* @radiotap_header: radiotap header to parse
* @max_length: total length we can parse into (eg, whole packet length)
*
* Returns: 0 or a negative error code if there is a problem.
*
* This function initializes an opaque iterator struct which can then
* be passed to ieee80211_radiotap_iterator_next() to visit every radiotap
* argument which is present in the header. It knows about extended
* present headers and handles them.
*
* How to use:
* call __ieee80211_radiotap_iterator_init() to init a semi-opaque iterator
* struct ieee80211_radiotap_iterator (no need to init the struct beforehand)
* checking for a good 0 return code. Then loop calling
* __ieee80211_radiotap_iterator_next()... it returns either 0,
* -ENOENT if there are no more args to parse, or -EINVAL if there is a problem.
* The iterator's @this_arg member points to the start of the argument
* associated with the current argument index that is present, which can be
* found in the iterator's @this_arg_index member. This arg index corresponds
* to the IEEE80211_RADIOTAP_... defines.
*
* Radiotap header length:
* You can find the CPU-endian total radiotap header length in
* iterator->max_length after executing ieee80211_radiotap_iterator_init()
* successfully.
*
* Alignment Gotcha:
* You must take care when dereferencing iterator.this_arg
* for multibyte types... the pointer is not aligned. Use
* get_unaligned((type *)iterator.this_arg) to dereference
* iterator.this_arg for type "type" safely on all arches.
*
* Example code:
* See Documentation/networking/radiotap-headers.txt
*/
int rtw_ieee80211_radiotap_iterator_init(
struct ieee80211_radiotap_iterator *iterator,
struct ieee80211_radiotap_header *radiotap_header,
int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns)
{
/* check the radiotap header can actually be present */
if (max_length < sizeof(struct ieee80211_radiotap_header))
return -EINVAL;
/* Linux only supports version 0 radiotap format */
if (radiotap_header->it_version)
return -EINVAL;
/* sanity check for allowed length and radiotap length field */
if (max_length < get_unaligned_le16(&radiotap_header->it_len))
return -EINVAL;
iterator->_rtheader = radiotap_header;
iterator->_max_length = get_unaligned_le16(&radiotap_header->it_len);
iterator->_arg_index = 0;
iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header);
iterator->_reset_on_ext = 0;
iterator->_next_bitmap = &radiotap_header->it_present;
iterator->_next_bitmap++;
iterator->_vns = vns;
iterator->current_namespace = &radiotap_ns;
iterator->is_radiotap_ns = 1;
/* find payload start allowing for extended bitmap(s) */
if (iterator->_bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT)) {
if ((unsigned long)iterator->_arg -
(unsigned long)iterator->_rtheader + sizeof(uint32_t) >
(unsigned long)iterator->_max_length)
return -EINVAL;
while (get_unaligned_le32(iterator->_arg) &
(1 << IEEE80211_RADIOTAP_EXT)) {
iterator->_arg += sizeof(uint32_t);
/*
* check for insanity where the present bitmaps
* keep claiming to extend up to or even beyond the
* stated radiotap header length
*/
if ((unsigned long)iterator->_arg -
(unsigned long)iterator->_rtheader +
sizeof(uint32_t) >
(unsigned long)iterator->_max_length)
return -EINVAL;
}
iterator->_arg += sizeof(uint32_t);
/*
* no need to check again for blowing past stated radiotap
* header length, because ieee80211_radiotap_iterator_next
* checks it before it is dereferenced
*/
}
iterator->this_arg = iterator->_arg;
/* we are all initialized happily */
return 0;
}
EXPORT_SYMBOL(rtw_ieee80211_radiotap_iterator_init);
static void find_ns(struct ieee80211_radiotap_iterator *iterator,
uint32_t oui, uint8_t subns)
{
int i;
iterator->current_namespace = NULL;
if (!iterator->_vns)
return;
for (i = 0; i < iterator->_vns->n_ns; i++) {
if (iterator->_vns->ns[i].oui != oui)
continue;
if (iterator->_vns->ns[i].subns != subns)
continue;
iterator->current_namespace = &iterator->_vns->ns[i];
break;
}
}
/**
* ieee80211_radiotap_iterator_next - return next radiotap parser iterator arg
* @iterator: radiotap_iterator to move to next arg (if any)
*
* Returns: 0 if there is an argument to handle,
* -ENOENT if there are no more args or -EINVAL
* if there is something else wrong.
*
* This function provides the next radiotap arg index (IEEE80211_RADIOTAP_*)
* in @this_arg_index and sets @this_arg to point to the
* payload for the field. It takes care of alignment handling and extended
* present fields. @this_arg can be changed by the caller (eg,
* incremented to move inside a compound argument like
* IEEE80211_RADIOTAP_CHANNEL). The args pointed to are in
* little-endian format whatever the endianess of your CPU.
*
* Alignment Gotcha:
* You must take care when dereferencing iterator.this_arg
* for multibyte types... the pointer is not aligned. Use
* get_unaligned((type *)iterator.this_arg) to dereference
* iterator.this_arg for type "type" safely on all arches.
*/
int rtw_ieee80211_radiotap_iterator_next(
struct ieee80211_radiotap_iterator *iterator)
{
while (1) {
int hit = 0;
int pad, align, size, subns;
uint32_t oui;
/* if no more EXT bits, that's it */
if ((iterator->_arg_index % 32) == IEEE80211_RADIOTAP_EXT &&
!(iterator->_bitmap_shifter & 1))
return -ENOENT;
if (!(iterator->_bitmap_shifter & 1))
goto next_entry; /* arg not present */
/* get alignment/size of data */
switch (iterator->_arg_index % 32) {
case IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE:
case IEEE80211_RADIOTAP_EXT:
align = 1;
size = 0;
break;
case IEEE80211_RADIOTAP_VENDOR_NAMESPACE:
align = 2;
size = 6;
break;
default:
if (!iterator->current_namespace ||
iterator->_arg_index >= iterator->current_namespace->n_bits) {
if (iterator->current_namespace == &radiotap_ns)
return -ENOENT;
align = 0;
} else {
align = iterator->current_namespace->align_size[iterator->_arg_index].align;
size = iterator->current_namespace->align_size[iterator->_arg_index].size;
}
if (!align) {
/* skip all subsequent data */
iterator->_arg = iterator->_next_ns_data;
/* give up on this namespace */
iterator->current_namespace = NULL;
goto next_entry;
}
break;
}
/*
* arg is present, account for alignment padding
*
* Note that these alignments are relative to the start
* of the radiotap header. There is no guarantee
* that the radiotap header itself is aligned on any
* kind of boundary.
*
* The above is why get_unaligned() is used to dereference
* multibyte elements from the radiotap area.
*/
pad = ((unsigned long)iterator->_arg -
(unsigned long)iterator->_rtheader) & (align - 1);
if (pad)
iterator->_arg += align - pad;
if (iterator->_arg_index % 32 == IEEE80211_RADIOTAP_VENDOR_NAMESPACE) {
int vnslen;
if ((unsigned long)iterator->_arg + size -
(unsigned long)iterator->_rtheader >
(unsigned long)iterator->_max_length)
return -EINVAL;
oui = (*iterator->_arg << 16) |
(*(iterator->_arg + 1) << 8) |
*(iterator->_arg + 2);
subns = *(iterator->_arg + 3);
find_ns(iterator, oui, subns);
vnslen = get_unaligned_le16(iterator->_arg + 4);
iterator->_next_ns_data = iterator->_arg + size + vnslen;
if (!iterator->current_namespace)
size += vnslen;
}
/*
* this is what we will return to user, but we need to
* move on first so next call has something fresh to test
*/
iterator->this_arg_index = iterator->_arg_index;
iterator->this_arg = iterator->_arg;
iterator->this_arg_size = size;
/* internally move on the size of this arg */
iterator->_arg += size;
/*
* check for insanity where we are given a bitmap that
* claims to have more arg content than the length of the
* radiotap section. We will normally end up equalling this
* max_length on the last arg, never exceeding it.
*/
if ((unsigned long)iterator->_arg -
(unsigned long)iterator->_rtheader >
(unsigned long)iterator->_max_length)
return -EINVAL;
/* these special ones are valid in each bitmap word */
switch (iterator->_arg_index % 32) {
case IEEE80211_RADIOTAP_VENDOR_NAMESPACE:
iterator->_reset_on_ext = 1;
iterator->is_radiotap_ns = 0;
/*
* If parser didn't register this vendor
* namespace with us, allow it to show it
* as 'raw. Do do that, set argument index
* to vendor namespace.
*/
iterator->this_arg_index =
IEEE80211_RADIOTAP_VENDOR_NAMESPACE;
if (!iterator->current_namespace)
hit = 1;
goto next_entry;
case IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE:
iterator->_reset_on_ext = 1;
iterator->current_namespace = &radiotap_ns;
iterator->is_radiotap_ns = 1;
goto next_entry;
case IEEE80211_RADIOTAP_EXT:
/*
* bit 31 was set, there is more
* -- move to next u32 bitmap
*/
iterator->_bitmap_shifter =
get_unaligned_le32(iterator->_next_bitmap);
iterator->_next_bitmap++;
if (iterator->_reset_on_ext)
iterator->_arg_index = 0;
else
iterator->_arg_index++;
iterator->_reset_on_ext = 0;
break;
default:
/* we've got a hit! */
hit = 1;
next_entry:
iterator->_bitmap_shifter >>= 1;
iterator->_arg_index++;
}
/* if we found a valid arg earlier, return it now */
if (hit)
return 0;
}
}
EXPORT_SYMBOL(rtw_ieee80211_radiotap_iterator_next);