Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

TCP Protocol

RFC 793 Transmission Control Protocol. More...

Functions

void NutTcpInput (NETBUF *nb)
 Process incoming TCP segments from IP layer. More...

void NutTcpProcessAck (TCPSOCKET *sock, TCPHDR *th, u_short length)
int NutTcpStatePassiveOpenEvent (TCPSOCKET *sock)
 Initiated by the application. More...

int NutTcpStateActiveOpenEvent (TCPSOCKET *sock)
 Initiated by the application. More...

int NutTcpStateCloseEvent (TCPSOCKET *sock)
 Changes state to TCPS_FIN_WAIT_1. More...

int NutTcpStateAbortEvent (TCPSOCKET *sock)
 Initiated by the application. More...

void NutTcpStateUserTimeout (TCPSOCKET *sock)
 Signal user timeout. More...

void NutTcpStateRetranTimeout (TCPSOCKET *sock)
 Retransmit a segment after ACK timeout. More...

void NutTcpStateTimeWaitTimeout (TCPSOCKET *sock)
 Signal timewait timeout. More...

void NutTcpStateMachine (TCPSOCKET *sock, NETBUF *nb)
 Process TCP incoming segments. More...

int IsInLimits (u_long x, u_long low, u_long high)
 Sequence number comparisons. More...

HANDLE NutTcpTrace (HANDLE hout)
 Switch on/off TCP trace.


Variables

NUTDEVICEtcp_trace

Detailed Description

RFC 793 Transmission Control Protocol.

TCP provides reliable, in-sequence delivery of a full-duplex stream of octets. It is used by applications which need a reliable, connection-oriented data transport.


Function Documentation

int IsInLimits ( u_long x,
u_long low,
u_long high )
 

Sequence number comparisons.

Return true if x is between low and high inclusive, false otherwise

void NutTcpInput ( NETBUF * nb )
 

Process incoming TCP segments from IP layer.

\warn The caller must take care not to pass broadcast or multicast segments.

Note:
This routine is called by the IP layer on incoming TCP segments. Applications typically do not call this function.

void NutTcpProcessAck ( TCPSOCKET * sock,
TCPHDR * th,
u_short length )
 

ACK processing.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

int NutTcpStateAbortEvent ( TCPSOCKET * sock )
 

Initiated by the application.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

int NutTcpStateActiveOpenEvent ( TCPSOCKET * sock )
 

Initiated by the application.

Optionally specify the local IP address.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

Returns:
0 if granted, error code otherwise.

int NutTcpStateCloseEvent ( TCPSOCKET * sock )
 

Changes state to TCPS_FIN_WAIT_1.

Initiated by the application.

No further data sending is accepted. Receiving is still allowed.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

void NutTcpStateMachine ( TCPSOCKET * sock,
NETBUF * nb )
 

Process TCP incoming segments.

Processing is based on the current state of the socket connection.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().
nb   Network buffer structure containing a TCP segment.

int NutTcpStatePassiveOpenEvent ( TCPSOCKET * sock )
 

Initiated by the application.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

Returns:
0 if granted, error code otherwise.

void NutTcpStateRetranTimeout ( TCPSOCKET * sock )
 

Retransmit a segment after ACK timeout.

This function is called by the TCP timer.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

void NutTcpStateTimeWaitTimeout ( TCPSOCKET * sock )
 

Signal timewait timeout.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().

void NutTcpStateUserTimeout ( TCPSOCKET * sock )
 

Signal user timeout.

Parameters:
sock   Socket descriptor. This pointer must have been retrieved by calling NutTcpCreateSocket().


Variable Documentation

NUTDEVICE * tcp_trace
 

TCP trace device.


© 2000-2001 by egnite Software GmbH - visit http://www.ethernut.de/