mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
started to move "private" header files containing implementation details to "lwip/priv/" include directory to seperate the API from the implementation.
This commit is contained in:
parent
b32751a693
commit
c12fa7b4c4
@ -6,6 +6,10 @@ HISTORY
|
||||
|
||||
++ New features:
|
||||
|
||||
2015-10-09: Simon Goldschmidt
|
||||
* started to move "private" header files containing implementation details to
|
||||
"lwip/priv/" include directory to seperate the API from the implementation.
|
||||
|
||||
2015-10-07: Simon Goldschmidt
|
||||
* added sntp client as first "supported" application layer protocol implementation
|
||||
added 'apps' folder
|
||||
|
@ -44,14 +44,13 @@
|
||||
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/api.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/memp.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/api_msg.h"
|
||||
#include "lwip/priv/api_msg.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/udp.h"
|
||||
@ -48,10 +48,10 @@
|
||||
#include "lwip/raw.h"
|
||||
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/dns.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -36,8 +36,8 @@
|
||||
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/netifapi.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#define NETIFAPI_VAR_REF(name) API_VAR_REF(name)
|
||||
#define NETIFAPI_VAR_DECLARE(name) API_VAR_DECLARE(struct netifapi_msg, name)
|
||||
|
@ -50,9 +50,9 @@
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
#include "lwip/inet_chksum.h"
|
||||
#endif
|
||||
|
@ -40,11 +40,12 @@
|
||||
|
||||
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "netif/etharp.h"
|
||||
@ -506,7 +507,8 @@ tcpip_pppapi_lock(struct pppapi_msg* pppapimsg)
|
||||
* @param ctx parameter passed to function
|
||||
* @return a struct pointer to pass to tcpip_trycallback().
|
||||
*/
|
||||
struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx)
|
||||
struct tcpip_callback_msg*
|
||||
tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx)
|
||||
{
|
||||
struct tcpip_msg *msg = (struct tcpip_msg *)memp_malloc(MEMP_TCPIP_MSG_API);
|
||||
if (msg == NULL) {
|
||||
@ -523,7 +525,8 @@ struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, voi
|
||||
*
|
||||
* @param msg the message to free
|
||||
*/
|
||||
void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg)
|
||||
void
|
||||
tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg)
|
||||
{
|
||||
memp_free(MEMP_TCPIP_MSG_API, msg);
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/autoip.h"
|
||||
#include "lwip/igmp.h"
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/autoip.h"
|
||||
#include "lwip/stats.h"
|
||||
|
@ -52,7 +52,7 @@
|
||||
#include "lwip/icmp6.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/dhcp6.h"
|
||||
#include "lwip/nd6.h"
|
||||
#include "lwip/mld6.h"
|
||||
|
@ -44,12 +44,10 @@
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/api.h"
|
||||
#include "lwip/api_msg.h"
|
||||
#include "lwip/priv/api_msg.h"
|
||||
#include "lwip/sockets.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/timers.h"
|
||||
#include "lwip/stats.h"
|
||||
@ -66,6 +64,8 @@
|
||||
#include "lwip/nd6.h"
|
||||
#include "lwip/ip6_frag.h"
|
||||
#include "lwip/mld6.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
@ -136,7 +136,7 @@ static
|
||||
#endif
|
||||
const u16_t memp_sizes[MEMP_MAX] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEM_ALIGN_SIZE(size),
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
|
||||
#if !MEMP_MEM_MALLOC /* don't build if not configured for use in lwipopts.h */
|
||||
@ -144,14 +144,14 @@ const u16_t memp_sizes[MEMP_MAX] = {
|
||||
/** This array holds the number of elements in each pool. */
|
||||
static const u16_t memp_num[MEMP_MAX] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) (num),
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
|
||||
/** This array holds a textual description of each pool. */
|
||||
#ifdef LWIP_DEBUG
|
||||
static const char *memp_desc[MEMP_MAX] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) (desc),
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
#endif /* LWIP_DEBUG */
|
||||
|
||||
@ -164,12 +164,12 @@ static const char *memp_desc[MEMP_MAX] = {
|
||||
*/
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) u8_t memp_memory_ ## name ## _base \
|
||||
[((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))];
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
|
||||
/** This array holds the base of each memory pool. */
|
||||
static u8_t *const memp_bases[] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) memp_memory_ ## name ## _base,
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
|
||||
#else /* MEMP_SEPARATE_POOLS */
|
||||
@ -177,7 +177,7 @@ static u8_t *const memp_bases[] = {
|
||||
/** This is the actual memory used by the pools (all pools in one big block). */
|
||||
static u8_t memp_memory[MEM_ALIGNMENT - 1
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) + ( (num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size) ) )
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
];
|
||||
|
||||
#endif /* MEMP_SEPARATE_POOLS */
|
||||
@ -210,7 +210,7 @@ memp_sanity(void)
|
||||
#if defined(LWIP_DEBUG) && MEMP_STATS
|
||||
static const char * memp_overflow_names[] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) "/"desc,
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/ip6_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/snmp_mib2.h"
|
||||
#include "lwip/igmp.h"
|
||||
|
@ -70,7 +70,7 @@
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/sys.h"
|
||||
#if LWIP_TCP && TCP_QUEUE_OOSEQ
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#endif
|
||||
#if LWIP_CHECKSUM_ON_COPY
|
||||
#include "lwip/inet_chksum.h"
|
||||
|
@ -56,7 +56,7 @@
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/ip_frag.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/snmp_asn1.h"
|
||||
#include "lwip/snmp_structs.h"
|
||||
|
@ -56,7 +56,7 @@ stats_init(void)
|
||||
#if MEMP_STATS
|
||||
const char * memp_names[] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) desc,
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
int i;
|
||||
for (i = 0; i < MEMP_MAX; i++) {
|
||||
@ -127,7 +127,7 @@ stats_display_memp(struct stats_mem *mem, int index)
|
||||
{
|
||||
const char * memp_names[] = {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) desc,
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
};
|
||||
if (index < MEMP_MAX) {
|
||||
stats_display_mem(mem, memp_names[index]);
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/debug.h"
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/ip6.h"
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
|
@ -42,13 +42,13 @@
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/timers.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
|
||||
#if LWIP_TIMERS
|
||||
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#include "lwip/ip_frag.h"
|
||||
#include "netif/etharp.h"
|
||||
|
@ -41,12 +41,12 @@ extern "C" {
|
||||
|
||||
/* run once with empty definition to handle all custom includes in lwippools.h */
|
||||
#define LWIP_MEMPOOL(name,num,size,desc)
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
|
||||
/* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */
|
||||
typedef enum {
|
||||
#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
MEMP_MAX
|
||||
} memp_t;
|
||||
|
||||
@ -60,7 +60,7 @@ typedef enum {
|
||||
#define LWIP_MALLOC_MEMPOOL_START 1
|
||||
#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
|
||||
#define LWIP_MALLOC_MEMPOOL_END
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
) ,
|
||||
/* Get the last (via:
|
||||
MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */
|
||||
@ -69,7 +69,7 @@ typedef enum {
|
||||
#define LWIP_MALLOC_MEMPOOL_START
|
||||
#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
|
||||
#define LWIP_MALLOC_MEMPOOL_END 1
|
||||
#include "lwip/memp_std.h"
|
||||
#include "lwip/priv/memp_std.h"
|
||||
)
|
||||
} memp_pool_helper_t;
|
||||
|
||||
|
@ -29,14 +29,15 @@
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
#ifndef LWIP_HDR_TCPIP_H
|
||||
#define LWIP_HDR_TCPIP_H
|
||||
#ifndef LWIP_HDR_TCPIP_PRIV_H
|
||||
#define LWIP_HDR_TCPIP_PRIV_H
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/api_msg.h"
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/priv/api_msg.h"
|
||||
#include "lwip/netifapi.h"
|
||||
#include "lwip/pppapi.h"
|
||||
#include "lwip/pbuf.h"
|
||||
@ -132,23 +133,10 @@ extern sys_mutex_t lock_tcpip_core;
|
||||
#endif /* LWIP_MPU_COMPATIBLE */
|
||||
|
||||
|
||||
|
||||
/** Function prototype for the init_done function passed to tcpip_init */
|
||||
typedef void (*tcpip_init_done_fn)(void *arg);
|
||||
/** Function prototype for functions passed to tcpip_callback() */
|
||||
typedef void (*tcpip_callback_fn)(void *ctx);
|
||||
|
||||
/* Forward declarations */
|
||||
struct tcpip_callback_msg;
|
||||
|
||||
void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg);
|
||||
|
||||
#if LWIP_NETCONN || LWIP_SOCKET
|
||||
err_t tcpip_apimsg(struct api_msg *apimsg);
|
||||
#endif /* LWIP_NETCONN || LWIP_SOCKET */
|
||||
|
||||
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
#if PPPOS_SUPPORT && !PPP_INPROC_IRQ_SAFE
|
||||
err_t tcpip_pppos_input(struct pbuf *p, struct netif *inp);
|
||||
#endif /* PPPOS_SUPPORT && !PPP_INPROC_IRQ_SAFE */
|
||||
@ -167,21 +155,6 @@ err_t tcpip_pppapi_lock(struct pppapi_msg *pppapimsg);
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
#endif /* LWIP_PPP_API */
|
||||
|
||||
err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block);
|
||||
#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1)
|
||||
|
||||
struct tcpip_callback_msg* tcpip_callbackmsg_new(tcpip_callback_fn function, void *ctx);
|
||||
void tcpip_callbackmsg_delete(struct tcpip_callback_msg* msg);
|
||||
err_t tcpip_trycallback(struct tcpip_callback_msg* msg);
|
||||
|
||||
/* free pbufs or heap memory from another context without blocking */
|
||||
err_t pbuf_free_callback(struct pbuf *p);
|
||||
err_t mem_free_callback(void *m);
|
||||
|
||||
#if LWIP_TCPIP_TIMEOUT
|
||||
err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
|
||||
err_t tcpip_untimeout(sys_timeout_handler h, void *arg);
|
||||
#endif /* LWIP_TCPIP_TIMEOUT */
|
||||
|
||||
enum tcpip_msg_type {
|
||||
#if LWIP_NETCONN || LWIP_SOCKET
|
||||
@ -242,4 +215,4 @@ struct tcpip_msg {
|
||||
|
||||
#endif /* !NO_SYS */
|
||||
|
||||
#endif /* LWIP_HDR_TCPIP_H */
|
||||
#endif /* LWIP_HDR_TCPIP_PRIV_H */
|
@ -29,7 +29,7 @@
|
||||
#define VJ_H
|
||||
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/tcp_impl.h"
|
||||
#include "lwip/priv/tcp_priv.h"
|
||||
|
||||
#define MAX_SLOTS 16 /* must be > 2 and < 256 */
|
||||
#define MAX_HDR 128
|
||||
|
Loading…
Reference in New Issue
Block a user