diff --git a/src/api/tcpip.c b/src/api/tcpip.c index 5ab26584..46fa6029 100644 --- a/src/api/tcpip.c +++ b/src/api/tcpip.c @@ -48,6 +48,7 @@ #include "lwip/ip.h" #include "lwip/pbuf.h" #include "lwip/etharp.h" +#include "netif/ethernet.h" #define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name) #define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name) diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c index 5481d3bd..2b3e9ca7 100644 --- a/src/core/ipv4/etharp.c +++ b/src/core/ipv4/etharp.c @@ -52,6 +52,7 @@ #include "lwip/snmp.h" #include "lwip/dhcp.h" #include "lwip/autoip.h" +#include "netif/ethernet.h" #include diff --git a/src/core/ipv6/ethip6.c b/src/core/ipv6/ethip6.c index 81a19955..b3a3cafb 100644 --- a/src/core/ipv6/ethip6.c +++ b/src/core/ipv6/ethip6.c @@ -51,7 +51,7 @@ #include "lwip/inet_chksum.h" #include "lwip/netif.h" #include "lwip/icmp6.h" -#include "netif/ethernet.h" +#include "lwip/prot/ethernet.h" #include diff --git a/src/core/netif.c b/src/core/netif.c index dfc25324..5c194588 100644 --- a/src/core/netif.c +++ b/src/core/netif.c @@ -58,6 +58,8 @@ #endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */ #endif /* ENABLE_LOOPBACK */ +#include "netif/ethernet.h" + #if LWIP_AUTOIP #include "lwip/autoip.h" #endif /* LWIP_AUTOIP */ diff --git a/src/include/lwip/etharp.h b/src/include/lwip/etharp.h index 6c0b2d78..d02f1d41 100644 --- a/src/include/lwip/etharp.h +++ b/src/include/lwip/etharp.h @@ -50,7 +50,7 @@ #include "lwip/ip4_addr.h" #include "lwip/netif.h" #include "lwip/ip4.h" -#include "netif/ethernet.h" +#include "lwip/prot/ethernet.h" #ifdef __cplusplus extern "C" { diff --git a/src/include/lwip/prot/ethernet.h b/src/include/lwip/prot/ethernet.h index 6ebc1008..4d11328d 100644 --- a/src/include/lwip/prot/ethernet.h +++ b/src/include/lwip/prot/ethernet.h @@ -126,7 +126,21 @@ PACK_STRUCT_END /** IPv6 multicast uses this prefix */ #define LL_IP6_MULTICAST_ADDR_0 0x33 #define LL_IP6_MULTICAST_ADDR_1 0x33 - + +/** MEMCPY-like macro to copy to/from struct eth_addr's that are local variables + * or known to be 32-bit aligned within the protocol header. */ +#ifndef ETHADDR32_COPY +#define ETHADDR32_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) +#endif + +/** MEMCPY-like macro to copy to/from struct eth_addr's that are no local + * variables and known to be 16-bit aligned within the protocol header. */ +#ifndef ETHADDR16_COPY +#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) +#endif + +#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0) + #ifdef __cplusplus } #endif diff --git a/src/include/netif/ethernet.h b/src/include/netif/ethernet.h index 7d41af10..ec961c4d 100644 --- a/src/include/netif/ethernet.h +++ b/src/include/netif/ethernet.h @@ -51,18 +51,6 @@ extern "C" { #endif -/** MEMCPY-like macro to copy to/from struct eth_addr's that are local variables - * or known to be 32-bit aligned within the protocol header. */ -#ifndef ETHADDR32_COPY -#define ETHADDR32_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) -#endif - -/** MEMCPY-like macro to copy to/from struct eth_addr's that are no local - * variables and known to be 16-bit aligned within the protocol header. */ -#ifndef ETHADDR16_COPY -#define ETHADDR16_COPY(dst, src) SMEMCPY(dst, src, ETH_HWADDR_LEN) -#endif - #if LWIP_ARP || LWIP_ETHERNET /** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type) @@ -77,8 +65,6 @@ extern "C" { err_t ethernet_input(struct pbuf *p, struct netif *netif); -#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETH_HWADDR_LEN) == 0) - extern const struct eth_addr ethbroadcast, ethzero; #endif /* LWIP_ARP || LWIP_ETHERNET */