NetBurner 3.5.0
PDF Version
 
InterfaceBlock Class Referenceabstract

Network interface configuration block class for interface control and configuration. More...

#include <netinterface.h>

Inherits config_obj.

Inherited by EtherLikeInterface, MultiHomeInterface, and PPPInterface.

Public Member Functions

 InterfaceBlock (const char *name, const char *desc=NULL)
 Constructor with interface name and description.
 
 InterfaceBlock (config_obj &owner, const char *name, const char *desc=NULL)
 Constructor with config_obj owner, interface name and description.
 
void RegisterInterface ()
 Register a network interface with system.
 
virtual void EnableMulticast (MACADR macAddress, BOOL addAddress)=0
 Enable Multicast on this interface.
 
virtual bool LinkActive ()=0
 Returns the link status of the network interface.
 
virtual int LinkSpeed ()=0
 Returns the link speed of the network interface.
 
virtual bool LinkDuplex ()=0
 Returns the full or half link duplex of the network interface.
 
void InterfaceLinkChange (bool link)
 Change the link status of the network interface.
 
virtual const char * GetInterfaceName ()
 Returns the interface name network interface.
 
int GetInterfaceNumber ()
 Returns the Interface Number of the network interface.
 
bool IsRootInterface ()
 Returns true if this is the first interface in the interface list.
 
- Public Member Functions inherited from config_obj
 config_obj (config_obj &owner, const char *name, const char *desc)
 Object constructor with the parent/owner leaf parameter.
 
 config_obj (const char *name, const char *desc)
 Object constructor.
 
virtual void GetTextValue (NBString &s)
 Get the object value as a text string to the specified NBString object.
 
virtual void GetTypeValue (NBString &s)
 Assigns the object type value to the specified NBString object.
 

Detailed Description

Network interface configuration block class for interface control and configuration.

Network Interfaces are configured and controlled C++ InterfaceBlock objects. The InterfaceBlock contains variables and member functions for things such as:

  • The Configuration Server interface
  • IP settings for both IPv4 and IPv6 types
  • Configuration to static or DHCP, and DHCP status (both v4 and v6)
  • Multihome
  • Routing
  • AutoIP
Note
While the recommended method for getting and setting network interface parameters is to obtain a pointer to an InterfaceBlock, there are also non-member functions of the object that can be used for situations that are best served by a single function call, such as just getting a single IP address of an interface. When using those functions pay special attention to the return value type. While IPADDR should be used because it supports both IPADDR4 and IPADDR6 types automatically, some of these helper functions may specifically return an IPADDR4 type.

Constructor & Destructor Documentation

◆ InterfaceBlock() [1/2]

InterfaceBlock::InterfaceBlock ( const char * name,
const char * desc = NULL )

Constructor with interface name and description.

Parameters
nameInterface name.
descInterface description. If not used, default is null.

◆ InterfaceBlock() [2/2]

InterfaceBlock::InterfaceBlock ( config_obj & owner,
const char * name,
const char * desc = NULL )

Constructor with config_obj owner, interface name and description.

Parameters
ownerReference to config_obj owner of the interface
nameInterface name.
descInterface description. If not used, default is null.

Member Function Documentation

◆ EnableMulticast()

virtual void InterfaceBlock::EnableMulticast ( MACADR macAddress,
BOOL addAddress )
pure virtual

Enable Multicast on this interface.

Calls registered interface multicast routine.

Parameters
macAddressMulticast MAC address.
addAddressTrue to add address/interface, false to remove it
See also
EnableMulticast(MACADR macAddress, int interface), DisableMulticast()

◆ GetInterfaceName()

virtual const char * InterfaceBlock::GetInterfaceName ( )
virtual

Returns the interface name network interface.

Returns
Pointer to a character string containing the name of the network interface
See also
InterfaceName()

◆ GetInterfaceNumber()

int InterfaceBlock::GetInterfaceNumber ( )
inline

Returns the Interface Number of the network interface.

Returns
Interface number of the InterfaceBlock.
See also
GetInterfaceNumber(InterfaceBlock *pifb)

◆ InterfaceLinkChange()

void InterfaceBlock::InterfaceLinkChange ( bool link)

Change the link status of the network interface.

Parameters
linkSet link active status to true or false

◆ IsRootInterface()

bool InterfaceBlock::IsRootInterface ( )
inline

Returns true if this is the first interface in the interface list.

Returns
True if this is the first interface in the interface list, otherwise false

◆ LinkActive()

virtual bool InterfaceBlock::LinkActive ( )
pure virtual

Returns the link status of the network interface.

Returns
True if link is active, otherwise false
See also
GetInterfaceLink(), InterfaceLinkActive()

◆ LinkDuplex()

virtual bool InterfaceBlock::LinkDuplex ( )
pure virtual

Returns the full or half link duplex of the network interface.

Returns
True if full duplex, false if half duplex
See also
InterfaceLinkDuplex()

◆ LinkSpeed()

virtual int InterfaceBlock::LinkSpeed ( )
pure virtual

Returns the link speed of the network interface.

Returns
10 or 100 representing the Mbps speed
See also
InterfaceLinkSpeed()

◆ RegisterInterface()

void InterfaceBlock::RegisterInterface ( )

Register a network interface with system.

InterfaceBlock member function to register a new network interface

See also
Removeinterface(), EnableMulticast(), DisableMulticast()

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