#include <senf/Socket/NetdeviceController.hh>
This controller provides an interface which can be used to configure network devices. Note, that some setting members are privileged operations.
Definition at line 51 of file NetdeviceController.hh.
Classes |
|
struct | SockFd |
Public Member Functions |
|
NetdeviceController (std::string const &interface_name) | |
Construct a new controller for the given interface name. |
|
NetdeviceController (int interface_index) | |
Construct a new controller for the given interface index. |
|
int | interfaceIndex () const |
return the interface index |
|
MACAddress | hardwareAddress () const |
return hardware address |
|
void | hardwareAddress (MACAddress const &newAddress) |
set hardware address |
|
std::string | interfaceName () const |
return interface name |
|
void | interfaceName (std::string const &newName) |
set interface name |
|
int | mtu () const |
return the Maximum Transmission Unit |
|
void | mtu (int new_mtu) |
set the Maximum Transmission Unit |
|
int | txqueuelen () const |
return the Tx Queue Length |
|
void | txqueuelen (int new_mtu) |
set the Tx Queue Length |
|
bool | promisc () const |
return true if interface is in promiscuous mode |
|
void | promisc (bool mode) |
enable/disable promiscuous mode of the interface |
|
bool | isUp () const |
return true if interface is up |
|
void | up () |
ifconfig up interface |
|
void | down () |
ifconfig down interface |
|
Static Public Member Functions |
|
static SockFd::ptr | sockfd () |
senf::NetdeviceController:: | ||||
NetdeviceController | ( | std::string const & | interface_name | ) |
Construct a new controller for the given interface name.
Definition at line 46 of file NetdeviceController.cc.
senf::NetdeviceController:: | ||||
NetdeviceController | ( | int | interface_index | ) |
Construct a new controller for the given interface index.
Definition at line 56 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
down | () | |||
ifconfig down interface
Definition at line 172 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
hardwareAddress | ( | MACAddress const & | newAddress | ) |
set hardware address
Changes the hardware address of the interface. Note, that setting the hardware address is a privileged operation. It is only allowed when the interface is not up. If the interface is up, this call will cause an SystemException to be thrown.
Definition at line 90 of file NetdeviceController.cc.
senf::MACAddress senf::NetdeviceController:: | ||||
hardwareAddress | () | |||
return hardware address
Definition at line 81 of file NetdeviceController.cc.
int senf::NetdeviceController:: | ||||
interfaceIndex | () | |||
return the interface index
Definition at line 181 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
interfaceName | ( | std::string const & | newName | ) |
set interface name
Changes the name of the interface. Note, that setting the name is a privileged operation. It is only allowed when the interface is not up. If the interface is up, this call will cause an SystemException to be thrown.
Definition at line 70 of file NetdeviceController.cc.
std::string senf::NetdeviceController:: | ||||
interfaceName | () | |||
return interface name
Definition at line 62 of file NetdeviceController.cc.
bool senf::NetdeviceController:: | ||||
isUp | () | |||
return true
if interface is up
Definition at line 154 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
mtu | ( | int | new_mtu | ) |
set the Maximum Transmission Unit
Set the MTU (Maximum Transfer Unit) of the device. Note, that this is a privileged operation. Setting the MTU to too small values may cause kernel crashes.
Definition at line 107 of file NetdeviceController.cc.
int senf::NetdeviceController:: | ||||
mtu | () | |||
return the Maximum Transmission Unit
Definition at line 98 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
promisc | ( | bool | mode | ) |
enable/disable promiscuous mode of the interface
Note, that this is a privileged operation.
Definition at line 142 of file NetdeviceController.cc.
bool senf::NetdeviceController:: | ||||
promisc | () | |||
return true
if interface is in promiscuous mode
Definition at line 133 of file NetdeviceController.cc.
senf::NetdeviceController::SockFd::ptr senf::NetdeviceController:: | ||||
sockfd | () | |||
Definition at line 214 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
txqueuelen | ( | int | new_mtu | ) |
set the Tx Queue Length
Set the Tx Queue Length (in Packets) MTU of the device. Note, that this is a privileged operation.
Definition at line 124 of file NetdeviceController.cc.
int senf::NetdeviceController:: | ||||
txqueuelen | () | |||
return the Tx Queue Length
Definition at line 115 of file NetdeviceController.cc.
void senf::NetdeviceController:: | ||||
up | () | |||
ifconfig up interface
Definition at line 163 of file NetdeviceController.cc.