summaryrefslogtreecommitdiff
path: root/node/InetAddress.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-12 10:47:50 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-12 10:47:50 -0800
commit8ac411a9e41ce62a6a6340f693ba70a59550df75 (patch)
tree8468938907b4d2773c595b41c441d31fdd65def1 /node/InetAddress.hpp
parent0940d673db84794f6e94ecb976d27f6347e446f6 (diff)
downloadinfinitytier-8ac411a9e41ce62a6a6340f693ba70a59550df75.tar.gz
infinitytier-8ac411a9e41ce62a6a6340f693ba70a59550df75.zip
Stashing utun work for OSX -- abandoning for now since utun excludes mDNS among other issues.
Diffstat (limited to 'node/InetAddress.hpp')
-rw-r--r--node/InetAddress.hpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index 74efc943..2573e694 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -303,17 +303,27 @@ struct InetAddress : public sockaddr_storage
/**
* Construct a full netmask as an InetAddress
+ *
+ * @return Netmask such as 255.255.255.0 if this address is /24 (port field will be unchanged)
*/
- InetAddress netmask() const
- throw();
+ InetAddress netmask() const;
/**
* Constructs a broadcast address from a network/netmask address
*
+ * This is only valid for IPv4 and will return a NULL InetAddress for other
+ * address families.
+ *
* @return Broadcast address (only IP portion is meaningful)
*/
- InetAddress broadcast() const
- throw();
+ InetAddress broadcast() const;
+
+ /**
+ * Return the network -- a.k.a. the IP ANDed with the netmask
+ *
+ * @return Network e.g. 10.0.1.0/24 from 10.0.1.200/24
+ */
+ InetAddress network() const;
/**
* @return True if this is an IPv4 address