]> git.sur5r.net Git - freertos/blob - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/include/FreeRTOS_TCP_IP.h
e26edf653789ae72b529f25b26e37dff2591ac97
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / include / FreeRTOS_TCP_IP.h
1 /*
2  * FreeRTOS+TCP V2.2.0
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25
26 #ifndef FREERTOS_TCP_IP_H
27 #define FREERTOS_TCP_IP_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 BaseType_t xProcessReceivedTCPPacket( NetworkBufferDescriptor_t *pxNetworkBuffer );
34
35 typedef enum eTCP_STATE {
36         /* Comments about the TCP states are borrowed from the very useful
37          * Wiki page:
38          * http://en.wikipedia.org/wiki/Transmission_Control_Protocol */
39         eCLOSED = 0u,   /* 0 (server + client) no connection state at all. */
40         eTCP_LISTEN,    /* 1 (server) waiting for a connection request
41                                                  from any remote TCP and port. */
42         eCONNECT_SYN,   /* 2 (client) internal state: socket wants to send
43                                                  a connect */
44         eSYN_FIRST,             /* 3 (server) Just created, must ACK the SYN request. */
45         eSYN_RECEIVED,  /* 4 (server) waiting for a confirming connection request
46                                                  acknowledgement after having both received and sent a connection request. */
47         eESTABLISHED,   /* 5 (server + client) an open connection, data received can be
48                                                  delivered to the user. The normal state for the data transfer phase of the connection. */
49         eFIN_WAIT_1,    /* 6 (server + client) waiting for a connection termination request from the remote TCP,
50                                                  or an acknowledgement of the connection termination request previously sent. */
51         eFIN_WAIT_2,    /* 7 (server + client) waiting for a connection termination request from the remote TCP. */
52         eCLOSE_WAIT,    /* 8 (server + client) waiting for a connection termination request from the local user. */
53         eCLOSING,               /*   (server + client) waiting for a connection termination request acknowledgement from the remote TCP. */
54         eLAST_ACK,              /* 9 (server + client) waiting for an acknowledgement of the connection termination request
55                                                  previously sent to the remote TCP
56                                                  (which includes an acknowledgement of its connection termination request). */
57         eTIME_WAIT,             /* 10 (either server or client) waiting for enough time to pass to be sure the remote TCP received the
58                                                  acknowledgement of its connection termination request. [According to RFC 793 a connection can
59                                                  stay in TIME-WAIT for a maximum of four minutes known as a MSL (maximum segment lifetime).] */
60 } eIPTCPState_t;
61
62
63 #ifdef __cplusplus
64 } // extern "C"
65 #endif
66
67 #endif /* FREERTOS_TCP_IP_H */
68
69
70
71
72
73
74
75
76
77
78
79
80