Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

wvipfirewall.h

Go to the documentation of this file.
00001 /*
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  * 
00005  * WvIPFirewall is an extremely simple hackish class that handles the Linux
00006  * 2.1 "ipchains" firewall.  Someday, this might be rewritten and much
00007  * improved.
00008  */
00009 #ifndef __WVIPFIREWALL_H
00010 #define __WVIPFIREWALL_H
00011 
00012 #include "wvlinklist.h"
00013 #include "wvaddr.h"
00014 
00015 
00016 
00017 DeclareWvList(WvIPPortAddr);
00018 
00022 class WvIPFirewall
00023 {
00024     class Redir
00025     {
00026     public:
00027         WvIPPortAddr src;
00028         int dstport;
00029         
00030         Redir(const WvIPPortAddr &_src, int _dstport) : src(_src)
00031             { dstport = _dstport; }
00032     };
00033 
00034     DeclareWvList(Redir);
00035 
00036     RedirList redirs;
00037     WvIPPortAddrList addrs;
00038     
00039     WvString port_command(const char *cmd, const char *proto,
00040                           const WvIPPortAddr &addr);
00041     WvString redir_command(const char *cmd,
00042                            const WvIPPortAddr &src, int dstport);
00043     
00044 public:
00045     WvIPFirewall();
00046     ~WvIPFirewall();
00047     
00048     static bool enable;
00049     
00050     void zap();
00051     void add_port(const WvIPPortAddr &addr);
00052     void add_redir(const WvIPPortAddr &src, int dstport);
00053     void add_proto(const WvString proto);
00054     void del_port(const WvIPPortAddr &addr);
00055     void del_redir(const WvIPPortAddr &src, int dstport);
00056 };
00057 
00058 #endif // __WVIPFIREWALL_H

Generated on Sat Aug 24 21:09:34 2002 for WvStreams by doxygen1.2.15