www.beck-ipc.com

@CHIP-RTOS C Library V2.06 - TCP/IP API


Get_TCP_Socket_State_IP_All

Find TCP socket and return its state.

unsigned char Get_TCP_Socket_State_IP_All (
                             unsigned int localPort,
                             struct in6_addr far *remoteIP,
                             unsigned int *remotePort );

Parameters

localPort

Local port (e.g. htons(23) for telnet).

remoteIP

Output parameter:  Pointer to a in6_addr structure which will receive the remote IP address.

remotePort

Output parameter:  Pointer to storage for 16 bit remote peer port number.

Return Value

Socket state (see list below)

Comments

Search for a TCP socket by a given local port number, returning the socket state, IP address and port number of the remote peer (if any).

If the return value is not INVALID (=20) and is greater or equal to SYN_SENT (=2) then a TCP connection is established.  In this case the storage at remoteIP holds the IP address of the connected remote peer and remotePort contains the remote peer port number.

Possible TCP socket states:

            
CLOSED          0
LISTEN          1
SYN_SENT        2
SYN_RECEIVED    3
ESTABLISHED     4
CLOSE_WAIT      5
FIN_WAIT_1      6
CLOSING         7
LAST_ACK        8
FIN_WAIT_2      9
TIME_WAIT      10
INVALID        20

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3
    n/an/an/aV0.90

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document