Home
last modified time | relevance | path

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

/hostap-3.6.0/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.c34 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
36 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
40 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
45 if (l2 == NULL) { in l2_packet_send()
49 if (l2->l2_hdr) { in l2_packet_send()
50 ret = send(l2->fd, buf, len, 0); in l2_packet_send()
60 ll.sll_ifindex = l2->ifindex; in l2_packet_send()
65 ret = sendto(l2->fd, buf, len, 0, (struct sockaddr *) &ll, in l2_packet_send()
77 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
96 if (ethhdr->h_proto != htons(l2->protocol)) { in l2_packet_receive()
[all …]
Dl2_packet_freebsd.c48 int l2_packet_get_own_addr(struct l2_packet_data *l2, u8 *addr) in l2_packet_get_own_addr() argument
50 os_memcpy(addr, l2->own_addr, ETH_ALEN); in l2_packet_get_own_addr()
55 int l2_packet_send(struct l2_packet_data *l2, const u8 *dst_addr, u16 proto, in l2_packet_send() argument
58 if (!l2->l2_hdr) { in l2_packet_send()
64 os_memcpy(eth->h_source, l2->own_addr, ETH_ALEN); in l2_packet_send()
67 ret = pcap_inject(l2->pcap, (u8 *) eth, len + sizeof(*eth)); in l2_packet_send()
71 return pcap_inject(l2->pcap, buf, len); in l2_packet_send()
77 struct l2_packet_data *l2 = eloop_ctx; in l2_packet_receive() local
87 if (!l2->rx_callback || !packet || hdr.caplen < sizeof(*ethhdr)) in l2_packet_receive()
91 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-3.6.0/src/ap/
Dx_snoop.c73 struct l2_packet_data *l2; in x_snoop_get_l2_packet() local
75 l2 = l2_packet_init(conf->bridge, NULL, ETH_P_ALL, handler, hapd, 1); in x_snoop_get_l2_packet()
76 if (l2 == NULL) { in x_snoop_get_l2_packet()
83 if (l2_packet_set_packet_filter(l2, type)) { in x_snoop_get_l2_packet()
87 l2_packet_deinit(l2); in x_snoop_get_l2_packet()
91 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.c716 if (hapd->l2 == NULL) in hostapd_wpa_auth_send_ether()
726 ret = l2_packet_send(hapd->l2, dst, proto, (u8 *) buf, in hostapd_wpa_auth_send_ether()
1570 hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB, in hostapd_setup_wpa()
1572 if (!hapd->l2) { in hostapd_setup_wpa()
1630 l2_packet_deinit(hapd->l2); in hostapd_deinit_wpa()
1631 hapd->l2 = NULL; in hostapd_deinit_wpa()
Dhostapd.h224 struct l2_packet_data *l2; member
/hostap-3.6.0/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()
/hostap-3.6.0/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()
505 if (!iface->l2[idx]) in wpa_priv_cmd_l2_register()
518 iface->l2[idx] = l2_packet_init(iface->ifname, NULL, proto, in wpa_priv_cmd_l2_register()
521 if (!iface->l2[idx]) { in wpa_priv_cmd_l2_register()
527 if (l2_packet_get_own_addr(iface->l2[idx], own_addr) < 0) { in wpa_priv_cmd_l2_register()
530 l2_packet_deinit(iface->l2[idx]); in wpa_priv_cmd_l2_register()
531 iface->l2[idx] = NULL; in wpa_priv_cmd_l2_register()
[all …]
Dpreauth_test.c228 struct l2_packet_data *l2; in wpa_init_conf() local
263 l2 = l2_packet_init(wpa_s->ifname, NULL, ETH_P_RSN_PREAUTH, NULL, in wpa_init_conf()
265 assert(l2 != NULL); in wpa_init_conf()
266 if (l2_packet_get_own_addr(l2, wpa_s->own_addr)) { in wpa_init_conf()
270 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()
307 if (wpa_s->l2) in auth_send_eapol()
308 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.c2482 if (wpa_s->l2) in wnm_bss_keep_alive()
2483 l2_packet_send(wpa_s->l2, wpa_s->bssid, 0x0800, in wnm_bss_keep_alive()
3382 if (wpa_s->l2) in wpa_supplicant_event_assoc()
3383 l2_packet_notify_auth_start(wpa_s->l2); in wpa_supplicant_event_assoc()
3928 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_event_interface_status()
3929 wpa_s->l2 = NULL; in wpa_supplicant_event_interface_status()
Dwpa_supplicant.c534 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_cleanup()
535 wpa_s->l2 = NULL; in wpa_supplicant_cleanup()
927 res = l2_packet_send(wpa_s->l2, wpa_s->bssid, ntohs(0x8989), buf, len); in dhcp_war()
5180 l2_packet_deinit(wpa_s->l2); in wpa_supplicant_update_mac_addr()
5181 wpa_s->l2 = l2_packet_init(wpa_s->ifname, in wpa_supplicant_update_mac_addr()
5187 if (wpa_s->l2 == NULL) in wpa_supplicant_update_mac_addr()
5190 if (l2_packet_set_packet_filter(wpa_s->l2, in wpa_supplicant_update_mac_addr()
5195 if (l2_packet_get_own_addr(wpa_s->l2, wpa_s->own_addr)) { in wpa_supplicant_update_mac_addr()
Dwpa_supplicant_i.h698 struct l2_packet_data *l2; member
Dctrl_iface.c2353 if (wpa_s->l2 && in wpa_supplicant_ctrl_iface_status()
2354 l2_packet_get_ip_addr(wpa_s->l2, tmp, sizeof(tmp)) >= 0) { in wpa_supplicant_ctrl_iface_status()
9740 struct l2_packet_data *l2 = NULL; in wpas_ctrl_iface_data_test_frame() local
9760 l2 = l2_packet_init(wpa_s->ifname, wpa_s->own_addr, ethertype, in wpas_ctrl_iface_data_test_frame()
9762 if (l2 == NULL) in wpas_ctrl_iface_data_test_frame()
9765 res = l2_packet_send(l2, eth->ether_dhost, ethertype, buf, len); in wpas_ctrl_iface_data_test_frame()
9768 if (l2) in wpas_ctrl_iface_data_test_frame()
9769 l2_packet_deinit(l2); in wpas_ctrl_iface_data_test_frame()
/hostap-3.6.0/hostapd/
Dctrl_iface.c2182 struct l2_packet_data *l2 = NULL; in hostapd_ctrl_iface_data_test_frame() local
2212 l2 = l2_packet_init(ifname, hapd->own_addr, ethertype, in hostapd_ctrl_iface_data_test_frame()
2214 if (l2 == NULL) in hostapd_ctrl_iface_data_test_frame()
2217 res = l2_packet_send(l2, eth->ether_dhost, ethertype, buf, len); in hostapd_ctrl_iface_data_test_frame()
2220 if (l2) in hostapd_ctrl_iface_data_test_frame()
2221 l2_packet_deinit(l2); in hostapd_ctrl_iface_data_test_frame()