diff options
Diffstat (limited to 'src/trunnel/netinfo.trunnel')
-rw-r--r-- | src/trunnel/netinfo.trunnel | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/trunnel/netinfo.trunnel b/src/trunnel/netinfo.trunnel new file mode 100644 index 0000000000..9c80fcc533 --- /dev/null +++ b/src/trunnel/netinfo.trunnel @@ -0,0 +1,21 @@ +const NETINFO_ADDR_TYPE_IPV4 = 4; +const NETINFO_ADDR_TYPE_IPV6 = 6; + +struct netinfo_addr { + u8 addr_type IN [NETINFO_ADDR_TYPE_IPV4, NETINFO_ADDR_TYPE_IPV6]; + u8 len IN [4, 16]; + union addr[addr_type] { + NETINFO_ADDR_TYPE_IPV4: u32 ipv4; + NETINFO_ADDR_TYPE_IPV6: u8 ipv6[16]; + default: fail; + }; + +} + +struct netinfo_cell { + u32 timestamp; + struct netinfo_addr other_addr; + u8 n_my_addrs; + struct netinfo_addr my_addrs[n_my_addrs]; +} + |