WvStreams
wviproute.h
1 /* -*- Mode: C++ -*-
2  * Worldvisions Weaver Software:
3  * Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4  *
5  * The WvIPRoute and WvIPRouteList classes, which can manipulate the kernel
6  * routing table in useful ways.
7  */
8 #ifndef __WVIPROUTE_H
9 #define __WVIPROUTE_H
10 
11 #include "wvaddr.h"
12 #include "wvlinklist.h"
13 #include "wvlog.h"
14 
16 class WvIPRoute
17 {
18 public:
19  WvIPRoute(WvStringParm _ifc, const WvIPNet &_net, const WvIPAddr &_gate,
20  int _metric, WvStringParm _table);
21  operator WvString() const;
22  bool operator== (const WvIPRoute &r2) const;
23 
24  WvString ifc;
25  WvIPNet ip;
26  WvIPAddr gateway;
27  int metric;
28  WvString table; // "advanced ip routing" table name
29  WvIPAddr src;
30 };
31 
32 
33 DeclareWvList2(WvIPRouteListBase, WvIPRoute);
34 
36 class WvIPRouteList : public WvIPRouteListBase
37 {
38 public:
39  WvLog log;
40 
41  WvIPRouteList();
42 
44  void get_kernel();
45 
47  void set_kernel();
48 
50  WvIPRoute *find(const WvIPAddr &addr);
51 };
52 
53 
54 #endif // __WVIPROUTE_H
WvIPNet
An IP network comprises two WvIPAddr structures: an address and a netmask.
Definition: wvaddr.h:312
WvIPRouteList
List of IP Routes currently in effect.
Definition: wviproute.h:36
WvIPRouteList::get_kernel
void get_kernel()
automatically fill the list with appropriate data from the kernel
Definition: wviproute.cc:60
WvIPRoute
Manipulate the kernel routing table in strange and interesting ways ;)
Definition: wviproute.h:16
WvString
WvString is an implementation of a simple and efficient printable-string class.
Definition: wvstring.h:329
WvIPRouteList::set_kernel
void set_kernel()
automatically set the kernel to the values in the RouteList
Definition: wviproute.cc:202
WvLog
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's.
Definition: wvlog.h:56
WvIPAddr
An IP address is made up of a "dotted quad" – four decimal numbers in the form www....
Definition: wvaddr.h:249
WvIPRouteList::find
WvIPRoute * find(const WvIPAddr &addr)
find the routing entry that matches 'addr'
Definition: wviproute.cc:253