senf::emu::EthernetController Class Reference

Control ethernet interfaces. More...

#include <senf/Ext/NetEmu/Ethernet/EthernetController.hh>

Inheritance diagram for senf::emu::EthernetController:

Public Types

enum  Duplex_mode { HALF_DUPLEX, FULL_DUPLEX, UNKNOWN_DUPLEX }
 

Public Member Functions

 EthernetController (std::string const &interface_name)
 
 EthernetController (int interface_index)
 
unsigned speed () const
 
Duplex_mode duplex () const
 
std::string duplexAsString () const
 
bool hasLink () const
 
bool nWayReset ()
 
bool ringSize (std::uint32_t rx, std::uint32_t tx)
 
std::pair< std::uint32_t, std::uint32_t > ringSize ()
 
bool setEEE (bool on)
 
bool getEEE ()
 
- Public Member Functions inherited from senf::NetdeviceController
 NetdeviceController (std::string const &interface_name)
 
 NetdeviceController (int interface_index)
 
void reset (std::string const &interface_name)
 
int interfaceIndex () const
 
MACAddress hardwareAddress () const
 
void hardwareAddress (MACAddress const &newAddress)
 
std::string interfaceName () const
 
void interfaceName (std::string const &newName)
 
int mtu () const
 
void mtu (int new_mtu)
 
int txqueuelen () const
 
void txqueuelen (int new_mtu)
 
bool promisc () const
 
void promisc (bool mode)
 
void addVLAN (std::uint16_t vlanId)
 
void delVLAN (std::uint16_t vlanId)
 
void timestamping (int txType, int rxFilter)
 
bool isUp () const
 
void up ()
 
void down ()
 

Static Public Member Functions

static std::string duplexAsString (Duplex_mode mode)
 
- Static Public Member Functions inherited from senf::NetdeviceController
static SockFd::ptr sockfd ()
 
static std::string macToName (MACAddress const &mac)
 
static MACAddress readMACAddressFromFile (boost::filesystem::path const &path)
 

Additional Inherited Members

- Protected Member Functions inherited from senf::NetdeviceController
void ifrName (ifreq &ifr) const
 
- Protected Attributes inherited from senf::NetdeviceController
SockFd::ptr sockfd_
 
int ifindex_
 

Detailed Description

Control ethernet interfaces.

Definition at line 31 of file EthernetController.hh.

Member Enumeration Documentation

◆ Duplex_mode

Enumerator
HALF_DUPLEX 
FULL_DUPLEX 
UNKNOWN_DUPLEX 

Definition at line 35 of file EthernetController.hh.

Constructor & Destructor Documentation

◆ EthernetController() [1/2]

senf::emu::EthernetController::EthernetController ( std::string const &  interface_name)
explicit

Definition at line 36 of file EthernetController.cc.

◆ EthernetController() [2/2]

senf::emu::EthernetController::EthernetController ( int  interface_index)
explicit

Definition at line 40 of file EthernetController.cc.

Member Function Documentation

◆ duplex()

senf::emu::EthernetController::Duplex_mode senf::emu::EthernetController::duplex ( ) const

Definition at line 56 of file EthernetController.cc.

◆ duplexAsString() [1/2]

std::string senf::emu::EthernetController::duplexAsString ( ) const

Definition at line 78 of file EthernetController.cc.

◆ duplexAsString() [2/2]

std::string senf::emu::EthernetController::duplexAsString ( Duplex_mode  mode)
static

Definition at line 84 of file EthernetController.cc.

◆ getEEE()

bool senf::emu::EthernetController::getEEE ( )

Definition at line 153 of file EthernetController.cc.

◆ hasLink()

bool senf::emu::EthernetController::hasLink ( ) const

Definition at line 91 of file EthernetController.cc.

◆ nWayReset()

bool senf::emu::EthernetController::nWayReset ( )

Definition at line 103 of file EthernetController.cc.

◆ ringSize() [1/2]

bool senf::emu::EthernetController::ringSize ( std::uint32_t  rx,
std::uint32_t  tx 
)

Definition at line 114 of file EthernetController.cc.

◆ ringSize() [2/2]

std::pair< std::uint32_t, std::uint32_t > senf::emu::EthernetController::ringSize ( )

Definition at line 128 of file EthernetController.cc.

◆ setEEE()

bool senf::emu::EthernetController::setEEE ( bool  on)

Definition at line 140 of file EthernetController.cc.

◆ speed()

unsigned senf::emu::EthernetController::speed ( ) const

Definition at line 44 of file EthernetController.cc.


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