X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Finet.h;fp=source%2Fnet%2Finet.h;h=639e64cbb1eca5ec8c9fc2e0d5247c91600adf38;hb=50e9f9ea7f7385a2c5931fca2b8fb1103078e67c;hp=0000000000000000000000000000000000000000;hpb=21c596567e3b6fd794ed6af73d304ce2bc70e58f;p=libs%2Fnet.git diff --git a/source/net/inet.h b/source/net/inet.h new file mode 100644 index 0000000..639e64c --- /dev/null +++ b/source/net/inet.h @@ -0,0 +1,34 @@ +#ifndef MSP_NET_INET_H_ +#define MSP_NET_INET_H_ + +#include "sockaddr.h" + +namespace Msp { +namespace Net { + +/** +Address class for IPv4 sockets. +*/ +class InetAddr: public SockAddr +{ +private: + unsigned char addr[4]; + unsigned port; + +public: + InetAddr(); + InetAddr(const SysAddr &); + + virtual InetAddr *copy() const { return new InetAddr(*this); } + + virtual SysAddr to_sys() const; + + virtual Family get_family() const { return INET; } + unsigned get_port() const { return port; } + virtual std::string str() const; +}; + +} // namespace Net +} // namespace Msp + +#endif