6 #include "lwip/ip_addr.h"
10 #define LWIP_TAG 'PIwl'
13 typedef struct tcp_pcb
* PTCP_PCB
;
15 typedef struct _QUEUE_ENTRY
20 } QUEUE_ENTRY
, *PQUEUE_ENTRY
;
22 struct lwip_callback_msg
33 PCONNECTION_ENDPOINT Connection
;
34 struct ip_addr
*IpAddress
;
38 PCONNECTION_ENDPOINT Connection
;
42 PCONNECTION_ENDPOINT Connection
;
47 PCONNECTION_ENDPOINT Connection
;
48 struct ip_addr
*IpAddress
;
52 PCONNECTION_ENDPOINT Connection
;
57 PCONNECTION_ENDPOINT Connection
;
65 struct tcp_pcb
*NewPcb
;
71 struct tcp_pcb
*NewPcb
;
89 NTSTATUS
LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection
, PUCHAR RecvBuffer
, UINT RecvLen
, UINT
*Received
);
91 /* External TCP event handlers */
92 extern void TCPConnectEventHandler(void *arg
, const err_t err
);
93 extern void TCPAcceptEventHandler(void *arg
, PTCP_PCB newpcb
);
94 extern void TCPSendEventHandler(void *arg
, const u16_t space
);
95 extern void TCPFinEventHandler(void *arg
, const err_t err
);
96 extern void TCPRecvEventHandler(void *arg
);
99 PTCP_PCB
LibTCPSocket(void *arg
);
100 err_t
LibTCPBind(PCONNECTION_ENDPOINT Connection
, struct ip_addr
*const ipaddr
, const u16_t port
);
101 PTCP_PCB
LibTCPListen(PCONNECTION_ENDPOINT Connection
, const u8_t backlog
);
102 err_t
LibTCPSend(PCONNECTION_ENDPOINT Connection
, void *const dataptr
, const u16_t len
, u32_t
*sent
, const int safe
);
103 err_t
LibTCPConnect(PCONNECTION_ENDPOINT Connection
, struct ip_addr
*const ipaddr
, const u16_t port
);
104 err_t
LibTCPShutdown(PCONNECTION_ENDPOINT Connection
, const int shut_rx
, const int shut_tx
);
105 err_t
LibTCPClose(PCONNECTION_ENDPOINT Connection
, const int safe
, const int callback
);
107 err_t
LibTCPGetPeerName(PTCP_PCB pcb
, struct ip_addr
*const ipaddr
, u16_t
*const port
);
108 err_t
LibTCPGetHostName(PTCP_PCB pcb
, struct ip_addr
*const ipaddr
, u16_t
*const port
);
109 void LibTCPAccept(PTCP_PCB pcb
, struct tcp_pcb
*listen_pcb
, void *arg
);
110 void LibTCPSetNoDelay(PTCP_PCB pcb
, BOOLEAN Set
);
113 void LibIPInsertPacket(void *ifarg
, const void *const data
, const u32_t size
);
114 void LibIPInitialize(void);
115 void LibIPShutdown(void);