13 #ifndef __WVIPFIREWALL_H 14 #define __WVIPFIREWALL_H 16 #include "wvinterface.h" 17 #include "wvstringlist.h" 26 virtual void zap() = 0;
28 virtual void add_redir(
const WvIPPortAddr &src,
int dstport) = 0;
29 virtual void add_redir_all(
int dstport) = 0;
30 virtual void add_redir_port_range(
const WvIPPortAddr &src_min,
37 virtual void del_redir(
const WvIPPortAddr &src,
int dstport) = 0;
38 virtual void del_redir_all(
int dstport) = 0;
39 virtual void del_redir_port_range(
const WvIPPortAddr &src_min,
66 Redir(
const WvIPPortAddr &_src,
int _dstport) : src(_src)
67 { dstport = _dstport; }
75 RedirAll(
int _dstport)
76 { dstport = _dstport; }
88 : src_min(_src_min), src_max(_src_max)
89 { dstport = _dstport; }
94 DeclareWvList(RedirAll);
95 DeclareWvList(RedirPortRange);
99 RedirAllList redir_alls;
100 RedirPortRangeList redir_port_ranges;
102 WvIPPortAddrList addrs;
105 WvString port_command(
const char *cmd,
const char *proto,
107 WvString redir_command(
const char *cmd,
109 WvString redir_port_range_command(
const char *cmd,
111 WvString redir_all_command(
const char *cmd,
int dstport);
112 WvString proto_command(
const char *cmd,
const char *proto);
113 WvString forward_command(
const char *cmd,
const char *proto,
117 const char *shutup()
const 118 {
return ignore_errors ?
" >/dev/null 2>/dev/null " :
""; }
124 static bool enable, ignore_errors;
128 virtual void add_redir(
const WvIPPortAddr &src,
int dstport);
129 virtual void add_redir_all(
int dstport);
130 virtual void add_redir_port_range(
const WvIPPortAddr &src_min,
137 virtual void del_redir(
const WvIPPortAddr &src,
int dstport);
140 virtual void del_redir_all(
int dstport);
141 virtual void del_redir_port_range(
const WvIPPortAddr &src_min,
145 #endif // __WVIPFIREWALL_H A WvFastString acts exactly like a WvString, but can take (const char *) strings without needing to a...
An IP+Port address also includes a port number, with the resulting form www.xxx.yyy.zzz:pppp.
Class to handle Linux 2.4 IPTables.
This is a WvList of WvStrings, and is a really handy way to parse strings.
WvString is an implementation of a simple and efficient printable-string class.
A WvLog stream accepts log messages from applications and forwards them to all registered WvLogRcv's...