Back to index

natlog  0.91.0
firstfree.cc
Go to the documentation of this file.
00001 #include "conntrackrecord.ih"
00002 
00003 ConntrackRecord::Record **ConntrackRecord::firstFree()
00004 {
00005     for (auto &record: d_connections)
00006     {
00007         if (record == 0)
00008         {
00009             imsg << "At #" << (&record - &d_connections[0]) << endl;
00010             return &record;
00011         }
00012     }
00013 
00014     d_connections.push_back(0);
00015     imsg << "New index #" << (d_connections.size() - 1) << endl;
00016     return &d_connections.back();
00017 }
00018