Vasil Dimov
bcfebb6d55
net: save the network type explicitly in CNetAddr
...
Before this change, we would analyze the contents of `CNetAddr::ip[16]`
in order to tell which type is an address. Change this by introducing a
new member `CNetAddr::m_net` that explicitly tells the type of the
address.
This is necessary because in BIP155 we will not be able to tell the
address type by just looking at its raw representation (e.g. both TORv3
and I2P are "seemingly random" 32 bytes).
As a side effect of this change we no longer need to store IPv4
addresses encoded as IPv6 addresses - we can store them in proper 4
bytes (will be done in a separate commit). Also the code gets
somewhat simplified - instead of
`memcmp(ip, pchIPv4, sizeof(pchIPv4)) == 0` we can use
`m_net == NET_IPV4`.
Co-authored-by: Carl Dong <contact@carldong.me>
2020-07-27 15:13:24 +02:00
..
2020-07-15 15:35:11 +02:00
2020-05-20 08:27:07 -04:00
2020-05-26 16:05:51 +02:00
2020-01-28 17:00:01 +01:00
2020-06-29 11:31:17 +08:00
2020-06-27 11:49:28 -04:00
2020-07-09 13:07:37 +02:00
2020-01-28 16:59:07 +01:00
2020-04-30 18:02:04 +08:00
2020-07-08 19:16:33 +03:00
2020-07-05 13:46:38 +03:00
2020-05-20 07:30:29 -04:00
2020-07-16 09:55:19 +02:00
2020-07-15 19:20:21 +02:00
2020-07-01 17:24:46 -04:00
2020-06-09 13:39:09 -07:00
2020-05-29 17:22:07 -04:00
2020-07-27 15:13:24 +02:00
2020-02-09 07:44:29 -08:00
2020-07-11 15:02:07 +02:00
2020-07-14 16:21:01 +02:00
2020-04-16 13:33:09 -04:00
2020-07-06 03:52:37 +02:00
2020-06-22 12:12:22 +02:00
2020-07-03 20:43:55 -07:00
2020-05-06 14:59:28 +02:00
2020-03-04 14:24:19 +01:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-07-08 21:44:45 +08:00
2020-07-03 20:43:55 -07:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-10-16 08:56:57 -07:00
2019-09-05 13:25:11 +12:00
2020-07-05 16:39:17 +02:00
2020-04-16 13:33:09 -04:00
2020-05-25 12:36:48 -04:00
2020-06-27 11:49:28 -04:00
2020-05-28 09:55:39 +03:00
2020-05-28 09:55:39 +03:00
2020-04-20 14:57:48 +00:00
2020-05-26 17:27:15 -04:00
2020-06-21 06:41:55 -04:00
2020-05-20 07:30:29 -04:00
2019-12-30 10:42:20 +13:00
2020-04-16 13:33:09 -04:00
2020-06-15 18:22:52 +09:00
2020-04-16 13:33:09 -04:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-04-03 16:29:26 +02:00
2020-04-16 13:33:09 -04:00
2020-05-04 19:53:58 +03:00
2020-05-03 18:42:14 +00:00
2020-05-06 13:15:28 +02:00
2019-12-30 10:42:20 +13:00
2020-04-16 13:33:09 -04:00
2019-12-30 10:42:20 +13:00
2020-05-22 01:40:31 +09:00
2020-06-28 14:20:00 -04:00
2020-04-08 14:45:27 +00:00
2019-12-30 10:42:20 +13:00
2020-07-08 14:26:14 +03:00
2020-05-01 07:39:00 -04:00
2020-05-20 07:30:29 -04:00
2020-06-16 15:15:46 -04:00
2019-12-30 10:42:20 +13:00
2020-05-21 06:53:39 -04:00
2020-05-13 16:20:13 -04:00
2020-06-27 11:49:28 -04:00
2020-04-16 13:33:09 -04:00
2020-04-16 13:33:09 -04:00
2020-07-14 16:33:01 +02:00
2020-05-13 16:20:13 -04:00
2019-12-30 10:42:20 +13:00
2020-06-10 18:29:33 -07:00
2019-12-30 10:42:20 +13:00
2020-06-07 17:03:49 +02:00
2020-05-28 09:54:24 +03:00
2020-06-27 11:49:35 -04:00
2020-04-29 00:31:41 -07:00
2020-01-28 17:01:48 +01:00
2020-05-12 18:03:39 +03:00
2020-04-01 12:49:15 +02:00
2020-06-29 18:49:13 +01:00
2019-11-21 21:13:08 +01:00
2020-04-05 01:01:13 +02:00
2020-04-05 10:46:24 +08:00
2020-07-15 14:45:12 +02:00
2020-04-16 13:33:09 -04:00
2020-03-30 16:09:51 -07:00
2020-03-30 16:09:51 -07:00
2020-06-15 08:08:19 -04:00
2020-06-15 08:08:19 -04:00
2020-07-09 12:48:05 +02:00
2020-07-09 12:48:05 +02:00
2020-07-16 08:07:25 +02:00
2020-07-14 10:24:43 +01:00
2019-10-29 11:30:12 +02:00
2020-07-14 10:24:43 +01:00
2020-07-14 10:24:43 +01:00
2020-07-27 15:13:24 +02:00
2020-07-27 15:13:24 +02:00
2020-06-22 12:12:22 +02:00
2020-01-08 12:35:59 +00:00
2020-05-11 00:20:57 +02:00
2020-06-27 11:49:28 -04:00
2020-05-05 04:45:59 +03:00
2019-12-30 10:42:20 +13:00
2020-07-01 18:03:12 -04:00
2020-07-01 18:02:38 -04:00
2020-04-30 18:02:03 +08:00
2020-06-04 17:16:49 +02:00
2020-07-10 22:14:18 +01:00
2020-06-24 16:32:19 -04:00
2020-06-24 16:32:19 -04:00
2019-12-30 10:42:20 +13:00
2020-06-10 17:35:43 +03:00
2020-05-15 08:58:49 -04:00
2020-04-30 09:19:14 -04:00
2020-04-16 13:33:09 -04:00
2019-11-12 14:50:44 -08:00
2020-06-24 18:41:45 +02:00
2020-06-21 06:02:59 -04:00
2020-06-21 06:02:59 -04:00
2020-06-22 12:12:22 +02:00
2020-06-26 13:49:52 -07:00
2019-12-30 10:42:20 +13:00
2020-06-25 21:27:34 +03:00
2020-06-11 15:49:39 +03:00
2019-12-30 10:42:20 +13:00
2020-06-11 15:49:39 +03:00
2020-06-27 11:49:28 -04:00
2019-12-06 10:02:08 +01:00
2020-01-08 12:35:59 +00:00
2019-12-30 10:42:20 +13:00
2020-06-27 11:49:28 -04:00
2020-01-15 02:18:00 +07:00
2020-05-15 09:23:55 -04:00
2020-05-25 11:27:07 -07:00
2020-01-23 16:35:08 -05:00
2020-01-23 16:35:08 -05:00
2020-04-16 13:33:09 -04:00
2020-07-14 16:15:07 +02:00
2020-07-11 19:41:24 +02:00
2020-05-22 16:30:07 -04:00
2020-05-22 16:30:07 -04:00
2020-07-10 22:14:18 +01:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2019-12-30 10:42:20 +13:00
2020-06-10 15:01:20 +03:00
2020-06-10 15:01:20 +03:00