6 #include "lwip/ip_addr.h"
10 #define LWIP_TAG 'PIwl'
11 #define LWIP_MESSAGE_TAG 'sMwl'
12 #define LWIP_QUEUE_TAG 'uQwl'
15 typedef struct tcp_pcb
* PTCP_PCB
;
17 typedef struct _QUEUE_ENTRY
22 } QUEUE_ENTRY
, *PQUEUE_ENTRY
;
24 struct lwip_callback_msg
35 PCONNECTION_ENDPOINT Connection
;
36 struct ip_addr
*IpAddress
;
40 PCONNECTION_ENDPOINT Connection
;
44 PCONNECTION_ENDPOINT Connection
;
49 PCONNECTION_ENDPOINT Connection
;
50 struct ip_addr
*IpAddress
;
54 PCONNECTION_ENDPOINT Connection
;
59 PCONNECTION_ENDPOINT Connection
;
67 struct tcp_pcb
*NewPcb
;
73 struct tcp_pcb
*NewPcb
;
91 NTSTATUS
LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection
, PUCHAR RecvBuffer
, UINT RecvLen
, UINT
*Received
);
93 /* External TCP event handlers */
94 extern void TCPConnectEventHandler(void *arg
, const err_t err
);
95 extern void TCPAcceptEventHandler(void *arg
, PTCP_PCB newpcb
);
96 extern void TCPSendEventHandler(void *arg
, const u16_t space
);
97 extern void TCPFinEventHandler(void *arg
, const err_t err
);
98 extern void TCPRecvEventHandler(void *arg
);
101 PTCP_PCB
LibTCPSocket(void *arg
);
102 err_t
LibTCPBind(PCONNECTION_ENDPOINT Connection
, struct ip_addr
*const ipaddr
, const u16_t port
);
103 PTCP_PCB
LibTCPListen(PCONNECTION_ENDPOINT Connection
, const u8_t backlog
);
104 err_t
LibTCPSend(PCONNECTION_ENDPOINT Connection
, void *const dataptr
, const u16_t len
, u32_t
*sent
, const int safe
);
105 err_t
LibTCPConnect(PCONNECTION_ENDPOINT Connection
, struct ip_addr
*const ipaddr
, const u16_t port
);
106 err_t
LibTCPShutdown(PCONNECTION_ENDPOINT Connection
, const int shut_rx
, const int shut_tx
);
107 err_t
LibTCPClose(PCONNECTION_ENDPOINT Connection
, const int safe
, const int callback
);
109 err_t
LibTCPGetPeerName(PTCP_PCB pcb
, struct ip_addr
*const ipaddr
, u16_t
*const port
);
110 err_t
LibTCPGetHostName(PTCP_PCB pcb
, struct ip_addr
*const ipaddr
, u16_t
*const port
);
111 void LibTCPAccept(PTCP_PCB pcb
, struct tcp_pcb
*listen_pcb
, void *arg
);
112 void LibTCPSetNoDelay(PTCP_PCB pcb
, BOOLEAN Set
);
115 void LibIPInsertPacket(void *ifarg
, const void *const data
, const u32_t size
);
116 void LibIPInitialize(void);
117 void LibIPShutdown(void);