/freebsd/tools/tools/net80211/w00t/ap/ |
H A D | ap.c | 90 void fill_basic(struct ieee80211_frame *wh, struct params *p) in fill_basic() argument 94 wh->i_dur[0] = 0x69; in fill_basic() 95 wh->i_dur[1] = 0x00; in fill_basic() 97 memcpy(wh->i_addr2, p->mac, 6); in fill_basic() 99 seq = (short*)wh->i_seq; in fill_basic() 117 int fill_beacon(struct params *p, struct ieee80211_frame *wh) in fill_beacon() argument 122 ptr = (char*) (wh+1); in fill_beacon() 148 return ptr - ((char*) wh); in fill_beacon() 154 struct ieee80211_frame *wh; in send_beacon() local 158 wh = (struct ieee80211_frame*) buf; in send_beacon() [all …]
|
/freebsd/tools/tools/net80211/w00t/assoc/ |
H A D | assoc.c | 83 void fill_basic(struct ieee80211_frame *wh, struct params *p) in fill_basic() argument 87 wh->i_dur[0] = 0x69; in fill_basic() 88 wh->i_dur[1] = 0x00; in fill_basic() 90 memcpy(wh->i_addr1, p->ap, 6); in fill_basic() 91 memcpy(wh->i_addr2, p->mac, 6); in fill_basic() 92 memcpy(wh->i_addr3, p->bssid, 6); in fill_basic() 94 seq = (short*)wh->i_seq; in fill_basic() 116 struct ieee80211_frame *wh; in send_probe_request() local 122 wh = (struct ieee80211_frame*) buf; in send_probe_request() 123 fill_basic(wh, p); in send_probe_request() [all …]
|
/freebsd/tools/tools/net80211/w00t/expand/ |
H A D | expand.c | 50 struct ieee80211_frame *wh; member 84 int wanted(struct params *p, struct ieee80211_frame *wh, int len) in wanted() argument 88 if (wh->i_fc[1] & IEEE80211_FC1_DIR_TODS) { in wanted() 89 bssid = wh->i_addr1; in wanted() 90 sa = wh->i_addr2; in wanted() 93 bssid = wh->i_addr2; in wanted() 94 sa = wh->i_addr3; in wanted() 100 if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { in wanted() 112 void enque(struct params *p, char **buf, struct ieee80211_frame *wh, int len) in enque() argument 152 q->wh = wh; in enque() [all …]
|
/freebsd/tools/tools/net80211/w00t/prga/ |
H A D | prga.c | 148 int is_arp(struct ieee80211_frame *wh, int len) in is_arp() argument 151 if (len > (sizeof(*wh) + 4 + 4 + 39)) in is_arp() 161 struct ieee80211_frame *wh; in get_prga() local 170 wh = get_wifi(buf, &rc); in get_prga() 171 if (!wh) in get_prga() 174 if (!frame_type(wh, IEEE80211_FC0_TYPE_DATA, in get_prga() 178 if (is_arp(wh, rc)) in get_prga() 183 if (wh->i_fc[1] & IEEE80211_FC1_DIR_TODS) in get_prga() 184 bssid = wh->i_addr1; in get_prga() 186 bssid = wh->i_addr2; in get_prga() [all …]
|
/freebsd/tools/tools/net80211/w00t/redir/ |
H A D | redir.c | 51 struct ieee80211_frame *wh; member 125 int wanted(struct params *p, struct ieee80211_frame *wh, int len) in wanted() argument 129 if (wh->i_fc[1] & IEEE80211_FC1_DIR_TODS) { in wanted() 130 bssid = wh->i_addr1; in wanted() 131 sa = wh->i_addr2; in wanted() 134 bssid = wh->i_addr2; in wanted() 135 sa = wh->i_addr3; in wanted() 141 if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { in wanted() 153 void enque(struct params *p, char **buf, struct ieee80211_frame *wh, int len) in enque() argument 193 q->wh = wh; in enque() [all …]
|
/freebsd/tools/tools/net80211/wesside/wesside/ |
H A D | wesside.c | 81 struct ieee80211_frame wh; member 584 void fill_basic(struct ieee80211_frame* wh) { in fill_basic() argument 587 memcpy(wh->i_addr1, victim.bss, 6); in fill_basic() 588 memcpy(wh->i_addr2, mymac, 6); in fill_basic() 589 memcpy(wh->i_addr3, victim.bss, 6); in fill_basic() 593 sp = (unsigned short*) wh->i_seq; in fill_basic() 596 sp = (unsigned short*) wh->i_dur; in fill_basic() 602 struct ieee80211_frame* wh = (struct ieee80211_frame*) buf; in send_assoc() local 607 fill_basic(wh); in send_assoc() 608 wh->i_fc[0] |= IEEE80211_FC0_TYPE_MGT | IEEE80211_FC0_SUBTYPE_ASSOC_REQ; in send_assoc() [all …]
|
/freebsd/sys/net80211/ |
H A D | ieee80211_adhoc.c | 311 struct ieee80211_frame *wh; in adhoc_input() local 337 wh = mtod(m, struct ieee80211_frame *); in adhoc_input() 339 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in adhoc_input() 341 hdrspace = ieee80211_hdrspace(ic, wh); /* XXX optimize? */ in adhoc_input() 363 wh = mtod(m, struct ieee80211_frame *); in adhoc_input() 365 if (!IEEE80211_IS_FC0_CHECK_VER(wh, IEEE80211_FC0_VERSION_0)) { in adhoc_input() 368 wh->i_fc[0], wh->i_fc[1]); in adhoc_input() 373 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in adhoc_input() 374 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in adhoc_input() 375 subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; in adhoc_input() [all …]
|
H A D | ieee80211_hostap.c | 481 struct ieee80211_frame *wh; in hostap_input() local 507 wh = mtod(m, struct ieee80211_frame *); in hostap_input() 509 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in hostap_input() 511 hdrspace = ieee80211_hdrspace(ic, wh); /* XXX optimize? */ in hostap_input() 533 wh = mtod(m, struct ieee80211_frame *); in hostap_input() 535 if (!IEEE80211_IS_FC0_CHECK_VER(wh, IEEE80211_FC0_VERSION_0)) { in hostap_input() 538 wh->i_fc[0], wh->i_fc[1]); in hostap_input() 543 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in hostap_input() 544 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in hostap_input() 545 subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; in hostap_input() [all …]
|
H A D | ieee80211_sta.c | 477 isdstods_mcastecho(struct ieee80211vap *vap, const struct ieee80211_frame *wh) in isdstods_mcastecho() argument 479 #define QWH4(wh) ((const struct ieee80211_qosframe_addr4 *)wh) in isdstods_mcastecho() argument 480 #define WH4(wh) ((const struct ieee80211_frame_addr4 *)wh) in isdstods_mcastecho() argument 485 if (!IEEE80211_IS_MULTICAST(wh->i_addr3)) in isdstods_mcastecho() 487 sa = IEEE80211_QOS_HAS_SEQ(wh) ? QWH4(wh)->i_addr4 : WH4(wh)->i_addr4; in isdstods_mcastecho() 498 isfromds_mcastecho(struct ieee80211vap *vap, const struct ieee80211_frame *wh) in isfromds_mcastecho() argument 502 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) in isfromds_mcastecho() 504 return IEEE80211_ADDR_EQ(wh->i_addr3, vap->iv_myaddr); in isfromds_mcastecho() 542 struct ieee80211_frame *wh; in sta_input() local 562 wh = mtod(m, struct ieee80211_frame *); in sta_input() [all …]
|
H A D | ieee80211_wds.c | 413 struct ieee80211_frame *wh; in wds_input() local 438 wh = mtod(m, struct ieee80211_frame *); in wds_input() 440 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in wds_input() 442 hdrspace = ieee80211_hdrspace(ic, wh); /* XXX optimize? */ in wds_input() 463 wh = mtod(m, struct ieee80211_frame *); in wds_input() 465 if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) in wds_input() 468 if (!IEEE80211_IS_FC0_CHECK_VER(wh, IEEE80211_FC0_VERSION_0)) { in wds_input() 471 wh->i_fc[0], wh->i_fc[1]); in wds_input() 476 dir = wh->i_fc[1] & IEEE80211_FC1_DIR_MASK; in wds_input() 477 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in wds_input() [all …]
|
H A D | ieee80211_input.c | 176 struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); in ieee80211_defrag() local 180 uint8_t more_frag = wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG; in ieee80211_defrag() 183 KASSERT(!IEEE80211_IS_MULTICAST(wh->i_addr1), ("multicast fragm?")); in ieee80211_defrag() 185 rxseq = le16toh(*(uint16_t *)wh->i_seq); in ieee80211_defrag() 195 wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; in ieee80211_defrag() 232 IEEE80211_ADDR_EQ(wh->i_addr1, lwh->i_addr1) && in ieee80211_defrag() 233 IEEE80211_ADDR_EQ(wh->i_addr2, lwh->i_addr2) && in ieee80211_defrag() 234 !((wh->i_fc[1] ^ lwh->i_fc[1]) & IEEE80211_FC1_PROTECTED)) { in ieee80211_defrag() 237 *(uint16_t *) lwh->i_seq = *(uint16_t *) wh->i_seq; in ieee80211_defrag() 267 wh = mtod(mfrag, struct ieee80211_frame *); in ieee80211_defrag() [all …]
|
H A D | ieee80211_output.c | 599 struct ieee80211_frame *wh; in ieee80211_validate_frame() local 605 wh = mtod(m, struct ieee80211_frame *); in ieee80211_validate_frame() 606 if (!IEEE80211_IS_FC0_CHECK_VER(wh, IEEE80211_FC0_VERSION_0)) in ieee80211_validate_frame() 609 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in ieee80211_validate_frame() 611 if ((wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) != in ieee80211_validate_frame() 616 (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) != 0) in ieee80211_validate_frame() 623 (IEEE80211_IS_PROTECTED(wh))) { in ieee80211_validate_frame() 626 subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; in ieee80211_validate_frame() 638 wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; in ieee80211_validate_frame() 641 if (m->m_pkthdr.len < ieee80211_anyhdrsize(wh)) in ieee80211_validate_frame() [all …]
|
H A D | ieee80211.h | 195 #define IEEE80211_IS_FC0_CHECK_VER(wh, v) \ argument 196 (((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v)) 199 #define IEEE80211_IS_FC0_CHECK_VER_TYPE(wh, v, t) \ argument 200 (((((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v))) && \ 201 (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == (t))) 204 #define IEEE80211_IS_FC0_CHECK_VER_TYPE_SUBTYPE(wh, v, t, st) \ argument 205 (((((wh)->i_fc[0] & IEEE80211_FC0_VERSION_MASK) == (v))) && \ 206 (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == (t)) && \ 207 (((wh)->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == (st))) 209 #define IEEE80211_IS_MGMT(wh) \ argument [all …]
|
H A D | ieee80211_crypto_tkip.c | 180 struct ieee80211_frame *wh; in tkip_encap() local 185 wh = mtod(m, struct ieee80211_frame *); in tkip_encap() 186 is_mgmt = IEEE80211_IS_MGMT(wh); in tkip_encap() 193 struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); in tkip_encap() local 196 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, in tkip_encap() 241 struct ieee80211_frame *wh; in tkip_enmic() local 244 wh = mtod(m, struct ieee80211_frame *); in tkip_enmic() 245 is_mgmt = IEEE80211_IS_MGMT(wh); in tkip_enmic() 256 struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); in tkip_enmic() local 264 hdrlen = ieee80211_hdrspace(ic, wh); in tkip_enmic() [all …]
|
H A D | ieee80211_crypto_ccmp.c | 165 const struct ieee80211_frame *wh; in ccmp_encap() local 173 wh = mtod(m, const struct ieee80211_frame *); in ccmp_encap() 174 is_mgmt = IEEE80211_IS_MGMT(wh); in ccmp_encap() 238 struct ieee80211_frame *wh; in ccmp_decap() local 251 wh = mtod(m, struct ieee80211_frame *); in ccmp_decap() 257 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, in ccmp_decap() 262 tid = ieee80211_gettid(wh); in ccmp_decap() 269 ieee80211_notify_replay_failure(vap, wh, k, pn, tid); in ccmp_decap() 343 ccmp_init_blocks(rijndael_ctx *ctx, struct ieee80211_frame *wh, in ccmp_init_blocks() argument 348 #define IS_QOS_DATA(wh) IEEE80211_QOS_HAS_SEQ(wh) in ccmp_init_blocks() argument [all …]
|
H A D | ieee80211_proto.h | 173 const struct ieee80211_frame *wh = data; in ieee80211_hdrsize() local 177 KASSERT((wh->i_fc[0]&IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_CTL, in ieee80211_hdrsize() 179 if (IEEE80211_IS_DSTODS(wh)) in ieee80211_hdrsize() 181 if (IEEE80211_QOS_HAS_SEQ(wh)) in ieee80211_hdrsize() 192 const struct ieee80211_frame *wh = data; in ieee80211_anyhdrsize() local 194 if ((wh->i_fc[0]&IEEE80211_FC0_TYPE_MASK) == IEEE80211_FC0_TYPE_CTL) { in ieee80211_anyhdrsize() 195 switch (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) { in ieee80211_anyhdrsize() 237 const struct ieee80211_frame *wh); 316 struct ieee80211_frame *wh = data; in ieee80211_getqos() local 318 KASSERT(IEEE80211_QOS_HAS_SEQ(wh), ("QoS field is absent!")); in ieee80211_getqos() [all …]
|
H A D | ieee80211_input.h | 34 wh, NULL, "%s", "no " #__elem ); \ 39 wh, NULL, "bad " #__elem " len %d", (__elem)[1]); \ 48 wh, NULL, "ie too short, got %d, expected %d", \ 66 wh->i_addr2, _ssid); \ 193 ieee80211_check_rxseq(struct ieee80211_node *ni, struct ieee80211_frame *wh, in ieee80211_check_rxseq() argument 206 rxseq = le16toh(*(uint16_t *)wh->i_seq); in ieee80211_check_rxseq() 207 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in ieee80211_check_rxseq() 208 subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; in ieee80211_check_rxseq() 221 if (IEEE80211_IS_MULTICAST(wh->i_addr1)) in ieee80211_check_rxseq() 224 tid = ieee80211_gettid(wh); in ieee80211_check_rxseq() [all …]
|
H A D | ieee80211_mesh.c | 1147 const struct ieee80211_frame *wh = in mesh_forward() local 1164 IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, in mesh_forward() 1170 IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, in mesh_forward() 1177 IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, in mesh_forward() 1183 mcopy = m_pullup(mcopy, ieee80211_hdrspace(ic, wh) + in mesh_forward() 1186 IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, in mesh_forward() 1195 (mtod(mcopy, uint8_t *) + ieee80211_hdrspace(ic, wh)); in mesh_forward() 1199 if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { in mesh_forward() 1211 IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, in mesh_forward() 1251 #define WHDIR(wh) ((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) in mesh_decap() argument [all …]
|
H A D | ieee80211_crypto_none.c | 103 struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); in none_encap() local 112 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr1, in none_encap() 124 struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *); in none_decap() local 125 const uint8_t *ivp = (const uint8_t *)&wh[1]; in none_decap() 133 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2, in none_decap()
|
/freebsd/tools/tools/net80211/wlaninject/ |
H A D | wlaninject.c | 295 int header_len(struct ieee80211_frame *wh) in header_len() argument 297 int len = sizeof(*wh); in header_len() 299 switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { in header_len() 301 switch (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) { in header_len() 341 wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK); in header_len() 346 switch (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) { in header_len() 370 wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK); in header_len() 375 if (wh->i_fc[1] & IEEE80211_FC1_DIR_DSTODS) in header_len() 376 len += sizeof(wh->i_addr1); in header_len() 381 wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK); in header_len() [all …]
|
/freebsd/tools/tools/net80211/w00t/libw00t/ |
H A D | w00t.c | 79 unsigned short seqno(struct ieee80211_frame *wh) in seqno() argument 81 unsigned short *s = (unsigned short*) wh->i_seq; in seqno() 303 int wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen) in wep_decrypt() argument 307 char *p = (char*) (wh+1); in wep_decrypt() 317 len -= sizeof(*wh); in wep_decrypt() 331 void wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen) in wep_encrypt() argument 335 char *p = (char*) (wh+1); in wep_encrypt() 345 len -= sizeof(*wh); in wep_encrypt() 354 int frame_type(struct ieee80211_frame *wh, int type, int stype) in frame_type() argument 356 if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != type) in frame_type() [all …]
|
H A D | w00t.h | 44 unsigned short seqno(struct ieee80211_frame *wh); 48 int wep_decrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 49 void wep_encrypt(struct ieee80211_frame *wh, int len, char *key, int klen); 50 int frame_type(struct ieee80211_frame *wh, int type, int stype); 53 char *known_pt(struct ieee80211_frame *wh, int *len);
|
/freebsd/sys/netgraph/ |
H A D | ng_pppoe.c | 410 struct pppoe_full_hdr *wh = &sp->neg->pkt->pkt_header; in make_packet() local 421 dp = (char *)(&wh->ph + 1); in make_packet() 426 if ((length + tlen) > (ETHER_MAX_LEN - 4 - sizeof(*wh))) { in make_packet() 435 wh->ph.length = htons(length); in make_packet() 436 sp->neg->m->m_len = length + sizeof(*wh); in make_packet() 437 sp->neg->m->m_pkthdr.len = length + sizeof(*wh); in make_packet() 596 pppoe_findsession(priv_p privp, const struct pppoe_full_hdr *wh) in pppoe_findsession() argument 598 uint16_t session = ntohs(wh->ph.sid); in pppoe_findsession() 606 wh->eh.ether_shost, ETHER_ADDR_LEN) == 0) { in pppoe_findsession() 1159 struct pppoe_full_hdr *wh; in ng_pppoe_rcvmsg() local [all …]
|
/freebsd/sys/compat/linuxkpi/common/include/net/ |
H A D | ipv6.h | 70 static inline void __ipv6_addr_set_half(__be32 *addr, __be32 wh, __be32 wl) in __ipv6_addr_set_half() argument 74 if (__builtin_constant_p(wh) && __builtin_constant_p(wl)) { in __ipv6_addr_set_half() 75 *(__force u64 *)addr = ((__force u64)(wh) << 32 | (__force u64)(wl)); in __ipv6_addr_set_half() 79 if (__builtin_constant_p(wl) && __builtin_constant_p(wh)) { in __ipv6_addr_set_half() 80 *(__force u64 *)addr = ((__force u64)(wl) << 32 | (__force u64)(wh)); in __ipv6_addr_set_half() 85 addr[0] = wh; in __ipv6_addr_set_half()
|
/freebsd/sys/dev/rtwn/ |
H A D | if_rtwn_tx.c | 116 struct ieee80211_frame *wh; in rtwn_tx_data() local 125 wh = mtod(m, struct ieee80211_frame *); in rtwn_tx_data() 126 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in rtwn_tx_data() 127 ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); in rtwn_tx_data() 156 if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { in rtwn_tx_data() 167 wh = mtod(m, struct ieee80211_frame *); in rtwn_tx_data() 195 struct ieee80211_frame *wh; in rtwn_tx_raw() local 215 wh = mtod(m, struct ieee80211_frame *); in rtwn_tx_raw() 216 type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; in rtwn_tx_raw()
|