networkcontroller.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 NETWORKCONTROLLER_H
00022 #define NETWORKCONTROLLER_H
00023 
00024 #include "networkcontrollerimpl.h"
00025 #include "payload_conf.h"
00026 #include "ikesacontroller.h"
00027 #include "payload_eap.h"
00028 
00029 
00030 namespace openikev2 {
00031 
00037     class NetworkController {
00038 
00039             /****************************** ATTRIBUTES ******************************/
00040         protected:
00041             static auto_ptr<NetworkControllerImpl> implementation;       
00043             /****************************** METHODS ******************************/
00044         public:
00049             static void setImplementation(auto_ptr<NetworkControllerImpl> impl);
00050             
00057             static auto_ptr<IpAddress> getIpAddress( uint16_t port );
00058 
00065             static auto_ptr<IpAddress> getIpAddress( string address, uint16_t port );
00066 
00074             static auto_ptr<IpAddress> getIpAddress( uint16_t family, auto_ptr<ByteArray> data, uint16_t port=0 );
00075 
00081             static auto_ptr<UdpSocket> getUdpSocket( uint16_t port );
00082 
00088             static auto_ptr<EapClientController> getEapClientController( Payload_EAP::EAP_TYPE eap_type );
00089 
00095             static auto_ptr<EapServerController> getEapServerController(const ID&  initiator_id);
00096 
00103             static auto_ptr<Payload_CONF> processConfigurationRequest( IkeSaController& ike_sa_controller, ChildSa& child_sa, Payload_CONF& configuration_request );
00104 
00110             static auto_ptr<Payload_CONF> createConfigurationRequest( IkeSaController& ike_sa_controller );
00111 
00118             static void processConfigurationResponse( IkeSaController& ike_sa_controller, ChildSa& child_sa, Payload_CONF& configuration_response );
00119 
00124             static void unsetConfiguration( IkeSaController& ike_sa_controller );
00125 
00132             static void addNotifyRequests( Message& message, IkeSaController& ike_sa_controller, ChildSa* child_sa );
00133 
00139             static NotifyController* getNotifyController( uint16_t type );
00140 
00146             static void registerNotifyController( uint16_t type, auto_ptr<NotifyController> notify_controller );
00147 
00153             static void sendMessage( Message &message, Cipher* cipher );
00154 
00155             static void startThread();
00156 
00161             static void addSrcAddress( auto_ptr<IpAddress> new_src_address );
00162 
00167             static void removeSrcAddress( const IpAddress& src_address );
00168             
00172             static void close();
00173     };
00174 };
00175 #endif

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