Home
last modified time | relevance | path

Searched refs:l2 (Results 1 – 25 of 25) sorted by relevance

/hostap-latest/src/l2_packet/
Dl2_packet_winpcap.c65 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
67 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
72 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
78 if (l2 == NULL) in l2_packet_send()
81 if (l2->l2_hdr) { in l2_packet_send()
82 ret = pcap_sendpacket(l2->pcap, buf, len); in l2_packet_send()
90 os_memcpy(eth->h_source, l2->own_addr, ETH_ALEN); in l2_packet_send()
93 ret = pcap_sendpacket(l2->pcap, (u8 *) eth, mlen); in l2_packet_send()
105 struct l2_packet_data *l2 = (struct l2_packet_data *) user; in l2_packet_receive_cb() local
112 if (l2->l2_hdr) { in l2_packet_receive_cb()
[all …]
Dl2_packet_pcap.c43 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
45 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
51 static int l2_packet_init_libdnet(struct l2_packet_data *l2) in l2_packet_init_libdnet() argument
55 l2->eth = eth_open(l2->ifname); in l2_packet_init_libdnet()
56 if (!l2->eth) { in l2_packet_init_libdnet()
59 l2->ifname, strerror(errno)); in l2_packet_init_libdnet()
63 if (eth_get(l2->eth, &own_addr) < 0) { in l2_packet_init_libdnet()
66 l2->ifname, strerror(errno)); in l2_packet_init_libdnet()
67 eth_close(l2->eth); in l2_packet_init_libdnet()
68 l2->eth = NULL; in l2_packet_init_libdnet()
[all …]
Dl2_packet_linux.c108 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
110 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
115 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
122 if (l2 == NULL) in l2_packet_send()
124 if (l2->l2_hdr) { in l2_packet_send()
125 ret = send(l2->fd, buf, len, 0); in l2_packet_send()
133 ll.sll_ifindex = l2->ifindex; in l2_packet_send()
137 ret = sendto(l2->fd, buf, len, 0, (struct sockaddr *) &ll, in l2_packet_send()
150 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
170 if (l2->fd_br_rx >= 0) { in l2_packet_receive()
[all …]
Dl2_packet_ndis.c56 struct l2_packet_data *l2[2]; member
84 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
86 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
91 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
102 if (l2 == NULL) in l2_packet_send()
112 if (l2->l2_hdr) { in l2_packet_send()
122 os_memcpy(eth->h_source, l2->own_addr, ETH_ALEN); in l2_packet_send()
157 static void l2_packet_callback(struct l2_packet_data *l2);
160 static void l2_packet_rx_thread_try_read(struct l2_packet_data *l2) in l2_packet_rx_thread_try_read() argument
165 if (!ReadFile(driver_ndis_get_ndisuio_handle(), l2->rx_buf, in l2_packet_rx_thread_try_read()
[all …]
Dl2_packet_privsep.c29 static int wpa_priv_cmd(struct l2_packet_data *l2, int cmd, in wpa_priv_cmd() argument
43 msg.msg_name = &l2->priv_addr; in wpa_priv_cmd()
44 msg.msg_namelen = sizeof(l2->priv_addr); in wpa_priv_cmd()
46 if (sendmsg(l2->fd, &msg, 0) < 0) { in wpa_priv_cmd()
55 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
57 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
62 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
81 msg.msg_name = &l2->priv_addr; in l2_packet_send()
82 msg.msg_namelen = sizeof(l2->priv_addr); in l2_packet_send()
84 if (sendmsg(l2->fd, &msg, 0) < 0) { in l2_packet_send()
[all …]
Dl2_packet_zephyr.c35 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
37 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
41 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
46 if (l2 == NULL) { in l2_packet_send()
50 if (l2->l2_hdr) { in l2_packet_send()
51 ret = send(l2->fd, buf, len, 0); in l2_packet_send()
61 ll.sll_ifindex = l2->ifindex; in l2_packet_send()
66 ret = sendto(l2->fd, buf, len, 0, (struct sockaddr *) &ll, in l2_packet_send()
78 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
103 l2->rx_callback(l2->rx_callback_ctx, ll.sll_addr, buf, res); in l2_packet_receive()
[all …]
Dl2_packet_freebsd.c52 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
54 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
59 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
62 if (!l2->l2_hdr) { in l2_packet_send()
68 os_memcpy(eth->h_source, l2->own_addr, ETH_ALEN); in l2_packet_send()
71 ret = pcap_inject(l2->pcap, (u8 *) eth, len + sizeof(*eth)); in l2_packet_send()
75 return pcap_inject(l2->pcap, buf, len); in l2_packet_send()
81 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
91 if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) in l2_packet_receive()
95 if (l2->l2_hdr) { in l2_packet_receive()
[all …]
Dl2_packet_none.c30 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
32 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
37 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
40 if (l2 == NULL) in l2_packet_send()
54 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
62 l2->rx_callback(l2->rx_callback_ctx, NULL /* TODO: src addr */, in l2_packet_receive()
73 struct l2_packet_data *l2; in l2_packet_init() local
75 l2 = os_zalloc(sizeof(struct l2_packet_data)); in l2_packet_init()
76 if (l2 == NULL) in l2_packet_init()
78 os_strlcpy(l2->ifname, ifname, sizeof(l2->ifname)); in l2_packet_init()
[all …]
Dl2_packet.h92 void l2_packet_deinit(struct l2_packet_data *l2);
100 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr);
114 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto,
131 int l2_packet_get_ip_addr(struct l2_packet_data *l2, char *buf, size_t len);
145 void l2_packet_notify_auth_start(struct l2_packet_data *l2);
156 int l2_packet_set_packet_filter(struct l2_packet_data *l2,
/hostap-latest/src/ap/
Dx_snoop.c75 struct l2_packet_data *l2; in x_snoop_get_l2_packet() local
77 l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1); in x_snoop_get_l2_packet()
78 if (l2 == NULL) { in x_snoop_get_l2_packet()
85 if (l2_packet_set_packet_filter(l2, type)) { in x_snoop_get_l2_packet()
89 l2_packet_deinit(l2); in x_snoop_get_l2_packet()
93 return l2; in x_snoop_get_l2_packet()
Deth_p_oui.c27 struct l2_packet_data *l2; member
120 iface->l2 = l2_packet_init(ifname, NULL, ETH_P_OUI, eth_p_rx, in eth_p_oui_register()
122 if (!iface->l2) { in eth_p_oui_register()
155 l2_packet_deinit(iface->l2); in eth_p_oui_unregister()
188 ret = l2_packet_send(iface->l2, NULL, 0, packet, packet_len); in eth_p_oui_send()
Dpreauth_auth.c35 struct l2_packet_data *l2; member
113 piface->l2 = l2_packet_init(piface->ifname, NULL, ETH_P_PREAUTH, in rsn_preauth_iface_add()
115 if (piface->l2 == NULL) { in rsn_preauth_iface_add()
142 l2_packet_deinit(prev->l2); in rsn_preauth_iface_deinit()
259 if (l2_packet_send(piface->l2, sta->addr, ETH_P_PREAUTH, (u8 *) ethhdr, in rsn_preauth_send()
Dwpa_auth_glue.c810 if (hapd->l2 == NULL) in hostapd_wpa_auth_send_ether()
820 ret = l2_packet_send(hapd->l2, dst, proto, (u8 *) buf, in hostapd_wpa_auth_send_ether()
1815 hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, in hostapd_setup_wpa()
1817 if (!hapd->l2) { in hostapd_setup_wpa()
1875 l2_packet_deinit(hapd->l2); in hostapd_deinit_wpa()
1876 hapd->l2 = NULL; in hostapd_deinit_wpa()
Dhostapd.h249 struct l2_packet_data *l2; member
/hostap-latest/src/drivers/
Ddriver_roboswitch.c57 struct l2_packet_data *l2; member
215 drv->l2 = l2_packet_init(drv->ifname, NULL, ETH_P_ALL, in wpa_driver_roboswitch_set_param()
218 if (drv->l2 == NULL) { in wpa_driver_roboswitch_set_param()
224 l2_packet_get_own_addr(drv->l2, drv->own_addr); in wpa_driver_roboswitch_set_param()
227 drv->l2 = NULL; in wpa_driver_roboswitch_set_param()
463 if (drv->l2) { in wpa_driver_roboswitch_deinit()
464 l2_packet_deinit(drv->l2); in wpa_driver_roboswitch_deinit()
465 drv->l2 = NULL; in wpa_driver_roboswitch_deinit()
Ddriver_zephyr.c2535 ret = l2_packet_send(hapd->l2, addr, ETH_P_EAPOL, data, data_len); in wpa_drv_hapd_send_eapol()
2556 ret = l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data, data_len); in wpa_drv_hapd_send_eapol()
/hostap-latest/wpa_supplicant/
Dwpa_priv.c42 struct l2_packet_data *l2[WPA_PRIV_MAX_L2]; member
74 if (iface->l2[i]) { in wpa_priv_cmd_register()
77 l2_packet_deinit(iface->l2[i]); in wpa_priv_cmd_register()
78 iface->l2[i] = NULL; in wpa_priv_cmd_register()
509 if (!iface->l2[idx]) in wpa_priv_cmd_l2_register()
522 iface->l2[idx] = l2_packet_init(iface->ifname, NULL, proto, in wpa_priv_cmd_l2_register()
525 if (!iface->l2[idx]) { in wpa_priv_cmd_l2_register()
531 if (l2_packet_get_own_addr(iface->l2[idx], own_addr) < 0) { in wpa_priv_cmd_l2_register()
534 l2_packet_deinit(iface->l2[idx]); in wpa_priv_cmd_l2_register()
535 iface->l2[idx] = NULL; in wpa_priv_cmd_l2_register()
[all …]
Dpreauth_test.c229 struct l2_packet_data *l2; in wpa_init_conf() local
264 l2 = l2_packet_init(wpa_s->ifname, NULL, ETH_P_RSN_PREAUTH, NULL, in wpa_init_conf()
266 assert(l2 != NULL); in wpa_init_conf()
267 if (l2_packet_get_own_addr(l2, wpa_s->own_addr)) { in wpa_init_conf()
271 l2_packet_deinit(l2); in wpa_init_conf()
Dibss_rsn.c78 if (wpa_s->l2) in supp_ether_send()
79 return l2_packet_send(wpa_s->l2, dest, proto, buf, len); in supp_ether_send()
308 if (wpa_s->l2) in auth_send_eapol()
309 return l2_packet_send(wpa_s->l2, addr, ETH_P_EAPOL, data, in auth_send_eapol()
Dwpas_glue.c124 if (wpa_s->l2) { in wpa_ether_send()
125 return l2_packet_send(wpa_s->l2, dest, proto, buf, len); in wpa_ether_send()
Devents.c2918 if (wpa_s->l2) in wnm_bss_keep_alive()
2919 l2_packet_send(wpa_s->l2, wpa_s->bssid, 0x0800, in wnm_bss_keep_alive()
4355 if (wpa_s->l2) in wpa_supplicant_event_assoc()
4356 l2_packet_notify_auth_start(wpa_s->l2); in wpa_supplicant_event_assoc()
4908 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_event_interface_status()
4909 wpa_s->l2 = NULL; in wpa_supplicant_event_interface_status()
Dwpa_supplicant.c539 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_cleanup()
540 wpa_s->l2 = NULL; in wpa_supplicant_cleanup()
5627 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_update_mac_addr()
5628 wpa_s->l2 = l2_packet_init(wpa_s->ifname, in wpa_supplicant_update_mac_addr()
5634 if (wpa_s->l2 == NULL) in wpa_supplicant_update_mac_addr()
5637 if (l2_packet_set_packet_filter(wpa_s->l2, in wpa_supplicant_update_mac_addr()
5642 if (l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) { in wpa_supplicant_update_mac_addr()
Dwpa_supplicant_i.h694 struct l2_packet_data *l2; member
Dctrl_iface.c2391 if (wpa_s->l2 && in wpa_supplicant_ctrl_iface_status()
2392 l2_packet_get_ip_addr(wpa_s->l2, tmp, sizeof(tmp)) >= 0) { in wpa_supplicant_ctrl_iface_status()
10150 struct l2_packet_data *l2 = NULL; in wpas_ctrl_iface_data_test_frame() local
10170 l2 = l2_packet_init(wpa_s->ifname, wpa_s->own_addr, ethertype, in wpas_ctrl_iface_data_test_frame()
10172 if (l2 == NULL) in wpas_ctrl_iface_data_test_frame()
10175 res = l2_packet_send(l2, eth->ether_dhost, ethertype, buf, len); in wpas_ctrl_iface_data_test_frame()
10178 if (l2) in wpas_ctrl_iface_data_test_frame()
10179 l2_packet_deinit(l2); in wpas_ctrl_iface_data_test_frame()
/hostap-latest/hostapd/
Dctrl_iface.c2045 struct l2_packet_data *l2 = NULL; in hostapd_ctrl_iface_data_test_frame() local
2075 l2 = l2_packet_init(ifname, hapd->own_addr, ethertype, in hostapd_ctrl_iface_data_test_frame()
2077 if (l2 == NULL) in hostapd_ctrl_iface_data_test_frame()
2080 res = l2_packet_send(l2, eth->ether_dhost, ethertype, buf, len); in hostapd_ctrl_iface_data_test_frame()
2083 if (l2) in hostapd_ctrl_iface_data_test_frame()
2084 l2_packet_deinit(l2); in hostapd_ctrl_iface_data_test_frame()