ReactOS  0.4.14-dev-552-g2fad488
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 {
36  struct ip_addr *IpAddress;
38  } Bind;
39  struct {
42  } Listen;
43  struct {
45  void *Data;
47  } Send;
48  struct {
50  struct ip_addr *IpAddress;
51  u16_t Port;
52  } Connect;
53  struct {
55  int shut_rx;
56  int shut_tx;
57  } Shutdown;
58  struct {
60  int Callback;
61  } Close;
62  } Input;
63 
64  /* Output */
65  union {
66  struct {
67  struct tcp_pcb *NewPcb;
68  } Socket;
69  struct {
71  } Bind;
72  struct {
73  struct tcp_pcb *NewPcb;
74  } Listen;
75  struct {
76  err_t Error;
78  } Send;
79  struct {
80  err_t Error;
81  } Connect;
82  struct {
83  err_t Error;
84  } Shutdown;
85  struct {
86  err_t Error;
87  } Close;
88  } Output;
89 };
90 
92 
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);
99 
100 /* TCP functions */
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);
108 
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);
114 
115 /* IP functions */
116 void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size);
117 void LibIPInitialize(void);
118 void LibIPShutdown(void);
119 
120 #endif
struct _QUEUE_ENTRY * PQUEUE_ENTRY
err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
Definition: rostcp.c:394
struct pbuf * p
Definition: rosip.h:19
struct lwip_callback_msg::@3950::@3952 Socket
struct ip_addr * IpAddress
Definition: rosip.h:36
err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx)
Definition: rostcp.c:683
ULONG Offset
Definition: rosip.h:20
PTCP_PCB LibTCPSocket(void *arg)
Definition: rostcp.c:342
LIST_ENTRY ListEntry
Definition: rosip.h:21
unsigned char * PUCHAR
Definition: retypes.h:3
void LibTCPGetSocketStatus(PTCP_PCB pcb, PULONG State)
Definition: rostcp.c:845
err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, u32_t *sent, const int safe)
Definition: rostcp.c:536
LONG NTSTATUS
Definition: precomp.h:26
void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size)
Definition: rosip.c:12
err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
Definition: rostcp.c:822
PCONNECTION_ENDPOINT Connection
Definition: rosip.h:35
err_t Error
Definition: rosip.h:70
u8_t Backlog
Definition: rosip.h:41
void LibIPInitialize(void)
Definition: rosip.c:35
static BOOL Set
Definition: pageheap.c:10
void * Data
Definition: rosip.h:45
struct tcp_pcb * NewPcb
Definition: rosip.h:67
Definition: rosip.h:17
struct lwip_callback_msg::@3950::@3957 Shutdown
void TCPConnectEventHandler(void *arg, const err_t err)
Definition: event.c:479
struct lwip_callback_msg::@3950::@3956 Connect
unsigned char BOOLEAN
s8_t err_t
Definition: err.h:47
u16_t DataLength
Definition: rosip.h:46
union lwip_callback_msg::@3950 Input
struct lwip_callback_msg::@3950::@3958 Close
err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback)
Definition: rostcp.c:764
struct lwip_callback_msg::@3950::@3954 Listen
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
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:77
union lwip_callback_msg::@3951 Output
void LibTCPSetNoDelay(PTCP_PCB pcb, BOOLEAN Set)
Definition: rostcp.c:834
void TCPFinEventHandler(void *arg, const err_t err)
Definition: event.c:247
struct _QUEUE_ENTRY QUEUE_ENTRY
Definition: msg.h:34
GLenum GLsizei len
Definition: glext.h:6722
Definition: typedefs.h:117
#define err(...)
struct lwip_callback_msg::@3950::@3955 Send
NTSTATUS LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection, PUCHAR RecvBuffer, UINT RecvLen, UINT *Received)
Definition: rostcp.c:101
struct lwip_callback_msg::@3950::@3953 Bind
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:437
unsigned int ULONG
Definition: retypes.h:1
int const JOCTET * dataptr
Definition: jpeglib.h:1027
void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg)
Definition: rostcp.c:796
unsigned short u16_t
Definition: cc.h:24
KEVENT Event
Definition: rosip.h:27
void TCPAcceptEventHandler(void *arg, PTCP_PCB newpcb)
Definition: event.c:297
USHORT port
Definition: uri.c:228
u16_t Port
Definition: rosip.h:37
UINT Received
Definition: arping.c:40
err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port)
Definition: rostcp.c:601
err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port)
Definition: rostcp.c:810
PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog)
Definition: rostcp.c:448
void TCPSendEventHandler(void *arg, const u16_t space)
Definition: event.c:359