35 #ifndef __NETIF_ETHARP_H__ 36 #define __NETIF_ETHARP_H__ 40 #if LWIP_ARP || LWIP_ETHERNET 51 #ifndef ETHARP_HWADDR_LEN 52 #define ETHARP_HWADDR_LEN 6 55 #ifdef PACK_STRUCT_USE_INCLUDES 56 # include "arch/bpstruct.h" 63 #ifdef PACK_STRUCT_USE_INCLUDES 64 # include "arch/epstruct.h" 67 #ifdef PACK_STRUCT_USE_INCLUDES 68 # include "arch/bpstruct.h" 81 #ifdef PACK_STRUCT_USE_INCLUDES 82 # include "arch/epstruct.h" 85 #define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE) 87 #if ETHARP_SUPPORT_VLAN 89 #ifdef PACK_STRUCT_USE_INCLUDES 90 # include "arch/bpstruct.h" 101 #ifdef PACK_STRUCT_USE_INCLUDES 102 # include "arch/epstruct.h" 105 #define SIZEOF_VLAN_HDR 4 106 #define VLAN_ID(vlan_hdr) (htons((vlan_hdr)->prio_vid) & 0xFFF) 110 #ifdef PACK_STRUCT_USE_INCLUDES 111 # include "arch/bpstruct.h" 127 #ifdef PACK_STRUCT_USE_INCLUDES 128 # include "arch/epstruct.h" 131 #define SIZEOF_ETHARP_HDR 28 132 #define SIZEOF_ETHARP_MINSIZE 46 133 #define SIZEOF_ETHARP_PACKET (SIZEOF_ETH_HDR + SIZEOF_ETHARP_HDR) 134 #define SIZEOF_ETHARP_WITHPAD (SIZEOF_ETH_HDR + SIZEOF_ETHARP_MINSIZE) 137 #define ARP_TMR_INTERVAL 5000 139 #define ETHTYPE_ARP 0x0806 140 #define ETHTYPE_IP 0x0800 141 #define ETHTYPE_VLAN 0x8100 142 #define ETHTYPE_PPPOEDISC 0x8863 143 #define ETHTYPE_PPPOE 0x8864 144 #define ETHTYPE_PAE 0x888e 148 #ifndef ETHADDR32_COPY 149 #define ETHADDR32_COPY(src, dst) SMEMCPY(src, dst, ETHARP_HWADDR_LEN) 154 #ifndef ETHADDR16_COPY 155 #define ETHADDR16_COPY(src, dst) SMEMCPY(src, dst, ETHARP_HWADDR_LEN) 161 #define ARP_REQUEST 1 170 #ifndef LWIP_ARP_FILTER_NETIF 171 #define LWIP_ARP_FILTER_NETIF 0 178 struct etharp_q_entry {
179 struct etharp_q_entry *next;
184 #define etharp_init() 195 #define etharp_gratuitous(netif) etharp_request((netif), &(netif)->ip_addr) 196 void etharp_cleanup_netif(
struct netif *
netif);
198 #if ETHARP_SUPPORT_STATIC_ENTRIES 204 err_t etharp_raw(
struct netif *
netif,
const struct eth_addr *ethsrc_addr,
205 const struct eth_addr *ethdst_addr,
206 const struct eth_addr *hwsrc_addr,
const ip_addr_t *ipsrc_addr,
207 const struct eth_addr *hwdst_addr,
const ip_addr_t *ipdst_addr,
215 #define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETHARP_HWADDR_LEN) == 0) 217 extern const struct eth_addr ethbroadcast, ethzero;
223 #ifndef ETHARP_HWADDR_LEN 224 #define ETHARP_HWADDR_LEN 6 242 #ifdef PACK_STRUCT_USE_INCLUDES 243 # include "arch/epstruct.h" 246 #define SIZEOF_ETH_HDR (14 + ETH_PAD_SIZE)
#define ICACHE_FLASH_ATTR
#define PACK_STRUCT_STRUCT
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_FIELD(x)