MCPcopy Create free account
hub / github.com/amule-project/amule / DecodeNodesDat

Function DecodeNodesDat

src/utils/fileview/KadFiles.cpp:168–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168void 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}

Callers 1

OnRunMethod · 0.85

Calls 6

CKadIPClass · 0.85
hexFunction · 0.85
ReadUInt32Method · 0.80
ReadUInt128Method · 0.80
ReadUInt16Method · 0.80
ReadUInt8Method · 0.80

Tested by

no test coverage detected