NetBurner 3.5.0
PDF Version
 
Network Interfaces

Network Interface Functions. More...

Topics

 IPADDR4 Functions
 Network Interface functions with IPADDR4 return types.
 
 Low Level Processing (NetDoRx)
 Callback functions to add custom Ethenet handlers and pass Ethernet frames in the bottom of the TCP/IP stack.
 

Classes

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

Functions

int Removeinterface (int interface)
 Remove a network interface from the system.
 
void EnableMulticast (MACADR macAddress, int interface=0)
 Enable Multicast on an existing interface.
 
void DisableMulticast (MACADR macAddress, int interface=0)
 Disable Multicast on an existing interface.
 
InterfaceBlockGetInterfaceBlock (int interface=0)
 Get an InterfaceBlock control and configuration object.
 
int32_t GetFirstInterface (void)
 Returns the Interface Number of the first registered network interface.
 
int32_t GetNextInterface (int lastInterface)
 Returns the Interface Number of the next registered network interface.
 
int32_t GetInterfaceNumber (InterfaceBlock *pifb)
 Returns the Interface Number of the specified network interface InterfaceBlock.
 
int32_t GetInterfaceForMyAddress4 (IPADDR4 ip)
 Returns the Interface Number of the specified network interface IPv4 address.
 
bool GetInterfaceLink (int ifn)
 Returns the network interface link status.
 
MACADR InterfaceMAC (int interface)
 Returns the MAC address of the specified network interface.
 
bool InterfaceLinkActive (int interface)
 Returns the link status of the specified network interface.
 
int InterfaceLinkSpeed (int interface)
 Returns the 10/100 link speed of the specified network interface.
 
bool InterfaceLinkDuplex (int interface)
 Returns the full or half link duplex of the specified network interface.
 
const char * InterfaceName (int interface)
 Returns the interface name of the specified network interface.
 

Detailed Description

Network Interface Functions.

Callback functions to add custom Ethenet handlers and pass Ethernet.

#include< netinterface.h >

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

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.

#include< netrx.h >

Function Documentation

◆ DisableMulticast()

void DisableMulticast ( MACADR macAddress,
int interface = 0 )

#include <netinterface.h>

Disable Multicast on an existing interface.

Calls registered interface multicast routine.

Parameters
macAddressMulticast MAC address.
interfaceInterface number. If not specified or 0, operates on the first registerd interface.
See also
EnableMulticast(MACADR macAddress, int interface), InterfaceBlock::EnableMulticast()

◆ EnableMulticast()

void EnableMulticast ( MACADR macAddress,
int interface = 0 )

#include <netinterface.h>

Enable Multicast on an existing interface.

Calls registered interface multicast routine.

Parameters
macAddressMulticast MAC address.
interfaceInterface number. If not specified, default is is 0.
See also
DisableMulticast(), InterfaceBlock::EnableMulticast()

◆ GetFirstInterface()

int32_t GetFirstInterface ( void )

#include <netinterface.h>

Returns the Interface Number of the first registered network interface.

If called on a device with wired Ethernet, this will be the first Ethernet interface typlical interface number 1.

Returns
Interface number of the first network interface, or 0 if none exist.

◆ GetInterfaceBlock()

InterfaceBlock * GetInterfaceBlock ( int interface = 0)

#include <netinterface.h>

Get an InterfaceBlock control and configuration object.

Parameters
interfaceInterface number. If not specified or 0, operates on the first registerd interface.
Returns
Pointer to an InterfaceBlock on success, Null if requested interface is invalid.

◆ GetInterfaceForMyAddress4()

int32_t GetInterfaceForMyAddress4 ( IPADDR4 ip)

#include <netinterface.h>

Returns the Interface Number of the specified network interface IPv4 address.

Parameters
ipIPv4 network interface address.
Returns
Interface number of the specified IPv4 address

◆ GetInterfaceLink()

bool GetInterfaceLink ( int ifn)

#include <netinterface.h>

Returns the network interface link status.

Parameters
ifnNetwork interface number
Returns
True if link, otherwise false
See also
InterfaceBlock::LinkActive(), InterfaceLinkActive()

◆ GetInterfaceNumber()

int32_t GetInterfaceNumber ( InterfaceBlock * pifb)

#include <netinterface.h>

Returns the Interface Number of the specified network interface InterfaceBlock.

Parameters
pifbPointer to the InterfaceBlock
Returns
Interface number of the InterfaceBlock.
See also
InterfaceBlock::GetInterfaceNumber()

◆ GetNextInterface()

int32_t GetNextInterface ( int lastInterface)

#include <netinterface.h>

Returns the Interface Number of the next registered network interface.

Parameters
lastInterfaceSpecifies the interface number starting point to begin search.
Returns
Interface number of the next network interface, or 0 if none exist.

◆ InterfaceLinkActive()

bool InterfaceLinkActive ( int interface)

#include <netinterface.h>

Returns the link status of the specified network interface.

Parameters
interfaceInterface number
Returns
True if link is active, otherwise false
See also
InterfaceBlock::LinkActive(), GetInterfaceLink()

◆ InterfaceLinkDuplex()

bool InterfaceLinkDuplex ( int interface)

#include <netinterface.h>

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

Parameters
interfaceInterface number
Returns
True if full duplex, false if half duplex
See also
InterfaceBlock::LinkDuplex()

◆ InterfaceLinkSpeed()

int InterfaceLinkSpeed ( int interface)

#include <netinterface.h>

Returns the 10/100 link speed of the specified network interface.

Parameters
interfaceInterface number
Returns
10 or 100 representing the Mbps speed
See also
InterfaceBlock::LinkSpeed()

◆ InterfaceMAC()

MACADR InterfaceMAC ( int interface)

#include <netinterface.h>

Returns the MAC address of the specified network interface.

Parameters
interfaceInterface number
Returns
MAC address of type MACADR

◆ InterfaceName()

const char * InterfaceName ( int interface)

#include <netinterface.h>

Returns the interface name of the specified network interface.

Parameters
interfaceInterface number
Returns
Pointer to a character string containing the name of the network interface
See also
InterfaceBlock::GetInterfaceName()

◆ Removeinterface()

int Removeinterface ( int interface)

#include <netinterface.h>

Remove a network interface from the system.

Parameters
interfaceInterface number
Returns
1 if successful, 0 if invalid interface number
See also
InterfaceBlock::RegisterInterface()