src/stack/tcp6/tcp6prot.c File Reference

The file handle the TCP Protocol functions for V6. More...


Functions

int TCP6PrAttach (HANDLE h, HANDLE *phTcp)
int TCP6PrListen (HANDLE h, HANDLE hTcp)
void TCP6PrInherit (HANDLE hParent, HANDLE hTcpParent, HANDLE hChild, HANDLE hTcpChild)
uint TCP6ValidateMetrics (TCPPROT *pt, uint rcvmss)
void TCP6Close (TCPPROT *pt)
void TCP6Drop (TCPPROT *pt, int Error)
int TCP6PrDetach (HANDLE hSock, HANDLE *phTcp, int fatal)
int TCP6PrConnect (HANDLE h, HANDLE hTcp)
int TCP6PrDisconnect (HANDLE hSock, HANDLE hTcp)
int TCP6PrRecv (HANDLE h, HANDLE hTcp)
int TCP6PrSend (HANDLE h, HANDLE hTcp, UINT8 *pBuf, INT32 Size, INT32 *pRetSize)
int TCP6PrSendOOB (HANDLE h, HANDLE hTcp, UINT8 *pBuf, INT32 Size, INT32 *pRetSize)
uint TCP6PrGetState (HANDLE hParent, HANDLE hTcp)
void TCP6PrCtlError (HANDLE h, HANDLE hTcp, uint Code, int Error)
int TCP6PrSetOption (HANDLE h, HANDLE hTcp, int Prop, void *pBuf, int size)
int TCP6PrGetOption (HANDLE h, HANDLE hTcp, int Prop, void *pBuf, int *psize)


Detailed Description

The file handle the TCP Protocol functions for V6.

NOTE: (C) Copyright 2008, Texas Instruments, Inc.

Function Documentation

void TCP6Close ( TCPPROT *  pt  ) 

Description
The function is called to close down the TCP Protocol block.

Parameters:
[in] pt Pointer to the TCP Protocol Information block.
Return values:
Not Applicable.

void TCP6Drop ( TCPPROT *  pt,
int  Error 
)

Description
The function drops a TCP side "socket" with ABORT

Parameters:
[in] pt Handle to the TCP protocol information
[in] Error Error Code.
Return values:
Not applicable.

int TCP6PrAttach ( HANDLE  h,
HANDLE *  phTcp 
)

Description
The function is used to create a new TCP socket and is called from the SOCK6 module.

Parameters:
[in] h Handle to the socket being created.
[out] phTcp The TCP Protocol information which is populated.
Return values:
Success - 0
Error - Non Zero

int TCP6PrConnect ( HANDLE  h,
HANDLE  hTcp 
)

Description
The function requests a connection for a TCP6 socket.

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
Return values:
Always returns 0.

void TCP6PrCtlError ( HANDLE  h,
HANDLE  hTcp,
uint  Code,
int  Error 
)

Description
The function is called to indicate there is an error detected by the reception of an error ICMPv6 packet.

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
[in] Code Obsolete
[in] Error Error Code.
Return values:
Not Applicable

int TCP6PrDetach ( HANDLE  hSock,
HANDLE *  phTcp,
int  fatal 
)

Description
The function closes the TCP side "socket", detaches and free resources

Parameters:
[in] hSock Handle to the socket.
[in] phTcp Handle to the TCP Protocol Information block.
[in] fatal Status flag which if set to 1 indicates that the socket should be closed immediately and if set to 0 indicates that the TCP close state machine is invoked.
Return values:
Always returns 0.

int TCP6PrDisconnect ( HANDLE  hSock,
HANDLE  hTcp 
)

Description
The function disconnects a TCP side "socket" - performs "half close"

Parameters:
[in] hSock Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
Return values:
Always returns 0.

int TCP6PrGetOption ( HANDLE  h,
HANDLE  hTcp,
int  Prop,
void *  pBuf,
int *  psize 
)

Description
The function is used to get the TCP options.

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
[in] Prop The Property which needs to be configured.
[out] pBuf Data buffer where the value of property will be copied.
[out] psize Size of the Data buffer
Return values:
Success - 0
Error - Non Zero

uint TCP6PrGetState ( HANDLE  hParent,
HANDLE  hTcp 
)

Description
The function returns the TCP State

Parameters:
[in] hParent Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information Block.
Return values:
TCP State

void TCP6PrInherit ( HANDLE  hParent,
HANDLE  hTcpParent,
HANDLE  hChild,
HANDLE  hTcpChild 
)

Description
The function is called to inherit TCP protocol properties from parent to child.

Parameters:
[in] hParent Handle to the parent socket.
[in] hTcpParent Handle to the parent TCP protocol information
[in] hChild Handle to the child socket.
[in] hTcpChild Handle to the child TCP protocol information
Return values:
Not Applicable

int TCP6PrListen ( HANDLE  h,
HANDLE  hTcp 
)

Description
The function is called by the SOCKET Layer to indicate that the socket has been marked as LISTENING. This internally implies that the socket can no longer be used for data reception and transmission so the function clears the internal protocol resources.

Parameters:
[in] h Handle to the socket
[in] hTcp Handle to the TCP protocol information
Return values:
Always returns 0.

int TCP6PrRecv ( HANDLE  h,
HANDLE  hTcp 
)

Description
The function deals with Rx data being removed from buffer

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
Return values:
Always returns 0.

int TCP6PrSend ( HANDLE  h,
HANDLE  hTcp,
UINT8 *  pBuf,
INT32  Size,
INT32 *  pRetSize 
)

Description
The function sends data

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
[in] pBuf Pointer to the data Buffer to be transmitted.
[in] Size Size of the data buffer.
[out] pRetSize Number of bytes sent out.
Return values:
Always returns 0.

int TCP6PrSendOOB ( HANDLE  h,
HANDLE  hTcp,
UINT8 *  pBuf,
INT32  Size,
INT32 *  pRetSize 
)

Description
The function sends OOB data

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
[in] pBuf Pointer to the data Buffer to be transmitted.
[in] Size Size of the data buffer.
[out] pRetSize Number of bytes sent out.
Return values:
Always returns 0.

int TCP6PrSetOption ( HANDLE  h,
HANDLE  hTcp,
int  Prop,
void *  pBuf,
int  size 
)

Description
The function is used to set the TCP options.

Parameters:
[in] h Handle to the socket.
[in] hTcp Handle to the TCP Protocol Information block.
[in] Prop The Property which needs to be configured.
[in] pBuf Data buffer where the value of property is present
[in] size Size of the Data buffer
Return values:
Success - 0
Error - Non Zero

uint TCP6ValidateMetrics ( TCPPROT *  pt,
uint  rcvmss 
)

Description
The function is called to update the TCP Information based on the socket route.

Parameters:
[in] pt Handle to the TCP protocol information
[in] rcvmss Received MSS.
Return values:
Current MSS to advertise.


Copyright 2009, Texas Instruments Incorporated