Webserver+3d print
tcp.h File Reference
TCP (Transmission Control Protocol) More...
Go to the source code of this file.
Data Structures | |
struct | TcpTimer |
TCP timer. More... | |
struct | _TcpQueueItem |
Retransmission queue item. More... | |
struct | _TcpSynQueueItem |
SYN queue item. More... | |
struct | TcpSackBlock |
SACK block. More... | |
struct | TcpTxBuffer |
Transmit buffer. More... | |
struct | TcpRxBuffer |
Receive buffer. More... | |
Typedefs | |
typedef struct _TcpQueueItem | TcpQueueItem |
Retransmission queue item. | |
typedef struct _TcpSynQueueItem | TcpSynQueueItem |
SYN queue item. | |
Enumerations | |
enum | TcpState |
TCP FSM states. More... | |
enum | TcpCongestState |
TCP congestion states. More... | |
enum | TcpFlags |
TCP control flags. More... | |
enum | TcpOptionKind |
TCP option types. More... | |
Functions | |
error_t | tcpInit (void) |
TCP related initialization. | |
uint16_t | tcpGetDynamicPort (void) |
Get an ephemeral port number. | |
error_t | tcpConnect (Socket *socket, const IpAddr *remoteIpAddr, uint16_t remotePort) |
Establish a TCP connection. | |
error_t | tcpListen (Socket *socket, uint_t backlog) |
Place a socket in the listening state. | |
Socket * | tcpAccept (Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort) |
Permit an incoming connection attempt on a TCP socket. | |
error_t | tcpSend (Socket *socket, const uint8_t *data, size_t length, size_t *written, uint_t flags) |
Send data to a connected socket. | |
error_t | tcpReceive (Socket *socket, uint8_t *data, size_t size, size_t *received, uint_t flags) |
Receive data from a connected socket. | |
error_t | tcpShutdown (Socket *socket, uint_t how) |
Shutdown gracefully reception, transmission, or both. | |
error_t | tcpAbort (Socket *socket) |
Abort an existing TCP connection. | |
TcpState | tcpGetState (Socket *socket) |
Get the current state of the TCP FSM. | |
Socket * | tcpKillOldestConnection (void) |
Kill the oldest socket in the TIME-WAIT state. |
Detailed Description
TCP (Transmission Control Protocol)
License
Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version:
- 1.7.6
Definition in file tcp.h.
Typedef Documentation
typedef struct _TcpQueueItem TcpQueueItem |
Retransmission queue item.
typedef struct _TcpSynQueueItem TcpSynQueueItem |
SYN queue item.
Enumeration Type Documentation
enum TcpCongestState |
enum TcpOptionKind |
Function Documentation
error_t tcpAbort | ( | Socket * | socket ) |
Socket* tcpAccept | ( | Socket * | socket, |
IpAddr * | clientIpAddr, | ||
uint16_t * | clientPort | ||
) |
Permit an incoming connection attempt on a TCP socket.
- Parameters:
-
[in] socket Handle to a socket previously placed in a listening state [out] clientIpAddr IP address of the client [out] clientPort Port number used by the client
- Returns:
- Handle to the socket in which the actual connection is made
uint16_t tcpGetDynamicPort | ( | void | ) |
TcpState tcpGetState | ( | Socket * | socket ) |
error_t tcpInit | ( | void | ) |
Socket* tcpKillOldestConnection | ( | void | ) |
error_t tcpListen | ( | Socket * | socket, |
uint_t | backlog | ||
) |
Place a socket in the listening state.
Place a socket in a state in which it is listening for an incoming connection
- Parameters:
-
[in] socket Socket to place in the listening state [in] backlog backlog The maximum length of the pending connection queue. If this parameter is zero, then the default backlog value is used instead
- Returns:
- Error code
error_t tcpReceive | ( | Socket * | socket, |
uint8_t * | data, | ||
size_t | size, | ||
size_t * | received, | ||
uint_t | flags | ||
) |
Receive data from a connected socket.
- Parameters:
-
[in] socket Handle that identifies a connected socket [out] data Buffer where to store the incoming data [in] size Maximum number of bytes that can be received [out] received Number of bytes that have been received [in] flags Set of flags that influences the behavior of this function
- Returns:
- Error code
error_t tcpSend | ( | Socket * | socket, |
const uint8_t * | data, | ||
size_t | length, | ||
size_t * | written, | ||
uint_t | flags | ||
) |
Send data to a connected socket.
- Parameters:
-
[in] socket Handle that identifies a connected socket [in] data Pointer to a buffer containing the data to be transmitted [in] length Number of bytes to be transmitted [out] written Actual number of bytes written (optional parameter) [in] flags Set of flags that influences the behavior of this function
- Returns:
- Error code
error_t tcpShutdown | ( | Socket * | socket, |
uint_t | how | ||
) |
Shutdown gracefully reception, transmission, or both.
Note that socketShutdown() does not close the socket, and resources attached to the socket will not be freed until socketClose() is invoked
- Parameters:
-
[in] socket Handle to a socket [in] how Flag that describes what types of operation will no longer be allowed
- Returns:
- Error code
Generated on Tue Jul 12 2022 17:10:22 by
