From ed566cceaa522b0183d3fb4a9a2de148a23380d9 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 19 Aug 2016 12:49:02 +0200 Subject: [PATCH] minor cleaup in (eth)arp --- src/core/ipv4/etharp.c | 7 +------ src/include/lwip/etharp.h | 12 ------------ src/include/lwip/prot/arp.h | 13 +++++++++++++ 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/core/ipv4/etharp.c b/src/core/ipv4/etharp.c index 2b3e9ca7..8020f346 100644 --- a/src/core/ipv4/etharp.c +++ b/src/core/ipv4/etharp.c @@ -72,8 +72,6 @@ */ #define ARP_MAXPENDING 5 -#define HWTYPE_ETHERNET 1 - enum etharp_state { ETHARP_STATE_EMPTY = 0, ETHARP_STATE_PENDING, @@ -1246,10 +1244,7 @@ etharp_query(struct netif *netif, const ip4_addr_t *ipaddr, struct pbuf *q) * ERR_MEM if the ARP packet couldn't be allocated * any other err_t on failure */ -#if !LWIP_AUTOIP -static -#endif /* LWIP_AUTOIP */ -err_t +static err_t etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, const struct eth_addr *ethdst_addr, const struct eth_addr *hwsrc_addr, const ip4_addr_t *ipsrc_addr, diff --git a/src/include/lwip/etharp.h b/src/include/lwip/etharp.h index 6b629d37..389cf9c4 100644 --- a/src/include/lwip/etharp.h +++ b/src/include/lwip/etharp.h @@ -70,10 +70,6 @@ extern "C" { /** 1 seconds period */ #define ARP_TMR_INTERVAL 1000 -/** ARP message types (opcodes) */ -#define ARP_REQUEST 1 -#define ARP_REPLY 2 - #if ARP_QUEUEING /** struct for queueing outgoing packets for unknown address * defined here to be accessed by memp.h @@ -105,14 +101,6 @@ err_t etharp_add_static_entry(const ip4_addr_t *ipaddr, struct eth_addr *ethaddr err_t etharp_remove_static_entry(const ip4_addr_t *ipaddr); #endif /* ETHARP_SUPPORT_STATIC_ENTRIES */ -#if LWIP_AUTOIP -err_t etharp_raw(struct netif *netif, const struct eth_addr *ethsrc_addr, - const struct eth_addr *ethdst_addr, - const struct eth_addr *hwsrc_addr, const ip4_addr_t *ipsrc_addr, - const struct eth_addr *hwdst_addr, const ip4_addr_t *ipdst_addr, - const u16_t opcode); -#endif /* LWIP_AUTOIP */ - #endif /* LWIP_IPV4 && LWIP_ARP */ void etharp_arp_input(struct netif *netif, struct eth_addr *ethaddr, struct pbuf *p); diff --git a/src/include/lwip/prot/arp.h b/src/include/lwip/prot/arp.h index 8e32df50..382c6a92 100644 --- a/src/include/lwip/prot/arp.h +++ b/src/include/lwip/prot/arp.h @@ -72,6 +72,19 @@ PACK_STRUCT_END #define SIZEOF_ETHARP_HDR 28 +/* ARP hwtype values */ +enum etharp_hwtype { + HWTYPE_ETHERNET = 1 + /* others not used */ +}; + +/* ARP message types (opcodes) */ +enum etharp_opcode { + ARP_REQUEST = 1, + ARP_REPLY = 2 +}; + + #ifdef __cplusplus } #endif