NetBurner 3.5.7
PDF Version
NcmInterfaceBlock Class Reference

Network interface block for NCM USB device. More...

#include <ncm_interface.h>

Inherits EtherLikeInterface, and EtherLikeInterface.

Public Member Functions

 NcmInterfaceBlock (const char *name, dCDC_NCM *pDevice)
 Constructor.
 
void LinkToDevice ()
 Register interface and link to NCM device Called after RegisterInterface() to update the device with interface number.
 
virtual void send_func (PoolPtr poolPtr) override
 Send function - called by network stack to transmit.
 
virtual void EnableMulticast (MACADR macAddress, BOOL addAddress) override
 Enable or disable multicast address reception.
 
virtual bool LinkActive () override
 Returns current link status.
 
virtual int LinkSpeed () override
 Returns link speed in Mbps.
 
void SetLinkSpeed (int speed)
 Set the link speed.
 
virtual bool LinkDuplex () override
 Returns duplex mode.
 
void SetMACAddress (const MACADR &mac)
 Set the MAC address for this interface.
 
virtual bool bNeedsArp () override
 Check if this interface needs ARP.
 
dCDC_NCMGetNcmDevice ()
 Get the associated NCM device.
 
 NcmInterfaceBlock (const char *name, dCDC_NCM *pDevice)
 Constructor.
 
void LinkToDevice ()
 Register interface and link to NCM device Called after RegisterInterface() to update the device with interface number.
 
virtual void send_func (PoolPtr poolPtr) override
 Send function - called by network stack to transmit.
 
virtual void EnableMulticast (MACADR macAddress, BOOL addAddress) override
 Enable or disable multicast address reception.
 
virtual bool LinkActive () override
 Returns current link status.
 
virtual int LinkSpeed () override
 Returns link speed in Mbps.
 
void SetLinkSpeed (int speed)
 Set the link speed.
 
virtual bool LinkDuplex () override
 Returns duplex mode.
 
void SetMACAddress (const MACADR &mac)
 Set the MAC address for this interface.
 
virtual bool bNeedsArp () override
 Check if this interface needs ARP.
 
dCDC_NCMGetNcmDevice ()
 Get the associated NCM device.
 

Detailed Description

Network interface block for NCM USB device.

This class extends EtherLikeInterface to provide network stack integration for the USB NCM device. It handles frame transmission via USB and provides link status to the network stack.

Constructor & Destructor Documentation

◆ NcmInterfaceBlock() [1/2]

NcmInterfaceBlock::NcmInterfaceBlock ( const char * name,
dCDC_NCM * pDevice )

Constructor.

Parameters
nameInterface name (e.g., "NCM0")
pDevicePointer to the associated NCM device

◆ NcmInterfaceBlock() [2/2]

NcmInterfaceBlock::NcmInterfaceBlock ( const char * name,
dCDC_NCM * pDevice )

Constructor.

Parameters
nameInterface name (e.g., "NCM0")
pDevicePointer to the associated NCM device

Member Function Documentation

◆ bNeedsArp() [1/2]

bool NcmInterfaceBlock::bNeedsArp ( )
overridevirtual

Check if this interface needs ARP.

Returns
True (NCM is Ethernet-like and uses ARP)

Reimplemented from InterfaceBlock.

◆ bNeedsArp() [2/2]

virtual bool NcmInterfaceBlock::bNeedsArp ( )
overridevirtual

Check if this interface needs ARP.

Returns
True (NCM is Ethernet-like and uses ARP)

Reimplemented from InterfaceBlock.

◆ EnableMulticast() [1/2]

void NcmInterfaceBlock::EnableMulticast ( MACADR macAddress,
BOOL addAddress )
overridevirtual

Enable or disable multicast address reception.

Parameters
macAddressThe multicast MAC address
addAddressTrue to add, false to remove

Implements InterfaceBlock.

◆ EnableMulticast() [2/2]

virtual void NcmInterfaceBlock::EnableMulticast ( MACADR macAddress,
BOOL addAddress )
overridevirtual

Enable or disable multicast address reception.

Parameters
macAddressThe multicast MAC address
addAddressTrue to add, false to remove

Implements InterfaceBlock.

◆ GetNcmDevice() [1/2]

dCDC_NCM * NcmInterfaceBlock::GetNcmDevice ( )
inline

Get the associated NCM device.

Returns
Pointer to the NCM device

◆ GetNcmDevice() [2/2]

dCDC_NCM * NcmInterfaceBlock::GetNcmDevice ( )
inline

Get the associated NCM device.

Returns
Pointer to the NCM device

◆ LinkActive() [1/2]

bool NcmInterfaceBlock::LinkActive ( )
overridevirtual

Returns current link status.

Returns
True if USB is connected and NCM is in CONNECTED state

Implements InterfaceBlock.

◆ LinkActive() [2/2]

virtual bool NcmInterfaceBlock::LinkActive ( )
overridevirtual

Returns current link status.

Returns
True if USB is connected and NCM is in CONNECTED state

Implements InterfaceBlock.

◆ LinkDuplex() [1/2]

bool NcmInterfaceBlock::LinkDuplex ( )
overridevirtual

Returns duplex mode.

Returns
Always true (full duplex) for USB

Implements InterfaceBlock.

◆ LinkDuplex() [2/2]

virtual bool NcmInterfaceBlock::LinkDuplex ( )
overridevirtual

Returns duplex mode.

Returns
Always true (full duplex) for USB

Implements InterfaceBlock.

◆ LinkSpeed() [1/2]

int NcmInterfaceBlock::LinkSpeed ( )
overridevirtual

Returns link speed in Mbps.

Returns
Link speed (typically 100 for USB 2.0 High Speed)

Implements InterfaceBlock.

◆ LinkSpeed() [2/2]

virtual int NcmInterfaceBlock::LinkSpeed ( )
overridevirtual

Returns link speed in Mbps.

Returns
Link speed (typically 100 for USB 2.0 High Speed)

Implements InterfaceBlock.

◆ send_func() [1/2]

void NcmInterfaceBlock::send_func ( PoolPtr poolPtr)
overridevirtual

Send function - called by network stack to transmit.

Parameters
poolPtrPointer to the buffer containing the Ethernet frame

Implements InterfaceBlock.

◆ send_func() [2/2]

virtual void NcmInterfaceBlock::send_func ( PoolPtr poolPtr)
overridevirtual

Send function - called by network stack to transmit.

Parameters
poolPtrPointer to the buffer containing the Ethernet frame

Implements InterfaceBlock.

◆ SetLinkSpeed() [1/2]

void NcmInterfaceBlock::SetLinkSpeed ( int speed)

Set the link speed.

Parameters
speedSpeed in Mbps

◆ SetLinkSpeed() [2/2]

void NcmInterfaceBlock::SetLinkSpeed ( int speed)

Set the link speed.

Parameters
speedSpeed in Mbps

◆ SetMACAddress() [1/2]

void NcmInterfaceBlock::SetMACAddress ( const MACADR & mac)

Set the MAC address for this interface.

Parameters
macThe MAC address to use

◆ SetMACAddress() [2/2]

void NcmInterfaceBlock::SetMACAddress ( const MACADR & mac)

Set the MAC address for this interface.

Parameters
macThe MAC address to use

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