#include <wvinterface.h>
Collaboration diagram for WvInterface:
It is _allowed_ to have more than one WvInterface instance referring to the same physical interface, because that is more convenient.
Definition at line 24 of file wvinterface.h.
Public Member Functions | |
WvInterface (WvStringParm _name) | |
~WvInterface () | |
void | rescan () |
forget all stored information about the address(es) of this interface | |
const WvAddr & | hwaddr () |
get the hardware address of this interface | |
const WvIPNet & | ipaddr () |
get the local IP net of this interface | |
const WvIPAddr | dstaddr () |
get the point-to-point IP address of this interface | |
int | getflags () |
get the current kernel flags | |
int | setflags (int clear, int set) |
toggle kernel flags on this netdevice. | |
bool | isup () |
set the interface state up or down. | |
void | up (bool enable) |
bool | ispromisc () |
turn promiscuous (see-all-packets) mode on or off. | |
void | promisc (bool enable) |
int | setipaddr (const WvIPNet &addr) |
Sets the local address, netmask, and broadcast of this interface and set a route to the local net. | |
int | setmtu (int mtu) |
Sets the MTU of the interface. | |
int | sethwaddr (const WvAddr &addr) |
Set the hardware address of this interface. | |
int | addroute (const WvIPNet &dest, int metric=0, WvStringParm table="default") |
add a route to the given network through this interface. | |
int | addroute (const WvIPNet &dest, const WvIPAddr &gw, const WvIPAddr &src, int metric=0, WvStringParm table="default") |
int | delroute (const WvIPNet &dest, int metric=0, WvStringParm table="default") |
delete a route to the given network through this interface. | |
int | delroute (const WvIPNet &dest, const WvIPAddr &gw, int metric=0, WvStringParm table="default") |
bool | isarp () |
add an ARP entry on this interface | |
int | addarp (const WvIPNet &proto, const WvAddr &hw, bool proxy) |
int | req (int ioctl_num, struct ifreq *ifr) |
get/set information about an interface | |
int | req (int ioctl_num, struct iwreq *ifr) |
get/set information about a wireless interface | |
Public Attributes | |
WvString | name |
bool | valid |
|
Definition at line 31 of file wvinterface.cc. References valid, and WvStringParm. |
|
Definition at line 39 of file wvinterface.cc. References rescan(). |
|
Definition at line 516 of file wvinterface.cc. References ATF_COM, ATF_NETMASK, ATF_PERM, ATF_PUBL, WvIPNet::is_host(), min, name, WvIPNet::netmask(), WvIPNet::network(), WvLog::perror(), WvAddr::sockaddr(), WvIPAddr::sockaddr(), WvAddr::sockaddr_len(), and WvIPAddr::sockaddr_len(). |
|
Definition at line 422 of file wvinterface.cc. References delroute(), and WvStringParm. |
|
add a route to the given network through this interface.
Definition at line 449 of file wvinterface.cc. References WvStringParm. |
|
Definition at line 456 of file wvinterface.cc. References WvSubProc::estatus, WvIPNet::is_default(), name, WvLog::perror(), WvSubProc::startv(), WvSubProc::wait(), and WvStringParm. |
|
delete a route to the given network through this interface.
Definition at line 509 of file wvinterface.cc. References WvStringParm. Referenced by addroute(). |
|
get the point-to-point IP address of this interface
Definition at line 130 of file wvinterface.cc. References getflags(), and req(). |
|
get the current kernel flags
Definition at line 141 of file wvinterface.cc. Referenced by dstaddr(), isarp(), ispromisc(), and isup(). |
|
get the hardware address of this interface
Definition at line 95 of file wvinterface.cc. References WvAddr::gen(), and req(). Referenced by WvInterfaceDict::islocal(), and WvInterfaceDict::update(). |
|
get the local IP net of this interface
Definition at line 111 of file wvinterface.cc. References req(). Referenced by WvInterfaceDict::islocal(), WvInterfaceDict::on_local_net(), and setipaddr(). |
|
add an ARP entry on this interface
Definition at line 558 of file wvinterface.cc. References getflags(). |
|
turn promiscuous (see-all-packets) mode on or off.
Definition at line 189 of file wvinterface.cc. References getflags(). |
|
set the interface state up or down.
Definition at line 177 of file wvinterface.cc. References getflags(), and valid. Referenced by WvInterfaceDict::on_local_net(), and sethwaddr(). |
|
Definition at line 183 of file wvinterface.cc. References setflags(). |
|
get/set information about a wireless interface
Definition at line 61 of file wvinterface.cc. References name. |
|
get/set information about an interface
Definition at line 45 of file wvinterface.cc. References name. Referenced by dstaddr(), getflags(), hwaddr(), ipaddr(), setflags(), sethwaddr(), and setmtu(). |
|
forget all stored information about the address(es) of this interface
Definition at line 78 of file wvinterface.cc. Referenced by sethwaddr(), setipaddr(), up(), WvInterfaceDict::update(), and ~WvInterface(). |
|
toggle kernel flags on this netdevice. Be careful! Definition at line 151 of file wvinterface.cc. References name, WvLog::perror(), and req(). |
|
Set the hardware address of this interface. Returns 0 on success, else an error code. Definition at line 274 of file wvinterface.cc. References isup(), name, WvLog::perror(), req(), rescan(), WvAddr::sockaddr(), WvAddr::sockaddr_len(), and up(). |
|
Sets the local address, netmask, and broadcast of this interface and set a route to the local net. Returns 0 on success, else an error code. Definition at line 195 of file wvinterface.cc. References WvIPNet::base(), WvIPNet::bits(), WvIPNet::broadcast(), ipaddr(), min, name, WvIPNet::netmask(), WvLog::perror(), rescan(), WvIPAddr::sockaddr(), and WvIPAddr::sockaddr_len(). |
|
Sets the MTU of the interface. Returns 0 on success, else an error code. Definition at line 263 of file wvinterface.cc. References name, WvLog::perror(), and req(). |
|
Definition at line 170 of file wvinterface.cc. References rescan(), and setflags(). Referenced by sethwaddr(). |
|
Definition at line 41 of file wvinterface.h. Referenced by addarp(), delroute(), req(), setflags(), sethwaddr(), setipaddr(), and setmtu(). |
|
Definition at line 42 of file wvinterface.h. Referenced by getflags(), WvInterfaceDict::islocal(), isup(), WvInterfaceDict::on_local_net(), WvInterfaceDict::update(), and WvInterface(). |