summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-26 10:42:30 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-10-26 10:42:30 -0700
commit3ce5ad9e2c1a31e1a3cc34f0ac8d950e4f0cf7b4 (patch)
treeea166e4d16d98e3d5bb88f1b3f7c2a136d2bb545 /node
parentd2b1dfe42465680e10e7971ba99279e5cacad207 (diff)
downloadinfinitytier-3ce5ad9e2c1a31e1a3cc34f0ac8d950e4f0cf7b4.tar.gz
infinitytier-3ce5ad9e2c1a31e1a3cc34f0ac8d950e4f0cf7b4.zip
For forward compatibility, add minimal parse for some future physical address types.
Diffstat (limited to 'node')
-rw-r--r--node/InetAddress.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp
index 50db272a..ecafcf51 100644
--- a/node/InetAddress.hpp
+++ b/node/InetAddress.hpp
@@ -409,6 +409,16 @@ struct InetAddress : public sockaddr_storage
switch(b[p++]) {
case 0:
return 1;
+ case 0x01:
+ // TODO: Ethernet address (but accept for forward compatibility)
+ return 7;
+ case 0x02:
+ // TODO: Bluetooth address (but accept for forward compatibility)
+ return 7;
+ case 0x03:
+ // TODO: Other address types (but accept for forward compatibility)
+ // These could be extended/optional things like AF_UNIX, LTE Direct, shared memory, etc.
+ return (unsigned int)(b.template at<uint16_t>(p) + 3); // other addresses begin with 16-bit non-inclusive length
case 0x04:
ss_family = AF_INET;
memcpy(&(reinterpret_cast<struct sockaddr_in *>(this)->sin_addr.s_addr),b.field(p,4),4); p += 4;