]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_TCP_IP.h
Added +TCP code to main repo.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / include / FreeRTOS_TCP_IP.h
1 /*\r
2  * FreeRTOS+TCP Labs Build 160919 (C) 2016 Real Time Engineers ltd.\r
3  * Authors include Hein Tibosch and Richard Barry\r
4  *\r
5  *******************************************************************************\r
6  ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***\r
7  ***                                                                         ***\r
8  ***                                                                         ***\r
9  ***   FREERTOS+TCP IS STILL IN THE LAB (mainly because the FTP and HTTP     ***\r
10  ***   demos have a dependency on FreeRTOS+FAT, which is only in the Labs    ***\r
11  ***   download):                                                            ***\r
12  ***                                                                         ***\r
13  ***   FreeRTOS+TCP is functional and has been used in commercial products   ***\r
14  ***   for some time.  Be aware however that we are still refining its       ***\r
15  ***   design, the source code does not yet quite conform to the strict      ***\r
16  ***   coding and style standards mandated by Real Time Engineers ltd., and  ***\r
17  ***   the documentation and testing is not necessarily complete.            ***\r
18  ***                                                                         ***\r
19  ***   PLEASE REPORT EXPERIENCES USING THE SUPPORT RESOURCES FOUND ON THE    ***\r
20  ***   URL: http://www.FreeRTOS.org/contact  Active early adopters may, at   ***\r
21  ***   the sole discretion of Real Time Engineers Ltd., be offered versions  ***\r
22  ***   under a license other than that described below.                      ***\r
23  ***                                                                         ***\r
24  ***                                                                         ***\r
25  ***** NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ******* NOTE ***\r
26  *******************************************************************************\r
27  *\r
28  * FreeRTOS+TCP can be used under two different free open source licenses.  The\r
29  * license that applies is dependent on the processor on which FreeRTOS+TCP is\r
30  * executed, as follows:\r
31  *\r
32  * If FreeRTOS+TCP is executed on one of the processors listed under the Special\r
33  * License Arrangements heading of the FreeRTOS+TCP license information web\r
34  * page, then it can be used under the terms of the FreeRTOS Open Source\r
35  * License.  If FreeRTOS+TCP is used on any other processor, then it can be used\r
36  * under the terms of the GNU General Public License V2.  Links to the relevant\r
37  * licenses follow:\r
38  *\r
39  * The FreeRTOS+TCP License Information Page: http://www.FreeRTOS.org/tcp_license\r
40  * The FreeRTOS Open Source License: http://www.FreeRTOS.org/license\r
41  * The GNU General Public License Version 2: http://www.FreeRTOS.org/gpl-2.0.txt\r
42  *\r
43  * FreeRTOS+TCP is distributed in the hope that it will be useful.  You cannot\r
44  * use FreeRTOS+TCP unless you agree that you use the software 'as is'.\r
45  * FreeRTOS+TCP is provided WITHOUT ANY WARRANTY; without even the implied\r
46  * warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR\r
47  * PURPOSE. Real Time Engineers Ltd. disclaims all conditions and terms, be they\r
48  * implied, expressed, or statutory.\r
49  *\r
50  * 1 tab == 4 spaces!\r
51  *\r
52  * http://www.FreeRTOS.org\r
53  * http://www.FreeRTOS.org/plus\r
54  * http://www.FreeRTOS.org/labs\r
55  *\r
56  */\r
57 \r
58 #ifndef FREERTOS_TCP_IP_H\r
59 #define FREERTOS_TCP_IP_H\r
60 \r
61 #ifdef __cplusplus\r
62 extern "C" {\r
63 #endif\r
64 \r
65 BaseType_t xProcessReceivedTCPPacket( NetworkBufferDescriptor_t *pxNetworkBuffer );\r
66 \r
67 typedef enum eTCP_STATE {\r
68         /* Comments about the TCP states are borrowed from the very useful\r
69          * Wiki page:\r
70          * http://en.wikipedia.org/wiki/Transmission_Control_Protocol */\r
71         eCLOSED = 0u,   /* 0 (server + client) no connection state at all. */\r
72         eTCP_LISTEN,    /* 1 (server) waiting for a connection request\r
73                                                  from any remote TCP and port. */\r
74         eCONNECT_SYN,   /* 2 (client) internal state: socket wants to send\r
75                                                  a connect */\r
76         eSYN_FIRST,             /* 3 (server) Just created, must ACK the SYN request. */\r
77         eSYN_RECEIVED,  /* 4 (server) waiting for a confirming connection request\r
78                                                  acknowledgement after having both received and sent a connection request. */\r
79         eESTABLISHED,   /* 5 (server + client) an open connection, data received can be\r
80                                                  delivered to the user. The normal state for the data transfer phase of the connection. */\r
81         eFIN_WAIT_1,    /* 6 (server + client) waiting for a connection termination request from the remote TCP,\r
82                                                  or an acknowledgement of the connection termination request previously sent. */\r
83         eFIN_WAIT_2,    /* 7 (server + client) waiting for a connection termination request from the remote TCP. */\r
84         eCLOSE_WAIT,    /* 8 (server + client) waiting for a connection termination request from the local user. */\r
85         eCLOSING,               /*   (server + client) waiting for a connection termination request acknowledgement from the remote TCP. */\r
86         eLAST_ACK,              /* 9 (server + client) waiting for an acknowledgement of the connection termination request\r
87                                                  previously sent to the remote TCP\r
88                                                  (which includes an acknowledgement of its connection termination request). */\r
89         eTIME_WAIT,             /* 10 (either server or client) waiting for enough time to pass to be sure the remote TCP received the\r
90                                                  acknowledgement of its connection termination request. [According to RFC 793 a connection can\r
91                                                  stay in TIME-WAIT for a maximum of four minutes known as a MSL (maximum segment lifetime).] */\r
92 } eIPTCPState_t;\r
93 \r
94 \r
95 #ifdef __cplusplus\r
96 } // extern "C"\r
97 #endif\r
98 \r
99 #endif /* FREERTOS_TCP_IP_H */\r
100 \r
101 \r
102 \r
103 \r
104 \r
105 \r
106 \r
107 \r
108 \r
109 \r
110 \r
111 \r
112 \r