00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CONEXUS_IPV4IP_H
00020 #define CONEXUS_IPV4IP_H
00021
00022 #include <conexus/ip.h>
00023 #include <conexus/ipv4_address.h>
00024
00029 namespace Conexus
00030 {
00031
00032 namespace IPv4
00033 {
00055 class IP : public Conexus::IP
00056 {
00057
00058 protected:
00059
00064 IP( int type = -1, int protocol = 0 );
00065
00066 public:
00068 typedef ConexusPointer<IP> pointer;
00069
00070 virtual ~IP() throw();
00071
00075 virtual void bind() throw ( bind_exception );
00076
00077 virtual void bind( const Conexus::Address& a ) throw ( bind_exception );
00078
00079 virtual void connect() throw ( connect_exception );
00080
00081 virtual void connect( const Address& a ) throw ( connect_exception );
00082
00083 virtual Address& local_address();
00084
00085 virtual Address& remote_address();
00086
00087 virtual IPAddress& generic_local_address();
00088
00089 virtual IPAddress& generic_remote_address();
00090
00091 virtual void set_remote_address( const Address& addr );
00092
00093 virtual void set_remote_address( uint32_t addr, uint16_t port );
00094
00095 virtual void set_remote_address( const std::string& addr, uint16_t port );
00096
00097 virtual void unset_remote_address();
00098
00099 virtual void set_local_address( const Address& addr );
00100
00101 virtual void set_local_address( uint32_t addr, uint16_t port );
00102
00103 virtual void set_local_address( const std::string& addr, uint16_t port );
00104
00105 protected:
00106 Address m_local_address;
00107 Address m_remote_address;
00108 bool m_remote_address_set;
00109
00110 virtual void on_local_address_changed( );
00111 virtual void on_remote_address_changed( );
00112
00113 void on_local_address_changed_proxy( );
00114 void on_remote_address_changed_proxy( );
00115 };
00116
00117 }
00118
00119 }
00120
00121 #endif