Combined etharp_request with etharp_raw for both LWIP_AUTOIP =0 and =1 to remove redundant code.

This commit is contained in:
goldsimon
2007-06-24 12:51:22 +00:00
parent 4848de3a8e
commit b51d1b79a3
4 changed files with 54 additions and 107 deletions

View File

@@ -216,51 +216,46 @@
#define ARP_TABLE_SIZE 10
#endif
/**
* If enabled, outgoing packets are queued during hardware address
/** If enabled, outgoing packets are queued during hardware address
* resolution.
*
* This feature has not stabilized yet. Single-packet queueing is
* believed to be stable, multi-packet queueing is believed to
* clash with the TCP segment queueing.
*
* As multi-packet-queueing is currently disabled, enabling this
* _should_ work, but we need your testing feedback on lwip-users.
*
*/
#ifndef ARP_QUEUEING
#define ARP_QUEUEING 1
#endif
/* If enabled, incoming IP packets cause the ARP table to be updated
/** If enabled, incoming IP packets cause the ARP table to be updated
* with the source MAC and IP addresses supplied in the packet. You may
* want to disable this if you do not trust LAN peers to have the
* correct addresses, or as a limited approach to attempt to handle
* spoofing. If disabled, lwIP will need to make a new ARP request if
* the peer is not already in the ARP table, adding a little latency.
*/
#ifndef ETHARP_TRUST_IP_MAC
#define ETHARP_TRUST_IP_MAC 1
#endif
/* If enabled, allow to do ARP processing for incoming packets inside network driver, before process packets using the tcpip_input. */
/** If enabled, allow to do ARP processing for incoming packets inside network
* driver, before process packets using the tcpip_input.
*/
#ifndef ETHARP_TCPIP_INPUT
#define ETHARP_TCPIP_INPUT 1
#endif
/* If enabled, allow to do ARP processing for incoming packets inside tcpip_thread, using the tcpip_ethinput (and not tcpip_input).
The aim is to protect ARP layer against concurrent access. Older ports have to be update to use tcpip_ethinput. */
/** If enabled, allow to do ARP processing for incoming packets inside tcpip_thread,
* using the tcpip_ethinput (and not tcpip_input).
* The aim is to protect ARP layer against concurrent access. Older ports have
* to be update to use tcpip_ethinput.
*/
#ifndef ETHARP_TCPIP_ETHINPUT
#define ETHARP_TCPIP_ETHINPUT 1
#endif
/* This option is deprecated */
/** This option is deprecated */
#ifdef ETHARP_QUEUE_FIRST
#error ETHARP_QUEUE_FIRST option is deprecated. Remove it from your lwipopts.h.
#endif
/* This option is removed to comply with the ARP standard */
/** This option is removed to comply with the ARP standard */
#ifdef ETHARP_ALWAYS_INSERT
#error ETHARP_ALWAYS_INSERT option is deprecated. Remove it from your lwipopts.h.
#endif

View File

@@ -148,10 +148,11 @@ err_t etharp_query(struct netif *netif, struct ip_addr *ipaddr, struct pbuf *q);
err_t etharp_request(struct netif *netif, struct ip_addr *ipaddr);
#if LWIP_AUTOIP
err_t etharp_raw(struct netif *netif, struct eth_addr *ethsrc_addr, struct eth_addr *ethdst_addr,
struct eth_addr *hwsrc_addr, struct ip_addr *ipsrc_addr,
struct eth_addr *hwdst_addr, struct ip_addr *ipdst_addr,
unsigned short int opcode);
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 struct ip_addr *ipsrc_addr,
const struct eth_addr *hwdst_addr, const struct ip_addr *ipdst_addr,
const u16_t opcode);
#endif /* LWIP_AUTOIP */
#define eth_addr_cmp(addr1, addr2) (memcmp((addr1)->addr, (addr2)->addr, ETHARP_HWADDR_LEN) == 0)