WvStreams
wviproute.h
00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * The WvIPRoute and WvIPRouteList classes, which can manipulate the kernel
00006  * routing table in useful ways.
00007  */
00008 #ifndef __WVIPROUTE_H
00009 #define __WVIPROUTE_H
00010 
00011 #include "wvaddr.h"
00012 #include "wvlinklist.h"
00013 #include "wvlog.h"
00014 
00016 class WvIPRoute
00017 {
00018 public:
00019     WvIPRoute(WvStringParm _ifc, const WvIPNet &_net, const WvIPAddr &_gate,
00020               int _metric, WvStringParm _table);
00021     operator WvString() const;
00022     bool operator== (const WvIPRoute &r2) const;
00023     
00024     WvString ifc;
00025     WvIPNet ip;
00026     WvIPAddr gateway;
00027     int metric;
00028     WvString table; // "advanced ip routing" table name
00029     WvIPAddr src;
00030 };
00031 
00032 
00033 DeclareWvList2(WvIPRouteListBase, WvIPRoute);
00034 
00036 class WvIPRouteList : public WvIPRouteListBase
00037 {
00038 public:
00039     WvLog log;
00040     
00041     WvIPRouteList();
00042     
00044     void get_kernel();
00045     
00047     void set_kernel();
00048                
00050     WvIPRoute *find(const WvIPAddr &addr);
00051 };
00052 
00053 
00054 #endif // __WVIPROUTE_H