1 /* 2 3 Firewall Builder 4 5 Copyright (C) 2000 NetCitadel, LLC 6 7 Author: Vadim Kurland vadim@fwbuilder.org 8 9 $Id$ 10 11 12 This program is free software which we release under the GNU General Public 13 License. You may redistribute and/or modify this program under the terms 14 of that license as published by the Free Software Foundation; either 15 version 2 of the License, or (at your option) any later version. 16 17 This program is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 To get a copy of the GNU General Public License, write to the Free Software 23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 25 */ 26 27 #ifndef __POLICY_HH_FLAG__ 28 #define __POLICY_HH_FLAG__ 29 30 #include "fwbuilder/FWObject.h" 31 #include "fwbuilder/RuleSet.h" 32 33 namespace libfwbuilder 34 { 35 36 class Policy : public RuleSet 37 { 38 public: 39 40 Policy(); 41 virtual ~Policy(); 42 43 DECLARE_FWOBJECT_SUBTYPE(Policy); 44 45 DECLARE_DISPATCH_METHODS(Policy); 46 47 /* the following methods provide proper typization */ getRuleByNum(int n)48 PolicyRule* getRuleByNum(int n) { 49 return PolicyRule::cast(RuleSet::getRuleByNum(n)); 50 } insertRuleAtTop()51 PolicyRule* insertRuleAtTop() { 52 return PolicyRule::cast(RuleSet::insertRuleAtTop()); 53 } insertRuleBefore(int n)54 PolicyRule* insertRuleBefore(int n){ 55 return PolicyRule::cast(RuleSet::insertRuleBefore(n)); 56 } appendRuleAfter(int n)57 PolicyRule* appendRuleAfter(int n){ 58 return PolicyRule::cast(RuleSet::appendRuleAfter(n)); 59 } appendRuleAtBottom()60 PolicyRule* appendRuleAtBottom(){ 61 return PolicyRule::cast(RuleSet::appendRuleAtBottom()); 62 } 63 64 virtual Rule* createRule(); 65 66 }; 67 68 } 69 70 #endif //__POLICY_HH_FLAG__ 71