Re: ARP problem
Posted: Sat Nov 08, 2014 8:34 am
I am using standard firmware 0018000902 and host MCU.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
extern struct netif *netif_list;
struct netif *netif = netif_list;
while (netif)
{
struct pbuf *q = pbuf_alloc(PBUF_RAW, 60, PBUF_RAM);
if (q != NULL) {
struct eth_hdr *ethhdr = (struct eth_hdr *)q->payload;
struct etharp_hdr *hdr = (struct etharp_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
os_memcpy(ðhdr->src, netif->hwaddr, 6);
os_memset(ðhdr->dest, 0xff, 6);//broadcast
os_memcpy(&hdr->shwaddr, netif->hwaddr, 6);
os_memset(&hdr->dhwaddr, 0, 6);
IPADDR2_COPY(&hdr->sipaddr, &netif->ip_addr);
IPADDR2_COPY(&hdr->dipaddr, &netif->ip_addr);
hdr->hwtype = PP_HTONS(1); //HWTYPE_ETHERNET
hdr->proto = PP_HTONS(ETHTYPE_IP);
/* set hwlen and protolen */
hdr->hwlen = ETHARP_HWADDR_LEN;
hdr->protolen = sizeof(ip_addr_t);
hdr->opcode = htons(1);
ethhdr->type = PP_HTONS(ETHTYPE_ARP);
}
else {
LWIP_ASSERT("q != NULL", q != NULL);
}
netif->linkoutput(netif, q);
pbuf_free(q);
netif = netif->next;
}
111 12:08:40.246544 Avm_xxxxxxx Espressi_98:72:c9 EAPOL 179 Key (Group Message 1 of 2)
114 12:08:40.252149 Espressi_98:72:c9 Avm_xxxxx EAPOL 131 Key (Group Message 2 of 2)