8 #ifndef __WVINTERFACE_H
9 #define __WVINTERFACE_H
12 #include "wvhashtable.h"
33 void fill_rte(
struct rtentry *rte,
char ifname[17],
71 void promisc(
bool enable);
102 const WvIPAddr &src,
int metric = 0,
113 int addarp(
const WvIPNet &proto,
const WvAddr &hw,
bool proxy);
116 int req(
int ioctl_num,
struct ifreq *ifr);
119 int req(
int ioctl_num,
struct iwreq *ifr);
128 static WvInterfaceDictBase slist;
131 class Iter :
public WvInterfaceDictBase::Iter
135 : WvInterfaceDictBase::Iter(l.slist)
139 class Sorter :
public WvInterfaceDictBase::Sorter
143 WvInterfaceDictBase::Sorter::RealCompareFunc *f)
144 : WvInterfaceDictBase::Sorter(l.slist, f)
153 bool on_local_net(
const WvIPNet &addr);
156 {
return slist[str]; }
162 #endif // __WVINTERFACE_H
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
const WvAddr & hwaddr()
get the hardware address of this interface
int req(int ioctl_num, struct ifreq *ifr)
get/set information about an interface
int ptp(bool enable, const WvIPNet &addr)
turn point-to-point mode on or off.
int getflags()
get the current kernel flags
An IP address is made up of a "dotted quad" – four decimal numbers in the form www.xxx.yyy.zzz.
const WvIPNet & ipaddr()
get the local IP net of this interface
int setflags(int clear, int set)
toggle kernel flags on this netdevice.
void rescan()
forget all stored information about the address(es) of this interface
int setmtu(int mtu)
Sets the MTU of the interface.
int addroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
add a route to the given network through this interface.
int sethwaddr(const WvAddr &addr)
Set the hardware address of this interface.
const WvIPAddr dstaddr()
get the point-to-point IP address of this interface
A WvInterface manages a particular network interface.
Base class for different address types, each of which will have the ability to convert itself to/from...
int delroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
delete a route to the given network through this interface.
WvString is an implementation of a simple and efficient printable-string class.
bool isarp()
add an ARP entry on this interface
int setipaddr(const WvIPNet &addr)
Sets the local address, netmask, and broadcast of this interface and set a route to the local net...
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's...
An IP network comprises two WvIPAddr structures: an address and a netmask.
bool ispromisc()
turn promiscuous (see-all-packets) mode on or off.
bool isup()
set the interface state up or down.