NetServices Stack source
Dependents: HelloWorld ServoInterfaceBoardExample1 4180_Lab4
tcp_in.c File Reference
Transmission Control Protocol, incoming traffic. More...
Go to the source code of this file.
Functions | |
static err_t | tcp_process (struct tcp_pcb *pcb) |
Implements the TCP state machine. | |
static void | tcp_receive (struct tcp_pcb *pcb) |
Called by tcp_process. | |
static void | tcp_parseopt (struct tcp_pcb *pcb) |
Parses the options contained in the incoming segment. | |
static err_t | tcp_listen_input (struct tcp_pcb_listen *pcb) |
Called by tcp_input() when a segment arrives for a listening connection (from tcp_input()). | |
static err_t | tcp_timewait_input (struct tcp_pcb *pcb) |
Called by tcp_input() when a segment arrives for a connection in TIME_WAIT. | |
void | tcp_input (struct pbuf *p, struct netif *inp) |
The initial input processing of TCP. | |
static void | tcp_oos_insert_segment (struct tcp_seg *cseg, struct tcp_seg *next) |
Insert segment into the list (segments covered with new one will be deleted) |
Detailed Description
Transmission Control Protocol, incoming traffic.
The input processing functions of the TCP layer.
These functions are generally called in the order (ip_input() ->) tcp_input() -> * tcp_process() -> tcp_receive() (-> application).
Definition in file tcp_in.c.
Function Documentation
void tcp_input | ( | struct pbuf * | p, |
struct netif * | inp | ||
) |
The initial input processing of TCP.
It verifies the TCP header, demultiplexes the segment between the PCBs and passes it on to tcp_process(), which implements the TCP finite state machine. This function is called by the IP layer (in ip_input()).
- Parameters:
-
p received TCP segment to process (p->payload pointing to the IP header) inp network interface on which this segment was received
static err_t tcp_listen_input | ( | struct tcp_pcb_listen * | pcb ) | [static] |
Called by tcp_input() when a segment arrives for a listening connection (from tcp_input()).
- Parameters:
-
pcb the tcp_pcb_listen for which a segment arrived
- Returns:
- ERR_OK if the segment was processed another err_t on error
- Note:
- the return value is not (yet?) used in tcp_input()
- the segment which arrived is saved in global variables, therefore only the pcb involved is passed as a parameter to this function
static void tcp_oos_insert_segment | ( | struct tcp_seg * | cseg, |
struct tcp_seg * | next | ||
) | [static] |
Insert segment into the list (segments covered with new one will be deleted)
Called from tcp_receive()
static void tcp_parseopt | ( | struct tcp_pcb * | pcb ) | [static] |
Parses the options contained in the incoming segment.
Called from tcp_listen_input() and tcp_process(). Currently, only the MSS option is supported!
- Parameters:
-
pcb the tcp_pcb for which a segment arrived
static err_t tcp_process | ( | struct tcp_pcb * | pcb ) | [static] |
Implements the TCP state machine.
Called by tcp_input. In some states tcp_receive() is called to receive data. The tcp_seg argument will be freed by the caller (tcp_input()) unless the recv_data pointer in the pcb is set.
- Parameters:
-
pcb the tcp_pcb for which a segment arrived
- Note:
- the segment which arrived is saved in global variables, therefore only the pcb involved is passed as a parameter to this function
static void tcp_receive | ( | struct tcp_pcb * | pcb ) | [static] |
Called by tcp_process.
Checks if the given segment is an ACK for outstanding data, and if so frees the memory of the buffered data. Next, is places the segment on any of the receive queues (pcb->recved or pcb->ooseq). If the segment is buffered, the pbuf is referenced by pbuf_ref so that it will not be freed until i it has been removed from the buffer.
If the incoming segment constitutes an ACK for a segment that was used for RTT estimation, the RTT is estimated here as well.
Called from tcp_process().
static err_t tcp_timewait_input | ( | struct tcp_pcb * | pcb ) | [static] |
Called by tcp_input() when a segment arrives for a connection in TIME_WAIT.
- Parameters:
-
pcb the tcp_pcb for which a segment arrived
- Note:
- the segment which arrived is saved in global variables, therefore only the pcb involved is passed as a parameter to this function
Generated on Tue Jul 12 2022 11:52:59 by 1.7.2