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]; }
Base class for different address types, each of which will have the ability to convert itself to/from...
A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
An IP address is made up of a "dotted quad" – four decimal numbers in the form www....
An IP network comprises two WvIPAddr structures: an address and a netmask.
A WvInterface manages a particular network interface.
int setflags(int clear, int set)
toggle kernel flags on this netdevice.
int setipaddr(const WvIPNet &addr)
Sets the local address, netmask, and broadcast of this interface and set a route to the local net.
const WvIPAddr dstaddr()
get the point-to-point IP address of this interface
bool isarp()
add an ARP entry on this interface
const WvIPNet & ipaddr()
get the local IP net of this interface
int delroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
delete a route to the given network through this interface.
int ptp(bool enable, const WvIPNet &addr)
turn point-to-point mode on or off.
int req(int ioctl_num, struct ifreq *ifr)
get/set information about an interface
bool isup()
set the interface state up or down.
const WvAddr & hwaddr()
get the hardware address of this interface
int getflags()
get the current kernel flags
void rescan()
forget all stored information about the address(es) of this interface
int setmtu(int mtu)
Sets the MTU of the interface.
int sethwaddr(const WvAddr &addr)
Set the hardware address of this interface.
bool ispromisc()
turn promiscuous (see-all-packets) mode on or off.
int addroute(const WvIPNet &dest, int metric=0, WvStringParm table="default")
add a route to the given network through this interface.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
WvString is an implementation of a simple and efficient printable-string class.