mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-12 13:13:21 +00:00
Implement task #14367: Hooks need a better place to be defined
We now have a #define for a header file name that is #included in every .c file that provides hooks.
This commit is contained in:
parent
bc07fd9db5
commit
239498f37c
@ -56,6 +56,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV4 && LWIP_ARP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
/** Re-request a used ARP entry 1 minute before it would expire to prevent
|
||||
|
@ -51,6 +51,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
/** Small optimization: set to 0 if incoming PBUF_POOL pbuf always can be
|
||||
* used to modify and send a response packet (and to 1 if this is not the case,
|
||||
* e.g. when link header is stripped of when receiving) */
|
||||
|
@ -59,6 +59,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
/** Set this to 0 in the rare case of wanting to call an extra function to
|
||||
* generate the IP checksum (in contrast to calculating it on-the-fly). */
|
||||
#ifndef LWIP_INLINE_IP_CHKSUM
|
||||
|
@ -60,6 +60,10 @@
|
||||
#include "lwip/debug.h"
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Finds the appropriate network interface for a given IPv6 address. It tries to select
|
||||
* a netif following a sequence of heuristics:
|
||||
|
@ -64,6 +64,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
#if LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK
|
||||
#error LWIP_IPV6_DUP_DETECT_ATTEMPTS > IP6_ADDR_TENTATIVE_COUNT_MASK
|
||||
#endif
|
||||
|
@ -76,7 +76,6 @@
|
||||
#include "lwip/ip6_frag.h"
|
||||
#include "lwip/mld6.h"
|
||||
|
||||
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc)
|
||||
#include "lwip/priv/memp_std.h"
|
||||
|
||||
@ -85,6 +84,10 @@ const struct memp_desc* const memp_pools[MEMP_MAX] = {
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
#if MEMP_MEM_MALLOC && MEMP_OVERFLOW_CHECK >= 2
|
||||
#undef MEMP_OVERFLOW_CHECK
|
||||
/* MEMP_OVERFLOW_CHECK >= 2 does not work with MEMP_MEM_MALLOC, use 1 instead */
|
||||
|
@ -62,6 +62,10 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
#ifndef TCP_LOCAL_PORT_RANGE_START
|
||||
/* From http://www.iana.org/assignments/port-numbers:
|
||||
"The Dynamic and/or Private Ports are those from 49152 through 65535" */
|
||||
|
@ -2454,6 +2454,15 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* LWIP_HOOK_FILENAME: Custom filename to #include in files that provide hooks.
|
||||
* Declare your hook function prototypes in there, you may also #include all headers
|
||||
* providing data types that are need in this file.
|
||||
*/
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_FILENAME "path/to/my/lwip_hooks.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LWIP_HOOK_TCP_ISN:
|
||||
* Hook for generation of the Initial Sequence Number (ISN) for a new TCP
|
||||
|
@ -56,6 +56,10 @@
|
||||
#include "netif/ppp/pppoe.h"
|
||||
#endif /* PPPOE_SUPPORT */
|
||||
|
||||
#ifdef LWIP_HOOK_FILENAME
|
||||
#include LWIP_HOOK_FILENAME
|
||||
#endif
|
||||
|
||||
const struct eth_addr ethbroadcast = {{0xff,0xff,0xff,0xff,0xff,0xff}};
|
||||
const struct eth_addr ethzero = {{0,0,0,0,0,0}};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user