mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
Reduce usage of netif/ethernet.h header, mostly lwip/prot/ethernet.h is sufficient
This commit is contained in:
parent
43d6812b3e
commit
8eb9db18a2
@ -48,6 +48,7 @@
|
|||||||
#include "lwip/ip.h"
|
#include "lwip/ip.h"
|
||||||
#include "lwip/pbuf.h"
|
#include "lwip/pbuf.h"
|
||||||
#include "lwip/etharp.h"
|
#include "lwip/etharp.h"
|
||||||
|
#include "netif/ethernet.h"
|
||||||
|
|
||||||
#define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name)
|
#define TCPIP_MSG_VAR_REF(name) API_VAR_REF(name)
|
||||||
#define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name)
|
#define TCPIP_MSG_VAR_DECLARE(name) API_VAR_DECLARE(struct tcpip_msg, name)
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "lwip/snmp.h"
|
#include "lwip/snmp.h"
|
||||||
#include "lwip/dhcp.h"
|
#include "lwip/dhcp.h"
|
||||||
#include "lwip/autoip.h"
|
#include "lwip/autoip.h"
|
||||||
|
#include "netif/ethernet.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
#include "lwip/inet_chksum.h"
|
#include "lwip/inet_chksum.h"
|
||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
#include "lwip/icmp6.h"
|
#include "lwip/icmp6.h"
|
||||||
#include "netif/ethernet.h"
|
#include "lwip/prot/ethernet.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -58,6 +58,8 @@
|
|||||||
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
||||||
#endif /* ENABLE_LOOPBACK */
|
#endif /* ENABLE_LOOPBACK */
|
||||||
|
|
||||||
|
#include "netif/ethernet.h"
|
||||||
|
|
||||||
#if LWIP_AUTOIP
|
#if LWIP_AUTOIP
|
||||||
#include "lwip/autoip.h"
|
#include "lwip/autoip.h"
|
||||||
#endif /* LWIP_AUTOIP */
|
#endif /* LWIP_AUTOIP */
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
#include "lwip/ip4_addr.h"
|
#include "lwip/ip4_addr.h"
|
||||||
#include "lwip/netif.h"
|
#include "lwip/netif.h"
|
||||||
#include "lwip/ip4.h"
|
#include "lwip/ip4.h"
|
||||||
#include "netif/ethernet.h"
|
#include "lwip/prot/ethernet.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -127,6 +127,20 @@ PACK_STRUCT_END
|
|||||||
#define LL_IP6_MULTICAST_ADDR_0 0x33
|
#define LL_IP6_MULTICAST_ADDR_0 0x33
|
||||||
#define LL_IP6_MULTICAST_ADDR_1 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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,18 +51,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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
|
#if LWIP_ARP || LWIP_ETHERNET
|
||||||
|
|
||||||
/** Define this to 1 and define LWIP_ARP_FILTER_NETIF_FN(pbuf, netif, type)
|
/** 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);
|
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;
|
extern const struct eth_addr ethbroadcast, ethzero;
|
||||||
|
|
||||||
#endif /* LWIP_ARP || LWIP_ETHERNET */
|
#endif /* LWIP_ARP || LWIP_ETHERNET */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user