Back to index

natlog  0.91.0
Classes | Public Member Functions | Private Member Functions | Private Attributes
ConntrackRecord Struct Reference

#include <conntrackrecord.h>

Collaboration diagram for ConntrackRecord:
Collaboration graph
[legend]

List of all members.

Classes

struct  Record

Public Member Functions

 ~ConntrackRecord ()
size_t find (std::string const &key) const
void add (std::string const &key, FBB::Pattern const &pat)
void erase (size_t idx)
Record const * operator[] (size_t idx)
size_t size () const
std::vector< Record * >
::const_iterator 
begin () const
std::vector< Record * >
::const_iterator 
end () const

Private Member Functions

Record ** firstFree ()

Private Attributes

std::vector< Record * > d_connections

Detailed Description

Definition at line 12 of file conntrackrecord.h.


Class Documentation

struct ConntrackRecord::Record

Definition at line 14 of file conntrackrecord.h.

Collaboration diagram for ConntrackRecord::Record:
Class Members
string destIP
string destPort
string key
string musecs
string seconds
string sourceIP
string sourcePort
string viaIP
string viaPort

Constructor & Destructor Documentation

Definition at line 3 of file destructor.cc.

{
    for (auto &record: d_connections)
        delete record;
}

Member Function Documentation

void ConntrackRecord::add ( std::string const &  key,
FBB::Pattern const &  pat 
)

Definition at line 3 of file add.cc.

{
    *firstFree() = new Record 
        {key, pat[1], pat[2], pat[4], pat[5], pat[6], pat[7], pat[8], pat[9]};
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector< ConntrackRecord::Record * >::const_iterator ConntrackRecord::begin ( ) const [inline]

Definition at line 60 of file conntrackrecord.h.

{
    return d_connections.begin();
}
std::vector< ConntrackRecord::Record * >::const_iterator ConntrackRecord::end ( ) const [inline]

Definition at line 66 of file conntrackrecord.h.

{
    return d_connections.end();
}
void ConntrackRecord::erase ( size_t  idx)

Definition at line 3 of file erase.cc.

{
    delete d_connections[idx];
    imsg << "Erased #" << idx << endl;
    d_connections[idx] = 0;
}

Here is the caller graph for this function:

size_t ConntrackRecord::find ( std::string const &  key) const

Definition at line 3 of file find.cc.

{
    for (auto &record: d_connections)
    {
        if (record && record->key == key)
            return &record - &d_connections[0];
    }
    return numeric_limits<size_t>::max();
}

Here is the caller graph for this function:

Definition at line 3 of file firstfree.cc.

{
    for (auto &record: d_connections)
    {
        if (record == 0)
        {
            imsg << "At #" << (&record - &d_connections[0]) << endl;
            return &record;
        }
    }

    d_connections.push_back(0);
    imsg << "New index #" << (d_connections.size() - 1) << endl;
    return &d_connections.back();
}

Here is the caller graph for this function:

ConntrackRecord::Record const * ConntrackRecord::operator[] ( size_t  idx) [inline]

Definition at line 53 of file conntrackrecord.h.

{
    return d_connections[idx];
}
size_t ConntrackRecord::size ( ) const [inline]

Definition at line 48 of file conntrackrecord.h.

{
    return d_connections.size();
}

Member Data Documentation

std::vector<Record *> ConntrackRecord::d_connections [private]

Definition at line 29 of file conntrackrecord.h.


The documentation for this struct was generated from the following files: