ReactOS 0.4.16-dev-297-gc569aee
tcpip_priv.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without modification,
11 * are permitted provided that the following conditions are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * 3. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
24 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
29 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
30 * OF SUCH DAMAGE.
31 *
32 * This file is part of the lwIP TCP/IP stack.
33 *
34 * Author: Adam Dunkels <adam@sics.se>
35 *
36 */
37#ifndef LWIP_HDR_TCPIP_PRIV_H
38#define LWIP_HDR_TCPIP_PRIV_H
39
40#include "lwip/opt.h"
41
42#if !NO_SYS /* don't build if not configured for use in lwipopts.h */
43
44#include "lwip/tcpip.h"
45#include "lwip/sys.h"
46#include "lwip/timeouts.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52struct pbuf;
53struct netif;
54
55#if LWIP_MPU_COMPATIBLE
56#define API_VAR_REF(name) (*(name))
57#define API_VAR_DECLARE(type, name) type * name
58#define API_VAR_ALLOC_EXT(type, pool, name, errorblock) do { \
59 name = (type *)memp_malloc(pool); \
60 if (name == NULL) { \
61 errorblock; \
62 } \
63 } while(0)
64#define API_VAR_ALLOC(type, pool, name, errorval) API_VAR_ALLOC_EXT(type, pool, name, return errorval)
65#define API_VAR_ALLOC_POOL(type, pool, name, errorval) do { \
66 name = (type *)LWIP_MEMPOOL_ALLOC(pool); \
67 if (name == NULL) { \
68 return errorval; \
69 } \
70 } while(0)
71#define API_VAR_FREE(pool, name) memp_free(pool, name)
72#define API_VAR_FREE_POOL(pool, name) LWIP_MEMPOOL_FREE(pool, name)
73#define API_EXPR_REF(expr) (&(expr))
74#if LWIP_NETCONN_SEM_PER_THREAD
75#define API_EXPR_REF_SEM(expr) (expr)
76#else
77#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr)
78#endif
79#define API_EXPR_DEREF(expr) expr
80#define API_MSG_M_DEF(m) m
81#define API_MSG_M_DEF_C(t, m) t m
82#else /* LWIP_MPU_COMPATIBLE */
83#define API_VAR_REF(name) name
84#define API_VAR_DECLARE(type, name) type name
85#define API_VAR_ALLOC_EXT(type, pool, name, errorblock)
86#define API_VAR_ALLOC(type, pool, name, errorval)
87#define API_VAR_ALLOC_POOL(type, pool, name, errorval)
88#define API_VAR_FREE(pool, name)
89#define API_VAR_FREE_POOL(pool, name)
90#define API_EXPR_REF(expr) expr
91#define API_EXPR_REF_SEM(expr) API_EXPR_REF(expr)
92#define API_EXPR_DEREF(expr) (*(expr))
93#define API_MSG_M_DEF(m) *m
94#define API_MSG_M_DEF_C(t, m) const t * m
95#endif /* LWIP_MPU_COMPATIBLE */
96
98
100{
101#if !LWIP_TCPIP_CORE_LOCKING
103#if !LWIP_NETCONN_SEM_PER_THREAD
105#endif /* LWIP_NETCONN_SEM_PER_THREAD */
106#else /* !LWIP_TCPIP_CORE_LOCKING */
107 u8_t dummy; /* avoid empty struct :-( */
108#endif /* !LWIP_TCPIP_CORE_LOCKING */
109};
112
114#if !LWIP_TCPIP_CORE_LOCKING
117#endif /* !LWIP_TCPIP_CORE_LOCKING */
118#if !LWIP_TCPIP_CORE_LOCKING_INPUT
120#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
121#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS
122 TCPIP_MSG_TIMEOUT,
123 TCPIP_MSG_UNTIMEOUT,
124#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */
129
130struct tcpip_msg {
132 union {
133#if !LWIP_TCPIP_CORE_LOCKING
134 struct {
136 void* msg;
138 struct {
143 struct {
144 tcpip_callback_fn function;
145 void *ctx;
146 sys_sem_t *sem;
148#endif /* LWIP_TCPIP_CORE_LOCKING */
149#if !LWIP_TCPIP_CORE_LOCKING_INPUT
150 struct {
151 struct pbuf *p;
152 struct netif *netif;
155#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */
156 struct {
158 void *ctx;
159 } cb;
160#if LWIP_TCPIP_TIMEOUT && LWIP_TIMERS
161 struct {
162 u32_t msecs;
163 sys_timeout_handler h;
164 void *arg;
165 } tmo;
166#endif /* LWIP_TCPIP_TIMEOUT && LWIP_TIMERS */
168};
169
170#ifdef __cplusplus
171}
172#endif
173
174#endif /* !NO_SYS */
175
176#endif /* LWIP_HDR_TCPIP_PRIV_H */
void(* tcpip_callback_fn)(void *ctx)
Definition: tcpip.h:72
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
uint32_t u32_t
Definition: arch.h:129
uint8_t u8_t
Definition: arch.h:125
s8_t err_t
Definition: err.h:96
static HANDLE sem
Definition: sync.c:674
err_t(* netif_input_fn)(struct pbuf *p, struct netif *inp)
Definition: netif.h:181
Definition: netif.h:269
Definition: pbuf.h:186
struct tcpip_api_call_data * arg
Definition: tcpip_priv.h:140
void * msg
Definition: tcpip_priv.h:136
struct tcpip_msg::@1052::@1057 cb
tcpip_api_call_fn function
Definition: tcpip_priv.h:139
netif_input_fn input_fn
Definition: tcpip_priv.h:153
enum tcpip_msg_type type
Definition: tcpip_priv.h:131
sys_sem_t * sem
Definition: tcpip_priv.h:141
struct netif * netif
Definition: tcpip_priv.h:152
struct tcpip_msg::@1052::@1055 cb_wait
struct tcpip_msg::@1052::@1054 api_call
void * ctx
Definition: tcpip_priv.h:145
struct pbuf * p
Definition: tcpip_priv.h:151
tcpip_callback_fn function
Definition: tcpip_priv.h:135
struct tcpip_msg::@1052::@1056 inp
struct tcpip_msg::@1052::@1053 api_msg
err_t tcpip_send_msg_wait_sem(tcpip_callback_fn fn, void *apimsg, sys_sem_t *sem)
Definition: tcpip.c:442
tcpip_msg_type
Definition: tcpip_priv.h:113
@ TCPIP_MSG_CALLBACK_STATIC
Definition: tcpip_priv.h:126
@ TCPIP_MSG_CALLBACK
Definition: tcpip_priv.h:125
@ TCPIP_MSG_CALLBACK_STATIC_WAIT
Definition: tcpip_priv.h:127
@ TCPIP_MSG_INPKT
Definition: tcpip_priv.h:119
@ TCPIP_MSG_API
Definition: tcpip_priv.h:115
@ TCPIP_MSG_API_CALL
Definition: tcpip_priv.h:116
err_t tcpip_api_call(tcpip_api_call_fn fn, struct tcpip_api_call_data *call)
Definition: tcpip.c:478
err_t(* tcpip_api_call_fn)(struct tcpip_api_call_data *call)
Definition: tcpip_priv.h:110
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159