8 #ifndef __WVINTERFACE_H
9 #define __WVINTERFACE_H
12 #include "wvhashtable.h"
33 void fill_rte(
struct rtentry *rte,
char ifname[17],
39 WvStringParm table,
bool shutup);
71 void promisc(
bool enable);
100 WvStringParm table =
"default");
102 const WvIPAddr &src,
int metric = 0,
103 WvStringParm table =
"default");
107 WvStringParm table =
"default");
109 WvStringParm table =
"default");
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
bool ispromisc()
turn promiscuous (see-all-packets) mode on or off.
bool isup()
set the interface state up or down.
int req(int ioctl_num, struct ifreq *ifr)
get/set information about an interface
An IP network comprises two WvIPAddr structures: an address and a netmask.
const WvAddr & hwaddr()
get the hardware address of this interface
int ptp(bool enable, const WvIPNet &addr)
turn point-to-point mode on or off.
WvString is an implementation of a simple and efficient printable-string class.
int getflags()
get the current kernel flags
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
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.
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 addroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
add a route to the given network through this interface.
Base class for different address types, each of which will have the ability to convert itself to/from...
A WvInterface manages a particular network interface.
int sethwaddr(const WvAddr &addr)
Set the hardware address of this interface.
An IP address is made up of a "dotted quad" – four decimal numbers in the form www....
int delroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
delete a route to the given network through 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.
bool isarp()
add an ARP entry on this interface