| 1201 | } |
| 1202 | |
| 1203 | bool RouterInfo::IsSameSubnet (const RouterInfo& other) const |
| 1204 | { |
| 1205 | auto transports = m_SupportedTransports & other.m_SupportedTransports; |
| 1206 | if (!transports) return false; |
| 1207 | auto addresses1 = GetAddresses (), addresses2 = other.GetAddresses ();; |
| 1208 | for (int i = 0; i < eNumTransports; i++) |
| 1209 | if (i != eNTCP2V6MeshIdx && (transports & (1 << i))) |
| 1210 | { |
| 1211 | auto addr1 = (*addresses1)[i], addr2 = (*addresses2)[i]; |
| 1212 | if (addr1 && addr2 && !addr1->host.is_unspecified () && !addr2->host.is_unspecified ()) |
| 1213 | return addr1->IsSameSubnet (*addr2); // first adddess with IPs |
| 1214 | } |
| 1215 | return false; |
| 1216 | } |
| 1217 | |
| 1218 | void LocalRouterInfo::CreateBuffer (const PrivateKeys& privateKeys) |
| 1219 | { |
no test coverage detected