diff options
Diffstat (limited to 'node/InetAddress.hpp')
-rw-r--r-- | node/InetAddress.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp index 325c2de4..74e42670 100644 --- a/node/InetAddress.hpp +++ b/node/InetAddress.hpp @@ -148,6 +148,15 @@ public: throw(); /** + * @return True if this is a loopback address + */ + inline bool isLoopback() const + throw() + { + return ((*this == LO4)||(*this == LO6)); + } + + /** * @return ASCII IP/port format representation */ std::string toString() const; @@ -287,6 +296,15 @@ public: throw(); /** + * Determine whether this address is within an ip/netmask + * + * @param ipnet IP/netmask + * @return True if this address is within this network + */ + bool within(const InetAddress &ipnet) const + throw(); + + /** * Set to null/zero */ inline void zero() throw() { memset(&_sa,0,sizeof(_sa)); } |