#include <wvinterface.h>
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 | ptp (bool enable, const WvIPNet &addr) |
turn point-to-point mode on or off. | |
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 |
|
toggle kernel flags on this netdevice. Be careful! Definition at line 157 of file wvinterface.cc. References name, WvLog::perror(), and req(). |
|
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 218 of file wvinterface.cc. References WvIPNet::base(), WvIPNet::bits(), WvIPNet::broadcast(), ipaddr(), name, WvIPNet::netmask(), WvLog::perror(), WvIPAddr::sockaddr(), and WvIPAddr::sockaddr_len(). |
|
Sets the MTU of the interface. Returns 0 on success, else an error code. Definition at line 286 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 297 of file wvinterface.cc. References isup(), name, WvLog::perror(), req(), rescan(), WvAddr::sockaddr(), WvAddr::sockaddr_len(), and up(). |