| 166 | } |
| 167 | |
| 168 | void DecodeNodesDat(const CFileDataIO& file) |
| 169 | { |
| 170 | uint32_t numContacts = file.ReadUInt32(); |
| 171 | uint32_t fileVersion = 0; |
| 172 | |
| 173 | cout << "NumContacts #1 : " << numContacts << '\n'; |
| 174 | if (numContacts == 0) { |
| 175 | cout << "FileVersion : " << (fileVersion = file.ReadUInt32()) << '\n'; |
| 176 | if (fileVersion == 3) { |
| 177 | cout << "BootstrapEdition: " << file.ReadUInt32() << '\n'; |
| 178 | } |
| 179 | if (fileVersion >= 1 && fileVersion <= 3) { |
| 180 | cout << "NumContacts #2 : " << (numContacts = file.ReadUInt32()) << '\n'; |
| 181 | } |
| 182 | } |
| 183 | for (uint32_t i = 0; i < numContacts; i++) { |
| 184 | cout << wxString::Format("#%u\tID : ", i) << file.ReadUInt128(); |
| 185 | cout << "\n\tIP : " << CKadIP(file.ReadUInt32()); |
| 186 | cout << "\n\tUDP Port : " << file.ReadUInt16(); |
| 187 | cout << "\n\tTCP Port : " << file.ReadUInt16(); |
| 188 | if (fileVersion >= 1) { |
| 189 | cout << "\n\tVersion : "; |
| 190 | } else { |
| 191 | cout << "\n\tType : "; |
| 192 | } |
| 193 | cout << (unsigned)file.ReadUInt8(); |
| 194 | if (fileVersion >= 2) { |
| 195 | cout << "\n\tUDP Key : { " << hex(file.ReadUInt32()); |
| 196 | cout << ", " << CKadIP(file.ReadUInt32()); |
| 197 | cout << " }\n\tVerified : " << (file.ReadUInt8() != 0 ? "true" : "false"); |
| 198 | } |
| 199 | cout << '\n'; |
| 200 | } |
| 201 | } |
no test coverage detected