MCProxy

check_source Class Reference
[Proxy Instance]

Monitored the forwarding rules in the Linux kernel table. If a source is unused for a long time it can be removed.

#include "check_source.hpp"

List of all members.

Public Member Functions

bool check ()
bool init (int addr_family)
bool is_src_unused (int vif, addr_storage src_addr, addr_storage g_addr)

Member Function Documentation

bool check_source::check (  ) 

Trigger the monitoring.

Returns:
Return true on success.

References HC_LOG_TRACE, and mc_tables::refresh_routes().

bool check_source::init ( int  addr_family  ) 

Initialize check_source.

Parameters:
addr_family used IP version (AF_INET or AF_INET6)
Returns:
Return true on success.

References HC_LOG_TRACE, mc_tables::init_tables(), and mc_tables::refresh_routes().

Referenced by proxy_instance::init().

bool check_source::is_src_unused ( int  vif,
addr_storage  src_addr,
addr_storage  g_addr 
)

Check wether an unique forwarding rule is unused since the last monitoring trigger.

Parameters:
vif virutal interface of the forwarding rule
src_addr source address of the forwarding rule
g_addr multicast group address of the forwarding rule

References mc_tables::get_route(), mc_tables::get_routes_count(), mr_cache::group, HC_LOG_ERROR, HC_LOG_TRACE, mr_cache::i_if, mr_cache::origin, and mr_cache::pkts.