индексе пакетов по IP-адресам
pp_iter pi;
pi = packets.begin();
std::map<RAW_PACKET, PACKET_EXTRA_DATA> newPackets;
pp_iter pi;
pi = packets.begin();
std::map<RAW_PACKET, PACKET_EXTRA_DATA> newPackets;
-std::multimap<uint32_t, pp_iter> newIP2Packets;
+ip2packets.erase(ip2packets.begin(), ip2packets.end());
while (pi != packets.end())
{
//Flushing
while (pi != packets.end())
{
//Flushing
pair<pp_iter, bool> res = newPackets.insert(*pi);
if (res.second)
{
pair<pp_iter, bool> res = newPackets.insert(*pi);
if (res.second)
{
- newIP2Packets.insert(make_pair(pi->first.GetSrcIP(), res.first));
- newIP2Packets.insert(make_pair(pi->first.GetDstIP(), res.first));
+ ip2packets.insert(make_pair(pi->first.GetSrcIP(), res.first));
+ ip2packets.insert(make_pair(pi->first.GetDstIP(), res.first));
}
}
++pi;
}
swap(packets, newPackets);
}
}
++pi;
}
swap(packets, newPackets);
-swap(ip2packets, newIP2Packets);
printfd(__FILE__, "FlushAndRemove() packets: %d(rem %d) ip2packets: %d(rem %d)\n",
packets.size(),
oldPacketsSize - packets.size(),
printfd(__FILE__, "FlushAndRemove() packets: %d(rem %d) ip2packets: %d(rem %d)\n",
packets.size(),
oldPacketsSize - packets.size(),