summaryrefslogtreecommitdiff
path: root/node/InetAddress.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-13 10:03:04 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-13 10:03:04 -0700
commit0b354803f3ea0eecd046a37c51d4d2d78934b502 (patch)
treef5c2afa2c57b0726047a43b6b4c681d9b161999a /node/InetAddress.hpp
parent0b9524f23d96ad4752a2a2cace92bc1c0306b1b6 (diff)
downloadinfinitytier-0b354803f3ea0eecd046a37c51d4d2d78934b502.tar.gz
infinitytier-0b354803f3ea0eecd046a37c51d4d2d78934b502.zip
Clean up some YAGNI issues with implementation of GitHub issue #180, and make best path choice aware of path rank.
Diffstat (limited to 'node/InetAddress.hpp')
-rw-r--r--node/InetAddress.hpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index 35fd4314..e3537ce0 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -63,17 +63,20 @@ struct InetAddress : public sockaddr_storage
/**
* IP address scope
+ *
+ * Note that these values are in ascending order of path preference and
+ * MUST remain that way or Path must be changed to reflect.
*/
enum IpScope
{
- IP_SCOPE_NONE = 0, // not an IP address -- also the number of classes, must be last entry
- IP_SCOPE_LINK_LOCAL = 1, // 169.254.x.x, IPv6 LL
- IP_SCOPE_PRIVATE = 2, // 10.x.x.x, etc.
- IP_SCOPE_PSEUDOPRIVATE = 3, // 28.x.x.x, etc. -- unofficially unrouted IP blocks often "bogarted"
- IP_SCOPE_SHARED = 4, // 100.64.0.0/10, shared space for e.g. carrier-grade NAT
- IP_SCOPE_GLOBAL = 5, // globally routable IP address (all others)
- IP_SCOPE_LOOPBACK = 6, // 127.0.0.1
- IP_SCOPE_MULTICAST = 7 // 224.0.0.0 and other multicast IPs
+ IP_SCOPE_NONE = 0, // NULL or not an IP address
+ IP_SCOPE_MULTICAST = 1, // 224.0.0.0 and other V4/V6 multicast IPs
+ IP_SCOPE_LOOPBACK = 2, // 127.0.0.1, ::1, etc.
+ IP_SCOPE_PSEUDOPRIVATE = 3, // 28.x.x.x, etc. -- unofficially unrouted IPv4 blocks often "bogarted"
+ IP_SCOPE_GLOBAL = 4, // globally routable IP address (all others)
+ IP_SCOPE_LINK_LOCAL = 5, // 169.254.x.x, IPv6 LL
+ IP_SCOPE_SHARED = 6, // 100.64.0.0/10, shared space for e.g. carrier-grade NAT
+ IP_SCOPE_PRIVATE = 7 // 10.x.x.x, 192.168.x.x, etc.
};
InetAddress() throw() { memset(this,0,sizeof(InetAddress)); }