#include <filter.h>
Public Types | |
enum | status_t { FILTER_CONTINUE = 0, FILTER_RETURN, FILTER_DROP } |
Public Member Functions | |
virtual status_t | egress (void *inbuf, void *outbuf, size_t inlen, size_t *outlen)=0 |
virtual status_t | ingress (void *inbuf, void *outbuf, size_t inlen, size_t *outlen)=0 |
virtual int | setSessionKey (security::BlowFish::key_t *key) |
virtual int | setPKM (n2nc::PacketManager *pkm) |
virtual size_t | getMaxOverHead () |
std::string | toString () |
Static Public Member Functions | |
static Filter * | load_filter (const std::string filename) |
static int | free_filter (Filter *filter) |
Protected Member Functions | |
Filter (std::string name, std::string description) | |
Protected Attributes | |
std::string | m_name |
std::string | m_description |
bool | m_isenabled |
size_t | m_maxoverhead |
std::string | m_filename |
void * | this_handle |
security::BlowFish::key_t * | m_skey |
n2nc::PacketManager * | m_pkm |
n2nc::net::Socket * | m_com_sock |
extern "C" static Filter* get_istance(void *argv,int argc); extern "C" static int free_istance();
Definition at line 28 of file filter.h.
n2nc::Filter::Filter | ( | std::string | name, | |
std::string | description | |||
) | [inline, protected] |
Each filter has to set its name and description by constructor call.
virtual status_t n2nc::Filter::egress | ( | void * | inbuf, | |
void * | outbuf, | |||
size_t | inlen, | |||
size_t * | outlen | |||
) | [pure virtual] |
Outgoing traffic goes through egress hook.
Implemented in n2nc::Filter_dummy, n2nc::FilterBlowFish, n2nc::FilterBZ2, and n2nc::FilterLZO.
Referenced by n2nc::FilterAdapter::send().
virtual status_t n2nc::Filter::ingress | ( | void * | inbuf, | |
void * | outbuf, | |||
size_t | inlen, | |||
size_t * | outlen | |||
) | [pure virtual] |
Ingoing traffic goes through ingress hook
Implemented in n2nc::Filter_dummy, n2nc::FilterBlowFish, n2nc::FilterBZ2, and n2nc::FilterLZO.
Referenced by n2nc::FilterAdapter::recv().
virtual int n2nc::Filter::setSessionKey | ( | security::BlowFish::key_t * | key | ) | [inline, virtual] |
virtual int n2nc::Filter::setPKM | ( | n2nc::PacketManager * | pkm | ) | [inline, virtual] |
std::string n2nc::Filter::toString | ( | ) | [inline] |
Prints the filter name and description..
static Filter* n2nc::Filter::load_filter | ( | const std::string | filename | ) | [inline, static] |
Public factory method to istanciates a new Filter module by filename
Definition at line 94 of file filter.h.
References m_filename, and this_handle.
static int n2nc::Filter::free_filter | ( | Filter * | filter | ) | [inline, static] |
Public denstructor method.
Definition at line 112 of file filter.h.
References this_handle.