xorp

firewall_set.hh

00001 // -*- c-basic-offset: 4; tab-width: 8; indent-tabs-mode: t -*-
00002 
00003 // Copyright (c) 2008-2009 XORP, Inc.
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, Version 2, June
00007 // 1991 as published by the Free Software Foundation. Redistribution
00008 // and/or modification of this program under the terms of any other
00009 // version of the GNU General Public License is not permitted.
00010 // 
00011 // This program is distributed in the hope that it will be useful, but
00012 // WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details,
00014 // see the GNU General Public License, Version 2, a copy of which can be
00015 // found in the XORP LICENSE.gpl file.
00016 // 
00017 // XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
00018 // http://xorp.net
00019 
00020 // $XORP: xorp/fea/firewall_set.hh,v 1.5 2008/10/02 21:56:46 bms Exp $
00021 
00022 #ifndef __FEA_FIREWALL_SET_HH__
00023 #define __FEA_FIREWALL_SET_HH__
00024 
00025 #include "firewall_entry.hh"
00026 #include "iftree.hh"
00027 #include "fea_data_plane_manager.hh"
00028 
00029 class FirewallManager;
00030 
00031 
00032 class FirewallSet {
00033 public:
00040     FirewallSet(FeaDataPlaneManager& fea_data_plane_manager)
00041     : _is_running(false),
00042       _firewall_manager(fea_data_plane_manager.firewall_manager()),
00043       _fea_data_plane_manager(fea_data_plane_manager)
00044     {}
00045 
00049     virtual ~FirewallSet() {}
00050 
00056     FirewallManager&    firewall_manager() { return _firewall_manager; }
00057 
00063     FeaDataPlaneManager& fea_data_plane_manager() { return _fea_data_plane_manager; }
00064 
00070     virtual bool is_running() const { return _is_running; }
00071 
00078     virtual int start(string& error_msg) = 0;
00079     
00086     virtual int stop(string& error_msg) = 0;
00087 
00097     virtual int update_entries(const list<FirewallEntry>& added_entries,
00098                    const list<FirewallEntry>& replaced_entries,
00099                    const list<FirewallEntry>& deleted_entries,
00100                    string& error_msg) = 0;
00101 
00110     virtual int set_table4(const list<FirewallEntry>& firewall_entry_list,
00111                string& error_msg) = 0;
00112 
00119     virtual int delete_all_entries4(string& error_msg) = 0;
00120 
00129     virtual int set_table6(const list<FirewallEntry>& firewall_entry_list,
00130                string& error_msg) = 0;
00131 
00138     virtual int delete_all_entries6(string& error_msg) = 0;
00139 
00140 protected:
00141     // Misc other state
00142     bool    _is_running;
00143 
00144 private:
00145     FirewallManager&        _firewall_manager;
00146     FeaDataPlaneManager&    _fea_data_plane_manager;
00147 };
00148 
00149 #endif // __FEA_FIREWALL_SET_HH__
 All Classes Namespaces Functions Variables Typedefs Enumerations