Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenrosip.h
Go to the documentation of this file.
00001 #ifndef _ROS_IP_H_ 00002 #define _ROS_IP_H_ 00003 00004 #include "lwip/tcp.h" 00005 #include "lwip/pbuf.h" 00006 #include "lwip/ip_addr.h" 00007 #include "tcpip.h" 00008 00009 #ifndef LWIP_TAG 00010 #define LWIP_TAG 'PIwl' 00011 #endif 00012 00013 typedef struct tcp_pcb* PTCP_PCB; 00014 00015 typedef struct _QUEUE_ENTRY 00016 { 00017 struct pbuf *p; 00018 LIST_ENTRY ListEntry; 00019 } QUEUE_ENTRY, *PQUEUE_ENTRY; 00020 00021 struct lwip_callback_msg 00022 { 00023 /* Synchronization */ 00024 KEVENT Event; 00025 00026 /* Input */ 00027 union { 00028 struct { 00029 PVOID Arg; 00030 } Socket; 00031 struct { 00032 PCONNECTION_ENDPOINT Connection; 00033 struct ip_addr *IpAddress; 00034 u16_t Port; 00035 } Bind; 00036 struct { 00037 PCONNECTION_ENDPOINT Connection; 00038 u8_t Backlog; 00039 } Listen; 00040 struct { 00041 PCONNECTION_ENDPOINT Connection; 00042 void *Data; 00043 u16_t DataLength; 00044 } Send; 00045 struct { 00046 PCONNECTION_ENDPOINT Connection; 00047 struct ip_addr *IpAddress; 00048 u16_t Port; 00049 } Connect; 00050 struct { 00051 PCONNECTION_ENDPOINT Connection; 00052 int shut_rx; 00053 int shut_tx; 00054 } Shutdown; 00055 struct { 00056 PCONNECTION_ENDPOINT Connection; 00057 int Callback; 00058 } Close; 00059 } Input; 00060 00061 /* Output */ 00062 union { 00063 struct { 00064 struct tcp_pcb *NewPcb; 00065 } Socket; 00066 struct { 00067 err_t Error; 00068 } Bind; 00069 struct { 00070 struct tcp_pcb *NewPcb; 00071 } Listen; 00072 struct { 00073 err_t Error; 00074 } Send; 00075 struct { 00076 err_t Error; 00077 } Connect; 00078 struct { 00079 err_t Error; 00080 } Shutdown; 00081 struct { 00082 err_t Error; 00083 } Close; 00084 } Output; 00085 }; 00086 00087 NTSTATUS LibTCPGetDataFromConnectionQueue(PCONNECTION_ENDPOINT Connection, PUCHAR RecvBuffer, UINT RecvLen, UINT *Received); 00088 00089 /* External TCP event handlers */ 00090 extern void TCPConnectEventHandler(void *arg, const err_t err); 00091 extern void TCPAcceptEventHandler(void *arg, PTCP_PCB newpcb); 00092 extern void TCPSendEventHandler(void *arg, const u16_t space); 00093 extern void TCPFinEventHandler(void *arg, const err_t err); 00094 extern void TCPRecvEventHandler(void *arg); 00095 00096 /* TCP functions */ 00097 PTCP_PCB LibTCPSocket(void *arg); 00098 err_t LibTCPBind(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port); 00099 PTCP_PCB LibTCPListen(PCONNECTION_ENDPOINT Connection, const u8_t backlog); 00100 err_t LibTCPSend(PCONNECTION_ENDPOINT Connection, void *const dataptr, const u16_t len, const int safe); 00101 err_t LibTCPConnect(PCONNECTION_ENDPOINT Connection, struct ip_addr *const ipaddr, const u16_t port); 00102 err_t LibTCPShutdown(PCONNECTION_ENDPOINT Connection, const int shut_rx, const int shut_tx); 00103 err_t LibTCPClose(PCONNECTION_ENDPOINT Connection, const int safe, const int callback); 00104 00105 err_t LibTCPGetPeerName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); 00106 err_t LibTCPGetHostName(PTCP_PCB pcb, struct ip_addr *const ipaddr, u16_t *const port); 00107 void LibTCPAccept(PTCP_PCB pcb, struct tcp_pcb *listen_pcb, void *arg); 00108 00109 /* IP functions */ 00110 void LibIPInsertPacket(void *ifarg, const void *const data, const u32_t size); 00111 void LibIPInitialize(void); 00112 void LibIPShutdown(void); 00113 00114 #endif Generated on Sat May 26 2012 04:35:00 for ReactOS by
1.7.6.1
|