00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00040 protected:
00041 static auto_ptr<NetworkControllerImpl> implementation;
00043
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