ReactOS  0.4.15-dev-3181-g4acf100
rosip.h
Go to the documentation of this file.
1 #ifndef _ROS_IP_H_
2 #define _ROS_IP_H_
3 
4 #include "lwip/tcp.h"
5 #include "lwip/pbuf.h"
6 #include "lwip/ip_addr.h"
7 #include "tcpip.h"
8 
9 #ifndef LWIP_TAG
10  #define LWIP_TAG 'PIwl'
11  #define LWIP_MESSAGE_TAG 'sMwl'
12  #define LWIP_QUEUE_TAG 'uQwl'
13 #endif
14 
15 typedef struct tcp_pcb* PTCP_PCB;
16 
17 typedef struct _QUEUE_ENTRY
18 {
19  struct pbuf *p;
23 
25 {
26  /* Synchronization */
28 
29  /* Input */
30  union {
31  struct {
33  } Socket;
34  struct {
35  struct tcp_pcb* pcb;
36  } FreeSocket;
37  struct {
39  struct ip_addr *IpAddress;
41  } Bind;
42  struct {
45  } Listen;
46  struct {
48  void *Data;
50  } Send;
51  struct {
53  struct ip_addr *IpAddress;
54  u16_t Port;
55  } Connect;
56  struct {
58  int shut_rx;
59  int shut_tx;
60  } Shutdown;
61  struct {
63  int Callback;
64  } Close;
65  } Input;
66 
67  /* Output */
68  union {
69  struct {
70  struct tcp_pcb *NewPcb;
71  } Socket;
72  struct {
74  } Bind;
75  struct {
76  struct tcp_pcb *NewPcb;
77  } Listen;
78  struct {
79  err_t Error;
81  } Send;
82  struct {
83  err_t Error;
84  } Connect;
85  struct {
86  err_t Error;
87  } Shutdown;
88  struct {
89  err_t Error;
90  } Close;
91  } Output;
92 };
93 
95 
96 /* External TCP event handlers */
97 extern void TCPConnectEventHandler(void *arg, const err_t err);
98 extern void TCPAcceptEventHandler(void *arg, PTCP_PCB newpcb);
99 extern void TCPSendEventHandler(void *arg, const u16_t space);
100 extern void TCPFinEventHandler(void *arg, const err_t err);
101 extern void TCPRecvEventHandler(void *arg);
102 
103 /* TCP functions */
104 PTCP_PCB LibTCPSocket(void *arg);
106 err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port);
107 PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog);
108 err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe);
109 err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port);
110 err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx);
111 err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback);
112 
113 err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port);
114 err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port);
115 void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg);
118 
119 /* IP functions */
120 void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size);
121 void LibIPInitialize(void);
122 void LibIPShutdown(void);
123 
124 #endif
struct _QUEUE_ENTRY * PQUEUE_ENTRY
err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
Definition: rostcp.c:418
struct pbuf * p
Definition: rosip.h:19
struct ip_addr * IpAddress
Definition: rosip.h:39
err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx)
Definition: rostcp.c:720
union lwip_callback_msg::@4076 Input
ULONG Offset
Definition: rosip.h:20
struct lwip_callback_msg::@4076::@4085 Close
PTCP_PCB LibTCPSocket(void *arg)
Definition: rostcp.c:339
LIST_ENTRY ListEntry
Definition: rosip.h:21
unsigned char * PUCHAR
Definition: retypes.h:3
void LibTCPGetSocketStatus(PTCP_PCB pcb, PULONG State)
Definition: rostcp.c:882
err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe)
Definition: rostcp.c:560
LONG NTSTATUS
Definition: precomp.h:26
void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size)
Definition: rosip.c:12
struct lwip_callback_msg::@4076::@4082 Send
err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
Definition: rostcp.c:859
PCONNECTION_ENDPOINT Connection
Definition: rosip.h:38
err_t Error
Definition: rosip.h:73
u8_t Backlog
Definition: rosip.h:44
void LibIPInitialize(void)
Definition: rosip.c:35
static BOOL Set
Definition: pageheap.c:10
struct lwip_callback_msg::@4076::@4078 Socket
void * Data
Definition: rosip.h:48
struct tcp_pcb * NewPcb
Definition: rosip.h:70
struct lwip_callback_msg::@4076::@4079 FreeSocket
Definition: rosip.h:17
void TCPConnectEventHandler(void *arg, const err_t err)
Definition: event.c:420
struct lwip_callback_msg::@4076::@4080 Bind
struct tcp_pcb * pcb
Definition: rosip.h:35
unsigned char BOOLEAN
s8_t err_t
Definition: err.h:47
u16_t DataLength
Definition: rosip.h:49
err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback)
Definition: rostcp.c:801
GLsizeiptr size
Definition: glext.h:5919
Definition: pbuf.h:79
unsigned long u32_t
Definition: cc.h:25
struct tcp_pcb * PTCP_PCB
Definition: rosip.h:15
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
u32_t Information
Definition: rosip.h:80
void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set)
Definition: rostcp.c:871
void TCPFinEventHandler(void *arg, const err_t err)
Definition: event.c:182
struct _QUEUE_ENTRY QUEUE_ENTRY
Definition: msg.h:34
GLenum GLsizei len
Definition: glext.h:6722
union lwip_callback_msg::@4077 Output
Definition: typedefs.h:119
#define err(...)
struct lwip_callback_msg::@4076::@4081 Listen
struct lwip_callback_msg::@4076::@4084 Shutdown
NTSTATUS LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection, PUCHAR RecvBuffer, UINT RecvLen, UINT *Received)
Definition: rostcp.c:103
unsigned char u8_t
Definition: cc.h:23
void LibIPShutdown(void)
Definition: rosip.c:42
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
void TCPRecvEventHandler(void *arg)
Definition: event.c:380
VOID LibTCPFreeSocket(PTCP_PCB pcb)
Definition: rostcp.c:378
unsigned int ULONG
Definition: retypes.h:1
int const JOCTET * dataptr
Definition: jpeglib.h:1030
void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg)
Definition: rostcp.c:833
unsigned short u16_t
Definition: cc.h:24
KEVENT Event
Definition: rosip.h:27
static IPrintDialogCallback callback
Definition: printdlg.c:326
void TCPAcceptEventHandler(void *arg, PTCP_PCB newpcb)
Definition: event.c:231
USHORT port
Definition: uri.c:228
u16_t Port
Definition: rosip.h:40
UINT Received
Definition: arping.c:40
err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
Definition: rostcp.c:625
err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
Definition: rostcp.c:847
struct lwip_callback_msg::@4076::@4083 Connect
PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog)
Definition: rostcp.c:472
void TCPSendEventHandler(void *arg, const u16_t space)
Definition: event.c:294