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

Function DecodeKeyIndexDat

src/utils/fileview/KadFiles.cpp:87–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void DecodeKeyIndexDat(const CFileDataIO& file)
88{
89 uint32_t version;
90 uint32_t numKeys;
91 uint32_t numSource;
92 uint32_t numName;
93 uint8_t tagCount;
94
95 cout << "Version : " << (version = file.ReadUInt32());
96 cout << "\nSaveTime: " << CTimeT(file.ReadUInt32());
97 cout << "\nID : " << file.ReadUInt128();
98 cout << "\nnumKeys : " << (numKeys = file.ReadUInt32()) << '\n';
99 for (uint32_t ik = 0; ik < numKeys; ik++) {
100 Kademlia::CUInt128 keyID = file.ReadUInt128();
101 bool identified = false;
102 cout << "\tKeyID : " << keyID;
103 cout << "\n\tnumSource: " << (numSource = file.ReadUInt32()) << '\n';
104 for (uint32_t is = 0; is < numSource; is++) {
105 cout << "\t\tSourceID: " << file.ReadUInt128();
106 cout << "\n\t\tnumName : " << (numName = file.ReadUInt32()) << '\n';
107 for (uint32_t iN = 0; iN < numName; iN++) {
108 cout << "\t\t\tLifeTime : " << CTimeT(file.ReadUInt32()) << '\n';
109 if (version >= 3) {
110 uint32_t count;
111 cout << "\t\t\tnameCount: " << (count = file.ReadUInt32()) << '\n';
112 for (uint32_t i = 0; i < count; i++) {
113 wxString name = file.ReadString(true, 2);
114 cout << "\t\t\t\t{ " << MakePrintableString(name);
115 cout << ", " << file.ReadUInt32() << " }\n";
116 wxString keyword;
117 if (!identified && IdentifyKeyword(keyID, name, keyword)) {
118 cout << "\tKeyword: " << MakePrintableString(keyword) << '\n';
119 identified = true;
120 }
121 }
122 cout << "\t\t\tipCount : " << (count = file.ReadUInt32()) << '\n';
123 for (uint32_t i = 0; i < count; i++) {
124 cout << "\t\t\t\t{ " << CKadIP(file.ReadUInt32());
125 cout << ", " << CTimeT(file.ReadUInt32()) << " }\n";
126 }
127 }
128 cout << "\t\t\ttagCount : " << (uint32)(tagCount = file.ReadUInt8()) << '\n';
129 for (uint32_t it = 0; it < tagCount; it++) {
130 CTag *tag = file.ReadTag();
131 cout << "\t\t\t\t" << *tag << '\n';
132 delete tag;
133 }
134 }
135 }
136 }
137}
138
139void DecodeSourceIndexDat(const CFileDataIO& file)
140{

Callers 1

OnRunMethod · 0.85

Calls 9

CTimeTClass · 0.85
MakePrintableStringFunction · 0.85
IdentifyKeywordFunction · 0.85
CKadIPClass · 0.85
ReadUInt32Method · 0.80
ReadUInt128Method · 0.80
ReadUInt8Method · 0.80
ReadTagMethod · 0.80
ReadStringMethod · 0.45

Tested by

no test coverage detected