diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-12-20 07:53:57 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-20 07:53:57 -0500 |
commit | 973a5db80851838e4516de40afe028bc10c425f0 (patch) | |
tree | 36c54954eb30c959217411f7529413f023f1e5e0 /src/trunnel/netinfo.trunnel | |
parent | 9c6283732a376b21d110f1ef95b4b2af423a8e59 (diff) | |
parent | c659603ac5a428d93ea625aa28b6b51ef9f2f9b3 (diff) | |
download | tor-973a5db80851838e4516de40afe028bc10c425f0.tar.gz tor-973a5db80851838e4516de40afe028bc10c425f0.zip |
Merge remote-tracking branch 'tor-github/pr/445'
Diffstat (limited to 'src/trunnel/netinfo.trunnel')
-rw-r--r-- | src/trunnel/netinfo.trunnel | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/trunnel/netinfo.trunnel b/src/trunnel/netinfo.trunnel new file mode 100644 index 0000000000..2c4b7a7591 --- /dev/null +++ b/src/trunnel/netinfo.trunnel @@ -0,0 +1,24 @@ +// Warning: make sure these values are consistent with RESOLVED_TYPE_* +// constants in Tor code and numbers in Section 6.4 of tor-spec.txt. + +const NETINFO_ADDR_TYPE_IPV4 = 4; +const NETINFO_ADDR_TYPE_IPV6 = 6; + +struct netinfo_addr { + u8 addr_type; + u8 len; + union addr[addr_type] with length len { + NETINFO_ADDR_TYPE_IPV4: u32 ipv4; + NETINFO_ADDR_TYPE_IPV6: u8 ipv6[16]; + default: ignore; + }; + +} + +struct netinfo_cell { + u32 timestamp; + struct netinfo_addr other_addr; + u8 n_my_addrs; + struct netinfo_addr my_addrs[n_my_addrs]; +} + |