inc/stack/inc/ip6if.h File Reference

Common structures and definitions for IPv6. More...


Data Structures

struct  IPV6_DEV_RECORD
 The structure describes the IPv6 Device Record. More...
struct  IPV6STATS
 The structure describes the IPv6 Statistics Block. More...

Functions

_extern void IPv6ParseExtnHeaders (PBM_Pkt *pPkt, IPV6HDR *ptr_ipv6hdr)
_extern int IPv6ParseFragHdr (PBM_Pkt *pPkt, IPV6HDR *ptr_ipv6hdr)
_extern void IPv6RxPacket (PBM_Pkt *pPkt)
_extern HANDLE IPv6GetRoute (IP6N DstIP)
_extern int IPv6TxPacket (PBM_Pkt *pPkt, UINT32 Flags)
_extern int IPv6InterfaceDeInit (UINT16 dev_index)
_extern int IPv6AddAddress (UINT16 dev_index, IP6N Address, UINT16 NetBits, UINT32 VLT, UINT32 PLT, UINT8 IsAny)
_extern int IPv6DelAddress (UINT16 dev_index, IP6N Address)
_extern void IPv6GetSubnetMaskFromBits (IP6N *SubnetMask, UINT16 bits)
_extern void IPv6DisplayIPAddress (IP6N address)
_extern int IPv6StringToIPAddress (char *StringIP, IP6N *address)
_extern UINT16 IPv6CompareAddress (IP6N addr1, IP6N addr2)
_extern UINT16 IPv6IsMulticast (IP6N address)
_extern UINT16 IPv6IsLinkLocal (IP6N address)
_extern UINT16 IPv6Layer4ComputeChecksum (UINT8 *ptr_l4Hdr, PSEUDOV6 *ptr_pseudoHdr)


Detailed Description

Common structures and definitions for IPv6.

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

Function Documentation

_extern int IPv6AddAddress ( UINT16  dev_index,
IP6N  Address,
UINT16  NetBits,
UINT32  ValidLifetime,
UINT32  PrefLifetime,
UINT8  IsAnycast 
)

Description
This function is used to add an IPv6 address to an interface. This function should not be used to add Link Local Addresses to the interface. Link Local Addresses are automatically added to the interface when the IPv6 stack is initialized on it.

See also:
IPv6AddAddress
The function is exported to system developers and should only be called from outside kernel mode.

Parameters:
[in] dev_index The device index on which the IPv6 address needs to be added.
[in] Address The IPv6 Address which needs to be added.
[in] NetBits The number of bits which make the Subnet-Mask.
[in] ValidLifetime The Valid Lifetime of the address. Set to INFINITE_LT if the address is permanent
[in] PrefLifetime The Preferred Lifetime of the address. Set to INFINITE_LT if the address is permanent.
[in] IsAnycast Flag which indicates if the address to be added is ANYCAST or UNICAST. Set to 1 for ANYCAST.
Return values:
0 - Success
<0 - Error

_extern UINT16 IPv6CompareAddress ( IP6N  addr1,
IP6N  addr2 
)

Description
Utility Function used to compare the 2 IPv6 Addresses.

This is for *internal* NDK Stack Usage.

Parameters:
[in] addr1 The first IPv6 Address which is to be compared.
[in] addr2 The second IPv6 Address which is to be compared.
Return values:
1 - The IP Addresses match
0 - The IP Addresses do not match

_extern int IPv6DelAddress ( UINT16  dev_index,
IP6N  Address 
)

Description
This function is used to delete an IPv6 address from an interface This function should not be used to delete Link Local Addresses from the interface. Link Local Addresses are automatically deleted from the interface when the IPv6 stack is de-initialized on it.

See also:
IPv6InterfaceDeInit
The function is exported to system developers and should only be called from outside kernel mode.

Parameters:
[in] dev_index The device index on which the IPv6 address needs to be deleted.
[in] Address The IPv6 Address which needs to be deleted.
Return values:
0 - Success
<0 - Error

_extern void IPv6DisplayIPAddress ( IP6N  address  ) 

Description
Utility Function which prints the IPv6 address. The IP address passed has to be specified in network order (IP6N).

Parameters:
[in] address IPv6 Address to be displayed.
Return values:
Not Applicable.

_extern HANDLE IPv6GetRoute ( IP6N  DstIP  ) 

Description
The function is used to get an IPv6 route matching the destination IP Address. The function increments the reference counter for the ROUTE6 object.

This is for *internal* NDK Stack Usage.

Parameters:
[in] DstIP IPv6 Destination IP address we are trying to find a route for.
Return values:
Success - Handle of the Route6 object to be used.
Error - 0

_extern void IPv6GetSubnetMaskFromBits ( IP6N *  SubnetMask,
UINT16  bits 
)

Description
Utility Function which gets the subnet mask given the number of bits.

For example: Subnet Mask = 0xFFFF:: if the bits is 16

This is for *internal* NDK Stack Usage.

Parameters:
[out] SubnetMask Pointer to the computed subnet mask in network order.
[in] bits Number of bits in the subnet mask
Return values:
Not Applicable.

_extern int IPv6InterfaceDeInit ( UINT16  dev_index  ) 

Description
This function is used to deinitialize the IPv6 stack on the the specific device name. The function is available to System Developers and should only be called from within kernel mode.

Parameters:
[in] dev_index The device index on which the IPv6 stack is to be deinitialized.
Return values:
0 - Success
<0 - Error

_extern UINT16 IPv6IsLinkLocal ( IP6N  address  ) 

Description
Utility Function which determines if the IPv6 Address specified is a Link Local address or not?

This is for *internal* NDK Stack Usage.

Parameters:
[in] address IPv6 Address which needs to be verfied.
Return values:
1 - The address passed is Link Local
0 - The address passed is NOT Link Local

_extern UINT16 IPv6IsMulticast ( IP6N  address  ) 

Description
Utility Function which determines if the IPv6 Address specified is a Multicast address or not?

This is for *internal* NDK Stack Usage.

Parameters:
[in] address IPv6 Address which needs to be verfied.
Return values:
1 - The address passed is MULTICAST
0 - The address passed is NOT Multicast

_extern UINT16 IPv6Layer4ComputeChecksum ( UINT8 *  ptr_l4Hdr,
PSEUDOV6 *  ptr_pseudoHdr 
)

Description
The function does the Layer4 Checksum computation.

Parameters:
[in] ptr_l4Hdr Pointer to the Layer4 Header. This could be TCP, UDP or ICMPv6.
[in] ptr_pseudoHdr Pointer to the Pseudo Header.
Return values:
Returns the computed checksum.
Precondition:
Ensure that the Checksum field in the layer4 header is set to 0 before calling this function.

_extern void IPv6ParseExtnHeaders ( PBM_Pkt *  pPkt,
IPV6HDR *  ptr_ipv6hdr 
)

Description
The function handles all IPV6 extension headers.

Parameters:
[in] pPkt Pointer to the entire IPv6 Packet.
[in] ptr_ipv6hdr Pointer to the IPv6 Header.
Return values:
None 

_extern int IPv6ParseFragHdr ( PBM_Pkt *  pPkt,
IPV6HDR *  ptr_ipv6hdr 
)

Description
The function handles all packets with fragmentation header.

Parameters:
[in] pPkt Pointer to the entire IPv6 Packet.
[in] ptr_ipv6hdr Pointer to the IPv6 Header.
Return values:
-1 - Error in processing the packet. Packet has been cleaned up.
1 - Packet has been successfully processed by fragmentation module. Its been absorbed by this module for reassembly. Ignore this packet. This packet is now a responsibility of the fragmentation layer for further processing.

_extern void IPv6RxPacket ( PBM_Pkt *  pPkt  ) 

Description
This function is used to process an IPv6 packet received on the network.

This is for *internal* NDK Stack Usage.

Parameters:
[in] pPkt Pointer to the IPv6 packet.
Return values:
Not Applicable.

_extern int IPv6StringToIPAddress ( char *  StringIP,
IP6N *  address 
)

Description
Utility Function which converts an IPv6 Address from CHAR Format to IP6N

Parameters:
[in] StringIP The IPv6 Address in String Format
[out] address The IPv6 Address in IP6N format.
Return values:
0 - Success
-1 - Error

_extern int IPv6TxPacket ( PBM_Pkt *  pPkt,
UINT32  Flags 
)

Description
The function is used to transmit an IPv6 packet.

This is for *internal* NDK Stack Usage.

Parameters:
[in] pPkt Pointer to the IPv6 packet which needs to be transmitted
[in] Flags Flags which need to be worked out. (Placeholder)
Return values:
Success - 0
Error - <0


Copyright 2009, Texas Instruments Incorporated