src/stack/sock6/sock6pcb.c File Reference

Object member functions for the Sock6 device object. These functions include protocol control type access to the SOCKET object. More...


Functions

int Sock6PcbAttach (HANDLE hSock)
int Sock6PcbDetach (HANDLE hSock)
int Sock6PcbBind (HANDLE hSock, IP6N LIP, uint LPort)
int Sock6PcbConnect (HANDLE hSock, IP6N FIP, uint FPort)
HANDLE Sock6PcbResolveChain (HANDLE hSock, uint SockProt, uint Prot, IP6N LIP, uint LPort, IP6N FIP, uint FPort)
HANDLE Sock6PcbResolve (uint SockProt, IP6N LIP, uint LPort, IP6N FIP, uint FPort, uint Match)
void Sock6PcbRtChange (HANDLE hRt6)
void Sock6PcbCleanup ()
void Sock6CleanPcb (uint SockProt, IP6N IPAddress)


Detailed Description

Object member functions for the Sock6 device object. These functions include protocol control type access to the SOCKET object.

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

Function Documentation

void Sock6CleanPcb ( uint  SockProt,
IP6N  IPAddress 
)

Description
The function cycles through all the socket entries for the specified protocol family and closes any socket which matches the IP Address specified. The function was added to ensure that when an IP address is modified then any sockets which are using the OLD IP Address should be closed.

This is for *internal* NDK Stack Usage.

Parameters:
[in] SockProt Socket Family
[in] IPAddress OLD IP Address to which a socket might be bound to and which needs to be cleaned.
Return values:
Not Applicable

int Sock6PcbAttach ( HANDLE  hSock  ) 

Description
The function attaches the SOCKET to the appropriate list.

Parameters:
[in] hSock The pointer to the socket which we will attach to the corresponding list.
Return values:
Success - 0
Error - Non Zero

int Sock6PcbBind ( HANDLE  hSock,
IP6N  LIP,
uint  LPort 
)

Description
The function binds the socket to the specific Local IP and Port.

Parameters:
[in] hSock Handle to the socket which is to be bound.
[in] LIP Local IPv6 Address to which the socket is to bound.
[in] LPort Local Port to which the socket is to be bound.
Return values:
Success - 0
Error - Non Zero

void Sock6PcbCleanup (  ) 

Description
The function aborts all closing sockets in the IPv6 socket family.

Return values:
Not Applicable.

int Sock6PcbConnect ( HANDLE  hSock,
IP6N  FIP,
uint  FPort 
)

Description
The function sets the Foreign IP And Port in the SOCKET to the ones passed in this API. The function ensures there is no duplication present.

Parameters:
[in] hSock Socket Handle to be configured with the IP and Port.
[in] FIP Foreign IP Address
[in] FPort Foreign Port
Return values:
Success - 0
Error - Non Zero

int Sock6PcbDetach ( HANDLE  hSock  ) 

Description
The function detaches the SOCKET from the appropriate list.

Parameters:
[in] hSock The pointer to the socket which we will detach from the corresponding list.
Return values:
Success - 0
Error - Non Zero

HANDLE Sock6PcbResolve ( uint  SockProt,
IP6N  LIP,
uint  LPort,
IP6N  FIP,
uint  FPort,
uint  Match 
)

Description
The function finds a socket matching the criteria given.

Parameters:
[in] SockProt The Socket Protocol Family.
[in] LIP The Local IPv6 Address
[in] LPort The Local Port
[in] FIP The Foreign IPv6 Address
[in] FPort The Foreign Port
[in] Match The type of resolution which is being sought.
  • SOCK_RESOLVE_EXACT: Exact Match all parameters should match
  • SOCK_RESOLVE_BEST : Best Possible Match.
  • SOCK_RESOLVE_SPAWN: Match and then spawn a new socket.
Return values:
Handle to Socket Matching the search criteria.

HANDLE Sock6PcbResolveChain ( HANDLE  hSock,
uint  SockProt,
uint  Prot,
IP6N  LIP,
uint  LPort,
IP6N  FIP,
uint  FPort 
)

Description
The function finds a socket matching the criteria given. The function unlike the SockPcbResolve can be used to start searches from various points in the list.

Parameters:
[in] hSock The socket handle from where the search will start. A value of 0 here indicates that the search is started from the begining of the list.
[in] SockProt The Socket Protocol Family.
[in] Prot The Protocol family
[in] LIP The Local IPv6 Address
[in] LPort The Local Port
[in] FIP The Foreign IPv6 Address
[in] FPort The Foreign Port
Return values:
Handle to Socket Matching the search criteria.

void Sock6PcbRtChange ( HANDLE  hRt6  ) 

Description
The function is called from the ROUTE6 Module to indicate that there has been a change in the IPv6 ROUTING Table. The function invalidates all sockets which have cached this route This will ensure that subsequent packets being transmitted via these sockets relook the routing table for the correct match.

Parameters:
[in] hRt6 Handle to the V6 routing entry which has expired.
Return values:
Not Applicable


Copyright 2009, Texas Instruments Incorporated