00001 #ifndef N2NC_NETRESOLVER_H
00002 #define N2NC_NETRESOLVER_H
00003
00004 #include "nixsys.h"
00005 #include "address.h"
00006 #include "ip4address.h"
00007 #include "ip6address.h"
00008 #include "socketaddress.h"
00009 #include "logger.h"
00010
00011 namespace n2nc {
00012 namespace net {
00013
00018 class Resolver{
00019 private:
00020 Resolver();
00021 ~Resolver();
00022 public:
00024 static Address* getAddressByFQDN(std::string &addr,bool resolve=true);
00025 static SocketAddress* getSocketAddressByService(const std::string& fqdn,const std::string& port,int type=SOCK_STREAM,int af=AF_UNSPEC,bool resolve=false);
00026 static SocketAddress* getSocketAddressByService(const std::string& fqdn,const int port,int type=SOCK_STREAM,int af=AF_UNSPEC,bool resolve=false);
00027 static SocketAddress* getSocketAddressByService(const Address& addr,const int port,int type=SOCK_STREAM);
00028 static std::string& getFQDNbyAddress(Address &addr);
00029
00030 static Address& getAddressByName(std::string &name, bool resolve=false);
00031
00032
00033 };
00034
00035 }
00036 }
00037
00038 #endif