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
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);
-swap(ip2packets, newIP2Packets);
printfd(__FILE__, "FlushAndRemove() packets: %d(rem %d) ip2packets: %d(rem %d)\n",
packets.size(),
oldPacketsSize - packets.size(),
uint32_t uip = user->GetCurrIP();
pair<ip2p_iter, ip2p_iter> pi;
-STG_LOCKER(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex, __FILE__, __LINE__);
// Find all packets with IP belongs to this user
pi = ip2packets.equal_range(uip);
printfd(__FILE__, "DelUser: %s \n", inet_ntostring(uip).c_str());
pair<ip2p_iter, ip2p_iter> pi;
-STG_LOCKER(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex, __FILE__, __LINE__);
pi = ip2packets.equal_range(uip);
while (pi.first != pi.second)