Warning, cross-references for /kernel/include/lwip/tcpip.h need to be fixed.
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 #ifndef __LWIP_TCPIP_H__
0033 #define __LWIP_TCPIP_H__
0034
0035 #include "lwip/opt.h"
0036
0037 #if !NO_SYS
0038
0039 #include "lwip/api_msg.h"
0040 #include "lwip/netifapi.h"
0041 #include "lwip/pbuf.h"
0042 #include "lwip/api.h"
0043 #include "lwip/sys.h"
0044 #include "lwip/netif.h"
0045
0046 #ifdef __cplusplus
0047 extern "C" {
0048 #endif
0049
0050 #if LWIP_TCPIP_CORE_LOCKING
0051
0052 extern sys_sem_t lock_tcpip_core;
0053 #define LOCK_TCPIP_CORE() sys_sem_wait(lock_tcpip_core)
0054 #define UNLOCK_TCPIP_CORE() sys_sem_signal(lock_tcpip_core)
0055 #define TCPIP_APIMSG(m) tcpip_apimsg_lock(m)
0056 #define TCPIP_APIMSG_ACK(m)
0057 #define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m)
0058 #define TCPIP_NETIFAPI_ACK(m)
0059 #else
0060 #define LOCK_TCPIP_CORE()
0061 #define UNLOCK_TCPIP_CORE()
0062 #define TCPIP_APIMSG(m) tcpip_apimsg(m)
0063 #define TCPIP_APIMSG_ACK(m) sys_sem_signal(m->conn->op_completed)
0064 #define TCPIP_NETIFAPI(m) tcpip_netifapi(m)
0065 #define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(m->sem)
0066 #endif
0067
0068 void tcpip_init(void (* tcpip_init_done)(void *), void *arg);
0069
0070 #if LWIP_NETCONN
0071 err_t tcpip_apimsg(struct api_msg *apimsg);
0072 #if LWIP_TCPIP_CORE_LOCKING
0073 err_t tcpip_apimsg_lock(struct api_msg *apimsg);
0074 #endif
0075 #endif
0076
0077 err_t tcpip_input(struct pbuf *p, struct netif *inp);
0078
0079 #if LWIP_NETIF_API
0080 err_t tcpip_netifapi(struct netifapi_msg *netifapimsg);
0081 #if LWIP_TCPIP_CORE_LOCKING
0082 err_t tcpip_netifapi_lock(struct netifapi_msg *netifapimsg);
0083 #endif
0084 #endif
0085
0086 err_t tcpip_callback_with_block(void (*f)(void *ctx), void *ctx, u8_t block);
0087 #define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1)
0088
0089
0090 err_t pbuf_free_callback(struct pbuf *p);
0091 err_t mem_free_callback(void *m);
0092
0093 err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
0094 err_t tcpip_untimeout(sys_timeout_handler h, void *arg);
0095
0096 enum tcpip_msg_type {
0097 #if LWIP_NETCONN
0098 TCPIP_MSG_API,
0099 #endif
0100 TCPIP_MSG_INPKT,
0101 #if LWIP_NETIF_API
0102 TCPIP_MSG_NETIFAPI,
0103 #endif
0104 TCPIP_MSG_CALLBACK,
0105 TCPIP_MSG_TIMEOUT,
0106 TCPIP_MSG_UNTIMEOUT
0107 };
0108
0109 struct tcpip_msg {
0110 enum tcpip_msg_type type;
0111 sys_sem_t *sem;
0112 union {
0113 #if LWIP_NETCONN
0114 struct api_msg *apimsg;
0115 #endif
0116 #if LWIP_NETIF_API
0117 struct netifapi_msg *netifapimsg;
0118 #endif
0119 struct {
0120 struct pbuf *p;
0121 struct netif *netif;
0122 } inp;
0123 struct {
0124 void (*f)(void *ctx);
0125 void *ctx;
0126 } cb;
0127 struct {
0128 u32_t msecs;
0129 sys_timeout_handler h;
0130 void *arg;
0131 } tmo;
0132 } msg;
0133 };
0134
0135 #ifdef __cplusplus
0136 }
0137 #endif
0138
0139 #endif
0140
0141 #endif