ipseccontrollerimpl.h

00001 /***************************************************************************
00002 *   Copyright (C) 2005 by                                                 *
00003 *   Pedro J. Fernandez Ruiz    pedroj.fernandez@dif.um.es                 *
00004 *   Alejandro Perez Mendez     alejandro_perez@dif.um.es                  *
00005 *                                                                         *
00006 *   This library is free software; you can redistribute it and/or         *
00007 *   modify it under the terms of the GNU Lesser General Public            *
00008 *   License as published by the Free Software Foundation; either          *
00009 *   version 2.1 of the License, or (at your option) any later version.    *
00010 *                                                                         *
00011 *   This library is distributed in the hope that it will be useful,       *
00012 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014 *   Lesser General Public License for more details.                       *
00015 *                                                                         *
00016 *   You should have received a copy of the GNU Lesser General Public      *
00017 *   License along with this library; if not, write to the Free Software   *
00018 *   Foundation, Inc., 51 Franklin St, Fifth Floor,                        *
00019 *   Boston, MA  02110-1301  USA                                           *
00020 ***************************************************************************/
00021 #ifndef IPSECCONTROLLERIMPL_H
00022 #define IPSECCONTROLLERIMPL_H
00023 
00024 #include "runnable.h"
00025 #include "mutex.h"
00026 #include "ipaddress.h"
00027 #include "payload_tsi.h"
00028 #include "payload_tsr.h"
00029 #include "enums.h"
00030 #include "proposal.h"
00031 #include "childsa.h"
00032 #include "payload_sa.h"
00033 #include "ikesacontroller.h"
00034 
00035 
00036 namespace openikev2 {
00037 
00042     class IpsecControllerImpl : public Runnable {
00043 
00044             /****************************** ATTRIBUTES ******************************/
00045         public:
00046             string name;                    
00048             /****************************** METHODS ******************************/
00049         public:
00053             virtual void initialize() = 0;
00054 
00063             virtual bool narrowPayloadTS( const Payload_TSi & received_payload_ts_i, const Payload_TSr & received_payload_ts_r, IkeSaController& ike_sa_controller, ChildSa & child_sa ) = 0;
00064 
00072             virtual bool checkNarrowPayloadTS( const Payload_TSi & received_payload_ts_i, const Payload_TSr & received_payload_ts_r, ChildSa & child_sa ) = 0;
00073 
00081             virtual uint32_t getSpi( const IpAddress& src, const IpAddress& dst, Enums::PROTOCOL_ID protocol ) = 0;
00082 
00089             virtual void createIpsecSa( const IpAddress& src, const IpAddress& dst, const ChildSa& childsa ) = 0;
00090 
00099             virtual uint32_t deleteIpsecSa( const IpAddress& src, const IpAddress& dst, Enums::PROTOCOL_ID protocol, uint32_t spi ) = 0;
00100 
00112             virtual void createIpsecPolicy( vector<TrafficSelector*> src_sel, vector<TrafficSelector*> dst_sel, Enums::DIRECTION direction, uint32_t priority, Enums::PROTOCOL_ID ipsec_protocol, Enums::IPSEC_MODE mode, const IpAddress* src_tunnel, const IpAddress* dst_tunnel ) = 0;
00113 
00120             virtual void deleteIpsecPolicy( vector< TrafficSelector*> src_sel, vector< TrafficSelector*> dst_sel, Enums::DIRECTION direction ) = 0;
00121 
00125             virtual void flushIpsecPolicies() = 0;
00126 
00130             virtual void flushIpsecSas() = 0;
00131 
00139             void processExpire( const IpAddress& src, const IpAddress& dst, uint32_t rekeyed_spi, bool hard );
00140 
00146             virtual void updateIpsecAddresses ( const IpAddress& old_address, const IpAddress& new_address) = 0;
00147             
00148             virtual void run();
00149 
00150             virtual ~IpsecControllerImpl();
00151     };
00152 }
00153 
00154 #endif

Generated on Fri Jul 27 11:04:44 2007 for libopenikev2 by  doxygen 1.5.1