00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef __XVR2_NET_IPV4_ADDRESS_H__
00015 #define __XVR2_NET_IPV4_ADDRESS_H__
00016 #include<iostream>
00017 #include<xvr2/Object.h>
00018 #include<xvr2/String.h>
00019 #include<xvr2/Net/NetworkExceptions.h>
00020 #include<xvr2/Net/IPAddress.h>
00021 #include<xvr2/Net/IPv4Resolver.h>
00022 #ifdef UNIX_SOCKETS
00023 #include<sys/socket.h>
00024 #include<sys/types.h>
00025 #include<netinet/in.h>
00026 #include<netdb.h>
00027 #endif
00028
00029 namespace xvr2 {
00030 namespace Net {
00031 class IPv4Resolver;
00032
00037 class IPv4Address:public IPAddress {
00038 protected:
00041 struct ::in_addr addr;
00042 public:
00046 IPv4Address();
00057 IPv4Address(const String &ip_or_host);
00059 IPv4Address(UInt8 a, UInt8 b, UInt8 c, UInt8 d);
00064 IPv4Address(const IPv4Address &ip);
00069 IPv4Address(const struct ::in_addr *x_addr);
00074 IPv4Address(const struct ::in_addr &x_addr);
00076 ~IPv4Address();
00081 IPv4Address &operator=(const struct ::in_addr *_addr);
00086 IPv4Address &operator=(const struct ::in_addr &_addr);
00087 const struct ::in_addr *address() const;
00088 std::string toString();
00089 friend std::ostream& operator<<(std::ostream& stream, const IPv4Address &s);
00090 };
00091 };
00092 };
00093 #endif