NetBurner 3.5.6
PDF Version
IPv6Interface Class Reference

Main IPv6 interface management class. More...

#include <ipv6_interface.h>

Inherits TimeOutElement.

Public Member Functions

uint16_t GetDestinationMTU (const IPADDR &ip)
 Get destination MTU for specified address.
 
IPv6InterfaceGetNext_IP6_Interface ()
 Get next IPv6 interface in the list.
 
IPADDR6 MySourceAddress (const IPADDR6 &ip)
 Determine best source address for communicating with destination.
 
int GetInterfaceNumber ()
 Get interface number.
 
IPADDR6 MyDNSAddress ()
 Get DNS server address for this interface.
 
bool HadLink ()
 Check if interface has had link connectivity.
 
IPV6_PREFIXAddStaticAddress (const IPADDR6 &ip, int PrefixLen)
 Add static IPv6 address to interface.
 
IPV6_ROUTERAddDefaultGateway (const IPADDR6 &ip)
 Add default gateway to interface.
 
IPV6_DNSAddStaticDNS (const IPADDR6 &ip)
 Add static DNS server to interface.
 
bool RemoveStaticAddress (const IPADDR6 &ip)
 Remove static IPv6 address from interface.
 
bool RemoveDefaultGateway (const IPADDR6 &ip)
 Remove default gateway from interface.
 
bool RemoveStaticDNS (const IPADDR6 &ip)
 Remove static DNS server from interface.
 
void SetStaticDNS (IPADDR6 dns)
 Set static DNS server address.
 
void StartDHCP_Solicit ()
 Start DHCPv6 solicitation process.
 
void StartDHCP_InfoReq ()
 Start DHCPv6 information request process.
 
bool IsMyAddress (const IPADDR6 &ip6, bool bMustBePrefered)
 Check if IPv6 address belongs to this interface.
 
bool OnLink (const IPADDR6 &ip6)
 Check if IPv6 address is on-link for this interface.
 
bool HasRoute (const IPADDR6 &ip6)
 Check if there is a route to the specified IPv6 address.
 
void NotifyReachable (const IPADDR6 &ip6)
 Notify that neighbor is reachable.
 
void NotifyUnreachable (const IPADDR6 &ip)
 Notify that neighbor is unreachable.
 
IPADDR6 GetMyFirstAddress ()
 Get first configured IPv6 address.
 
IPADDR6 GetMyNextAddress (const IPADDR6 &ip)
 Get next IPv6 address after specified address.
 
 IPv6Interface (int ifnum)
 Constructor for IPv6 interface.
 
int ping (const IPADDR6 &ip, uint16_t id, uint16_t seq, uint16_t wait, int siz)
 Send IPv6 ping to specified address.
 
int SendMLDRegistration (const IPADDR &regAddr, bool joinNotLeave=true)
 Send MLD registration message.
 
void ShowInfo ()
 Display IPv6 information for this interface.
 

Static Public Member Functions

static IPv6InterfaceGetInterfaceForDestination (const IPADDR6 &ip)
 Find interface that can reach the specified destination.
 
static IPv6InterfaceGetInterfaceForSource (const IPADDR6 &ip)
 Find interface that should be used as source for specified destination.
 
static IPv6InterfaceGetInterfaceN (int n)
 Get IPv6 interface by interface number.
 
static IPv6InterfaceGetFirst_IP6_Interface ()
 Get first IPv6 interface in the system.
 
static void ShowAllInfo ()
 Display IPv6 information for all interfaces.
 

Public Attributes

IPV6_PREFIXm_pMyLinkLocal
 Link-local address for this interface.
 
IPADDR6 m_StaticDNS
 Static DNS server address.
 

Friends

struct IPV6_PREFIX
 
struct IPV6_DEST
 
struct IPV6_ROUTER
 
struct IPV6_NEIGHBOR
 
struct IPV6_DNS
 
struct IPV6_DHCPD
 
class UDPPacket
 
void InitIPv6 (int ifnum=0)
 
int Ping6 (const IPADDR6 &to, uint16_t id, uint16_t seq, uint16_t maxwaitticks, int size=32)
 Send an IPv6 "ping" packet and wait the specified timeout for a response.
 

Detailed Description

Main IPv6 interface management class.

Provides comprehensive IPv6 interface functionality including address management, routing, neighbor discovery, and protocol processing.

Constructor & Destructor Documentation

◆ IPv6Interface()

IPv6Interface::IPv6Interface ( int ifnum)

Constructor for IPv6 interface.

Parameters
ifnumInterface number

Member Function Documentation

◆ AddDefaultGateway()

IPV6_ROUTER * IPv6Interface::AddDefaultGateway ( const IPADDR6 & ip)

Add default gateway to interface.

Parameters
ipIPv6 address of default gateway
Returns
Pointer to created router entry or NULL on failure
See also
RemoveDefaultGateway(), AddStaticAddress(), AddStaticDNS()

◆ AddStaticAddress()

IPV6_PREFIX * IPv6Interface::AddStaticAddress ( const IPADDR6 & ip,
int PrefixLen )

Add static IPv6 address to interface.

Parameters
ipIPv6 address to add
PrefixLenPrefix length in bits
Returns
Pointer to created prefix entry or NULL on failure
See also
RemoveStaticAddress(), AddDefaultGateway(), AddStaticDNS()

◆ AddStaticDNS()

IPV6_DNS * IPv6Interface::AddStaticDNS ( const IPADDR6 & ip)

Add static DNS server to interface.

Parameters
ipIPv6 address of DNS server
Returns
Pointer to created DNS entry or NULL on failure
See also
RemoveStaticDNS(), AddStaticAddress(), AddDefaultGateway()

◆ GetDestinationMTU()

uint16_t IPv6Interface::GetDestinationMTU ( const IPADDR & ip)

Get destination MTU for specified address.

Parameters
ipDestination IP address
Returns
MTU value for the destination

◆ GetFirst_IP6_Interface()

static IPv6Interface * IPv6Interface::GetFirst_IP6_Interface ( )
static

Get first IPv6 interface in the system.

Returns
Pointer to first interface or NULL if none exist
See also
GetInterfaceN(), GetNext_IP6_Interface()

◆ GetInterfaceForDestination()

static IPv6Interface * IPv6Interface::GetInterfaceForDestination ( const IPADDR6 & ip)
static

Find interface that can reach the specified destination.

Parameters
ipDestination IPv6 address
Returns
Pointer to appropriate interface or NULL if none found
See also
GetInterfaceForSource(), GetInterfaceN()

◆ GetInterfaceForSource()

static IPv6Interface * IPv6Interface::GetInterfaceForSource ( const IPADDR6 & ip)
static

Find interface that should be used as source for specified destination.

Parameters
ipDestination IPv6 address
Returns
Pointer to appropriate interface or NULL if none found
See also
GetInterfaceForDestination(), GetInterfaceN()

◆ GetInterfaceN()

static IPv6Interface * IPv6Interface::GetInterfaceN ( int n)
static

Get IPv6 interface by interface number.

Parameters
nInterface number
Returns
Pointer to interface or NULL if not found
See also
GetFirst_IP6_Interface(), GetNext_IP6_Interface()

◆ GetInterfaceNumber()

int IPv6Interface::GetInterfaceNumber ( )
inline

Get interface number.

Returns
Interface number for this interface

◆ GetMyFirstAddress()

IPADDR6 IPv6Interface::GetMyFirstAddress ( )
inline

Get first configured IPv6 address.

Returns
First IPv6 address or null address if none configured

◆ GetMyNextAddress()

IPADDR6 IPv6Interface::GetMyNextAddress ( const IPADDR6 & ip)
inline

Get next IPv6 address after specified address.

Parameters
ipCurrent IPv6 address
Returns
Next IPv6 address or null address if at end

◆ GetNext_IP6_Interface()

IPv6Interface * IPv6Interface::GetNext_IP6_Interface ( )

Get next IPv6 interface in the list.

Returns
Pointer to next interface or NULL if at end of list
See also
GetFirst_IP6_Interface(), GetInterfaceN()

◆ HadLink()

bool IPv6Interface::HadLink ( )
inline

Check if interface has had link connectivity.

Returns
true if interface has had link

◆ HasRoute()

bool IPv6Interface::HasRoute ( const IPADDR6 & ip6)

Check if there is a route to the specified IPv6 address.

Parameters
ip6Destination IPv6 address
Returns
true if route exists
See also
IsMyAddress(), OnLink()

◆ IsMyAddress()

bool IPv6Interface::IsMyAddress ( const IPADDR6 & ip6,
bool bMustBePrefered )

Check if IPv6 address belongs to this interface.

Parameters
ip6IPv6 address to check
bMustBePreferedtrue if address must be in preferred state
Returns
true if address belongs to this interface
See also
OnLink(), HasRoute()

◆ MyDNSAddress()

IPADDR6 IPv6Interface::MyDNSAddress ( )

Get DNS server address for this interface.

Returns
IPv6 address of DNS server

◆ MySourceAddress()

IPADDR6 IPv6Interface::MySourceAddress ( const IPADDR6 & ip)

Determine best source address for communicating with destination.

Parameters
ipDestination IPv6 address
Returns
Best source address for this interface

◆ NotifyReachable()

void IPv6Interface::NotifyReachable ( const IPADDR6 & ip6)

Notify that neighbor is reachable.

Parameters
ip6IPv6 address of reachable neighbor

◆ NotifyUnreachable()

void IPv6Interface::NotifyUnreachable ( const IPADDR6 & ip)

Notify that neighbor is unreachable.

Parameters
ipIPv6 address of unreachable neighbor

◆ OnLink()

bool IPv6Interface::OnLink ( const IPADDR6 & ip6)

Check if IPv6 address is on-link for this interface.

Parameters
ip6IPv6 address to check
Returns
true if address is on-link
See also
IsMyAddress(), HasRoute()

◆ ping()

int IPv6Interface::ping ( const IPADDR6 & ip,
uint16_t id,
uint16_t seq,
uint16_t wait,
int siz )

Send IPv6 ping to specified address.

Parameters
ipDestination IPv6 address
idPing identifier
seqPing sequence number
waitMaximum wait time in ticks
sizPing packet size
Returns
Ping result status

◆ RemoveDefaultGateway()

bool IPv6Interface::RemoveDefaultGateway ( const IPADDR6 & ip)

Remove default gateway from interface.

Parameters
ipIPv6 address of gateway to remove
Returns
true if gateway was found and removed
See also
AddDefaultGateway(), RemoveStaticAddress(), RemoveStaticDNS()

◆ RemoveStaticAddress()

bool IPv6Interface::RemoveStaticAddress ( const IPADDR6 & ip)

Remove static IPv6 address from interface.

Parameters
ipIPv6 address to remove
Returns
true if address was found and removed
See also
AddStaticAddress(), RemoveDefaultGateway(), RemoveStaticDNS()

◆ RemoveStaticDNS()

bool IPv6Interface::RemoveStaticDNS ( const IPADDR6 & ip)

Remove static DNS server from interface.

Parameters
ipIPv6 address of DNS server to remove
Returns
true if DNS server was found and removed
See also
AddStaticDNS(), RemoveStaticAddress(), RemoveDefaultGateway()

◆ SendMLDRegistration()

int IPv6Interface::SendMLDRegistration ( const IPADDR & regAddr,
bool joinNotLeave = true )

Send MLD registration message.

Parameters
regAddrMulticast address to register
joinNotLeavetrue to join, false to leave
Returns
Result status

◆ SetStaticDNS()

void IPv6Interface::SetStaticDNS ( IPADDR6 dns)
inline

Set static DNS server address.

Parameters
dnsIPv6 address of DNS server

◆ ShowAllInfo()

static void IPv6Interface::ShowAllInfo ( )
static

Display IPv6 information for all interfaces.

See also
ShowInfo()

◆ ShowInfo()

void IPv6Interface::ShowInfo ( )

Display IPv6 information for this interface.

See also
ShowAllInfo()

Friends And Related Symbol Documentation

◆ InitIPv6

void InitIPv6 ( int ifnum = 0)
friend

◆ Ping6

int Ping6 ( const IPADDR6 & to,
uint16_t id,
uint16_t seq,
uint16_t maxwaitticks,
int size = 32 )
friend

Send an IPv6 "ping" packet and wait the specified timeout for a response.

Sends an ICMPv6 echo request packet to the specified IPv6 destination address and waits for an echo reply. The ping uses the primary network interface. This follows the ICMPv6 echo request/reply protocol defined in RFC 4443.

Parameters
toDestination IPv6 address to ping
idICMP identifier field (typically process ID)
seqICMP sequence number field (typically increments per ping)
maxwaitticksMaximum wait time in system time ticks
sizeSize of ping data payload in bytes (default: 32)
Returns
>=0 Number of ticks elapsed waiting for the response (successful ping) -1 Timeout occurred - no response received within maxwaitticks -2 Error other than timeout occurred
Note
IPv6 ping packets may traverse different paths than IPv4 pings to the same host.
Link-local addresses require the appropriate zone ID/interface specification.
See also
Ping6ViaInterface(), Ping4(), Ping()

The documentation for this class was generated from the following file: